You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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:
committed by
Michael Niedermayer
parent
d5f4a55123
commit
9537d91e8f
@@ -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;
|
||||
|
Reference in New Issue
Block a user