Hi!

Attached patch fixes decoding of a sample mentioned in ticket #8930.

Please comment, Carl Eugen
From 30316e5626df36089893f0800660e96ecbf25d1e Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Sun, 28 Mar 2021 00:31:05 +0100
Subject: [PATCH] lavc/mjpegdec: Support pixel format 0x11311100.

Fixes decoding of Nene3xRGB.jpg
---
 libavcodec/mjpegdec.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 5583d2aa35..575b2d8d4a 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -615,6 +615,17 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
                 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
             }
             break;
+        case 0x11311100:
+            if (s->bits > 8)
+                goto unk_pixfmt;
+            if (s->component_id[0] == 'R' - 1 && s->component_id[1] == 'G' - 1 && s->component_id[2] == 'B' - 1) {
+                s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
+            } else {
+                goto unk_pixfmt;
+            }
+            s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+            s->upscale_h[1] = s->upscale_h[2] = 2;
+            break;
         case 0x31111100:
             if (s->bits > 8)
                 goto unk_pixfmt;
-- 
2.30.1

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

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

Reply via email to