FFmpeg
dsp_init.c
Go to the documentation of this file.
1 /*
2  * VVC filters DSP
3  *
4  * Copyright (C) 2024 Zhao Zhili
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include "libavutil/cpu.h"
24 #include "libavutil/aarch64/cpu.h"
26 #include "libavcodec/vvc/dsp.h"
27 #include "libavcodec/vvc/dec.h"
28 #include "libavcodec/vvc/ctu.h"
29 
30 #define BDOF_BLOCK_SIZE 16
31 #define BDOF_MIN_BLOCK_SIZE 4
32 
33 void ff_vvc_put_luma_h8_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
34  const int height, const int8_t *hf, const int8_t *vf, const int width);
35 void ff_vvc_put_luma_h16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
36  const int height, const int8_t *hf, const int8_t *vf, const int width);
37 void ff_vvc_put_luma_h_x16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
38  const int height, const int8_t *hf, const int8_t *vf, const int width);
39 void ff_vvc_put_luma_h8_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
40  const int height, const int8_t *hf, const int8_t *vf, const int width);
41 void ff_vvc_put_luma_h16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
42  const int height, const int8_t *hf, const int8_t *vf, const int width);
43 void ff_vvc_put_luma_h_x16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
44  const int height, const int8_t *hf, const int8_t *vf, const int width);
45 
46 void ff_vvc_put_chroma_h8_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
47  const int height, const int8_t *hf, const int8_t *vf, const int width);
48 void ff_vvc_put_chroma_h16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
49  const int height, const int8_t *hf, const int8_t *vf, const int width);
50 void ff_vvc_put_chroma_h_x16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
51  const int height, const int8_t *hf, const int8_t *vf, const int width);
52 void ff_vvc_put_chroma_h8_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
53  const int height, const int8_t *hf, const int8_t *vf, const int width);
54 void ff_vvc_put_chroma_h16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
55  const int height, const int8_t *hf, const int8_t *vf, const int width);
56 void ff_vvc_put_chroma_h_x16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
57  const int height, const int8_t *hf, const int8_t *vf, const int width);
58 
59 void ff_vvc_put_luma_v4_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
60  const int height, const int8_t *hf, const int8_t *vf, const int width);
61 void ff_vvc_put_luma_v8_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
62  const int height, const int8_t *hf, const int8_t *vf, const int width);
63 void ff_vvc_put_luma_v16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
64  const int height, const int8_t *hf, const int8_t *vf, const int width);
65 void ff_vvc_put_luma_v_x16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
66  const int height, const int8_t *hf, const int8_t *vf, const int width);
67 void ff_vvc_put_luma_v4_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
68  const int height, const int8_t *hf, const int8_t *vf, const int width);
69 void ff_vvc_put_luma_v8_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
70  const int height, const int8_t *hf, const int8_t *vf, const int width);
71 void ff_vvc_put_luma_v16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
72  const int height, const int8_t *hf, const int8_t *vf, const int width);
73 void ff_vvc_put_luma_v_x16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
74  const int height, const int8_t *hf, const int8_t *vf, const int width);
75 
76 void ff_vvc_put_luma_hv8_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
77  const int height, const int8_t *hf, const int8_t *vf, const int width);
78 void ff_vvc_put_luma_hv16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
79  const int height, const int8_t *hf, const int8_t *vf, const int width);
80 void ff_vvc_put_luma_hv_x16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
81  const int height, const int8_t *hf, const int8_t *vf, const int width);
82 void ff_vvc_put_luma_hv8_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
83  const int height, const int8_t *hf, const int8_t *vf, const int width);
84 void ff_vvc_put_luma_hv16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
85  const int height, const int8_t *hf, const int8_t *vf, const int width);
86 void ff_vvc_put_luma_hv_x16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride,
87  const int height, const int8_t *hf, const int8_t *vf, const int width);
88 
89 void ff_alf_classify_sum_neon(int *sum0, int *sum1, int16_t *grad, uint32_t gshift, uint32_t steps);
90 
91 #define BIT_DEPTH 8
92 #include "alf_template.c"
93 #undef BIT_DEPTH
94 
95 #define BIT_DEPTH 10
96 #include "alf_template.c"
97 #undef BIT_DEPTH
98 
99 #define BIT_DEPTH 12
100 #include "alf_template.c"
101 #undef BIT_DEPTH
102 
103 int ff_vvc_sad_neon(const int16_t *src0, const int16_t *src1, int dx, int dy,
104  const int block_w, const int block_h);
105 
106 void ff_vvc_avg_8_neon(uint8_t *dst, ptrdiff_t dst_stride,
107  const int16_t *src0, const int16_t *src1, int width,
108  int height);
109 void ff_vvc_avg_10_neon(uint8_t *dst, ptrdiff_t dst_stride,
110  const int16_t *src0, const int16_t *src1, int width,
111  int height);
112 void ff_vvc_avg_12_neon(uint8_t *dst, ptrdiff_t dst_stride,
113  const int16_t *src0, const int16_t *src1, int width,
114  int height);
115 
116 void ff_vvc_w_avg_8_neon(uint8_t *_dst, ptrdiff_t _dst_stride,
117  const int16_t *src0, const int16_t *src1,
118  int width, int height,
119  uintptr_t w0_w1, uintptr_t offset_shift);
120 void ff_vvc_w_avg_10_neon(uint8_t *_dst, ptrdiff_t _dst_stride,
121  const int16_t *src0, const int16_t *src1,
122  int width, int height,
123  uintptr_t w0_w1, uintptr_t offset_shift);
124 void ff_vvc_w_avg_12_neon(uint8_t *_dst, ptrdiff_t _dst_stride,
125  const int16_t *src0, const int16_t *src1,
126  int width, int height,
127  uintptr_t w0_w1, uintptr_t offset_shift);
128 /* When passing arguments to functions, Apple platforms diverge from the ARM64
129  * standard ABI for functions that require passing arguments on the stack. To
130  * simplify portability in the assembly function interface, use a different
131  * function signature that doesn't require passing arguments on the stack.
132  */
133 #define W_AVG_FUN(bit_depth) \
134 static void vvc_w_avg_ ## bit_depth(uint8_t *dst, ptrdiff_t dst_stride, \
135  const int16_t *src0, const int16_t *src1, int width, int height, \
136  int denom, int w0, int w1, int o) \
137 { \
138  int shift = denom + FFMAX(3, 15 - bit_depth); \
139  int offset = (o * (1 << (bit_depth - 8)) + 1) * (1 << (shift - 1)); \
140  uintptr_t w0_w1 = ((uintptr_t)w0 << 32) | (uint32_t)w1; \
141  uintptr_t offset_shift = ((uintptr_t)offset << 32) | (uint32_t)shift; \
142  ff_vvc_w_avg_ ## bit_depth ## _neon(dst, dst_stride, src0, src1, width, height, w0_w1, offset_shift); \
143 }
144 
145 W_AVG_FUN(8)
146 W_AVG_FUN(10)
147 W_AVG_FUN(12)
148 
149 #define DMVR_FUN(fn, bd) \
150  void ff_vvc_dmvr_ ## fn ## bd ## _neon(int16_t *dst, \
151  const uint8_t *_src, ptrdiff_t _src_stride, int height, \
152  intptr_t mx, intptr_t my, int width);
153 
154 DMVR_FUN(, 8)
155 DMVR_FUN(, 12)
156 DMVR_FUN(h_, 8)
157 DMVR_FUN(h_, 10)
158 DMVR_FUN(h_, 12)
159 DMVR_FUN(v_, 8)
160 DMVR_FUN(hv_, 8)
161 DMVR_FUN(hv_, 10)
162 DMVR_FUN(hv_, 12)
163 
164 #define APPLY_BDOF_FUNC(bd) \
165  void ff_vvc_apply_bdof_ ## bd ## _neon(uint8_t *_dst, ptrdiff_t _dst_stride, \
166  const int16_t *_src0, const int16_t *_src1, \
167  int block_w, int block_h);
168 
170 APPLY_BDOF_FUNC(10)
171 APPLY_BDOF_FUNC(12)
172 
173 void ff_vvc_dsp_init_aarch64(VVCDSPContext *const c, const int bd)
174 {
175  int cpu_flags = av_get_cpu_flags();
176  if (!have_neon(cpu_flags))
177  return;
178 
179  if (bd == 8) {
180  c->inter.put[0][1][0][0] = ff_vvc_put_pel_pixels4_8_neon;
181  c->inter.put[0][2][0][0] = ff_vvc_put_pel_pixels8_8_neon;
182  c->inter.put[0][3][0][0] = ff_vvc_put_pel_pixels16_8_neon;
183  c->inter.put[0][4][0][0] = ff_vvc_put_pel_pixels32_8_neon;
184  c->inter.put[0][5][0][0] = ff_vvc_put_pel_pixels64_8_neon;
185  c->inter.put[0][6][0][0] = ff_vvc_put_pel_pixels128_8_neon;
186 
187  c->inter.put[0][1][0][1] = ff_vvc_put_qpel_h4_8_neon;
188  c->inter.put[0][2][0][1] = ff_vvc_put_qpel_h8_8_neon;
189  c->inter.put[0][3][0][1] = ff_vvc_put_qpel_h16_8_neon;
190  c->inter.put[0][4][0][1] =
191  c->inter.put[0][5][0][1] =
192  c->inter.put[0][6][0][1] = ff_vvc_put_qpel_h32_8_neon;
193 
194  c->inter.put[0][1][1][0] = ff_vvc_put_qpel_v4_8_neon;
195  c->inter.put[0][2][1][0] =
196  c->inter.put[0][3][1][0] =
197  c->inter.put[0][4][1][0] =
198  c->inter.put[0][5][1][0] =
199  c->inter.put[0][6][1][0] = ff_vvc_put_qpel_v8_8_neon;
200 
201  c->inter.put[0][1][1][1] = ff_vvc_put_qpel_hv4_8_neon;
202  c->inter.put[0][2][1][1] = ff_vvc_put_qpel_hv8_8_neon;
203  c->inter.put[0][3][1][1] = ff_vvc_put_qpel_hv16_8_neon;
204  c->inter.put[0][4][1][1] = ff_vvc_put_qpel_hv32_8_neon;
205  c->inter.put[0][5][1][1] = ff_vvc_put_qpel_hv64_8_neon;
206  c->inter.put[0][6][1][1] = ff_vvc_put_qpel_hv128_8_neon;
207 
208  c->inter.put[1][1][0][0] = ff_vvc_put_pel_pixels4_8_neon;
209  c->inter.put[1][2][0][0] = ff_vvc_put_pel_pixels8_8_neon;
210  c->inter.put[1][3][0][0] = ff_vvc_put_pel_pixels16_8_neon;
211  c->inter.put[1][4][0][0] = ff_vvc_put_pel_pixels32_8_neon;
212  c->inter.put[1][5][0][0] = ff_vvc_put_pel_pixels64_8_neon;
213  c->inter.put[1][6][0][0] = ff_vvc_put_pel_pixels128_8_neon;
214 
215  c->inter.put[1][1][0][1] = ff_vvc_put_epel_h4_8_neon;
216  c->inter.put[1][2][0][1] = ff_vvc_put_epel_h8_8_neon;
217  c->inter.put[1][3][0][1] = ff_vvc_put_epel_h16_8_neon;
218  c->inter.put[1][4][0][1] =
219  c->inter.put[1][5][0][1] =
220  c->inter.put[1][6][0][1] = ff_vvc_put_epel_h32_8_neon;
221 
222  c->inter.put[1][1][1][1] = ff_vvc_put_epel_hv4_8_neon;
223  c->inter.put[1][2][1][1] = ff_vvc_put_epel_hv8_8_neon;
224  c->inter.put[1][3][1][1] = ff_vvc_put_epel_hv16_8_neon;
225  c->inter.put[1][4][1][1] = ff_vvc_put_epel_hv32_8_neon;
226  c->inter.put[1][5][1][1] = ff_vvc_put_epel_hv64_8_neon;
227  c->inter.put[1][6][1][1] = ff_vvc_put_epel_hv128_8_neon;
228 
229  c->inter.put_uni[0][1][0][0] = ff_vvc_put_pel_uni_pixels4_8_neon;
230  c->inter.put_uni[0][2][0][0] = ff_vvc_put_pel_uni_pixels8_8_neon;
231  c->inter.put_uni[0][3][0][0] = ff_vvc_put_pel_uni_pixels16_8_neon;
232  c->inter.put_uni[0][4][0][0] = ff_vvc_put_pel_uni_pixels32_8_neon;
233  c->inter.put_uni[0][5][0][0] = ff_vvc_put_pel_uni_pixels64_8_neon;
234  c->inter.put_uni[0][6][0][0] = ff_vvc_put_pel_uni_pixels128_8_neon;
235 
236  c->inter.put_uni[0][1][0][1] = ff_vvc_put_qpel_uni_h4_8_neon;
237  c->inter.put_uni[0][2][0][1] = ff_vvc_put_qpel_uni_h8_8_neon;
238  c->inter.put_uni[0][3][0][1] = ff_vvc_put_qpel_uni_h16_8_neon;
239  c->inter.put_uni[0][4][0][1] =
240  c->inter.put_uni[0][5][0][1] =
241  c->inter.put_uni[0][6][0][1] = ff_vvc_put_qpel_uni_h32_8_neon;
242 
243  c->inter.put_uni_w[0][1][0][0] = ff_vvc_put_pel_uni_w_pixels4_8_neon;
244  c->inter.put_uni_w[0][2][0][0] = ff_vvc_put_pel_uni_w_pixels8_8_neon;
245  c->inter.put_uni_w[0][3][0][0] = ff_vvc_put_pel_uni_w_pixels16_8_neon;
246  c->inter.put_uni_w[0][4][0][0] = ff_vvc_put_pel_uni_w_pixels32_8_neon;
247  c->inter.put_uni_w[0][5][0][0] = ff_vvc_put_pel_uni_w_pixels64_8_neon;
248  c->inter.put_uni_w[0][6][0][0] = ff_vvc_put_pel_uni_w_pixels128_8_neon;
249 
250  c->inter.avg = ff_vvc_avg_8_neon;
251  c->inter.w_avg = vvc_w_avg_8;
252  c->inter.dmvr[0][0] = ff_vvc_dmvr_8_neon;
253  c->inter.dmvr[0][1] = ff_vvc_dmvr_h_8_neon;
254  c->inter.dmvr[1][0] = ff_vvc_dmvr_v_8_neon;
255  c->inter.dmvr[1][1] = ff_vvc_dmvr_hv_8_neon;
256  c->inter.apply_bdof = ff_vvc_apply_bdof_8_neon;
257 
258  c->sao.band_filter[0] = ff_h26x_sao_band_filter_8x8_8_neon;
259  for (int i = 1; i < FF_ARRAY_ELEMS(c->sao.band_filter); i++)
260  c->sao.band_filter[i] = ff_h26x_sao_band_filter_16x16_8_neon;
261  c->sao.edge_filter[0] = ff_vvc_sao_edge_filter_8x8_8_neon;
262  for (int i = 1; i < FF_ARRAY_ELEMS(c->sao.edge_filter); i++)
263  c->sao.edge_filter[i] = ff_vvc_sao_edge_filter_16x16_8_neon;
264  c->alf.filter[LUMA] = alf_filter_luma_8_neon;
265  c->alf.filter[CHROMA] = alf_filter_chroma_8_neon;
266  c->alf.classify = alf_classify_8_neon;
267 
268  if (have_i8mm(cpu_flags)) {
269  c->inter.put[0][1][0][1] = ff_vvc_put_qpel_h4_8_neon_i8mm;
270  c->inter.put[0][2][0][1] = ff_vvc_put_qpel_h8_8_neon_i8mm;
271  c->inter.put[0][3][0][1] = ff_vvc_put_qpel_h16_8_neon_i8mm;
272  c->inter.put[0][4][0][1] = ff_vvc_put_qpel_h32_8_neon_i8mm;
273  c->inter.put[0][5][0][1] = ff_vvc_put_qpel_h64_8_neon_i8mm;
274  c->inter.put[0][6][0][1] = ff_vvc_put_qpel_h128_8_neon_i8mm;
275 
276  c->inter.put[0][1][1][1] = ff_vvc_put_qpel_hv4_8_neon_i8mm;
277  c->inter.put[0][2][1][1] = ff_vvc_put_qpel_hv8_8_neon_i8mm;
278  c->inter.put[0][3][1][1] = ff_vvc_put_qpel_hv16_8_neon_i8mm;
279  c->inter.put[0][4][1][1] = ff_vvc_put_qpel_hv32_8_neon_i8mm;
280  c->inter.put[0][5][1][1] = ff_vvc_put_qpel_hv64_8_neon_i8mm;
281  c->inter.put[0][6][1][1] = ff_vvc_put_qpel_hv128_8_neon_i8mm;
282 
283  c->inter.put[1][1][0][1] = ff_vvc_put_epel_h4_8_neon_i8mm;
284  c->inter.put[1][2][0][1] = ff_vvc_put_epel_h8_8_neon_i8mm;
285  c->inter.put[1][3][0][1] = ff_vvc_put_epel_h16_8_neon_i8mm;
286  c->inter.put[1][4][0][1] = ff_vvc_put_epel_h32_8_neon_i8mm;
287  c->inter.put[1][5][0][1] = ff_vvc_put_epel_h64_8_neon_i8mm;
288  c->inter.put[1][6][0][1] = ff_vvc_put_epel_h128_8_neon_i8mm;
289 
290  c->inter.put[1][1][1][1] = ff_vvc_put_epel_hv4_8_neon_i8mm;
291  c->inter.put[1][2][1][1] = ff_vvc_put_epel_hv8_8_neon_i8mm;
292  c->inter.put[1][3][1][1] = ff_vvc_put_epel_hv16_8_neon_i8mm;
293  c->inter.put[1][4][1][1] = ff_vvc_put_epel_hv32_8_neon_i8mm;
294  c->inter.put[1][5][1][1] = ff_vvc_put_epel_hv64_8_neon_i8mm;
295  c->inter.put[1][6][1][1] = ff_vvc_put_epel_hv128_8_neon_i8mm;
296  }
298  c->alf.filter[LUMA] = alf_filter_luma_8_sme2;
299  }
300  } else if (bd == 10) {
301  c->inter.avg = ff_vvc_avg_10_neon;
302  c->inter.w_avg = vvc_w_avg_10;
303  c->inter.dmvr[0][1] = ff_vvc_dmvr_h_10_neon;
304  c->inter.dmvr[1][1] = ff_vvc_dmvr_hv_10_neon;
305  c->inter.apply_bdof = ff_vvc_apply_bdof_10_neon;
306 
307  c->inter.put[1][2][0][1] = ff_vvc_put_chroma_h8_10_neon;
308  c->inter.put[1][3][0][1] = ff_vvc_put_chroma_h16_10_neon;
309  c->inter.put[1][4][0][1] =
310  c->inter.put[1][5][0][1] =
311  c->inter.put[1][6][0][1] = ff_vvc_put_chroma_h_x16_10_neon;
312 
313  c->inter.put[0][2][0][1] = ff_vvc_put_luma_h8_10_neon;
314  c->inter.put[0][3][0][1] = ff_vvc_put_luma_h16_10_neon;
315  c->inter.put[0][4][0][1] =
316  c->inter.put[0][5][0][1] =
317  c->inter.put[0][6][0][1] = ff_vvc_put_luma_h_x16_10_neon;
318 
319  c->inter.put[0][1][1][0] = ff_vvc_put_luma_v4_10_neon;
320  c->inter.put[0][2][1][0] = ff_vvc_put_luma_v8_10_neon;
321  c->inter.put[0][3][1][0] = ff_vvc_put_luma_v16_10_neon;
322  c->inter.put[0][4][1][0] =
323  c->inter.put[0][5][1][0] =
324  c->inter.put[0][6][1][0] = ff_vvc_put_luma_v_x16_10_neon;
325 
326  c->inter.put[0][2][1][1] = ff_vvc_put_luma_hv8_10_neon;
327  c->inter.put[0][3][1][1] = ff_vvc_put_luma_hv16_10_neon;
328  c->inter.put[0][4][1][1] =
329  c->inter.put[0][5][1][1] =
330  c->inter.put[0][6][1][1] = ff_vvc_put_luma_hv_x16_10_neon;
331 
332  c->alf.filter[LUMA] = alf_filter_luma_10_neon;
333  c->alf.filter[CHROMA] = alf_filter_chroma_10_neon;
334  c->alf.classify = alf_classify_10_neon;
336  c->alf.filter[LUMA] = alf_filter_luma_10_sme2;
337  }
338  } else if (bd == 12) {
339  c->inter.avg = ff_vvc_avg_12_neon;
340  c->inter.w_avg = vvc_w_avg_12;
341  c->inter.dmvr[0][0] = ff_vvc_dmvr_12_neon;
342  c->inter.dmvr[0][1] = ff_vvc_dmvr_h_12_neon;
343  c->inter.dmvr[1][1] = ff_vvc_dmvr_hv_12_neon;
344  c->inter.apply_bdof = ff_vvc_apply_bdof_12_neon;
345 
346  c->inter.put[1][2][0][1] = ff_vvc_put_chroma_h8_12_neon;
347  c->inter.put[1][3][0][1] = ff_vvc_put_chroma_h16_12_neon;
348  c->inter.put[1][4][0][1] =
349  c->inter.put[1][5][0][1] =
350  c->inter.put[1][6][0][1] = ff_vvc_put_chroma_h_x16_12_neon;
351 
352  c->inter.put[0][2][0][1] = ff_vvc_put_luma_h8_12_neon;
353  c->inter.put[0][3][0][1] = ff_vvc_put_luma_h16_12_neon;
354  c->inter.put[0][4][0][1] =
355  c->inter.put[0][5][0][1] =
356  c->inter.put[0][6][0][1] = ff_vvc_put_luma_h_x16_12_neon;
357 
358  c->inter.put[0][2][1][1] = ff_vvc_put_luma_hv8_12_neon;
359  c->inter.put[0][3][1][1] = ff_vvc_put_luma_hv16_12_neon;
360  c->inter.put[0][4][1][1] =
361  c->inter.put[0][5][1][1] =
362  c->inter.put[0][6][1][1] = ff_vvc_put_luma_hv_x16_12_neon;
363 
364  c->inter.put[0][1][1][0] = ff_vvc_put_luma_v4_12_neon;
365  c->inter.put[0][2][1][0] = ff_vvc_put_luma_v8_12_neon;
366  c->inter.put[0][3][1][0] = ff_vvc_put_luma_v16_12_neon;
367  c->inter.put[0][4][1][0] =
368  c->inter.put[0][5][1][0] =
369  c->inter.put[0][6][1][0] = ff_vvc_put_luma_v_x16_12_neon;
370 
371  c->alf.filter[LUMA] = alf_filter_luma_12_neon;
372  c->alf.filter[CHROMA] = alf_filter_chroma_12_neon;
373  c->alf.classify = alf_classify_12_neon;
375  c->alf.filter[LUMA] = alf_filter_luma_12_sme2;
376  }
377  }
378 
379  c->inter.sad = ff_vvc_sad_neon;
380 }
_dst
uint8_t * _dst
Definition: dsp.h:56
LUMA
#define LUMA
Definition: filter.c:31
ff_vvc_put_chroma_h16_12_neon
void ff_vvc_put_chroma_h16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
src1
const pixel * src1
Definition: h264pred_template.c:420
ff_vvc_put_qpel_v8_8_neon
void ff_vvc_put_qpel_v8_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width)
ff_vvc_put_luma_h_x16_12_neon
void ff_vvc_put_luma_h_x16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_luma_h16_10_neon
void ff_vvc_put_luma_h16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_chroma_h_x16_12_neon
void ff_vvc_put_chroma_h_x16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_chroma_h8_10_neon
void ff_vvc_put_chroma_h8_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_luma_v8_10_neon
void ff_vvc_put_luma_v8_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_luma_hv16_12_neon
void ff_vvc_put_luma_hv16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:109
ff_vvc_dsp_init_aarch64
void ff_vvc_dsp_init_aarch64(VVCDSPContext *const c, const int bd)
Definition: dsp_init.c:173
have_sme2
#define have_sme2(flags)
Definition: cpu.h:35
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:56
_src
uint8_t ptrdiff_t const uint8_t * _src
Definition: dsp.h:56
ff_vvc_put_luma_h8_10_neon
void ff_vvc_put_luma_h8_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_luma_h16_12_neon
void ff_vvc_put_luma_h16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
dsp.h
W_AVG_FUN
#define W_AVG_FUN(bit_depth)
Definition: dsp_init.c:133
ff_vvc_put_chroma_h8_12_neon
void ff_vvc_put_chroma_h8_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_w_avg_10_neon
void ff_vvc_w_avg_10_neon(uint8_t *_dst, ptrdiff_t _dst_stride, const int16_t *src0, const int16_t *src1, int width, int height, uintptr_t w0_w1, uintptr_t offset_shift)
ff_vvc_put_qpel_v4_8_neon
void ff_vvc_put_qpel_v4_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width)
ff_vvc_put_luma_hv_x16_12_neon
void ff_vvc_put_luma_hv_x16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
dsp.h
ff_vvc_put_luma_hv16_10_neon
void ff_vvc_put_luma_hv16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_luma_hv8_10_neon
void ff_vvc_put_luma_hv8_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_luma_hv_x16_10_neon
void ff_vvc_put_luma_hv_x16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
DMVR_FUN
#define DMVR_FUN(fn, bd)
Definition: dsp_init.c:149
ff_h26x_sao_band_filter_16x16_8_neon
void ff_h26x_sao_band_filter_16x16_8_neon(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, const int16_t *sao_offset_val, int sao_left_class, int width, int height)
if
if(ret)
Definition: filter_design.txt:179
grad
static double grad(int hash, double x, double y, double z)
Definition: perlin.c:42
ff_vvc_put_luma_hv8_12_neon
void ff_vvc_put_luma_hv8_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_sao_edge_filter_8x8_8_neon
void ff_vvc_sao_edge_filter_8x8_8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, const int16_t *sao_offset_val, int eo, int width, int height)
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
have_i8mm
#define have_i8mm(flags)
Definition: cpu.h:30
height
#define height
Definition: dsp.h:89
ff_vvc_put_luma_v_x16_10_neon
void ff_vvc_put_luma_v_x16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
ff_vvc_put_chroma_h16_10_neon
void ff_vvc_put_chroma_h16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_luma_h_x16_10_neon
void ff_vvc_put_luma_h_x16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
cpu.h
i
#define i(width, name, range_min, range_max)
Definition: cbs_h264.c:63
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:424
ff_vvc_avg_8_neon
void ff_vvc_avg_8_neon(uint8_t *dst, ptrdiff_t dst_stride, const int16_t *src0, const int16_t *src1, int width, int height)
have_neon
#define have_neon(flags)
Definition: cpu.h:26
ff_h26x_sao_band_filter_8x8_8_neon
void ff_h26x_sao_band_filter_8x8_8_neon(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, const int16_t *sao_offset_val, int sao_left_class, int width, int height)
ff_vvc_put_luma_v16_10_neon
void ff_vvc_put_luma_v16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_avg_10_neon
void ff_vvc_avg_10_neon(uint8_t *dst, ptrdiff_t dst_stride, const int16_t *src0, const int16_t *src1, int width, int height)
ff_alf_classify_sum_neon
void ff_alf_classify_sum_neon(int *sum0, int *sum1, int16_t *grad, uint32_t gshift, uint32_t steps)
hf
uint8_t ptrdiff_t const uint8_t ptrdiff_t int const int8_t * hf
Definition: dsp.h:258
ff_vvc_put_luma_v4_10_neon
void ff_vvc_put_luma_v4_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ff_vvc_put_luma_v8_12_neon
void ff_vvc_put_luma_v8_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
CHROMA
@ CHROMA
Definition: vf_waveform.c:49
ff_vvc_put_luma_v4_12_neon
void ff_vvc_put_luma_v4_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
steps
static const int16_t steps[16]
Definition: misc4.c:30
ff_vvc_w_avg_8_neon
void ff_vvc_w_avg_8_neon(uint8_t *_dst, ptrdiff_t _dst_stride, const int16_t *src0, const int16_t *src1, int width, int height, uintptr_t w0_w1, uintptr_t offset_shift)
ff_vvc_w_avg_12_neon
void ff_vvc_w_avg_12_neon(uint8_t *_dst, ptrdiff_t _dst_stride, const int16_t *src0, const int16_t *src1, int width, int height, uintptr_t w0_w1, uintptr_t offset_shift)
src0
const pixel *const src0
Definition: h264pred_template.c:419
ff_vvc_avg_12_neon
void ff_vvc_avg_12_neon(uint8_t *dst, ptrdiff_t dst_stride, const int16_t *src0, const int16_t *src1, int width, int height)
ff_vvc_sao_edge_filter_16x16_8_neon
void ff_vvc_sao_edge_filter_16x16_8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, const int16_t *sao_offset_val, int eo, int width, int height)
alf_template.c
ff_vvc_put_chroma_h_x16_10_neon
void ff_vvc_put_chroma_h_x16_10_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
have_sme_i16i64
#define have_sme_i16i64(flags)
Definition: cpu.h:34
ff_vvc_sad_neon
int ff_vvc_sad_neon(const int16_t *src0, const int16_t *src1, int dx, int dy, const int block_w, const int block_h)
APPLY_BDOF_FUNC
#define APPLY_BDOF_FUNC(bd)
Definition: dsp_init.c:164
ff_vvc_put_luma_v16_12_neon
void ff_vvc_put_luma_v16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
ctu.h
ff_vvc_put_luma_h8_12_neon
void ff_vvc_put_luma_h8_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
width
#define width
Definition: dsp.h:89
cpu.h
vf
uint8_t ptrdiff_t const uint8_t ptrdiff_t int const int8_t const int8_t * vf
Definition: dsp.h:258
ff_vvc_put_luma_v_x16_12_neon
void ff_vvc_put_luma_v_x16_12_neon(int16_t *dst, const uint8_t *_src, const ptrdiff_t _src_stride, const int height, const int8_t *hf, const int8_t *vf, const int width)
dec.h
VVCDSPContext
Definition: dsp.h:170