Commit 65f118d7 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Making input pointer of any inverse transform constant.

Also renaming dest_stride to stride in some places.

Change-Id: I75f602b623a5a7071d4922b747c45fa0b7d7a940
parent ac468dde
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
extern "C" { extern "C" {
#include "vp9/common/vp9_entropy.h" #include "vp9/common/vp9_entropy.h"
#include "./vp9_rtcd.h" #include "./vp9_rtcd.h"
void vp9_idct16x16_256_add_c(int16_t *input, uint8_t *output, int pitch); void vp9_idct16x16_256_add_c(const int16_t *input, uint8_t *output, int pitch);
} }
#include "vpx/vpx_integer.h" #include "vpx/vpx_integer.h"
...@@ -258,9 +258,10 @@ void reference_16x16_dct_2d(int16_t input[256], double output[256]) { ...@@ -258,9 +258,10 @@ void reference_16x16_dct_2d(int16_t input[256], double output[256]) {
} }
typedef void (*fdct_t)(int16_t *in, int16_t *out, int stride); typedef void (*fdct_t)(int16_t *in, int16_t *out, int stride);
typedef void (*idct_t)(int16_t *in, uint8_t *dst, int stride); typedef void (*idct_t)(const int16_t *in, uint8_t *dst, int stride);
typedef void (*fht_t) (int16_t *in, int16_t *out, int stride, int tx_type); typedef void (*fht_t) (int16_t *in, int16_t *out, int stride, int tx_type);
typedef void (*iht_t) (int16_t *in, uint8_t *dst, int stride, int tx_type); typedef void (*iht_t) (const int16_t *in, uint8_t *dst, int stride,
int tx_type);
void fdct16x16_ref(int16_t *in, int16_t *out, int stride, int tx_type) { void fdct16x16_ref(int16_t *in, int16_t *out, int stride, int tx_type) {
vp9_short_fdct16x16_c(in, out, stride); vp9_short_fdct16x16_c(in, out, stride);
......
...@@ -75,7 +75,7 @@ void reference_32x32_dct_2d(const int16_t input[kNumCoeffs], ...@@ -75,7 +75,7 @@ void reference_32x32_dct_2d(const int16_t input[kNumCoeffs],
} }
typedef void (*fwd_txfm_t)(int16_t *in, int16_t *out, int stride); typedef void (*fwd_txfm_t)(int16_t *in, int16_t *out, int stride);
typedef void (*inv_txfm_t)(int16_t *in, uint8_t *dst, int stride); typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *dst, int stride);
class Trans32x32Test : public PARAMS(fwd_txfm_t, inv_txfm_t, int) { class Trans32x32Test : public PARAMS(fwd_txfm_t, inv_txfm_t, int) {
public: public:
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
extern "C" { extern "C" {
#include "vp9/common/vp9_entropy.h" #include "vp9/common/vp9_entropy.h"
#include "./vp9_rtcd.h" #include "./vp9_rtcd.h"
void vp9_idct8x8_64_add_c(int16_t *input, uint8_t *output, int pitch); void vp9_idct8x8_64_add_c(const int16_t *input, uint8_t *output, int pitch);
} }
#include "vpx/vpx_integer.h" #include "vpx/vpx_integer.h"
...@@ -29,9 +29,10 @@ using libvpx_test::ACMRandom; ...@@ -29,9 +29,10 @@ using libvpx_test::ACMRandom;
namespace { namespace {
typedef void (*fdct_t)(int16_t *in, int16_t *out, int stride); typedef void (*fdct_t)(int16_t *in, int16_t *out, int stride);
typedef void (*idct_t)(int16_t *in, uint8_t *dst, int stride); typedef void (*idct_t)(const int16_t *in, uint8_t *dst, int stride);
typedef void (*fht_t) (int16_t *in, int16_t *out, int stride, int tx_type); typedef void (*fht_t) (int16_t *in, int16_t *out, int stride, int tx_type);
typedef void (*iht_t) (int16_t *in, uint8_t *dst, int stride, int tx_type); typedef void (*iht_t) (const int16_t *in, uint8_t *dst, int stride,
int tx_type);
void fdct8x8_ref(int16_t *in, int16_t *out, int stride, int tx_type) { void fdct8x8_ref(int16_t *in, int16_t *out, int stride, int tx_type) {
vp9_short_fdct8x8_c(in, out, stride); vp9_short_fdct8x8_c(in, out, stride);
......
...@@ -11,31 +11,31 @@ ...@@ -11,31 +11,31 @@
#include "./vp9_rtcd.h" #include "./vp9_rtcd.h"
#include "vp9/common/vp9_common.h" #include "vp9/common/vp9_common.h"
extern void vp9_idct16x16_256_add_neon_pass1(int16_t *input, void vp9_idct16x16_256_add_neon_pass1(const int16_t *input,
int16_t *output, int16_t *output,
int output_stride); int output_stride);
extern void vp9_idct16x16_256_add_neon_pass2(int16_t *src, void vp9_idct16x16_256_add_neon_pass2(const int16_t *src,
int16_t *output, int16_t *output,
int16_t *pass1Output, int16_t *pass1Output,
int16_t skip_adding, int16_t skip_adding,
uint8_t *dest, uint8_t *dest,
int dest_stride); int dest_stride);
extern void vp9_idct16x16_10_add_neon_pass1(int16_t *input, void vp9_idct16x16_10_add_neon_pass1(const int16_t *input,
int16_t *output, int16_t *output,
int output_stride); int output_stride);
extern void vp9_idct16x16_10_add_neon_pass2(int16_t *src, void vp9_idct16x16_10_add_neon_pass2(const int16_t *src,
int16_t *output, int16_t *output,
int16_t *pass1Output, int16_t *pass1Output,
int16_t skip_adding, int16_t skip_adding,
uint8_t *dest, uint8_t *dest,
int dest_stride); int dest_stride);
/* For ARM NEON, d8-d15 are callee-saved registers, and need to be saved. */ /* For ARM NEON, d8-d15 are callee-saved registers, and need to be saved. */
extern void vp9_push_neon(int64_t *store); extern void vp9_push_neon(int64_t *store);
extern void vp9_pop_neon(int64_t *store); extern void vp9_pop_neon(int64_t *store);
void vp9_idct16x16_256_add_neon(int16_t *input, void vp9_idct16x16_256_add_neon(const int16_t *input,
uint8_t *dest, int dest_stride) { uint8_t *dest, int dest_stride) {
int64_t store_reg[8]; int64_t store_reg[8];
int16_t pass1_output[16*16] = {0}; int16_t pass1_output[16*16] = {0};
int16_t row_idct_output[16*16] = {0}; int16_t row_idct_output[16*16] = {0};
...@@ -109,8 +109,8 @@ void vp9_idct16x16_256_add_neon(int16_t *input, ...@@ -109,8 +109,8 @@ void vp9_idct16x16_256_add_neon(int16_t *input,
return; return;
} }
void vp9_idct16x16_10_add_neon(int16_t *input, void vp9_idct16x16_10_add_neon(const int16_t *input,
uint8_t *dest, int dest_stride) { uint8_t *dest, int dest_stride) {
int64_t store_reg[8]; int64_t store_reg[8];
int16_t pass1_output[16*16] = {0}; int16_t pass1_output[16*16] = {0};
int16_t row_idct_output[16*16] = {0}; int16_t row_idct_output[16*16] = {0};
......
...@@ -221,7 +221,7 @@ typedef struct macroblockd { ...@@ -221,7 +221,7 @@ typedef struct macroblockd {
int lossless; int lossless;
/* Inverse transform function pointers. */ /* Inverse transform function pointers. */
void (*itxm_add)(int16_t *input, uint8_t *dest, int stride, int eob); void (*itxm_add)(const int16_t *input, uint8_t *dest, int stride, int eob);
struct subpix_fn_table subpix; struct subpix_fn_table subpix;
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
#include "vp9/common/vp9_common.h" #include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_idct.h" #include "vp9/common/vp9_idct.h"
void vp9_iwht4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride) { void vp9_iwht4x4_16_add_c(const int16_t *input, uint8_t *dest, int stride) {
/* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds, /* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds,
0.5 shifts per pixel. */ 0.5 shifts per pixel. */
int i; int i;
int16_t output[16]; int16_t output[16];
int a1, b1, c1, d1, e1; int a1, b1, c1, d1, e1;
int16_t *ip = input; const int16_t *ip = input;
int16_t *op = output; int16_t *op = output;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
...@@ -60,21 +60,21 @@ void vp9_iwht4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride) { ...@@ -60,21 +60,21 @@ void vp9_iwht4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride) {
c1 = e1 - c1; c1 = e1 - c1;
a1 -= b1; a1 -= b1;
d1 += c1; d1 += c1;
dest[dest_stride * 0] = clip_pixel(dest[dest_stride * 0] + a1); dest[stride * 0] = clip_pixel(dest[stride * 0] + a1);
dest[dest_stride * 1] = clip_pixel(dest[dest_stride * 1] + b1); dest[stride * 1] = clip_pixel(dest[stride * 1] + b1);
dest[dest_stride * 2] = clip_pixel(dest[dest_stride * 2] + c1); dest[stride * 2] = clip_pixel(dest[stride * 2] + c1);
dest[dest_stride * 3] = clip_pixel(dest[dest_stride * 3] + d1); dest[stride * 3] = clip_pixel(dest[stride * 3] + d1);
ip++; ip++;
dest++; dest++;
} }
} }
void vp9_iwht4x4_1_add_c(int16_t *in, uint8_t *dest, int dest_stride) { void vp9_iwht4x4_1_add_c(const int16_t *in, uint8_t *dest, int dest_stride) {
int i; int i;
int a1, e1; int a1, e1;
int16_t tmp[4]; int16_t tmp[4];
int16_t *ip = in; const int16_t *ip = in;
int16_t *op = tmp; int16_t *op = tmp;
a1 = ip[0] >> UNIT_QUANT_SHIFT; a1 = ip[0] >> UNIT_QUANT_SHIFT;
...@@ -116,7 +116,7 @@ static void idct4_1d(const int16_t *input, int16_t *output) { ...@@ -116,7 +116,7 @@ static void idct4_1d(const int16_t *input, int16_t *output) {
output[3] = step[0] - step[3]; output[3] = step[0] - step[3];
} }
void vp9_idct4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride) { void vp9_idct4x4_16_add_c(const int16_t *input, uint8_t *dest, int stride) {
int16_t out[4 * 4]; int16_t out[4 * 4];
int16_t *outptr = out; int16_t *outptr = out;
int i, j; int i, j;
...@@ -135,12 +135,12 @@ void vp9_idct4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride) { ...@@ -135,12 +135,12 @@ void vp9_idct4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride) {
temp_in[j] = out[j * 4 + i]; temp_in[j] = out[j * 4 + i];
idct4_1d(temp_in, temp_out); idct4_1d(temp_in, temp_out);
for (j = 0; j < 4; ++j) for (j = 0; j < 4; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 4) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 4)
+ dest[j * dest_stride + i]); + dest[j * stride + i]);
} }
} }
void vp9_idct4x4_1_add_c(int16_t *input, uint8_t *dest, int dest_stride) { void vp9_idct4x4_1_add_c(const int16_t *input, uint8_t *dest, int dest_stride) {
int i; int i;
int a1; int a1;
int16_t out = dct_const_round_shift(input[0] * cospi_16_64); int16_t out = dct_const_round_shift(input[0] * cospi_16_64);
...@@ -201,7 +201,7 @@ static void idct8_1d(const int16_t *input, int16_t *output) { ...@@ -201,7 +201,7 @@ static void idct8_1d(const int16_t *input, int16_t *output) {
output[7] = step1[0] - step1[7]; output[7] = step1[0] - step1[7];
} }
void vp9_idct8x8_64_add_c(int16_t *input, uint8_t *dest, int dest_stride) { void vp9_idct8x8_64_add_c(const int16_t *input, uint8_t *dest, int stride) {
int16_t out[8 * 8]; int16_t out[8 * 8];
int16_t *outptr = out; int16_t *outptr = out;
int i, j; int i, j;
...@@ -220,12 +220,12 @@ void vp9_idct8x8_64_add_c(int16_t *input, uint8_t *dest, int dest_stride) { ...@@ -220,12 +220,12 @@ void vp9_idct8x8_64_add_c(int16_t *input, uint8_t *dest, int dest_stride) {
temp_in[j] = out[j * 8 + i]; temp_in[j] = out[j * 8 + i];
idct8_1d(temp_in, temp_out); idct8_1d(temp_in, temp_out);
for (j = 0; j < 8; ++j) for (j = 0; j < 8; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5)
+ dest[j * dest_stride + i]); + dest[j * stride + i]);
} }
} }
void vp9_idct8x8_1_add_c(int16_t *input, uint8_t *dest, int dest_stride) { void vp9_idct8x8_1_add_c(const int16_t *input, uint8_t *dest, int stride) {
int i, j; int i, j;
int a1; int a1;
int16_t out = dct_const_round_shift(input[0] * cospi_16_64); int16_t out = dct_const_round_shift(input[0] * cospi_16_64);
...@@ -234,7 +234,7 @@ void vp9_idct8x8_1_add_c(int16_t *input, uint8_t *dest, int dest_stride) { ...@@ -234,7 +234,7 @@ void vp9_idct8x8_1_add_c(int16_t *input, uint8_t *dest, int dest_stride) {
for (j = 0; j < 8; ++j) { for (j = 0; j < 8; ++j) {
for (i = 0; i < 8; ++i) for (i = 0; i < 8; ++i)
dest[i] = clip_pixel(dest[i] + a1); dest[i] = clip_pixel(dest[i] + a1);
dest += dest_stride; dest += stride;
} }
} }
...@@ -280,8 +280,8 @@ static void iadst4_1d(const int16_t *input, int16_t *output) { ...@@ -280,8 +280,8 @@ static void iadst4_1d(const int16_t *input, int16_t *output) {
output[3] = dct_const_round_shift(s3); output[3] = dct_const_round_shift(s3);
} }
void vp9_iht4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride, void vp9_iht4x4_16_add_c(const int16_t *input, uint8_t *dest, int stride,
int tx_type) { int tx_type) {
const transform_2d IHT_4[] = { const transform_2d IHT_4[] = {
{ idct4_1d, idct4_1d }, // DCT_DCT = 0 { idct4_1d, idct4_1d }, // DCT_DCT = 0
{ iadst4_1d, idct4_1d }, // ADST_DCT = 1 { iadst4_1d, idct4_1d }, // ADST_DCT = 1
...@@ -307,8 +307,8 @@ void vp9_iht4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride, ...@@ -307,8 +307,8 @@ void vp9_iht4x4_16_add_c(int16_t *input, uint8_t *dest, int dest_stride,
temp_in[j] = out[j * 4 + i]; temp_in[j] = out[j * 4 + i];
IHT_4[tx_type].cols(temp_in, temp_out); IHT_4[tx_type].cols(temp_in, temp_out);
for (j = 0; j < 4; ++j) for (j = 0; j < 4; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 4) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 4)
+ dest[j * dest_stride + i]); + dest[j * stride + i]);
} }
} }
static void iadst8_1d(const int16_t *input, int16_t *output) { static void iadst8_1d(const int16_t *input, int16_t *output) {
...@@ -395,8 +395,8 @@ static const transform_2d IHT_8[] = { ...@@ -395,8 +395,8 @@ static const transform_2d IHT_8[] = {
{ iadst8_1d, iadst8_1d } // ADST_ADST = 3 { iadst8_1d, iadst8_1d } // ADST_ADST = 3
}; };
void vp9_iht8x8_64_add_c(int16_t *input, uint8_t *dest, int dest_stride, void vp9_iht8x8_64_add_c(const int16_t *input, uint8_t *dest, int stride,
int tx_type) { int tx_type) {
int i, j; int i, j;
int16_t out[8 * 8]; int16_t out[8 * 8];
int16_t *outptr = out; int16_t *outptr = out;
...@@ -416,12 +416,12 @@ void vp9_iht8x8_64_add_c(int16_t *input, uint8_t *dest, int dest_stride, ...@@ -416,12 +416,12 @@ void vp9_iht8x8_64_add_c(int16_t *input, uint8_t *dest, int dest_stride,
temp_in[j] = out[j * 8 + i]; temp_in[j] = out[j * 8 + i];
ht.cols(temp_in, temp_out); ht.cols(temp_in, temp_out);
for (j = 0; j < 8; ++j) for (j = 0; j < 8; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5)
+ dest[j * dest_stride + i]); } + dest[j * stride + i]);
}
} }
void vp9_idct8x8_10_add_c(int16_t *input, uint8_t *dest, void vp9_idct8x8_10_add_c(const int16_t *input, uint8_t *dest, int stride) {
int dest_stride) {
int16_t out[8 * 8] = { 0 }; int16_t out[8 * 8] = { 0 };
int16_t *outptr = out; int16_t *outptr = out;
int i, j; int i, j;
...@@ -441,8 +441,8 @@ void vp9_idct8x8_10_add_c(int16_t *input, uint8_t *dest, ...@@ -441,8 +441,8 @@ void vp9_idct8x8_10_add_c(int16_t *input, uint8_t *dest,
temp_in[j] = out[j * 8 + i]; temp_in[j] = out[j * 8 + i];
idct8_1d(temp_in, temp_out); idct8_1d(temp_in, temp_out);
for (j = 0; j < 8; ++j) for (j = 0; j < 8; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5)
+ dest[j * dest_stride + i]); + dest[j * stride + i]);
} }
} }
...@@ -611,7 +611,7 @@ static void idct16_1d(const int16_t *input, int16_t *output) { ...@@ -611,7 +611,7 @@ static void idct16_1d(const int16_t *input, int16_t *output) {
output[15] = step2[0] - step2[15]; output[15] = step2[0] - step2[15];
} }
void vp9_idct16x16_256_add_c(int16_t *input, uint8_t *dest, int dest_stride) { void vp9_idct16x16_256_add_c(const int16_t *input, uint8_t *dest, int stride) {
int16_t out[16 * 16]; int16_t out[16 * 16];
int16_t *outptr = out; int16_t *outptr = out;
int i, j; int i, j;
...@@ -630,8 +630,8 @@ void vp9_idct16x16_256_add_c(int16_t *input, uint8_t *dest, int dest_stride) { ...@@ -630,8 +630,8 @@ void vp9_idct16x16_256_add_c(int16_t *input, uint8_t *dest, int dest_stride) {
temp_in[j] = out[j * 16 + i]; temp_in[j] = out[j * 16 + i];
idct16_1d(temp_in, temp_out); idct16_1d(temp_in, temp_out);
for (j = 0; j < 16; ++j) for (j = 0; j < 16; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
+ dest[j * dest_stride + i]); + dest[j * stride + i]);
} }
} }
...@@ -813,8 +813,8 @@ static const transform_2d IHT_16[] = { ...@@ -813,8 +813,8 @@ static const transform_2d IHT_16[] = {
{ iadst16_1d, iadst16_1d } // ADST_ADST = 3 { iadst16_1d, iadst16_1d } // ADST_ADST = 3
}; };
void vp9_iht16x16_256_add_c(int16_t *input, uint8_t *dest, int dest_stride, void vp9_iht16x16_256_add_c(const int16_t *input, uint8_t *dest, int stride,
int tx_type) { int tx_type) {
int i, j; int i, j;
int16_t out[16 * 16]; int16_t out[16 * 16];
int16_t *outptr = out; int16_t *outptr = out;
...@@ -834,12 +834,11 @@ void vp9_iht16x16_256_add_c(int16_t *input, uint8_t *dest, int dest_stride, ...@@ -834,12 +834,11 @@ void vp9_iht16x16_256_add_c(int16_t *input, uint8_t *dest, int dest_stride,
temp_in[j] = out[j * 16 + i]; temp_in[j] = out[j * 16 + i];
ht.cols(temp_in, temp_out); ht.cols(temp_in, temp_out);
for (j = 0; j < 16; ++j) for (j = 0; j < 16; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
+ dest[j * dest_stride + i]); } + dest[j * stride + i]); }
} }
void vp9_idct16x16_10_add_c(int16_t *input, uint8_t *dest, void vp9_idct16x16_10_add_c(const int16_t *input, uint8_t *dest, int stride) {
int dest_stride) {
int16_t out[16 * 16] = { 0 }; int16_t out[16 * 16] = { 0 };
int16_t *outptr = out; int16_t *outptr = out;
int i, j; int i, j;
...@@ -859,13 +858,12 @@ void vp9_idct16x16_10_add_c(int16_t *input, uint8_t *dest, ...@@ -859,13 +858,12 @@ void vp9_idct16x16_10_add_c(int16_t *input, uint8_t *dest,
temp_in[j] = out[j*16 + i]; temp_in[j] = out[j*16 + i];
idct16_1d(temp_in, temp_out); idct16_1d(temp_in, temp_out);
for (j = 0; j < 16; ++j) for (j = 0; j < 16; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
+ dest[j * dest_stride + i]); + dest[j * stride + i]);
} }
} }
void vp9_idct16x16_1_add_c(int16_t *input, uint8_t *dest, void vp9_idct16x16_1_add_c(const int16_t *input, uint8_t *dest, int stride) {
int dest_stride) {
int i, j; int i, j;
int a1; int a1;
int16_t out = dct_const_round_shift(input[0] * cospi_16_64); int16_t out = dct_const_round_shift(input[0] * cospi_16_64);
...@@ -874,7 +872,7 @@ void vp9_idct16x16_1_add_c(int16_t *input, uint8_t *dest, ...@@ -874,7 +872,7 @@ void vp9_idct16x16_1_add_c(int16_t *input, uint8_t *dest,
for (j = 0; j < 16; ++j) { for (j = 0; j < 16; ++j) {
for (i = 0; i < 16; ++i) for (i = 0; i < 16; ++i)
dest[i] = clip_pixel(dest[i] + a1); dest[i] = clip_pixel(dest[i] + a1);
dest += dest_stride; dest += stride;
} }
} }
...@@ -1245,7 +1243,7 @@ static void idct32_1d(const int16_t *input, int16_t *output) { ...@@ -1245,7 +1243,7 @@ static void idct32_1d(const int16_t *input, int16_t *output) {
output[31] = step1[0] - step1[31]; output[31] = step1[0] - step1[31];
} }
void vp9_idct32x32_1024_add_c(int16_t *input, uint8_t *dest, int dest_stride) { void vp9_idct32x32_1024_add_c(const int16_t *input, uint8_t *dest, int stride) {
int16_t out[32 * 32]; int16_t out[32 * 32];
int16_t *outptr = out; int16_t *outptr = out;
int i, j; int i, j;
...@@ -1277,13 +1275,12 @@ void vp9_idct32x32_1024_add_c(int16_t *input, uint8_t *dest, int dest_stride) { ...@@ -1277,13 +1275,12 @@ void vp9_idct32x32_1024_add_c(int16_t *input, uint8_t *dest, int dest_stride) {
temp_in[j] = out[j * 32 + i]; temp_in[j] = out[j * 32 + i];
idct32_1d(temp_in, temp_out); idct32_1d(temp_in, temp_out);
for (j = 0; j < 32; ++j) for (j = 0; j < 32; ++j)
dest[j * dest_stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6) dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
+ dest[j * dest_stride + i]); + dest[j * stride + i]);
} }
} }
void vp9_idct32x32_1_add_c(int16_t *input, uint8_t *dest, void vp9_idct32x32_1_add_c(const int16_t *input, uint8_t *dest, int stride) {
int dest_stride) {
int i, j; int i, j;
int a1; int a1;
...@@ -1294,12 +1291,12 @@ void vp9_idct32x32_1_add_c(int16_t *input, uint8_t *dest, ...@@ -1294,12 +1291,12 @@ void vp9_idct32x32_1_add_c(int16_t *input, uint8_t *dest,
for (j = 0; j < 32; ++j) { for (j = 0; j < 32; ++j) {
for (i = 0; i < 32; ++i) for (i = 0; i < 32; ++i)
dest[i] = clip_pixel(dest[i] + a1); dest[i] = clip_pixel(dest[i] + a1);
dest += dest_stride; dest += stride;
} }
} }
// idct // idct
void vp9_idct4x4_add(int16_t *input, uint8_t *dest, int stride, int eob) { void vp9_idct4x4_add(const int16_t *input, uint8_t *dest, int stride, int eob) {
if (eob > 1) if (eob > 1)
vp9_idct4x4_16_add(input, dest, stride); vp9_idct4x4_16_add(input, dest, stride);
else else
...@@ -1307,14 +1304,14 @@ void vp9_idct4x4_add(int16_t *input, uint8_t *dest, int stride, int eob) { ...@@ -1307,14 +1304,14 @@ void vp9_idct4x4_add(int16_t *input, uint8_t *dest, int stride, int eob) {
} }
void vp9_iwht4x4_add(int16_t *input, uint8_t *dest, int stride, int eob) { void vp9_iwht4x4_add(const int16_t *input, uint8_t *dest, int stride, int eob) {
if (eob > 1) if (eob > 1)
vp9_iwht4x4_16_add(input, dest, stride); vp9_iwht4x4_16_add(input, dest, stride);
else else
vp9_iwht4x4_1_add(input, dest, stride); vp9_iwht4x4_1_add(input, dest, stride);
} }
void vp9_idct8x8_add(int16_t *input, uint8_t *dest, int stride, int eob) { void vp9_idct8x8_add(const int16_t *input, uint8_t *dest, int stride, int eob) {
// If dc is 1, then input[0] is the reconstructed value, do not need // If dc is 1, then input[0] is the reconstructed value, do not need
// dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1. // dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1.
...@@ -1333,7 +1330,8 @@ void vp9_idct8x8_add(int16_t *input, uint8_t *dest, int stride, int eob) { ...@@ -1333,7 +1330,8 @@ void vp9_idct8x8_add(int16_t *input, uint8_t *dest, int stride, int eob) {
} }
} }
void vp9_idct16x16_add(int16_t *input, uint8_t *dest, int stride, int eob) { void vp9_idct16x16_add(const int16_t *input, uint8_t *dest, int stride,
int eob) {
/* The calculation can be simplified if there are not many non-zero dct /* The calculation can be simplified if there are not many non-zero dct
* coefficients. Use eobs to separate different cases. */ * coefficients. Use eobs to separate different cases. */
if (eob)