avformat/cinedec: add support for additional Bayer CFA patterns for Phantom CINE file format
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
d5f4a55123
commit
9537d91e8f
1 changed files with 22 additions and 0 deletions
|
|
@ -52,6 +52,8 @@ enum {
|
|||
CFA_VRIV6 = 2, /**< BGGR/GRBG */
|
||||
CFA_BAYER = 3, /**< GB/RG */
|
||||
CFA_BAYERFLIP = 4, /**< RG/GB */
|
||||
CFA_BAYERFLIPB = 5, /**< GR/BG */
|
||||
CFA_BAYERFLIPH = 6, /**< BG/GR */
|
||||
};
|
||||
|
||||
#define CFA_TLGRAY 0x80000000U
|
||||
|
|
@ -237,6 +239,26 @@ static int cine_read_header(AVFormatContext *avctx)
|
|||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
case CFA_BAYERFLIPB:
|
||||
if (biBitCount == 8) {
|
||||
st->codecpar->format = AV_PIX_FMT_BAYER_GRBG8;
|
||||
} else if (biBitCount == 16) {
|
||||
st->codecpar->format = AV_PIX_FMT_BAYER_GRBG16LE;
|
||||
} else {
|
||||
avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
case CFA_BAYERFLIPH:
|
||||
if (biBitCount == 8) {
|
||||
st->codecpar->format = AV_PIX_FMT_BAYER_BGGR8;
|
||||
} else if (biBitCount == 16) {
|
||||
st->codecpar->format = AV_PIX_FMT_BAYER_BGGR16LE;
|
||||
} else {
|
||||
avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
avpriv_request_sample(avctx, "unsupported Color Field Array (CFA) %i", CFA & 0xFFFFFF);
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue