From 73031aaa7dbdab9d7a6f128180d27bd00ace8753 Mon Sep 17 00:00:00 2001 From: Deb Mukherjee Date: Thu, 4 Apr 2013 11:07:19 -0700 Subject: [PATCH] Bugfix in encode_inter_mb_segment_8x8 Fixes an indexing bug. Looks like the bug has been there for a while. Change-Id: I9fc04b0c30754bcb47366ad94a08112925600c4d --- vp9/encoder/vp9_rdopt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index e66f6a2f5..34adc9915 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -573,6 +573,10 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb, if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) seg_eob = 0; + /* sanity check to ensure that we do not have spurious non-zero q values */ + if (eob < seg_eob) + assert(qcoeff_ptr[scan[eob]] == 0); + { #if CONFIG_CODE_NONZEROCOUNT int nzc = 0; @@ -2562,7 +2566,7 @@ static int64_t encode_inter_mb_segment_8x8(VP9_COMMON *const cm, BLOCKD *bd = &xd->block[ib + iblock[j]]; BLOCK *be = &x->block[ib + iblock[j]]; x->fwd_txm8x4(be->src_diff, be->coeff, 32); - x->quantize_b_4x4_pair(x, ib + iblock[j], ib + iblock[j]); + x->quantize_b_4x4_pair(x, ib + iblock[j], ib + iblock[j] + 1); thisdistortion = vp9_block_error_c(be->coeff, bd->dqcoeff, 32); otherdist += thisdistortion; xd->mode_info_context->mbmi.txfm_size = TX_4X4; -- 2.40.0