Go to the documentation of this file.
43 #define YUV2RGB_LOOP(depth) \
44 h_size = (c->opts.dst_w + 7) & ~7; \
45 if (h_size * depth > FFABS(dstStride[0])) \
48 vshift = c->opts.src_format != AV_PIX_FMT_YUV422P; \
50 for (y = 0; y < srcSliceH; y++) { \
51 uint8_t *image = dst[0] + (y + srcSliceY) * dstStride[0]; \
52 const uint8_t *py = src[0] + y * srcStride[0]; \
53 const uint8_t *pu = src[1] + (y >> vshift) * srcStride[1]; \
54 const uint8_t *pv = src[2] + (y >> vshift) * srcStride[2]; \
55 x86_reg index = -h_size / 2; \
57 extern void ff_yuv_420_rgb24_ssse3(
x86_reg index, uint8_t *image,
const uint8_t *pu_index,
58 const uint8_t *pv_index,
const uint64_t *pointer_c_dither,
59 const uint8_t *py_2index);
60 extern void ff_yuv_420_bgr24_ssse3(
x86_reg index, uint8_t *image,
const uint8_t *pu_index,
61 const uint8_t *pv_index,
const uint64_t *pointer_c_dither,
62 const uint8_t *py_2index);
64 extern void ff_yuv_420_rgb15_ssse3(
x86_reg index, uint8_t *image,
const uint8_t *pu_index,
65 const uint8_t *pv_index,
const uint64_t *pointer_c_dither,
66 const uint8_t *py_2index);
67 extern void ff_yuv_420_rgb16_ssse3(
x86_reg index, uint8_t *image,
const uint8_t *pu_index,
68 const uint8_t *pv_index,
const uint64_t *pointer_c_dither,
69 const uint8_t *py_2index);
70 extern void ff_yuv_420_rgb32_ssse3(
x86_reg index, uint8_t *image,
const uint8_t *pu_index,
71 const uint8_t *pv_index,
const uint64_t *pointer_c_dither,
72 const uint8_t *py_2index);
73 extern void ff_yuv_420_bgr32_ssse3(
x86_reg index, uint8_t *image,
const uint8_t *pu_index,
74 const uint8_t *pv_index,
const uint64_t *pointer_c_dither,
75 const uint8_t *py_2index);
76 extern void ff_yuva_420_rgb32_ssse3(
x86_reg index, uint8_t *image,
const uint8_t *pu_index,
77 const uint8_t *pv_index,
const uint64_t *pointer_c_dither,
78 const uint8_t *py_2index,
const uint8_t *pa_2index);
79 extern void ff_yuva_420_bgr32_ssse3(
x86_reg index, uint8_t *image,
const uint8_t *pu_index,
80 const uint8_t *pv_index,
const uint64_t *pointer_c_dither,
81 const uint8_t *py_2index,
const uint8_t *pa_2index);
83 extern void ff_yuv_420_gbrp24_ssse3(
x86_reg index, uint8_t *image, uint8_t *dst_b, uint8_t *dst_r,
84 const uint8_t *pu_index,
const uint8_t *pv_index,
85 const uint64_t *pointer_c_dither,
86 const uint8_t *py_2index);
89 static inline int yuv420_rgb15_ssse3(
SwsInternal *
c,
const uint8_t *
const src[],
90 const int srcStride[],
91 int srcSliceY,
int srcSliceH,
92 uint8_t *
const dst[],
const int dstStride[])
107 static inline
int yuv420_rgb16_ssse3(
SwsInternal *
c, const uint8_t *const
src[],
108 const
int srcStride[],
109 int srcSliceY,
int srcSliceH,
110 uint8_t *const
dst[], const
int dstStride[])
125 static inline
int yuv420_rgb32_ssse3(
SwsInternal *
c, const uint8_t *const
src[],
126 const
int srcStride[],
127 int srcSliceY,
int srcSliceH,
128 uint8_t *const
dst[], const
int dstStride[])
139 static inline
int yuv420_bgr32_ssse3(
SwsInternal *
c, const uint8_t *const
src[],
140 const
int srcStride[],
141 int srcSliceY,
int srcSliceH,
142 uint8_t *const
dst[], const
int dstStride[])
153 static inline
int yuva420_rgb32_ssse3(
SwsInternal *
c, const uint8_t *const
src[],
154 const
int srcStride[],
155 int srcSliceY,
int srcSliceH,
156 uint8_t *const
dst[], const
int dstStride[])
161 const uint8_t *pa =
src[3] + y * srcStride[3];
167 static inline
int yuva420_bgr32_ssse3(
SwsInternal *
c, const uint8_t *const
src[],
168 const
int srcStride[],
169 int srcSliceY,
int srcSliceH,
170 uint8_t *const
dst[], const
int dstStride[])
176 const uint8_t *pa =
src[3] + y * srcStride[3];
182 static inline
int yuv420_rgb24_ssse3(
SwsInternal *
c, const uint8_t *const
src[],
183 const
int srcStride[],
184 int srcSliceY,
int srcSliceH,
185 uint8_t *const
dst[], const
int dstStride[])
196 static inline
int yuv420_bgr24_ssse3(
SwsInternal *
c, const uint8_t *const
src[],
197 const
int srcStride[],
198 int srcSliceY,
int srcSliceH,
199 uint8_t *const
dst[], const
int dstStride[])
211 static inline int yuv420_gbrp_ssse3(
SwsInternal *
c,
const uint8_t *
const src[],
212 const int srcStride[],
213 int srcSliceY,
int srcSliceH,
214 uint8_t *
const dst[],
const int dstStride[])
218 h_size = (
c->opts.dst_w + 7) & ~7;
219 if (h_size * 3 >
FFABS(dstStride[0]))
224 for (y = 0; y < srcSliceH; y++) {
225 uint8_t *dst_g =
dst[0] + (y + srcSliceY) * dstStride[0];
226 uint8_t *dst_b =
dst[1] + (y + srcSliceY) * dstStride[1];
227 uint8_t *dst_r =
dst[2] + (y + srcSliceY) * dstStride[2];
228 const uint8_t *py =
src[0] + y * srcStride[0];
229 const uint8_t *pu =
src[1] + (y >>
vshift) * srcStride[1];
230 const uint8_t *pv =
src[2] + (y >>
vshift) * srcStride[2];
233 ff_yuv_420_gbrp24_ssse3(
index, dst_g, dst_b, dst_r, pu -
index, pv -
index, &(
c->redDither), py - 2 *
index);
247 switch (
c->opts.dst_format) {
250 #if CONFIG_SWSCALE_ALPHA
251 return yuva420_rgb32_ssse3;
255 return yuv420_rgb32_ssse3;
258 #if CONFIG_SWSCALE_ALPHA
259 return yuva420_bgr32_ssse3;
263 return yuv420_bgr32_ssse3;
265 return yuv420_rgb24_ssse3;
267 return yuv420_bgr24_ssse3;
269 return yuv420_rgb16_ssse3;
271 return yuv420_rgb15_ssse3;
274 return yuv420_gbrp_ssse3;
av_cold SwsFunc ff_yuv2rgb_init_x86(SwsInternal *c)
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
static atomic_int cpu_flags
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return
const uint64_t ff_dither4[2]
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
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
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define AV_PIX_FMT_RGB555
#define AV_PIX_FMT_RGB565
static int vshift(enum AVPixelFormat fmt, int plane)
const uint64_t ff_dither8[2]
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int(* SwsFunc)(SwsInternal *c, const uint8_t *const src[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[])
#define EXTERNAL_SSSE3(flags)