blob: 8a85e26f3e5688c7ef3596c5440636b13ec62985 [file] [log] [blame]
Yaowu Xuc27fc142016-08-22 16:08:15 -07001/*
Yaowu Xu9c01aa12016-09-01 14:32:49 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Yaowu Xuc27fc142016-08-22 16:08:15 -07003 *
Yaowu Xu9c01aa12016-09-01 14:32:49 -07004 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Yaowu Xuc27fc142016-08-22 16:08:15 -070010 */
11
Yaowu Xuf883b422016-08-30 14:01:10 -070012#ifndef AOM_DSP_MIPS_INV_TXFM_DSPR2_H_
13#define AOM_DSP_MIPS_INV_TXFM_DSPR2_H_
Yaowu Xuc27fc142016-08-22 16:08:15 -070014
15#include <assert.h>
16
Yaowu Xuf883b422016-08-30 14:01:10 -070017#include "./aom_config.h"
18#include "aom/aom_integer.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070019#include "aom_dsp/inv_txfm.h"
20#include "aom_dsp/mips/common_dspr2.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#if HAVE_DSPR2
27#define DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input) \
28 ({ \
29 \
30 int32_t tmp, out; \
31 int dct_cost_rounding = DCT_CONST_ROUNDING; \
32 int in = input; \
33 \
34 __asm__ __volatile__(/* out = dct_const_round_shift(dc * cospi_16_64); */ \
35 "mtlo %[dct_cost_rounding], $ac1 " \
36 " \n\t" \
37 "mthi $zero, $ac1 " \
38 " \n\t" \
39 "madd $ac1, %[in], " \
40 "%[cospi_16_64] \n\t" \
41 "extp %[tmp], $ac1, " \
42 "31 \n\t" \
43 \
44 /* out = dct_const_round_shift(out * cospi_16_64); */ \
45 "mtlo %[dct_cost_rounding], $ac2 " \
46 " \n\t" \
47 "mthi $zero, $ac2 " \
48 " \n\t" \
49 "madd $ac2, %[tmp], " \
50 "%[cospi_16_64] \n\t" \
51 "extp %[out], $ac2, " \
52 "31 \n\t" \
53 \
54 : [tmp] "=&r"(tmp), [out] "=r"(out) \
55 : [in] "r"(in), \
56 [dct_cost_rounding] "r"(dct_cost_rounding), \
57 [cospi_16_64] "r"(cospi_16_64)); \
58 out; \
59 })
60
Yaowu Xuf883b422016-08-30 14:01:10 -070061void aom_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
Yaowu Xuc27fc142016-08-22 16:08:15 -070062 int dest_stride);
Yaowu Xuf883b422016-08-30 14:01:10 -070063void aom_idct4_rows_dspr2(const int16_t *input, int16_t *output);
64void aom_idct4_columns_add_blk_dspr2(int16_t *input, uint8_t *dest,
Yaowu Xuc27fc142016-08-22 16:08:15 -070065 int dest_stride);
66void iadst4_dspr2(const int16_t *input, int16_t *output);
67void idct8_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows);
68void idct8_columns_add_blk_dspr2(int16_t *input, uint8_t *dest,
69 int dest_stride);
70void iadst8_dspr2(const int16_t *input, int16_t *output);
71void idct16_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows);
72void idct16_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, int dest_stride);
73void iadst16_dspr2(const int16_t *input, int16_t *output);
74
75#endif // #if HAVE_DSPR2
76#ifdef __cplusplus
77} // extern "C"
78#endif
79
Yaowu Xuf883b422016-08-30 14:01:10 -070080#endif // AOM_DSP_MIPS_INV_TXFM_DSPR2_H_