From ff7639b042d066be7e6a26ba23bdb9804457d644 Mon Sep 17 00:00:00 2001 From: Fiona Glaser Date: Wed, 30 Jul 2008 14:42:29 -0600 Subject: [PATCH] Fix regression in r922 set the chroma DC coefficients to zero for residual coding in qpel-rd fix C99ism --- encoder/cabac.c | 6 ++++-- encoder/macroblock.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/encoder/cabac.c b/encoder/cabac.c index c301f65c..78736ff6 100644 --- a/encoder/cabac.c +++ b/encoder/cabac.c @@ -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 ) { diff --git a/encoder/macroblock.c b/encoder/macroblock.c index 593e30cc..51c56840 100644 --- a/encoder/macroblock.c +++ b/encoder/macroblock.c @@ -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 ); -- 2.40.0