]> granicus.if.org Git - libvpx/commitdiff
Improving the forward 16x16 ADST/DCT accuracy
authorJingning Han <jingning@google.com>
Mon, 25 Feb 2013 20:08:29 +0000 (12:08 -0800)
committerJingning Han <jingning@google.com>
Mon, 25 Feb 2013 20:13:37 +0000 (12:13 -0800)
Increase the first stage dynamic range by 4 times, and reduce it
back with proper rounding before applying the second stage. Hence
it still fits in the given dynamic range and slightly improves
the key frame coding performance.

Change-Id: Ia4c5907446f20a95dc3de079c314b3ad1221d8aa

vp9/encoder/vp9_dct.c

index a371eeb190a55da35eab0d4f8c30f8f5c6345a35..e2f3e267798ce2e0c81118c2925a04622116585c 100644 (file)
@@ -728,10 +728,10 @@ void vp9_short_fht16x16_c(int16_t *input, int16_t *output,
   // column transform
   for (i = 0; i < 16; ++i) {
     for (j = 0; j < 16; ++j)
-      temp_in[j] = input[j * short_pitch + i];
+      temp_in[j] = input[j * short_pitch + i] << 2;
     fwdc(temp_in, temp_out);
     for (j = 0; j < 16; ++j)
-      outptr[j * 16 + i] = temp_out[j];
+      outptr[j * 16 + i] = (temp_out[j] + 1 + (temp_out[j] > 0)) >> 2;
   }
 
   // row transform