ref: 0eb5590425112044e86b8a24945b8d20552f0f9f
parent: 4c7c15ee6996eea1c5911e2418554d5c64978c30
parent: 47d9d48fa4a7c1f7ff09e09464a4c2ea1758f706
author: Yunqing Wang <yunqingwang@google.com>
date: Fri Nov 16 07:35:17 EST 2012
Merge "Add const before the dequant(dq)" into experimental
--- a/vp9/common/rtcd_defs.sh
+++ b/vp9/common/rtcd_defs.sh
@@ -45,34 +45,34 @@
prototype void vp9_dequantize_b_2x2 "struct blockd *x"
specialize vp9_dequantize_b_2x2
-prototype void vp9_dequant_dc_idct_add_y_block_8x8 "short *q, short *dq, unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs, short *dc, struct macroblockd *xd"
+prototype void vp9_dequant_dc_idct_add_y_block_8x8 "short *q, const short *dq, unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs, const short *dc, struct macroblockd *xd"
specialize vp9_dequant_dc_idct_add_y_block_8x8
-prototype void vp9_dequant_idct_add_y_block_8x8 "short *q, short *dq, unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs, struct macroblockd *xd"
+prototype void vp9_dequant_idct_add_y_block_8x8 "short *q, const short *dq, unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs, struct macroblockd *xd"
specialize vp9_dequant_idct_add_y_block_8x8
-prototype void vp9_dequant_idct_add_uv_block_8x8 "short *q, short *dq, unsigned char *pre, unsigned char *dstu, unsigned char *dstv, int stride, unsigned short *eobs, struct macroblockd *xd"
+prototype void vp9_dequant_idct_add_uv_block_8x8 "short *q, const short *dq, unsigned char *pre, unsigned char *dstu, unsigned char *dstv, int stride, unsigned short *eobs, struct macroblockd *xd"
specialize vp9_dequant_idct_add_uv_block_8x8
-prototype void vp9_dequant_idct_add_16x16 "short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, unsigned short eobs"
+prototype void vp9_dequant_idct_add_16x16 "short *input, const short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, unsigned short eobs"
specialize vp9_dequant_idct_add_16x16
-prototype void vp9_dequant_idct_add_8x8 "short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, int dc, unsigned short eobs"
+prototype void vp9_dequant_idct_add_8x8 "short *input, const short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, int dc, unsigned short eobs"
specialize vp9_dequant_idct_add_8x8
-prototype void vp9_dequant_idct_add "short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride"
+prototype void vp9_dequant_idct_add "short *input, const short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride"
specialize vp9_dequant_idct_add
-prototype void vp9_dequant_dc_idct_add "short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, int Dc"
+prototype void vp9_dequant_dc_idct_add "short *input, const short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, int Dc"
specialize vp9_dequant_dc_idct_add
-prototype void vp9_dequant_dc_idct_add_y_block "short *q, short *dq, unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs, short *dc"
+prototype void vp9_dequant_dc_idct_add_y_block "short *q, const short *dq, unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs, const short *dc"
specialize vp9_dequant_dc_idct_add_y_block mmx
-prototype void vp9_dequant_idct_add_y_block "short *q, short *dq, unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs"
+prototype void vp9_dequant_idct_add_y_block "short *q, const short *dq, unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs"
specialize vp9_dequant_idct_add_y_block mmx
-prototype void vp9_dequant_idct_add_uv_block "short *q, short *dq, unsigned char *pre, unsigned char *dstu, unsigned char *dstv, int stride, unsigned short *eobs"
+prototype void vp9_dequant_idct_add_uv_block "short *q, const short *dq, unsigned char *pre, unsigned char *dstu, unsigned char *dstv, int stride, unsigned short *eobs"
specialize vp9_dequant_idct_add_uv_block mmx
#
--- a/vp9/decoder/dequantize.c
+++ b/vp9/decoder/dequantize.c
@@ -67,8 +67,8 @@
int i;
int16_t *DQ = d->dqcoeff;
- int16_t *Q = d->qcoeff;
- int16_t *DQC = d->dequant;
+ const int16_t *Q = d->qcoeff;
+ const int16_t *DQC = d->dequant;
for (i = 0; i < 16; i++) {
DQ[i] = Q[i] * DQC[i];
@@ -76,7 +76,8 @@
}
-void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input, int16_t *dq,
+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) {
int16_t output[16];
@@ -94,7 +95,8 @@
add_residual(diff_ptr, pred, pitch, dest, stride, 4, 4);
}
-void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, int16_t *input, int16_t *dq,
+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) {
int16_t output[64];
@@ -113,7 +115,7 @@
add_residual(diff_ptr, pred, pitch, dest, stride, 8, 8);
}
-void vp9_dequant_idct_add_c(int16_t *input, int16_t *dq, uint8_t *pred,
+void vp9_dequant_idct_add_c(int16_t *input, const int16_t *dq, uint8_t *pred,
uint8_t *dest, int pitch, int stride) {
int16_t output[16];
int16_t *diff_ptr = output;
@@ -131,9 +133,8 @@
add_residual(diff_ptr, pred, pitch, dest, stride, 4, 4);
}
-void vp9_dequant_dc_idct_add_c(int16_t *input, int16_t *dq, uint8_t *pred,
- uint8_t *dest, int pitch, int stride,
- int Dc) {
+void vp9_dequant_dc_idct_add_c(int16_t *input, const int16_t *dq, uint8_t *pred,
+ uint8_t *dest, int pitch, int stride, int Dc) {
int i;
int16_t output[16];
int16_t *diff_ptr = output;
@@ -153,7 +154,7 @@
}
#if CONFIG_LOSSLESS
-void vp9_dequant_idct_add_lossless_c(int16_t *input, int16_t *dq,
+void vp9_dequant_idct_add_lossless_c(int16_t *input, const int16_t *dq,
uint8_t *pred, uint8_t *dest,
int pitch, int stride) {
int16_t output[16];
@@ -171,7 +172,7 @@
add_residual(diff_ptr, pred, pitch, dest, stride, 4, 4);
}
-void vp9_dequant_dc_idct_add_lossless_c(int16_t *input, int16_t *dq,
+void vp9_dequant_dc_idct_add_lossless_c(int16_t *input, const int16_t *dq,
uint8_t *pred,
uint8_t *dest,
int pitch, int stride, int dc) {
@@ -195,8 +196,8 @@
void vp9_dequantize_b_2x2_c(BLOCKD *d) {
int i;
int16_t *DQ = d->dqcoeff;
- int16_t *Q = d->qcoeff;
- int16_t *DQC = d->dequant;
+ const int16_t *Q = d->qcoeff;
+ const int16_t *DQC = d->dequant;
for (i = 0; i < 16; i++) {
DQ[i] = (int16_t)((Q[i] * DQC[i]));
@@ -213,9 +214,9 @@
#endif
}
-void vp9_dequant_idct_add_8x8_c(int16_t *input, int16_t *dq, uint8_t *pred,
- uint8_t *dest, int pitch, int stride,
- int dc, uint16_t eobs) {
+void vp9_dequant_idct_add_8x8_c(int16_t *input, const int16_t *dq,
+ uint8_t *pred, uint8_t *dest, int pitch,
+ int stride, int dc, uint16_t eobs) {
int16_t output[64];
int16_t *diff_ptr = output;
int i;
@@ -327,8 +328,8 @@
}
void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, int16_t *input,
- int16_t *dq, uint8_t *pred, uint8_t *dest,
- int pitch, int stride) {
+ const int16_t *dq, uint8_t *pred,
+ uint8_t *dest, int pitch, int stride) {
int16_t output[256];
int16_t *diff_ptr = output;
int i;
@@ -350,9 +351,9 @@
add_residual(diff_ptr, pred, pitch, dest, stride, 16, 16);
}
-void vp9_dequant_idct_add_16x16_c(int16_t *input, int16_t *dq, uint8_t *pred,
- uint8_t *dest, int pitch, int stride,
- uint16_t eobs) {
+void vp9_dequant_idct_add_16x16_c(int16_t *input, const int16_t *dq,
+ uint8_t *pred, uint8_t *dest, int pitch,
+ int stride, uint16_t eobs) {
int16_t output[256];
int16_t *diff_ptr = output;
int i;
--- a/vp9/decoder/dequantize.h
+++ b/vp9/decoder/dequantize.h
@@ -14,26 +14,27 @@
#include "vp9/common/blockd.h"
#if CONFIG_LOSSLESS
-extern void vp9_dequant_idct_add_lossless_c(short *input, short *dq,
+extern void vp9_dequant_idct_add_lossless_c(short *input, const short *dq,
unsigned char *pred,
unsigned char *output,
int pitch, int stride);
-extern void vp9_dequant_dc_idct_add_lossless_c(short *input, short *dq,
+extern void vp9_dequant_dc_idct_add_lossless_c(short *input, const short *dq,
unsigned char *pred,
unsigned char *output,
int pitch, int stride, int dc);
-extern void vp9_dequant_dc_idct_add_y_block_lossless_c(short *q, short *dq,
+extern void vp9_dequant_dc_idct_add_y_block_lossless_c(short *q,
+ const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride,
unsigned short *eobs,
- short *dc);
-extern void vp9_dequant_idct_add_y_block_lossless_c(short *q, short *dq,
+ const short *dc);
+extern void vp9_dequant_idct_add_y_block_lossless_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride,
unsigned short *eobs);
-extern void vp9_dequant_idct_add_uv_block_lossless_c(short *q, short *dq,
+extern void vp9_dequant_idct_add_uv_block_lossless_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst_u,
unsigned char *dst_v,
@@ -41,46 +42,49 @@
unsigned short *eobs);
#endif
-typedef void (*vp9_dequant_idct_add_fn_t)(short *input, short *dq,
+typedef void (*vp9_dequant_idct_add_fn_t)(short *input, const short *dq,
unsigned char *pred, unsigned char *output, int pitch, int stride);
-typedef void(*vp9_dequant_dc_idct_add_fn_t)(short *input, short *dq,
+typedef void(*vp9_dequant_dc_idct_add_fn_t)(short *input, const short *dq,
unsigned char *pred, unsigned char *output, int pitch, int stride, int dc);
-typedef void(*vp9_dequant_dc_idct_add_y_block_fn_t)(short *q, short *dq,
+typedef void(*vp9_dequant_dc_idct_add_y_block_fn_t)(short *q, const short *dq,
unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs,
- short *dc);
-typedef void(*vp9_dequant_idct_add_y_block_fn_t)(short *q, short *dq,
+ const short *dc);
+typedef void(*vp9_dequant_idct_add_y_block_fn_t)(short *q, const short *dq,
unsigned char *pre, unsigned char *dst, int stride, unsigned short *eobs);
-typedef void(*vp9_dequant_idct_add_uv_block_fn_t)(short *q, short *dq,
+typedef void(*vp9_dequant_idct_add_uv_block_fn_t)(short *q, const short *dq,
unsigned char *pre, unsigned char *dst_u, unsigned char *dst_v, int stride,
unsigned short *eobs);
-void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, short *input, short *dq,
+void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, short *input, const short *dq,
unsigned char *pred, unsigned char *dest,
int pitch, int stride);
-void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, short *input, short *dq,
- unsigned char *pred, unsigned char *dest,
- int pitch, int stride);
+void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, short *input,
+ const short *dq, unsigned char *pred,
+ unsigned char *dest, int pitch, int stride);
-void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, short *input, short *dq,
- unsigned char *pred, unsigned char *dest,
+void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, short *input,
+ const short *dq, unsigned char *pred,
+ unsigned char *dest,
int pitch, int stride);
#if CONFIG_SUPERBLOCKS
-void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(short *q, const short *dq,
unsigned char *dst,
int stride,
unsigned short *eobs,
- short *dc, MACROBLOCKD *xd);
+ const short *dc,
+ MACROBLOCKD *xd);
-void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, const short *dq,
unsigned char *dst,
int stride,
unsigned short *eobs,
- short *dc, MACROBLOCKD *xd);
+ const short *dc,
+ MACROBLOCKD *xd);
-void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, short *dq,
+void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, const short *dq,
unsigned char *dstu,
unsigned char *dstv,
int stride,
@@ -87,7 +91,7 @@
unsigned short *eobs,
MACROBLOCKD *xd);
-void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, short *dq,
+void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, const short *dq,
unsigned char *dstu,
unsigned char *dstv,
int stride,
--- a/vp9/decoder/idct_blk.c
+++ b/vp9/decoder/idct_blk.c
@@ -11,11 +11,11 @@
#include "vp9_rtcd.h"
#include "vp9/common/idct.h"
-void vp9_dequant_dc_idct_add_y_block_c(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride, unsigned short *eobs,
- short *dc) {
+ const short *dc) {
int i, j;
for (i = 0; i < 4; i++) {
@@ -37,11 +37,12 @@
}
#if CONFIG_SUPERBLOCKS
-void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(short *q, const short *dq,
unsigned char *dst,
int stride,
unsigned short *eobs,
- short *dc, MACROBLOCKD *xd) {
+ const short *dc,
+ MACROBLOCKD *xd) {
int i, j;
for (i = 0; i < 4; i++) {
@@ -61,7 +62,7 @@
}
#endif
-void vp9_dequant_idct_add_y_block_c(short *q, short *dq,
+void vp9_dequant_idct_add_y_block_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride, unsigned short *eobs) {
@@ -86,9 +87,10 @@
}
}
-void vp9_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *pre,
- unsigned char *dstu, unsigned char *dstv,
- int stride, unsigned short *eobs) {
+void vp9_dequant_idct_add_uv_block_c(short *q, const short *dq,
+ unsigned char *pre, unsigned char *dstu,
+ unsigned char *dstv, int stride,
+ unsigned short *eobs) {
int i, j;
for (i = 0; i < 2; i++) {
@@ -129,7 +131,7 @@
}
#if CONFIG_SUPERBLOCKS
-void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, short *dq,
+void vp9_dequant_idct_add_uv_block_4x4_inplace_c(short *q, const short *dq,
unsigned char *dstu,
unsigned char *dstv,
int stride,
@@ -171,11 +173,11 @@
}
#endif
-void vp9_dequant_dc_idct_add_y_block_8x8_c(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_8x8_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride, unsigned short *eobs,
- short *dc,
+ const short *dc,
MACROBLOCKD *xd) {
q[0] = dc[0];
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, 1, xd->eobs[0]);
@@ -195,11 +197,12 @@
}
#if CONFIG_SUPERBLOCKS
-void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(short *q, const short *dq,
unsigned char *dst,
int stride,
unsigned short *eobs,
- short *dc, MACROBLOCKD *xd) {
+ const short *dc,
+ MACROBLOCKD *xd) {
q[0] = dc[0];
vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, 1, xd->eobs[0]);
@@ -219,7 +222,7 @@
}
#endif
-void vp9_dequant_idct_add_y_block_8x8_c(short *q, short *dq,
+void vp9_dequant_idct_add_y_block_8x8_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride, unsigned short *eobs,
@@ -237,7 +240,7 @@
xd->eobs[12]);
}
-void vp9_dequant_idct_add_uv_block_8x8_c(short *q, short *dq,
+void vp9_dequant_idct_add_uv_block_8x8_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dstu,
unsigned char *dstv,
@@ -252,7 +255,7 @@
}
#if CONFIG_SUPERBLOCKS
-void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, short *dq,
+void vp9_dequant_idct_add_uv_block_8x8_inplace_c(short *q, const short *dq,
unsigned char *dstu,
unsigned char *dstv,
int stride,
@@ -268,12 +271,12 @@
#endif
#if CONFIG_LOSSLESS
-void vp9_dequant_dc_idct_add_y_block_lossless_c(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_lossless_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride,
unsigned short *eobs,
- short *dc) {
+ const short *dc) {
int i, j;
for (i = 0; i < 4; i++) {
@@ -294,7 +297,7 @@
}
}
-void vp9_dequant_idct_add_y_block_lossless_c(short *q, short *dq,
+void vp9_dequant_idct_add_y_block_lossless_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride, unsigned short *eobs) {
@@ -319,7 +322,7 @@
}
}
-void vp9_dequant_idct_add_uv_block_lossless_c(short *q, short *dq,
+void vp9_dequant_idct_add_uv_block_lossless_c(short *q, const short *dq,
unsigned char *pre,
unsigned char *dstu,
unsigned char *dstv,
--- a/vp9/decoder/x86/idct_blk_mmx.c
+++ b/vp9/decoder/x86/idct_blk_mmx.c
@@ -12,11 +12,11 @@
#include "vp9/common/idct.h"
#include "vp9/decoder/dequantize.h"
-void vp9_dequant_dc_idct_add_y_block_mmx(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_mmx(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride, unsigned short *eobs,
- short *dc) {
+ const short *dc) {
int i;
for (i = 0; i < 4; i++) {
@@ -51,7 +51,7 @@
}
}
-void vp9_dequant_idct_add_y_block_mmx(short *q, short *dq,
+void vp9_dequant_idct_add_y_block_mmx(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride, unsigned short *eobs) {
@@ -93,7 +93,7 @@
}
}
-void vp9_dequant_idct_add_uv_block_mmx(short *q, short *dq,
+void vp9_dequant_idct_add_uv_block_mmx(short *q, const short *dq,
unsigned char *pre,
unsigned char *dstu,
unsigned char *dstv,
--- a/vp9/decoder/x86/idct_blk_sse2.c
+++ b/vp9/decoder/x86/idct_blk_sse2.c
@@ -12,27 +12,27 @@
#include "vp9/common/idct.h"
#include "vp9/decoder/dequantize.h"
-void vp9_idct_dequant_dc_0_2x_sse2(short *q, short *dq,
+void vp9_idct_dequant_dc_0_2x_sse2(short *q, const short *dq,
unsigned char *pre, unsigned char *dst,
- int dst_stride, short *dc);
+ int dst_stride, const short *dc);
-void vp9_idct_dequant_dc_full_2x_sse2(short *q, short *dq,
+void vp9_idct_dequant_dc_full_2x_sse2(short *q, const short *dq,
unsigned char *pre, unsigned char *dst,
- int dst_stride, short *dc);
+ int dst_stride, const short *dc);
-void vp9_idct_dequant_0_2x_sse2(short *q, short *dq,
+void vp9_idct_dequant_0_2x_sse2(short *q, const short *dq,
unsigned char *pre, unsigned char *dst,
int dst_stride, int blk_stride);
-void vp9_idct_dequant_full_2x_sse2(short *q, short *dq,
+void vp9_idct_dequant_full_2x_sse2(short *q, const short *dq,
unsigned char *pre, unsigned char *dst,
int dst_stride, int blk_stride);
-void vp9_dequant_dc_idct_add_y_block_sse2(short *q, short *dq,
+void vp9_dequant_dc_idct_add_y_block_sse2(short *q, const short *dq,
unsigned char *pre,
unsigned char *dst,
int stride, unsigned short *eobs,
- short *dc) {
+ const short *dc) {
int i;
for (i = 0; i < 4; i++) {
@@ -56,7 +56,7 @@
}
}
-void vp9_dequant_idct_add_y_block_sse2(short *q, short *dq,
+void vp9_dequant_idct_add_y_block_sse2(short *q, const short *dq,
unsigned char *pre, unsigned char *dst,
int stride, unsigned short *eobs) {
int i;
@@ -79,7 +79,7 @@
}
}
-void vp9_dequant_idct_add_uv_block_sse2(short *q, short *dq,
+void vp9_dequant_idct_add_uv_block_sse2(short *q, const short *dq,
unsigned char *pre,
unsigned char *dstu,
unsigned char *dstv,