summaryrefslogtreecommitdiffstats
path: root/vp8/decoder/dequantize.c
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-09-15 15:12:42 -0700
committerAndreas Huber <andih@google.com>2010-09-15 15:12:42 -0700
commitf71323e297a928af368937089d3ed71239786f86 (patch)
treedad338caad00af21fd81f0975335c343a91be085 /vp8/decoder/dequantize.c
parent8aa17fc40a750935d80b115d89ca9403f42ab211 (diff)
downloadandroid_external_libvpx-f71323e297a928af368937089d3ed71239786f86.tar.gz
android_external_libvpx-f71323e297a928af368937089d3ed71239786f86.tar.bz2
android_external_libvpx-f71323e297a928af368937089d3ed71239786f86.zip
Upgrade to the latest .webm project code.
Change-Id: I33907e0c9ded667e54d31e2f9226c77501731c6c
Diffstat (limited to 'vp8/decoder/dequantize.c')
-rw-r--r--vp8/decoder/dequantize.c72
1 files changed, 63 insertions, 9 deletions
diff --git a/vp8/decoder/dequantize.c b/vp8/decoder/dequantize.c
index 14798d9..8cfa2a3 100644
--- a/vp8/decoder/dequantize.c
+++ b/vp8/decoder/dequantize.c
@@ -1,10 +1,11 @@
/*
- * Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
- * Use of this source code is governed by a BSD-style license and patent
- * grant that can be found in the LICENSE file in the root of the source
- * tree. All contributing project authors may be found in the AUTHORS
- * file in the root of the source tree.
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
*/
@@ -31,8 +32,12 @@ void vp8_dequantize_b_c(BLOCKD *d)
}
}
-void vp8_dequant_idct_c(short *input, short *dq, short *output, int pitch)
+void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *pred,
+ unsigned char *dest, int pitch, int stride)
{
+ short output[16];
+ short *diff_ptr = output;
+ int r, c;
int i;
for (i = 0; i < 16; i++)
@@ -40,13 +45,40 @@ void vp8_dequant_idct_c(short *input, short *dq, short *output, int pitch)
input[i] = dq[i] * input[i];
}
- vp8_short_idct4x4llm_c(input, output, pitch);
+ // the idct halves ( >> 1) the pitch
+ vp8_short_idct4x4llm_c(input, output, 4 << 1);
+
vpx_memset(input, 0, 32);
+
+ for (r = 0; r < 4; r++)
+ {
+ for (c = 0; c < 4; c++)
+ {
+ int a = diff_ptr[c] + pred[c];
+
+ if (a < 0)
+ a = 0;
+
+ if (a > 255)
+ a = 255;
+
+ dest[c] = (unsigned char) a;
+ }
+
+ dest += stride;
+ diff_ptr += 4;
+ pred += pitch;
+ }
}
-void vp8_dequant_dc_idct_c(short *input, short *dq, short *output, int pitch, int Dc)
+void vp8_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred,
+ unsigned char *dest, int pitch, int stride,
+ int Dc)
{
int i;
+ short output[16];
+ short *diff_ptr = output;
+ int r, c;
input[0] = (short)Dc;
@@ -55,6 +87,28 @@ void vp8_dequant_dc_idct_c(short *input, short *dq, short *output, int pitch, in
input[i] = dq[i] * input[i];
}
- vp8_short_idct4x4llm_c(input, output, pitch);
+ // the idct halves ( >> 1) the pitch
+ vp8_short_idct4x4llm_c(input, output, 4 << 1);
+
vpx_memset(input, 0, 32);
+
+ for (r = 0; r < 4; r++)
+ {
+ for (c = 0; c < 4; c++)
+ {
+ int a = diff_ptr[c] + pred[c];
+
+ if (a < 0)
+ a = 0;
+
+ if (a > 255)
+ a = 255;
+
+ dest[c] = (unsigned char) a;
+ }
+
+ dest += stride;
+ diff_ptr += 4;
+ pred += pitch;
+ }
}