Go to the documentation of this file.
61 void (*
yv12toyuy2)(
const uint8_t *ysrc,
const uint8_t *usrc,
62 const uint8_t *vsrc, uint8_t *dst,
64 int lumStride,
int chromStride,
int dstStride);
65 void (*
yv12touyvy)(
const uint8_t *ysrc,
const uint8_t *usrc,
66 const uint8_t *vsrc, uint8_t *dst,
68 int lumStride,
int chromStride,
int dstStride);
70 const uint8_t *vsrc, uint8_t *dst,
72 int lumStride,
int chromStride,
int dstStride);
74 const uint8_t *vsrc, uint8_t *dst,
76 int lumStride,
int chromStride,
int dstStride);
78 uint8_t *udst, uint8_t *vdst,
80 int lumStride,
int chromStride,
int srcStride);
82 uint8_t *udst, uint8_t *vdst,
84 int lumStride,
int chromStride,
int srcStride,
87 int srcStride,
int dstStride);
90 int src2Stride,
int dstStride);
93 int dst1Stride,
int dst2Stride);
95 uint8_t *dst1, uint8_t *dst2,
97 int srcStride1,
int srcStride2,
98 int dstStride1,
int dstStride2);
100 const uint8_t *src3, uint8_t *dst,
102 int srcStride1,
int srcStride2,
103 int srcStride3,
int dstStride);
106 int lumStride,
int chromStride,
int srcStride);
109 int lumStride,
int chromStride,
int srcStride);
112 int lumStride,
int chromStride,
int srcStride);
115 int lumStride,
int chromStride,
int srcStride);
117 #define BY ((int)( 0.098 * (1 << RGB2YUV_SHIFT) + 0.5))
118 #define BV ((int)(-0.071 * (1 << RGB2YUV_SHIFT) + 0.5))
119 #define BU ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
120 #define GY ((int)( 0.504 * (1 << RGB2YUV_SHIFT) + 0.5))
121 #define GV ((int)(-0.368 * (1 << RGB2YUV_SHIFT) + 0.5))
122 #define GU ((int)(-0.291 * (1 << RGB2YUV_SHIFT) + 0.5))
123 #define RY ((int)( 0.257 * (1 << RGB2YUV_SHIFT) + 0.5))
124 #define RV ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
125 #define RU ((int)(-0.148 * (1 << RGB2YUV_SHIFT) + 0.5))
146 #elif ARCH_LOONGARCH64
153 int i, num_pixels = src_size >> 2;
155 for (
i = 0;
i < num_pixels;
i++) {
158 dst[3 *
i + 0] =
src[4 *
i + 1];
159 dst[3 *
i + 1] =
src[4 *
i + 2];
160 dst[3 *
i + 2] =
src[4 *
i + 3];
162 dst[3 *
i + 0] =
src[4 *
i + 2];
163 dst[3 *
i + 1] =
src[4 *
i + 1];
164 dst[3 *
i + 2] =
src[4 *
i + 0];
173 for (
i = 0; 3 *
i < src_size;
i++) {
176 dst[4 *
i + 0] = 255;
177 dst[4 *
i + 1] =
src[3 *
i + 0];
178 dst[4 *
i + 2] =
src[3 *
i + 1];
179 dst[4 *
i + 3] =
src[3 *
i + 2];
181 dst[4 *
i + 0] =
src[3 *
i + 2];
182 dst[4 *
i + 1] =
src[3 *
i + 1];
183 dst[4 *
i + 2] =
src[3 *
i + 0];
184 dst[4 *
i + 3] = 255;
192 const uint16_t *
s = (
const uint16_t *)
src;
193 const uint16_t *end =
s + src_size / 2;
196 register uint16_t bgr = *
s++;
199 *
d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
200 *
d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
201 *
d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
203 *
d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
204 *
d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
205 *
d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
214 uint16_t *
d = (uint16_t *)dst;
215 const uint16_t *
s = (
const uint16_t *)
src;
216 const uint16_t *end =
s + src_size / 2;
223 r = (
r << 3) | ((
r & 0x800) >> 1);
224 g = (
g << 2) | ((
g & 0x080) >> 2);
225 b = (
b << 1) | (
b >> 3);
233 const uint16_t *
s = (
const uint16_t *)
src;
234 const uint16_t *end =
s + src_size / 2;
237 register uint16_t bgr = *
s++;
238 *
d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
239 *
d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
240 *
d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
246 int i, num_pixels = src_size >> 1;
248 for (
i = 0;
i < num_pixels;
i++) {
249 unsigned rgb = ((
const uint16_t *)
src)[
i];
250 ((uint16_t *)dst)[
i] = (
rgb >> 11) | (
rgb & 0x7E0) | (
rgb << 11);
256 int i, num_pixels = src_size >> 1;
258 for (
i = 0;
i < num_pixels;
i++) {
259 unsigned rgb = ((
const uint16_t *)
src)[
i];
260 ((uint16_t *)dst)[
i] = (
rgb >> 11) | ((
rgb & 0x7C0) >> 1) | ((
rgb & 0x1F) << 10);
267 const uint16_t *
s = (
const uint16_t *)
src;
268 const uint16_t *end =
s + src_size / 2;
271 register uint16_t bgr = *
s++;
274 *
d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
275 *
d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
276 *
d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
278 *
d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
279 *
d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
280 *
d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
289 const uint16_t *
s = (
const uint16_t *)
src;
290 const uint16_t *end =
s + src_size / 2;
293 register uint16_t bgr = *
s++;
294 *
d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
295 *
d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
296 *
d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
302 int i, num_pixels = src_size >> 1;
304 for (
i = 0;
i < num_pixels;
i++) {
305 unsigned rgb = ((
const uint16_t *)
src)[
i];
306 ((uint16_t *)dst)[
i] = ((
rgb & 0x7C00) >> 10) | ((
rgb & 0x3E0) << 1) | (
rgb << 11);
312 int i, num_pixels = src_size >> 1;
314 for (
i = 0;
i < num_pixels;
i++) {
315 unsigned rgb = ((
const uint16_t *)
src)[
i];
316 unsigned br =
rgb & 0x7C1F;
317 ((uint16_t *)dst)[
i] = (br >> 10) | (
rgb & 0x3E0) | (br << 10);
323 uint16_t *
d = (uint16_t *)dst;
324 const uint16_t *
s = (
const uint16_t *)
src;
325 int i, num_pixels = src_size >> 1;
327 for (
i = 0;
i < num_pixels;
i++) {
333 #define DEFINE_RGB48TOBGR48(need_bswap, swap) \
334 void rgb48tobgr48_ ## need_bswap(const uint8_t *src, \
335 uint8_t *dst, int src_size) \
337 uint16_t *d = (uint16_t *)dst; \
338 const uint16_t *s = (const uint16_t *)src; \
339 int i, num_pixels = src_size >> 1; \
341 for (i = 0; i < num_pixels; i += 3) { \
342 d[i ] = swap ? av_bswap16(s[i + 2]) : s[i + 2]; \
343 d[i + 1] = swap ? av_bswap16(s[i + 1]) : s[i + 1]; \
344 d[i + 2] = swap ? av_bswap16(s[i ]) : s[i ]; \
351 #define DEFINE_RGB64TOBGR48(need_bswap, swap) \
352 void rgb64tobgr48_ ## need_bswap(const uint8_t *src, \
353 uint8_t *dst, int src_size) \
355 uint16_t *d = (uint16_t *)dst; \
356 const uint16_t *s = (const uint16_t *)src; \
357 int i, num_pixels = src_size >> 3; \
359 for (i = 0; i < num_pixels; i++) { \
360 d[3 * i ] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
361 d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
362 d[3 * i + 2] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
369 #define DEFINE_RGB64TO48(need_bswap, swap) \
370 void rgb64to48_ ## need_bswap(const uint8_t *src, \
371 uint8_t *dst, int src_size) \
373 uint16_t *d = (uint16_t *)dst; \
374 const uint16_t *s = (const uint16_t *)src; \
375 int i, num_pixels = src_size >> 3; \
377 for (i = 0; i < num_pixels; i++) { \
378 d[3 * i ] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
379 d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
380 d[3 * i + 2] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
387 #define DEFINE_RGB48TOBGR64(need_bswap, swap) \
388 void rgb48tobgr64_ ## need_bswap(const uint8_t *src, \
389 uint8_t *dst, int src_size) \
391 uint16_t *d = (uint16_t *)dst; \
392 const uint16_t *s = (const uint16_t *)src; \
393 int i, num_pixels = src_size / 6; \
395 for (i = 0; i < num_pixels; i++) { \
396 d[4 * i ] = swap ? av_bswap16(s[3 * i + 2]) : s[3 * i + 2]; \
397 d[4 * i + 1] = swap ? av_bswap16(s[3 * i + 1]) : s[3 * i + 1]; \
398 d[4 * i + 2] = swap ? av_bswap16(s[3 * i ]) : s[3 * i ]; \
399 d[4 * i + 3] = 0xFFFF; \
406 #define DEFINE_RGB48TO64(need_bswap, swap) \
407 void rgb48to64_ ## need_bswap(const uint8_t *src, \
408 uint8_t *dst, int src_size) \
410 uint16_t *d = (uint16_t *)dst; \
411 const uint16_t *s = (const uint16_t *)src; \
412 int i, num_pixels = src_size / 6; \
414 for (i = 0; i < num_pixels; i++) { \
415 d[4 * i ] = swap ? av_bswap16(s[3 * i ]) : s[3 * i ]; \
416 d[4 * i + 1] = swap ? av_bswap16(s[3 * i + 1]) : s[3 * i + 1]; \
417 d[4 * i + 2] = swap ? av_bswap16(s[3 * i + 2]) : s[3 * i + 2]; \
418 d[4 * i + 3] = 0xFFFF; \
void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
void(* shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size)
void(* yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
Height should be a multiple of 2 and width should be a multiple of 16.
void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size)
void(* yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride)
Height should be a multiple of 2 and width should be a multiple of 16.
void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
void(* shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size)
static const char rgb2yuv[]
void(* rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
void(* yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
void(* rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size)
#define DEFINE_RGB48TOBGR48(need_bswap, swap)
void(* yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
Height should be a multiple of 2 and width should be a multiple of 16.
void(* rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
void(* ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride, int32_t *rgb2yuv)
Height should be a multiple of 2 and width should be a multiple of 2.
#define DEFINE_RGB64TOBGR48(need_bswap, swap)
void(* rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
void(* shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
void(* yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
Width should be a multiple of 16.
void(* shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size)
void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size)
void(* interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, int width, int height, int src1Stride, int src2Stride, int dstStride)
av_cold void rgb2rgb_init_aarch64(void)
void(* yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, uint8_t *dst, int width, int height, int srcStride1, int srcStride2, int srcStride3, int dstStride)
void(* rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size)
av_cold void ff_sws_rgb2rgb_init(void)
void(* yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size)
#define DEFINE_RGB48TOBGR64(need_bswap, swap)
av_cold void rgb2rgb_init_x86(void)
void(* shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size)
void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size)
void(* uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
#define i(width, name, range_min, range_max)
void(* rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size)
av_cold void rgb2rgb_init_riscv(void)
void(* deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, int width, int height, int srcStride, int dst1Stride, int dst2Stride)
static av_cold void rgb2rgb_init_c(void)
void(* uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
void(* rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size)
#define DEFINE_RGB48TO64(need_bswap, swap)
void(* yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
Width should be a multiple of 16.
void(* vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst1, uint8_t *dst2, int width, int height, int srcStride1, int srcStride2, int dstStride1, int dstStride2)
void(* rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
#define DEFINE_RGB64TO48(need_bswap, swap)
void(* planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, int srcStride, int dstStride)
static const SheerTable rgb[2]
av_cold void rgb2rgb_init_loongarch(void)
void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size)