ffmpeg | branch: master | Max Rudolph <maxwe...@gmail.com> | Tue May  6 
14:52:30 2025 +0200| [9537d91e8f1e389e7c957d3ca62d35f27453d347] | committer: 
Michael Niedermayer

avformat/cinedec: add support for additional Bayer CFA patterns for Phantom 
CINE file format

Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9537d91e8f1e389e7c957d3ca62d35f27453d347
---

 libavformat/cinedec.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

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;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to