mjpegenc: fix restart interval parameters for yuv444
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 18 Dec 2012 00:11:02 +0000 (01:11 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 18 Dec 2012 00:21:48 +0000 (01:21 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegenc.c

index e817905..7ac3042 100644 (file)
@@ -137,7 +137,7 @@ static void jpeg_table_header(MpegEncContext *s)
     if(s->avctx->active_thread_type & FF_THREAD_SLICE){
         put_marker(p, DRI);
         put_bits(p, 16, 4);
-        put_bits(p, 16, s->mb_width*2/s->mjpeg_hsample[0]);
+        put_bits(p, 16, (s->width-1)/(8*s->mjpeg_hsample[0]) + 1);
     }
 
     /* huffman table */