summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2013-04-29 17:38:25 -0700
committerRonald S. Bultje <rbultje@google.com>2013-04-29 17:59:00 -0700
commitee0f3a9d31c46ff9ed300e3d66106a6b8cf9e206 (patch)
tree36ada6b78da9ec2aa77d45c04febbf3bad6ab5f3
parent0b48548eeb2e5e2d002563d2a8181c57d7b9f85a (diff)
downloadlibvpx-ee0f3a9d31c46ff9ed300e3d66106a6b8cf9e206.tar
libvpx-ee0f3a9d31c46ff9ed300e3d66106a6b8cf9e206.tar.gz
libvpx-ee0f3a9d31c46ff9ed300e3d66106a6b8cf9e206.tar.bz2
libvpx-ee0f3a9d31c46ff9ed300e3d66106a6b8cf9e206.zip
Make sure 32x32 coefficients fit in int16_t.
Fixes mismatches on yt. Change-Id: I65444137578b29a4984af5c01b2874c5ab086acc
-rw-r--r--vp9/decoder/vp9_detokenize.c3
-rw-r--r--vp9/decoder/vp9_idct_blk.c15
2 files changed, 2 insertions, 16 deletions
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index 3ef1e5b32..650defde7 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -85,7 +85,8 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
#define WRITE_COEF_CONTINUE(val, token) \
{ \
- qcoeff_ptr[scan[c]] = vp9_read_and_apply_sign(r, val) * dq[c > 0]; \
+ qcoeff_ptr[scan[c]] = vp9_read_and_apply_sign(r, val) * \
+ dq[c > 0] / (1 + (txfm_size == TX_32X32)); \
INCREMENT_COUNT(token); \
c++; \
continue; \
diff --git a/vp9/decoder/vp9_idct_blk.c b/vp9/decoder/vp9_idct_blk.c
index 73c1c4d2c..3480df25e 100644
--- a/vp9/decoder/vp9_idct_blk.c
+++ b/vp9/decoder/vp9_idct_blk.c
@@ -315,23 +315,12 @@ void vp9_idct_add_32x32_c(int16_t *input, uint8_t *dest, int stride, int eob) {
DECLARE_ALIGNED_ARRAY(16, int16_t, output, 1024);
if (eob) {
- input[0] = input[0] / 2;
if (eob == 1) {
vp9_short_idct1_32x32(input, output);
vp9_add_constant_residual_32x32(output[0], dest, stride);
input[0] = 0;
#if !CONFIG_SCATTERSCAN
} else if (eob <= 10) {
- input[1] = input[1] / 2;
- input[2] = input[2] / 2;
- input[3] = input[3] / 2;
- input[32] = input[32] / 2;
- input[33] = input[33] / 2;
- input[34] = input[34] / 2;
- input[64] = input[64] / 2;
- input[65] = input[65] / 2;
- input[96] = input[96] / 2;
-
// the idct halves ( >> 1) the pitch
vp9_short_idct10_32x32(input, output, 64);
@@ -343,10 +332,6 @@ void vp9_idct_add_32x32_c(int16_t *input, uint8_t *dest, int stride, int eob) {
vp9_add_residual_32x32(output, dest, stride);
#endif
} else {
- int i;
- for (i = 1; i < 1024; i++)
- input[i] = input[i] / 2;
-
vp9_short_idct32x32(input, output, 64);
vpx_memset(input, 0, 2048);
vp9_add_residual_32x32(output, dest, stride);