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 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); \
56 #define DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuvx) \
57 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, argb) \
58 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, rgba) \
59 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, abgr) \
60 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, bgra) \
65 #define DECLARE_FF_NVX_TO_RGBX_FUNCS(ifmt, ofmt) \
66 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
67 uint8_t *dst, int linesize, \
68 const uint8_t *srcY, int linesizeY, \
69 const uint8_t *srcC, int linesizeC, \
70 const int16_t *table, \
74 static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[], \
75 int srcStride[], int srcSliceY, int srcSliceH, \
76 uint8_t *dst[], int dstStride[]) { \
77 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
79 ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
80 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
81 src[0], srcStride[0], src[1], srcStride[1], \
83 c->yuv2rgb_y_offset >> 6, \
84 c->yuv2rgb_y_coeff); \
89 #define DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nvx) \
90 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, argb) \
91 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, rgba) \
92 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, abgr) \
93 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, bgra) \
102 #define SET_FF_NVX_TO_RGBX_FUNC(ifmt, IFMT, ofmt, OFMT, accurate_rnd) do { \
103 if (c->srcFormat == AV_PIX_FMT_##IFMT \
104 && c->dstFormat == AV_PIX_FMT_##OFMT \
108 c->swscale = ifmt##_to_##ofmt##_neon_wrapper; \
111 #define SET_FF_NVX_TO_ALL_RGBX_FUNC(nvx, NVX, accurate_rnd) do { \
112 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, argb, ARGB, accurate_rnd); \
113 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, rgba, RGBA, accurate_rnd); \
114 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, abgr, ABGR, accurate_rnd); \
115 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, bgra, BGRA, accurate_rnd); \