Commit 8b80d232 authored by Luc Trudeau's avatar Luc Trudeau

[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
parent a0af3b5e
......@@ -36,9 +36,8 @@ static INLINE void cfl_luma_subsampling_420(const uint8_t *y_pix,
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment