1 /*
2 * Copyright (c) 2023 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 <assert.h>
12
13 #include "./vpx_dsp_rtcd.h"
14 #include "vpx_dsp/arm/vpx_convolve8_neon.h"
15 #include "vpx_dsp/vpx_dsp_common.h"
16 #include "vpx_ports/mem.h"
17
vpx_convolve8_neon_i8mm(const uint8_t * src,ptrdiff_t src_stride,uint8_t * dst,ptrdiff_t dst_stride,const InterpKernel * filter,int x0_q4,int x_step_q4,int y0_q4,int y_step_q4,int w,int h)18 void vpx_convolve8_neon_i8mm(const uint8_t *src, ptrdiff_t src_stride,
19 uint8_t *dst, ptrdiff_t dst_stride,
20 const InterpKernel *filter, int x0_q4,
21 int x_step_q4, int y0_q4, int y_step_q4, int w,
22 int h) {
23 /* Given our constraints: w <= 64, h <= 64, taps == 8 we can reduce the
24 * maximum buffer size to 64 * (64 + 7). */
25 uint8_t temp[64 * 71];
26
27 /* Account for the vertical phase needing 3 lines prior and 4 lines post. */
28 const int intermediate_height = h + 7;
29
30 assert(y_step_q4 == 16);
31 assert(x_step_q4 == 16);
32
33 /* Filter starting 3 lines back. */
34 vpx_convolve8_2d_horiz_neon_i8mm(src - src_stride * 3, src_stride, temp, w,
35 filter, x0_q4, x_step_q4, y0_q4, y_step_q4,
36 w, intermediate_height);
37
38 /* Step into the temp buffer 3 lines to get the actual frame data. */
39 vpx_convolve8_vert_neon_i8mm(temp + w * 3, w, dst, dst_stride, filter, x0_q4,
40 x_step_q4, y0_q4, y_step_q4, w, h);
41 }
42
vpx_convolve8_avg_neon_i8mm(const uint8_t * src,ptrdiff_t src_stride,uint8_t * dst,ptrdiff_t dst_stride,const InterpKernel * filter,int x0_q4,int x_step_q4,int y0_q4,int y_step_q4,int w,int h)43 void vpx_convolve8_avg_neon_i8mm(const uint8_t *src, ptrdiff_t src_stride,
44 uint8_t *dst, ptrdiff_t dst_stride,
45 const InterpKernel *filter, int x0_q4,
46 int x_step_q4, int y0_q4, int y_step_q4, int w,
47 int h) {
48 uint8_t temp[64 * 71];
49 const int intermediate_height = h + 7;
50
51 assert(y_step_q4 == 16);
52 assert(x_step_q4 == 16);
53
54 vpx_convolve8_2d_horiz_neon_i8mm(src - src_stride * 3, src_stride, temp, w,
55 filter, x0_q4, x_step_q4, y0_q4, y_step_q4,
56 w, intermediate_height);
57
58 vpx_convolve8_avg_vert_neon_i8mm(temp + w * 3, w, dst, dst_stride, filter,
59 x0_q4, x_step_q4, y0_q4, y_step_q4, w, h);
60 }
61