Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 11 | #ifndef AOM_DSP_MIPS_INV_TXFM_DSPR2_H_ |
| 12 | #define AOM_DSP_MIPS_INV_TXFM_DSPR2_H_ |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 13 | |
| 14 | #include <assert.h> |
| 15 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 16 | #include "./aom_config.h" |
| 17 | #include "aom/aom_integer.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 18 | #include "aom_dsp/inv_txfm.h" |
| 19 | #include "aom_dsp/mips/common_dspr2.h" |
| 20 | |
| 21 | #ifdef __cplusplus |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
| 25 | #if HAVE_DSPR2 |
| 26 | #define DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input) \ |
| 27 | ({ \ |
| 28 | \ |
| 29 | int32_t tmp, out; \ |
| 30 | int dct_cost_rounding = DCT_CONST_ROUNDING; \ |
| 31 | int in = input; \ |
| 32 | \ |
| 33 | __asm__ __volatile__(/* out = dct_const_round_shift(dc * cospi_16_64); */ \ |
| 34 | "mtlo %[dct_cost_rounding], $ac1 " \ |
| 35 | " \n\t" \ |
| 36 | "mthi $zero, $ac1 " \ |
| 37 | " \n\t" \ |
| 38 | "madd $ac1, %[in], " \ |
| 39 | "%[cospi_16_64] \n\t" \ |
| 40 | "extp %[tmp], $ac1, " \ |
| 41 | "31 \n\t" \ |
| 42 | \ |
| 43 | /* out = dct_const_round_shift(out * cospi_16_64); */ \ |
| 44 | "mtlo %[dct_cost_rounding], $ac2 " \ |
| 45 | " \n\t" \ |
| 46 | "mthi $zero, $ac2 " \ |
| 47 | " \n\t" \ |
| 48 | "madd $ac2, %[tmp], " \ |
| 49 | "%[cospi_16_64] \n\t" \ |
| 50 | "extp %[out], $ac2, " \ |
| 51 | "31 \n\t" \ |
| 52 | \ |
| 53 | : [tmp] "=&r"(tmp), [out] "=r"(out) \ |
| 54 | : [in] "r"(in), \ |
| 55 | [dct_cost_rounding] "r"(dct_cost_rounding), \ |
| 56 | [cospi_16_64] "r"(cospi_16_64)); \ |
| 57 | out; \ |
| 58 | }) |
| 59 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 60 | void aom_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 61 | int dest_stride); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 62 | void aom_idct4_rows_dspr2(const int16_t *input, int16_t *output); |
| 63 | void aom_idct4_columns_add_blk_dspr2(int16_t *input, uint8_t *dest, |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 64 | int dest_stride); |
| 65 | void iadst4_dspr2(const int16_t *input, int16_t *output); |
| 66 | void idct8_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows); |
| 67 | void idct8_columns_add_blk_dspr2(int16_t *input, uint8_t *dest, |
| 68 | int dest_stride); |
| 69 | void iadst8_dspr2(const int16_t *input, int16_t *output); |
| 70 | void idct16_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows); |
| 71 | void idct16_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, int dest_stride); |
| 72 | void iadst16_dspr2(const int16_t *input, int16_t *output); |
| 73 | |
| 74 | #endif // #if HAVE_DSPR2 |
| 75 | #ifdef __cplusplus |
| 76 | } // extern "C" |
| 77 | #endif |
| 78 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 79 | #endif // AOM_DSP_MIPS_INV_TXFM_DSPR2_H_ |