2
0

inv_txfm_dspr2.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. #ifndef VPX_DSP_MIPS_INV_TXFM_DSPR2_H_
  11. #define VPX_DSP_MIPS_INV_TXFM_DSPR2_H_
  12. #include <assert.h>
  13. #include "./vpx_config.h"
  14. #include "vpx/vpx_integer.h"
  15. #include "vpx_dsp/inv_txfm.h"
  16. #include "vpx_dsp/mips/common_dspr2.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #if HAVE_DSPR2
  21. #define DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input) \
  22. ({ \
  23. \
  24. int32_t tmp, out; \
  25. int dct_cost_rounding = DCT_CONST_ROUNDING; \
  26. int in = input; \
  27. \
  28. __asm__ __volatile__(/* out = dct_const_round_shift(dc * cospi_16_64); */ \
  29. "mtlo %[dct_cost_rounding], $ac1 " \
  30. " \n\t" \
  31. "mthi $zero, $ac1 " \
  32. " \n\t" \
  33. "madd $ac1, %[in], " \
  34. "%[cospi_16_64] \n\t" \
  35. "extp %[tmp], $ac1, " \
  36. "31 \n\t" \
  37. \
  38. /* out = dct_const_round_shift(out * cospi_16_64); */ \
  39. "mtlo %[dct_cost_rounding], $ac2 " \
  40. " \n\t" \
  41. "mthi $zero, $ac2 " \
  42. " \n\t" \
  43. "madd $ac2, %[tmp], " \
  44. "%[cospi_16_64] \n\t" \
  45. "extp %[out], $ac2, " \
  46. "31 \n\t" \
  47. \
  48. : [tmp] "=&r"(tmp), [out] "=r"(out) \
  49. : [in] "r"(in), \
  50. [dct_cost_rounding] "r"(dct_cost_rounding), \
  51. [cospi_16_64] "r"(cospi_16_64)); \
  52. out; \
  53. })
  54. void vpx_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, int stride);
  55. void vpx_idct4_rows_dspr2(const int16_t *input, int16_t *output);
  56. void vpx_idct4_columns_add_blk_dspr2(int16_t *input, uint8_t *dest, int 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, int stride);
  60. void iadst8_dspr2(const int16_t *input, int16_t *output);
  61. void idct16_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows);
  62. void idct16_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, int stride);
  63. void iadst16_dspr2(const int16_t *input, int16_t *output);
  64. #endif // #if HAVE_DSPR2
  65. #ifdef __cplusplus
  66. } // extern "C"
  67. #endif
  68. #endif // VPX_DSP_MIPS_INV_TXFM_DSPR2_H_