]> granicus.if.org Git - libvpx/commitdiff
re-scaled 2nd order haar transform
authorYaowu Xu <yaowu@google.com>
Wed, 15 Feb 2012 23:01:35 +0000 (15:01 -0800)
committerYaowu Xu <yaowu@google.com>
Thu, 16 Feb 2012 15:03:56 +0000 (07:03 -0800)
During the work of extend_qrange, we have rolled a factor of 2 from
quantization/dequatnization into 2nd order walsh-hadamard transform.
This commit does the same for the 2nd order haar transform. so they
can share the same quantizaiton process as the 2nd order WHT.

Change-Id: I734af4a20ea8149a01b5b1971a065092977dfe33

vp8/common/idctllm.c
vp8/encoder/dct.c

index 22c9baa46ff70de0d8b83fc60551d3ccfc4979b6..e21af6871f8ad8297ac88069bb80d86c28f97a69 100644 (file)
@@ -487,10 +487,10 @@ void vp8_short_ihaar2x2_c(short *input, short *output, int pitch)
        op[i] = 0;
    }
 
-   op[0] = (ip[0] + ip[1] + ip[4] + ip[8])>>2;
-   op[1] = (ip[0] - ip[1] + ip[4] - ip[8])>>2;
-   op[4] = (ip[0] + ip[1] - ip[4] - ip[8])>>2;
-   op[8] = (ip[0] - ip[1] - ip[4] + ip[8])>>2;
+   op[0] = (ip[0] + ip[1] + ip[4] + ip[8])>>1;
+   op[1] = (ip[0] - ip[1] + ip[4] - ip[8])>>1;
+   op[4] = (ip[0] + ip[1] - ip[4] - ip[8])>>1;
+   op[8] = (ip[0] - ip[1] - ip[4] + ip[8])>>1;
 }
 
 void vp8_short_ihaar2x2_1_c(short *input, short *output, int pitch)
index d6b3e77c5ce0fe7866c8e4cb30e4fe48ba406ab7..b537835da413abb3b6e796f476f53d6f44cc82ef 100644 (file)
@@ -120,10 +120,10 @@ void vp8_short_fhaar2x2_c(short *input, short *output, int pitch) //pitch = 8
        op1[i] = 0;
    }
 
-   op1[0]=ip1[0] + ip1[1] + ip1[4] + ip1[8];
-   op1[1]=ip1[0] - ip1[1] + ip1[4] - ip1[8];
-   op1[4]=ip1[0] + ip1[1] - ip1[4] - ip1[8];
-   op1[8]=ip1[0] - ip1[1] - ip1[4] + ip1[8];
+   op1[0]=(ip1[0] + ip1[1] + ip1[4] + ip1[8])>>1;
+   op1[1]=(ip1[0] - ip1[1] + ip1[4] - ip1[8])>>1;
+   op1[4]=(ip1[0] + ip1[1] - ip1[4] - ip1[8])>>1;
+   op1[8]=(ip1[0] - ip1[1] - ip1[4] + ip1[8])>>1;
 
 }
 #endif