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