Go to the documentation of this file.
27 const int32_t *filterPos,
int filterSize);
30 const int32_t *filterPos,
int filterSize);
33 const int32_t *filterPos,
int filterSize);
36 const int32_t *filterPos,
int filterSize);
39 const int32_t *filterPos,
int filterSize);
42 const int32_t *filterPos,
int filterSize);
46 const int32_t *filterPos,
int filterSize)
49 int sh =
desc->comp[0].depth - 1;
62 const int32_t *filterPos,
int filterSize)
65 int sh =
desc->comp[0].depth - 1;
78 const int32_t *filterPos,
int filterSize)
81 int sh =
desc->comp[0].depth - 1;
93 const int32_t *filterPos,
int filterSize)
111 const int32_t *filterPos,
int filterSize)
129 const int32_t *filterPos,
int filterSize)
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); \
162 const int16_t **
src, uint16_t *dest,
int dstW,
163 int big_endian,
int output_bits);
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) \
170 ff_yuv2planeX_## template_size ## _neon(filter, \
171 filterSize, (const typeX_t **) src, \
172 (uint16_t *) dest, dstW, is_be, bits); \
185 const int16_t **
src, uint8_t *dest,
int dstW,
187 void ff_yuv2plane1_8_neon(
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);
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)
205 ff_yuv2nv12cX_neon_asm(1, chrDither, chrFilter, chrFilterSize,
206 chrUSrc, chrVSrc, dest, chrDstW);
208 ff_yuv2nv12cX_neon_asm(0, chrDither, chrFilter, chrFilterSize,
209 chrUSrc, chrVSrc, dest, chrDstW);
213 #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt) do { \
214 if (c->srcBpc == 8) { \
215 if(c->dstBpc <= 14) { \
217 ff_hscale8to15_ ## filtersize ## _ ## opt; \
220 ff_hscale8to19_ ## filtersize ## _ ## opt; \
222 if (c->dstBpc <= 14) \
224 ff_hscale16to15_ ## filtersize ## _ ## opt; \
227 ff_hscale16to19_ ## filtersize ## _ ## opt; \
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); \
240 #define ASSIGN_VSCALE_FUNC(vscalefn, opt) \
241 switch (c->dstBpc) { \
242 case 8: vscalefn = ff_yuv2plane1_8_ ## opt; break; \
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 *);
290 if (
c->dstBpc <= 14) {
291 if (
c->opts.src_range) {
299 if (
c->opts.src_range) {
320 if (
c->dstBpc == 8) {
323 c->yuv2nv12cX = ff_yuv2nv12cX_neon;
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;
338 switch (
c->opts.src_format) {
340 c->lumToYV12 = ff_abgr32ToY_neon;
341 if (
c->chrSrcHSubSample)
342 c->chrToYV12 = ff_abgr32ToUV_half_neon;
344 c->chrToYV12 = ff_abgr32ToUV_neon;
348 c->lumToYV12 = ff_argb32ToY_neon;
349 if (
c->chrSrcHSubSample)
350 c->chrToYV12 = ff_argb32ToUV_half_neon;
352 c->chrToYV12 = ff_argb32ToUV_neon;
355 c->lumToYV12 = ff_bgr24ToY_neon;
356 if (
c->chrSrcHSubSample)
357 c->chrToYV12 = ff_bgr24ToUV_half_neon;
359 c->chrToYV12 = ff_bgr24ToUV_neon;
362 c->lumToYV12 = ff_bgra32ToY_neon;
365 c->lumToYV12 = ff_bgra32ToY_neon_dotprod;
368 if (
c->chrSrcHSubSample)
369 c->chrToYV12 = ff_bgra32ToUV_half_neon;
371 c->chrToYV12 = ff_bgra32ToUV_neon;
374 c->lumToYV12 = ff_rgb24ToY_neon;
375 if (
c->chrSrcHSubSample)
376 c->chrToYV12 = ff_rgb24ToUV_half_neon;
378 c->chrToYV12 = ff_rgb24ToUV_neon;
381 c->lumToYV12 = ff_rgba32ToY_neon;
384 c->lumToYV12 = ff_rgba32ToY_neon_dotprod;
387 if (
c->chrSrcHSubSample)
388 c->chrToYV12 = ff_rgba32ToUV_half_neon;
390 c->chrToYV12 = ff_rgba32ToUV_neon;
void ff_lumRangeFromJpeg16_neon(int16_t *dst, int width, uint32_t coeff, int64_t offset)
AVPixelFormat
Pixel format.
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)
av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
void(* filter)(uint8_t *src, int stride, int qscale)
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
static atomic_int cpu_flags
void ff_lumRangeToJpeg16_neon(int16_t *dst, int width, uint32_t coeff, int64_t offset)
uint8_t ptrdiff_t const uint8_t * _src
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)
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)
void ff_chrRangeFromJpeg8_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
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)
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)
void ff_lumRangeToJpeg8_neon(int16_t *dst, int width, uint32_t coeff, int64_t offset)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
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
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
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)
static av_always_inline int isSemiPlanarYUV(enum AVPixelFormat pix_fmt)
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
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
void ff_chrRangeToJpeg16_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)
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
static av_always_inline int isDataInHighBits(enum AVPixelFormat pix_fmt)
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)
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
void ff_lumRangeFromJpeg8_neon(int16_t *dst, int width, uint32_t coeff, int64_t offset)
static int shift(int a, int b)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt)
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)
static av_always_inline int isSwappedChroma(enum AVPixelFormat pix_fmt)
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
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
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
#define ASSIGN_VSCALE_FUNC(vscalefn, opt)
#define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t)
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)
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
#define ASSIGN_SCALE_FUNC(hscalefn, filtersize, opt)
void ff_chrRangeFromJpeg16_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)
#define have_dotprod(flags)
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)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
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)
av_cold void ff_sws_init_swscale_aarch64(SwsInternal *c)
static const double coeff[2][5]
#define NEON_INPUT_DOTPROD(name)
#define ALL_SCALE_FUNCS(opt)
void ff_chrRangeToJpeg8_neon(int16_t *dstU, int16_t *dstV, int width, uint32_t coeff, int64_t offset)
static const uint8_t dither[8][8]