26 #if HAVE_AS_DN_DIRECTIVE
29 int y_stride,
int c_stride,
int src_stride,
34 int y_stride,
int c_stride,
int src_stride,
38 int srcStride[],
int srcSliceY,
int srcSliceH,
39 uint8_t *dst[],
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],
44 context->
srcW, srcSliceH,
45 dstStride[0], dstStride[1], srcStride[0],
51 static int rgbx_to_nv12_neon_16_wrapper(
SwsContext *context,
const uint8_t *src[],
52 int srcStride[],
int srcSliceY,
int srcSliceH,
53 uint8_t *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],
58 context->
srcW, srcSliceH,
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(SwsContext *c, const uint8_t *src[], \
82 int srcStride[], int srcSliceY, int srcSliceH, \
83 uint8_t *dst[], int dstStride[]) { \
84 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
86 ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
87 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
88 src[0], srcStride[0], \
89 src[1], srcStride[1], \
90 src[2], srcStride[2], \
92 c->yuv2rgb_y_offset >> 6, \
93 c->yuv2rgb_y_coeff); \
98 #define DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuvx) \
99 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, argb) \
100 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, rgba) \
101 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, abgr) \
102 DECLARE_FF_YUVX_TO_RGBX_FUNCS(yuvx, bgra) \
107 #define DECLARE_FF_NVX_TO_RGBX_FUNCS(ifmt, ofmt) \
108 int ff_##ifmt##_to_##ofmt##_neon(int w, int h, \
109 uint8_t *dst, int linesize, \
110 const uint8_t *srcY, int linesizeY, \
111 const uint8_t *srcC, int linesizeC, \
112 const int16_t *table, \
116 static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[], \
117 int srcStride[], int srcSliceY, int srcSliceH, \
118 uint8_t *dst[], int dstStride[]) { \
119 const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
121 ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
122 dst[0] + srcSliceY * dstStride[0], dstStride[0], \
123 src[0], srcStride[0], src[1], srcStride[1], \
125 c->yuv2rgb_y_offset >> 6, \
126 c->yuv2rgb_y_coeff); \
131 #define DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nvx) \
132 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, argb) \
133 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, rgba) \
134 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, abgr) \
135 DECLARE_FF_NVX_TO_RGBX_FUNCS(nvx, bgra) \
144 #define SET_FF_NVX_TO_RGBX_FUNC(ifmt, IFMT, ofmt, OFMT, accurate_rnd) do { \
145 if (c->srcFormat == AV_PIX_FMT_##IFMT \
146 && c->dstFormat == AV_PIX_FMT_##OFMT \
149 && !accurate_rnd) { \
150 c->swscale = ifmt##_to_##ofmt##_neon_wrapper; \
154 #define SET_FF_NVX_TO_ALL_RGBX_FUNC(nvx, NVX, accurate_rnd) do { \
155 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, argb, ARGB, accurate_rnd); \
156 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, rgba, RGBA, accurate_rnd); \
157 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, abgr, ABGR, accurate_rnd); \
158 SET_FF_NVX_TO_RGBX_FUNC(nvx, NVX, bgra, BGRA, accurate_rnd); \
165 && (c->
srcW >= 16)) {
166 c->
swscale = accurate_rnd ? rgbx_to_nv12_neon_32_wrapper
167 : rgbx_to_nv12_neon_16_wrapper;
static atomic_int cpu_flags
#define SET_FF_NVX_TO_ALL_RGBX_FUNC(nvx, NVX, accurate_rnd)
enum AVPixelFormat dstFormat
Destination pixel format.
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nvx)
static void get_unscaled_swscale_neon(SwsContext *c)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
void ff_get_unscaled_swscale_arm(SwsContext *c)
enum AVPixelFormat srcFormat
Source pixel format.
SwsFunc swscale
Note that src, dst, srcStride, dstStride will be copied in the sws_scale() wrapper so they can be fre...
int32_t input_rgb2yuv_table[16+40 *4]
int srcW
Width of source luma/alpha planes.
int flags
Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc...
#define DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuvx)