ref: 9afe2cf5990bfc247950f240923ba050df4b7cd8
parent: ad55b1d270db717a1f5c1c4966e7aecf9a563e5f
parent: 2745f94deb6993bf478148b7e05305e7f65cb0f1
author: Yunqing Wang <yunqingwang@google.com>
date: Thu Sep 29 20:49:06 EDT 2016
Merge "Fix an issue in vp9_first_pass for non-mulitple of 16 resolutions"
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -843,6 +843,10 @@
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;