[FFmpeg-cvslog] mpegvideo_enc: fix gray flag with 444 jpeg

Michael Niedermayer git at videolan.org
Wed Feb 27 03:10:21 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 27 02:56:06 2013 +0100| [1672624ddc746f236294548980a69a2301f6ddd5] | committer: Michael Niedermayer

mpegvideo_enc: fix gray flag with 444 jpeg

Fixes Ticket2155

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

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

 libavcodec/mpegvideo_enc.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 9378c0c..a0e7a54 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2156,6 +2156,12 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
         s->block_last_index[5] = 0;
         s->block[4][0] =
         s->block[5][0] = (1024 + s->c_dc_scale / 2) / s->c_dc_scale;
+        if (!s->chroma_y_shift) { /* 422 / 444 */
+            for (i=6; i<12; i++) {
+                s->block_last_index[i] = 0;
+                s->block[i][0] = s->block[4][0];
+            }
+        }
     }
 
     // non c quantize code returns incorrect block_last_index FIXME



More information about the ffmpeg-cvslog mailing list