2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
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.
11 #ifndef VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_
12 #define VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_
16 #include "./vpx_config.h"
17 #include "vpx/vpx_integer.h"
18 #include "vp9/common/vp9_common.h"
25 #define CROP_WIDTH 512
26 extern uint8_t *vp9_ff_cropTbl;
28 #define DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input) ({ \
31 int dct_cost_rounding = DCT_CONST_ROUNDING; \
34 __asm__ __volatile__ ( \
35 /* out = dct_const_round_shift(input_dc * cospi_16_64); */ \
36 "mtlo %[dct_cost_rounding], $ac1 \n\t"\
37 "mthi $zero, $ac1 \n\t"\
38 "madd $ac1, %[in], %[cospi_16_64] \n\t"\
39 "extp %[tmp], $ac1, 31 \n\t"\
41 /* out = dct_const_round_shift(out * cospi_16_64); */ \
42 "mtlo %[dct_cost_rounding], $ac2 \n\t"\
43 "mthi $zero, $ac2 \n\t"\
44 "madd $ac2, %[tmp], %[cospi_16_64] \n\t"\
45 "extp %[out], $ac2, 31 \n\t"\
47 : [tmp] "=&r" (tmp), [out] "=r" (out) \
49 [dct_cost_rounding] "r" (dct_cost_rounding), \
50 [cospi_16_64] "r" (cospi_16_64) \
54 static INLINE void vp9_prefetch_load(const unsigned char *src) {
55 __asm__ __volatile__ (
56 "pref 0, 0(%[src]) \n\t"
62 /* prefetch data for store */
63 static INLINE void vp9_prefetch_store(unsigned char *dst) {
64 __asm__ __volatile__ (
65 "pref 1, 0(%[dst]) \n\t"
71 static INLINE void vp9_prefetch_load_streamed(const unsigned char *src) {
72 __asm__ __volatile__ (
73 "pref 4, 0(%[src]) \n\t"
79 /* prefetch data for store */
80 static INLINE void vp9_prefetch_store_streamed(unsigned char *dst) {
81 __asm__ __volatile__ (
82 "pref 5, 0(%[dst]) \n\t"
88 void vp9_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
91 void vp9_convolve2_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride,
92 uint8_t *dst, ptrdiff_t dst_stride,
93 const int16_t *filter_x, int x_step_q4,
94 const int16_t *filter_y, int y_step_q4,
97 void vp9_convolve2_avg_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride,
98 uint8_t *dst, ptrdiff_t dst_stride,
99 const int16_t *filter_x, int x_step_q4,
100 const int16_t *filter_y, int y_step_q4,
103 void vp9_convolve2_avg_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride,
104 uint8_t *dst, ptrdiff_t dst_stride,
105 const int16_t *filter_x, int x_step_q4,
106 const int16_t *filter_y, int y_step_q4,
109 void vp9_convolve2_dspr2(const uint8_t *src, ptrdiff_t src_stride,
110 uint8_t *dst, ptrdiff_t dst_stride,
111 const int16_t *filter,
114 void vp9_convolve2_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride,
115 uint8_t *dst, ptrdiff_t dst_stride,
116 const int16_t *filter_x, int x_step_q4,
117 const int16_t *filter_y, int y_step_q4,
120 #endif // #if HAVE_DSPR2
125 #endif // VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_