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 
25 void ff_hscale16to15_4_neon_asm(int shift, int16_t *_dst, int dstW,
26  const uint8_t *_src, const int16_t *filter,
27  const int32_t *filterPos, int filterSize);
28 void ff_hscale16to15_X8_neon_asm(int shift, int16_t *_dst, int dstW,
29  const uint8_t *_src, const int16_t *filter,
30  const int32_t *filterPos, int filterSize);
31 void ff_hscale16to15_X4_neon_asm(int shift, int16_t *_dst, int dstW,
32  const uint8_t *_src, const int16_t *filter,
33  const int32_t *filterPos, int filterSize);
34 void ff_hscale16to19_4_neon_asm(int shift, int16_t *_dst, int dstW,
35  const uint8_t *_src, const int16_t *filter,
36  const int32_t *filterPos, int filterSize);
37 void ff_hscale16to19_X8_neon_asm(int shift, int16_t *_dst, int dstW,
38  const uint8_t *_src, const int16_t *filter,
39  const int32_t *filterPos, int filterSize);
40 void ff_hscale16to19_X4_neon_asm(int shift, int16_t *_dst, int dstW,
41  const uint8_t *_src, const int16_t *filter,
42  const int32_t *filterPos, int filterSize);
43 
44 static void ff_hscale16to15_4_neon(SwsInternal *c, int16_t *_dst, int dstW,
45  const uint8_t *_src, const int16_t *filter,
46  const int32_t *filterPos, int filterSize)
47 {
48  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
49  int sh = desc->comp[0].depth - 1;
50 
51  if (sh<15) {
52  sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
53  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
54  sh = 16 - 1;
55  }
56  ff_hscale16to15_4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
57 
58 }
59 
60 static void ff_hscale16to15_X8_neon(SwsInternal *c, int16_t *_dst, int dstW,
61  const uint8_t *_src, const int16_t *filter,
62  const int32_t *filterPos, int filterSize)
63 {
64  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
65  int sh = desc->comp[0].depth - 1;
66 
67  if (sh<15) {
68  sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
69  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
70  sh = 16 - 1;
71  }
72  ff_hscale16to15_X8_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
73 
74 }
75 
76 static void ff_hscale16to15_X4_neon(SwsInternal *c, int16_t *_dst, int dstW,
77  const uint8_t *_src, const int16_t *filter,
78  const int32_t *filterPos, int filterSize)
79 {
80  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
81  int sh = desc->comp[0].depth - 1;
82 
83  if (sh<15) {
84  sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
85  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
86  sh = 16 - 1;
87  }
88  ff_hscale16to15_X4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
89 }
90 
91 static void ff_hscale16to19_4_neon(SwsInternal *c, int16_t *_dst, int dstW,
92  const uint8_t *_src, const int16_t *filter,
93  const int32_t *filterPos, int filterSize)
94 {
95  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
96  int bits = desc->comp[0].depth - 1;
97  int sh = bits - 4;
98 
99  if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
100  sh = 9;
101  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
102  sh = 16 - 1 - 4;
103  }
104 
105  ff_hscale16to19_4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
106 
107 }
108 
109 static void ff_hscale16to19_X8_neon(SwsInternal *c, int16_t *_dst, int dstW,
110  const uint8_t *_src, const int16_t *filter,
111  const int32_t *filterPos, int filterSize)
112 {
113  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
114  int bits = desc->comp[0].depth - 1;
115  int sh = bits - 4;
116 
117  if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
118  sh = 9;
119  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
120  sh = 16 - 1 - 4;
121  }
122 
123  ff_hscale16to19_X8_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
124 
125 }
126 
127 static void ff_hscale16to19_X4_neon(SwsInternal *c, int16_t *_dst, int dstW,
128  const uint8_t *_src, const int16_t *filter,
129  const int32_t *filterPos, int filterSize)
130 {
131  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
132  int bits = desc->comp[0].depth - 1;
133  int sh = bits - 4;
134 
135  if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
136  sh = 9;
137  } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
138  sh = 16 - 1 - 4;
139  }
140 
141  ff_hscale16to19_X4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize);
142 
143 }
144 
145 #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
146 void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \
147  SwsInternal *c, int16_t *data, \
148  int dstW, const uint8_t *src, \
149  const int16_t *filter, \
150  const int32_t *filterPos, int filterSize)
151 #define SCALE_FUNCS(filter_n, opt) \
152  SCALE_FUNC(filter_n, 8, 15, opt); \
153  SCALE_FUNC(filter_n, 8, 19, opt);
154 #define ALL_SCALE_FUNCS(opt) \
155  SCALE_FUNCS(4, opt); \
156  SCALE_FUNCS(X8, opt); \
157  SCALE_FUNCS(X4, opt)
158 
159 ALL_SCALE_FUNCS(neon);
160 
161 void ff_yuv2planeX_10_neon(const int16_t *filter, int filterSize,
162  const int16_t **src, uint16_t *dest, int dstW,
163  int big_endian, int output_bits);
164 
165 #define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t) \
166 static void yuv2planeX_ ## bits ## BE_LE ## _neon(const int16_t *filter, int filterSize, \
167  const int16_t **src, uint8_t *dest, int dstW, \
168  const uint8_t *dither, int offset) \
169 { \
170  ff_yuv2planeX_## template_size ## _neon(filter, \
171  filterSize, (const typeX_t **) src, \
172  (uint16_t *) dest, dstW, is_be, bits); \
173 }
174 
175 yuv2NBPS( 9, BE, 1, 10, int16_t)
176 yuv2NBPS( 9, LE, 0, 10, int16_t)
177 yuv2NBPS(10, BE, 1, 10, int16_t)
178 yuv2NBPS(10, LE, 0, 10, int16_t)
179 yuv2NBPS(12, BE, 1, 10, int16_t)
180 yuv2NBPS(12, LE, 0, 10, int16_t)
181 yuv2NBPS(14, BE, 1, 10, int16_t)
182 yuv2NBPS(14, LE, 0, 10, int16_t)
183 
184 void ff_yuv2planeX_8_neon(const int16_t *filter, int filterSize,
185  const int16_t **src, uint8_t *dest, int dstW,
186  const uint8_t *dither, int offset);
187 void ff_yuv2plane1_8_neon(
188  const int16_t *src,
189  uint8_t *dest,
190  int dstW,
191  const uint8_t *dither,
192  int offset);
193 
194 void ff_yuv2nv12cX_neon_asm(int isSwapped, const uint8_t *chrDither,
195  const int16_t *chrFilter, int chrFilterSize,
196  const int16_t **chrUSrc, const int16_t **chrVSrc,
197  uint8_t *dest, int chrDstW);
198 
199 static void ff_yuv2nv12cX_neon(enum AVPixelFormat dstFormat, const uint8_t *chrDither,
200  const int16_t *chrFilter, int chrFilterSize,
201  const int16_t **chrUSrc, const int16_t **chrVSrc,
202  uint8_t *dest, int chrDstW)
203 {
204  if (!isSwappedChroma(dstFormat)) {
205  ff_yuv2nv12cX_neon_asm(1, chrDither, chrFilter, chrFilterSize,
206  chrUSrc, chrVSrc, dest, chrDstW);
207  } else {
208  ff_yuv2nv12cX_neon_asm(0, chrDither, chrFilter, chrFilterSize,
209  chrUSrc, chrVSrc, dest, chrDstW);
210  }
211 }
212 
213 #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt) do { \
214  if (c->srcBpc == 8) { \
215  if(c->dstBpc <= 14) { \
216  hscalefn = \
217  ff_hscale8to15_ ## filtersize ## _ ## opt; \
218  } else \
219  hscalefn = \
220  ff_hscale8to19_ ## filtersize ## _ ## opt; \
221  } else { \
222  if (c->dstBpc <= 14) \
223  hscalefn = \
224  ff_hscale16to15_ ## filtersize ## _ ## opt; \
225  else \
226  hscalefn = \
227  ff_hscale16to19_ ## filtersize ## _ ## opt; \
228  } \
229 } while (0)
230 
231 #define ASSIGN_SCALE_FUNC(hscalefn, filtersize, opt) do { \
232  if (filtersize == 4) \
233  ASSIGN_SCALE_FUNC2(hscalefn, 4, opt); \
234  else if (filtersize % 8 == 0) \
235  ASSIGN_SCALE_FUNC2(hscalefn, X8, opt); \
236  else if (filtersize % 4 == 0 && filtersize % 8 != 0) \
237  ASSIGN_SCALE_FUNC2(hscalefn, X4, opt); \
238 } while (0)
239 
240 #define ASSIGN_VSCALE_FUNC(vscalefn, opt) \
241  switch (c->dstBpc) { \
242  case 8: vscalefn = ff_yuv2plane1_8_ ## opt; break; \
243  default: break; \
244  }
245 
246 #define NEON_INPUT(name) \
247 void ff_##name##ToY_neon(uint8_t *dst, const uint8_t *src, const uint8_t *, \
248  const uint8_t *, int w, uint32_t *coeffs, void *); \
249 void ff_##name##ToUV_neon(uint8_t *, uint8_t *, const uint8_t *, \
250  const uint8_t *, const uint8_t *, int w, \
251  uint32_t *coeffs, void *); \
252 void ff_##name##ToUV_half_neon(uint8_t *, uint8_t *, const uint8_t *, \
253  const uint8_t *, const uint8_t *, int w, \
254  uint32_t *coeffs, void *)
255 #define NEON_INPUT_DOTPROD(name) \
256 void ff_##name##ToY_neon_dotprod(uint8_t *dst, const uint8_t *src, const uint8_t *, \
257  const uint8_t *, int w, uint32_t *coeffs, void *);
258 
259 NEON_INPUT(abgr32);
260 NEON_INPUT(argb32);
261 NEON_INPUT(bgr24);
262 NEON_INPUT(bgra32);
263 NEON_INPUT(rgb24);
264 NEON_INPUT(rgba32);
265 NEON_INPUT_DOTPROD(bgra32);
266 NEON_INPUT_DOTPROD(rgba32);
267 
268 void ff_lumRangeFromJpeg8_neon(int16_t *dst, int width,
269  uint32_t coeff, int64_t offset);
270 void ff_chrRangeFromJpeg8_neon(int16_t *dstU, int16_t *dstV, int width,
271  uint32_t coeff, int64_t offset);
272 void ff_lumRangeToJpeg8_neon(int16_t *dst, int width,
273  uint32_t coeff, int64_t offset);
274 void ff_chrRangeToJpeg8_neon(int16_t *dstU, int16_t *dstV, int width,
275  uint32_t coeff, int64_t offset);
276 void ff_lumRangeFromJpeg16_neon(int16_t *dst, int width,
277  uint32_t coeff, int64_t offset);
278 void ff_chrRangeFromJpeg16_neon(int16_t *dstU, int16_t *dstV, int width,
279  uint32_t coeff, int64_t offset);
280 void ff_lumRangeToJpeg16_neon(int16_t *dst, int width,
281  uint32_t coeff, int64_t offset);
282 void ff_chrRangeToJpeg16_neon(int16_t *dstU, int16_t *dstV, int width,
283  uint32_t coeff, int64_t offset);
284 
286 {
287  int cpu_flags = av_get_cpu_flags();
288 
289  if (have_neon(cpu_flags)) {
290  if (c->dstBpc <= 14) {
291  if (c->opts.src_range) {
292  c->lumConvertRange = ff_lumRangeFromJpeg8_neon;
293  c->chrConvertRange = ff_chrRangeFromJpeg8_neon;
294  } else {
295  c->lumConvertRange = ff_lumRangeToJpeg8_neon;
296  c->chrConvertRange = ff_chrRangeToJpeg8_neon;
297  }
298  } else {
299  if (c->opts.src_range) {
300  c->lumConvertRange = ff_lumRangeFromJpeg16_neon;
301  c->chrConvertRange = ff_chrRangeFromJpeg16_neon;
302  } else {
303  c->lumConvertRange = ff_lumRangeToJpeg16_neon;
304  c->chrConvertRange = ff_chrRangeToJpeg16_neon;
305  }
306  }
307  }
308 }
309 
311 {
312  int cpu_flags = av_get_cpu_flags();
313  enum AVPixelFormat dstFormat = c->opts.dst_format;
314  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
315 
316  if (have_neon(cpu_flags)) {
317  ASSIGN_SCALE_FUNC(c->hyScale, c->hLumFilterSize, neon);
318  ASSIGN_SCALE_FUNC(c->hcScale, c->hChrFilterSize, neon);
319  ASSIGN_VSCALE_FUNC(c->yuv2plane1, neon);
320  if (c->dstBpc == 8) {
321  c->yuv2planeX = ff_yuv2planeX_8_neon;
322  if (isSemiPlanarYUV(dstFormat) && !isDataInHighBits(dstFormat))
323  c->yuv2nv12cX = ff_yuv2nv12cX_neon;
324  }
325 
326  if (isNBPS(dstFormat) && !isSemiPlanarYUV(dstFormat) && !isDataInHighBits(dstFormat)) {
327  if (desc->comp[0].depth == 9) {
328  c->yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_neon : yuv2planeX_9LE_neon;
329  } else if (desc->comp[0].depth == 10) {
330  c->yuv2planeX = isBE(dstFormat) ? yuv2planeX_10BE_neon : yuv2planeX_10LE_neon;
331  } else if (desc->comp[0].depth == 12) {
332  c->yuv2planeX = isBE(dstFormat) ? yuv2planeX_12BE_neon : yuv2planeX_12LE_neon;
333  } else if (desc->comp[0].depth == 14) {
334  c->yuv2planeX = isBE(dstFormat) ? yuv2planeX_14BE_neon : yuv2planeX_14LE_neon;
335  } else
336  av_assert0(0);
337  }
338  switch (c->opts.src_format) {
339  case AV_PIX_FMT_ABGR:
340  c->lumToYV12 = ff_abgr32ToY_neon;
341  if (c->chrSrcHSubSample)
342  c->chrToYV12 = ff_abgr32ToUV_half_neon;
343  else
344  c->chrToYV12 = ff_abgr32ToUV_neon;
345  break;
346 
347  case AV_PIX_FMT_ARGB:
348  c->lumToYV12 = ff_argb32ToY_neon;
349  if (c->chrSrcHSubSample)
350  c->chrToYV12 = ff_argb32ToUV_half_neon;
351  else
352  c->chrToYV12 = ff_argb32ToUV_neon;
353  break;
354  case AV_PIX_FMT_BGR24:
355  c->lumToYV12 = ff_bgr24ToY_neon;
356  if (c->chrSrcHSubSample)
357  c->chrToYV12 = ff_bgr24ToUV_half_neon;
358  else
359  c->chrToYV12 = ff_bgr24ToUV_neon;
360  break;
361  case AV_PIX_FMT_BGRA:
362  c->lumToYV12 = ff_bgra32ToY_neon;
363 #if HAVE_DOTPROD
364  if (have_dotprod(cpu_flags)) {
365  c->lumToYV12 = ff_bgra32ToY_neon_dotprod;
366  }
367 #endif
368  if (c->chrSrcHSubSample)
369  c->chrToYV12 = ff_bgra32ToUV_half_neon;
370  else
371  c->chrToYV12 = ff_bgra32ToUV_neon;
372  break;
373  case AV_PIX_FMT_RGB24:
374  c->lumToYV12 = ff_rgb24ToY_neon;
375  if (c->chrSrcHSubSample)
376  c->chrToYV12 = ff_rgb24ToUV_half_neon;
377  else
378  c->chrToYV12 = ff_rgb24ToUV_neon;
379  break;
380  case AV_PIX_FMT_RGBA:
381  c->lumToYV12 = ff_rgba32ToY_neon;
382 #if HAVE_DOTPROD
383  if (have_dotprod(cpu_flags)) {
384  c->lumToYV12 = ff_rgba32ToY_neon_dotprod;
385  }
386 #endif
387  if (c->chrSrcHSubSample)
388  c->chrToYV12 = ff_rgba32ToUV_half_neon;
389  else
390  c->chrToYV12 = ff_rgba32ToUV_neon;
391  break;
392  default:
393  break;
394  }
395  }
396 }
_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)
ff_sws_init_range_convert_aarch64
av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c)
Definition: swscale.c:285
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3447
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
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:44
ff_chrRangeFromJpeg8_neon
void ff_chrRangeFromJpeg8_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)
isNBPS
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:741
NEON_INPUT
#define NEON_INPUT(name)
Definition: swscale.c:246
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:127
av_cold
#define av_cold
Definition: attributes.h:90
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:76
isSemiPlanarYUV
static av_always_inline int isSemiPlanarYUV(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:773
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)
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:936
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)
isBE
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:748
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:856
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:91
have_neon
#define have_neon(flags)
Definition: cpu.h:26
isSwappedChroma
static av_always_inline int isSwappedChroma(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:955
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:240
yuv2NBPS
#define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t)
Definition: swscale.c:165
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:60
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:231
SwsInternal
Definition: swscale_internal.h:317
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:79
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:109
ff_sws_init_swscale_aarch64
av_cold void ff_sws_init_swscale_aarch64(SwsInternal *c)
Definition: swscale.c:310
int32_t
int32_t
Definition: audioconvert.c:56
coeff
static const double coeff[2][5]
Definition: vf_owdenoise.c:80
NEON_INPUT_DOTPROD
#define NEON_INPUT_DOTPROD(name)
Definition: swscale.c:255
width
#define width
Definition: dsp.h:89
cpu.h
ALL_SCALE_FUNCS
#define ALL_SCALE_FUNCS(opt)
Definition: swscale.c:154
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)
dither
static const uint8_t dither[8][8]
Definition: vf_fspp.c:62