[CFL] No Average in 4:2:0 Subsampling
Since Subsampled values are in Q3, one does not need to take the
average, as the sum of 4 values is the average in Q2. As such, shifting
by 1 to the left, results in the average in Q3. By removing the
intermediate step in Q0, rounding error is removed.
Results on Subset1
PSNR | PSNR Cb | PSNR Cr | PSNR HVS | SSIM | MS SSIM | CIEDE 2000
-0.0204 | -0.1945 | -0.1474 | -0.0170 | -0.0237 | -0.0178 | -0.0973
https://arewecompressedyet.com/?job=cfl-baseline%402017-09-06T17%3A41%3A38.041Z&job=cfl-NoAverageInSub%402017-09-06T17%3A59%3A00.035Z
Change-Id: I8c6d4f71ec0e6e3923e254d79b83127b3734699e
diff --git a/av1/common/cfl.c b/av1/common/cfl.c
index 9b33079..2e1281f 100644
--- a/av1/common/cfl.c
+++ b/av1/common/cfl.c
@@ -36,9 +36,8 @@
for (int i = 0; i < width; i++) {
int top = i << 1;
int bot = top + MAX_SB_SIZE;
- int sum = y_pix[top] + y_pix[top + 1] + y_pix[bot] + y_pix[bot + 1];
- // TODO(ltrudeau) replace "+ 2 >> 2 << 3" with << 1
- output_q3[i] = ((sum + 2) >> 2) << 3;
+ output_q3[i] = (y_pix[top] + y_pix[top + 1] + y_pix[bot] + y_pix[bot + 1])
+ << 1;
}
y_pix += MAX_SB_SIZE << 1;
output_q3 += MAX_SB_SIZE;