shithub: libvpx

Download patch

ref: a7b6c4503a201f7f77bb39aee7312bc5d5a41535
parent: 9e2c09cc2a0e446f4493bb3837adffd95d1879c9
author: Jingning Han <[email protected]>
date: Mon Mar 18 09:52:05 EDT 2019

Normalize the Wiener variance for ranking

Normalize the Wiener variance calculation for stack ranking. Remove
potential dependency on blocks at frame boundary.

Change-Id: I37e8634d714a1c34e99f9f7c4f1bb6ea81d56112

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -3604,9 +3604,11 @@
     for (col = mb_col_start; col < mb_col_end; ++col)
       wiener_variance += cpi->mb_wiener_variance[row * cm->mb_cols + col];
 
+  wiener_variance /= (mb_row_end - mb_row_start) * (mb_col_end - mb_col_start);
 #if CONFIG_MULTITHREAD
   pthread_mutex_lock(&cpi->kmeans_mutex);
 #endif  // CONFIG_MULTITHREAD
+
   kmeans_data = &cpi->kmeans_data_arr[cpi->kmeans_data_size++];
   kmeans_data->value = log(1.0 + wiener_variance) / log(2.0);
   kmeans_data->pos = mi_row * cpi->kmeans_data_stride + mi_col;