]> granicus.if.org Git - libx264/commitdiff
Fix bug with PCM and adaptive quantization
authorFiona Glaser <fiona@x264.com>
Sat, 12 Jul 2008 04:53:27 +0000 (22:53 -0600)
committerFiona Glaser <fiona@x264.com>
Sat, 12 Jul 2008 04:53:27 +0000 (22:53 -0600)
In rare cases CABAC desync could occur, causing bitstream corruption

common/macroblock.c

index b5e3ebc68d9ba460aa882178fb8e04c05d8d0ffb..b512b08e8577ca97d8d0bb91b47b9b71f3826e0a 100644 (file)
@@ -1397,7 +1397,7 @@ void x264_macroblock_cache_save( x264_t *h )
 
     h->mb.type[i_mb_xy] = i_mb_type;
 
-    if( h->mb.i_type != I_16x16 && h->mb.i_cbp_luma == 0 && h->mb.i_cbp_chroma == 0 )
+    if( h->mb.i_type == I_PCM || (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] = i_mb_type != I_PCM ? h->mb.i_qp : 0;