From: Deepa K G Date: Thu, 29 Sep 2016 03:38:34 +0000 (-0700) Subject: Fix an issue in vp9_first_pass for non-mulitple of 16 resolutions X-Git-Tag: v1.6.1~222^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2745f94deb6993bf478148b7e05305e7f65cb0f1;p=libvpx Fix an issue in vp9_first_pass for non-mulitple of 16 resolutions This patch sets the 16x16 src_diff to zero and ensures correct calculation of this_error for block sizes smaller than 16x16. Change-Id: I7b7c02d267433c9f22c8ac9b8d5df2f499175172 --- diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 1c716a102..272dde593 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -843,6 +843,10 @@ void vp9_first_pass(VP9_COMP *cpi, const struct lookahead_entry *source) { xd->mi[0]->mode = DC_PRED; xd->mi[0]->tx_size = use_dc_pred ? (bsize >= BLOCK_16X16 ? TX_16X16 : TX_8X8) : TX_4X4; + + // Set the 16x16 src_diff block to zero, which ensures correct this_error + // calculation for block sizes smaller than 16x16. + vp9_zero_array(x->plane[0].src_diff, 256); vp9_encode_intra_block_plane(x, bsize, 0, 0); this_error = vpx_get_mb_ss(x->plane[0].src_diff); this_intra_error = this_error;