From: Fiona Glaser Date: Sat, 12 Jul 2008 04:53:27 +0000 (-0600) Subject: Fix bug with PCM and adaptive quantization X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e0904d2841960cd2f57d8ec1e873545dccf3522;p=libx264 Fix bug with PCM and adaptive quantization In rare cases CABAC desync could occur, causing bitstream corruption --- diff --git a/common/macroblock.c b/common/macroblock.c index b5e3ebc6..b512b08e 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -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;