FFmpeg
Loading...
Searching...
No Matches
dsp.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Zhao Zhili
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef AVCODEC_AARCH64_H26X_DSP_H
22#define AVCODEC_AARCH64_H26X_DSP_H
23
24#include <stddef.h>
25#include <stdint.h>
26
27void ff_h26x_sao_band_filter_8x8_8_neon(uint8_t *_dst, const uint8_t *_src,
28 ptrdiff_t stride_dst, ptrdiff_t stride_src,
29 const int16_t *sao_offset_val, int sao_left_class,
30 int width, int height);
31void ff_h26x_sao_band_filter_16x16_8_neon(uint8_t *_dst, const uint8_t *_src,
32 ptrdiff_t stride_dst, ptrdiff_t stride_src,
33 const int16_t *sao_offset_val, int sao_left_class,
34 int width, int height);
35#define SAO_EDGE_FILTER_PROTO(codec, size, depth) \
36 void ff_##codec##_sao_edge_filter_##size##_##depth##_neon( \
37 uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, \
38 const int16_t *sao_offset_val, int eo, int width, int height)
39
40SAO_EDGE_FILTER_PROTO(hevc, 16x16, 8);
42SAO_EDGE_FILTER_PROTO(hevc, 16x16, 10);
43SAO_EDGE_FILTER_PROTO(hevc, 8x8, 10);
44SAO_EDGE_FILTER_PROTO(hevc, 16x16, 12);
45SAO_EDGE_FILTER_PROTO(hevc, 8x8, 12);
46SAO_EDGE_FILTER_PROTO(vvc, 16x16, 8);
48SAO_EDGE_FILTER_PROTO(vvc, 16x16, 10);
50SAO_EDGE_FILTER_PROTO(vvc, 16x16, 12);
52
53#undef SAO_EDGE_FILTER_PROTO
54
55#define NEON8_FNPROTO_PARTIAL_6(fn, args, ext) \
56 void ff_hevc_put_hevc_##fn##_h4_8_neon##ext args; \
57 void ff_hevc_put_hevc_##fn##_h6_8_neon##ext args; \
58 void ff_hevc_put_hevc_##fn##_h8_8_neon##ext args; \
59 void ff_hevc_put_hevc_##fn##_h12_8_neon##ext args; \
60 void ff_hevc_put_hevc_##fn##_h16_8_neon##ext args; \
61 void ff_hevc_put_hevc_##fn##_h32_8_neon##ext args;
62
63NEON8_FNPROTO_PARTIAL_6(qpel, (int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height,
64 intptr_t mx, intptr_t my, int width),)
65
66NEON8_FNPROTO_PARTIAL_6(qpel_uni, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src,
67 ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width),)
68
69NEON8_FNPROTO_PARTIAL_6(qpel_bi, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src,
70 ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t
71 mx, intptr_t my, int width),)
72
73#define NEON8_FNPROTO(fn, args, ext) \
74 void ff_hevc_put_hevc_##fn##4_8_neon##ext args; \
75 void ff_hevc_put_hevc_##fn##6_8_neon##ext args; \
76 void ff_hevc_put_hevc_##fn##8_8_neon##ext args; \
77 void ff_hevc_put_hevc_##fn##12_8_neon##ext args; \
78 void ff_hevc_put_hevc_##fn##16_8_neon##ext args; \
79 void ff_hevc_put_hevc_##fn##24_8_neon##ext args; \
80 void ff_hevc_put_hevc_##fn##32_8_neon##ext args; \
81 void ff_hevc_put_hevc_##fn##48_8_neon##ext args; \
82 void ff_hevc_put_hevc_##fn##64_8_neon##ext args
83
84#define NEON8_FNPROTO_PARTIAL_4(fn, args, ext) \
85 void ff_hevc_put_hevc_##fn##4_8_neon##ext args; \
86 void ff_hevc_put_hevc_##fn##8_8_neon##ext args; \
87 void ff_hevc_put_hevc_##fn##16_8_neon##ext args; \
88 void ff_hevc_put_hevc_##fn##64_8_neon##ext args
89
90#define NEON8_FNPROTO_PARTIAL_5(fn, args, ext) \
91 void ff_hevc_put_hevc_##fn##4_8_neon##ext args; \
92 void ff_hevc_put_hevc_##fn##8_8_neon##ext args; \
93 void ff_hevc_put_hevc_##fn##16_8_neon##ext args; \
94 void ff_hevc_put_hevc_##fn##32_8_neon##ext args; \
95 void ff_hevc_put_hevc_##fn##64_8_neon##ext args
96
97NEON8_FNPROTO(pel_pixels, (int16_t *dst,
98 const uint8_t *src, ptrdiff_t srcstride,
99 int height, intptr_t mx, intptr_t my, int width),);
100
101NEON8_FNPROTO(pel_bi_pixels, (uint8_t *dst, ptrdiff_t dststride,
102 const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2,
103 int height, intptr_t mx, intptr_t my, int width),);
104
105NEON8_FNPROTO(pel_bi_w_pixels, (uint8_t *_dst, ptrdiff_t _dststride,
106 const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2,
107 int height, int denom, int wx0, int wx1,
108 int ox, intptr_t mx, intptr_t my, int width),);
109
110NEON8_FNPROTO(epel_bi_h, (uint8_t *dst, ptrdiff_t dststride,
111 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
112 int height, intptr_t mx, intptr_t my, int width),);
113
114NEON8_FNPROTO(epel_bi_v, (uint8_t *dst, ptrdiff_t dststride,
115 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
116 int height, intptr_t mx, intptr_t my, int width),);
117
118NEON8_FNPROTO(epel_bi_hv, (uint8_t *dst, ptrdiff_t dststride,
119 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
120 int height, intptr_t mx, intptr_t my, int width),);
121
122NEON8_FNPROTO(epel_bi_hv, (uint8_t *dst, ptrdiff_t dststride,
123 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
124 int height, intptr_t mx, intptr_t my, int width), _i8mm);
125
126NEON8_FNPROTO(epel_v, (int16_t *dst,
127 const uint8_t *src, ptrdiff_t srcstride,
128 int height, intptr_t mx, intptr_t my, int width),);
129
130NEON8_FNPROTO(pel_uni_pixels, (uint8_t *_dst, ptrdiff_t _dststride,
131 const uint8_t *_src, ptrdiff_t _srcstride,
132 int height, intptr_t mx, intptr_t my, int width),);
133
134NEON8_FNPROTO(pel_uni_w_pixels, (uint8_t *_dst, ptrdiff_t _dststride,
135 const uint8_t *_src, ptrdiff_t _srcstride,
136 int height, int denom, int wx, int ox,
137 intptr_t mx, intptr_t my, int width),);
138
139NEON8_FNPROTO(epel_uni_v, (uint8_t *dst, ptrdiff_t dststride,
140 const uint8_t *src, ptrdiff_t srcstride,
141 int height, intptr_t mx, intptr_t my, int width),);
142
143NEON8_FNPROTO(epel_uni_h, (uint8_t *dst, ptrdiff_t dststride,
144 const uint8_t *src, ptrdiff_t srcstride,
145 int height, intptr_t mx, intptr_t my, int width),);
146
147NEON8_FNPROTO(epel_uni_hv, (uint8_t *dst, ptrdiff_t _dststride,
148 const uint8_t *src, ptrdiff_t srcstride,
149 int height, intptr_t mx, intptr_t my, int width),);
150
151NEON8_FNPROTO(epel_uni_hv, (uint8_t *dst, ptrdiff_t _dststride,
152 const uint8_t *src, ptrdiff_t srcstride,
153 int height, intptr_t mx, intptr_t my, int width), _i8mm);
154
155NEON8_FNPROTO(epel_uni_w_v, (uint8_t *_dst, ptrdiff_t _dststride,
156 const uint8_t *_src, ptrdiff_t _srcstride,
157 int height, int denom, int wx, int ox,
158 intptr_t mx, intptr_t my, int width),);
159
160NEON8_FNPROTO(qpel_uni_w_v, (uint8_t *_dst, ptrdiff_t _dststride,
161 const uint8_t *_src, ptrdiff_t _srcstride,
162 int height, int denom, int wx, int ox,
163 intptr_t mx, intptr_t my, int width),);
164
165NEON8_FNPROTO(epel_h, (int16_t *dst,
166 const uint8_t *_src, ptrdiff_t _srcstride,
167 int height, intptr_t mx, intptr_t my, int width),);
168
169NEON8_FNPROTO(epel_hv, (int16_t *dst,
170 const uint8_t *src, ptrdiff_t srcstride,
171 int height, intptr_t mx, intptr_t my, int width), );
172
173NEON8_FNPROTO(epel_h, (int16_t *dst,
174 const uint8_t *_src, ptrdiff_t _srcstride,
175 int height, intptr_t mx, intptr_t my, int width), _i8mm);
176
177NEON8_FNPROTO(epel_hv, (int16_t *dst,
178 const uint8_t *src, ptrdiff_t srcstride,
179 int height, intptr_t mx, intptr_t my, int width), _i8mm);
180
181NEON8_FNPROTO(epel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride,
182 const uint8_t *_src, ptrdiff_t _srcstride,
183 int height, int denom, int wx, int ox,
184 intptr_t mx, intptr_t my, int width),);
185
186NEON8_FNPROTO(epel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride,
187 const uint8_t *_src, ptrdiff_t _srcstride,
188 int height, int denom, int wx, int ox,
189 intptr_t mx, intptr_t my, int width), _i8mm);
190
191NEON8_FNPROTO(qpel_h, (int16_t *dst,
192 const uint8_t *_src, ptrdiff_t _srcstride,
193 int height, intptr_t mx, intptr_t my, int width), _i8mm);
194
195NEON8_FNPROTO(qpel_v, (int16_t *dst,
196 const uint8_t *src, ptrdiff_t srcstride,
197 int height, intptr_t mx, intptr_t my, int width),);
198
199NEON8_FNPROTO(qpel_hv, (int16_t *dst,
200 const uint8_t *src, ptrdiff_t srcstride,
201 int height, intptr_t mx, intptr_t my, int width),);
202
203NEON8_FNPROTO(qpel_hv, (int16_t *dst,
204 const uint8_t *src, ptrdiff_t srcstride,
205 int height, intptr_t mx, intptr_t my, int width), _i8mm);
206
207NEON8_FNPROTO(qpel_uni_v, (uint8_t *dst, ptrdiff_t dststride,
208 const uint8_t *src, ptrdiff_t srcstride,
209 int height, intptr_t mx, intptr_t my, int width),);
210
211NEON8_FNPROTO(qpel_uni_hv, (uint8_t *dst, ptrdiff_t dststride,
212 const uint8_t *src, ptrdiff_t srcstride,
213 int height, intptr_t mx, intptr_t my, int width),);
214
215NEON8_FNPROTO(qpel_uni_hv, (uint8_t *dst, ptrdiff_t dststride,
216 const uint8_t *src, ptrdiff_t srcstride,
217 int height, intptr_t mx, intptr_t my, int width), _i8mm);
218
219NEON8_FNPROTO(qpel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride,
220 const uint8_t *_src, ptrdiff_t _srcstride,
221 int height, int denom, int wx, int ox,
222 intptr_t mx, intptr_t my, int width),);
223
224NEON8_FNPROTO(qpel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride,
225 const uint8_t *_src, ptrdiff_t _srcstride,
226 int height, int denom, int wx, int ox,
227 intptr_t mx, intptr_t my, int width), _i8mm);
228
229NEON8_FNPROTO(epel_uni_w_hv, (uint8_t *_dst, ptrdiff_t _dststride,
230 const uint8_t *_src, ptrdiff_t _srcstride,
231 int height, int denom, int wx, int ox,
232 intptr_t mx, intptr_t my, int width),);
233
234NEON8_FNPROTO(epel_uni_w_hv, (uint8_t *_dst, ptrdiff_t _dststride,
235 const uint8_t *_src, ptrdiff_t _srcstride,
236 int height, int denom, int wx, int ox,
237 intptr_t mx, intptr_t my, int width), _i8mm);
238
239NEON8_FNPROTO(qpel_uni_w_hv, (uint8_t *_dst, ptrdiff_t _dststride,
240 const uint8_t *_src, ptrdiff_t _srcstride,
241 int height, int denom, int wx, int ox,
242 intptr_t mx, intptr_t my, int width),);
243
244NEON8_FNPROTO(qpel_uni_w_hv, (uint8_t *_dst, ptrdiff_t _dststride,
245 const uint8_t *_src, ptrdiff_t _srcstride,
246 int height, int denom, int wx, int ox,
247 intptr_t mx, intptr_t my, int width), _i8mm);
248
249NEON8_FNPROTO(qpel_bi_v, (uint8_t *dst, ptrdiff_t dststride,
250 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
251 int height, intptr_t mx, intptr_t my, int width),);
252
253NEON8_FNPROTO(qpel_bi_hv, (uint8_t *dst, ptrdiff_t dststride,
254 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
255 int height, intptr_t mx, intptr_t my, int width),);
256
257NEON8_FNPROTO(qpel_bi_hv, (uint8_t *dst, ptrdiff_t dststride,
258 const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2,
259 int height, intptr_t mx, intptr_t my, int width), _i8mm);
260
261#undef NEON8_FNPROTO_PARTIAL_4
262#define NEON8_FNPROTO_PARTIAL_4(fn, args, ext) \
263 void ff_vvc_put_##fn##_h4_8_neon##ext args; \
264 void ff_vvc_put_##fn##_h8_8_neon##ext args; \
265 void ff_vvc_put_##fn##_h16_8_neon##ext args; \
266 void ff_vvc_put_##fn##_h32_8_neon##ext args;
267
268NEON8_FNPROTO_PARTIAL_4(qpel, (int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height,
269 const int8_t *hf, const int8_t *vf, int width),)
270
271NEON8_FNPROTO_PARTIAL_4(qpel_uni, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src,
272 ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width),)
273
274NEON8_FNPROTO_PARTIAL_4(epel, (int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height,
275 const int8_t *hf, const int8_t *vf, int width),)
276
277#undef NEON8_FNPROTO_PARTIAL_6
278#define NEON8_FNPROTO_PARTIAL_6(fn, args, ext) \
279 void ff_vvc_put_##fn##4_8_neon##ext args; \
280 void ff_vvc_put_##fn##8_8_neon##ext args; \
281 void ff_vvc_put_##fn##16_8_neon##ext args; \
282 void ff_vvc_put_##fn##32_8_neon##ext args; \
283 void ff_vvc_put_##fn##64_8_neon##ext args; \
284 void ff_vvc_put_##fn##128_8_neon##ext args
285
286NEON8_FNPROTO_PARTIAL_6(pel_pixels, (int16_t *dst,
287 const uint8_t *src, ptrdiff_t srcstride, int height,
288 const int8_t *hf, const int8_t *vf, int width),);
289
290NEON8_FNPROTO_PARTIAL_6(pel_uni_pixels, (uint8_t *_dst, ptrdiff_t _dststride,
291 const uint8_t *_src, ptrdiff_t _srcstride, int height,
292 const int8_t *hf, const int8_t *vf, int width),);
293
294NEON8_FNPROTO_PARTIAL_6(pel_uni_w_pixels, (uint8_t *_dst, ptrdiff_t _dststride,
295 const uint8_t *_src, ptrdiff_t _srcstride,
296 int height, int denom, int wx, int ox,
297 const int8_t *hf, const int8_t *vf, int width),);
298
299NEON8_FNPROTO_PARTIAL_6(qpel_h, (int16_t *dst,
300 const uint8_t *_src, ptrdiff_t _srcstride, int height,
301 const int8_t *hf, const int8_t *vf, int width), _i8mm);
302
303NEON8_FNPROTO_PARTIAL_6(epel_h, (int16_t *dst,
304 const uint8_t *_src, ptrdiff_t _srcstride, int height,
305 const int8_t *hf, const int8_t *vf, int width), _i8mm);
306
307void ff_vvc_put_qpel_v4_8_neon(int16_t *dst, const uint8_t *_src,
308 ptrdiff_t _srcstride, int height,
309 const int8_t *hf, const int8_t *vf, int width);
310
311void ff_vvc_put_qpel_v8_8_neon(int16_t *dst, const uint8_t *_src,
312 ptrdiff_t _srcstride, int height,
313 const int8_t *hf, const int8_t *vf, int width);
314
315NEON8_FNPROTO_PARTIAL_6(qpel_hv, (int16_t *dst,
316 const uint8_t *src, ptrdiff_t srcstride, int height,
317 const int8_t *hf, const int8_t *vf, int width),);
318
319NEON8_FNPROTO_PARTIAL_6(qpel_hv, (int16_t *dst,
320 const uint8_t *src, ptrdiff_t srcstride, int height,
321 const int8_t *hf, const int8_t *vf, int width), _i8mm);
322
323NEON8_FNPROTO_PARTIAL_6(epel_hv, (int16_t *dst,
324 const uint8_t *src, ptrdiff_t srcstride, int height,
325 const int8_t *hf, const int8_t *vf, int width),);
326
327NEON8_FNPROTO_PARTIAL_6(epel_hv, (int16_t *dst,
328 const uint8_t *src, ptrdiff_t srcstride, int height,
329 const int8_t *hf, const int8_t *vf, int width), _i8mm);
330
331#endif
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t const uint8_t ptrdiff_t srcstride
Definition dsp.h:98
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
Definition dsp.h:67
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)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int const int8_t const int8_t * vf
Definition dsp.h:272
#define NEON8_FNPROTO_PARTIAL_6(fn, args, ext)
Definition dsp.h:55
uint8_t ptrdiff_t _dststride
Definition dsp.h:66
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
Definition dsp.h:67
uint8_t * _dst
Definition dsp.h:66
#define NEON8_FNPROTO_PARTIAL_4(fn, args, ext)
Definition dsp.h:262
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)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int const int8_t * hf
Definition dsp.h:272
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)
uint8_t ptrdiff_t const uint8_t ptrdiff_t _srcstride
Definition dsp.h:67
#define NEON8_FNPROTO(fn, args, ext)
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)
uint8_t ptrdiff_t const uint8_t * _src
Definition dsp.h:66
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:97
#define SAO_EDGE_FILTER_PROTO(codec, size, depth)
Definition dsp.h:35
const pixel * src2
#define src
Definition vp8dsp.c:248
#define height
Definition dsp.h:99
#define width
Definition dsp.h:99