]> git.sesse.net Git - narabu/commitdiff
DC predict chroma. ~1.5% lower bitrate.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 17 Sep 2017 11:45:59 +0000 (13:45 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 17 Sep 2017 11:45:59 +0000 (13:45 +0200)
qdc.cpp

diff --git a/qdc.cpp b/qdc.cpp
index 46eb6886e5fd305de89dc78dcc177d2ad3dab32c..db3fe275a97c18e9a386aca0332cabcd90ef0038 100644 (file)
--- a/qdc.cpp
+++ b/qdc.cpp
@@ -720,6 +720,12 @@ int main(int argc, char **argv)
                        coeff_y[yb * WIDTH + xb] -= coeff_y[yb * WIDTH + (xb + 8)];
                }
        }
+       for (unsigned yb = 0; yb < HEIGHT; yb += 8) {
+               for (unsigned xb = 0; xb < WIDTH/2 - 8; xb += 8) {
+                       coeff_cb[yb * WIDTH/2 + xb] -= coeff_cb[yb * WIDTH/2 + (xb + 8)];
+                       coeff_cr[yb * WIDTH/2 + xb] -= coeff_cr[yb * WIDTH/2 + (xb + 8)];
+               }
+       }
 
        FILE *fp = fopen("reconstructed.pgm", "wb");
        fprintf(fp, "P5\n%d %d\n255\n", WIDTH, HEIGHT);