FFmpeg
swscale.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include "config.h"
20 #include "libavutil/attributes.h"
21 #include "libswscale/swscale.h"
23 #include "libavutil/aarch64/cpu.h"
24 #include "asm-offsets.h"
25 
26 #define SIZEOF_MEMBER(type, member) \
27  sizeof(((type*)0)->member)
28 
29 static_assert(offsetof(SwsLuts, in) == SL_IN, "struct layout mismatch");
30 static_assert(offsetof(SwsLuts, out) == SL_OUT, "struct layout mismatch");
31 
32 static_assert(offsetof(SwsColorXform, gamma) == SCX_GAMMA,
33  "struct layout mismatch");
34 static_assert(offsetof(SwsColorXform, mat) == SCX_MAT,
35  "struct layout mismatch");
36 
37 static_assert(offsetof(SwsColorXform, mat) +
38  2 * SIZEOF_MEMBER(SwsColorXform, mat[0]) +
39  2 * SIZEOF_MEMBER(SwsColorXform, mat[0][0]) == SCX_MAT_22,
40  "struct layout mismatch");
41 
42 void ff_xyz12Torgb48le_neon_asm(const SwsColorXform *c, uint8_t *dst,
43  int dst_stride, const uint8_t *src,
44  int src_stride, int w, int h);
45 
46 static void xyz12Torgb48le_neon(const SwsInternal *c, uint8_t *dst,
47  int dst_stride, const uint8_t *src,
48  int src_stride, int w, int h)
49 {
50  ff_xyz12Torgb48le_neon_asm(&c->xyz2rgb, dst, dst_stride, src, src_stride,
51  w, h);
52 }
53 
54 void ff_hscale16to15_4_neon_asm(int shift, int16_t *_dst, int dstW,
55  const uint8_t *_src, const int16_t *filter,
56  const int32_t *filterPos, int filterSize);
57 void ff_hscale16to15_X8_neon_asm(int shift, int16_t *_dst, int dstW,
58  const uint8_t *_src, const int16_t *filter,
59  const int32_t *filterPos, int filterSize);
60 void ff_hscale16to15_X4_neon_asm(int shift, int16_t *_dst, int dstW,
61  const uint8_t *_src, const int16_t *filter,
62  const int32_t *filterPos, int filterSize);
63 void ff_hscale16to19_4_neon_asm(int shift, int16_t *_dst, int dstW,
64  const uint8_t *_src, const int16_t *filter,
65  const int32_t *filterPos, int filterSize);
66 void ff_hscale16to19_X8_neon_asm(int shift, int16_t *_dst, int dstW,
67  const uint8_t *_src, const int16_t *filter,
68  const int32_t *filterPos, int filterSize);
69 void ff_hscale16to19_X4_neon_asm(int shift, int16_t *_dst, int dstW,
70  const uint8_t *_src, const int16_t *filter,
71  const int32_t *filterPos, int filterSize);
72 
73 static void ff_hscale16to15_4_neon(SwsInternal *c, int16_t *_dst, int dstW,
74  const uint8_t *_src, const int16_t *filter,
75  const int32_t *filterPos, int filterSize)
76 {
77  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
78  int sh = desc->comp[0].depth - 1;
79 
80  if (sh<15) {
81  sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
82  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
83  sh = 16 - 1;
84  }
85  ff_hscale16to15_4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
86 
87 }
88 
89 static void ff_hscale16to15_X8_neon(SwsInternal *c, int16_t *_dst, int dstW,
90  const uint8_t *_src, const int16_t *filter,
91  const int32_t *filterPos, int filterSize)
92 {
93  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
94  int sh = desc->comp[0].depth - 1;
95 
96  if (sh<15) {
97  sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
98  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
99  sh = 16 - 1;
100  }
101  ff_hscale16to15_X8_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
102 
103 }
104 
105 static void ff_hscale16to15_X4_neon(SwsInternal *c, int16_t *_dst, int dstW,
106  const uint8_t *_src, const int16_t *filter,
107  const int32_t *filterPos, int filterSize)
108 {
109  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
110  int sh = desc->comp[0].depth - 1;
111 
112  if (sh<15) {
113  sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
114  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
115  sh = 16 - 1;
116  }
117  ff_hscale16to15_X4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
118 }
119 
120 static void ff_hscale16to19_4_neon(SwsInternal *c, int16_t *_dst, int dstW,
121  const uint8_t *_src, const int16_t *filter,
122  const int32_t *filterPos, int filterSize)
123 {
124  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
125  int bits = desc->comp[0].depth - 1;
126  int sh = bits - 4;
127 
128  if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
129  sh = 9;
130  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
131  sh = 16 - 1 - 4;
132  }
133 
134  ff_hscale16to19_4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
135 
136 }
137 
138 static void ff_hscale16to19_X8_neon(SwsInternal *c, int16_t *_dst, int dstW,
139  const uint8_t *_src, const int16_t *filter,
140  const int32_t *filterPos, int filterSize)
141 {
142  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
143  int bits = desc->comp[0].depth - 1;
144  int sh = bits - 4;
145 
146  if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
147  sh = 9;
148  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
149  sh = 16 - 1 - 4;
150  }
151 
152  ff_hscale16to19_X8_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
153 
154 }
155 
156 static void ff_hscale16to19_X4_neon(SwsInternal *c, int16_t *_dst, int dstW,
157  const uint8_t *_src, const int16_t *filter,
158  const int32_t *filterPos, int filterSize)
159 {
160  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
161  int bits = desc->comp[0].depth - 1;
162  int sh = bits - 4;
163 
164  if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
165  sh = 9;
166  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
167  sh = 16 - 1 - 4;
168  }
169 
170  ff_hscale16to19_X4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
171 
172 }
173 
174 #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
175 void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \
176  SwsInternal *c, int16_t *data, \
177  int dstW, const uint8_t *src, \
178  const int16_t *filter, \
179  const int32_t *filterPos, int filterSize)
180 #define SCALE_FUNCS(filter_n, opt) \
181  SCALE_FUNC(filter_n, 8, 15, opt); \
182  SCALE_FUNC(filter_n, 8, 19, opt);
183 #define ALL_SCALE_FUNCS(opt) \
184  SCALE_FUNCS(4, opt); \
185  SCALE_FUNCS(X8, opt); \
186  SCALE_FUNCS(X4, opt)
187 
188 ALL_SCALE_FUNCS(neon);
189 
190 void ff_yuv2planeX_10_neon(const int16_t *filter, int filterSize,
191  const int16_t **src, uint16_t *dest, int dstW,
192  int big_endian, int output_bits);
193 
194 #define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t) \
195 static void yuv2planeX_ ## bits ## BE_LE ## _neon(const int16_t *filter, int filterSize, \
196  const int16_t **src, uint8_t *dest, int dstW, \
197  const uint8_t *dither, int offset) \
198 { \
199  ff_yuv2planeX_## template_size ## _neon(filter, \
200  filterSize, (const typeX_t **) src, \
201  (uint16_t *) dest, dstW, is_be, bits); \
202 }
203 
204 yuv2NBPS( 9, BE, 1, 10, int16_t)
205 yuv2NBPS( 9, LE, 0, 10, int16_t)
206 yuv2NBPS(10, BE, 1, 10, int16_t)
207 yuv2NBPS(10, LE, 0, 10, int16_t)
208 yuv2NBPS(12, BE, 1, 10, int16_t)
209 yuv2NBPS(12, LE, 0, 10, int16_t)
210 yuv2NBPS(14, BE, 1, 10, int16_t)
211 yuv2NBPS(14, LE, 0, 10, int16_t)
212 
213 void ff_yuv2planeX_8_neon(const int16_t *filter, int filterSize,
214  const int16_t **src, uint8_t *dest, int dstW,
215  const uint8_t *dither, int offset);
216 void ff_yuv2plane1_8_neon(
217  const int16_t *src,
218  uint8_t *dest,
219  int dstW,
220  const uint8_t *dither,
221  int offset);
222 
223 void ff_yuv2nv12cX_neon_asm(int isSwapped, const uint8_t *chrDither,
224  const int16_t *chrFilter, int chrFilterSize,
225  const int16_t **chrUSrc, const int16_t **chrVSrc,
226  uint8_t *dest, int chrDstW);
227 
228 static void ff_yuv2nv12cX_neon(enum AVPixelFormat dstFormat, const uint8_t *chrDither,
229  const int16_t *chrFilter, int chrFilterSize,
230  const int16_t **chrUSrc, const int16_t **chrVSrc,
231  uint8_t *dest, int chrDstW)
232 {
233  if (!isSwappedChroma(dstFormat)) {
234  ff_yuv2nv12cX_neon_asm(1, chrDither, chrFilter, chrFilterSize,
235  chrUSrc, chrVSrc, dest, chrDstW);
236  } else {
237  ff_yuv2nv12cX_neon_asm(0, chrDither, chrFilter, chrFilterSize,
238  chrUSrc, chrVSrc, dest, chrDstW);
239  }
240 }
241 
242 #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt) do { \
243  if (c->srcBpc == 8) { \
244  if(c->dstBpc <= 14) { \
245  hscalefn = \
246  ff_hscale8to15_ ## filtersize ## _ ## opt; \
247  } else \
248  hscalefn = \
249  ff_hscale8to19_ ## filtersize ## _ ## opt; \
250  } else { \
251  if (c->dstBpc <= 14) \
252  hscalefn = \
253  ff_hscale16to15_ ## filtersize ## _ ## opt; \
254  else \
255  hscalefn = \
256  ff_hscale16to19_ ## filtersize ## _ ## opt; \
257  } \
258 } while (0)
259 
260 #define ASSIGN_SCALE_FUNC(hscalefn, filtersize, opt) do { \
261  if (filtersize == 4) \
262  ASSIGN_SCALE_FUNC2(hscalefn, 4, opt); \
263  else if (filtersize % 8 == 0) \
264  ASSIGN_SCALE_FUNC2(hscalefn, X8, opt); \
265  else if (filtersize % 4 == 0 && filtersize % 8 != 0) \
266  ASSIGN_SCALE_FUNC2(hscalefn, X4, opt); \
267 } while (0)
268 
269 #define ASSIGN_VSCALE_FUNC(vscalefn, opt) \
270  switch (c->dstBpc) { \
271  case 8: vscalefn = ff_yuv2plane1_8_ ## opt; break; \
272  default: break; \
273  }
274 
275 #define NEON_INPUT(name) \
276 void ff_##name##ToY_neon(uint8_t *dst, const uint8_t *src, const uint8_t *, \
277  const uint8_t *, int w, uint32_t *coeffs, void *); \
278 void ff_##name##ToUV_neon(uint8_t *, uint8_t *, const uint8_t *, \
279  const uint8_t *, const uint8_t *, int w, \
280  uint32_t *coeffs, void *); \
281 void ff_##name##ToUV_half_neon(uint8_t *, uint8_t *, const uint8_t *, \
282  const uint8_t *, const uint8_t *, int w, \
283  uint32_t *coeffs, void *)
284 #define NEON_INPUT_DOTPROD(name) \
285 void ff_##name##ToY_neon_dotprod(uint8_t *dst, const uint8_t *src, const uint8_t *, \
286  const uint8_t *, int w, uint32_t *coeffs, void *);
287 
288 NEON_INPUT(abgr32);
289 NEON_INPUT(argb32);
290 NEON_INPUT(bgr24);
291 NEON_INPUT(bgra32);
292 NEON_INPUT(rgb24);
293 NEON_INPUT(rgba32);
294 NEON_INPUT_DOTPROD(bgra32);
295 NEON_INPUT_DOTPROD(rgba32);
296 
297 void ff_lumRangeFromJpeg8_neon(int16_t *dst, int width,
298  uint32_t coeff, int64_t offset);
299 void ff_chrRangeFromJpeg8_neon(int16_t *dstU, int16_t *dstV, int width,
300  uint32_t coeff, int64_t offset);
301 void ff_lumRangeToJpeg8_neon(int16_t *dst, int width,
302  uint32_t coeff, int64_t offset);
303 void ff_chrRangeToJpeg8_neon(int16_t *dstU, int16_t *dstV, int width,
304  uint32_t coeff, int64_t offset);
305 void ff_lumRangeFromJpeg16_neon(int16_t *dst, int width,
306  uint32_t coeff, int64_t offset);
307 void ff_chrRangeFromJpeg16_neon(int16_t *dstU, int16_t *dstV, int width,
308  uint32_t coeff, int64_t offset);
309 void ff_lumRangeToJpeg16_neon(int16_t *dst, int width,
310  uint32_t coeff, int64_t offset);
311 void ff_chrRangeToJpeg16_neon(int16_t *dstU, int16_t *dstV, int width,
312  uint32_t coeff, int64_t offset);
313 
315 {
316  int cpu_flags = av_get_cpu_flags();
317 
318  if (have_neon(cpu_flags)) {
319  if (c->dstBpc <= 14) {
320  if (c->opts.src_range) {
321  c->lumConvertRange = ff_lumRangeFromJpeg8_neon;
322  c->chrConvertRange = ff_chrRangeFromJpeg8_neon;
323  } else {
324  c->lumConvertRange = ff_lumRangeToJpeg8_neon;
325  c->chrConvertRange = ff_chrRangeToJpeg8_neon;
326  }
327  } else {
328  if (c->opts.src_range) {
329  c->lumConvertRange = ff_lumRangeFromJpeg16_neon;
330  c->chrConvertRange = ff_chrRangeFromJpeg16_neon;
331  } else {
332  c->lumConvertRange = ff_lumRangeToJpeg16_neon;
333  c->chrConvertRange = ff_chrRangeToJpeg16_neon;
334  }
335  }
336  }
337 }
338 
340 {
341  int cpu_flags = av_get_cpu_flags();
342 
343  if (have_neon(cpu_flags)) {
344  if (!isBE(c->opts.src_format)) {
345  c->xyz12Torgb48 = xyz12Torgb48le_neon;
346  }
347  }
348 }
349 
351 {
352  int cpu_flags = av_get_cpu_flags();
353  enum AVPixelFormat dstFormat = c->opts.dst_format;
354  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
355 
356  if (have_neon(cpu_flags)) {
357  ASSIGN_SCALE_FUNC(c->hyScale, c->hLumFilterSize, neon);
358  ASSIGN_SCALE_FUNC(c->hcScale, c->hChrFilterSize, neon);
359  ASSIGN_VSCALE_FUNC(c->yuv2plane1, neon);
360  if (c->dstBpc == 8) {
361  c->yuv2planeX = ff_yuv2planeX_8_neon;
362  if (isSemiPlanarYUV(dstFormat) && !isDataInHighBits(dstFormat))
363  c->yuv2nv12cX = ff_yuv2nv12cX_neon;
364  }
365 
366  if (isNBPS(dstFormat) && !isSemiPlanarYUV(dstFormat) && !isDataInHighBits(dstFormat)) {
367  if (desc->comp[0].depth == 9) {
368  c->yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_neon : yuv2planeX_9LE_neon;
369  } else if (desc->comp[0].depth == 10) {
370  c->yuv2planeX = isBE(dstFormat) ? yuv2planeX_10BE_neon : yuv2planeX_10LE_neon;
371  } else if (desc->comp[0].depth == 12) {
372  c->yuv2planeX = isBE(dstFormat) ? yuv2planeX_12BE_neon : yuv2planeX_12LE_neon;
373  } else if (desc->comp[0].depth == 14) {
374  c->yuv2planeX = isBE(dstFormat) ? yuv2planeX_14BE_neon : yuv2planeX_14LE_neon;
375  } else
376  av_assert0(0);
377  }
378  switch (c->opts.src_format) {
379  case AV_PIX_FMT_ABGR:
380  c->lumToYV12 = ff_abgr32ToY_neon;
381  if (c->chrSrcHSubSample)
382  c->chrToYV12 = ff_abgr32ToUV_half_neon;
383  else
384  c->chrToYV12 = ff_abgr32ToUV_neon;
385  break;
386 
387  case AV_PIX_FMT_ARGB:
388  c->lumToYV12 = ff_argb32ToY_neon;
389  if (c->chrSrcHSubSample)
390  c->chrToYV12 = ff_argb32ToUV_half_neon;
391  else
392  c->chrToYV12 = ff_argb32ToUV_neon;
393  break;
394  case AV_PIX_FMT_BGR24:
395  c->lumToYV12 = ff_bgr24ToY_neon;
396  if (c->chrSrcHSubSample)
397  c->chrToYV12 = ff_bgr24ToUV_half_neon;
398  else
399  c->chrToYV12 = ff_bgr24ToUV_neon;
400  break;
401  case AV_PIX_FMT_BGRA:
402  c->lumToYV12 = ff_bgra32ToY_neon;
403 #if HAVE_DOTPROD
404  if (have_dotprod(cpu_flags)) {
405  c->lumToYV12 = ff_bgra32ToY_neon_dotprod;
406  }
407 #endif
408  if (c->chrSrcHSubSample)
409  c->chrToYV12 = ff_bgra32ToUV_half_neon;
410  else
411  c->chrToYV12 = ff_bgra32ToUV_neon;
412  break;
413  case AV_PIX_FMT_RGB24:
414  c->lumToYV12 = ff_rgb24ToY_neon;
415  if (c->chrSrcHSubSample)
416  c->chrToYV12 = ff_rgb24ToUV_half_neon;
417  else
418  c->chrToYV12 = ff_rgb24ToUV_neon;
419  break;
420  case AV_PIX_FMT_RGBA:
421  c->lumToYV12 = ff_rgba32ToY_neon;
422 #if HAVE_DOTPROD
423  if (have_dotprod(cpu_flags)) {
424  c->lumToYV12 = ff_rgba32ToY_neon_dotprod;
425  }
426 #endif
427  if (c->chrSrcHSubSample)
428  c->chrToYV12 = ff_rgba32ToUV_half_neon;
429  else
430  c->chrToYV12 = ff_rgba32ToUV_neon;
431  break;
432  default:
433  break;
434  }
435  }
436 }
_dst
uint8_t * _dst
Definition: dsp.h:56
ff_lumRangeFromJpeg16_neon
void ff_lumRangeFromJpeg16_neon(int16_t *dst, int width, uint32_t coeff, int64_t offset)
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
ff_hscale16to19_X4_neon_asm
void ff_hscale16to19_X4_neon_asm(int shift, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
out
FILE * out
Definition: movenc.c:55
ff_sws_init_range_convert_aarch64
av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c)
Definition: swscale.c:314
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3456
SCX_GAMMA
#define SCX_GAMMA
Definition: asm-offsets.h:29
int64_t
long long int64_t
Definition: coverity.c:34
AV_PIX_FMT_FLAG_FLOAT
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
Definition: pixdesc.h:158
w
uint8_t w
Definition: llviddspenc.c:38
filter
void(* filter)(uint8_t *src, int stride, int qscale)
Definition: h263dsp.c:29
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:102
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:109
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:56
ff_lumRangeToJpeg16_neon
void ff_lumRangeToJpeg16_neon(int16_t *dst, int width, uint32_t coeff, int64_t offset)
_src
uint8_t ptrdiff_t const uint8_t * _src
Definition: dsp.h:56
ff_hscale16to15_X4_neon_asm
void ff_hscale16to15_X4_neon_asm(int shift, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
ff_hscale16to15_4_neon
static void ff_hscale16to15_4_neon(SwsInternal *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale.c:73
ff_chrRangeFromJpeg8_neon
void ff_chrRangeFromJpeg8_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)
ff_sws_init_xyzdsp_aarch64
av_cold void ff_sws_init_xyzdsp_aarch64(SwsInternal *c)
Definition: swscale.c:339
isNBPS
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:757
NEON_INPUT
#define NEON_INPUT(name)
Definition: swscale.c:275
ff_hscale16to15_X8_neon_asm
void ff_hscale16to15_X8_neon_asm(int shift, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
ff_hscale16to19_X4_neon
static void ff_hscale16to19_X4_neon(SwsInternal *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale.c:156
av_cold
#define av_cold
Definition: attributes.h:106
dither
static const uint16_t dither[8][8]
Definition: vf_gradfun.c:46
ff_lumRangeToJpeg8_neon
void ff_lumRangeToJpeg8_neon(int16_t *dst, int width, uint32_t coeff, int64_t offset)
bits
uint8_t bits
Definition: vp3data.h:128
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:41
ff_yuv2planeX_8_neon
void ff_yuv2planeX_8_neon(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:100
ff_hscale16to15_X4_neon
static void ff_hscale16to15_X4_neon(SwsInternal *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale.c:105
isSemiPlanarYUV
static av_always_inline int isSemiPlanarYUV(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:789
ff_hscale16to19_X8_neon_asm
void ff_hscale16to19_X8_neon_asm(int shift, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
SIZEOF_MEMBER
#define SIZEOF_MEMBER(type, member)
Definition: swscale.c:26
SCX_MAT_22
#define SCX_MAT_22
Definition: asm-offsets.h:34
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:101
ff_chrRangeToJpeg16_neon
void ff_chrRangeToJpeg16_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)
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
isDataInHighBits
static av_always_inline int isDataInHighBits(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:952
ff_yuv2planeX_10_neon
void ff_yuv2planeX_10_neon(const int16_t *filter, int filterSize, const int16_t **src, uint16_t *dest, int dstW, int big_endian, int output_bits)
asm-offsets.h
isBE
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:764
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
ff_lumRangeFromJpeg8_neon
void ff_lumRangeFromJpeg8_neon(int16_t *dst, int width, uint32_t coeff, int64_t offset)
shift
static int shift(int a, int b)
Definition: bonk.c:261
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
isAnyRGB
static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:872
ff_hscale16to19_4_neon
static void ff_hscale16to19_4_neon(SwsInternal *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale.c:120
have_neon
#define have_neon(flags)
Definition: cpu.h:26
SwsLuts
Definition: swscale_internal.h:99
isSwappedChroma
static av_always_inline int isSwappedChroma(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:971
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
attributes.h
ff_hscale16to19_4_neon_asm
void ff_hscale16to19_4_neon_asm(int shift, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:99
swscale_internal.h
ASSIGN_VSCALE_FUNC
#define ASSIGN_VSCALE_FUNC(vscalefn, opt)
Definition: swscale.c:269
yuv2NBPS
#define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t)
Definition: swscale.c:194
ff_xyz12Torgb48le_neon_asm
void ff_xyz12Torgb48le_neon_asm(const SwsColorXform *c, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
SL_IN
#define SL_IN
Definition: asm-offsets.h:25
ff_hscale16to15_X8_neon
static void ff_hscale16to15_X8_neon(SwsInternal *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale.c:89
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:84
ASSIGN_SCALE_FUNC
#define ASSIGN_SCALE_FUNC(hscalefn, filtersize, opt)
Definition: swscale.c:260
SwsInternal
Definition: swscale_internal.h:330
SCX_MAT
#define SCX_MAT
Definition: asm-offsets.h:30
ff_chrRangeFromJpeg16_neon
void ff_chrRangeFromJpeg16_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)
have_dotprod
#define have_dotprod(flags)
Definition: cpu.h:28
desc
const char * desc
Definition: libsvtav1.c:78
ff_hscale16to15_4_neon_asm
void ff_hscale16to15_4_neon_asm(int shift, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
ff_hscale16to19_X8_neon
static void ff_hscale16to19_X8_neon(SwsInternal *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
Definition: swscale.c:138
ff_sws_init_swscale_aarch64
av_cold void ff_sws_init_swscale_aarch64(SwsInternal *c)
Definition: swscale.c:350
int32_t
int32_t
Definition: audioconvert.c:56
coeff
static const double coeff[2][5]
Definition: vf_owdenoise.c:80
SwsColorXform
Definition: swscale_internal.h:104
h
h
Definition: vp9dsp_template.c:2070
NEON_INPUT_DOTPROD
#define NEON_INPUT_DOTPROD(name)
Definition: swscale.c:284
width
#define width
Definition: dsp.h:89
cpu.h
ALL_SCALE_FUNCS
#define ALL_SCALE_FUNCS(opt)
Definition: swscale.c:183
xyz12Torgb48le_neon
static void xyz12Torgb48le_neon(const SwsInternal *c, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
Definition: swscale.c:46
SL_OUT
#define SL_OUT
Definition: asm-offsets.h:26
src
#define src
Definition: vp8dsp.c:248
swscale.h
ff_chrRangeToJpeg8_neon
void ff_chrRangeToJpeg8_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)