shithub: libvpx

Download patch

ref: 2745f94deb6993bf478148b7e05305e7f65cb0f1
parent: 70240a77b8decede28132fd4dbf1fa48713edea4
author: Deepa K G <deepa.kg@ittiam.com>
date: Wed Sep 28 16:38:34 EDT 2016

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

--- 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;