inv_txfm_dspr2.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_VPX_DSP_MIPS_INV_TXFM_DSPR2_H_
  11. #define VPX_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. int32_t tmp, out; \
  24. int dct_cost_rounding = DCT_CONST_ROUNDING; \
  25. int in = input; \
  26. \
  27. __asm__ __volatile__(/* out = dct_const_round_shift(dc * cospi_16_64); */ \
  28. "mtlo %[dct_cost_rounding], $ac1 " \
  29. " \n\t" \
  30. "mthi $zero, $ac1 " \
  31. " \n\t" \
  32. "madd $ac1, %[in], " \
  33. "%[cospi_16_64] \n\t" \
  34. "extp %[tmp], $ac1, " \
  35. "31 \n\t" \
  36. \
  37. /* out = dct_const_round_shift(out * cospi_16_64); */ \
  38. "mtlo %[dct_cost_rounding], $ac2 " \
  39. " \n\t" \
  40. "mthi $zero, $ac2 " \
  41. " \n\t" \
  42. "madd $ac2, %[tmp], " \
  43. "%[cospi_16_64] \n\t" \
  44. "extp %[out], $ac2, " \
  45. "31 \n\t" \
  46. \
  47. : [tmp] "=&r"(tmp), [out] "=r"(out) \
  48. : [in] "r"(in), \
  49. [dct_cost_rounding] "r"(dct_cost_rounding), \
  50. [cospi_16_64] "r"(cospi_16_64)); \
  51. out; \
  52. })
  53. void vpx_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, int 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, int stride);
  56. void iadst4_dspr2(const int16_t *input, int16_t *output);
  57. void idct8_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows);
  58. void idct8_columns_add_blk_dspr2(int16_t *input, uint8_t *dest, int stride);
  59. void iadst8_dspr2(const int16_t *input, int16_t *output);
  60. void idct16_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows);
  61. void idct16_cols_add_blk_dspr2(int16_t *input, uint8_t *dest, int stride);
  62. void iadst16_dspr2(const int16_t *input, int16_t *output);
  63. #endif // #if HAVE_DSPR2
  64. #ifdef __cplusplus
  65. } // extern "C"
  66. #endif
  67. #endif // VPX_VPX_DSP_MIPS_INV_TXFM_DSPR2_H_