vp9_fdct8x8_msa.c 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 2015 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. #include <assert.h>
  11. #include "vp9/common/vp9_enums.h"
  12. #include "vp9/encoder/mips/msa/vp9_fdct_msa.h"
  13. void vp9_fht8x8_msa(const int16_t *input, int16_t *output, int32_t stride,
  14. int32_t tx_type) {
  15. v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
  16. LD_SH8(input, stride, in0, in1, in2, in3, in4, in5, in6, in7);
  17. SLLI_4V(in0, in1, in2, in3, 2);
  18. SLLI_4V(in4, in5, in6, in7, 2);
  19. switch (tx_type) {
  20. case DCT_DCT:
  21. VP9_FDCT8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3, in4,
  22. in5, in6, in7);
  23. TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2,
  24. in3, in4, in5, in6, in7);
  25. VP9_FDCT8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3, in4,
  26. in5, in6, in7);
  27. break;
  28. case ADST_DCT:
  29. VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3, in4,
  30. in5, in6, in7);
  31. TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2,
  32. in3, in4, in5, in6, in7);
  33. VP9_FDCT8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3, in4,
  34. in5, in6, in7);
  35. break;
  36. case DCT_ADST:
  37. VP9_FDCT8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3, in4,
  38. in5, in6, in7);
  39. TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2,
  40. in3, in4, in5, in6, in7);
  41. VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3, in4,
  42. in5, in6, in7);
  43. break;
  44. case ADST_ADST:
  45. VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3, in4,
  46. in5, in6, in7);
  47. TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2,
  48. in3, in4, in5, in6, in7);
  49. VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3, in4,
  50. in5, in6, in7);
  51. break;
  52. default: assert(0); break;
  53. }
  54. TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3,
  55. in4, in5, in6, in7);
  56. SRLI_AVE_S_4V_H(in0, in1, in2, in3, in4, in5, in6, in7);
  57. ST_SH8(in0, in1, in2, in3, in4, in5, in6, in7, output, 8);
  58. }