Go to the documentation of this file.
32 #define input_pixel(pos) (is_be ? AV_RB16(pos) : AV_RL16(pos))
39 #define IS_BE(ENDIAN_IDENTIFIER) IS_BE_ ## ENDIAN_IDENTIFIER
41 #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)
42 #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)
61 const uint16_t *
src1,
const uint16_t *
src2,
80 const uint16_t *
src1,
const uint16_t *
src2,
97 #define RGB64FUNCS_EXT(pattern, BE_LE, origin, is_be) \
98 static void pattern ## 64 ## BE_LE ## ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, const uint8_t *unused1,\
99 int width, uint32_t *rgb2yuv, void *opq) \
101 const uint16_t *src = (const uint16_t *) _src; \
102 uint16_t *dst = (uint16_t *) _dst; \
103 rgb64ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \
106 static void pattern ## 64 ## BE_LE ## ToUV_c(uint8_t *_dstU, uint8_t *_dstV, \
107 const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \
108 int width, uint32_t *rgb2yuv, void *opq) \
110 const uint16_t *src1 = (const uint16_t *) _src1, \
111 *src2 = (const uint16_t *) _src2; \
112 uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \
113 rgb64ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
116 static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, \
117 const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \
118 int width, uint32_t *rgb2yuv, void *opq) \
120 const uint16_t *src1 = (const uint16_t *) _src1, \
121 *src2 = (const uint16_t *) _src2; \
122 uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \
123 rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
125 #define RGB64FUNCS(pattern, endianness, base_fmt) \
126 RGB64FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness))
151 const uint16_t *
src1,
152 const uint16_t *
src2,
173 const uint16_t *
src1,
174 const uint16_t *
src2,
200 #define RGB48FUNCS_EXT(pattern, BE_LE, origin, is_be) \
201 static void pattern ## 48 ## BE_LE ## ToY_c(uint8_t *_dst, \
202 const uint8_t *_src, \
203 const uint8_t *unused0, const uint8_t *unused1,\
208 const uint16_t *src = (const uint16_t *)_src; \
209 uint16_t *dst = (uint16_t *)_dst; \
210 rgb48ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \
213 static void pattern ## 48 ## BE_LE ## ToUV_c(uint8_t *_dstU, \
215 const uint8_t *unused0, \
216 const uint8_t *_src1, \
217 const uint8_t *_src2, \
222 const uint16_t *src1 = (const uint16_t *)_src1, \
223 *src2 = (const uint16_t *)_src2; \
224 uint16_t *dstU = (uint16_t *)_dstU, \
225 *dstV = (uint16_t *)_dstV; \
226 rgb48ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
229 static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \
231 const uint8_t *unused0, \
232 const uint8_t *_src1, \
233 const uint8_t *_src2, \
238 const uint16_t *src1 = (const uint16_t *)_src1, \
239 *src2 = (const uint16_t *)_src2; \
240 uint16_t *dstU = (uint16_t *)_dstU, \
241 *dstV = (uint16_t *)_dstV; \
242 rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
244 #define RGB48FUNCS(pattern, endianness, base_fmt) \
245 RGB48FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness))
252 #define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \
253 origin == AV_PIX_FMT_BGRA || \
254 origin == AV_PIX_FMT_ARGB || \
255 origin == AV_PIX_FMT_ABGR) \
256 ? AV_RN32A(&src[(i) * 4]) \
257 : ((origin == AV_PIX_FMT_X2RGB10LE || \
258 origin == AV_PIX_FMT_X2BGR10LE) \
259 ? AV_RL32(&src[(i) * 4]) \
260 : (is_be ? AV_RB16(&src[(i) * 2]) \
261 : AV_RL16(&src[(i) * 2]))))
269 int maskr,
int maskg,
271 int gsh,
int bsh,
int S,
275 const unsigned rnd = (32<<((
S)-1)) + (1<<(
S-7));
280 int b = (px & maskb) >> shb;
281 int g = (px & maskg) >> shg;
282 int r = (px & maskr) >> shr;
284 dst[
i] = (ry *
r + gy *
g + by *
b +
rnd) >> ((
S)-6);
295 int maskr,
int maskg,
297 int gsh,
int bsh,
int S,
302 const unsigned rnd = (256
u<<((
S)-1)) + (1<<(
S-7));
307 int b = (px & maskb) >> shb;
308 int g = (px & maskg) >> shg;
309 int r = (px & maskr) >> shr;
311 dstU[
i] = (ru *
r + gu *
g + bu *
b +
rnd) >> ((
S)-6);
312 dstV[
i] = (rv *
r + gv *
g + bv *
b +
rnd) >> ((
S)-6);
323 int maskr,
int maskg,
325 int gsh,
int bsh,
int S,
330 maskgx = ~(maskr | maskb);
331 const unsigned rnd = (256
U<<(
S)) + (1<<(
S-6));
340 int b,
r,
g = (px0 & maskgx) + (px1 & maskgx);
341 int rb = px0 + px1 -
g;
343 b = (rb & maskb) >> shb;
349 g = (
g & maskg) >> shg;
351 r = (rb & maskr) >> shr;
353 dstU[
i] = (ru *
r + gu *
g + bu *
b + (unsigned)
rnd) >> ((
S)-6+1);
354 dstV[
i] = (rv *
r + gv *
g + bv *
b + (unsigned)
rnd) >> ((
S)-6+1);
360 #define RGB16_32FUNCS_EXT(fmt, name, shr, shg, shb, shp, maskr, \
361 maskg, maskb, rsh, gsh, bsh, S, is_be) \
362 static void name ## ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, \
363 int width, uint32_t *tab, void *opq) \
365 rgb16_32ToY_c_template((int16_t*)dst, src, width, fmt, shr, shg, shb, shp, \
366 maskr, maskg, maskb, rsh, gsh, bsh, S, tab, is_be); \
369 static void name ## ToUV_c(uint8_t *dstU, uint8_t *dstV, \
370 const uint8_t *unused0, const uint8_t *src, const uint8_t *dummy, \
371 int width, uint32_t *tab, void *opq) \
373 rgb16_32ToUV_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
374 shr, shg, shb, shp, \
375 maskr, maskg, maskb, rsh, gsh, bsh, S, tab, is_be); \
378 static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \
379 const uint8_t *unused0, const uint8_t *src, \
380 const uint8_t *dummy, \
381 int width, uint32_t *tab, void *opq) \
383 rgb16_32ToUV_half_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
384 shr, shg, shb, shp, \
385 maskr, maskg, maskb, \
386 rsh, gsh, bsh, S, tab, is_be); \
389 #define RGB16_32FUNCS(base_fmt, endianness, name, shr, shg, shb, shp, maskr, \
390 maskg, maskb, rsh, gsh, bsh, S) \
391 RGB16_32FUNCS_EXT(base_fmt ## endianness, name, shr, shg, shb, shp, maskr, \
392 maskg, maskb, rsh, gsh, bsh, S, IS_BE(endianness))
394 RGB16_32FUNCS(
AV_PIX_FMT_BGR32, , bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8,
RGB2YUV_SHIFT + 8)
395 RGB16_32FUNCS(
AV_PIX_FMT_BGR32_1, , bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8,
RGB2YUV_SHIFT + 8)
396 RGB16_32FUNCS(
AV_PIX_FMT_RGB32, , rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8,
RGB2YUV_SHIFT + 8)
397 RGB16_32FUNCS(
AV_PIX_FMT_RGB32_1, , rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8,
RGB2YUV_SHIFT + 8)
398 RGB16_32FUNCS(
AV_PIX_FMT_BGR565, LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0,
RGB2YUV_SHIFT + 8)
399 RGB16_32FUNCS(
AV_PIX_FMT_BGR555, LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0,
RGB2YUV_SHIFT + 7)
400 RGB16_32FUNCS(
AV_PIX_FMT_BGR444, LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0,
RGB2YUV_SHIFT + 4)
401 RGB16_32FUNCS(
AV_PIX_FMT_RGB565, LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11,
RGB2YUV_SHIFT + 8)
402 RGB16_32FUNCS(
AV_PIX_FMT_RGB555, LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10,
RGB2YUV_SHIFT + 7)
403 RGB16_32FUNCS(
AV_PIX_FMT_RGB444, LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8,
RGB2YUV_SHIFT + 4)
404 RGB16_32FUNCS(
AV_PIX_FMT_BGR565, BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0,
RGB2YUV_SHIFT + 8)
405 RGB16_32FUNCS(
AV_PIX_FMT_BGR555, BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0,
RGB2YUV_SHIFT + 7)
406 RGB16_32FUNCS(
AV_PIX_FMT_BGR444, BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0,
RGB2YUV_SHIFT + 4)
407 RGB16_32FUNCS(
AV_PIX_FMT_RGB565, BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11,
RGB2YUV_SHIFT + 8)
408 RGB16_32FUNCS(
AV_PIX_FMT_RGB555, BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10,
RGB2YUV_SHIFT + 7)
409 RGB16_32FUNCS(
AV_PIX_FMT_RGB444, BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8,
RGB2YUV_SHIFT + 4)
410 RGB16_32FUNCS(
AV_PIX_FMT_X2RGB10, LE, rgb30le, 16, 6, 0, 0, 0x3FF00000, 0xFFC00, 0x3FF, 0, 0, 4,
RGB2YUV_SHIFT + 6)
411 RGB16_32FUNCS(
AV_PIX_FMT_X2BGR10, LE, bgr30le, 0, 6, 16, 0, 0x3FF, 0xFFC00, 0x3FF00000, 4, 0, 0,
RGB2YUV_SHIFT + 6)
414 const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc,
417 uint16_t *dstU = (uint16_t *)_dstU;
418 uint16_t *dstV = (uint16_t *)_dstV;
424 unsigned int g = gsrc[2*
i] + gsrc[2*
i+1];
425 unsigned int b = bsrc[2*
i] + bsrc[2*
i+1];
426 unsigned int r = rsrc[2*
i] + rsrc[2*
i+1];
434 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
436 int16_t *
dst = (int16_t *)
_dst;
437 const uint16_t *
src = (
const uint16_t *)
_src;
444 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
446 int16_t *
dst = (int16_t *)
_dst;
447 const uint16_t *
src = (
const uint16_t *)
_src;
454 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
456 int16_t *
dst = (int16_t *)
_dst;
464 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
466 int16_t *
dst = (int16_t *)
_dst;
474 const uint8_t *unused2,
int width, uint32_t *pal,
void *opq)
476 int16_t *
dst = (int16_t *)
_dst;
481 dst[
i]= (pal[d] >> 24)<<6 | pal[d]>>26;
486 const uint8_t *unused2,
int width, uint32_t *pal,
void *opq)
488 int16_t *
dst = (int16_t *)
_dst;
493 dst[
i] = (pal[d] & 0xFF)<<6;
498 const uint8_t *unused0,
const uint8_t *
src1,
const uint8_t *
src2,
499 int width, uint32_t *pal,
void *opq)
501 uint16_t *dstU = (uint16_t *)_dstU;
502 int16_t *dstV = (int16_t *)_dstV;
506 int p = pal[
src1[
i]];
508 dstU[
i] = (uint8_t)(p>> 8)<<6;
509 dstV[
i] = (uint8_t)(p>>16)<<6;
514 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
516 int16_t *
dst = (int16_t *)
_dst;
521 for (j = 0; j < 8; j++)
522 dst[8*
i+j]= ((d>>(7-j))&1) * 16383;
526 for (j = 0; j < (
width&7); j++)
527 dst[8*
i+j]= ((d>>(7-j))&1) * 16383;
532 const uint8_t *unused2,
int width, uint32_t *unused,
void *opq)
534 int16_t *
dst = (int16_t *)
_dst;
539 for (j = 0; j < 8; j++)
540 dst[8*
i+j]= ((d>>(7-j))&1) * 16383;
544 for (j = 0; j < (
width&7); j++)
545 dst[8*
i+j] = ((d>>(7-j))&1) * 16383;
549 static void yuy2ToY_c(uint8_t *
dst,
const uint8_t *
src,
const uint8_t *unused1,
const uint8_t *unused2,
int width,
550 uint32_t *unused,
void *opq)
557 static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src1,
558 const uint8_t *
src2,
int width, uint32_t *unused,
void *opq)
562 dstU[
i] =
src1[4 *
i + 1];
563 dstV[
i] =
src1[4 *
i + 3];
568 static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src1,
569 const uint8_t *
src2,
int width, uint32_t *unused,
void *opq)
573 dstV[
i] =
src1[4 *
i + 1];
574 dstU[
i] =
src1[4 *
i + 3];
579 #define y21xle_wrapper(bits, shift) \
580 static void y2 ## bits ## le_UV_c(uint8_t *dstU, uint8_t *dstV, \
581 const uint8_t *unused0, \
582 const uint8_t *src, \
583 const uint8_t *unused1, int width, \
584 uint32_t *unused2, void *opq) \
587 for (i = 0; i < width; i++) { \
588 AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 2) >> shift); \
589 AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> shift); \
593 static void y2 ## bits ## le_Y_c(uint8_t *dst, const uint8_t *src, \
594 const uint8_t *unused0, \
595 const uint8_t *unused1, int width, \
596 uint32_t *unused2, void *opq) \
599 for (i = 0; i < width; i++) \
600 AV_WN16(dst + i * 2, AV_RL16(src + i * 4) >> shift); \
607 static
void bswap16Y_c(uint8_t *
_dst, const uint8_t *
_src, const uint8_t *unused1, const uint8_t *unused2,
int width,
608 uint32_t *unused,
void *opq)
611 const uint16_t *
src = (
const uint16_t *)
_src;
612 uint16_t *
dst = (uint16_t *)
_dst;
617 static void bswap16UV_c(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *unused0,
const uint8_t *_src1,
618 const uint8_t *_src2,
int width, uint32_t *unused,
void *opq)
621 const uint16_t *
src1 = (
const uint16_t *)_src1,
622 *
src2 = (
const uint16_t *)_src2;
623 uint16_t *dstU = (uint16_t *)_dstU, *dstV = (uint16_t *)_dstV;
631 uint32_t *unused,
void *opq)
639 uint32_t *unused,
void *opq)
647 uint32_t *unused,
void *opq)
655 uint32_t *unused,
void *opq)
663 uint32_t *unused2,
void *opq)
671 uint32_t *unused2,
void *opq)
679 int u_offset,
int v_offset)
689 int u_offset,
int v_offset)
698 #define ayuv64_UV_funcs(pixfmt, U, V) \
699 static void read_ ## pixfmt ## le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, \
700 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
702 ayuv64le_UV_c(dstU, dstV, src, width, U, V); \
705 static void read_ ## pixfmt ## be_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, \
706 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
708 ayuv64be_UV_c(dstU, dstV, src, width, U, V); \
714 static
void read_ayuv64le_A_c(uint8_t *
dst, const uint8_t *
src, const uint8_t *unused0, const uint8_t *unused1,
int width,
715 uint32_t *unused2,
void *opq)
723 uint32_t *unused2,
void *opq)
730 static void read_vuyx_UV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src,
731 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
735 dstU[
i] =
src[
i * 4 + 1];
736 dstV[
i] =
src[
i * 4];
741 uint32_t *unused2,
void *opq)
749 uint32_t *unused2,
void *opq)
756 static void read_ayuv_UV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src,
757 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
761 dstU[
i] =
src[
i * 4 + 2];
762 dstV[
i] =
src[
i * 4 + 3];
767 uint32_t *unused2,
void *opq)
775 uint32_t *unused2,
void *opq)
782 static void read_uyva_UV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src,
783 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
787 dstU[
i] =
src[
i * 4];
788 dstV[
i] =
src[
i * 4 + 2];
792 static void vyuToY_c(uint8_t *
dst,
const uint8_t *
src,
const uint8_t *unused0,
const uint8_t *unused1,
int width,
793 uint32_t *unused2,
void *opq)
800 static void vyuToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src,
801 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
805 dstU[
i] =
src[
i * 3 + 2];
806 dstV[
i] =
src[
i * 3];
811 uint32_t *unused2,
void *opq)
820 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
825 AV_WN16(dstU +
i * 2, (uv >> 2) & 0x3FFu);
826 AV_WN16(dstV +
i * 2, (uv >> 22) & 0x3FFu);
831 uint32_t *unused2,
void *opq)
840 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
850 uint32_t *unused2,
void *opq)
859 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
869 uint32_t *unused2,
void *opq)
878 const uint8_t *unused1,
int width, uint32_t *unused2,
void *opq)
889 static void uyvyToY_c(uint8_t *
dst,
const uint8_t *
src,
const uint8_t *unused1,
const uint8_t *unused2,
int width,
890 uint32_t *unused,
void *opq)
897 static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src1,
898 const uint8_t *
src2,
int width, uint32_t *unused,
void *opq)
902 dstU[
i] =
src1[4 *
i + 0];
903 dstV[
i] =
src1[4 *
i + 2];
908 static void uyyvyyToY_c(uint8_t *
dst,
const uint8_t *
src,
const uint8_t *unused1,
const uint8_t *unused2,
909 int width, uint32_t *unused,
void *opq)
912 dst[
i] =
src[3 * (
i >> 1) + 1 + (
i & 1)];
915 static void uyyvyyToUV_c(uint8_t *dstU, uint8_t *dstV,
const uint8_t *unused0,
const uint8_t *
src1,
916 const uint8_t *
src2,
int width, uint32_t *unused,
void *opq)
919 dstU[
i] =
src1[6 *
i + 0];
920 dstV[
i] =
src1[6 *
i + 3];
930 dst1[
i] =
src[2 *
i + 0];
931 dst2[
i] =
src[2 *
i + 1];
936 const uint8_t *unused0,
const uint8_t *
src1,
const uint8_t *
src2,
937 int width, uint32_t *unused,
void *opq)
943 const uint8_t *unused0,
const uint8_t *
src1,
const uint8_t *
src2,
944 int width, uint32_t *unused,
void *opq)
949 #define p01x_uv_wrapper(fmt, shift) \
950 static void fmt ## LEToUV ## _c(uint8_t *dstU, \
952 const uint8_t *unused0, \
953 const uint8_t *src1, \
954 const uint8_t *src2, int width, \
955 uint32_t *unused, void *opq) \
958 for (i = 0; i < width; i++) { \
959 AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0) >> shift); \
960 AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2) >> shift); \
964 static void fmt ## BEToUV ## _c(uint8_t *dstU, \
966 const uint8_t *unused0, \
967 const uint8_t *src1, \
968 const uint8_t *src2, int width, \
969 uint32_t *unused, void *opq) \
972 for (i = 0; i < width; i++) { \
973 AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0) >> shift); \
974 AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2) >> shift); \
978 #define p01x_wrapper(fmt, shift) \
979 static void fmt ## LEToY ## _c(uint8_t *dst, \
980 const uint8_t *src, \
981 const uint8_t *unused1, \
982 const uint8_t *unused2, int width, \
983 uint32_t *unused, void *opq) \
986 for (i = 0; i < width; i++) { \
987 AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> shift); \
991 static void fmt ## BEToY ## _c(uint8_t *dst, \
992 const uint8_t *src, \
993 const uint8_t *unused1, \
994 const uint8_t *unused2, int width, \
995 uint32_t *unused, void *opq) \
998 for (i = 0; i < width; i++) { \
999 AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> shift); \
1002 p01x_uv_wrapper(fmt, shift)
1009 #define shf16_uv_wrapper(shift) \
1010 static void shf16_ ## shift ## LEToUV_c(uint8_t *dstU, \
1012 const uint8_t *unused0, \
1013 const uint8_t *src1, \
1014 const uint8_t *src2, int width, \
1015 uint32_t *unused, void *opq) \
1018 for (i = 0; i < width; i++) { \
1019 AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 2) >> (16 - shift)); \
1020 AV_WN16(dstV + i * 2, AV_RL16(src2 + i * 2) >> (16 - shift)); \
1024 static void shf16_ ## shift ## BEToUV_c(uint8_t *dstU, \
1026 const uint8_t *unused0, \
1027 const uint8_t *src1, \
1028 const uint8_t *src2, int width, \
1029 uint32_t *unused, void *opq) \
1032 for (i = 0; i < width; i++) { \
1033 AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 2) >> (16 - shift)); \
1034 AV_WN16(dstV + i * 2, AV_RB16(src2 + i * 2) >> (16 - shift)); \
1038 #define shf16_wrapper(shift) \
1039 static void shf16_ ## shift ## LEToY_c(uint8_t *dst, \
1040 const uint8_t *src, \
1041 const uint8_t *unused1, \
1042 const uint8_t *unused2, int width, \
1043 uint32_t *unused, void *opq) \
1046 for (i = 0; i < width; i++) { \
1047 AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> (16 - shift)); \
1051 static void shf16_ ## shift ## BEToY_c(uint8_t *dst, \
1052 const uint8_t *src, \
1053 const uint8_t *unused1, \
1054 const uint8_t *unused2, int width, \
1055 uint32_t *unused, void *opq) \
1058 for (i = 0; i < width; i++) { \
1059 AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> (16 - shift)); \
1062 shf16_uv_wrapper(shift)
1067 static
void bgr24ToY_c(uint8_t *
_dst, const uint8_t *
src, const uint8_t *unused1, const uint8_t *unused2,
1070 int16_t *
dst = (int16_t *)
_dst;
1074 int b =
src[
i * 3 + 0];
1075 int g =
src[
i * 3 + 1];
1076 int r =
src[
i * 3 + 2];
1082 static void bgr24ToUV_c(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *unused0,
const uint8_t *
src1,
1085 int16_t *dstU = (int16_t *)_dstU;
1086 int16_t *dstV = (int16_t *)_dstV;
1104 int16_t *dstU = (int16_t *)_dstU;
1105 int16_t *dstV = (int16_t *)_dstV;
1123 int16_t *
dst = (int16_t *)
_dst;
1127 int r =
src[
i * 3 + 0];
1128 int g =
src[
i * 3 + 1];
1129 int b =
src[
i * 3 + 2];
1135 static void rgb24ToUV_c(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *unused0,
const uint8_t *
src1,
1138 int16_t *dstU = (int16_t *)_dstU;
1139 int16_t *dstV = (int16_t *)_dstV;
1157 int16_t *dstU = (int16_t *)_dstU;
1158 int16_t *dstV = (int16_t *)_dstV;
1175 uint16_t *
dst = (uint16_t *)
_dst;
1189 uint16_t *
dst = (uint16_t *)
_dst;
1197 uint16_t *dstU = (uint16_t *)_dstU;
1198 uint16_t *dstV = (uint16_t *)_dstV;
1213 (is_be ? AV_RB16(src) : AV_RL16(src))
1215 #define shifted_planar_rgb16_to_y(rdpx_shift) \
1216 static av_always_inline void planar_rgb16_s ## rdpx_shift ## _to_y(uint8_t *_dst, const uint8_t *_src[4], \
1217 int width, int bpc, int is_be, int32_t *rgb2yuv) \
1220 const uint16_t **src = (const uint16_t **)_src; \
1221 uint16_t *dst = (uint16_t *)_dst; \
1222 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX]; \
1223 int shift = bpc < 16 ? bpc : 14; \
1224 for (i = 0; i < width; i++) { \
1225 int g = rdpx(src[0] + i) >> (16 - rdpx_shift); \
1226 int b = rdpx(src[1] + i) >> (16 - rdpx_shift); \
1227 int r = rdpx(src[2] + i) >> (16 - rdpx_shift); \
1229 dst[i] = (ry*r + gy*g + by*b + (16 << (RGB2YUV_SHIFT + bpc - 8)) \
1230 + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14); \
1234 #define shifted_planar_rgb16_to_a(rdpx_shift) \
1235 static av_always_inline void planar_rgb16_s ## rdpx_shift ## _to_a(uint8_t *_dst, const uint8_t *_src[4], \
1236 int width, int bpc, int is_be, int32_t *rgb2yuv) \
1239 const uint16_t **src = (const uint16_t **)_src; \
1240 uint16_t *dst = (uint16_t *)_dst; \
1241 int shift = (bpc < 16 ? bpc : 14) + 16 - rdpx_shift; \
1243 for (i = 0; i < width; i++) { \
1244 dst[i] = rdpx(src[3] + i) << (14 - shift); \
1248 #define shifted_planar_rgb16_to_uv(rdpx_shift) \
1249 static av_always_inline void planar_rgb16_s ## rdpx_shift ## _to_uv(uint8_t *_dstU, uint8_t *_dstV, \
1250 const uint8_t *_src[4], int width, \
1251 int bpc, int is_be, int32_t *rgb2yuv) \
1254 const uint16_t **src = (const uint16_t **)_src; \
1255 uint16_t *dstU = (uint16_t *)_dstU; \
1256 uint16_t *dstV = (uint16_t *)_dstV; \
1257 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX]; \
1258 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX]; \
1259 int shift = bpc < 16 ? bpc : 14; \
1260 for (i = 0; i < width; i++) { \
1261 int g = rdpx(src[0] + i) >> (16 - rdpx_shift); \
1262 int b = rdpx(src[1] + i) >> (16 - rdpx_shift); \
1263 int r = rdpx(src[2] + i) >> (16 - rdpx_shift); \
1265 dstU[i] = (ru*r + gu*g + bu*b + (128 << (RGB2YUV_SHIFT + bpc - 8)) \
1266 + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14); \
1267 dstV[i] = (rv*r + gv*g + bv*b + (128 << (RGB2YUV_SHIFT + bpc - 8)) \
1268 + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14); \
1272 #define shifted_planar_rgb16_to_y_uv(rdpx_shift) \
1273 shifted_planar_rgb16_to_y(rdpx_shift) \
1274 shifted_planar_rgb16_to_uv(rdpx_shift)
1276 #define shifted_planar_rgb16(rdpx_shift) \
1277 shifted_planar_rgb16_to_y_uv(rdpx_shift) \
1278 shifted_planar_rgb16_to_a(rdpx_shift)
1286 #define rdpx(src) (is_be ? av_int2float(AV_RB32(src)): av_int2float(AV_RL32(src)))
1291 const float **
src = (
const float **)
_src;
1292 uint16_t *
dst = (uint16_t *)
_dst;
1302 const float **
src = (
const float **)
_src;
1303 uint16_t *dstU = (uint16_t *)_dstU;
1304 uint16_t *dstV = (uint16_t *)_dstV;
1321 const float **
src = (
const float **)
_src;
1322 uint16_t *
dst = (uint16_t *)
_dst;
1336 const uint8_t *
_src,
const uint8_t *unused2,
1340 const float *
src = (
const float *)
_src;
1341 uint16_t *dstU = (uint16_t *)_dstU;
1342 uint16_t *dstV = (uint16_t *)_dstV;
1357 const uint8_t *unused1,
const uint8_t *unused2,
1361 const float *
src = (
const float *)
_src;
1362 uint16_t *
dst = (uint16_t *)
_dst;
1376 const uint8_t *unused2,
int width,
int is_be, uint32_t *unused)
1379 const float *
src = (
const float *)
_src;
1380 uint16_t *
dst = (uint16_t *)
_dst;
1388 const uint8_t *unused2,
int width,
int is_be, uint32_t *unused)
1391 const float *
src = (
const float *)
_src;
1392 uint16_t *
dst = (uint16_t *)
_dst;
1399 const uint8_t *unused2,
int width,
int is_be, uint32_t *unused)
1402 const float *
src = (
const float *)
_src;
1403 uint16_t *
dst = (uint16_t *)
_dst;
1411 #define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \
1412 static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1413 int w, int32_t *rgb2yuv, void *opq) \
1415 planar_rgb16_s16_to_y(dst, src, w, nbits, endian, rgb2yuv); \
1417 static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1418 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1421 planar_rgb16_s16_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \
1424 #define rgb9plus_planar_transparency_funcs(nbits) \
1425 static void planar_rgb##nbits##le_to_a(uint8_t *dst, const uint8_t *src[4], \
1426 int w, int32_t *rgb2yuv, \
1429 planar_rgb16_s16_to_a(dst, src, w, nbits, 0, rgb2yuv); \
1431 static void planar_rgb##nbits##be_to_a(uint8_t *dst, const uint8_t *src[4], \
1432 int w, int32_t *rgb2yuv, \
1435 planar_rgb16_s16_to_a(dst, src, w, nbits, 1, rgb2yuv); \
1438 #define rgb9plus_msb_planar_funcs_endian(nbits, endian_name, endian) \
1439 static void msb_planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1440 int w, int32_t *rgb2yuv, void *opq) \
1442 planar_rgb16_s##nbits##_to_y(dst, src, w, nbits, endian, rgb2yuv); \
1444 static void msb_planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1445 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1448 planar_rgb16_s##nbits##_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \
1451 #define rgb9plus_planar_funcs(nbits) \
1452 rgb9plus_planar_funcs_endian(nbits, le, 0) \
1453 rgb9plus_planar_funcs_endian(nbits, be, 1)
1455 #define rgb9plus_msb_planar_funcs(nbits) \
1456 rgb9plus_msb_planar_funcs_endian(nbits, le, 0) \
1457 rgb9plus_msb_planar_funcs_endian(nbits, be, 1)
1473 #define rgbf32_funcs_endian(endian_name, endian) \
1474 static void planar_rgbf32##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1475 int w, int32_t *rgb2yuv, void *opq) \
1477 planar_rgbf32_to_y(dst, src, w, endian, rgb2yuv); \
1479 static void planar_rgbf32##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1480 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1483 planar_rgbf32_to_uv(dstU, dstV, src, w, endian, rgb2yuv); \
1485 static void planar_rgbf32##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \
1486 int w, int32_t *rgb2yuv, void *opq) \
1488 planar_rgbf32_to_a(dst, src, w, endian, rgb2yuv); \
1490 static void rgbf32##endian_name##_to_y_c(uint8_t *dst, const uint8_t *src, \
1491 const uint8_t *unused1, const uint8_t *unused2, \
1492 int w, uint32_t *rgb2yuv, void *opq) \
1494 rgbf32_to_y_c(dst, src, unused1, unused2, w, endian, rgb2yuv); \
1496 static void rgbf32##endian_name##_to_uv_c(uint8_t *dstU, uint8_t *dstV, \
1497 const uint8_t *unused1, \
1498 const uint8_t *src, const uint8_t *unused2, \
1499 int w, uint32_t *rgb2yuv, \
1502 rgbf32_to_uv_c(dstU, dstV, unused1, src, unused2, w, endian, rgb2yuv); \
1504 static void grayf32##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \
1505 const uint8_t *unused1, const uint8_t *unused2, \
1506 int width, uint32_t *unused, void *opq) \
1508 grayf32ToY16_c(dst, src, unused1, unused2, width, endian, unused); \
1510 static void read_yaf32##endian_name##_gray_c(uint8_t *dst, const uint8_t *src, \
1511 const uint8_t *unused1, const uint8_t *unused2, \
1512 int width, uint32_t *unused, void *opq) \
1514 read_yaf32_gray_c(dst, src, unused1, unused2, width, endian, unused); \
1516 static void read_yaf32##endian_name##_alpha_c(uint8_t *dst, const uint8_t *src, \
1517 const uint8_t *unused1, const uint8_t *unused2, \
1518 int width, uint32_t *unused, void *opq) \
1520 read_yaf32_alpha_c(dst, src, unused1, unused2, width, endian, unused); \
1526 #define rdpx(src) av_int2float(half2float(is_be ? AV_RB16(&src) : AV_RL16(&src), h2f_tbl))
1527 #define rdpx2(src) av_int2float(half2float(is_be ? AV_RB16(src) : AV_RL16(src), h2f_tbl))
1582 uint16_t *
dst = (uint16_t *)
_dst;
1591 uint16_t *
dst = (uint16_t *)
_dst;
1710 #define rgbaf16_funcs_endian(endian_name, endian) \
1711 static void planar_rgbf16##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1712 int w, int32_t *rgb2yuv, void *opq) \
1714 planar_rgbf16_to_y(dst, src, w, endian, rgb2yuv, opq); \
1716 static void planar_rgbf16##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1717 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1720 planar_rgbf16_to_uv(dstU, dstV, src, w, endian, rgb2yuv, opq); \
1722 static void planar_rgbf16##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \
1723 int w, int32_t *rgb2yuv, void *opq) \
1725 planar_rgbf16_to_a(dst, src, w, endian, rgb2yuv, opq); \
1727 static void grayf16##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \
1728 const uint8_t *unused1, const uint8_t *unused2, \
1729 int width, uint32_t *unused, void *opq) \
1731 grayf16ToY16_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1733 static void read_yaf16##endian_name##_gray_c(uint8_t *dst, const uint8_t *src, \
1734 const uint8_t *unused1, const uint8_t *unused2, \
1735 int width, uint32_t *unused, void *opq) \
1737 read_yaf16_gray_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1739 static void read_yaf16##endian_name##_alpha_c(uint8_t *dst, const uint8_t *src, \
1740 const uint8_t *unused1, const uint8_t *unused2, \
1741 int width, uint32_t *unused, void *opq) \
1743 read_yaf16_alpha_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1746 static void rgbaf16##endian_name##ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1747 const uint8_t *src1, const uint8_t *src2, \
1748 int width, uint32_t *_rgb2yuv, void *opq) \
1750 const uint16_t *src = (const uint16_t*)src1; \
1751 uint16_t *dstU = (uint16_t*)_dstU; \
1752 uint16_t *dstV = (uint16_t*)_dstV; \
1753 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1754 av_assert1(src1==src2); \
1755 rgbaf16ToUV_half_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1757 static void rgbaf16##endian_name##ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1758 const uint8_t *src1, const uint8_t *src2, \
1759 int width, uint32_t *_rgb2yuv, void *opq) \
1761 const uint16_t *src = (const uint16_t*)src1; \
1762 uint16_t *dstU = (uint16_t*)_dstU; \
1763 uint16_t *dstV = (uint16_t*)_dstV; \
1764 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1765 av_assert1(src1==src2); \
1766 rgbaf16ToUV_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1768 static void rgbaf16##endian_name##ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1769 const uint8_t *unused1, int width, uint32_t *_rgb2yuv, void *opq) \
1771 const uint16_t *src = (const uint16_t*)_src; \
1772 uint16_t *dst = (uint16_t*)_dst; \
1773 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1774 rgbaf16ToY_endian(dst, src, endian, width, rgb2yuv, opq); \
1776 static void rgbaf16##endian_name##ToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1777 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
1779 const uint16_t *src = (const uint16_t*)_src; \
1780 uint16_t *dst = (uint16_t*)_dst; \
1781 rgbaf16ToA_endian(dst, src, endian, width, opq); \
1783 static void rgbf16##endian_name##ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1784 const uint8_t *src1, const uint8_t *src2, \
1785 int width, uint32_t *_rgb2yuv, void *opq) \
1787 const uint16_t *src = (const uint16_t*)src1; \
1788 uint16_t *dstU = (uint16_t*)_dstU; \
1789 uint16_t *dstV = (uint16_t*)_dstV; \
1790 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1791 av_assert1(src1==src2); \
1792 rgbf16ToUV_half_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1794 static void rgbf16##endian_name##ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1795 const uint8_t *src1, const uint8_t *src2, \
1796 int width, uint32_t *_rgb2yuv, void *opq) \
1798 const uint16_t *src = (const uint16_t*)src1; \
1799 uint16_t *dstU = (uint16_t*)_dstU; \
1800 uint16_t *dstV = (uint16_t*)_dstV; \
1801 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1802 av_assert1(src1==src2); \
1803 rgbf16ToUV_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1805 static void rgbf16##endian_name##ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1806 const uint8_t *unused1, int width, uint32_t *_rgb2yuv, void *opq) \
1808 const uint16_t *src = (const uint16_t*)_src; \
1809 uint16_t *dst = (uint16_t*)_dst; \
1810 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1811 rgbf16ToY_endian(dst, src, endian, width, rgb2yuv, opq); \
1828 switch (srcFormat) {
1861 *readChrPlanar = planar_rgb9le_to_uv;
1865 *readChrPlanar = planar_rgb10le_to_uv;
1869 *readChrPlanar = planar_rgb12le_to_uv;
1873 *readChrPlanar = planar_rgb14le_to_uv;
1877 *readChrPlanar = planar_rgb16le_to_uv;
1881 *readChrPlanar = planar_rgbf32le_to_uv;
1885 *readChrPlanar = planar_rgbf16le_to_uv;
1888 *readChrPlanar = msb_planar_rgb10le_to_uv;
1891 *readChrPlanar = msb_planar_rgb12le_to_uv;
1894 *readChrPlanar = planar_rgb9be_to_uv;
1898 *readChrPlanar = planar_rgb10be_to_uv;
1902 *readChrPlanar = planar_rgb12be_to_uv;
1906 *readChrPlanar = planar_rgb14be_to_uv;
1910 *readChrPlanar = planar_rgb16be_to_uv;
1914 *readChrPlanar = planar_rgbf32be_to_uv;
1918 *readChrPlanar = planar_rgbf16be_to_uv;
1921 *readChrPlanar = msb_planar_rgb10be_to_uv;
1924 *readChrPlanar = msb_planar_rgb12be_to_uv;
1996 *chrToYV12 = shf16_10LEToUV_c;
1999 *chrToYV12 = shf16_12LEToUV_c;
2002 *chrToYV12 = shf16_10BEToUV_c;
2005 *chrToYV12 = shf16_12BEToUV_c;
2021 *chrToYV12 = read_ayuv64le_UV_c;
2024 *chrToYV12 = read_ayuv64be_UV_c;
2036 *chrToYV12 = read_xv48le_UV_c;
2039 *chrToYV12 = read_xv48be_UV_c;
2042 *chrToYV12 = nv20LEToUV_c;
2047 *chrToYV12 = p010LEToUV_c;
2050 *chrToYV12 = nv20BEToUV_c;
2055 *chrToYV12 = p010BEToUV_c;
2060 *chrToYV12 = p012LEToUV_c;
2065 *chrToYV12 = p012BEToUV_c;
2070 *chrToYV12 = p016LEToUV_c;
2075 *chrToYV12 = p016BEToUV_c;
2078 *chrToYV12 = y210le_UV_c;
2081 *chrToYV12 = y212le_UV_c;
2084 *chrToYV12 = y216le_UV_c;
2087 *chrToYV12 = rgbf32le_to_uv_c;
2090 *chrToYV12 = rgbf32be_to_uv_c;
2093 if (
c->chrSrcHSubSample) {
2094 switch (srcFormat) {
2096 *chrToYV12 = rgb64BEToUV_half_c;
2099 *chrToYV12 = rgb64LEToUV_half_c;
2102 *chrToYV12 = bgr64BEToUV_half_c;
2105 *chrToYV12 = bgr64LEToUV_half_c;
2108 *chrToYV12 = rgb48BEToUV_half_c;
2111 *chrToYV12 = rgb48LEToUV_half_c;
2114 *chrToYV12 = bgr48BEToUV_half_c;
2117 *chrToYV12 = bgr48LEToUV_half_c;
2120 *chrToYV12 = bgr32ToUV_half_c;
2123 *chrToYV12 = bgr321ToUV_half_c;
2129 *chrToYV12 = bgr16leToUV_half_c;
2132 *chrToYV12 = bgr16beToUV_half_c;
2135 *chrToYV12 = bgr15leToUV_half_c;
2138 *chrToYV12 = bgr15beToUV_half_c;
2145 *chrToYV12 = bgr12leToUV_half_c;
2148 *chrToYV12 = bgr12beToUV_half_c;
2151 *chrToYV12 = rgb32ToUV_half_c;
2154 *chrToYV12 = rgb321ToUV_half_c;
2160 *chrToYV12 = rgb16leToUV_half_c;
2163 *chrToYV12 = rgb16beToUV_half_c;
2166 *chrToYV12 = rgb15leToUV_half_c;
2169 *chrToYV12 = rgb15beToUV_half_c;
2172 *chrToYV12 = rgb12leToUV_half_c;
2175 *chrToYV12 = rgb12beToUV_half_c;
2178 *chrToYV12 = rgb30leToUV_half_c;
2181 *chrToYV12 = bgr30leToUV_half_c;
2184 *chrToYV12 = rgbaf16beToUV_half_c;
2187 *chrToYV12 = rgbaf16leToUV_half_c;
2190 *chrToYV12 = rgbf16beToUV_half_c;
2193 *chrToYV12 = rgbf16leToUV_half_c;
2197 switch (srcFormat) {
2199 *chrToYV12 = rgb64BEToUV_c;
2202 *chrToYV12 = rgb64LEToUV_c;
2205 *chrToYV12 = bgr64BEToUV_c;
2208 *chrToYV12 = bgr64LEToUV_c;
2211 *chrToYV12 = rgb48BEToUV_c;
2214 *chrToYV12 = rgb48LEToUV_c;
2217 *chrToYV12 = bgr48BEToUV_c;
2220 *chrToYV12 = bgr48LEToUV_c;
2223 *chrToYV12 = bgr32ToUV_c;
2226 *chrToYV12 = bgr321ToUV_c;
2232 *chrToYV12 = bgr16leToUV_c;
2235 *chrToYV12 = bgr16beToUV_c;
2238 *chrToYV12 = bgr15leToUV_c;
2241 *chrToYV12 = bgr15beToUV_c;
2244 *chrToYV12 = bgr12leToUV_c;
2247 *chrToYV12 = bgr12beToUV_c;
2250 *chrToYV12 = rgb32ToUV_c;
2253 *chrToYV12 = rgb321ToUV_c;
2259 *chrToYV12 = rgb16leToUV_c;
2262 *chrToYV12 = rgb16beToUV_c;
2265 *chrToYV12 = rgb15leToUV_c;
2268 *chrToYV12 = rgb15beToUV_c;
2271 *chrToYV12 = rgb12leToUV_c;
2274 *chrToYV12 = rgb12beToUV_c;
2277 *chrToYV12 = rgb30leToUV_c;
2280 *chrToYV12 = bgr30leToUV_c;
2283 *chrToYV12 = rgbaf16beToUV_c;
2286 *chrToYV12 = rgbaf16leToUV_c;
2289 *chrToYV12 = rgbf16beToUV_c;
2292 *chrToYV12 = rgbf16leToUV_c;
2299 switch (srcFormat) {
2301 *readLumPlanar = planar_rgb9le_to_y;
2304 *readAlpPlanar = planar_rgb10le_to_a;
2306 *readLumPlanar = planar_rgb10le_to_y;
2309 *readAlpPlanar = planar_rgb12le_to_a;
2311 *readLumPlanar = planar_rgb12le_to_y;
2314 *readAlpPlanar = planar_rgb14le_to_a;
2316 *readLumPlanar = planar_rgb14le_to_y;
2319 *readAlpPlanar = planar_rgb16le_to_a;
2321 *readLumPlanar = planar_rgb16le_to_y;
2324 *readAlpPlanar = planar_rgbf32le_to_a;
2326 *readLumPlanar = planar_rgbf32le_to_y;
2329 *readAlpPlanar = planar_rgbf16le_to_a;
2331 *readLumPlanar = planar_rgbf16le_to_y;
2334 *readLumPlanar = msb_planar_rgb10le_to_y;
2337 *readLumPlanar = msb_planar_rgb12le_to_y;
2340 *readLumPlanar = planar_rgb9be_to_y;
2343 *readAlpPlanar = planar_rgb10be_to_a;
2345 *readLumPlanar = planar_rgb10be_to_y;
2348 *readAlpPlanar = planar_rgb12be_to_a;
2350 *readLumPlanar = planar_rgb12be_to_y;
2353 *readAlpPlanar = planar_rgb14be_to_a;
2355 *readLumPlanar = planar_rgb14be_to_y;
2358 *readAlpPlanar = planar_rgb16be_to_a;
2360 *readLumPlanar = planar_rgb16be_to_y;
2363 *readAlpPlanar = planar_rgbf32be_to_a;
2365 *readLumPlanar = planar_rgbf32be_to_y;
2368 *readAlpPlanar = planar_rgbf16be_to_a;
2370 *readLumPlanar = planar_rgbf16be_to_y;
2373 *readLumPlanar = msb_planar_rgb10be_to_y;
2376 *readLumPlanar = msb_planar_rgb12be_to_y;
2411 *lumToYV12 = bswap16Y_c;
2424 *lumToYV12 = bswap16Y_c;
2425 *alpToYV12 = bswap16Y_c;
2455 *lumToYV12 = bswap16Y_c;
2468 *lumToYV12 = bswap16Y_c;
2469 *alpToYV12 = bswap16Y_c;
2473 *lumToYV12 = shf16_10LEToY_c;
2476 *lumToYV12 = shf16_12LEToY_c;
2479 *lumToYV12 = shf16_10BEToY_c;
2482 *lumToYV12 = shf16_12BEToY_c;
2491 *lumToYV12 = read_yaf16le_gray_c;
2494 *lumToYV12 = read_yaf16be_gray_c;
2539 *lumToYV12 = bgr24ToY_c;
2542 *lumToYV12 = bgr16leToY_c;
2545 *lumToYV12 = bgr16beToY_c;
2548 *lumToYV12 = bgr15leToY_c;
2551 *lumToYV12 = bgr15beToY_c;
2554 *lumToYV12 = bgr12leToY_c;
2557 *lumToYV12 = bgr12beToY_c;
2563 *lumToYV12 = rgb16leToY_c;
2566 *lumToYV12 = rgb16beToY_c;
2569 *lumToYV12 = rgb15leToY_c;
2572 *lumToYV12 = rgb15beToY_c;
2575 *lumToYV12 = rgb12leToY_c;
2578 *lumToYV12 = rgb12beToY_c;
2594 *lumToYV12 = bgr32ToY_c;
2597 *lumToYV12 = bgr321ToY_c;
2600 *lumToYV12 = rgb32ToY_c;
2603 *lumToYV12 = rgb321ToY_c;
2606 *lumToYV12 = rgb48BEToY_c;
2609 *lumToYV12 = rgb48LEToY_c;
2612 *lumToYV12 = bgr48BEToY_c;
2615 *lumToYV12 = bgr48LEToY_c;
2618 *lumToYV12 = rgb64BEToY_c;
2621 *lumToYV12 = rgb64LEToY_c;
2624 *lumToYV12 = bgr64BEToY_c;
2627 *lumToYV12 = bgr64LEToY_c;
2630 *lumToYV12 = nv20LEToY_c;
2635 *lumToYV12 = p010LEToY_c;
2638 *lumToYV12 = nv20BEToY_c;
2643 *lumToYV12 = p010BEToY_c;
2648 *lumToYV12 = p012LEToY_c;
2653 *lumToYV12 = p012BEToY_c;
2656 *lumToYV12 = grayf32leToY16_c;
2659 *lumToYV12 = grayf32beToY16_c;
2662 *lumToYV12 = read_yaf32le_gray_c;
2665 *lumToYV12 = read_yaf32be_gray_c;
2668 *lumToYV12 = grayf16leToY16_c;
2671 *lumToYV12 = grayf16beToY16_c;
2674 *lumToYV12 = y210le_Y_c;
2677 *lumToYV12 = y212le_Y_c;
2680 *lumToYV12 = y216le_Y_c;
2683 *lumToYV12 = rgb30leToY_c;
2686 *lumToYV12 = bgr30leToY_c;
2689 *lumToYV12 = rgbaf16beToY_c;
2692 *lumToYV12 = rgbaf16leToY_c;
2695 *lumToYV12 = rgbf16beToY_c;
2698 *lumToYV12 = rgbf16leToY_c;
2701 *lumToYV12 = rgbf32le_to_y_c;
2704 *lumToYV12 = rgbf32be_to_y_c;
2709 if (HAVE_BIGENDIAN == !
isBE(srcFormat) && !*readAlpPlanar)
2710 *alpToYV12 = bswap16Y_c;
2712 switch (srcFormat) {
2726 *alpToYV12 = rgbaf16beToA_c;
2729 *alpToYV12 = rgbaf16leToA_c;
2741 *alpToYV12 = read_yaf16le_alpha_c;
2744 *alpToYV12 = read_yaf16be_alpha_c;
2747 *alpToYV12 = read_yaf32le_alpha_c;
2750 *alpToYV12 = read_yaf32be_alpha_c;
2760 *alpToYV12 = read_ayuv64le_A_c;
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it be(in the first position) for now. Options ------- Then comes the options array. This is what will define the user accessible options. For example
@ AV_PIX_FMT_YUV420P9LE
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ 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_GRAY10BE
Y , 10bpp, big-endian.
AVPixelFormat
Pixel format.
@ 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_P416BE
interleaved chroma YUV 4:4:4, 48bpp, big-endian
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
@ 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_RGB444LE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_GBRP16BE
planar GBR 4:4:4 48bpp, big-endian
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
@ AV_PIX_FMT_YUV422P14LE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-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_RGBF16LE
IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., little-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_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_YUV440P12BE
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
#define u(width, name, range_min, range_max)
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
@ AV_PIX_FMT_P412BE
interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-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_P010BE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
static const char rgb2yuv[]
@ AV_PIX_FMT_YUV420P14BE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_YUV420P16LE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
#define AV_PIX_FMT_RGB32_1
@ AV_PIX_FMT_GBRP14BE
planar GBR 4:4:4 42bpp, big-endian
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_YUVA444P9BE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
@ AV_PIX_FMT_YUV422P9BE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
@ AV_PIX_FMT_GRAYF32LE
IEEE-754 single precision Y, 32bpp, little-endian.
@ AV_PIX_FMT_GBRAP14BE
planar GBR 4:4:4:4 56bpp, big-endian
@ AV_PIX_FMT_RGB555BE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
@ AV_PIX_FMT_RGBAF16LE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian.
uint8_t ptrdiff_t const uint8_t * _src
@ AV_PIX_FMT_AYUV64LE
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
@ AV_PIX_FMT_YUV444P16LE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), 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_GBRAP12LE
planar GBR 4:4:4:4 48bpp, little-endian
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
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)
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_GRAY9LE
Y , 9bpp, little-endian.
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
@ AV_PIX_FMT_YUVA444P16BE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
@ AV_PIX_FMT_YUV444P10BE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), 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_VUYA
packed VUYA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), VUYAVUYA...
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (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_YUV444P14LE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
@ AV_PIX_FMT_GBRAP16BE
planar GBRA 4:4:4:4 64bpp, big-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_GBRP16LE
planar GBR 4:4:4 48bpp, little-endian
@ AV_PIX_FMT_P416LE
interleaved chroma YUV 4:4:4, 48bpp, little-endian
@ AV_PIX_FMT_P210LE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, 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_P016BE
like NV12, with 16bpp per component, big-endian
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
@ AV_PIX_FMT_YUVA420P16BE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
@ AV_PIX_FMT_GBRP10LE
planar GBR 4:4:4 30bpp, little-endian
@ AV_PIX_FMT_GBRAPF16LE
IEEE-754 half precision planar GBRA 4:4:4:4, 64bpp, little-endian.
#define AV_PIX_FMT_BGR32_1
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-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_GBRP10MSBLE
planar GBR 4:4:4 30bpp, lowest bits zero, little-endian
@ AV_PIX_FMT_YUV444P9BE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_YUV422P10BE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_YUV422P16LE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
#define AV_PIX_FMT_RGBA64
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
@ AV_PIX_FMT_Y216LE
packed YUV 4:2:2 like YUYV422, 32bpp, little-endian
@ AV_PIX_FMT_GBRAPF32BE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
@ AV_PIX_FMT_GBRAP12BE
planar GBR 4:4:4:4 48bpp, big-endian
@ AV_PIX_FMT_P012LE
like NV12, with 12bpp per component, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_GBRAPF16BE
IEEE-754 half precision planar GBRA 4:4:4:4, 64bpp, big-endian.
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.
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
@ AV_PIX_FMT_P210BE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian
@ 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_YA16LE
16 bits gray, 16 bits alpha (little-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_YUVA422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, little-endian
@ AV_PIX_FMT_BGR565LE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-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_YUVA444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian
void(* planarX2_YV12_fn)(uint8_t *dst, uint8_t *dst2, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opaque)
@ AV_PIX_FMT_YUVA444P9LE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
@ AV_PIX_FMT_Y210LE
packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-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_RGB8
packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb)
@ AV_PIX_FMT_YUV440P10LE
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
@ AV_PIX_FMT_BGR555BE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
@ 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_GBRP12MSBLE
planar GBR 4:4:4 36bpp, lowest bits zero, little-endian
@ AV_PIX_FMT_YAF16BE
IEEE-754 half precision packed YA, 16 bits gray, 16 bits alpha, 32bpp, big-endian.
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.
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
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_YUV420P14LE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_YUV444P14BE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
@ AV_PIX_FMT_X2RGB10LE
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_P212LE
interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian
@ AV_PIX_FMT_YUV420P9BE
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
#define AV_PIX_FMT_X2BGR10
@ AV_PIX_FMT_YUV444P10MSBLE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), lowest bits zero, little-endian
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
@ AV_PIX_FMT_RGBF32BE
IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_YUV440P12LE
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
@ AV_PIX_FMT_GBRP10MSBBE
planar GBR 4:4:4 30bpp, lowest bits zero, big-endian
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
@ AV_PIX_FMT_YUV420P12BE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-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_XV36BE
packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian,...
@ AV_PIX_FMT_YUV422P14BE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_YA16BE
16 bits gray, 16 bits alpha (big-endian)
@ AV_PIX_FMT_GRAY12LE
Y , 12bpp, little-endian.
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.
#define AV_PIX_FMT_BGR555
@ AV_PIX_FMT_GBRP9BE
planar GBR 4:4:4 27bpp, big-endian
@ AV_PIX_FMT_YUV420P10BE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 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_GBRP12MSBBE
planar GBR 4:4:4 36bpp, lowest bits zero, big-endian
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_BGR444BE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
@ AV_PIX_FMT_GBRP9LE
planar GBR 4:4:4 27bpp, little-endian
@ AV_PIX_FMT_GBRAP10LE
planar GBR 4:4:4:4 40bpp, little-endian
@ AV_PIX_FMT_BGR565BE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
@ AV_PIX_FMT_YAF32LE
IEEE-754 single precision packed YA, 32 bits gray, 32 bits alpha, 64bpp, 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_P410LE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, 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_AYUV
packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ 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_YUVA422P10BE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A 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_YUVA444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian
@ AV_PIX_FMT_YUVA422P9BE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
#define AV_PIX_FMT_BGRA64
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
@ 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...
#define i(width, name, range_min, range_max)
@ AV_PIX_FMT_GRAY9BE
Y , 9bpp, big-endian.
@ 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...
#define AV_PIX_FMT_BGR444
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
@ AV_PIX_FMT_YAF16LE
IEEE-754 half precision packed YA, 16 bits gray, 16 bits alpha, 32bpp, little-endian.
#define AV_PIX_FMT_RGB555
@ AV_PIX_FMT_NV20LE
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
#define AV_PIX_FMT_X2RGB10
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
#define AV_PIX_FMT_BGR565
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
@ AV_PIX_FMT_YUV444P16BE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
@ AV_PIX_FMT_NV42
as above, but U and V bytes are swapped
#define AV_PIX_FMT_RGB565
@ AV_PIX_FMT_GBRAP16LE
planar GBRA 4:4:4:4 64bpp, little-endian
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_GRAY12BE
Y , 12bpp, big-endian.
@ AV_PIX_FMT_YVYU422
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
@ 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_Y212LE
packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_P410BE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian
@ AV_PIX_FMT_P016LE
like NV12, with 16bpp per component, little-endian
@ AV_PIX_FMT_GRAYF32BE
IEEE-754 single precision Y, 32bpp, big-endian.
@ AV_PIX_FMT_GRAYF16BE
IEEE-754 half precision Y, 16bpp, big-endian.
@ AV_PIX_FMT_RGBF16BE
IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., big-endian.
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
@ AV_PIX_FMT_YUV444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-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_YUV444P9LE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_P216LE
interleaved chroma YUV 4:2:2, 32bpp, little-endian
@ AV_PIX_FMT_RGBF32LE
IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-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_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
@ AV_PIX_FMT_YUV420P16BE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUV422P16BE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_P212BE
interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-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_V30XLE
packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), little-endian
@ AV_PIX_FMT_P010LE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_XV48BE
packed XVYU 4:4:4, 64bpp, big-endian, variant of Y416 where alpha channel is left undefined
@ AV_PIX_FMT_YUVA444P10LE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-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_YAF32BE
IEEE-754 single precision packed YA, 32 bits gray, 32 bits alpha, 64bpp, big-endian.
@ AV_PIX_FMT_P216BE
interleaved chroma YUV 4:2:2, 32bpp, big-endian
@ AV_PIX_FMT_P412LE
interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian
@ AV_PIX_FMT_GRAY14LE
Y , 14bpp, little-endian.
@ AV_PIX_FMT_GRAYF16LE
IEEE-754 half precision Y, 16bpp, little-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_GRAY14BE
Y , 14bpp, big-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_YUV440P10BE
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
@ AV_PIX_FMT_YUV422P9LE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-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_GBRP14LE
planar GBR 4:4:4 42bpp, little-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_GBRAP10BE
planar GBR 4:4:4:4 40bpp, 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_GBRPF16BE
IEEE-754 half precision planer GBR 4:4:4, 48bpp, big-endian.
@ AV_PIX_FMT_VUYX
packed VUYX 4:4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined
@ AV_PIX_FMT_VYU444
packed VYU 4:4:4, 24bpp (1 Cr & Cb sample per 1x1 Y), VYUVYU...
@ 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_BGR444LE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-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_GBRAP14LE
planar GBR 4:4:4:4 56bpp, little-endian
@ AV_PIX_FMT_GBRPF16LE
IEEE-754 half precision planer GBR 4:4:4, 48bpp, little-endian.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
@ AV_PIX_FMT_UYYVYY411
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
@ 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_YUVA422P9LE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
#define AV_PIX_FMT_RGB444