summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_dequantize.c
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2013-01-08 10:11:26 -0800
committerJohn Koleszar <jkoleszar@google.com>2013-01-08 10:19:59 -0800
commit879cb7d96259a71eea0038452a00241650589084 (patch)
tree4d8c0a86fcdb6655d10647837e6c3adfb38639c4 /vp9/decoder/vp9_dequantize.c
parentc14439c3d3db8dfa44a30c4edc50f56250ce4cd3 (diff)
parentbdca030cafc31446afc1685906f7c44e1850ed84 (diff)
downloadlibvpx-879cb7d96259a71eea0038452a00241650589084.tar
libvpx-879cb7d96259a71eea0038452a00241650589084.tar.gz
libvpx-879cb7d96259a71eea0038452a00241650589084.tar.bz2
libvpx-879cb7d96259a71eea0038452a00241650589084.zip
Merge vp9-preview changes into experimental branch
Incorportate vp9-preview changes by merging master branch into experimental. Conflicts: test/test.mk vp9/common/vp9_filter.c vp9/common/vp9_idctllm.c vp9/common/vp9_invtrans.h vp9/common/vp9_mbpitch.c vp9/common/vp9_rtcd_defs.sh vp9/common/vp9_systemdependent.h vp9/common/vp9_type_aliases.h vp9/common/x86/vp9_asm_stubs.c vp9/common/x86/vp9_subpixel_mmx.asm vp9/decoder/vp9_decodframe.c vp9/decoder/vp9_dequantize.c vp9/decoder/vp9_dequantize.h vp9/decoder/vp9_onyxd_int.h vp9/encoder/vp9_bitstream.c vp9/encoder/vp9_encodeframe.c vp9/encoder/vp9_rdopt.c Change-Id: I17f51c3666d1b59cf1a699f87607cbc5d30a87c5
Diffstat (limited to 'vp9/decoder/vp9_dequantize.c')
-rw-r--r--vp9/decoder/vp9_dequantize.c56
1 files changed, 32 insertions, 24 deletions
diff --git a/vp9/decoder/vp9_dequantize.c b/vp9/decoder/vp9_dequantize.c
index 4376dc3d3..72cd2771e 100644
--- a/vp9/decoder/vp9_dequantize.c
+++ b/vp9/decoder/vp9_dequantize.c
@@ -14,7 +14,6 @@
#include "vpx_mem/vpx_mem.h"
#include "vp9/decoder/vp9_onyxd_int.h"
#include "vp9/common/vp9_common.h"
-
static void add_residual(const int16_t *diff, const uint8_t *pred, int pitch,
uint8_t *dest, int stride, int width, int height) {
int r, c;
@@ -61,7 +60,7 @@ void vp9_dequantize_b_c(BLOCKD *d) {
void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq,
uint8_t *pred, uint8_t *dest,
- int pitch, int stride) {
+ int pitch, int stride, uint16_t eobs) {
int16_t output[16];
int16_t *diff_ptr = output;
int i;
@@ -70,7 +69,7 @@ void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input,
input[i] = dq[i] * input[i];
}
- vp9_ihtllm(input, output, 4 << 1, tx_type, 4);
+ vp9_ihtllm(input, output, 4 << 1, tx_type, 4, eobs);
vpx_memset(input, 0, 32);
@@ -80,21 +79,25 @@ void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input,
void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq,
uint8_t *pred, uint8_t *dest,
- int pitch, int stride) {
+ int pitch, int stride, uint16_t eobs) {
int16_t output[64];
int16_t *diff_ptr = output;
int i;
+ if (eobs == 0) {
+ /* All 0 DCT coefficient */
+ vp9_copy_mem8x8(pred, pitch, dest, stride);
+ } else if (eobs > 0) {
+ input[0] = dq[0] * input[0];
+ for (i = 1; i < 64; i++) {
+ input[i] = dq[1] * input[i];
+ }
- input[0] = dq[0] * input[0];
- for (i = 1; i < 64; i++) {
- input[i] = dq[1] * input[i];
- }
-
- vp9_ihtllm(input, output, 16, tx_type, 8);
+ vp9_ihtllm(input, output, 16, tx_type, 8, eobs);
- vpx_memset(input, 0, 128);
+ vpx_memset(input, 0, 128);
- add_residual(diff_ptr, pred, pitch, dest, stride, 8, 8);
+ add_residual(diff_ptr, pred, pitch, dest, stride, 8, 8);
+ }
}
void vp9_dequant_idct_add_c(int16_t *input, const int16_t *dq, uint8_t *pred,
@@ -256,26 +259,31 @@ void vp9_dequant_idct_add_8x8_c(int16_t *input, const int16_t *dq,
void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq, uint8_t *pred,
- uint8_t *dest, int pitch, int stride) {
+ uint8_t *dest, int pitch, int stride,
+ uint16_t eobs) {
int16_t output[256];
int16_t *diff_ptr = output;
int i;
+ if (eobs == 0) {
+ /* All 0 DCT coefficient */
+ vp9_copy_mem16x16(pred, pitch, dest, stride);
+ } else if (eobs > 0) {
+ input[0]= input[0] * dq[0];
- input[0]= input[0] * dq[0];
-
- // recover quantizer for 4 4x4 blocks
- for (i = 1; i < 256; i++)
- input[i] = input[i] * dq[1];
+ // recover quantizer for 4 4x4 blocks
+ for (i = 1; i < 256; i++)
+ input[i] = input[i] * dq[1];
- // inverse hybrid transform
- vp9_ihtllm(input, output, 32, tx_type, 16);
+ // inverse hybrid transform
+ vp9_ihtllm(input, output, 32, tx_type, 16, eobs);
- // the idct halves ( >> 1) the pitch
- // vp9_short_idct16x16_c(input, output, 32);
+ // the idct halves ( >> 1) the pitch
+ // vp9_short_idct16x16_c(input, output, 32);
- vpx_memset(input, 0, 512);
+ vpx_memset(input, 0, 512);
- add_residual(diff_ptr, pred, pitch, dest, stride, 16, 16);
+ add_residual(diff_ptr, pred, pitch, dest, stride, 16, 16);
+ }
}
void vp9_dequant_idct_add_16x16_c(int16_t *input, const int16_t *dq,