Go to the documentation of this file.
24 #define YUV_TO_RGB_TABLE \
25 c->yuv2rgb_v2r_coeff, \
26 c->yuv2rgb_u2g_coeff, \
27 c->yuv2rgb_v2g_coeff, \
28 c->yuv2rgb_u2b_coeff, \
30 #define DECLARE_FF_YUVX_TO_RGBX_FUNCS(ifmt, ofmt) \
31 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
32 uint8_t *dst, int linesize, \
33 const uint8_t *srcY, int linesizeY, \
34 const uint8_t *srcU, int linesizeU, \
35 const uint8_t *srcV, int linesizeV, \
36 const int16_t *table, \
40 static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[], \
41 int srcStride[], int srcSliceY, int srcSliceH, \
42 uint8_t *dst[], int dstStride[]) { \
43 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
45 return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
46 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
47 src[0], srcStride[0], \
48 src[1], srcStride[1], \
49 src[2], srcStride[2], \
51 c->yuv2rgb_y_offset >> 6, \
52 c->yuv2rgb_y_coeff); \
55 #define DECLARE_FF_YUVX_TO_GBRP_FUNCS(ifmt, ofmt) \
56 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
57 uint8_t *dst, int linesize, \
58 const uint8_t *srcY, int linesizeY, \
59 const uint8_t *srcU, int linesizeU, \
60 const uint8_t *srcV, int linesizeV, \
61 const int16_t *table, \
64 uint8_t *dst1, int linesize1, \
65 uint8_t *dst2, int linesize2); \
67 static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[], \
68 int srcStride[], int srcSliceY, int srcSliceH, \
69 uint8_t *dst[], int dstStride[]) { \
70 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
72 return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
73 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
74 src[0], srcStride[0], \
75 src[1], srcStride[1], \
76 src[2], srcStride[2], \
78 c->yuv2rgb_y_offset >> 6, \
80 dst[1] + srcSliceY * dstStride[1], dstStride[1], \
81 dst[2] + srcSliceY * dstStride[2], dstStride[2]); \
84 #define DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuvx) \
85 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, argb) \
86 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, rgba) \
87 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, abgr) \
88 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, bgra) \
89 DECLARE_FF_YUVX_TO_GBRP_FUNCS(yuvx, gbrp) \
94 #define DECLARE_FF_NVX_TO_RGBX_FUNCS(ifmt, ofmt) \
95 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
96 uint8_t *dst, int linesize, \
97 const uint8_t *srcY, int linesizeY, \
98 const uint8_t *srcC, int linesizeC, \
99 const int16_t *table, \
103 static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[], \
104 int srcStride[], int srcSliceY, int srcSliceH, \
105 uint8_t *dst[], int dstStride[]) { \
106 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
108 return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
109 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
110 src[0], srcStride[0], src[1], srcStride[1], \
112 c->yuv2rgb_y_offset >> 6, \
113 c->yuv2rgb_y_coeff); \
116 #define DECLARE_FF_NVX_TO_GBRP_FUNCS(ifmt, ofmt) \
117 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
118 uint8_t *dst, int linesize, \
119 const uint8_t *srcY, int linesizeY, \
120 const uint8_t *srcC, int linesizeC, \
121 const int16_t *table, \
124 uint8_t *dst1, int linesize1, \
125 uint8_t *dst2, int linesize2); \
127 static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[], \
128 int srcStride[], int srcSliceY, int srcSliceH, \
129 uint8_t *dst[], int dstStride[]) { \
130 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
132 return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
133 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
134 src[0], srcStride[0], src[1], srcStride[1], \
136 c->yuv2rgb_y_offset >> 6, \
137 c->yuv2rgb_y_coeff, \
138 dst[1] + srcSliceY * dstStride[1], dstStride[1], \
139 dst[2] + srcSliceY * dstStride[2], dstStride[2]); \
143 uint8_t *dst2,
int dstStride2,
144 const uint8_t *
src,
int srcStride,
148 int srcStride[],
int srcSliceY,
int srcSliceH,
149 uint8_t *
dst[],
int dstStride[])
151 uint8_t *dst1 =
dst[1] + dstStride[1] * srcSliceY / 2;
152 uint8_t *dst2 =
dst[2] + dstStride[2] * srcSliceY / 2;
155 dst[0], dstStride[0]);
159 src[1], srcStride[1],
c->srcW / 2, srcSliceH);
162 src[1], srcStride[1],
c->srcW / 2, srcSliceH);
167 #define DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nvx) \
168 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, argb) \
169 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, rgba) \
170 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, abgr) \
171 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, bgra) \
172 DECLARE_FF_NVX_TO_GBRP_FUNCS(nvx, gbrp) \
181 #define SET_FF_NVX_TO_RGBX_FUNC(ifmt, IFMT, ofmt, OFMT, accurate_rnd) do { \
182 if (c->srcFormat == AV_PIX_FMT_##IFMT \
183 && c->dstFormat == AV_PIX_FMT_##OFMT \
187 c->convert_unscaled = ifmt##_to_##ofmt##_neon_wrapper; \
190 #define SET_FF_NVX_TO_ALL_RGBX_FUNC(nvx, NVX, accurate_rnd) do { \
191 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, argb, ARGB, accurate_rnd); \
192 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, rgba, RGBA, accurate_rnd); \
193 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, abgr, ABGR, accurate_rnd); \
194 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, bgra, BGRA, accurate_rnd); \
195 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, gbrp, GBRP, accurate_rnd); \
208 !(
c->srcH & 1) && !(
c->srcW & 15) && !accurate_rnd)
#define SET_FF_NVX_TO_ALL_RGBX_FUNC(nvx, NVX, accurate_rnd)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
static atomic_int cpu_flags
static int nv24_to_yuv420p_neon_wrapper(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
void ff_get_unscaled_swscale_aarch64(SwsContext *c)
#define DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuvx)
static void get_unscaled_swscale_neon(SwsContext *c)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
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
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
void ff_copyPlane(const uint8_t *src, int srcStride, int srcSliceY, int srcSliceH, int width, uint8_t *dst, int dstStride)
@ AV_PIX_FMT_NV24
planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
void ff_nv24_to_yuv420p_chroma_neon(uint8_t *dst1, int dstStride1, uint8_t *dst2, int dstStride2, const uint8_t *src, int srcStride, int w, int h)
@ AV_PIX_FMT_NV42
as above, but U and V bytes are swapped
#define DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nvx)