MPEG-2: Fix an encoder/decoder mismatch
authorPhillip Blucas <pblucas@gmail.com>
Wed, 7 Dec 2011 02:07:57 +0000 (20:07 -0600)
committerPhillip Blucas <pblucas@gmail.com>
Wed, 7 Dec 2011 02:07:57 +0000 (20:07 -0600)
The first MB in each row can't be skipped, so set i_last_qp accordingly.

common/macroblock.c

index a183cf1..3b43701 100644 (file)
@@ -1755,6 +1755,8 @@ void x264_macroblock_cache_save( x264_t *h )
     }
     else
     {
+        if( MPEG2 && !h->mb.i_mb_x )
+            h->mb.i_last_qp = h->mb.i_qp;
         if( h->mb.i_type != I_16x16 && h->mb.i_cbp_luma == 0 && h->mb.i_cbp_chroma == 0 )
             h->mb.i_qp = h->mb.i_last_qp;
         h->mb.qp[i_mb_xy] = h->mb.i_qp;