summaryrefslogtreecommitdiff
path: root/vp8/encoder/dct.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/encoder/dct.c')
-rw-r--r--vp8/encoder/dct.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/vp8/encoder/dct.c b/vp8/encoder/dct.c
index b5a11ae34..69a882c89 100644
--- a/vp8/encoder/dct.c
+++ b/vp8/encoder/dct.c
@@ -10,7 +10,7 @@
#include <math.h>
-
+#include "vpx_ports/config.h"
void vp8_short_fdct4x4_c(short *input, short *output, int pitch)
{
int i;
@@ -20,11 +20,17 @@ void vp8_short_fdct4x4_c(short *input, short *output, int pitch)
for (i = 0; i < 4; i++)
{
+#if CONFIG_EXTEND_QRANGE
+ a1 = ((ip[0] + ip[3])<<5);
+ b1 = ((ip[1] + ip[2])<<5);
+ c1 = ((ip[1] - ip[2])<<5);
+ d1 = ((ip[0] - ip[3])<<5);
+#else
a1 = ((ip[0] + ip[3])<<3);
b1 = ((ip[1] + ip[2])<<3);
c1 = ((ip[1] - ip[2])<<3);
d1 = ((ip[0] - ip[3])<<3);
-
+#endif
op[0] = a1 + b1;
op[2] = a1 - b1;
@@ -72,12 +78,22 @@ void vp8_short_walsh4x4_c(short *input, short *output, int pitch)
for (i = 0; i < 4; i++)
{
+#if !CONFIG_EXTEND_QRANGE
a1 = ((ip[0] + ip[2])<<2);
d1 = ((ip[1] + ip[3])<<2);
c1 = ((ip[1] - ip[3])<<2);
b1 = ((ip[0] - ip[2])<<2);
op[0] = a1 + d1 + (a1!=0);
+#else
+ a1 = ((ip[0] + ip[2]));
+ d1 = ((ip[1] + ip[3]));
+ c1 = ((ip[1] - ip[3]));
+ b1 = ((ip[0] - ip[2]));
+
+
+ op[0] = a1 + d1;
+#endif
op[1] = b1 + c1;
op[2] = b1 - c1;
op[3] = a1 - d1;
@@ -105,11 +121,17 @@ void vp8_short_walsh4x4_c(short *input, short *output, int pitch)
c2 += c2<0;
d2 += d2<0;
+#if !CONFIG_EXTEND_QRANGE
op[0] = (a2+3) >> 3;
op[4] = (b2+3) >> 3;
op[8] = (c2+3) >> 3;
op[12]= (d2+3) >> 3;
-
+#else
+ op[0] = (a2+1) >> 2;
+ op[4] = (b2+1) >> 2;
+ op[8] = (c2+1) >> 2;
+ op[12]= (d2+1) >> 2;
+#endif
ip++;
op++;
}