diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c index e0bcca4ce5..cd13f132c3 100644 --- a/libavformat/cinedec.c +++ b/libavformat/cinedec.c @@ -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;