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 : (isBE(origin) ? AV_RB16(&src[(i) * 2]) \
250 : AV_RL16(&src[(i) * 2])))
258 int maskr,
int maskg,
260 int gsh,
int bsh,
int S,
263 const int ry = rgb2yuv[
RY_IDX]<<rsh, gy = rgb2yuv[
GY_IDX]<<gsh, by = rgb2yuv[
BY_IDX]<<bsh;
264 const unsigned rnd = (32<<((
S)-1)) + (1<<(S-7));
267 for (i = 0; i <
width; i++) {
269 int b = (px & maskb) >> shb;
270 int g = (px & maskg) >> shg;
271 int r = (px & maskr) >> shr;
273 dst[i] = (ry * r + gy * g + by * b +
rnd) >> ((S)-6);
284 int maskr,
int maskg,
286 int gsh,
int bsh,
int S,
289 const int ru = rgb2yuv[
RU_IDX] << rsh, gu = rgb2yuv[
GU_IDX] << gsh, bu = rgb2yuv[
BU_IDX] << bsh,
290 rv = rgb2yuv[
RV_IDX] << rsh, gv = rgb2yuv[
GV_IDX] << gsh, bv = rgb2yuv[
BV_IDX] << bsh;
291 const unsigned rnd = (256
u<<((
S)-1)) + (1<<(S-7));
294 for (i = 0; i <
width; i++) {
296 int b = (px & maskb) >> shb;
297 int g = (px & maskg) >> shg;
298 int r = (px & maskr) >> shr;
300 dstU[i] = (ru * r + gu * g + bu * b +
rnd) >> ((S)-6);
301 dstV[i] = (rv * r + gv * g + bv * b +
rnd) >> ((S)-6);
312 int maskr,
int maskg,
314 int gsh,
int bsh,
int S,
317 const int ru = rgb2yuv[
RU_IDX] << rsh, gu = rgb2yuv[
GU_IDX] << gsh, bu = rgb2yuv[
BU_IDX] << bsh,
318 rv = rgb2yuv[
RV_IDX] << rsh, gv = rgb2yuv[
GV_IDX] << gsh, bv = rgb2yuv[
BV_IDX] << bsh,
319 maskgx = ~(maskr | maskb);
320 const unsigned rnd = (256
U<<(
S)) + (1<<(S-6));
326 for (i = 0; i <
width; i++) {
329 int b,
r,
g = (px0 & maskgx) + (px1 & maskgx);
330 int rb = px0 + px1 -
g;
332 b = (rb & maskb) >> shb;
338 g = (g & maskg) >> shg;
340 r = (rb & maskr) >> shr;
342 dstU[i] = (ru * r + gu * g + bu * b + (unsigned)rnd) >> ((
S)-6+1);
343 dstV[i] = (rv * r + gv * g + bv * b + (unsigned)rnd) >> ((
S)-6+1);
349 #define rgb16_32_wrapper(fmt, name, shr, shg, shb, shp, maskr, \
350 maskg, maskb, rsh, gsh, bsh, S) \
351 static void name ## ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, \
352 int width, uint32_t *tab) \
354 rgb16_32ToY_c_template((int16_t*)dst, src, width, fmt, shr, shg, shb, shp, \
355 maskr, maskg, maskb, rsh, gsh, bsh, S, tab); \
358 static void name ## ToUV_c(uint8_t *dstU, uint8_t *dstV, \
359 const uint8_t *unused0, const uint8_t *src, const uint8_t *dummy, \
360 int width, uint32_t *tab) \
362 rgb16_32ToUV_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
363 shr, shg, shb, shp, \
364 maskr, maskg, maskb, rsh, gsh, bsh, S, tab);\
367 static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \
368 const uint8_t *unused0, const uint8_t *src, \
369 const uint8_t *dummy, \
370 int width, uint32_t *tab) \
372 rgb16_32ToUV_half_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
373 shr, shg, shb, shp, \
374 maskr, maskg, maskb, \
375 rsh, gsh, bsh, S, tab); \
378 rgb16_32_wrapper(
AV_PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8,
RGB2YUV_SHIFT + 8)
379 rgb16_32_wrapper(
AV_PIX_FMT_BGR32_1,
bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8,
RGB2YUV_SHIFT + 8)
380 rgb16_32_wrapper(
AV_PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8,
RGB2YUV_SHIFT + 8)
381 rgb16_32_wrapper(
AV_PIX_FMT_RGB32_1,
rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8,
RGB2YUV_SHIFT + 8)
382 rgb16_32_wrapper(
AV_PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0,
RGB2YUV_SHIFT + 8)
383 rgb16_32_wrapper(
AV_PIX_FMT_BGR555LE,
bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0,
RGB2YUV_SHIFT + 7)
384 rgb16_32_wrapper(
AV_PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0,
RGB2YUV_SHIFT + 4)
385 rgb16_32_wrapper(
AV_PIX_FMT_RGB565LE,
rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11,
RGB2YUV_SHIFT + 8)
386 rgb16_32_wrapper(
AV_PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10,
RGB2YUV_SHIFT + 7)
387 rgb16_32_wrapper(
AV_PIX_FMT_RGB444LE,
rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8,
RGB2YUV_SHIFT + 4)
388 rgb16_32_wrapper(
AV_PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0,
RGB2YUV_SHIFT + 8)
389 rgb16_32_wrapper(
AV_PIX_FMT_BGR555BE,
bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0,
RGB2YUV_SHIFT + 7)
390 rgb16_32_wrapper(
AV_PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0,
RGB2YUV_SHIFT + 4)
391 rgb16_32_wrapper(
AV_PIX_FMT_RGB565BE,
rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11,
RGB2YUV_SHIFT + 8)
392 rgb16_32_wrapper(
AV_PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10,
RGB2YUV_SHIFT + 7)
393 rgb16_32_wrapper(
AV_PIX_FMT_RGB444BE,
rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8,
RGB2YUV_SHIFT + 4)
399 uint16_t *dstU = (uint16_t *)_dstU;
400 uint16_t *dstV = (uint16_t *)_dstV;
405 for (i = 0; i <
width; i++) {
406 unsigned int g = gsrc[2*i] + gsrc[2*i+1];
407 unsigned int b = bsrc[2*i] + bsrc[2*i+1];
408 unsigned int r = rsrc[2*i] + rsrc[2*i+1];
418 int16_t *dst = (int16_t *)_dst;
419 const uint16_t *
src = (
const uint16_t *)_src;
421 for (i = 0; i <
width; i++)
422 dst[i] =
AV_RL16(src + 4 * i + 3);
428 int16_t *dst = (int16_t *)_dst;
429 const uint16_t *
src = (
const uint16_t *)_src;
431 for (i = 0; i <
width; i++)
432 dst[i] =
AV_RB16(src + 4 * i + 3);
437 int16_t *dst = (int16_t *)_dst;
439 for (i=0; i<
width; i++) {
446 int16_t *dst = (int16_t *)_dst;
448 for (i=0; i<
width; i++) {
449 dst[i]= src[4*i+3]<<6;
455 int16_t *dst = (int16_t *)_dst;
457 for (i=0; i<
width; i++) {
460 dst[i]= (pal[d] >> 24)<<6;
466 int16_t *dst = (int16_t *)_dst;
468 for (i = 0; i <
width; i++) {
471 dst[i] = (pal[d] & 0xFF)<<6;
477 int width, uint32_t *pal)
479 uint16_t *dstU = (uint16_t *)_dstU;
480 int16_t *dstV = (int16_t *)_dstV;
483 for (i = 0; i <
width; i++) {
484 int p = pal[src1[i]];
493 int16_t *dst = (int16_t *)_dst;
495 width = (width + 7) >> 3;
496 for (i = 0; i <
width; i++) {
498 for (j = 0; j < 8; j++)
499 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
503 for (j = 0; j < (width&7); j++)
504 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
510 int16_t *dst = (int16_t *)_dst;
512 width = (width + 7) >> 3;
513 for (i = 0; i <
width; i++) {
515 for (j = 0; j < 8; j++)
516 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
520 for (j = 0; j < (width&7); j++)
521 dst[8*i+j] = ((d>>(7-j))&1) * 16383;
529 for (i = 0; i <
width; i++)
537 for (i = 0; i <
width; i++) {
538 dstU[i] = src1[4 * i + 1];
539 dstV[i] = src1[4 * i + 3];
548 for (i = 0; i <
width; i++) {
549 dstV[i] = src1[4 * i + 1];
550 dstU[i] = src1[4 * i + 3];
559 const uint16_t *
src = (
const uint16_t *)_src;
560 uint16_t *dst = (uint16_t *)_dst;
561 for (i = 0; i <
width; i++)
569 const uint16_t *
src1 = (
const uint16_t *)_src1,
570 *src2 = (
const uint16_t *)_src2;
571 uint16_t *dstU = (uint16_t *)_dstU, *dstV = (uint16_t *)_dstV;
572 for (i = 0; i <
width; i++) {
582 for (i = 0; i <
width; i++)
590 for (i = 0; i <
width; i++)
598 for (i = 0; i <
width; i++)
606 for (i = 0; i <
width; i++)
614 for (i = 0; i <
width; i++)
623 for (i = 0; i <
width; i++) {
633 for (i = 0; i <
width; i++)
643 for (i = 0; i <
width; i++)
644 dst[i] = src[2 * i + 1];
651 for (i = 0; i <
width; i++) {
652 dstU[i] = src1[4 * i + 0];
653 dstV[i] = src1[4 * i + 2];
662 for (i = 0; i <
width; i++) {
663 dst1[i] = src[2 * i + 0];
664 dst2[i] = src[2 * i + 1];
670 int width, uint32_t *unused)
677 int width, uint32_t *unused)
682 #define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))
687 int16_t *dst = (int16_t *)_dst;
690 for (i = 0; i <
width; i++) {
691 int b = src[i * 3 + 0];
692 int g = src[i * 3 + 1];
693 int r = src[i * 3 + 2];
702 int16_t *dstU = (int16_t *)_dstU;
703 int16_t *dstV = (int16_t *)_dstV;
707 for (i = 0; i <
width; i++) {
708 int b = src1[3 * i + 0];
709 int g = src1[3 * i + 1];
710 int r = src1[3 * i + 2];
721 int16_t *dstU = (int16_t *)_dstU;
722 int16_t *dstV = (int16_t *)_dstV;
726 for (i = 0; i <
width; i++) {
727 int b = src1[6 * i + 0] + src1[6 * i + 3];
728 int g = src1[6 * i + 1] + src1[6 * i + 4];
729 int r = src1[6 * i + 2] + src1[6 * i + 5];
740 int16_t *dst = (int16_t *)_dst;
743 for (i = 0; i <
width; i++) {
744 int r = src[i * 3 + 0];
745 int g = src[i * 3 + 1];
746 int b = src[i * 3 + 2];
755 int16_t *dstU = (int16_t *)_dstU;
756 int16_t *dstV = (int16_t *)_dstV;
761 for (i = 0; i <
width; i++) {
762 int r = src1[3 * i + 0];
763 int g = src1[3 * i + 1];
764 int b = src1[3 * i + 2];
774 int16_t *dstU = (int16_t *)_dstU;
775 int16_t *dstV = (int16_t *)_dstV;
780 for (i = 0; i <
width; i++) {
781 int r = src1[6 * i + 0] + src1[6 * i + 3];
782 int g = src1[6 * i + 1] + src1[6 * i + 4];
783 int b = src1[6 * i + 2] + src1[6 * i + 5];
792 uint16_t *dst = (uint16_t *)_dst;
795 for (i = 0; i <
width; i++) {
806 uint16_t *dst = (uint16_t *)_dst;
808 for (i = 0; i <
width; i++)
809 dst[i] = src[3][i] << 6;
814 uint16_t *dstU = (uint16_t *)_dstU;
815 uint16_t *dstV = (uint16_t *)_dstV;
819 for (i = 0; i <
width; i++) {
830 is_be ? AV_RB16(src) : AV_RL16(src)
835 const uint16_t **
src = (
const uint16_t **)_src;
836 uint16_t *dst = (uint16_t *)_dst;
838 int shift = bpc < 16 ? bpc : 14;
839 for (i = 0; i <
width; i++) {
840 int g =
rdpx(src[0] + i);
841 int b =
rdpx(src[1] + i);
842 int r =
rdpx(src[2] + i);
853 const uint16_t **
src = (
const uint16_t **)_src;
854 uint16_t *dstU = (uint16_t *)_dstU;
855 uint16_t *dstV = (uint16_t *)_dstV;
858 int shift = bpc < 16 ? bpc : 14;
859 for (i = 0; i <
width; i++) {
860 int g =
rdpx(src[0] + i);
861 int b =
rdpx(src[1] + i);
862 int r =
rdpx(src[2] + i);
870 #define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \
871 static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
872 int w, int32_t *rgb2yuv) \
874 planar_rgb16_to_y(dst, src, w, nbits, endian, rgb2yuv); \
876 static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
877 const uint8_t *src[4], int w, int32_t *rgb2yuv) \
879 planar_rgb16_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \
882 #define rgb9plus_planar_funcs(nbits) \
883 rgb9plus_planar_funcs_endian(nbits, le, 0) \
884 rgb9plus_planar_funcs_endian(nbits, be, 1)
921 c->readChrPlanar = planar_rgb9le_to_uv;
924 c->readChrPlanar = planar_rgb10le_to_uv;
927 c->readChrPlanar = planar_rgb12le_to_uv;
930 c->readChrPlanar = planar_rgb14le_to_uv;
934 c->readChrPlanar = planar_rgb16le_to_uv;
937 c->readChrPlanar = planar_rgb9be_to_uv;
940 c->readChrPlanar = planar_rgb10be_to_uv;
943 c->readChrPlanar = planar_rgb12be_to_uv;
946 c->readChrPlanar = planar_rgb14be_to_uv;
950 c->readChrPlanar = planar_rgb16be_to_uv;
1021 if (c->chrSrcHSubSample) {
1022 switch (srcFormat) {
1024 c->chrToYV12 = rgb64BEToUV_half_c;
1027 c->chrToYV12 = rgb64LEToUV_half_c;
1030 c->chrToYV12 = bgr64BEToUV_half_c;
1033 c->chrToYV12 = bgr64LEToUV_half_c;
1036 c->chrToYV12 = rgb48BEToUV_half_c;
1039 c->chrToYV12 = rgb48LEToUV_half_c;
1042 c->chrToYV12 = bgr48BEToUV_half_c;
1045 c->chrToYV12 = bgr48LEToUV_half_c;
1048 c->chrToYV12 = bgr32ToUV_half_c;
1051 c->chrToYV12 = bgr321ToUV_half_c;
1057 c->chrToYV12 = bgr16leToUV_half_c;
1060 c->chrToYV12 = bgr16beToUV_half_c;
1063 c->chrToYV12 = bgr15leToUV_half_c;
1066 c->chrToYV12 = bgr15beToUV_half_c;
1073 c->chrToYV12 = bgr12leToUV_half_c;
1076 c->chrToYV12 = bgr12beToUV_half_c;
1079 c->chrToYV12 = rgb32ToUV_half_c;
1082 c->chrToYV12 = rgb321ToUV_half_c;
1088 c->chrToYV12 = rgb16leToUV_half_c;
1091 c->chrToYV12 = rgb16beToUV_half_c;
1094 c->chrToYV12 = rgb15leToUV_half_c;
1097 c->chrToYV12 = rgb15beToUV_half_c;
1100 c->chrToYV12 = rgb12leToUV_half_c;
1103 c->chrToYV12 = rgb12beToUV_half_c;
1107 switch (srcFormat) {
1109 c->chrToYV12 = rgb64BEToUV_c;
1112 c->chrToYV12 = rgb64LEToUV_c;
1115 c->chrToYV12 = bgr64BEToUV_c;
1118 c->chrToYV12 = bgr64LEToUV_c;
1121 c->chrToYV12 = rgb48BEToUV_c;
1124 c->chrToYV12 = rgb48LEToUV_c;
1127 c->chrToYV12 = bgr48BEToUV_c;
1130 c->chrToYV12 = bgr48LEToUV_c;
1133 c->chrToYV12 = bgr32ToUV_c;
1136 c->chrToYV12 = bgr321ToUV_c;
1142 c->chrToYV12 = bgr16leToUV_c;
1145 c->chrToYV12 = bgr16beToUV_c;
1148 c->chrToYV12 = bgr15leToUV_c;
1151 c->chrToYV12 = bgr15beToUV_c;
1154 c->chrToYV12 = bgr12leToUV_c;
1157 c->chrToYV12 = bgr12beToUV_c;
1160 c->chrToYV12 = rgb32ToUV_c;
1163 c->chrToYV12 = rgb321ToUV_c;
1169 c->chrToYV12 = rgb16leToUV_c;
1172 c->chrToYV12 = rgb16beToUV_c;
1175 c->chrToYV12 = rgb15leToUV_c;
1178 c->chrToYV12 = rgb15beToUV_c;
1181 c->chrToYV12 = rgb12leToUV_c;
1184 c->chrToYV12 = rgb12beToUV_c;
1189 c->lumToYV12 =
NULL;
1190 c->alpToYV12 =
NULL;
1191 switch (srcFormat) {
1193 c->readLumPlanar = planar_rgb9le_to_y;
1196 c->readLumPlanar = planar_rgb10le_to_y;
1199 c->readLumPlanar = planar_rgb12le_to_y;
1202 c->readLumPlanar = planar_rgb14le_to_y;
1206 c->readLumPlanar = planar_rgb16le_to_y;
1209 c->readLumPlanar = planar_rgb9be_to_y;
1212 c->readLumPlanar = planar_rgb10be_to_y;
1215 c->readLumPlanar = planar_rgb12be_to_y;
1218 c->readLumPlanar = planar_rgb14be_to_y;
1222 c->readLumPlanar = planar_rgb16be_to_y;
1319 c->lumToYV12 = bgr16leToY_c;
1322 c->lumToYV12 = bgr16beToY_c;
1325 c->lumToYV12 = bgr15leToY_c;
1328 c->lumToYV12 = bgr15beToY_c;
1331 c->lumToYV12 = bgr12leToY_c;
1334 c->lumToYV12 = bgr12beToY_c;
1340 c->lumToYV12 = rgb16leToY_c;
1343 c->lumToYV12 = rgb16beToY_c;
1346 c->lumToYV12 = rgb15leToY_c;
1349 c->lumToYV12 = rgb15beToY_c;
1352 c->lumToYV12 = rgb12leToY_c;
1355 c->lumToYV12 = rgb12beToY_c;
1371 c->lumToYV12 = bgr32ToY_c;
1374 c->lumToYV12 = bgr321ToY_c;
1377 c->lumToYV12 = rgb32ToY_c;
1380 c->lumToYV12 = rgb321ToY_c;
1383 c->lumToYV12 = rgb48BEToY_c;
1386 c->lumToYV12 = rgb48LEToY_c;
1389 c->lumToYV12 = bgr48BEToY_c;
1392 c->lumToYV12 = bgr48LEToY_c;
1395 c->lumToYV12 = rgb64BEToY_c;
1398 c->lumToYV12 = rgb64LEToY_c;
1401 c->lumToYV12 = bgr64BEToY_c;
1404 c->lumToYV12 = bgr64LEToY_c;
1408 if (HAVE_BIGENDIAN == !
isBE(srcFormat))
1411 switch (srcFormat) {
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
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
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
packed RGB 8:8:8, 24bpp, RGBRGB...
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
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)
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
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)
8 bit 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...
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
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)
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
16bit gray, 16bit alpha (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
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), 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)
as above, but U and V bytes are swapped
#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
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
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)
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)
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), 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 ...
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
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)
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.
16bit gray, 16bit 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
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
static av_always_inline uint32_t rgb2yuv(const uint32_t *r2y, uint32_t c)
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
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, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian