OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_ | 11 #ifndef VPX_DSP_MIPS_INV_TXFM_DSPR2_H_ |
12 #define VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_ | 12 #define VPX_DSP_MIPS_INV_TXFM_DSPR2_H_ |
13 | 13 |
14 #include <assert.h> | 14 #include <assert.h> |
15 | 15 |
16 #include "./vpx_config.h" | 16 #include "./vpx_config.h" |
17 #include "vpx/vpx_integer.h" | 17 #include "vpx/vpx_integer.h" |
| 18 #include "vpx_dsp/inv_txfm.h" |
18 #include "vpx_dsp/mips/common_dspr2.h" | 19 #include "vpx_dsp/mips/common_dspr2.h" |
19 | 20 |
20 #ifdef __cplusplus | 21 #ifdef __cplusplus |
21 extern "C" { | 22 extern "C" { |
22 #endif | 23 #endif |
23 | 24 |
24 #if HAVE_DSPR2 | 25 #if HAVE_DSPR2 |
25 | |
26 extern uint8_t *vpx_ff_cropTbl; | |
27 | |
28 #define DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input) ({ \ | 26 #define DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input) ({ \ |
29 \ | 27 \ |
30 int32_t tmp, out; \ | 28 int32_t tmp, out; \ |
31 int dct_cost_rounding = DCT_CONST_ROUNDING; \ | 29 int dct_cost_rounding = DCT_CONST_ROUNDING; \ |
32 int in = input; \ | 30 int in = input; \ |
33 \ | 31 \ |
34 __asm__ __volatile__ ( \ | 32 __asm__ __volatile__ ( \ |
35 /* out = dct_const_round_shift(input_dc * cospi_16_64); */ \ | 33 /* out = dct_const_round_shift(input_dc * cospi_16_64); */ \ |
36 "mtlo %[dct_cost_rounding], $ac1 \n\t"\ | 34 "mtlo %[dct_cost_rounding], $ac1 \n\t"\ |
37 "mthi $zero, $ac1 \n\t"\ | 35 "mthi $zero, $ac1 \n\t"\ |
38 "madd $ac1, %[in], %[cospi_16_64] \n\t"\ | 36 "madd $ac1, %[in], %[cospi_16_64] \n\t"\ |
39 "extp %[tmp], $ac1, 31 \n\t"\ | 37 "extp %[tmp], $ac1, 31 \n\t"\ |
40 \ | 38 \ |
41 /* out = dct_const_round_shift(out * cospi_16_64); */ \ | 39 /* out = dct_const_round_shift(out * cospi_16_64); */ \ |
42 "mtlo %[dct_cost_rounding], $ac2 \n\t"\ | 40 "mtlo %[dct_cost_rounding], $ac2 \n\t"\ |
43 "mthi $zero, $ac2 \n\t"\ | 41 "mthi $zero, $ac2 \n\t"\ |
44 "madd $ac2, %[tmp], %[cospi_16_64] \n\t"\ | 42 "madd $ac2, %[tmp], %[cospi_16_64] \n\t"\ |
45 "extp %[out], $ac2, 31 \n\t"\ | 43 "extp %[out], $ac2, 31 \n\t"\ |
46 \ | 44 \ |
47 : [tmp] "=&r" (tmp), [out] "=r" (out) \ | 45 : [tmp] "=&r" (tmp), [out] "=r" (out) \ |
48 : [in] "r" (in), \ | 46 : [in] "r" (in), \ |
49 [dct_cost_rounding] "r" (dct_cost_rounding), \ | 47 [dct_cost_rounding] "r" (dct_cost_rounding), \ |
50 [cospi_16_64] "r" (cospi_16_64) \ | 48 [cospi_16_64] "r" (cospi_16_64) \ |
51 ); \ | 49 ); \ |
52 out; }) | 50 out; }) |
53 | 51 |
54 void vp9_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, | 52 void vpx_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, |
55 int dest_stride); | 53 int dest_stride); |
| 54 void vpx_idct4_rows_dspr2(const int16_t *input, int16_t *output); |
| 55 void vpx_idct4_columns_add_blk_dspr2(int16_t *input, uint8_t *dest, |
| 56 int dest_stride); |
| 57 void iadst4_dspr2(const int16_t *input, int16_t *output); |
| 58 void idct8_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows); |
| 59 void idct8_columns_add_blk_dspr2(int16_t *input, uint8_t *dest, |
| 60 int dest_stride); |
| 61 void iadst8_dspr2(const int16_t *input, int16_t *output); |
| 62 void idct16_rows_dspr2(const int16_t *input, int16_t *output, |
| 63 uint32_t no_rows); |
| 64 void idct16_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, |
| 65 int dest_stride); |
| 66 void iadst16_dspr2(const int16_t *input, int16_t *output); |
56 | 67 |
57 #endif // #if HAVE_DSPR2 | 68 #endif // #if HAVE_DSPR2 |
58 #ifdef __cplusplus | 69 #ifdef __cplusplus |
59 } // extern "C" | 70 } // extern "C" |
60 #endif | 71 #endif |
61 | 72 |
62 #endif // VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_ | 73 #endif // VPX_DSP_MIPS_INV_TXFM_DSPR2_H_ |
OLD | NEW |