26 #if HAVE_AS_DN_DIRECTIVE
27 extern void rgbx_to_nv12_neon_32(
const uint8_t *
src, uint8_t *y, uint8_t *
chroma,
29 int y_stride,
int c_stride,
int src_stride,
32 extern void rgbx_to_nv12_neon_16(
const uint8_t *
src, uint8_t *y, uint8_t *
chroma,
34 int y_stride,
int c_stride,
int src_stride,
38 const int srcStride[],
int srcSliceY,
int srcSliceH,
39 uint8_t *
const dst[],
const int dstStride[]) {
41 rgbx_to_nv12_neon_32(
src[0] + srcSliceY * srcStride[0],
42 dst[0] + srcSliceY * dstStride[0],
43 dst[1] + (srcSliceY / 2) * dstStride[1],
45 dstStride[0], dstStride[1], srcStride[0],
52 const int srcStride[],
int srcSliceY,
int srcSliceH,
53 uint8_t *
const dst[],
int dstStride[]) {
55 rgbx_to_nv12_neon_16(
src[0] + srcSliceY * srcStride[0],
56 dst[0] + srcSliceY * dstStride[0],
57 dst[1] + (srcSliceY / 2) * dstStride[1],
59 dstStride[0], dstStride[1], srcStride[0],
65 #define YUV_TO_RGB_TABLE \
66 c->yuv2rgb_v2r_coeff, \
67 c->yuv2rgb_u2g_coeff, \
68 c->yuv2rgb_v2g_coeff, \
69 c->yuv2rgb_u2b_coeff, \
71 #define DECLARE_FF_YUVX_TO_RGBX_FUNCS(ifmt, ofmt) \
72 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
73 uint8_t *dst, int linesize, \
74 const uint8_t *srcY, int linesizeY, \
75 const uint8_t *srcU, int linesizeU, \
76 const uint8_t *srcV, int linesizeV, \
77 const int16_t *table, \
81 static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const src[], \
82 const int srcStride[], int srcSliceY, \
83 int srcSliceH, uint8_t *const dst[], \
84 const int dstStride[]) { \
85 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
87 ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
88 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
89 src[0], srcStride[0], \
90 src[1], srcStride[1], \
91 src[2], srcStride[2], \
93 c->yuv2rgb_y_offset >> 6, \
94 c->yuv2rgb_y_coeff); \
99 #define DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuvx) \
100 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, argb) \
101 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, rgba) \
102 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, abgr) \
103 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, bgra) \
108 #define DECLARE_FF_NVX_TO_RGBX_FUNCS(ifmt, ofmt) \
109 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
110 uint8_t *dst, int linesize, \
111 const uint8_t *srcY, int linesizeY, \
112 const uint8_t *srcC, int linesizeC, \
113 const int16_t *table, \
117 static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const src[], \
118 const int srcStride[], int srcSliceY, \
119 int srcSliceH, uint8_t *const dst[], \
120 const int dstStride[]) { \
121 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
123 ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
124 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
125 src[0], srcStride[0], src[1], srcStride[1], \
127 c->yuv2rgb_y_offset >> 6, \
128 c->yuv2rgb_y_coeff); \
133 #define DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nvx) \
134 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, argb) \
135 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, rgba) \
136 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, abgr) \
137 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, bgra) \
146 #define SET_FF_NVX_TO_RGBX_FUNC(ifmt, IFMT, ofmt, OFMT, accurate_rnd) do { \
147 if (c->srcFormat == AV_PIX_FMT_##IFMT \
148 && c->dstFormat == AV_PIX_FMT_##OFMT \
151 && !accurate_rnd) { \
152 c->convert_unscaled = ifmt##_to_##ofmt##_neon_wrapper; \
156 #define SET_FF_NVX_TO_ALL_RGBX_FUNC(nvx, NVX, accurate_rnd) do { \
157 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, argb, ARGB, accurate_rnd); \
158 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, rgba, RGBA, accurate_rnd); \
159 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, abgr, ABGR, accurate_rnd); \
160 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, bgra, BGRA, accurate_rnd); \
167 && (
c->srcW >= 16)) {
168 c->convert_unscaled = accurate_rnd ? rgbx_to_nv12_neon_32_wrapper
169 : rgbx_to_nv12_neon_16_wrapper;