33#define input_pixel(pos) (is_be ? AV_RB16(pos) : AV_RL16(pos))
40#define IS_BE(ENDIAN_IDENTIFIER) IS_BE_ ## ENDIAN_IDENTIFIER
42#define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? b_r : r_b)
43#define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? r_b : b_r)
62 const uint16_t *
src1,
const uint16_t *
src2,
81 const uint16_t *
src1,
const uint16_t *
src2,
98#define RGB64FUNCS_EXT(pattern, BE_LE, origin, is_be) \
99static void pattern ## 64 ## BE_LE ## ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, const uint8_t *unused1,\
100 int width, uint32_t *rgb2yuv, void *opq) \
102 const uint16_t *src = (const uint16_t *) _src; \
103 uint16_t *dst = (uint16_t *) _dst; \
104 rgb64ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \
107static void pattern ## 64 ## BE_LE ## ToUV_c(uint8_t *_dstU, uint8_t *_dstV, \
108 const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \
109 int width, uint32_t *rgb2yuv, void *opq) \
111 const uint16_t *src1 = (const uint16_t *) _src1, \
112 *src2 = (const uint16_t *) _src2; \
113 uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \
114 rgb64ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
117static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, \
118 const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \
119 int width, uint32_t *rgb2yuv, void *opq) \
121 const uint16_t *src1 = (const uint16_t *) _src1, \
122 *src2 = (const uint16_t *) _src2; \
123 uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \
124 rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
126#define RGB64FUNCS(pattern, endianness, base_fmt) \
127 RGB64FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness))
152 const uint16_t *
src1,
153 const uint16_t *
src2,
174 const uint16_t *
src1,
175 const uint16_t *
src2,
201#define RGB48FUNCS_EXT(pattern, BE_LE, origin, is_be) \
202static void pattern ## 48 ## BE_LE ## ToY_c(uint8_t *_dst, \
203 const uint8_t *_src, \
204 const uint8_t *unused0, const uint8_t *unused1,\
209 const uint16_t *src = (const uint16_t *)_src; \
210 uint16_t *dst = (uint16_t *)_dst; \
211 rgb48ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \
214static void pattern ## 48 ## BE_LE ## ToUV_c(uint8_t *_dstU, \
216 const uint8_t *unused0, \
217 const uint8_t *_src1, \
218 const uint8_t *_src2, \
223 const uint16_t *src1 = (const uint16_t *)_src1, \
224 *src2 = (const uint16_t *)_src2; \
225 uint16_t *dstU = (uint16_t *)_dstU, \
226 *dstV = (uint16_t *)_dstV; \
227 rgb48ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
230static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \
232 const uint8_t *unused0, \
233 const uint8_t *_src1, \
234 const uint8_t *_src2, \
239 const uint16_t *src1 = (const uint16_t *)_src1, \
240 *src2 = (const uint16_t *)_src2; \
241 uint16_t *dstU = (uint16_t *)_dstU, \
242 *dstV = (uint16_t *)_dstV; \
243 rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
245#define RGB48FUNCS(pattern, endianness, base_fmt) \
246 RGB48FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness))
253#define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \
254 origin == AV_PIX_FMT_BGRA || \
255 origin == AV_PIX_FMT_ARGB || \
256 origin == AV_PIX_FMT_ABGR) \
257 ? AV_RN32A(&src[(i) * 4]) \
258 : ((origin == AV_PIX_FMT_X2RGB10LE || \
259 origin == AV_PIX_FMT_X2BGR10LE) \
260 ? AV_RL32(&src[(i) * 4]) \
261 : (is_be ? AV_RB16(&src[(i) * 2]) \
262 : AV_RL16(&src[(i) * 2]))))
270 int maskr,
int maskg,
272 int gsh,
int bsh,
int S,
276 const unsigned rnd = (32<<((
S)-1)) + (1<<(
S-7));
281 int b = (px & maskb) >> shb;
282 int g = (px & maskg) >> shg;
283 int r = (px & maskr) >> shr;
285 dst[
i] = (ry *
r + gy *
g + by *
b +
rnd) >> ((
S)-6);
296 int maskr,
int maskg,
298 int gsh,
int bsh,
int S,
303 const unsigned rnd = (256u<<((
S)-1)) + (1<<(
S-7));
308 int b = (px & maskb) >> shb;
309 int g = (px & maskg) >> shg;
310 int r = (px & maskr) >> shr;
312 dstU[
i] = (ru *
r + gu *
g + bu *
b +
rnd) >> ((
S)-6);
313 dstV[
i] = (rv *
r + gv *
g + bv *
b +
rnd) >> ((
S)-6);
324 int maskr,
int maskg,
326 int gsh,
int bsh,
int S,
331 maskgx = ~(maskr | maskb);
332 const unsigned rnd = (256U<<(
S)) + (1<<(
S-6));
341 int b,
r,
g = (px0 & maskgx) + (px1 & maskgx);
342 int rb = px0 + px1 -
g;
344 b = (rb & maskb) >> shb;
350 g = (
g & maskg) >> shg;
352 r = (rb & maskr) >> shr;
354 dstU[
i] = (ru *
r + gu *
g + bu *
b + (unsigned)
rnd) >> ((
S)-6+1);
355 dstV[
i] = (rv *
r + gv *
g + bv *
b + (unsigned)
rnd) >> ((
S)-6+1);
361#define RGB16_32FUNCS_EXT(fmt, name, shr, shg, shb, shp, maskr, \
362 maskg, maskb, rsh, gsh, bsh, S, is_be) \
363static void name ## ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, \
364 int width, uint32_t *tab, void *opq) \
366 rgb16_32ToY_c_template((int16_t*)dst, src, width, fmt, shr, shg, shb, shp, \
367 maskr, maskg, maskb, rsh, gsh, bsh, S, tab, is_be); \
370static void name ## ToUV_c(uint8_t *dstU, uint8_t *dstV, \
371 const uint8_t *unused0, const uint8_t *src, const uint8_t *dummy, \
372 int width, uint32_t *tab, void *opq) \
374 rgb16_32ToUV_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
375 shr, shg, shb, shp, \
376 maskr, maskg, maskb, rsh, gsh, bsh, S, tab, is_be); \
379static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \
380 const uint8_t *unused0, const uint8_t *src, \
381 const uint8_t *dummy, \
382 int width, uint32_t *tab, void *opq) \
384 rgb16_32ToUV_half_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
385 shr, shg, shb, shp, \
386 maskr, maskg, maskb, \
387 rsh, gsh, bsh, S, tab, is_be); \
390#define RGB16_32FUNCS(base_fmt, endianness, name, shr, shg, shb, shp, maskr, \
391 maskg, maskb, rsh, gsh, bsh, S) \
392 RGB16_32FUNCS_EXT(base_fmt ## endianness, name, shr, shg, shb, shp, maskr, \
393 maskg, maskb, rsh, gsh, bsh, S, IS_BE(endianness))
395RGB16_32FUNCS(
AV_PIX_FMT_BGR32, , bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8,
RGB2YUV_SHIFT + 8)
396RGB16_32FUNCS(
AV_PIX_FMT_BGR32_1, , bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8,
RGB2YUV_SHIFT + 8)
397RGB16_32FUNCS(
AV_PIX_FMT_RGB32, , rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8,
RGB2YUV_SHIFT + 8)
398RGB16_32FUNCS(
AV_PIX_FMT_RGB32_1, , rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8,
RGB2YUV_SHIFT + 8)
399RGB16_32FUNCS(
AV_PIX_FMT_BGR565, LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0,
RGB2YUV_SHIFT + 8)
400RGB16_32FUNCS(
AV_PIX_FMT_BGR555, LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0,
RGB2YUV_SHIFT + 7)
401RGB16_32FUNCS(
AV_PIX_FMT_BGR444, LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0,
RGB2YUV_SHIFT + 4)
402RGB16_32FUNCS(
AV_PIX_FMT_RGB565, LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11,
RGB2YUV_SHIFT + 8)
403RGB16_32FUNCS(
AV_PIX_FMT_RGB555, LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10,
RGB2YUV_SHIFT + 7)
404RGB16_32FUNCS(
AV_PIX_FMT_RGB444, LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8,
RGB2YUV_SHIFT + 4)
405RGB16_32FUNCS(
AV_PIX_FMT_BGR565, BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0,
RGB2YUV_SHIFT + 8)
406RGB16_32FUNCS(
AV_PIX_FMT_BGR555, BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0,
RGB2YUV_SHIFT + 7)
407RGB16_32FUNCS(
AV_PIX_FMT_BGR444, BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0,
RGB2YUV_SHIFT + 4)
408RGB16_32FUNCS(
AV_PIX_FMT_RGB565, BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11,
RGB2YUV_SHIFT + 8)
409RGB16_32FUNCS(
AV_PIX_FMT_RGB555, BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10,
RGB2YUV_SHIFT + 7)
410RGB16_32FUNCS(
AV_PIX_FMT_RGB444, BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8,
RGB2YUV_SHIFT + 4)
411RGB16_32FUNCS(
AV_PIX_FMT_X2RGB10, LE, rgb30le, 16, 6, 0, 0, 0x3FF00000, 0xFFC00, 0x3FF, 0, 0, 4,
RGB2YUV_SHIFT + 6)
412RGB16_32FUNCS(
AV_PIX_FMT_X2BGR10, LE, bgr30le, 0, 6, 16, 0, 0x3FF, 0xFFC00, 0x3FF00000, 4, 0, 0,
RGB2YUV_SHIFT + 6)
415 const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc,
418 uint16_t *dstU = (uint16_t *)_dstU;
419 uint16_t *dstV = (uint16_t *)_dstV;
425 unsigned int g = gsrc[2*
i] + gsrc[2*
i+1];
426 unsigned int b = bsrc[2*
i] + bsrc[2*
i+1];
427 unsigned int r = rsrc[2*
i] + rsrc[2*
i+1];
435 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
437 int16_t *
dst = (int16_t *)
_dst;
438 const uint16_t *
src = (
const uint16_t *)
_src;
445 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
447 int16_t *
dst = (int16_t *)
_dst;
448 const uint16_t *
src = (
const uint16_t *)
_src;
455 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
457 int16_t *
dst = (int16_t *)
_dst;
465 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
467 int16_t *
dst = (int16_t *)
_dst;
475 const uint8_t *unused2,
int width, uint32_t *pal,
void *opq)
477 int16_t *
dst = (int16_t *)
_dst;
482 dst[
i]= (pal[d] >> 24)<<6 | pal[d]>>26;
487 const uint8_t *unused2,
int width, uint32_t *pal,
void *opq)
489 int16_t *
dst = (int16_t *)
_dst;
494 dst[
i] = (pal[d] & 0xFF)<<6;
499 const uint8_t *unused0,
const uint8_t *
src1,
const uint8_t *
src2,
500 int width, uint32_t *pal,
void *opq)
502 uint16_t *dstU = (uint16_t *)_dstU;
503 int16_t *dstV = (int16_t *)_dstV;
507 int p = pal[
src1[
i]];
509 dstU[
i] = (uint8_t)(p>> 8)<<6;
510 dstV[
i] = (uint8_t)(p>>16)<<6;
515 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
517 int16_t *
dst = (int16_t *)
_dst;
522 for (j = 0; j < 8; j++)
523 dst[8*
i+j]= ((d>>(7-j))&1) * 16383;
527 for (j = 0; j < (
width&7); j++)
528 dst[8*
i+j]= ((d>>(7-j))&1) * 16383;
533 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
535 int16_t *
dst = (int16_t *)
_dst;
540 for (j = 0; j < 8; j++)
541 dst[8*
i+j]= ((d>>(7-j))&1) * 16383;
545 for (j = 0; j < (
width&7); j++)
546 dst[8*
i+j] = ((d>>(7-j))&1) * 16383;
550static void yuy2ToY_c(uint8_t *
dst,
const uint8_t *
src,
const uint8_t *unused1,
const uint8_t *unused2,
int width,
551 uint32_t *unused,
void *opq)
558static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src1,
559 const uint8_t *
src2,
int width, uint32_t *unused,
void *opq)
563 dstU[
i] =
src1[4 *
i + 1];
564 dstV[
i] =
src1[4 *
i + 3];
569static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src1,
570 const uint8_t *
src2,
int width, uint32_t *unused,
void *opq)
574 dstV[
i] =
src1[4 *
i + 1];
575 dstU[
i] =
src1[4 *
i + 3];
580#define y21xle_wrapper(bits, shift) \
581 static void y2 ## bits ## le_UV_c(uint8_t *dstU, uint8_t *dstV, \
582 const uint8_t *unused0, \
583 const uint8_t *src, \
584 const uint8_t *unused1, int width, \
585 uint32_t *unused2, void *opq) \
588 for (i = 0; i < width; i++) { \
589 AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 2) >> shift); \
590 AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> shift); \
594 static void y2 ## bits ## le_Y_c(uint8_t *dst, const uint8_t *src, \
595 const uint8_t *unused0, \
596 const uint8_t *unused1, int width, \
597 uint32_t *unused2, void *opq) \
600 for (i = 0; i < width; i++) \
601 AV_WN16(dst + i * 2, AV_RL16(src + i * 4) >> shift); \
608static
void bswap16Y_c(uint8_t *
_dst, const uint8_t *
_src, const uint8_t *unused1, const uint8_t *unused2,
int width,
609 uint32_t *unused,
void *opq)
612 const uint16_t *
src = (
const uint16_t *)
_src;
613 uint16_t *
dst = (uint16_t *)
_dst;
618static void bswap16UV_c(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *unused0,
const uint8_t *_src1,
619 const uint8_t *_src2,
int width, uint32_t *unused,
void *opq)
622 const uint16_t *
src1 = (
const uint16_t *)_src1,
623 *
src2 = (
const uint16_t *)_src2;
624 uint16_t *dstU = (uint16_t *)_dstU, *dstV = (uint16_t *)_dstV;
632 uint32_t *unused,
void *opq)
640 uint32_t *unused,
void *opq)
648 uint32_t *unused,
void *opq)
656 uint32_t *unused,
void *opq)
664 uint32_t *unused2,
void *opq)
672 uint32_t *unused2,
void *opq)
680 int u_offset,
int v_offset)
690 int u_offset,
int v_offset)
699#define ayuv64_UV_funcs(pixfmt, U, V) \
700static void read_ ## pixfmt ## le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, \
701 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
703 ayuv64le_UV_c(dstU, dstV, src, width, U, V); \
706static void read_ ## pixfmt ## be_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, \
707 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
709 ayuv64be_UV_c(dstU, dstV, src, width, U, V); \
715static
void read_ayuv64le_A_c(uint8_t *
dst, const uint8_t *
src, const uint8_t *unused0, const uint8_t *unused1,
int width,
716 uint32_t *unused2,
void *opq)
724 uint32_t *unused2,
void *opq)
731static void read_vuyx_UV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src,
732 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
736 dstU[
i] =
src[
i * 4 + 1];
737 dstV[
i] =
src[
i * 4];
742 uint32_t *unused2,
void *opq)
750 uint32_t *unused2,
void *opq)
757static void read_ayuv_UV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src,
758 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
762 dstU[
i] =
src[
i * 4 + 2];
763 dstV[
i] =
src[
i * 4 + 3];
768 uint32_t *unused2,
void *opq)
776 uint32_t *unused2,
void *opq)
783static void read_uyva_UV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src,
784 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
788 dstU[
i] =
src[
i * 4];
789 dstV[
i] =
src[
i * 4 + 2];
793static void vyuToY_c(uint8_t *
dst,
const uint8_t *
src,
const uint8_t *unused0,
const uint8_t *unused1,
int width,
794 uint32_t *unused2,
void *opq)
801static void vyuToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src,
802 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
806 dstU[
i] =
src[
i * 3 + 2];
807 dstV[
i] =
src[
i * 3];
812 uint32_t *unused2,
void *opq)
821 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
826 AV_WN16(dstU +
i * 2, (uv >> 2) & 0x3FFu);
827 AV_WN16(dstV +
i * 2, (uv >> 22) & 0x3FFu);
832 uint32_t *unused2,
void *opq)
841 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
851 uint32_t *unused2,
void *opq)
860 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
870 uint32_t *unused2,
void *opq)
879 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
890static void uyvyToY_c(uint8_t *
dst,
const uint8_t *
src,
const uint8_t *unused1,
const uint8_t *unused2,
int width,
891 uint32_t *unused,
void *opq)
898static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src1,
899 const uint8_t *
src2,
int width, uint32_t *unused,
void *opq)
903 dstU[
i] =
src1[4 *
i + 0];
904 dstV[
i] =
src1[4 *
i + 2];
909static void uyyvyyToY_c(uint8_t *
dst,
const uint8_t *
src,
const uint8_t *unused1,
const uint8_t *unused2,
910 int width, uint32_t *unused,
void *opq)
913 dst[
i] =
src[3 * (
i >> 1) + 1 + (
i & 1)];
916static void uyyvyyToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src1,
917 const uint8_t *
src2,
int width, uint32_t *unused,
void *opq)
920 dstU[
i] =
src1[6 *
i + 0];
921 dstV[
i] =
src1[6 *
i + 3];
931 dst1[
i] =
src[2 *
i + 0];
932 dst2[
i] =
src[2 *
i + 1];
937 const uint8_t *unused0,
const uint8_t *
src1,
const uint8_t *
src2,
938 int width, uint32_t *unused,
void *opq)
944 const uint8_t *unused0,
const uint8_t *
src1,
const uint8_t *
src2,
945 int width, uint32_t *unused,
void *opq)
950#define p01x_uv_wrapper(fmt, shift) \
951 static void fmt ## LEToUV ## _c(uint8_t *dstU, \
953 const uint8_t *unused0, \
954 const uint8_t *src1, \
955 const uint8_t *src2, int width, \
956 uint32_t *unused, void *opq) \
959 for (i = 0; i < width; i++) { \
960 AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0) >> shift); \
961 AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2) >> shift); \
965 static void fmt ## BEToUV ## _c(uint8_t *dstU, \
967 const uint8_t *unused0, \
968 const uint8_t *src1, \
969 const uint8_t *src2, int width, \
970 uint32_t *unused, void *opq) \
973 for (i = 0; i < width; i++) { \
974 AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0) >> shift); \
975 AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2) >> shift); \
979#define p01x_wrapper(fmt, shift) \
980 static void fmt ## LEToY ## _c(uint8_t *dst, \
981 const uint8_t *src, \
982 const uint8_t *unused1, \
983 const uint8_t *unused2, int width, \
984 uint32_t *unused, void *opq) \
987 for (i = 0; i < width; i++) { \
988 AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> shift); \
992 static void fmt ## BEToY ## _c(uint8_t *dst, \
993 const uint8_t *src, \
994 const uint8_t *unused1, \
995 const uint8_t *unused2, int width, \
996 uint32_t *unused, void *opq) \
999 for (i = 0; i < width; i++) { \
1000 AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> shift); \
1003 p01x_uv_wrapper(fmt, shift)
1010#define shf16_uv_wrapper(shift) \
1011 static void shf16_ ## shift ## LEToUV_c(uint8_t *dstU, \
1013 const uint8_t *unused0, \
1014 const uint8_t *src1, \
1015 const uint8_t *src2, int width, \
1016 uint32_t *unused, void *opq) \
1019 for (i = 0; i < width; i++) { \
1020 AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 2) >> (16 - shift)); \
1021 AV_WN16(dstV + i * 2, AV_RL16(src2 + i * 2) >> (16 - shift)); \
1025 static void shf16_ ## shift ## BEToUV_c(uint8_t *dstU, \
1027 const uint8_t *unused0, \
1028 const uint8_t *src1, \
1029 const uint8_t *src2, int width, \
1030 uint32_t *unused, void *opq) \
1033 for (i = 0; i < width; i++) { \
1034 AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 2) >> (16 - shift)); \
1035 AV_WN16(dstV + i * 2, AV_RB16(src2 + i * 2) >> (16 - shift)); \
1039#define shf16_wrapper(shift) \
1040 static void shf16_ ## shift ## LEToY_c(uint8_t *dst, \
1041 const uint8_t *src, \
1042 const uint8_t *unused1, \
1043 const uint8_t *unused2, int width, \
1044 uint32_t *unused, void *opq) \
1047 for (i = 0; i < width; i++) { \
1048 AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> (16 - shift)); \
1052 static void shf16_ ## shift ## BEToY_c(uint8_t *dst, \
1053 const uint8_t *src, \
1054 const uint8_t *unused1, \
1055 const uint8_t *unused2, int width, \
1056 uint32_t *unused, void *opq) \
1059 for (i = 0; i < width; i++) { \
1060 AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> (16 - shift)); \
1063 shf16_uv_wrapper(shift)
1068static
void bgr24ToY_c(uint8_t *
_dst, const uint8_t *
src, const uint8_t *unused1, const uint8_t *unused2,
1071 int16_t *
dst = (int16_t *)
_dst;
1075 int b =
src[
i * 3 + 0];
1076 int g =
src[
i * 3 + 1];
1077 int r =
src[
i * 3 + 2];
1083static void bgr24ToUV_c(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *unused0,
const uint8_t *
src1,
1086 int16_t *dstU = (int16_t *)_dstU;
1087 int16_t *dstV = (int16_t *)_dstV;
1105 int16_t *dstU = (int16_t *)_dstU;
1106 int16_t *dstV = (int16_t *)_dstV;
1124 int16_t *
dst = (int16_t *)
_dst;
1128 int r =
src[
i * 3 + 0];
1129 int g =
src[
i * 3 + 1];
1130 int b =
src[
i * 3 + 2];
1136static void rgb24ToUV_c(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *unused0,
const uint8_t *
src1,
1139 int16_t *dstU = (int16_t *)_dstU;
1140 int16_t *dstV = (int16_t *)_dstV;
1158 int16_t *dstU = (int16_t *)_dstU;
1159 int16_t *dstV = (int16_t *)_dstV;
1176 uint16_t *
dst = (uint16_t *)
_dst;
1190 uint16_t *
dst = (uint16_t *)
_dst;
1198 uint16_t *dstU = (uint16_t *)_dstU;
1199 uint16_t *dstV = (uint16_t *)_dstV;
1214 (is_be ? AV_RB16(src) : AV_RL16(src))
1216#define shifted_planar_rgb16_to_y(rdpx_shift) \
1217 static av_always_inline void planar_rgb16_s ## rdpx_shift ## _to_y(uint8_t *_dst, const uint8_t *_src[4], \
1218 int width, int bpc, int is_be, int32_t *rgb2yuv) \
1221 const uint16_t **src = (const uint16_t **)_src; \
1222 uint16_t *dst = (uint16_t *)_dst; \
1223 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX]; \
1224 int shift = bpc < 16 ? bpc : 14; \
1225 for (i = 0; i < width; i++) { \
1226 int g = rdpx(src[0] + i) >> (16 - rdpx_shift); \
1227 int b = rdpx(src[1] + i) >> (16 - rdpx_shift); \
1228 int r = rdpx(src[2] + i) >> (16 - rdpx_shift); \
1230 dst[i] = (int)((unsigned)ry*r + (unsigned)gy*g + (unsigned)by*b + (16 << (RGB2YUV_SHIFT + bpc - 8)) \
1231 + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14); \
1235#define shifted_planar_rgb16_to_a(rdpx_shift) \
1236 static av_always_inline void planar_rgb16_s ## rdpx_shift ## _to_a(uint8_t *_dst, const uint8_t *_src[4], \
1237 int width, int bpc, int is_be, int32_t *rgb2yuv) \
1240 const uint16_t **src = (const uint16_t **)_src; \
1241 uint16_t *dst = (uint16_t *)_dst; \
1242 int shift = (bpc < 16 ? bpc : 14) + 16 - rdpx_shift; \
1244 for (i = 0; i < width; i++) { \
1245 dst[i] = rdpx(src[3] + i) << (14 - shift); \
1249#define shifted_planar_rgb16_to_uv(rdpx_shift) \
1250 static av_always_inline void planar_rgb16_s ## rdpx_shift ## _to_uv(uint8_t *_dstU, uint8_t *_dstV, \
1251 const uint8_t *_src[4], int width, \
1252 int bpc, int is_be, int32_t *rgb2yuv) \
1255 const uint16_t **src = (const uint16_t **)_src; \
1256 uint16_t *dstU = (uint16_t *)_dstU; \
1257 uint16_t *dstV = (uint16_t *)_dstV; \
1258 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX]; \
1259 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX]; \
1260 int shift = bpc < 16 ? bpc : 14; \
1261 for (i = 0; i < width; i++) { \
1262 int g = rdpx(src[0] + i) >> (16 - rdpx_shift); \
1263 int b = rdpx(src[1] + i) >> (16 - rdpx_shift); \
1264 int r = rdpx(src[2] + i) >> (16 - rdpx_shift); \
1266 dstU[i] = (int)((unsigned)ru*r + (unsigned)gu*g + (unsigned)bu*b + (128 << (RGB2YUV_SHIFT + bpc - 8)) \
1267 + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14); \
1268 dstV[i] = (int)((unsigned)rv*r + (unsigned)gv*g + (unsigned)bv*b + (128 << (RGB2YUV_SHIFT + bpc - 8)) \
1269 + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14); \
1273#define shifted_planar_rgb16_to_y_uv(rdpx_shift) \
1274 shifted_planar_rgb16_to_y(rdpx_shift) \
1275 shifted_planar_rgb16_to_uv(rdpx_shift)
1277#define shifted_planar_rgb16(rdpx_shift) \
1278 shifted_planar_rgb16_to_y_uv(rdpx_shift) \
1279 shifted_planar_rgb16_to_a(rdpx_shift)
1287#define rdpx(src) (is_be ? av_int2float(AV_RB32(src)): av_int2float(AV_RL32(src)))
1292 const float **
src = (
const float **)
_src;
1293 uint16_t *
dst = (uint16_t *)
_dst;
1303 const float **
src = (
const float **)
_src;
1304 uint16_t *dstU = (uint16_t *)_dstU;
1305 uint16_t *dstV = (uint16_t *)_dstV;
1322 const float **
src = (
const float **)
_src;
1323 uint16_t *
dst = (uint16_t *)
_dst;
1337 const uint8_t *
_src,
const uint8_t *unused2,
1341 const float *
src = (
const float *)
_src;
1342 uint16_t *dstU = (uint16_t *)_dstU;
1343 uint16_t *dstV = (uint16_t *)_dstV;
1358 const uint8_t *
_src,
const uint8_t *unused2,
1361 const float *
src = (
const float *)
_src;
1362 uint16_t *dstU = (uint16_t *) _dstU;
1363 uint16_t *dstV = (uint16_t *) _dstV;
1381 const uint8_t *unused1,
const uint8_t *unused2,
1385 const float *
src = (
const float *)
_src;
1386 uint16_t *
dst = (uint16_t *)
_dst;
1400 const uint8_t *unused2,
int width,
int is_be, uint32_t *unused)
1403 const float *
src = (
const float *)
_src;
1404 uint16_t *
dst = (uint16_t *)
_dst;
1412 const uint8_t *unused2,
int width,
int is_be, uint32_t *unused)
1415 const float *
src = (
const float *)
_src;
1416 uint16_t *
dst = (uint16_t *)
_dst;
1423 const uint8_t *unused2,
int width,
int is_be, uint32_t *unused)
1426 const float *
src = (
const float *)
_src;
1427 uint16_t *
dst = (uint16_t *)
_dst;
1435#define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \
1436static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1437 int w, int32_t *rgb2yuv, void *opq) \
1439 planar_rgb16_s16_to_y(dst, src, w, nbits, endian, rgb2yuv); \
1441static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1442 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1445 planar_rgb16_s16_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \
1448#define rgb9plus_planar_transparency_funcs(nbits) \
1449static void planar_rgb##nbits##le_to_a(uint8_t *dst, const uint8_t *src[4], \
1450 int w, int32_t *rgb2yuv, \
1453 planar_rgb16_s16_to_a(dst, src, w, nbits, 0, rgb2yuv); \
1455static void planar_rgb##nbits##be_to_a(uint8_t *dst, const uint8_t *src[4], \
1456 int w, int32_t *rgb2yuv, \
1459 planar_rgb16_s16_to_a(dst, src, w, nbits, 1, rgb2yuv); \
1462#define rgb9plus_msb_planar_funcs_endian(nbits, endian_name, endian) \
1463static void msb_planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1464 int w, int32_t *rgb2yuv, void *opq) \
1466 planar_rgb16_s##nbits##_to_y(dst, src, w, nbits, endian, rgb2yuv); \
1468static void msb_planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1469 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1472 planar_rgb16_s##nbits##_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \
1475#define rgb9plus_planar_funcs(nbits) \
1476 rgb9plus_planar_funcs_endian(nbits, le, 0) \
1477 rgb9plus_planar_funcs_endian(nbits, be, 1)
1479#define rgb9plus_msb_planar_funcs(nbits) \
1480 rgb9plus_msb_planar_funcs_endian(nbits, le, 0) \
1481 rgb9plus_msb_planar_funcs_endian(nbits, be, 1)
1497#define rgbf32_funcs_endian(endian_name, endian) \
1498static void planar_rgbf32##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1499 int w, int32_t *rgb2yuv, void *opq) \
1501 planar_rgbf32_to_y(dst, src, w, endian, rgb2yuv); \
1503static void planar_rgbf32##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1504 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1507 planar_rgbf32_to_uv(dstU, dstV, src, w, endian, rgb2yuv); \
1509static void planar_rgbf32##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \
1510 int w, int32_t *rgb2yuv, void *opq) \
1512 planar_rgbf32_to_a(dst, src, w, endian, rgb2yuv); \
1514static void rgbf32##endian_name##_to_y_c(uint8_t *dst, const uint8_t *src, \
1515 const uint8_t *unused1, const uint8_t *unused2, \
1516 int w, uint32_t *rgb2yuv, void *opq) \
1518 rgbf32_to_y_c(dst, src, unused1, unused2, w, endian, rgb2yuv); \
1520static void rgbf32##endian_name##_to_uv_c(uint8_t *dstU, uint8_t *dstV, \
1521 const uint8_t *unused1, \
1522 const uint8_t *src, const uint8_t *unused2, \
1523 int w, uint32_t *rgb2yuv, \
1526 rgbf32_to_uv_c(dstU, dstV, unused1, src, unused2, w, endian, rgb2yuv); \
1528static void rgbf32##endian_name##_to_uv_half_c(uint8_t *dstU, uint8_t *dstV, \
1529 const uint8_t *unused1, \
1530 const uint8_t *src, const uint8_t *unused2, \
1531 int w, uint32_t *rgb2yuv, \
1534 rgbf32_to_uv_half_c(dstU, dstV, unused1, src, unused2, w, endian, rgb2yuv); \
1536static void grayf32##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \
1537 const uint8_t *unused1, const uint8_t *unused2, \
1538 int width, uint32_t *unused, void *opq) \
1540 grayf32ToY16_c(dst, src, unused1, unused2, width, endian, unused); \
1542static void read_yaf32##endian_name##_gray_c(uint8_t *dst, const uint8_t *src, \
1543 const uint8_t *unused1, const uint8_t *unused2, \
1544 int width, uint32_t *unused, void *opq) \
1546 read_yaf32_gray_c(dst, src, unused1, unused2, width, endian, unused); \
1548static void read_yaf32##endian_name##_alpha_c(uint8_t *dst, const uint8_t *src, \
1549 const uint8_t *unused1, const uint8_t *unused2, \
1550 int width, uint32_t *unused, void *opq) \
1552 read_yaf32_alpha_c(dst, src, unused1, unused2, width, endian, unused); \
1558#define rdpx(src) av_int2float(half2float(is_be ? AV_RB16(&src) : AV_RL16(&src), h2f_tbl))
1559#define rdpx2(src) av_int2float(half2float(is_be ? AV_RB16(src) : AV_RL16(src), h2f_tbl))
1614 uint16_t *
dst = (uint16_t *)
_dst;
1623 uint16_t *
dst = (uint16_t *)
_dst;
1742#define rgbaf16_funcs_endian(endian_name, endian) \
1743static void planar_rgbf16##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1744 int w, int32_t *rgb2yuv, void *opq) \
1746 planar_rgbf16_to_y(dst, src, w, endian, rgb2yuv, opq); \
1748static void planar_rgbf16##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1749 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1752 planar_rgbf16_to_uv(dstU, dstV, src, w, endian, rgb2yuv, opq); \
1754static void planar_rgbf16##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \
1755 int w, int32_t *rgb2yuv, void *opq) \
1757 planar_rgbf16_to_a(dst, src, w, endian, rgb2yuv, opq); \
1759static void grayf16##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \
1760 const uint8_t *unused1, const uint8_t *unused2, \
1761 int width, uint32_t *unused, void *opq) \
1763 grayf16ToY16_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1765static void read_yaf16##endian_name##_gray_c(uint8_t *dst, const uint8_t *src, \
1766 const uint8_t *unused1, const uint8_t *unused2, \
1767 int width, uint32_t *unused, void *opq) \
1769 read_yaf16_gray_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1771static void read_yaf16##endian_name##_alpha_c(uint8_t *dst, const uint8_t *src, \
1772 const uint8_t *unused1, const uint8_t *unused2, \
1773 int width, uint32_t *unused, void *opq) \
1775 read_yaf16_alpha_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1778static void rgbaf16##endian_name##ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1779 const uint8_t *src1, const uint8_t *src2, \
1780 int width, uint32_t *_rgb2yuv, void *opq) \
1782 const uint16_t *src = (const uint16_t*)src1; \
1783 uint16_t *dstU = (uint16_t*)_dstU; \
1784 uint16_t *dstV = (uint16_t*)_dstV; \
1785 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1786 av_assert1(src1==src2); \
1787 rgbaf16ToUV_half_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1789static void rgbaf16##endian_name##ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1790 const uint8_t *src1, const uint8_t *src2, \
1791 int width, uint32_t *_rgb2yuv, void *opq) \
1793 const uint16_t *src = (const uint16_t*)src1; \
1794 uint16_t *dstU = (uint16_t*)_dstU; \
1795 uint16_t *dstV = (uint16_t*)_dstV; \
1796 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1797 av_assert1(src1==src2); \
1798 rgbaf16ToUV_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1800static void rgbaf16##endian_name##ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1801 const uint8_t *unused1, int width, uint32_t *_rgb2yuv, void *opq) \
1803 const uint16_t *src = (const uint16_t*)_src; \
1804 uint16_t *dst = (uint16_t*)_dst; \
1805 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1806 rgbaf16ToY_endian(dst, src, endian, width, rgb2yuv, opq); \
1808static void rgbaf16##endian_name##ToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1809 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
1811 const uint16_t *src = (const uint16_t*)_src; \
1812 uint16_t *dst = (uint16_t*)_dst; \
1813 rgbaf16ToA_endian(dst, src, endian, width, opq); \
1815static void rgbf16##endian_name##ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1816 const uint8_t *src1, const uint8_t *src2, \
1817 int width, uint32_t *_rgb2yuv, void *opq) \
1819 const uint16_t *src = (const uint16_t*)src1; \
1820 uint16_t *dstU = (uint16_t*)_dstU; \
1821 uint16_t *dstV = (uint16_t*)_dstV; \
1822 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1823 av_assert1(src1==src2); \
1824 rgbf16ToUV_half_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1826static void rgbf16##endian_name##ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1827 const uint8_t *src1, const uint8_t *src2, \
1828 int width, uint32_t *_rgb2yuv, void *opq) \
1830 const uint16_t *src = (const uint16_t*)src1; \
1831 uint16_t *dstU = (uint16_t*)_dstU; \
1832 uint16_t *dstV = (uint16_t*)_dstV; \
1833 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1834 av_assert1(src1==src2); \
1835 rgbf16ToUV_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1837static void rgbf16##endian_name##ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1838 const uint8_t *unused1, int width, uint32_t *_rgb2yuv, void *opq) \
1840 const uint16_t *src = (const uint16_t*)_src; \
1841 uint16_t *dst = (uint16_t*)_dst; \
1842 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1843 rgbf16ToY_endian(dst, src, endian, width, rgb2yuv, opq); \
1860 switch (srcFormat) {
1893 *readChrPlanar = planar_rgb9le_to_uv;
1897 *readChrPlanar = planar_rgb10le_to_uv;
1901 *readChrPlanar = planar_rgb12le_to_uv;
1905 *readChrPlanar = planar_rgb14le_to_uv;
1909 *readChrPlanar = planar_rgb16le_to_uv;
1913 *readChrPlanar = planar_rgbf32le_to_uv;
1917 *readChrPlanar = planar_rgbf16le_to_uv;
1920 *readChrPlanar = msb_planar_rgb10le_to_uv;
1923 *readChrPlanar = msb_planar_rgb12le_to_uv;
1926 *readChrPlanar = planar_rgb9be_to_uv;
1930 *readChrPlanar = planar_rgb10be_to_uv;
1934 *readChrPlanar = planar_rgb12be_to_uv;
1938 *readChrPlanar = planar_rgb14be_to_uv;
1942 *readChrPlanar = planar_rgb16be_to_uv;
1946 *readChrPlanar = planar_rgbf32be_to_uv;
1950 *readChrPlanar = planar_rgbf16be_to_uv;
1953 *readChrPlanar = msb_planar_rgb10be_to_uv;
1956 *readChrPlanar = msb_planar_rgb12be_to_uv;
2028 *chrToYV12 = shf16_10LEToUV_c;
2031 *chrToYV12 = shf16_12LEToUV_c;
2034 *chrToYV12 = shf16_10BEToUV_c;
2037 *chrToYV12 = shf16_12BEToUV_c;
2053 *chrToYV12 = read_ayuv64le_UV_c;
2056 *chrToYV12 = read_ayuv64be_UV_c;
2068 *chrToYV12 = read_xv48le_UV_c;
2071 *chrToYV12 = read_xv48be_UV_c;
2074 *chrToYV12 = nv20LEToUV_c;
2079 *chrToYV12 = p010LEToUV_c;
2082 *chrToYV12 = nv20BEToUV_c;
2087 *chrToYV12 = p010BEToUV_c;
2092 *chrToYV12 = p012LEToUV_c;
2097 *chrToYV12 = p012BEToUV_c;
2102 *chrToYV12 = p016LEToUV_c;
2107 *chrToYV12 = p016BEToUV_c;
2110 *chrToYV12 = y210le_UV_c;
2113 *chrToYV12 = y212le_UV_c;
2116 *chrToYV12 = y216le_UV_c;
2119 *chrToYV12 = rgbf32le_to_uv_c;
2122 *chrToYV12 = rgbf32be_to_uv_c;
2125 if (
c->chrSrcHSubSample) {
2126 switch (srcFormat) {
2127 case AV_PIX_FMT_RGBA64BE:
2128 *chrToYV12 = rgb64BEToUV_half_c;
2130 case AV_PIX_FMT_RGBA64LE:
2131 *chrToYV12 = rgb64LEToUV_half_c;
2133 case AV_PIX_FMT_BGRA64BE:
2134 *chrToYV12 = bgr64BEToUV_half_c;
2136 case AV_PIX_FMT_BGRA64LE:
2137 *chrToYV12 = bgr64LEToUV_half_c;
2139 case AV_PIX_FMT_RGB48BE:
2140 *chrToYV12 = rgb48BEToUV_half_c;
2142 case AV_PIX_FMT_RGB48LE:
2143 *chrToYV12 = rgb48LEToUV_half_c;
2145 case AV_PIX_FMT_BGR48BE:
2146 *chrToYV12 = bgr48BEToUV_half_c;
2148 case AV_PIX_FMT_BGR48LE:
2149 *chrToYV12 = bgr48LEToUV_half_c;
2151 case AV_PIX_FMT_RGB32:
2152 *chrToYV12 = bgr32ToUV_half_c;
2154 case AV_PIX_FMT_RGB32_1:
2155 *chrToYV12 = bgr321ToUV_half_c;
2157 case AV_PIX_FMT_BGR24:
2158 *chrToYV12 = bgr24ToUV_half_c;
2160 case AV_PIX_FMT_BGR565LE:
2161 *chrToYV12 = bgr16leToUV_half_c;
2163 case AV_PIX_FMT_BGR565BE:
2164 *chrToYV12 = bgr16beToUV_half_c;
2166 case AV_PIX_FMT_BGR555LE:
2167 *chrToYV12 = bgr15leToUV_half_c;
2169 case AV_PIX_FMT_BGR555BE:
2170 *chrToYV12 = bgr15beToUV_half_c;
2172 case AV_PIX_FMT_GBRAP:
2173 case AV_PIX_FMT_GBRP:
2174 *chrToYV12 = gbr24pToUV_half_c;
2176 case AV_PIX_FMT_BGR444LE:
2177 *chrToYV12 = bgr12leToUV_half_c;
2179 case AV_PIX_FMT_BGR444BE:
2180 *chrToYV12 = bgr12beToUV_half_c;
2182 case AV_PIX_FMT_BGR32:
2183 *chrToYV12 = rgb32ToUV_half_c;
2185 case AV_PIX_FMT_BGR32_1:
2186 *chrToYV12 = rgb321ToUV_half_c;
2188 case AV_PIX_FMT_RGB24:
2189 *chrToYV12 = rgb24ToUV_half_c;
2191 case AV_PIX_FMT_RGB565LE:
2192 *chrToYV12 = rgb16leToUV_half_c;
2194 case AV_PIX_FMT_RGB565BE:
2195 *chrToYV12 = rgb16beToUV_half_c;
2197 case AV_PIX_FMT_RGB555LE:
2198 *chrToYV12 = rgb15leToUV_half_c;
2200 case AV_PIX_FMT_RGB555BE:
2201 *chrToYV12 = rgb15beToUV_half_c;
2203 case AV_PIX_FMT_RGB444LE:
2204 *chrToYV12 = rgb12leToUV_half_c;
2206 case AV_PIX_FMT_RGB444BE:
2207 *chrToYV12 = rgb12beToUV_half_c;
2209 case AV_PIX_FMT_X2RGB10LE:
2210 *chrToYV12 = rgb30leToUV_half_c;
2212 case AV_PIX_FMT_X2BGR10LE:
2213 *chrToYV12 = bgr30leToUV_half_c;
2215 case AV_PIX_FMT_RGBAF16BE:
2216 *chrToYV12 = rgbaf16beToUV_half_c;
2218 case AV_PIX_FMT_RGBAF16LE:
2219 *chrToYV12 = rgbaf16leToUV_half_c;
2221 case AV_PIX_FMT_RGBF16BE:
2222 *chrToYV12 = rgbf16beToUV_half_c;
2224 case AV_PIX_FMT_RGBF16LE:
2225 *chrToYV12 = rgbf16leToUV_half_c;
2227 case AV_PIX_FMT_RGBF32BE:
2228 *chrToYV12 = rgbf32be_to_uv_half_c;
2230 case AV_PIX_FMT_RGBF32LE:
2231 *chrToYV12 = rgbf32le_to_uv_half_c;
2235 switch (srcFormat) {
2237 *chrToYV12 = rgb64BEToUV_c;
2240 *chrToYV12 = rgb64LEToUV_c;
2243 *chrToYV12 = bgr64BEToUV_c;
2246 *chrToYV12 = bgr64LEToUV_c;
2249 *chrToYV12 = rgb48BEToUV_c;
2252 *chrToYV12 = rgb48LEToUV_c;
2255 *chrToYV12 = bgr48BEToUV_c;
2258 *chrToYV12 = bgr48LEToUV_c;
2261 *chrToYV12 = bgr32ToUV_c;
2264 *chrToYV12 = bgr321ToUV_c;
2270 *chrToYV12 = bgr16leToUV_c;
2273 *chrToYV12 = bgr16beToUV_c;
2276 *chrToYV12 = bgr15leToUV_c;
2279 *chrToYV12 = bgr15beToUV_c;
2282 *chrToYV12 = bgr12leToUV_c;
2285 *chrToYV12 = bgr12beToUV_c;
2288 *chrToYV12 = rgb32ToUV_c;
2291 *chrToYV12 = rgb321ToUV_c;
2297 *chrToYV12 = rgb16leToUV_c;
2300 *chrToYV12 = rgb16beToUV_c;
2303 *chrToYV12 = rgb15leToUV_c;
2306 *chrToYV12 = rgb15beToUV_c;
2309 *chrToYV12 = rgb12leToUV_c;
2312 *chrToYV12 = rgb12beToUV_c;
2315 *chrToYV12 = rgb30leToUV_c;
2318 *chrToYV12 = bgr30leToUV_c;
2321 *chrToYV12 = rgbaf16beToUV_c;
2324 *chrToYV12 = rgbaf16leToUV_c;
2327 *chrToYV12 = rgbf16beToUV_c;
2330 *chrToYV12 = rgbf16leToUV_c;
2337 switch (srcFormat) {
2339 *readLumPlanar = planar_rgb9le_to_y;
2342 *readAlpPlanar = planar_rgb10le_to_a;
2345 *readLumPlanar = planar_rgb10le_to_y;
2348 *readAlpPlanar = planar_rgb12le_to_a;
2351 *readLumPlanar = planar_rgb12le_to_y;
2354 *readAlpPlanar = planar_rgb14le_to_a;
2357 *readLumPlanar = planar_rgb14le_to_y;
2360 *readAlpPlanar = planar_rgb16le_to_a;
2363 *readLumPlanar = planar_rgb16le_to_y;
2366 *readAlpPlanar = planar_rgbf32le_to_a;
2369 *readLumPlanar = planar_rgbf32le_to_y;
2372 *readAlpPlanar = planar_rgbf16le_to_a;
2375 *readLumPlanar = planar_rgbf16le_to_y;
2378 *readLumPlanar = msb_planar_rgb10le_to_y;
2381 *readLumPlanar = msb_planar_rgb12le_to_y;
2384 *readLumPlanar = planar_rgb9be_to_y;
2387 *readAlpPlanar = planar_rgb10be_to_a;
2390 *readLumPlanar = planar_rgb10be_to_y;
2393 *readAlpPlanar = planar_rgb12be_to_a;
2396 *readLumPlanar = planar_rgb12be_to_y;
2399 *readAlpPlanar = planar_rgb14be_to_a;
2402 *readLumPlanar = planar_rgb14be_to_y;
2405 *readAlpPlanar = planar_rgb16be_to_a;
2408 *readLumPlanar = planar_rgb16be_to_y;
2411 *readAlpPlanar = planar_rgbf32be_to_a;
2414 *readLumPlanar = planar_rgbf32be_to_y;
2417 *readAlpPlanar = planar_rgbf16be_to_a;
2420 *readLumPlanar = planar_rgbf16be_to_y;
2423 *readLumPlanar = msb_planar_rgb10be_to_y;
2426 *readLumPlanar = msb_planar_rgb12be_to_y;
2462 *lumToYV12 = bswap16Y_c;
2475 *lumToYV12 = bswap16Y_c;
2476 *alpToYV12 = bswap16Y_c;
2506 *lumToYV12 = bswap16Y_c;
2519 *lumToYV12 = bswap16Y_c;
2520 *alpToYV12 = bswap16Y_c;
2524 *lumToYV12 = shf16_10LEToY_c;
2527 *lumToYV12 = shf16_12LEToY_c;
2530 *lumToYV12 = shf16_10BEToY_c;
2533 *lumToYV12 = shf16_12BEToY_c;
2542 *lumToYV12 = read_yaf16le_gray_c;
2545 *lumToYV12 = read_yaf16be_gray_c;
2590 *lumToYV12 = bgr24ToY_c;
2593 *lumToYV12 = bgr16leToY_c;
2596 *lumToYV12 = bgr16beToY_c;
2599 *lumToYV12 = bgr15leToY_c;
2602 *lumToYV12 = bgr15beToY_c;
2605 *lumToYV12 = bgr12leToY_c;
2608 *lumToYV12 = bgr12beToY_c;
2614 *lumToYV12 = rgb16leToY_c;
2617 *lumToYV12 = rgb16beToY_c;
2620 *lumToYV12 = rgb15leToY_c;
2623 *lumToYV12 = rgb15beToY_c;
2626 *lumToYV12 = rgb12leToY_c;
2629 *lumToYV12 = rgb12beToY_c;
2645 *lumToYV12 = bgr32ToY_c;
2648 *lumToYV12 = bgr321ToY_c;
2651 *lumToYV12 = rgb32ToY_c;
2654 *lumToYV12 = rgb321ToY_c;
2657 *lumToYV12 = rgb48BEToY_c;
2660 *lumToYV12 = rgb48LEToY_c;
2663 *lumToYV12 = bgr48BEToY_c;
2666 *lumToYV12 = bgr48LEToY_c;
2669 *lumToYV12 = rgb64BEToY_c;
2672 *lumToYV12 = rgb64LEToY_c;
2675 *lumToYV12 = bgr64BEToY_c;
2678 *lumToYV12 = bgr64LEToY_c;
2681 *lumToYV12 = nv20LEToY_c;
2686 *lumToYV12 = p010LEToY_c;
2689 *lumToYV12 = nv20BEToY_c;
2694 *lumToYV12 = p010BEToY_c;
2699 *lumToYV12 = p012LEToY_c;
2704 *lumToYV12 = p012BEToY_c;
2707 *lumToYV12 = grayf32leToY16_c;
2710 *lumToYV12 = grayf32beToY16_c;
2713 *lumToYV12 = read_yaf32le_gray_c;
2716 *lumToYV12 = read_yaf32be_gray_c;
2719 *lumToYV12 = grayf16leToY16_c;
2722 *lumToYV12 = grayf16beToY16_c;
2725 *lumToYV12 = y210le_Y_c;
2728 *lumToYV12 = y212le_Y_c;
2731 *lumToYV12 = y216le_Y_c;
2734 *lumToYV12 = rgb30leToY_c;
2737 *lumToYV12 = bgr30leToY_c;
2740 *lumToYV12 = rgbaf16beToY_c;
2743 *lumToYV12 = rgbaf16leToY_c;
2746 *lumToYV12 = rgbf16beToY_c;
2749 *lumToYV12 = rgbf16leToY_c;
2752 *lumToYV12 = rgbf32le_to_y_c;
2755 *lumToYV12 = rgbf32be_to_y_c;
2759 if (is16BPS(srcFormat) || isNBPS(srcFormat)) {
2760 if (HAVE_BIGENDIAN == !isBE(srcFormat) && !*readAlpPlanar)
2761 *alpToYV12 = bswap16Y_c;
2763 switch (srcFormat) {
2777 *alpToYV12 = rgbaf16beToA_c;
2780 *alpToYV12 = rgbaf16leToA_c;
2792 *alpToYV12 = read_yaf16le_alpha_c;
2795 *alpToYV12 = read_yaf16be_alpha_c;
2798 *alpToYV12 = read_yaf32le_alpha_c;
2801 *alpToYV12 = read_yaf32be_alpha_c;
2811 *alpToYV12 = read_ayuv64le_A_c;
uint8_t ptrdiff_t const uint8_t * _src
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
#define i(width, name, range_min, range_max)
static void fn rgb2yuv(uint8_t *_yuv[3], const ptrdiff_t yuv_stride[3], int16_t *rgb[3], ptrdiff_t s, int w, int h, const int16_t rgb2yuv_coeffs[3][3][8], const int16_t yuv_offset[8])
Macro definitions for various function/variable attributes.
#define AV_PIX_FMT_BGR444
#define AV_PIX_FMT_BGR555
#define AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_X2RGB10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YAF16BE
IEEE-754 half precision packed YA, 16 bits gray, 16 bits alpha, 32bpp, big-endian.
@ AV_PIX_FMT_YUV444P16BE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_UYVA
packed UYVA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), UYVAUYVA...
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
@ AV_PIX_FMT_P210BE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
@ AV_PIX_FMT_YUV420P16BE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_V30XLE
packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), little-endian
@ AV_PIX_FMT_AYUV64BE
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
@ AV_PIX_FMT_P010LE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
@ AV_PIX_FMT_GRAYF32LE
IEEE-754 single precision Y, 32bpp, little-endian.
@ AV_PIX_FMT_P210LE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, little-endian
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
@ AV_PIX_FMT_YA16BE
16 bits gray, 16 bits alpha (big-endian)
@ AV_PIX_FMT_YUV444P12MSBBE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), lowest bits zero, big-endian
@ AV_PIX_FMT_YUVA420P9BE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
@ AV_PIX_FMT_XV36LE
packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian,...
@ AV_PIX_FMT_YUVA444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian
@ AV_PIX_FMT_NV42
as above, but U and V bytes are swapped
@ AV_PIX_FMT_YUV420P14LE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_YUV440P10BE
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
@ AV_PIX_FMT_GBRPF16BE
IEEE-754 half precision planer GBR 4:4:4, 48bpp, big-endian.
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
@ AV_PIX_FMT_XV30LE
packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channe...
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
@ AV_PIX_FMT_BGR565BE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
@ AV_PIX_FMT_RGBF32LE
IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian.
@ AV_PIX_FMT_YUVA422P12BE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, big-endian
@ AV_PIX_FMT_YUVA444P9LE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
@ AV_PIX_FMT_YUVA444P10LE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
@ AV_PIX_FMT_VUYX
packed VUYX 4:4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined
@ AV_PIX_FMT_GBRP9LE
planar GBR 4:4:4 27bpp, little-endian
@ AV_PIX_FMT_NV20LE
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_GBRP10MSBBE
planar GBR 4:4:4 30bpp, lowest bits zero, big-endian
@ AV_PIX_FMT_YUV444P14BE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_YUVA420P10BE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
@ AV_PIX_FMT_YUVA422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, little-endian
@ AV_PIX_FMT_P416LE
interleaved chroma YUV 4:4:4, 48bpp, little-endian
@ AV_PIX_FMT_P016LE
like NV12, with 16bpp per component, little-endian
@ AV_PIX_FMT_P010BE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_AYUV64LE
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ AV_PIX_FMT_RGB555BE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
@ AV_PIX_FMT_YVYU422
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
@ AV_PIX_FMT_YUVA422P9LE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
@ AV_PIX_FMT_GRAY12LE
Y , 12bpp, little-endian.
@ AV_PIX_FMT_P012BE
like NV12, with 12bpp per component, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_GBRAP12BE
planar GBR 4:4:4:4 48bpp, big-endian
@ AV_PIX_FMT_YUV420P9LE
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_NV20BE
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_GRAY12BE
Y , 12bpp, big-endian.
@ AV_PIX_FMT_X2BGR10LE
packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_GRAYF16BE
IEEE-754 half precision Y, 16bpp, big-endian.
@ AV_PIX_FMT_BGR48BE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
@ AV_PIX_FMT_YA16LE
16 bits gray, 16 bits alpha (little-endian)
@ AV_PIX_FMT_YUVA420P10LE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
@ AV_PIX_FMT_GRAY14LE
Y , 14bpp, little-endian.
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
@ AV_PIX_FMT_Y210LE
packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian
@ AV_PIX_FMT_P012LE
like NV12, with 12bpp per component, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ AV_PIX_FMT_YAF16LE
IEEE-754 half precision packed YA, 16 bits gray, 16 bits alpha, 32bpp, little-endian.
@ AV_PIX_FMT_YUV422P10BE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_P016BE
like NV12, with 16bpp per component, big-endian
@ AV_PIX_FMT_YUVA422P10LE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
@ AV_PIX_FMT_YUV444P10MSBBE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), lowest bits zero, big-endian
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_GBRPF16LE
IEEE-754 half precision planer GBR 4:4:4, 48bpp, little-endian.
@ AV_PIX_FMT_RGBA64BE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb)
@ AV_PIX_FMT_NV24
planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
@ AV_PIX_FMT_YAF32BE
IEEE-754 single precision packed YA, 32 bits gray, 32 bits alpha, 64bpp, big-endian.
@ AV_PIX_FMT_GBRAP14BE
planar GBR 4:4:4:4 56bpp, big-endian
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_YUV422P16LE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_YUV420P14BE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_GBRAP16BE
planar GBRA 4:4:4:4 64bpp, big-endian
@ AV_PIX_FMT_YUV444P14LE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
@ AV_PIX_FMT_YUVA444P9BE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
@ AV_PIX_FMT_RGB444LE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_YUV444P10BE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_P410LE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, little-endian
@ AV_PIX_FMT_YUV440P12LE
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
@ AV_PIX_FMT_GBRP10MSBLE
planar GBR 4:4:4 30bpp, lowest bits zero, little-endian
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_YUVA420P9LE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
@ AV_PIX_FMT_YAF32LE
IEEE-754 single precision packed YA, 32 bits gray, 32 bits alpha, 64bpp, little-endian.
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_YUV444P9LE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_RGBF16LE
IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., little-endian.
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
@ AV_PIX_FMT_GRAY9BE
Y , 9bpp, big-endian.
@ AV_PIX_FMT_YUVA444P16LE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
@ AV_PIX_FMT_YUVA422P10BE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
@ AV_PIX_FMT_UYYVYY411
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
@ AV_PIX_FMT_P216LE
interleaved chroma YUV 4:2:2, 32bpp, little-endian
@ AV_PIX_FMT_YUVA422P16BE
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
@ AV_PIX_FMT_BGRA64BE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_P416BE
interleaved chroma YUV 4:4:4, 48bpp, big-endian
@ AV_PIX_FMT_P212BE
interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian
@ AV_PIX_FMT_YUV444P10MSBLE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), lowest bits zero, little-endian
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
@ AV_PIX_FMT_GBRP16BE
planar GBR 4:4:4 48bpp, big-endian
@ AV_PIX_FMT_AYUV
packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
@ AV_PIX_FMT_GBRAP12LE
planar GBR 4:4:4:4 48bpp, little-endian
@ AV_PIX_FMT_GBRP9BE
planar GBR 4:4:4 27bpp, big-endian
@ AV_PIX_FMT_YUVA420P16LE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_BGR444BE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
@ AV_PIX_FMT_BGR555BE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
@ AV_PIX_FMT_GBRAPF32BE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
@ AV_PIX_FMT_XV36BE
packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian,...
@ AV_PIX_FMT_GBRP12MSBLE
planar GBR 4:4:4 36bpp, lowest bits zero, little-endian
@ AV_PIX_FMT_Y212LE
packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_Y216LE
packed YUV 4:2:2 like YUYV422, 32bpp, little-endian
@ AV_PIX_FMT_BGR444LE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_YUVA420P16BE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_X2RGB10LE
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_YUV444P9BE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
@ AV_PIX_FMT_P410BE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian
@ AV_PIX_FMT_GBRAP14LE
planar GBR 4:4:4:4 56bpp, little-endian
@ AV_PIX_FMT_RGBAF16LE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian.
@ AV_PIX_FMT_YUV422P9LE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_GRAYF32BE
IEEE-754 single precision Y, 32bpp, big-endian.
@ AV_PIX_FMT_RGB444BE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
@ AV_PIX_FMT_YUV422P9BE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_BGR48LE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
@ AV_PIX_FMT_GBRP14LE
planar GBR 4:4:4 42bpp, little-endian
@ AV_PIX_FMT_XV48LE
packed XVYU 4:4:4, 64bpp, little-endian, variant of Y416 where alpha channel is left undefined
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
@ AV_PIX_FMT_GBRP10LE
planar GBR 4:4:4 30bpp, little-endian
@ AV_PIX_FMT_GBRAP10BE
planar GBR 4:4:4:4 40bpp, big-endian
@ AV_PIX_FMT_GBRAPF16BE
IEEE-754 half precision planar GBRA 4:4:4:4, 64bpp, big-endian.
@ AV_PIX_FMT_YUV444P12MSBLE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), lowest bits zero, little-endian
@ AV_PIX_FMT_GRAYF16LE
IEEE-754 half precision Y, 16bpp, little-endian.
@ AV_PIX_FMT_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
@ AV_PIX_FMT_BGR555LE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_YUV420P12BE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_BGRA64LE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_YUV440P12BE
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
@ AV_PIX_FMT_GBRAP10LE
planar GBR 4:4:4:4 40bpp, little-endian
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
@ AV_PIX_FMT_YUV422P16BE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_RGBAF16BE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_GRAY9LE
Y , 9bpp, little-endian.
@ AV_PIX_FMT_VUYA
packed VUYA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), VUYAVUYA...
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_XV48BE
packed XVYU 4:4:4, 64bpp, big-endian, variant of Y416 where alpha channel is left undefined
@ AV_PIX_FMT_YUV422P14LE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_GBRAP16LE
planar GBRA 4:4:4:4 64bpp, little-endian
@ AV_PIX_FMT_YUV420P10BE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_GBRAPF16LE
IEEE-754 half precision planar GBRA 4:4:4:4, 64bpp, little-endian.
@ AV_PIX_FMT_YUV420P9BE
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
@ AV_PIX_FMT_GRAY10BE
Y , 10bpp, big-endian.
@ AV_PIX_FMT_YUVA444P10BE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
@ AV_PIX_FMT_YUV440P10LE
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
@ AV_PIX_FMT_YUV444P16LE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_GRAY14BE
Y , 14bpp, big-endian.
@ AV_PIX_FMT_P212LE
interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian
@ AV_PIX_FMT_GBRP14BE
planar GBR 4:4:4 42bpp, big-endian
@ AV_PIX_FMT_BGR565LE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
@ AV_PIX_FMT_YUV422P14BE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_P216BE
interleaved chroma YUV 4:2:2, 32bpp, big-endian
@ AV_PIX_FMT_YUV444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_YUVA444P16BE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
@ AV_PIX_FMT_YUVA422P16LE
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
@ AV_PIX_FMT_RGBF32BE
IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian.
@ AV_PIX_FMT_GBRP16LE
planar GBR 4:4:4 48bpp, little-endian
@ AV_PIX_FMT_YUVA422P9BE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
@ AV_PIX_FMT_VYU444
packed VYU 4:4:4, 24bpp (1 Cr & Cb sample per 1x1 Y), VYUVYU...
@ AV_PIX_FMT_YUVA444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_YUV422P12BE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_P412BE
interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian
@ AV_PIX_FMT_GBRP12MSBBE
planar GBR 4:4:4 36bpp, lowest bits zero, big-endian
@ AV_PIX_FMT_P412LE
interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian
@ AV_PIX_FMT_YUV420P16LE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_RGBF16BE
IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., big-endian.
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
#define AV_PIX_FMT_RGB32_1
#define AV_PIX_FMT_BGR32_1
#define AV_PIX_FMT_X2BGR10
#define AV_PIX_FMT_BGR565
#define AV_PIX_FMT_RGB565
#define AV_PIX_FMT_BGRA64
#define AV_PIX_FMT_RGB444
#define AV_PIX_FMT_RGB555
void(* planar2_YV12_fn)(uint8_t *dst, uint8_t *dst2, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal, void *opaque)
Unscaled conversion of chroma plane to YV12 for horizontal scaler.
void(* planar1_YV12_fn)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal, void *opaque)
Unscaled conversion of luma/alpha plane to YV12 for horizontal scaler.
void(* planarX_YV12_fn)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opaque)
Unscaled conversion of arbitrary planar data (e.g.
void ff_sws_init_input_funcs(SwsInternal *c, planar1_YV12_fn *lumToYV12, planar1_YV12_fn *alpToYV12, planar2_YV12_fn *chrToYV12, planarX_YV12_fn *readLumPlanar, planarX_YV12_fn *readAlpPlanar, planarX2_YV12_fn *readChrPlanar)
void(* planarX2_YV12_fn)(uint8_t *dst, uint8_t *dst2, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opaque)