[FFmpeg-cvslog] jpg: fix colors for sequential RGB

Carl Eugen Hoyos git at videolan.org
Sun Mar 18 14:11:12 CET 2012


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Mar 18 13:08:08 2012 +0100| [7594ee2e6e9aada671c2958dea4848e828e9b178] | committer: Michael Niedermayer

jpg: fix colors for sequential RGB

Fixes Ticket850

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/mjpegdec.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 19d44e4..4c8015f 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1168,6 +1168,8 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
 
         if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == PIX_FMT_GBR24P)
             index = (i+2)%3;
+        if(nb_components == 1 && s->nb_components == 3 && s->avctx->pix_fmt == PIX_FMT_GBR24P)
+            index = (index+2)%3;
 
         s->comp_index[i] = index;
 



More information about the ffmpeg-cvslog mailing list