38 #define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos)) 40 #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) 41 #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) 49 for (i = 0; i <
width; i++) {
60 const uint16_t *
src1,
const uint16_t *src2,
67 for (i = 0; i <
width; i++) {
79 const uint16_t *
src1,
const uint16_t *src2,
86 for (i = 0; i <
width; i++) {
96 #define rgb64funcs(pattern, BE_LE, origin) \ 97 static void pattern ## 64 ## BE_LE ## ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, const uint8_t *unused1,\ 98 int width, uint32_t *rgb2yuv) \ 100 const uint16_t *src = (const uint16_t *) _src; \ 101 uint16_t *dst = (uint16_t *) _dst; \ 102 rgb64ToY_c_template(dst, src, width, origin, rgb2yuv); \ 105 static void pattern ## 64 ## BE_LE ## ToUV_c(uint8_t *_dstU, uint8_t *_dstV, \ 106 const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \ 107 int width, uint32_t *rgb2yuv) \ 109 const uint16_t *src1 = (const uint16_t *) _src1, \ 110 *src2 = (const uint16_t *) _src2; \ 111 uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \ 112 rgb64ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv); \ 115 static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, \ 116 const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \ 117 int width, uint32_t *rgb2yuv) \ 119 const uint16_t *src1 = (const uint16_t *) _src1, \ 120 *src2 = (const uint16_t *) _src2; \ 121 uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \ 122 rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv); \ 137 for (i = 0; i <
width; i++) {
148 const uint16_t *
src1,
149 const uint16_t *src2,
158 for (i = 0; i <
width; i++) {
170 const uint16_t *
src1,
171 const uint16_t *src2,
180 for (i = 0; i <
width; i++) {
197 #define rgb48funcs(pattern, BE_LE, origin) \ 198 static void pattern ## 48 ## BE_LE ## ToY_c(uint8_t *_dst, \ 199 const uint8_t *_src, \ 200 const uint8_t *unused0, const uint8_t *unused1,\ 204 const uint16_t *src = (const uint16_t *)_src; \ 205 uint16_t *dst = (uint16_t *)_dst; \ 206 rgb48ToY_c_template(dst, src, width, origin, rgb2yuv); \ 209 static void pattern ## 48 ## BE_LE ## ToUV_c(uint8_t *_dstU, \ 211 const uint8_t *unused0, \ 212 const uint8_t *_src1, \ 213 const uint8_t *_src2, \ 217 const uint16_t *src1 = (const uint16_t *)_src1, \ 218 *src2 = (const uint16_t *)_src2; \ 219 uint16_t *dstU = (uint16_t *)_dstU, \ 220 *dstV = (uint16_t *)_dstV; \ 221 rgb48ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv); \ 224 static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \ 226 const uint8_t *unused0, \ 227 const uint8_t *_src1, \ 228 const uint8_t *_src2, \ 232 const uint16_t *src1 = (const uint16_t *)_src1, \ 233 *src2 = (const uint16_t *)_src2; \ 234 uint16_t *dstU = (uint16_t *)_dstU, \ 235 *dstV = (uint16_t *)_dstV; \ 236 rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv); \ 244 #define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \ 245 origin == AV_PIX_FMT_BGRA || \ 246 origin == AV_PIX_FMT_ARGB || \ 247 origin == AV_PIX_FMT_ABGR) \ 248 ? AV_RN32A(&src[(i) * 4]) \ 249 : ((origin == AV_PIX_FMT_X2RGB10LE) \ 250 ? AV_RL32(&src[(i) * 4]) \ 251 : (isBE(origin) ? AV_RB16(&src[(i) * 2]) \ 252 : AV_RL16(&src[(i) * 2])))) 260 int maskr,
int maskg,
262 int gsh,
int bsh,
int S,
265 const int ry = rgb2yuv[
RY_IDX]<<rsh, gy = rgb2yuv[
GY_IDX]<<gsh, by = rgb2yuv[
BY_IDX]<<bsh;
266 const unsigned rnd = (32<<((
S)-1)) + (1<<(S-7));
269 for (i = 0; i <
width; i++) {
271 int b = (px & maskb) >> shb;
272 int g = (px & maskg) >> shg;
273 int r = (px & maskr) >> shr;
275 dst[
i] = (ry * r + gy * g + by * b +
rnd) >> ((S)-6);
286 int maskr,
int maskg,
288 int gsh,
int bsh,
int S,
293 const unsigned rnd = (256
u<<((
S)-1)) + (1<<(S-7));
296 for (i = 0; i <
width; i++) {
298 int b = (px & maskb) >> shb;
299 int g = (px & maskg) >> shg;
300 int r = (px & maskr) >> shr;
302 dstU[
i] = (ru * r +
gu * g +
bu * b +
rnd) >> ((S)-6);
303 dstV[
i] = (
rv * r +
gv * g +
bv * b +
rnd) >> ((S)-6);
314 int maskr,
int maskg,
316 int gsh,
int bsh,
int S,
321 maskgx = ~(maskr | maskb);
322 const unsigned rnd = (256
U<<(
S)) + (1<<(S-6));
328 for (i = 0; i <
width; i++) {
331 int b,
r,
g = (px0 & maskgx) + (px1 & maskgx);
332 int rb = px0 + px1 -
g;
334 b = (rb & maskb) >> shb;
340 g = (g & maskg) >> shg;
342 r = (rb & maskr) >> shr;
344 dstU[
i] = (ru * r +
gu * g +
bu * b + (unsigned)rnd) >> ((
S)-6+1);
345 dstV[
i] = (
rv * r +
gv * g +
bv * b + (unsigned)rnd) >> ((
S)-6+1);
351 #define rgb16_32_wrapper(fmt, name, shr, shg, shb, shp, maskr, \ 352 maskg, maskb, rsh, gsh, bsh, S) \ 353 static void name ## ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, \ 354 int width, uint32_t *tab) \ 356 rgb16_32ToY_c_template((int16_t*)dst, src, width, fmt, shr, shg, shb, shp, \ 357 maskr, maskg, maskb, rsh, gsh, bsh, S, tab); \ 360 static void name ## ToUV_c(uint8_t *dstU, uint8_t *dstV, \ 361 const uint8_t *unused0, const uint8_t *src, const uint8_t *dummy, \ 362 int width, uint32_t *tab) \ 364 rgb16_32ToUV_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \ 365 shr, shg, shb, shp, \ 366 maskr, maskg, maskb, rsh, gsh, bsh, S, tab);\ 369 static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \ 370 const uint8_t *unused0, const uint8_t *src, \ 371 const uint8_t *dummy, \ 372 int width, uint32_t *tab) \ 374 rgb16_32ToUV_half_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \ 375 shr, shg, shb, shp, \ 376 maskr, maskg, maskb, \ 377 rsh, gsh, bsh, S, tab); \ 380 rgb16_32_wrapper(
AV_PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8,
RGB2YUV_SHIFT + 8)
381 rgb16_32_wrapper(
AV_PIX_FMT_BGR32_1,
bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8,
RGB2YUV_SHIFT + 8)
382 rgb16_32_wrapper(
AV_PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8,
RGB2YUV_SHIFT + 8)
383 rgb16_32_wrapper(
AV_PIX_FMT_RGB32_1,
rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8,
RGB2YUV_SHIFT + 8)
384 rgb16_32_wrapper(
AV_PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0,
RGB2YUV_SHIFT + 8)
385 rgb16_32_wrapper(
AV_PIX_FMT_BGR555LE,
bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0,
RGB2YUV_SHIFT + 7)
386 rgb16_32_wrapper(
AV_PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0,
RGB2YUV_SHIFT + 4)
387 rgb16_32_wrapper(
AV_PIX_FMT_RGB565LE,
rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11,
RGB2YUV_SHIFT + 8)
388 rgb16_32_wrapper(
AV_PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10,
RGB2YUV_SHIFT + 7)
389 rgb16_32_wrapper(
AV_PIX_FMT_RGB444LE,
rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8,
RGB2YUV_SHIFT + 4)
390 rgb16_32_wrapper(
AV_PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0,
RGB2YUV_SHIFT + 8)
391 rgb16_32_wrapper(
AV_PIX_FMT_BGR555BE,
bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0,
RGB2YUV_SHIFT + 7)
392 rgb16_32_wrapper(
AV_PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0,
RGB2YUV_SHIFT + 4)
393 rgb16_32_wrapper(
AV_PIX_FMT_RGB565BE,
rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11,
RGB2YUV_SHIFT + 8)
394 rgb16_32_wrapper(
AV_PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10,
RGB2YUV_SHIFT + 7)
395 rgb16_32_wrapper(
AV_PIX_FMT_RGB444BE,
rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8,
RGB2YUV_SHIFT + 4)
396 rgb16_32_wrapper(
AV_PIX_FMT_X2RGB10LE, rgb30le, 16, 6, 0, 0, 0x3FF00000, 0xFFC00, 0x3FF, 0, 0, 4,
RGB2YUV_SHIFT + 6)
402 uint16_t *dstU = (uint16_t *)_dstU;
403 uint16_t *
dstV = (uint16_t *)_dstV;
409 unsigned int g = gsrc[2*
i] + gsrc[2*i+1];
410 unsigned int b = bsrc[2*
i] + bsrc[2*i+1];
411 unsigned int r = rsrc[2*
i] + rsrc[2*i+1];
419 const uint8_t *unused2,
int width, uint32_t *unused)
421 int16_t *dst = (int16_t *)_dst;
422 const uint16_t *
src = (
const uint16_t *)_src;
424 for (i = 0; i <
width; i++)
425 dst[i] =
AV_RL16(src + 4 * i + 3);
429 const uint8_t *unused2,
int width, uint32_t *unused)
431 int16_t *dst = (int16_t *)_dst;
432 const uint16_t *
src = (
const uint16_t *)_src;
434 for (i = 0; i <
width; i++)
435 dst[i] =
AV_RB16(src + 4 * i + 3);
440 int16_t *dst = (int16_t *)_dst;
442 for (i=0; i<
width; i++) {
443 dst[
i]= src[4*
i]<<6 | src[4*
i]>>2;
449 int16_t *dst = (int16_t *)_dst;
451 for (i=0; i<
width; i++) {
452 dst[
i]= src[4*i+3]<<6 | src[4*i+3]>>2;
458 int16_t *dst = (int16_t *)_dst;
460 for (i=0; i<
width; i++) {
463 dst[
i]= (pal[d] >> 24)<<6 | pal[d]>>26;
469 int16_t *dst = (int16_t *)_dst;
471 for (i = 0; i <
width; i++) {
474 dst[
i] = (pal[d] & 0xFF)<<6;
480 int width, uint32_t *pal)
482 uint16_t *dstU = (uint16_t *)_dstU;
483 int16_t *dstV = (int16_t *)_dstV;
486 for (i = 0; i <
width; i++) {
487 int p = pal[src1[
i]];
496 int16_t *dst = (int16_t *)_dst;
498 width = (width + 7) >> 3;
499 for (i = 0; i <
width; i++) {
501 for (j = 0; j < 8; j++)
502 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
506 for (j = 0; j < (width&7); j++)
507 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
513 int16_t *dst = (int16_t *)_dst;
515 width = (width + 7) >> 3;
516 for (i = 0; i <
width; i++) {
518 for (j = 0; j < 8; j++)
519 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
523 for (j = 0; j < (width&7); j++)
524 dst[8*i+j] = ((d>>(7-j))&1) * 16383;
532 for (i = 0; i <
width; i++)
537 const uint8_t *src2,
int width, uint32_t *unused)
540 for (i = 0; i <
width; i++) {
541 dstU[
i] = src1[4 * i + 1];
542 dstV[
i] = src1[4 * i + 3];
548 const uint8_t *src2,
int width, uint32_t *unused)
551 for (i = 0; i <
width; i++) {
552 dstV[
i] = src1[4 * i + 1];
553 dstU[
i] = src1[4 * i + 3];
559 const uint8_t *unused1,
int width, uint32_t *unused2)
562 for (i = 0; i <
width; i++) {
569 const uint8_t *unused1,
int width, uint32_t *unused2)
572 for (i = 0; i <
width; i++)
580 const uint16_t *
src = (
const uint16_t *)_src;
581 uint16_t *dst = (uint16_t *)_dst;
582 for (i = 0; i <
width; i++)
587 const uint8_t *_src2,
int width, uint32_t *unused)
590 const uint16_t *
src1 = (
const uint16_t *)_src1,
591 *src2 = (
const uint16_t *)_src2;
592 uint16_t *dstU = (uint16_t *)_dstU, *dstV = (uint16_t *)
_dstV;
593 for (i = 0; i <
width; i++) {
603 for (i = 0; i <
width; i++)
611 for (i = 0; i <
width; i++)
619 for (i = 0; i <
width; i++)
627 for (i = 0; i <
width; i++)
635 for (i = 0; i <
width; i++)
641 const uint8_t *unused1,
int width, uint32_t *unused2)
644 for (i = 0; i <
width; i++) {
654 for (i = 0; i <
width; i++)
664 for (i = 0; i <
width; i++)
665 dst[i] = src[2 * i + 1];
669 const uint8_t *src2,
int width, uint32_t *unused)
672 for (i = 0; i <
width; i++) {
673 dstU[
i] = src1[4 * i + 0];
674 dstV[
i] = src1[4 * i + 2];
683 for (i = 0; i <
width; i++) {
684 dst1[
i] = src[2 * i + 0];
685 dst2[
i] = src[2 * i + 1];
691 int width, uint32_t *unused)
698 int width, uint32_t *unused)
704 const uint8_t *unused2,
int width, uint32_t *unused)
707 for (i = 0; i <
width; i++) {
713 const uint8_t *unused2,
int width, uint32_t *unused)
716 for (i = 0; i <
width; i++) {
723 int width, uint32_t *unused)
726 for (i = 0; i <
width; i++) {
734 int width, uint32_t *unused)
737 for (i = 0; i <
width; i++) {
745 int width, uint32_t *unused)
748 for (i = 0; i <
width; i++) {
756 int width, uint32_t *unused)
759 for (i = 0; i <
width; i++) {
765 #define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos)) 768 int width, uint32_t *rgb2yuv)
770 int16_t *dst = (int16_t *)_dst;
773 for (i = 0; i <
width; i++) {
774 int b = src[i * 3 + 0];
775 int g = src[i * 3 + 1];
776 int r = src[i * 3 + 2];
783 const uint8_t *src2,
int width, uint32_t *rgb2yuv)
785 int16_t *dstU = (int16_t *)_dstU;
786 int16_t *dstV = (int16_t *)_dstV;
790 for (i = 0; i <
width; i++) {
791 int b = src1[3 * i + 0];
792 int g = src1[3 * i + 1];
793 int r = src1[3 * i + 2];
802 const uint8_t *src2,
int width, uint32_t *rgb2yuv)
804 int16_t *dstU = (int16_t *)_dstU;
805 int16_t *dstV = (int16_t *)_dstV;
809 for (i = 0; i <
width; i++) {
810 int b = src1[6 * i + 0] + src1[6 * i + 3];
811 int g = src1[6 * i + 1] + src1[6 * i + 4];
812 int r = src1[6 * i + 2] + src1[6 * i + 5];
823 int16_t *dst = (int16_t *)_dst;
826 for (i = 0; i <
width; i++) {
827 int r = src[i * 3 + 0];
828 int g = src[i * 3 + 1];
829 int b = src[i * 3 + 2];
836 const uint8_t *src2,
int width, uint32_t *rgb2yuv)
838 int16_t *dstU = (int16_t *)_dstU;
839 int16_t *dstV = (int16_t *)_dstV;
844 for (i = 0; i <
width; i++) {
845 int r = src1[3 * i + 0];
846 int g = src1[3 * i + 1];
847 int b = src1[3 * i + 2];
855 const uint8_t *src2,
int width, uint32_t *rgb2yuv)
857 int16_t *dstU = (int16_t *)_dstU;
858 int16_t *dstV = (int16_t *)_dstV;
863 for (i = 0; i <
width; i++) {
864 int r = src1[6 * i + 0] + src1[6 * i + 3];
865 int g = src1[6 * i + 1] + src1[6 * i + 4];
866 int b = src1[6 * i + 2] + src1[6 * i + 5];
875 uint16_t *dst = (uint16_t *)_dst;
878 for (i = 0; i <
width; i++) {
889 uint16_t *dst = (uint16_t *)_dst;
891 for (i = 0; i <
width; i++)
892 dst[i] = src[3][i] << 6;
897 uint16_t *dstU = (uint16_t *)_dstU;
898 uint16_t *dstV = (uint16_t *)_dstV;
902 for (i = 0; i <
width; i++) {
913 is_be ? AV_RB16(src) : AV_RL16(src) 915 int width,
int bpc,
int is_be,
int32_t *rgb2yuv)
918 const uint16_t **
src = (
const uint16_t **)_src;
919 uint16_t *dst = (uint16_t *)_dst;
921 int shift = bpc < 16 ? bpc : 14;
922 for (i = 0; i <
width; i++) {
923 int g =
rdpx(src[0] + i);
924 int b =
rdpx(src[1] + i);
925 int r =
rdpx(src[2] + i);
932 int width,
int bpc,
int is_be,
int32_t *rgb2yuv)
935 const uint16_t **
src = (
const uint16_t **)_src;
936 uint16_t *dst = (uint16_t *)_dst;
937 int shift = bpc < 16 ? bpc : 14;
939 for (i = 0; i <
width; i++) {
945 const uint8_t *_src[4],
int width,
946 int bpc,
int is_be,
int32_t *rgb2yuv)
949 const uint16_t **
src = (
const uint16_t **)_src;
950 uint16_t *dstU = (uint16_t *)_dstU;
951 uint16_t *dstV = (uint16_t *)_dstV;
954 int shift = bpc < 16 ? bpc : 14;
955 for (i = 0; i <
width; i++) {
956 int g =
rdpx(src[0] + i);
957 int b =
rdpx(src[1] + i);
958 int r =
rdpx(src[2] + i);
966 #define rdpx(src) (is_be ? av_int2float(AV_RB32(src)): av_int2float(AV_RL32(src))) 971 const float **
src = (
const float **)_src;
972 uint16_t *dst = (uint16_t *)_dst;
974 for (i = 0; i <
width; i++) {
982 const float **
src = (
const float **)_src;
983 uint16_t *dstU = (uint16_t *)_dstU;
984 uint16_t *dstV = (uint16_t *)_dstV;
988 for (i = 0; i <
width; i++) {
1001 const float **
src = (
const float **)_src;
1002 uint16_t *dst = (uint16_t *)_dst;
1006 for (i = 0; i <
width; i++) {
1018 const uint8_t *unused2,
int width, uint32_t *unused)
1021 const float *
src = (
const float *)_src;
1022 uint16_t *dst = (uint16_t *)_dst;
1024 for (i = 0; i <
width; ++
i){
1030 const uint8_t *unused2,
int width, uint32_t *unused)
1033 const uint32_t *
src = (
const uint32_t *)_src;
1034 uint16_t *dst = (uint16_t *)_dst;
1036 for (i = 0; i <
width; ++
i){
1041 #define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \ 1042 static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \ 1043 int w, int32_t *rgb2yuv) \ 1045 planar_rgb16_to_y(dst, src, w, nbits, endian, rgb2yuv); \ 1047 static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \ 1048 const uint8_t *src[4], int w, int32_t *rgb2yuv) \ 1050 planar_rgb16_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \ 1053 #define rgb9plus_planar_transparency_funcs(nbits) \ 1054 static void planar_rgb##nbits##le_to_a(uint8_t *dst, const uint8_t *src[4], \ 1055 int w, int32_t *rgb2yuv) \ 1057 planar_rgb16_to_a(dst, src, w, nbits, 0, rgb2yuv); \ 1059 static void planar_rgb##nbits##be_to_a(uint8_t *dst, const uint8_t *src[4], \ 1060 int w, int32_t *rgb2yuv) \ 1062 planar_rgb16_to_a(dst, src, w, nbits, 1, rgb2yuv); \ 1065 #define rgb9plus_planar_funcs(nbits) \ 1066 rgb9plus_planar_funcs_endian(nbits, le, 0) \ 1067 rgb9plus_planar_funcs_endian(nbits, be, 1) 1079 #define rgbf32_planar_funcs_endian(endian_name, endian) \ 1080 static void planar_rgbf32##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \ 1081 int w, int32_t *rgb2yuv) \ 1083 planar_rgbf32_to_y(dst, src, w, endian, rgb2yuv); \ 1085 static void planar_rgbf32##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \ 1086 const uint8_t *src[4], int w, int32_t *rgb2yuv) \ 1088 planar_rgbf32_to_uv(dstU, dstV, src, w, endian, rgb2yuv); \ 1090 static void planar_rgbf32##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \ 1091 int w, int32_t *rgb2yuv) \ 1093 planar_rgbf32_to_a(dst, src, w, endian, rgb2yuv); \ 1103 c->chrToYV12 =
NULL;
1104 switch (srcFormat) {
1130 c->readChrPlanar = planar_rgb9le_to_uv;
1134 c->readChrPlanar = planar_rgb10le_to_uv;
1138 c->readChrPlanar = planar_rgb12le_to_uv;
1141 c->readChrPlanar = planar_rgb14le_to_uv;
1145 c->readChrPlanar = planar_rgb16le_to_uv;
1149 c->readChrPlanar = planar_rgbf32le_to_uv;
1152 c->readChrPlanar = planar_rgb9be_to_uv;
1156 c->readChrPlanar = planar_rgb10be_to_uv;
1160 c->readChrPlanar = planar_rgb12be_to_uv;
1163 c->readChrPlanar = planar_rgb14be_to_uv;
1167 c->readChrPlanar = planar_rgb16be_to_uv;
1171 c->readChrPlanar = planar_rgbf32be_to_uv;
1261 if (c->chrSrcHSubSample) {
1262 switch (srcFormat) {
1264 c->chrToYV12 = rgb64BEToUV_half_c;
1267 c->chrToYV12 = rgb64LEToUV_half_c;
1270 c->chrToYV12 = bgr64BEToUV_half_c;
1273 c->chrToYV12 = bgr64LEToUV_half_c;
1276 c->chrToYV12 = rgb48BEToUV_half_c;
1279 c->chrToYV12 = rgb48LEToUV_half_c;
1282 c->chrToYV12 = bgr48BEToUV_half_c;
1285 c->chrToYV12 = bgr48LEToUV_half_c;
1287 case AV_PIX_FMT_RGB32:
1288 c->chrToYV12 = bgr32ToUV_half_c;
1290 case AV_PIX_FMT_RGB32_1:
1291 c->chrToYV12 = bgr321ToUV_half_c;
1296 case AV_PIX_FMT_BGR565LE:
1297 c->chrToYV12 = bgr16leToUV_half_c;
1299 case AV_PIX_FMT_BGR565BE:
1300 c->chrToYV12 = bgr16beToUV_half_c;
1302 case AV_PIX_FMT_BGR555LE:
1303 c->chrToYV12 = bgr15leToUV_half_c;
1305 case AV_PIX_FMT_BGR555BE:
1306 c->chrToYV12 = bgr15beToUV_half_c;
1310 c->chrToYV12 = gbr24pToUV_half_c;
1312 case AV_PIX_FMT_BGR444LE:
1313 c->chrToYV12 = bgr12leToUV_half_c;
1315 case AV_PIX_FMT_BGR444BE:
1316 c->chrToYV12 = bgr12beToUV_half_c;
1319 c->chrToYV12 = rgb32ToUV_half_c;
1321 case AV_PIX_FMT_BGR32_1:
1322 c->chrToYV12 = rgb321ToUV_half_c;
1327 case AV_PIX_FMT_RGB565LE:
1328 c->chrToYV12 = rgb16leToUV_half_c;
1330 case AV_PIX_FMT_RGB565BE:
1331 c->chrToYV12 = rgb16beToUV_half_c;
1333 case AV_PIX_FMT_RGB555LE:
1334 c->chrToYV12 = rgb15leToUV_half_c;
1336 case AV_PIX_FMT_RGB555BE:
1337 c->chrToYV12 = rgb15beToUV_half_c;
1339 case AV_PIX_FMT_RGB444LE:
1340 c->chrToYV12 = rgb12leToUV_half_c;
1342 case AV_PIX_FMT_RGB444BE:
1343 c->chrToYV12 = rgb12beToUV_half_c;
1345 case AV_PIX_FMT_X2RGB10LE:
1346 c->chrToYV12 = rgb30leToUV_half_c;
1350 switch (srcFormat) {
1352 c->chrToYV12 = rgb64BEToUV_c;
1355 c->chrToYV12 = rgb64LEToUV_c;
1358 c->chrToYV12 = bgr64BEToUV_c;
1361 c->chrToYV12 = bgr64LEToUV_c;
1364 c->chrToYV12 = rgb48BEToUV_c;
1367 c->chrToYV12 = rgb48LEToUV_c;
1370 c->chrToYV12 = bgr48BEToUV_c;
1373 c->chrToYV12 = bgr48LEToUV_c;
1375 case AV_PIX_FMT_RGB32:
1376 c->chrToYV12 = bgr32ToUV_c;
1378 case AV_PIX_FMT_RGB32_1:
1379 c->chrToYV12 = bgr321ToUV_c;
1384 case AV_PIX_FMT_BGR565LE:
1385 c->chrToYV12 = bgr16leToUV_c;
1387 case AV_PIX_FMT_BGR565BE:
1388 c->chrToYV12 = bgr16beToUV_c;
1390 case AV_PIX_FMT_BGR555LE:
1391 c->chrToYV12 = bgr15leToUV_c;
1393 case AV_PIX_FMT_BGR555BE:
1394 c->chrToYV12 = bgr15beToUV_c;
1396 case AV_PIX_FMT_BGR444LE:
1397 c->chrToYV12 = bgr12leToUV_c;
1399 case AV_PIX_FMT_BGR444BE:
1400 c->chrToYV12 = bgr12beToUV_c;
1403 c->chrToYV12 = rgb32ToUV_c;
1405 case AV_PIX_FMT_BGR32_1:
1406 c->chrToYV12 = rgb321ToUV_c;
1411 case AV_PIX_FMT_RGB565LE:
1412 c->chrToYV12 = rgb16leToUV_c;
1414 case AV_PIX_FMT_RGB565BE:
1415 c->chrToYV12 = rgb16beToUV_c;
1417 case AV_PIX_FMT_RGB555LE:
1418 c->chrToYV12 = rgb15leToUV_c;
1420 case AV_PIX_FMT_RGB555BE:
1421 c->chrToYV12 = rgb15beToUV_c;
1423 case AV_PIX_FMT_RGB444LE:
1424 c->chrToYV12 = rgb12leToUV_c;
1426 case AV_PIX_FMT_RGB444BE:
1427 c->chrToYV12 = rgb12beToUV_c;
1429 case AV_PIX_FMT_X2RGB10LE:
1430 c->chrToYV12 = rgb30leToUV_c;
1435 c->lumToYV12 =
NULL;
1436 c->alpToYV12 =
NULL;
1437 switch (srcFormat) {
1439 c->readLumPlanar = planar_rgb9le_to_y;
1442 c->readAlpPlanar = planar_rgb10le_to_a;
1444 c->readLumPlanar = planar_rgb10le_to_y;
1447 c->readAlpPlanar = planar_rgb12le_to_a;
1449 c->readLumPlanar = planar_rgb12le_to_y;
1452 c->readLumPlanar = planar_rgb14le_to_y;
1455 c->readAlpPlanar = planar_rgb16le_to_a;
1457 c->readLumPlanar = planar_rgb16le_to_y;
1460 c->readAlpPlanar = planar_rgbf32le_to_a;
1462 c->readLumPlanar = planar_rgbf32le_to_y;
1465 c->readLumPlanar = planar_rgb9be_to_y;
1468 c->readAlpPlanar = planar_rgb10be_to_a;
1470 c->readLumPlanar = planar_rgb10be_to_y;
1473 c->readAlpPlanar = planar_rgb12be_to_a;
1475 c->readLumPlanar = planar_rgb12be_to_y;
1478 c->readLumPlanar = planar_rgb14be_to_y;
1481 c->readAlpPlanar = planar_rgb16be_to_a;
1483 c->readLumPlanar = planar_rgb16be_to_y;
1486 c->readAlpPlanar = planar_rgbf32be_to_a;
1488 c->readLumPlanar = planar_rgbf32be_to_y;
1600 case AV_PIX_FMT_BGR565LE:
1601 c->lumToYV12 = bgr16leToY_c;
1603 case AV_PIX_FMT_BGR565BE:
1604 c->lumToYV12 = bgr16beToY_c;
1606 case AV_PIX_FMT_BGR555LE:
1607 c->lumToYV12 = bgr15leToY_c;
1609 case AV_PIX_FMT_BGR555BE:
1610 c->lumToYV12 = bgr15beToY_c;
1612 case AV_PIX_FMT_BGR444LE:
1613 c->lumToYV12 = bgr12leToY_c;
1615 case AV_PIX_FMT_BGR444BE:
1616 c->lumToYV12 = bgr12beToY_c;
1621 case AV_PIX_FMT_RGB565LE:
1622 c->lumToYV12 = rgb16leToY_c;
1624 case AV_PIX_FMT_RGB565BE:
1625 c->lumToYV12 = rgb16beToY_c;
1627 case AV_PIX_FMT_RGB555LE:
1628 c->lumToYV12 = rgb15leToY_c;
1630 case AV_PIX_FMT_RGB555BE:
1631 c->lumToYV12 = rgb15beToY_c;
1633 case AV_PIX_FMT_RGB444LE:
1634 c->lumToYV12 = rgb12leToY_c;
1636 case AV_PIX_FMT_RGB444BE:
1637 c->lumToYV12 = rgb12beToY_c;
1652 case AV_PIX_FMT_RGB32:
1653 c->lumToYV12 = bgr32ToY_c;
1655 case AV_PIX_FMT_RGB32_1:
1656 c->lumToYV12 = bgr321ToY_c;
1659 c->lumToYV12 = rgb32ToY_c;
1661 case AV_PIX_FMT_BGR32_1:
1662 c->lumToYV12 = rgb321ToY_c;
1665 c->lumToYV12 = rgb48BEToY_c;
1668 c->lumToYV12 = rgb48LEToY_c;
1671 c->lumToYV12 = bgr48BEToY_c;
1674 c->lumToYV12 = bgr48LEToY_c;
1677 c->lumToYV12 = rgb64BEToY_c;
1680 c->lumToYV12 = rgb64LEToY_c;
1683 c->lumToYV12 = bgr64BEToY_c;
1686 c->lumToYV12 = bgr64LEToY_c;
1711 case AV_PIX_FMT_X2RGB10LE:
1712 c->lumToYV12 =rgb30leToY_c;
1717 if (HAVE_BIGENDIAN == !
isBE(srcFormat) && !c->readAlpPlanar)
1720 switch (srcFormat) {
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
IEEE-754 single precision Y, 32bpp, big-endian.
packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian
planar GBR 4:4:4:4 40bpp, little-endian
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
static int shift(int a, int b)
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
8 bits gray, 8 bits alpha
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian ...
packed RGB 8:8:8, 24bpp, RGBRGB...
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined ...
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
Convenience header that includes libavutil's core.
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
planar GBR 4:4:4 36bpp, little-endian
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
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
Y , 12bpp, little-endian.
planar GBR 4:4:4 36bpp, big-endian
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
void ff_sws_init_input_funcs(SwsContext *c)
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian ...
planar GBRA 4:4:4:4 64bpp, big-endian
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, little-endian ...
8 bits with AV_PIX_FMT_RGB32 palette
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
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
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined ...
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
#define u(width, name, range_min, range_max)
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
planar GBR 4:4:4 48bpp, big-endian
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Y , 10bpp, little-endian.
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
planar GBR 4:4:4 27bpp, big-endian
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
#define AV_PIX_FMT_BGR32_1
16 bits gray, 16 bits alpha (big-endian)
like NV12, with 16bpp per component, big-endian
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
simple assert() macros that are a bit more flexible than ISO C assert().
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
like NV12, with 16bpp per component, little-endian
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
as above, but U and V bytes are swapped
planar GBR 4:4:4:4 48bpp, big-endian
planar GBR 4:4:4:4 40bpp, big-endian
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
packed RGB 8:8:8, 24bpp, BGRBGR...
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined ...
planar GBR 4:4:4:4 48bpp, little-endian
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
planar GBR 4:4:4 30bpp, big-endian
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
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
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
planar GBR 4:4:4 42bpp, little-endian
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
as above, but U and V bytes are swapped
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian ...
planar GBR 4:4:4 42bpp, big-endian
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined ...
Y , 14bpp, little-endian.
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
planar GBRA 4:4:4:4 32bpp
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
planar GBR 4:4:4 27bpp, little-endian
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
#define AV_PIX_FMT_RGB32_1
Y , 16bpp, little-endian.
16 bits gray, 16 bits alpha (little-endian)
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
planar GBR 4:4:4 48bpp, little-endian
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined ...
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
IEEE-754 single precision Y, 32bpp, little-endian.
planar GBRA 4:4:4:4 64bpp, little-endian
AVPixelFormat
Pixel format.
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
planar GBR 4:4:4 30bpp, little-endian
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, big-endian ...
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian