Variance Boost: update comment on variance calculation
Truncating variance values was found to perform better than rounding
or keeping them as doubles.
Bug: aomedia:375221136
Change-Id: I9180a4bb50257351b16dee3529f168e5a17779d0
diff --git a/av1/encoder/aq_variance.c b/av1/encoder/aq_variance.c
index 1598805..0be78dd 100644
--- a/av1/encoder/aq_variance.c
+++ b/av1/encoder/aq_variance.c
@@ -207,15 +207,14 @@
: av1_all_zeros;
unsigned int variances[SUBBLOCKS_IN_SB];
- // TODO: bug https://crbug.com/aomedia/375221136 - the current implementation
- // truncates variances to integers during normalization, similar to SVT-AV1's
- // counterpart. A possible improvement would be to use rounding: `(n + 32) /
- // 64`, or just return variances as doubles.
+ // Calculate subblock variances.
aom_variance_fn_t vf = cpi->ppi->fn_ptr[BLOCK_8X8].vf;
for (int subb_i = 0; subb_i < SUBBLOCKS_IN_SB_DIM; subb_i++) {
int i = subb_i * SUBBLOCK_SIZE;
for (int subb_j = 0; subb_j < SUBBLOCKS_IN_SB_DIM; subb_j++) {
int j = subb_j * SUBBLOCK_SIZE;
+ // Truncating values to integers (i.e. the 64 term) was found to perform
+ // better than rounding, or returning them as doubles.
variances[subb_i * SUBBLOCKS_IN_SB_DIM + subb_j] =
vf(x->plane[0].src.buf + i * x->plane[0].src.stride + j,
x->plane[0].src.stride, all_zeros, 0, &sse) /