idct8x8_add_neon.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2014 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 <arm_neon.h>
  11. #include "./vpx_config.h"
  12. #include "./vpx_dsp_rtcd.h"
  13. #include "vpx_dsp/arm/idct_neon.h"
  14. #include "vpx_dsp/arm/mem_neon.h"
  15. #include "vpx_dsp/arm/transpose_neon.h"
  16. #include "vpx_dsp/txfm_common.h"
  17. void vpx_idct8x8_64_add_neon(const tran_low_t *input, uint8_t *dest,
  18. int stride) {
  19. const int16x8_t cospis = vld1q_s16(kCospi);
  20. const int16x4_t cospis0 = vget_low_s16(cospis); // cospi 0, 8, 16, 24
  21. const int16x4_t cospis1 = vget_high_s16(cospis); // cospi 4, 12, 20, 28
  22. int16x8_t a[8];
  23. a[0] = load_tran_low_to_s16q(input);
  24. a[1] = load_tran_low_to_s16q(input + 8);
  25. a[2] = load_tran_low_to_s16q(input + 16);
  26. a[3] = load_tran_low_to_s16q(input + 24);
  27. a[4] = load_tran_low_to_s16q(input + 32);
  28. a[5] = load_tran_low_to_s16q(input + 40);
  29. a[6] = load_tran_low_to_s16q(input + 48);
  30. a[7] = load_tran_low_to_s16q(input + 56);
  31. idct8x8_64_1d_bd8(cospis0, cospis1, a);
  32. idct8x8_64_1d_bd8(cospis0, cospis1, a);
  33. idct8x8_add8x8_neon(a, dest, stride);
  34. }
  35. void vpx_idct8x8_12_add_neon(const tran_low_t *input, uint8_t *dest,
  36. int stride) {
  37. const int16x8_t cospis = vld1q_s16(kCospi);
  38. const int16x8_t cospisd = vaddq_s16(cospis, cospis);
  39. const int16x4_t cospis0 = vget_low_s16(cospis); // cospi 0, 8, 16, 24
  40. const int16x4_t cospisd0 = vget_low_s16(cospisd); // doubled 0, 8, 16, 24
  41. const int16x4_t cospisd1 = vget_high_s16(cospisd); // doubled 4, 12, 20, 28
  42. int16x4_t a[8];
  43. int16x8_t b[8];
  44. a[0] = load_tran_low_to_s16d(input);
  45. a[1] = load_tran_low_to_s16d(input + 8);
  46. a[2] = load_tran_low_to_s16d(input + 16);
  47. a[3] = load_tran_low_to_s16d(input + 24);
  48. idct8x8_12_pass1_bd8(cospis0, cospisd0, cospisd1, a);
  49. idct8x8_12_pass2_bd8(cospis0, cospisd0, cospisd1, a, b);
  50. idct8x8_add8x8_neon(b, dest, stride);
  51. }