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_PACKED_RGB_FUNCS(ifmt, ofmt) \
31 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
34 const int16_t *table, \
35 const uint8_t *const src[], const int srcStride[], \
36 uint8_t *dst, int linesize); \
38 static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const src[], \
39 const int srcStride[], int srcSliceY, \
40 int srcSliceH, uint8_t *const dst[], \
41 const int dstStride[]) { \
42 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
44 return ff_##ifmt##_to_##ofmt##_neon(c->opts.src_w, srcSliceH, \
45 c->yuv2rgb_y_offset >> 6, \
49 dst[0] + srcSliceY * dstStride[0], \
53 #define DECLARE_FF_YUVX_TO_PLANAR_RGB_FUNCS(ifmt, ofmt) \
54 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
57 const int16_t *table, \
58 const uint8_t *const src[], const int srcStride[], \
59 uint8_t *dst0, int linesize0, \
60 uint8_t *dst1, int linesize1, \
61 uint8_t *dst2, int linesize2); \
63 static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const src[], \
64 const int srcStride[], int srcSliceY, \
65 int srcSliceH, uint8_t *const dst[], \
66 const int dstStride[]) { \
67 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
69 return ff_##ifmt##_to_##ofmt##_neon(c->opts.src_w, srcSliceH, \
70 c->yuv2rgb_y_offset >> 6, \
74 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
75 dst[1] + srcSliceY * dstStride[1], dstStride[1], \
76 dst[2] + srcSliceY * dstStride[2], dstStride[2]); \
79 #define DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuvx) \
80 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, argb) \
81 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, rgba) \
82 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, abgr) \
83 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, bgra) \
84 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, rgb24) \
85 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, bgr24) \
86 DECLARE_FF_YUVX_TO_PLANAR_RGB_FUNCS(yuvx, gbrp) \
93 #define DECLARE_FF_YUVX_TO_ALL_RGB16_FUNCS(yuvx) \
94 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, rgb565le) \
95 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, bgr565le) \
96 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, rgb555le) \
97 DECLARE_FF_YUVX_TO_PACKED_RGB_FUNCS(yuvx, bgr555le) \
110 uint8_t *dst2,
int dstStride2,
111 const uint8_t *
src,
int srcStride,
115 const int srcStride[],
int srcSliceY,
int srcSliceH,
116 uint8_t *
const dst[],
const int dstStride[])
118 uint8_t *dst1 =
dst[1] + dstStride[1] * srcSliceY / 2;
119 uint8_t *dst2 =
dst[2] + dstStride[2] * srcSliceY / 2;
122 dst[0], dstStride[0]);
126 src[1], srcStride[1],
c->opts.src_w / 2,
130 src[1], srcStride[1],
c->opts.src_w / 2,
140 #define SET_FF_YUVX_TO_RGBX_FUNC(ifmt, IFMT, ofmt, OFMT, accurate_rnd) do { \
141 if (c->opts.src_format == AV_PIX_FMT_##IFMT \
142 && c->opts.dst_format == AV_PIX_FMT_##OFMT \
143 && !(c->opts.src_h & 1) \
144 && !(c->opts.src_w & 15) \
146 c->convert_unscaled = ifmt##_to_##ofmt##_neon_wrapper; \
149 #define SET_FF_YUVX_TO_ALL_RGBX_FUNC(yuvx, YUVX, accurate_rnd) do { \
150 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, argb, ARGB, accurate_rnd); \
151 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, rgba, RGBA, accurate_rnd); \
152 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, abgr, ABGR, accurate_rnd); \
153 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, bgra, BGRA, accurate_rnd); \
154 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, gbrp, GBRP, accurate_rnd); \
155 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, rgb24, RGB24, accurate_rnd); \
156 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, bgr24, BGR24, accurate_rnd); \
159 #define SET_FF_YUVX_TO_ALL_RGB16_FUNC(yuvx, YUVX, accurate_rnd) do { \
160 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, rgb565le, RGB565LE, accurate_rnd); \
161 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, bgr565le, BGR565LE, accurate_rnd); \
162 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, rgb555le, RGB555LE, accurate_rnd); \
163 SET_FF_YUVX_TO_RGBX_FUNC(yuvx, YUVX, bgr555le, BGR555LE, accurate_rnd); \
192 !(
c->opts.src_h & 1) && !(
c->opts.src_w & 15) && !accurate_rnd)
207 (
c->opts.src_h & 1) || (
c->opts.src_w & 15) ||
212 switch (
c->opts.dst_format) {
226 switch (
c->opts.dst_format) {
227 #if CONFIG_SWSCALE_ALPHA
243 switch (
c->opts.dst_format) {