Fix regression in r922
authorFiona Glaser <fiona@x264.com>
Wed, 30 Jul 2008 20:42:29 +0000 (14:42 -0600)
committerFiona Glaser <fiona@x264.com>
Wed, 30 Jul 2008 21:19:39 +0000 (15:19 -0600)
set the chroma DC coefficients to zero for residual coding in qpel-rd
fix C99ism

encoder/cabac.c
encoder/macroblock.c

index c301f65..78736ff 100644 (file)
@@ -730,10 +730,12 @@ static void block_residual_write_cabac( x264_t *h, x264_cabac_t *cb, int i_ctxBl
 
     do
     {
+        int i_prefix, ctx;
         i_coeff--;
+
         /* write coeff_abs - 1 */
-        int i_prefix = X264_MIN( i_coeff_abs_m1[i_coeff], 14 );
-        int ctx = coeff_abs_level1_ctx[node_ctx] + i_ctx_level;
+        i_prefix = X264_MIN( i_coeff_abs_m1[i_coeff], 14 );
+        ctx = coeff_abs_level1_ctx[node_ctx] + i_ctx_level;
 
         if( i_prefix )
         {
index 593e30c..51c5684 100644 (file)
@@ -809,6 +809,7 @@ void x264_macroblock_encode_p8x8( x264_t *h, int i8 )
         h->dctf.sub4x4_dct( dct4x4, p_fenc, p_fdec );
         h->quantf.quant_4x4( dct4x4, h->quant4_mf[CQM_4PC][i_qp], h->quant4_bias[CQM_4PC][i_qp] );
         h->zigzagf.scan_4x4( h->dct.luma4x4[16+i8+ch*4], dct4x4 );
+        h->dct.luma4x4[16+i8+ch*4][0] = 0;
         if( array_non_zero( dct4x4 ) )
         {
             h->quantf.dequant_4x4( dct4x4, h->dequant4_mf[CQM_4PC], i_qp );