40 { 1, 3, 1, 3, 1, 3, 1, 3, },
41 { 2, 0, 2, 0, 2, 0, 2, 0, },
42 { 1, 3, 1, 3, 1, 3, 1, 3, },
46 { 6, 2, 6, 2, 6, 2, 6, 2, },
47 { 0, 4, 0, 4, 0, 4, 0, 4, },
48 { 6, 2, 6, 2, 6, 2, 6, 2, },
52 { 8, 4, 11, 7, 8, 4, 11, 7, },
53 { 2, 14, 1, 13, 2, 14, 1, 13, },
54 { 10, 6, 9, 5, 10, 6, 9, 5, },
55 { 0, 12, 3, 15, 0, 12, 3, 15, },
56 { 8, 4, 11, 7, 8, 4, 11, 7, },
60 { 17, 9, 23, 15, 16, 8, 22, 14, },
61 { 5, 29, 3, 27, 4, 28, 2, 26, },
62 { 21, 13, 19, 11, 20, 12, 18, 10, },
63 { 0, 24, 6, 30, 1, 25, 7, 31, },
64 { 16, 8, 22, 14, 17, 9, 23, 15, },
65 { 4, 28, 2, 26, 5, 29, 3, 27, },
66 { 20, 12, 18, 10, 21, 13, 19, 11, },
67 { 1, 25, 7, 31, 0, 24, 6, 30, },
68 { 17, 9, 23, 15, 16, 8, 22, 14, },
72 { 0, 55, 14, 68, 3, 58, 17, 72, },
73 { 37, 18, 50, 32, 40, 22, 54, 35, },
74 { 9, 64, 5, 59, 13, 67, 8, 63, },
75 { 46, 27, 41, 23, 49, 31, 44, 26, },
76 { 2, 57, 16, 71, 1, 56, 15, 70, },
77 { 39, 21, 52, 34, 38, 19, 51, 33, },
78 { 11, 66, 7, 62, 10, 65, 6, 60, },
79 { 48, 30, 43, 25, 47, 29, 42, 24, },
80 { 0, 55, 14, 68, 3, 58, 17, 72, },
85 {117, 62, 158, 103, 113, 58, 155, 100, },
86 { 34, 199, 21, 186, 31, 196, 17, 182, },
87 {144, 89, 131, 76, 141, 86, 127, 72, },
88 { 0, 165, 41, 206, 10, 175, 52, 217, },
89 {110, 55, 151, 96, 120, 65, 162, 107, },
90 { 28, 193, 14, 179, 38, 203, 24, 189, },
91 {138, 83, 124, 69, 148, 93, 134, 79, },
92 { 7, 172, 48, 213, 3, 168, 45, 210, },
93 {117, 62, 158, 103, 113, 58, 155, 100, },
98 { 0, 143, 18, 200, 2, 156, 25, 215, },
99 { 78, 28, 125, 64, 89, 36, 138, 74, },
100 { 10, 180, 3, 161, 16, 195, 8, 175, },
101 {109, 51, 93, 38, 121, 60, 105, 47, },
102 { 1, 152, 23, 210, 0, 147, 20, 205, },
103 { 85, 33, 134, 71, 81, 30, 130, 67, },
104 { 14, 190, 6, 171, 12, 185, 5, 166, },
105 {117, 57, 101, 44, 113, 54, 97, 41, },
106 { 0, 143, 18, 200, 2, 156, 25, 215, },
111 { 0, 124, 8, 193, 0, 140, 12, 213, },
112 { 55, 14, 104, 42, 66, 19, 119, 52, },
113 { 3, 168, 1, 145, 6, 187, 3, 162, },
114 { 86, 31, 70, 21, 99, 39, 82, 28, },
115 { 0, 134, 11, 206, 0, 129, 9, 200, },
116 { 62, 17, 114, 48, 58, 16, 109, 45, },
117 { 5, 181, 2, 157, 4, 175, 1, 151, },
118 { 95, 36, 78, 26, 90, 34, 74, 24, },
119 { 0, 124, 8, 193, 0, 140, 12, 213, },
124 { 0, 107, 3, 187, 0, 125, 6, 212, },
125 { 39, 7, 86, 28, 49, 11, 102, 36, },
126 { 1, 158, 0, 131, 3, 180, 1, 151, },
127 { 68, 19, 52, 12, 81, 25, 64, 17, },
128 { 0, 119, 5, 203, 0, 113, 4, 195, },
129 { 45, 9, 96, 33, 42, 8, 91, 30, },
130 { 2, 172, 1, 144, 2, 165, 0, 137, },
131 { 77, 23, 60, 15, 72, 21, 56, 14, },
132 { 0, 107, 3, 187, 0, 125, 6, 212, },
136 #define output_pixel(pos, val, bias, signedness) \
138 AV_WB16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \
140 AV_WL16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \
145 int big_endian,
int output_bits)
151 for (i = 0; i < dstW; i++) {
152 int val = src[i] + (1 << (shift - 1));
159 const int32_t **
src, uint16_t *dest,
int dstW,
160 int big_endian,
int output_bits)
166 for (i = 0; i < dstW; i++) {
167 int val = 1 << (shift - 1);
176 for (j = 0; j < filterSize; j++)
177 val += src[j][i] * (
unsigned)filter[j];
184 const int16_t **chrUSrc,
const int16_t **chrVSrc,
187 uint16_t *dest = (uint16_t*)dest8;
194 for (i = 0; i < chrDstW; i++) {
195 int u = 1 << (shift - 1);
196 int v = 1 << (shift - 1);
201 for (j = 0; j < chrFilterSize; j++) {
202 u += uSrc[j][i] * (unsigned)chrFilter[j];
203 v += vSrc[j][i] * (unsigned)chrFilter[j];
214 static const int big_endian = HAVE_BIGENDIAN;
215 static const int shift = 3;
216 static const float float_mult = 1.0f / 65535.0f;
220 for (i = 0; i < dstW; ++i){
221 val = src[i] + (1 << (shift - 1));
223 dest[i] = float_mult * (float)val_uint;
230 static const int big_endian = HAVE_BIGENDIAN;
231 static const int shift = 3;
232 static const float float_mult = 1.0f / 65535.0f;
236 for (i = 0; i < dstW; ++i){
237 val = src[i] + (1 << (shift - 1));
245 float *dest,
int dstW)
247 static const int big_endian = HAVE_BIGENDIAN;
248 static const int shift = 15;
249 static const float float_mult = 1.0f / 65535.0f;
253 for (i = 0; i < dstW; ++i){
254 val = (1 << (shift - 1)) - 0x40000000;
255 for (j = 0; j < filterSize; ++j){
256 val += src[j][i] * (unsigned)filter[j];
259 dest[i] = float_mult * (float)val_uint;
265 uint32_t *dest,
int dstW)
267 static const int big_endian = HAVE_BIGENDIAN;
268 static const int shift = 15;
269 static const float float_mult = 1.0f / 65535.0f;
273 for (i = 0; i < dstW; ++i){
274 val = (1 << (shift - 1)) - 0x40000000;
275 for (j = 0; j < filterSize; ++j){
276 val += src[j][i] * (unsigned)filter[j];
283 #define yuv2plane1_float(template, dest_type, BE_LE) \
284 static void yuv2plane1_float ## BE_LE ## _c(const int16_t *src, uint8_t *dest, int dstW, \
285 const uint8_t *dither, int offset) \
287 template((const int32_t *)src, (dest_type *)dest, dstW); \
290 #define yuv2planeX_float(template, dest_type, BE_LE) \
291 static void yuv2planeX_float ## BE_LE ## _c(const int16_t *filter, int filterSize, \
292 const int16_t **src, uint8_t *dest, int dstW, \
293 const uint8_t *dither, int offset) \
295 template(filter, filterSize, (const int32_t **)src, (dest_type *)dest, dstW); \
312 #define output_pixel(pos, val) \
314 AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits)); \
316 AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits)); \
320 yuv2plane1_10_c_template(
const int16_t *
src, uint16_t *dest,
int dstW,
321 int big_endian,
int output_bits)
324 int shift = 15 - output_bits;
326 for (i = 0; i < dstW; i++) {
327 int val = src[i] + (1 << (shift - 1));
334 const int16_t **
src, uint16_t *dest,
int dstW,
335 int big_endian,
int output_bits)
338 int shift = 11 + 16 - output_bits;
340 for (i = 0; i < dstW; i++) {
341 int val = 1 << (shift - 1);
344 for (j = 0; j < filterSize; j++)
345 val += src[j][i] * filter[j];
353 #define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t) \
354 static void yuv2plane1_ ## bits ## BE_LE ## _c(const int16_t *src, \
355 uint8_t *dest, int dstW, \
356 const uint8_t *dither, int offset)\
358 yuv2plane1_ ## template_size ## _c_template((const typeX_t *) src, \
359 (uint16_t *) dest, dstW, is_be, bits); \
361 static void yuv2planeX_ ## bits ## BE_LE ## _c(const int16_t *filter, int filterSize, \
362 const int16_t **src, uint8_t *dest, int dstW, \
363 const uint8_t *dither, int offset)\
365 yuv2planeX_## template_size ## _c_template(filter, \
366 filterSize, (const typeX_t **) src, \
367 (uint16_t *) dest, dstW, is_be, bits); \
371 yuv2NBPS(10, BE, 1, 10, int16_t)
372 yuv2NBPS(10, LE, 0, 10, int16_t)
373 yuv2NBPS(12, BE, 1, 10, int16_t)
374 yuv2NBPS(12, LE, 0, 10, int16_t)
375 yuv2NBPS(14, BE, 1, 10, int16_t)
376 yuv2NBPS(14, LE, 0, 10, int16_t)
377 yuv2NBPS(16, BE, 1, 16,
int32_t)
378 yuv2NBPS(16, LE, 0, 16,
int32_t)
380 static
void yuv2planeX_8_c(const int16_t *
filter,
int filterSize,
385 for (i=0; i<dstW; i++) {
386 int val = dither[(i +
offset) & 7] << 12;
388 for (j=0; j<filterSize; j++)
389 val += src[j][i] * filter[j];
391 dest[i]= av_clip_uint8(val>>19);
399 for (i=0; i<dstW; i++) {
400 int val = (src[i] + dither[(i +
offset) & 7]) >> 7;
401 dest[i]= av_clip_uint8(val);
406 const int16_t **chrUSrc,
const int16_t **chrVSrc,
414 for (i=0; i<chrDstW; i++) {
415 int u = chrDither[i & 7] << 12;
416 int v = chrDither[(i + 3) & 7] << 12;
418 for (j=0; j<chrFilterSize; j++) {
419 u += chrUSrc[j][i] * chrFilter[j];
420 v += chrVSrc[j][i] * chrFilter[j];
423 dest[2*i]= av_clip_uint8(u>>19);
424 dest[2*i+1]= av_clip_uint8(v>>19);
427 for (i=0; i<chrDstW; i++) {
428 int u = chrDither[i & 7] << 12;
429 int v = chrDither[(i + 3) & 7] << 12;
431 for (j=0; j<chrFilterSize; j++) {
432 u += chrUSrc[j][i] * chrFilter[j];
433 v += chrVSrc[j][i] * chrFilter[j];
436 dest[2*i]= av_clip_uint8(v>>19);
437 dest[2*i+1]= av_clip_uint8(u>>19);
442 #define output_pixel(pos, val) \
444 AV_WB16(pos, av_clip_uintp2(val >> shift, 10) << 6); \
446 AV_WL16(pos, av_clip_uintp2(val >> shift, 10) << 6); \
450 uint16_t *dest,
int dstW,
456 for (i = 0; i < dstW; i++) {
457 int val = src[i] + (1 << (shift - 1));
463 const int16_t **
src, uint16_t *dest,
int dstW,
469 for (i = 0; i < dstW; i++) {
470 int val = 1 << (shift - 1);
472 for (j = 0; j < filterSize; j++)
473 val += src[j][i] * filter[j];
480 const int16_t **chrUSrc,
const int16_t **chrVSrc,
483 uint16_t *dest = (uint16_t*)dest8;
488 for (i = 0; i < chrDstW; i++) {
489 int u = 1 << (shift - 1);
490 int v = 1 << (shift - 1);
492 for (j = 0; j < chrFilterSize; j++) {
493 u += chrUSrc[j][i] * chrFilter[j];
494 v += chrVSrc[j][i] * chrFilter[j];
520 yuv2p010lX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 0);
527 yuv2p010lX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 1);
533 #define accumulate_bit(acc, val) \
536 #define output_pixel(pos, acc) \
537 if (target == AV_PIX_FMT_MONOBLACK) { \
545 const int16_t **lumSrc,
int lumFilterSize,
546 const int16_t *chrFilter,
const int16_t **chrUSrc,
547 const int16_t **chrVSrc,
int chrFilterSize,
548 const int16_t **alpSrc,
uint8_t *dest,
int dstW,
556 for (i = 0; i < dstW; i += 2) {
561 for (j = 0; j < lumFilterSize; j++) {
562 Y1 += lumSrc[j][i] * lumFilter[j];
563 Y2 += lumSrc[j][i+1] * lumFilter[j];
567 if ((Y1 | Y2) & 0x100) {
568 Y1 = av_clip_uint8(Y1);
569 Y2 = av_clip_uint8(Y2);
574 acc = 2*acc + (Y1 >= 128);
579 acc = 2*acc + (err >= 128);
598 const int16_t *ubuf[2],
const int16_t *vbuf[2],
599 const int16_t *abuf[2],
uint8_t *dest,
int dstW,
600 int yalpha,
int uvalpha,
int y,
603 const int16_t *buf0 = buf[0], *buf1 = buf[1];
605 int yalpha1 = 4096 - yalpha;
612 for (i = 0; i < dstW; i +=2) {
615 Y = (buf0[i + 0] * yalpha1 + buf1[i + 0] * yalpha) >> 19;
618 acc = 2*acc + (Y >= 128);
621 err = (buf0[i + 1] * yalpha1 + buf1[i + 1] * yalpha) >> 19;
624 acc = 2*acc + (err >= 128);
632 for (i = 0; i < dstW; i += 8) {
635 Y = (buf0[i + 0] * yalpha1 + buf1[i + 0] * yalpha) >> 19;
637 Y = (buf0[i + 1] * yalpha1 + buf1[i + 1] * yalpha) >> 19;
639 Y = (buf0[i + 2] * yalpha1 + buf1[i + 2] * yalpha) >> 19;
641 Y = (buf0[i + 3] * yalpha1 + buf1[i + 3] * yalpha) >> 19;
643 Y = (buf0[i + 4] * yalpha1 + buf1[i + 4] * yalpha) >> 19;
645 Y = (buf0[i + 5] * yalpha1 + buf1[i + 5] * yalpha) >> 19;
647 Y = (buf0[i + 6] * yalpha1 + buf1[i + 6] * yalpha) >> 19;
649 Y = (buf0[i + 7] * yalpha1 + buf1[i + 7] * yalpha) >> 19;
659 const int16_t *ubuf[2],
const int16_t *vbuf[2],
660 const int16_t *abuf0,
uint8_t *dest,
int dstW,
669 for (i = 0; i < dstW; i +=2) {
672 Y = ((buf0[i + 0] + 64) >> 7);
675 acc = 2*acc + (Y >= 128);
678 err = ((buf0[i + 1] + 64) >> 7);
681 acc = 2*acc + (err >= 128);
689 for (i = 0; i < dstW; i += 8) {
706 #undef accumulate_bit
708 #define YUV2PACKEDWRAPPER(name, base, ext, fmt) \
709 static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \
710 const int16_t **lumSrc, int lumFilterSize, \
711 const int16_t *chrFilter, const int16_t **chrUSrc, \
712 const int16_t **chrVSrc, int chrFilterSize, \
713 const int16_t **alpSrc, uint8_t *dest, int dstW, \
716 name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
717 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
718 alpSrc, dest, dstW, y, fmt); \
721 static void name ## ext ## _2_c(SwsContext *c, const int16_t *buf[2], \
722 const int16_t *ubuf[2], const int16_t *vbuf[2], \
723 const int16_t *abuf[2], uint8_t *dest, int dstW, \
724 int yalpha, int uvalpha, int y) \
726 name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
727 dest, dstW, yalpha, uvalpha, y, fmt); \
730 static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
731 const int16_t *ubuf[2], const int16_t *vbuf[2], \
732 const int16_t *abuf0, uint8_t *dest, int dstW, \
733 int uvalpha, int y) \
735 name ## base ## _1_c_template(c, buf0, ubuf, vbuf, \
736 abuf0, dest, dstW, uvalpha, \
743 #define output_pixels(pos, Y1, U, Y2, V) \
744 if (target == AV_PIX_FMT_YUYV422) { \
745 dest[pos + 0] = Y1; \
747 dest[pos + 2] = Y2; \
749 } else if (target == AV_PIX_FMT_YVYU422) { \
750 dest[pos + 0] = Y1; \
752 dest[pos + 2] = Y2; \
756 dest[pos + 1] = Y1; \
758 dest[pos + 3] = Y2; \
763 const int16_t **lumSrc,
int lumFilterSize,
764 const int16_t *chrFilter,
const int16_t **chrUSrc,
765 const int16_t **chrVSrc,
int chrFilterSize,
766 const int16_t **alpSrc,
uint8_t *dest,
int dstW,
771 for (i = 0; i < ((dstW + 1) >> 1); i++) {
778 for (j = 0; j < lumFilterSize; j++) {
779 Y1 += lumSrc[j][i * 2] * lumFilter[j];
780 Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j];
782 for (j = 0; j < chrFilterSize; j++) {
783 U += chrUSrc[j][i] * chrFilter[j];
784 V += chrVSrc[j][i] * chrFilter[j];
790 if ((Y1 | Y2 | U | V) & 0x100) {
791 Y1 = av_clip_uint8(Y1);
792 Y2 = av_clip_uint8(Y2);
793 U = av_clip_uint8(U);
794 V = av_clip_uint8(V);
802 const int16_t *ubuf[2],
const int16_t *vbuf[2],
803 const int16_t *abuf[2],
uint8_t *dest,
int dstW,
804 int yalpha,
int uvalpha,
int y,
807 const int16_t *buf0 = buf[0], *buf1 = buf[1],
808 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
809 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
810 int yalpha1 = 4096 - yalpha;
811 int uvalpha1 = 4096 - uvalpha;
816 for (i = 0; i < ((dstW + 1) >> 1); i++) {
817 int Y1 = (buf0[i * 2] * yalpha1 + buf1[i * 2] * yalpha) >> 19;
818 int Y2 = (buf0[i * 2 + 1] * yalpha1 + buf1[i * 2 + 1] * yalpha) >> 19;
819 int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha) >> 19;
820 int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha) >> 19;
822 if ((Y1 | Y2 | U | V) & 0x100) {
823 Y1 = av_clip_uint8(Y1);
824 Y2 = av_clip_uint8(Y2);
825 U = av_clip_uint8(U);
826 V = av_clip_uint8(V);
835 const int16_t *ubuf[2],
const int16_t *vbuf[2],
836 const int16_t *abuf0,
uint8_t *dest,
int dstW,
839 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
842 if (uvalpha < 2048) {
843 for (i = 0; i < ((dstW + 1) >> 1); i++) {
844 int Y1 = (buf0[i * 2 ]+64) >> 7;
845 int Y2 = (buf0[i * 2 + 1]+64) >> 7;
846 int U = (ubuf0[i] +64) >> 7;
847 int V = (vbuf0[i] +64) >> 7;
849 if ((Y1 | Y2 | U | V) & 0x100) {
850 Y1 = av_clip_uint8(Y1);
851 Y2 = av_clip_uint8(Y2);
852 U = av_clip_uint8(U);
853 V = av_clip_uint8(V);
856 Y1 = av_clip_uint8(Y1);
857 Y2 = av_clip_uint8(Y2);
858 U = av_clip_uint8(U);
859 V = av_clip_uint8(V);
864 const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
865 for (i = 0; i < ((dstW + 1) >> 1); i++) {
866 int Y1 = (buf0[i * 2 ] + 64) >> 7;
867 int Y2 = (buf0[i * 2 + 1] + 64) >> 7;
868 int U = (ubuf0[i] + ubuf1[i]+128) >> 8;
869 int V = (vbuf0[i] + vbuf1[i]+128) >> 8;
871 if ((Y1 | Y2 | U | V) & 0x100) {
872 Y1 = av_clip_uint8(Y1);
873 Y2 = av_clip_uint8(Y2);
874 U = av_clip_uint8(U);
875 V = av_clip_uint8(V);
878 Y1 = av_clip_uint8(Y1);
879 Y2 = av_clip_uint8(Y2);
880 U = av_clip_uint8(U);
881 V = av_clip_uint8(V);
894 #define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE) ? R : B)
895 #define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE) ? B : R)
896 #define output_pixel(pos, val) \
897 if (isBE(target)) { \
905 const int32_t **lumSrc,
int lumFilterSize,
906 const int16_t *chrFilter,
const int32_t **unused_chrUSrc,
907 const int32_t **unused_chrVSrc,
int unused_chrFilterSize,
908 const int32_t **alpSrc, uint16_t *dest,
int dstW,
909 int y,
enum AVPixelFormat target,
int unused_hasAlpha,
int unused_eightbytes)
911 int hasAlpha = !!alpSrc;
914 for (i = 0; i < dstW; i++) {
917 int64_t
A = 0xffff<<14;
919 for (j = 0; j < lumFilterSize; j++)
920 Y += lumSrc[j][i] * lumFilter[j];
923 Y = av_clip_uint16(Y);
926 for (j = 0; j < lumFilterSize; j++)
927 A += alpSrc[j][i] * lumFilter[j];
930 A = av_clip_uint16(A);
941 const int32_t *abuf[2], uint16_t *dest,
int dstW,
942 int yalpha,
int unused_uvalpha,
int y,
943 enum AVPixelFormat target,
int unused_hasAlpha,
int unused_eightbytes)
945 int hasAlpha = abuf && abuf[0] && abuf[1];
946 const int32_t *buf0 = buf[0], *buf1 = buf[1],
947 *abuf0 = hasAlpha ? abuf[0] :
NULL,
948 *abuf1 = hasAlpha ? abuf[1] :
NULL;
949 int yalpha1 = 4096 - yalpha;
954 for (i = 0; i < dstW; i++) {
955 int Y = (buf0[i] * yalpha1 + buf1[i] * yalpha) >> 15;
958 Y = av_clip_uint16(Y);
961 A = (abuf0[i] * yalpha1 + abuf1[i] * yalpha) >> 15;
962 A = av_clip_uint16(A);
973 const int32_t *abuf0, uint16_t *dest,
int dstW,
974 int unused_uvalpha,
int y,
enum AVPixelFormat target,
int unused_hasAlpha,
int unused_eightbytes)
976 int hasAlpha = !!abuf0;
979 for (i = 0; i < dstW; i++) {
980 int Y = buf0[i] >> 3;
983 Y = av_clip_uint16(Y);
988 A = av_clip_uint16(A);
998 const int32_t **lumSrc,
int lumFilterSize,
999 const int16_t *chrFilter,
const int32_t **chrUSrc,
1000 const int32_t **chrVSrc,
int chrFilterSize,
1001 const int32_t **alpSrc, uint16_t *dest,
int dstW,
1002 int y,
enum AVPixelFormat target,
int hasAlpha,
int eightbytes)
1005 int A1 = 0xffff<<14,
A2 = 0xffff<<14;
1007 for (i = 0; i < ((dstW + 1) >> 1); i++) {
1009 int Y1 = -0x40000000;
1010 int Y2 = -0x40000000;
1011 int U = -(128 << 23);
1012 int V = -(128 << 23);
1015 for (j = 0; j < lumFilterSize; j++) {
1016 Y1 += lumSrc[j][i * 2] * (unsigned)lumFilter[j];
1017 Y2 += lumSrc[j][i * 2 + 1] * (unsigned)lumFilter[j];
1019 for (j = 0; j < chrFilterSize; j++) {;
1020 U += chrUSrc[j][i] * (unsigned)chrFilter[j];
1021 V += chrVSrc[j][i] * (unsigned)chrFilter[j];
1027 for (j = 0; j < lumFilterSize; j++) {
1028 A1 += alpSrc[j][i * 2] * (unsigned)lumFilter[j];
1029 A2 += alpSrc[j][i * 2 + 1] * (unsigned)lumFilter[j];
1060 output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
1065 output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
1071 output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14);
1081 const int32_t *abuf[2], uint16_t *dest,
int dstW,
1082 int yalpha,
int uvalpha,
int y,
1085 const int32_t *buf0 = buf[0], *buf1 = buf[1],
1086 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
1087 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
1088 *abuf0 = hasAlpha ? abuf[0] :
NULL,
1089 *abuf1 = hasAlpha ? abuf[1] :
NULL;
1090 int yalpha1 = 4096 - yalpha;
1091 int uvalpha1 = 4096 - uvalpha;
1093 int A1 = 0xffff<<14,
A2 = 0xffff<<14;
1098 for (i = 0; i < ((dstW + 1) >> 1); i++) {
1099 int Y1 = (buf0[i * 2] * yalpha1 + buf1[i * 2] * yalpha) >> 14;
1100 int Y2 = (buf0[i * 2 + 1] * yalpha1 + buf1[i * 2 + 1] * yalpha) >> 14;
1101 int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha - (128 << 23)) >> 14;
1102 int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha - (128 << 23)) >> 14;
1117 A1 = (abuf0[i * 2 ] * yalpha1 + abuf1[i * 2 ] * yalpha) >> 1;
1118 A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 1;
1125 output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
1130 output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
1136 output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14);
1146 const int32_t *abuf0, uint16_t *dest,
int dstW,
1147 int uvalpha,
int y,
enum AVPixelFormat target,
int hasAlpha,
int eightbytes)
1149 const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
1151 int A1 = 0xffff<<14,
A2= 0xffff<<14;
1153 if (uvalpha < 2048) {
1154 for (i = 0; i < ((dstW + 1) >> 1); i++) {
1155 int Y1 = (buf0[i * 2] ) >> 2;
1156 int Y2 = (buf0[i * 2 + 1]) >> 2;
1157 int U = (ubuf0[i] - (128 << 11)) >> 2;
1158 int V = (vbuf0[i] - (128 << 11)) >> 2;
1169 A1 = abuf0[i * 2 ] << 11;
1170 A2 = abuf0[i * 2 + 1] << 11;
1181 output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
1186 output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
1192 output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14);
1198 const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
1199 int A1 = 0xffff<<14,
A2 = 0xffff<<14;
1200 for (i = 0; i < ((dstW + 1) >> 1); i++) {
1201 int Y1 = (buf0[i * 2] ) >> 2;
1202 int Y2 = (buf0[i * 2 + 1]) >> 2;
1203 int U = (ubuf0[i] + ubuf1[i] - (128 << 12)) >> 3;
1204 int V = (vbuf0[i] + vbuf1[i] - (128 << 12)) >> 3;
1215 A1 = abuf0[i * 2 ] << 11;
1216 A2 = abuf0[i * 2 + 1] << 11;
1227 output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
1232 output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
1238 output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14);
1248 const int32_t **lumSrc,
int lumFilterSize,
1249 const int16_t *chrFilter,
const int32_t **chrUSrc,
1250 const int32_t **chrVSrc,
int chrFilterSize,
1251 const int32_t **alpSrc, uint16_t *dest,
int dstW,
1252 int y,
enum AVPixelFormat target,
int hasAlpha,
int eightbytes)
1257 for (i = 0; i < dstW; i++) {
1259 int Y = -0x40000000;
1260 int U = -(128 << 23);
1261 int V = -(128 << 23);
1264 for (j = 0; j < lumFilterSize; j++) {
1265 Y += lumSrc[j][i] * (unsigned)lumFilter[j];
1267 for (j = 0; j < chrFilterSize; j++) {;
1268 U += chrUSrc[j][i] * (unsigned)chrFilter[j];
1269 V += chrVSrc[j][i] * (unsigned)chrFilter[j];
1274 for (j = 0; j < lumFilterSize; j++) {
1275 A += alpSrc[j][i] * (unsigned)lumFilter[j];
1299 output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14);
1313 const int32_t *abuf[2], uint16_t *dest,
int dstW,
1314 int yalpha,
int uvalpha,
int y,
1317 const int32_t *buf0 = buf[0], *buf1 = buf[1],
1318 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
1319 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
1320 *abuf0 = hasAlpha ? abuf[0] :
NULL,
1321 *abuf1 = hasAlpha ? abuf[1] :
NULL;
1322 int yalpha1 = 4096 - yalpha;
1323 int uvalpha1 = 4096 - uvalpha;
1330 for (i = 0; i < dstW; i++) {
1331 int Y = (buf0[i] * yalpha1 + buf1[i] * yalpha) >> 14;
1332 int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha - (128 << 23)) >> 14;
1333 int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha - (128 << 23)) >> 14;
1345 A = (abuf0[i] * yalpha1 + abuf1[i] * yalpha) >> 1;
1351 output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14);
1365 const int32_t *abuf0, uint16_t *dest,
int dstW,
1366 int uvalpha,
int y,
enum AVPixelFormat target,
int hasAlpha,
int eightbytes)
1368 const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
1372 if (uvalpha < 2048) {
1373 for (i = 0; i < dstW; i++) {
1374 int Y = (buf0[i]) >> 2;
1375 int U = (ubuf0[i] - (128 << 11)) >> 2;
1376 int V = (vbuf0[i] - (128 << 11)) >> 2;
1394 output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14);
1404 const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
1406 for (i = 0; i < dstW; i++) {
1407 int Y = (buf0[i] ) >> 2;
1408 int U = (ubuf0[i] + ubuf1[i] - (128 << 12)) >> 3;
1409 int V = (vbuf0[i] + vbuf1[i] - (128 << 12)) >> 3;
1427 output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14);
1443 #define YUV2PACKED16WRAPPER(name, base, ext, fmt, hasAlpha, eightbytes) \
1444 static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \
1445 const int16_t **_lumSrc, int lumFilterSize, \
1446 const int16_t *chrFilter, const int16_t **_chrUSrc, \
1447 const int16_t **_chrVSrc, int chrFilterSize, \
1448 const int16_t **_alpSrc, uint8_t *_dest, int dstW, \
1451 const int32_t **lumSrc = (const int32_t **) _lumSrc, \
1452 **chrUSrc = (const int32_t **) _chrUSrc, \
1453 **chrVSrc = (const int32_t **) _chrVSrc, \
1454 **alpSrc = (const int32_t **) _alpSrc; \
1455 uint16_t *dest = (uint16_t *) _dest; \
1456 name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
1457 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
1458 alpSrc, dest, dstW, y, fmt, hasAlpha, eightbytes); \
1461 static void name ## ext ## _2_c(SwsContext *c, const int16_t *_buf[2], \
1462 const int16_t *_ubuf[2], const int16_t *_vbuf[2], \
1463 const int16_t *_abuf[2], uint8_t *_dest, int dstW, \
1464 int yalpha, int uvalpha, int y) \
1466 const int32_t **buf = (const int32_t **) _buf, \
1467 **ubuf = (const int32_t **) _ubuf, \
1468 **vbuf = (const int32_t **) _vbuf, \
1469 **abuf = (const int32_t **) _abuf; \
1470 uint16_t *dest = (uint16_t *) _dest; \
1471 name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
1472 dest, dstW, yalpha, uvalpha, y, fmt, hasAlpha, eightbytes); \
1475 static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \
1476 const int16_t *_ubuf[2], const int16_t *_vbuf[2], \
1477 const int16_t *_abuf0, uint8_t *_dest, int dstW, \
1478 int uvalpha, int y) \
1480 const int32_t *buf0 = (const int32_t *) _buf0, \
1481 **ubuf = (const int32_t **) _ubuf, \
1482 **vbuf = (const int32_t **) _vbuf, \
1483 *abuf0 = (const int32_t *) _abuf0; \
1484 uint16_t *dest = (uint16_t *) _dest; \
1485 name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \
1486 dstW, uvalpha, y, fmt, hasAlpha, eightbytes); \
1527 unsigned A1,
unsigned A2,
1528 const
void *_r, const
void *_g, const
void *_b,
int y,
1533 uint32_t *dest = (uint32_t *) _dest;
1534 const uint32_t *
r = (
const uint32_t *) _r;
1535 const uint32_t *
g = (
const uint32_t *) _g;
1536 const uint32_t *
b = (
const uint32_t *) _b;
1541 dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (hasAlpha ? A1 << sh : 0);
1542 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (hasAlpha ? A2 << sh : 0);
1547 av_assert2((((r[Y1] + g[Y1] + b[Y1]) >> sh) & 0xFF) == 0);
1548 dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (A1 << sh);
1549 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (A2 << sh);
1551 #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
1554 av_assert2((((r[Y1] + g[Y1] + b[Y1]) >> sh) & 0xFF) == 0xFF);
1556 dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1];
1557 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2];
1566 #define r_b ((target == AV_PIX_FMT_RGB24) ? r : b)
1567 #define b_r ((target == AV_PIX_FMT_RGB24) ? b : r)
1569 dest[i * 6 + 0] =
r_b[Y1];
1570 dest[i * 6 + 1] = g[Y1];
1571 dest[i * 6 + 2] =
b_r[Y1];
1572 dest[i * 6 + 3] =
r_b[Y2];
1573 dest[i * 6 + 4] = g[Y2];
1574 dest[i * 6 + 5] =
b_r[Y2];
1580 uint16_t *dest = (uint16_t *) _dest;
1581 const uint16_t *
r = (
const uint16_t *) _r;
1582 const uint16_t *
g = (
const uint16_t *) _g;
1583 const uint16_t *
b = (
const uint16_t *) _b;
1584 int dr1, dg1, db1, dr2, dg2, db2;
1609 dest[i * 2 + 0] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1];
1610 dest[i * 2 + 1] = r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2];
1616 int dr1, dg1, db1, dr2, dg2, db2;
1621 dr1 = dg1 = d32[(i * 2 + 0) & 7];
1622 db1 = d64[(i * 2 + 0) & 7];
1623 dr2 = dg2 = d32[(i * 2 + 1) & 7];
1624 db2 = d64[(i * 2 + 1) & 7];
1628 dr1 = db1 = d128[(i * 2 + 0) & 7];
1629 dg1 = d64[(i * 2 + 0) & 7];
1630 dr2 = db2 = d128[(i * 2 + 1) & 7];
1631 dg2 = d64[(i * 2 + 1) & 7];
1635 dest[i] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1] +
1636 ((r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]) << 4);
1638 dest[i * 2 + 0] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1];
1639 dest[i * 2 + 1] = r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2];
1646 const int16_t **lumSrc,
int lumFilterSize,
1647 const int16_t *chrFilter,
const int16_t **chrUSrc,
1648 const int16_t **chrVSrc,
int chrFilterSize,
1649 const int16_t **alpSrc,
uint8_t *dest,
int dstW,
1654 for (i = 0; i < ((dstW + 1) >> 1); i++) {
1660 const void *
r, *
g, *
b;
1662 for (j = 0; j < lumFilterSize; j++) {
1663 Y1 += lumSrc[j][i * 2] * lumFilter[j];
1664 Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j];
1666 for (j = 0; j < chrFilterSize; j++) {
1667 U += chrUSrc[j][i] * chrFilter[j];
1668 V += chrVSrc[j][i] * chrFilter[j];
1677 for (j = 0; j < lumFilterSize; j++) {
1678 A1 += alpSrc[j][i * 2 ] * lumFilter[j];
1679 A2 += alpSrc[j][i * 2 + 1] * lumFilter[j];
1683 if ((A1 | A2) & 0x100) {
1684 A1 = av_clip_uint8(A1);
1685 A2 = av_clip_uint8(A2);
1693 yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
1694 r, g, b, y, target, hasAlpha);
1700 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1701 const int16_t *abuf[2],
uint8_t *dest,
int dstW,
1702 int yalpha,
int uvalpha,
int y,
1705 const int16_t *buf0 = buf[0], *buf1 = buf[1],
1706 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
1707 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
1708 *abuf0 = hasAlpha ? abuf[0] :
NULL,
1709 *abuf1 = hasAlpha ? abuf[1] :
NULL;
1710 int yalpha1 = 4096 - yalpha;
1711 int uvalpha1 = 4096 - uvalpha;
1716 for (i = 0; i < ((dstW + 1) >> 1); i++) {
1717 int Y1 = (buf0[i * 2] * yalpha1 + buf1[i * 2] * yalpha) >> 19;
1718 int Y2 = (buf0[i * 2 + 1] * yalpha1 + buf1[i * 2 + 1] * yalpha) >> 19;
1719 int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha) >> 19;
1720 int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha) >> 19;
1727 A1 = (abuf0[i * 2 ] * yalpha1 + abuf1[i * 2 ] * yalpha) >> 19;
1728 A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 19;
1729 A1 = av_clip_uint8(A1);
1730 A2 = av_clip_uint8(A2);
1733 yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
1734 r,
g,
b, y, target, hasAlpha);
1740 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1741 const int16_t *abuf0,
uint8_t *dest,
int dstW,
1745 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
1748 if (uvalpha < 2048) {
1749 for (i = 0; i < ((dstW + 1) >> 1); i++) {
1750 int Y1 = (buf0[i * 2 ] + 64) >> 7;
1751 int Y2 = (buf0[i * 2 + 1] + 64) >> 7;
1752 int U = (ubuf0[i] + 64) >> 7;
1753 int V = (vbuf0[i] + 64) >> 7;
1760 A1 = abuf0[i * 2 ] * 255 + 16384 >> 15;
1761 A2 = abuf0[i * 2 + 1] * 255 + 16384 >> 15;
1762 A1 = av_clip_uint8(A1);
1763 A2 = av_clip_uint8(A2);
1766 yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
1767 r,
g,
b, y, target, hasAlpha);
1770 const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
1771 for (i = 0; i < ((dstW + 1) >> 1); i++) {
1772 int Y1 = (buf0[i * 2 ] + 64) >> 7;
1773 int Y2 = (buf0[i * 2 + 1] + 64) >> 7;
1774 int U = (ubuf0[i] + ubuf1[i] + 128) >> 8;
1775 int V = (vbuf0[i] + vbuf1[i] + 128) >> 8;
1782 A1 = (abuf0[i * 2 ] + 64) >> 7;
1783 A2 = (abuf0[i * 2 + 1] + 64) >> 7;
1784 A1 = av_clip_uint8(A1);
1785 A2 = av_clip_uint8(A2);
1788 yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
1789 r,
g,
b, y, target, hasAlpha);
1794 #define YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \
1795 static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \
1796 const int16_t **lumSrc, int lumFilterSize, \
1797 const int16_t *chrFilter, const int16_t **chrUSrc, \
1798 const int16_t **chrVSrc, int chrFilterSize, \
1799 const int16_t **alpSrc, uint8_t *dest, int dstW, \
1802 name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
1803 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
1804 alpSrc, dest, dstW, y, fmt, hasAlpha); \
1807 #define YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha) \
1808 YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \
1809 static void name ## ext ## _2_c(SwsContext *c, const int16_t *buf[2], \
1810 const int16_t *ubuf[2], const int16_t *vbuf[2], \
1811 const int16_t *abuf[2], uint8_t *dest, int dstW, \
1812 int yalpha, int uvalpha, int y) \
1814 name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
1815 dest, dstW, yalpha, uvalpha, y, fmt, hasAlpha); \
1818 #define YUV2RGBWRAPPER(name, base, ext, fmt, hasAlpha) \
1819 YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha) \
1820 static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
1821 const int16_t *ubuf[2], const int16_t *vbuf[2], \
1822 const int16_t *abuf0, uint8_t *dest, int dstW, \
1823 int uvalpha, int y) \
1825 name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \
1826 dstW, uvalpha, y, fmt, hasAlpha); \
1833 #if CONFIG_SWSCALE_ALPHA
1856 Y -= c->yuv2rgb_y_offset;
1857 Y *= c->yuv2rgb_y_coeff;
1859 R = Y + V*c->yuv2rgb_v2r_coeff;
1860 G = Y + V*c->yuv2rgb_v2g_coeff + U*c->yuv2rgb_u2g_coeff;
1861 B = Y + U*c->yuv2rgb_u2b_coeff;
1862 if ((R | G | B) & 0xC0000000) {
1863 R = av_clip_uintp2(R, 30);
1864 G = av_clip_uintp2(G, 30);
1865 B = av_clip_uintp2(B, 30);
1870 dest[0] = hasAlpha ? A : 255;
1884 dest[3] = hasAlpha ? A : 255;
1887 dest[0] = hasAlpha ? A : 255;
1892 case AV_PIX_FMT_BGR24:
1901 dest[3] = hasAlpha ? A : 255;
1904 case AV_PIX_FMT_RGB4_BYTE:
1906 case AV_PIX_FMT_RGB8:
1910 switch (c->dither) {
1917 R += (7*err[0] + 1*c->dither_error[0][i] + 5*c->dither_error[0][i+1] + 3*c->dither_error[0][i+2])>>4;
1918 G += (7*err[1] + 1*c->dither_error[1][i] + 5*c->dither_error[1][i+1] + 3*c->dither_error[1][i+2])>>4;
1919 B += (7*err[2] + 1*c->dither_error[2][i] + 5*c->dither_error[2][i+1] + 3*c->dither_error[2][i+2])>>4;
1920 c->dither_error[0][i] = err[0];
1921 c->dither_error[1][i] = err[1];
1922 c->dither_error[2][i] = err[2];
1923 r = R >> (isrgb8 ? 5 : 7);
1924 g = G >> (isrgb8 ? 5 : 6);
1925 b = B >> (isrgb8 ? 6 : 7);
1926 r = av_clip(r, 0, isrgb8 ? 7 : 1);
1927 g = av_clip(g, 0, isrgb8 ? 7 : 3);
1928 b = av_clip(b, 0, isrgb8 ? 3 : 1);
1929 err[0] = R - r*(isrgb8 ? 36 : 255);
1930 err[1] = G - g*(isrgb8 ? 36 : 85);
1931 err[2] = B - b*(isrgb8 ? 85 : 255);
1936 #define A_DITHER(u,v) (((((u)+((v)*236))*119)&0xff))
1937 r = (((R >> 19) +
A_DITHER(i,y) -96)>>8);
1938 g = (((G >> 19) +
A_DITHER(i + 17,y) - 96)>>8);
1939 b = (((B >> 20) +
A_DITHER(i + 17*2,y) -96)>>8);
1940 r = av_clip_uintp2(r, 3);
1941 g = av_clip_uintp2(g, 3);
1942 b = av_clip_uintp2(b, 2);
1944 r = (((R >> 21) +
A_DITHER(i,y)-256)>>8);
1945 g = (((G >> 19) +
A_DITHER(i + 17,y)-256)>>8);
1946 b = (((B >> 21) +
A_DITHER(i + 17*2,y)-256)>>8);
1947 r = av_clip_uintp2(r, 1);
1948 g = av_clip_uintp2(g, 2);
1949 b = av_clip_uintp2(b, 1);
1955 #define X_DITHER(u,v) (((((u)^((v)*237))*181)&0x1ff)/2)
1956 r = (((R >> 19) +
X_DITHER(i,y) - 96)>>8);
1957 g = (((G >> 19) +
X_DITHER(i + 17,y) - 96)>>8);
1958 b = (((B >> 20) +
X_DITHER(i + 17*2,y) - 96)>>8);
1959 r = av_clip_uintp2(r, 3);
1960 g = av_clip_uintp2(g, 3);
1961 b = av_clip_uintp2(b, 2);
1963 r = (((R >> 21) +
X_DITHER(i,y)-256)>>8);
1964 g = (((G >> 19) +
X_DITHER(i + 17,y)-256)>>8);
1965 b = (((B >> 21) +
X_DITHER(i + 17*2,y)-256)>>8);
1966 r = av_clip_uintp2(r, 1);
1967 g = av_clip_uintp2(g, 2);
1968 b = av_clip_uintp2(b, 1);
1975 dest[0] = r + 2*g + 8*
b;
1976 }
else if(target == AV_PIX_FMT_RGB4_BYTE) {
1977 dest[0] = b + 2*g + 8*
r;
1979 dest[0] = r + 8*g + 64*
b;
1980 }
else if(target == AV_PIX_FMT_RGB8) {
1981 dest[0] = b + 4*g + 32*
r;
1990 const int16_t **lumSrc,
int lumFilterSize,
1991 const int16_t *chrFilter,
const int16_t **chrUSrc,
1992 const int16_t **chrVSrc,
int chrFilterSize,
1993 const int16_t **alpSrc,
uint8_t *dest,
2005 for (i = 0; i < dstW; i++) {
2008 int U = (1<<9)-(128 << 19);
2009 int V = (1<<9)-(128 << 19);
2011 for (j = 0; j < lumFilterSize; j++) {
2012 Y += lumSrc[j][i] * lumFilter[j];
2014 for (j = 0; j < chrFilterSize; j++) {
2015 U += chrUSrc[j][i] * chrFilter[j];
2016 V += chrVSrc[j][i] * chrFilter[j];
2023 for (j = 0; j < lumFilterSize; j++) {
2024 A += alpSrc[j][i] * lumFilter[j];
2028 A = av_clip_uint8(A);
2030 yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err);
2040 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2041 const int16_t *abuf[2],
uint8_t *dest,
int dstW,
2042 int yalpha,
int uvalpha,
int y,
2045 const int16_t *buf0 = buf[0], *buf1 = buf[1],
2046 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
2047 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
2048 *abuf0 = hasAlpha ? abuf[0] :
NULL,
2049 *abuf1 = hasAlpha ? abuf[1] :
NULL;
2050 int yalpha1 = 4096 - yalpha;
2051 int uvalpha1 = 4096 - uvalpha;
2064 for (i = 0; i < dstW; i++) {
2065 int Y = ( buf0[i] * yalpha1 + buf1[i] * yalpha ) >> 10;
2066 int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha-(128 << 19)) >> 10;
2067 int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha-(128 << 19)) >> 10;
2070 A = (abuf0[i] * yalpha1 + abuf1[i] * yalpha + (1<<18)) >> 19;
2072 A = av_clip_uint8(A);
2075 yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err);
2085 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2086 const int16_t *abuf0,
uint8_t *dest,
int dstW,
2090 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
2099 if (uvalpha < 2048) {
2101 for (i = 0; i < dstW; i++) {
2102 int Y = buf0[i] << 2;
2103 int U = (ubuf0[i] - (128<<7)) * 4;
2104 int V = (vbuf0[i] - (128<<7)) * 4;
2107 A = (abuf0[i] + 64) >> 7;
2109 A = av_clip_uint8(A);
2112 yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err);
2116 const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
2118 for (i = 0; i < dstW; i++) {
2119 int Y = buf0[i] << 2;
2120 int U = (ubuf0[i] + ubuf1[i] - (128<<8)) << 1;
2121 int V = (vbuf0[i] + vbuf1[i] - (128<<8)) << 1;
2124 A = (abuf0[i] + 64) >> 7;
2126 A = av_clip_uint8(A);
2129 yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err);
2145 #if CONFIG_SWSCALE_ALPHA
2166 const int16_t **lumSrc,
int lumFilterSize,
2167 const int16_t *chrFilter, const int16_t **chrUSrc,
2168 const int16_t **chrVSrc,
int chrFilterSize,
2169 const int16_t **alpSrc,
uint8_t **dest,
2175 uint16_t **dest16 = (uint16_t**)dest;
2179 for (i = 0; i < dstW; i++) {
2182 int U = (1 << 9) - (128 << 19);
2183 int V = (1 << 9) - (128 << 19);
2186 for (j = 0; j < lumFilterSize; j++)
2187 Y += lumSrc[j][i] * lumFilter[j];
2189 for (j = 0; j < chrFilterSize; j++) {
2190 U += chrUSrc[j][i] * chrFilter[j];
2191 V += chrVSrc[j][i] * chrFilter[j];
2201 for (j = 0; j < lumFilterSize; j++)
2202 A += alpSrc[j][i] * lumFilter[j];
2205 A = av_clip_uintp2(A, 27);
2208 Y -= c->yuv2rgb_y_offset;
2209 Y *= c->yuv2rgb_y_coeff;
2211 R = Y + V * c->yuv2rgb_v2r_coeff;
2212 G = Y + V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
2213 B = Y + U * c->yuv2rgb_u2b_coeff;
2215 if ((R | G | B) & 0xC0000000) {
2216 R = av_clip_uintp2(R, 30);
2217 G = av_clip_uintp2(G, 30);
2218 B = av_clip_uintp2(B, 30);
2222 dest16[0][i] = G >>
SH;
2223 dest16[1][i] = B >>
SH;
2224 dest16[2][i] = R >>
SH;
2226 dest16[3][i] = A >> (SH - 3);
2228 dest[0][i] = G >> 22;
2229 dest[1][i] = B >> 22;
2230 dest[2][i] = R >> 22;
2232 dest[3][i] = A >> 19;
2235 if (SH != 22 && (!
isBE(c->dstFormat)) != (!HAVE_BIGENDIAN)) {
2236 for (i = 0; i < dstW; i++) {
2248 const int16_t **lumSrcx,
int lumFilterSize,
2249 const int16_t *chrFilter,
const int16_t **chrUSrcx,
2250 const int16_t **chrVSrcx,
int chrFilterSize,
2251 const int16_t **alpSrcx,
uint8_t **dest,
2257 uint16_t **dest16 = (uint16_t**)dest;
2263 for (i = 0; i < dstW; i++) {
2265 int Y = -0x40000000;
2266 int U = -(128 << 23);
2267 int V = -(128 << 23);
2270 for (j = 0; j < lumFilterSize; j++)
2271 Y += lumSrc[j][i] * (
unsigned)lumFilter[j];
2273 for (j = 0; j < chrFilterSize; j++) {
2274 U += chrUSrc[j][i] * (unsigned)chrFilter[j];
2275 V += chrVSrc[j][i] * (unsigned)chrFilter[j];
2286 for (j = 0; j < lumFilterSize; j++)
2287 A += alpSrc[j][i] * lumFilter[j];
2300 R = av_clip_uintp2(Y + R, 30);
2301 G = av_clip_uintp2(Y + G, 30);
2302 B = av_clip_uintp2(Y + B, 30);
2304 dest16[0][i] = G >> 14;
2305 dest16[1][i] = B >> 14;
2306 dest16[2][i] = R >> 14;
2308 dest16[3][i] = av_clip_uintp2(A, 30) >> 14;
2311 for (i = 0; i < dstW; i++) {
2323 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2324 const int16_t *abuf0,
uint8_t *dest,
int dstW,
2327 int hasAlpha = !!abuf0;
2330 for (i = 0; i < dstW; i++) {
2331 int Y = (buf0[i] + 64) >> 7;
2334 Y = av_clip_uint8(Y);
2337 A = (abuf0[i] + 64) >> 7;
2339 A = av_clip_uint8(A);
2343 dest[i * 2 + 1] = hasAlpha ? A : 255;
2349 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2350 const int16_t *abuf[2],
uint8_t *dest,
int dstW,
2351 int yalpha,
int uvalpha,
int y)
2353 int hasAlpha = abuf && abuf[0] && abuf[1];
2354 const int16_t *buf0 = buf[0], *buf1 = buf[1],
2355 *abuf0 = hasAlpha ? abuf[0] :
NULL,
2356 *abuf1 = hasAlpha ? abuf[1] :
NULL;
2357 int yalpha1 = 4096 - yalpha;
2362 for (i = 0; i < dstW; i++) {
2363 int Y = (buf0[i] * yalpha1 + buf1[i] * yalpha) >> 19;
2366 Y = av_clip_uint8(Y);
2369 A = (abuf0[i] * yalpha1 + abuf1[i] * yalpha) >> 19;
2370 A = av_clip_uint8(A);
2374 dest[i * 2 + 1] = hasAlpha ? A : 255;
2380 const int16_t **lumSrc,
int lumFilterSize,
2381 const int16_t *chrFilter,
const int16_t **chrUSrc,
2382 const int16_t **chrVSrc,
int chrFilterSize,
2383 const int16_t **alpSrc,
uint8_t *dest,
int dstW,
int y)
2385 int hasAlpha = !!alpSrc;
2388 for (i = 0; i < dstW; i++) {
2390 int Y = 1 << 18,
A = 1 << 18;
2392 for (j = 0; j < lumFilterSize; j++)
2393 Y += lumSrc[j][i] * lumFilter[j];
2397 Y = av_clip_uint8(Y);
2400 for (j = 0; j < lumFilterSize; j++)
2401 A += alpSrc[j][i] * lumFilter[j];
2406 A = av_clip_uint8(
A);
2410 dest[2 * i + 1] = hasAlpha ?
A : 255;
2416 const int16_t **_lumSrc,
int lumFilterSize,
2417 const int16_t *chrFilter,
const int16_t **_chrUSrc,
2418 const int16_t **_chrVSrc,
int chrFilterSize,
2419 const int16_t **_alpSrc,
uint8_t *dest,
int dstW,
int y)
2422 **chrUSrc = (
const int32_t **) _chrUSrc,
2423 **chrVSrc = (
const int32_t **) _chrVSrc,
2424 **alpSrc = (
const int32_t **) _alpSrc;
2425 int hasAlpha = !!alpSrc;
2428 for (i = 0; i < dstW; i++) {
2429 int Y = 1 << 14,
U = 1 << 14;
2430 int V = 1 << 14,
A = 1 << 14;
2438 for (j = 0; j < lumFilterSize; j++)
2439 Y += lumSrc[j][i] * (
unsigned)lumFilter[j];
2441 for (j = 0; j < chrFilterSize; j++)
2442 U += chrUSrc[j][i] * (
unsigned)chrFilter[j];
2444 for (j = 0; j < chrFilterSize; j++)
2445 V += chrVSrc[j][i] * (
unsigned)chrFilter[j];
2448 for (j = 0; j < lumFilterSize; j++)
2449 A += alpSrc[j][i] * (
unsigned)lumFilter[j];
2451 Y = 0x8000 + av_clip_int16(Y >> 15);
2452 U = 0x8000 + av_clip_int16(
U >> 15);
2453 V = 0x8000 + av_clip_int16(V >> 15);
2454 A = 0x8000 + av_clip_int16(
A >> 15);
2456 AV_WL16(dest + 8 * i, hasAlpha ?
A : 65535);
2479 }
else if (
is16BPS(dstFormat)) {
2480 *yuv2planeX =
isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
2481 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c;
2485 }
else if (
isNBPS(dstFormat)) {
2487 *yuv2planeX =
isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c;
2488 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_9LE_c;
2490 *yuv2planeX =
isBE(dstFormat) ? yuv2planeX_10BE_c : yuv2planeX_10LE_c;
2491 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_10BE_c : yuv2plane1_10LE_c;
2493 *yuv2planeX =
isBE(dstFormat) ? yuv2planeX_12BE_c : yuv2planeX_12LE_c;
2494 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_12BE_c : yuv2plane1_12LE_c;
2496 *yuv2planeX =
isBE(dstFormat) ? yuv2planeX_14BE_c : yuv2planeX_14LE_c;
2497 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_14BE_c : yuv2plane1_14LE_c;
2501 *yuv2planeX = yuv2planeX_floatBE_c;
2502 *yuv2plane1 = yuv2plane1_floatBE_c;
2504 *yuv2planeX = yuv2planeX_floatLE_c;
2505 *yuv2plane1 = yuv2plane1_floatLE_c;
2508 *yuv2planeX = yuv2planeX_8_c;
2514 switch (dstFormat) {
2515 case AV_PIX_FMT_RGBA:
2517 *yuv2packedX = yuv2rgba32_full_X_c;
2518 *yuv2packed2 = yuv2rgba32_full_2_c;
2519 *yuv2packed1 = yuv2rgba32_full_1_c;
2521 #if CONFIG_SWSCALE_ALPHA
2523 *yuv2packedX = yuv2rgba32_full_X_c;
2524 *yuv2packed2 = yuv2rgba32_full_2_c;
2525 *yuv2packed1 = yuv2rgba32_full_1_c;
2529 *yuv2packedX = yuv2rgbx32_full_X_c;
2530 *yuv2packed2 = yuv2rgbx32_full_2_c;
2531 *yuv2packed1 = yuv2rgbx32_full_1_c;
2535 case AV_PIX_FMT_ARGB:
2537 *yuv2packedX = yuv2argb32_full_X_c;
2538 *yuv2packed2 = yuv2argb32_full_2_c;
2539 *yuv2packed1 = yuv2argb32_full_1_c;
2541 #if CONFIG_SWSCALE_ALPHA
2543 *yuv2packedX = yuv2argb32_full_X_c;
2544 *yuv2packed2 = yuv2argb32_full_2_c;
2545 *yuv2packed1 = yuv2argb32_full_1_c;
2549 *yuv2packedX = yuv2xrgb32_full_X_c;
2550 *yuv2packed2 = yuv2xrgb32_full_2_c;
2551 *yuv2packed1 = yuv2xrgb32_full_1_c;
2557 *yuv2packedX = yuv2bgra32_full_X_c;
2558 *yuv2packed2 = yuv2bgra32_full_2_c;
2559 *yuv2packed1 = yuv2bgra32_full_1_c;
2561 #if CONFIG_SWSCALE_ALPHA
2563 *yuv2packedX = yuv2bgra32_full_X_c;
2564 *yuv2packed2 = yuv2bgra32_full_2_c;
2565 *yuv2packed1 = yuv2bgra32_full_1_c;
2569 *yuv2packedX = yuv2bgrx32_full_X_c;
2570 *yuv2packed2 = yuv2bgrx32_full_2_c;
2571 *yuv2packed1 = yuv2bgrx32_full_1_c;
2575 case AV_PIX_FMT_ABGR:
2577 *yuv2packedX = yuv2abgr32_full_X_c;
2578 *yuv2packed2 = yuv2abgr32_full_2_c;
2579 *yuv2packed1 = yuv2abgr32_full_1_c;
2581 #if CONFIG_SWSCALE_ALPHA
2583 *yuv2packedX = yuv2abgr32_full_X_c;
2584 *yuv2packed2 = yuv2abgr32_full_2_c;
2585 *yuv2packed1 = yuv2abgr32_full_1_c;
2589 *yuv2packedX = yuv2xbgr32_full_X_c;
2590 *yuv2packed2 = yuv2xbgr32_full_2_c;
2591 *yuv2packed1 = yuv2xbgr32_full_1_c;
2596 #if CONFIG_SWSCALE_ALPHA
2598 *yuv2packedX = yuv2rgba64le_full_X_c;
2599 *yuv2packed2 = yuv2rgba64le_full_2_c;
2600 *yuv2packed1 = yuv2rgba64le_full_1_c;
2604 *yuv2packedX = yuv2rgbx64le_full_X_c;
2605 *yuv2packed2 = yuv2rgbx64le_full_2_c;
2606 *yuv2packed1 = yuv2rgbx64le_full_1_c;
2610 #if CONFIG_SWSCALE_ALPHA
2612 *yuv2packedX = yuv2rgba64be_full_X_c;
2613 *yuv2packed2 = yuv2rgba64be_full_2_c;
2614 *yuv2packed1 = yuv2rgba64be_full_1_c;
2618 *yuv2packedX = yuv2rgbx64be_full_X_c;
2619 *yuv2packed2 = yuv2rgbx64be_full_2_c;
2620 *yuv2packed1 = yuv2rgbx64be_full_1_c;
2624 #if CONFIG_SWSCALE_ALPHA
2626 *yuv2packedX = yuv2bgra64le_full_X_c;
2627 *yuv2packed2 = yuv2bgra64le_full_2_c;
2628 *yuv2packed1 = yuv2bgra64le_full_1_c;
2632 *yuv2packedX = yuv2bgrx64le_full_X_c;
2633 *yuv2packed2 = yuv2bgrx64le_full_2_c;
2634 *yuv2packed1 = yuv2bgrx64le_full_1_c;
2638 #if CONFIG_SWSCALE_ALPHA
2640 *yuv2packedX = yuv2bgra64be_full_X_c;
2641 *yuv2packed2 = yuv2bgra64be_full_2_c;
2642 *yuv2packed1 = yuv2bgra64be_full_1_c;
2646 *yuv2packedX = yuv2bgrx64be_full_X_c;
2647 *yuv2packed2 = yuv2bgrx64be_full_2_c;
2648 *yuv2packed1 = yuv2bgrx64be_full_1_c;
2653 *yuv2packedX = yuv2rgb24_full_X_c;
2654 *yuv2packed2 = yuv2rgb24_full_2_c;
2655 *yuv2packed1 = yuv2rgb24_full_1_c;
2658 *yuv2packedX = yuv2bgr24_full_X_c;
2659 *yuv2packed2 = yuv2bgr24_full_2_c;
2660 *yuv2packed1 = yuv2bgr24_full_1_c;
2663 *yuv2packedX = yuv2rgb48le_full_X_c;
2664 *yuv2packed2 = yuv2rgb48le_full_2_c;
2665 *yuv2packed1 = yuv2rgb48le_full_1_c;
2668 *yuv2packedX = yuv2bgr48le_full_X_c;
2669 *yuv2packed2 = yuv2bgr48le_full_2_c;
2670 *yuv2packed1 = yuv2bgr48le_full_1_c;
2673 *yuv2packedX = yuv2rgb48be_full_X_c;
2674 *yuv2packed2 = yuv2rgb48be_full_2_c;
2675 *yuv2packed1 = yuv2rgb48be_full_1_c;
2678 *yuv2packedX = yuv2bgr48be_full_X_c;
2679 *yuv2packed2 = yuv2bgr48be_full_2_c;
2680 *yuv2packed1 = yuv2bgr48be_full_1_c;
2683 *yuv2packedX = yuv2bgr4_byte_full_X_c;
2684 *yuv2packed2 = yuv2bgr4_byte_full_2_c;
2685 *yuv2packed1 = yuv2bgr4_byte_full_1_c;
2688 *yuv2packedX = yuv2rgb4_byte_full_X_c;
2689 *yuv2packed2 = yuv2rgb4_byte_full_2_c;
2690 *yuv2packed1 = yuv2rgb4_byte_full_1_c;
2693 *yuv2packedX = yuv2bgr8_full_X_c;
2694 *yuv2packed2 = yuv2bgr8_full_2_c;
2695 *yuv2packed1 = yuv2bgr8_full_1_c;
2698 *yuv2packedX = yuv2rgb8_full_X_c;
2699 *yuv2packed2 = yuv2rgb8_full_2_c;
2700 *yuv2packed1 = yuv2rgb8_full_1_c;
2725 if (!*yuv2packedX && !*yuv2anyX)
2729 switch (dstFormat) {
2731 #if CONFIG_SWSCALE_ALPHA
2733 *yuv2packed1 = yuv2rgba64le_1_c;
2734 *yuv2packed2 = yuv2rgba64le_2_c;
2735 *yuv2packedX = yuv2rgba64le_X_c;
2739 *yuv2packed1 = yuv2rgbx64le_1_c;
2740 *yuv2packed2 = yuv2rgbx64le_2_c;
2741 *yuv2packedX = yuv2rgbx64le_X_c;
2745 #if CONFIG_SWSCALE_ALPHA
2747 *yuv2packed1 = yuv2rgba64be_1_c;
2748 *yuv2packed2 = yuv2rgba64be_2_c;
2749 *yuv2packedX = yuv2rgba64be_X_c;
2753 *yuv2packed1 = yuv2rgbx64be_1_c;
2754 *yuv2packed2 = yuv2rgbx64be_2_c;
2755 *yuv2packedX = yuv2rgbx64be_X_c;
2759 #if CONFIG_SWSCALE_ALPHA
2761 *yuv2packed1 = yuv2bgra64le_1_c;
2762 *yuv2packed2 = yuv2bgra64le_2_c;
2763 *yuv2packedX = yuv2bgra64le_X_c;
2767 *yuv2packed1 = yuv2bgrx64le_1_c;
2768 *yuv2packed2 = yuv2bgrx64le_2_c;
2769 *yuv2packedX = yuv2bgrx64le_X_c;
2773 #if CONFIG_SWSCALE_ALPHA
2775 *yuv2packed1 = yuv2bgra64be_1_c;
2776 *yuv2packed2 = yuv2bgra64be_2_c;
2777 *yuv2packedX = yuv2bgra64be_X_c;
2781 *yuv2packed1 = yuv2bgrx64be_1_c;
2782 *yuv2packed2 = yuv2bgrx64be_2_c;
2783 *yuv2packedX = yuv2bgrx64be_X_c;
2787 *yuv2packed1 = yuv2rgb48le_1_c;
2788 *yuv2packed2 = yuv2rgb48le_2_c;
2789 *yuv2packedX = yuv2rgb48le_X_c;
2792 *yuv2packed1 = yuv2rgb48be_1_c;
2793 *yuv2packed2 = yuv2rgb48be_2_c;
2794 *yuv2packedX = yuv2rgb48be_X_c;
2797 *yuv2packed1 = yuv2bgr48le_1_c;
2798 *yuv2packed2 = yuv2bgr48le_2_c;
2799 *yuv2packedX = yuv2bgr48le_X_c;
2802 *yuv2packed1 = yuv2bgr48be_1_c;
2803 *yuv2packed2 = yuv2bgr48be_2_c;
2804 *yuv2packedX = yuv2bgr48be_X_c;
2806 case AV_PIX_FMT_RGB32:
2809 *yuv2packed1 = yuv2rgb32_1_c;
2810 *yuv2packed2 = yuv2rgb32_2_c;
2811 *yuv2packedX = yuv2rgb32_X_c;
2813 #if CONFIG_SWSCALE_ALPHA
2815 *yuv2packed1 = yuv2rgba32_1_c;
2816 *yuv2packed2 = yuv2rgba32_2_c;
2817 *yuv2packedX = yuv2rgba32_X_c;
2821 *yuv2packed1 = yuv2rgbx32_1_c;
2822 *yuv2packed2 = yuv2rgbx32_2_c;
2823 *yuv2packedX = yuv2rgbx32_X_c;
2830 *yuv2packed1 = yuv2rgb32_1_1_c;
2831 *yuv2packed2 = yuv2rgb32_1_2_c;
2832 *yuv2packedX = yuv2rgb32_1_X_c;
2834 #if CONFIG_SWSCALE_ALPHA
2836 *yuv2packed1 = yuv2rgba32_1_1_c;
2837 *yuv2packed2 = yuv2rgba32_1_2_c;
2838 *yuv2packedX = yuv2rgba32_1_X_c;
2842 *yuv2packed1 = yuv2rgbx32_1_1_c;
2843 *yuv2packed2 = yuv2rgbx32_1_2_c;
2844 *yuv2packedX = yuv2rgbx32_1_X_c;
2849 *yuv2packed1 = yuv2rgb24_1_c;
2850 *yuv2packed2 = yuv2rgb24_2_c;
2851 *yuv2packedX = yuv2rgb24_X_c;
2854 *yuv2packed1 = yuv2bgr24_1_c;
2855 *yuv2packed2 = yuv2bgr24_2_c;
2856 *yuv2packedX = yuv2bgr24_X_c;
2862 *yuv2packed1 = yuv2rgb16_1_c;
2863 *yuv2packed2 = yuv2rgb16_2_c;
2864 *yuv2packedX = yuv2rgb16_X_c;
2870 *yuv2packed1 = yuv2rgb15_1_c;
2871 *yuv2packed2 = yuv2rgb15_2_c;
2872 *yuv2packedX = yuv2rgb15_X_c;
2878 *yuv2packed1 = yuv2rgb12_1_c;
2879 *yuv2packed2 = yuv2rgb12_2_c;
2880 *yuv2packedX = yuv2rgb12_X_c;
2884 *yuv2packed1 = yuv2rgb8_1_c;
2885 *yuv2packed2 = yuv2rgb8_2_c;
2886 *yuv2packedX = yuv2rgb8_X_c;
2890 *yuv2packed1 = yuv2rgb4_1_c;
2891 *yuv2packed2 = yuv2rgb4_2_c;
2892 *yuv2packedX = yuv2rgb4_X_c;
2896 *yuv2packed1 = yuv2rgb4b_1_c;
2897 *yuv2packed2 = yuv2rgb4b_2_c;
2898 *yuv2packedX = yuv2rgb4b_X_c;
2902 switch (dstFormat) {
2904 *yuv2packed1 = yuv2monowhite_1_c;
2905 *yuv2packed2 = yuv2monowhite_2_c;
2906 *yuv2packedX = yuv2monowhite_X_c;
2909 *yuv2packed1 = yuv2monoblack_1_c;
2910 *yuv2packed2 = yuv2monoblack_2_c;
2911 *yuv2packedX = yuv2monoblack_X_c;
2914 *yuv2packed1 = yuv2yuyv422_1_c;
2915 *yuv2packed2 = yuv2yuyv422_2_c;
2916 *yuv2packedX = yuv2yuyv422_X_c;
2919 *yuv2packed1 = yuv2yvyu422_1_c;
2920 *yuv2packed2 = yuv2yvyu422_2_c;
2921 *yuv2packedX = yuv2yvyu422_X_c;
2924 *yuv2packed1 = yuv2uyvy422_1_c;
2925 *yuv2packed2 = yuv2uyvy422_2_c;
2926 *yuv2packedX = yuv2uyvy422_X_c;
2934 *yuv2packed1 = yuv2ya16le_1_c;
2935 *yuv2packed2 = yuv2ya16le_2_c;
2936 *yuv2packedX = yuv2ya16le_X_c;
2939 *yuv2packed1 = yuv2ya16be_1_c;
2940 *yuv2packed2 = yuv2ya16be_2_c;
2941 *yuv2packedX = yuv2ya16be_X_c;
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
IEEE-754 single precision Y, 32bpp, big-endian.
planar GBR 4:4:4:4 40bpp, little-endian
const char const char void * val
static av_always_inline void yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha)
static void yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter, const int16_t **_lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **_chrUSrc, const int16_t **_chrVSrc, int chrFilterSize, const int16_t **_alpSrc, uint8_t *dest, int dstW, int y)
av_cold void ff_sws_init_output_funcs(SwsContext *c, yuv2planar1_fn *yuv2plane1, yuv2planarX_fn *yuv2planeX, yuv2interleavedX_fn *yuv2nv12cX, yuv2packed1_fn *yuv2packed1, yuv2packed2_fn *yuv2packed2, yuv2packedX_fn *yuv2packedX, yuv2anyX_fn *yuv2anyX)
static void yuv2gbrp16_full_X_c(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrcx, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrcx, const int16_t **chrVSrcx, int chrFilterSize, const int16_t **alpSrcx, uint8_t **dest, int dstW, int y)
static int shift(int a, int b)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define YUVRGB_TABLE_HEADROOM
static void yuv2p010lX_BE_c(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
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...
packed RGB 8:8:8, 24bpp, RGBRGB...
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
#define accumulate_bit(acc, val)
static void yuv2rgb(uint8_t *out, int ridx, int Y, int U, int V)
const uint8_t ff_dither_2x2_8[][8]
static av_always_inline void yuv2rgb_full_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha)
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...
static void yuv2p010l1_LE_c(const int16_t *src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
uint8_t * table_bU[256+2 *YUVRGB_TABLE_HEADROOM]
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
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
#define AV_PIX_FMT_RGB444
planar GBR 4:4:4 36bpp, big-endian
const uint8_t ff_dither_8x8_220[][8]
static av_always_inline void yuv2plane1_16_c_template(const int32_t *src, uint16_t *dest, int dstW, int big_endian, int output_bits)
static av_always_inline void yuv2planeX_16_c_template(const int16_t *filter, int filterSize, const int32_t **src, uint16_t *dest, int dstW, int big_endian, int output_bits)
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
#define output_pixels(pos, Y1, U, Y2, V)
Macro definitions for various function/variable attributes.
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
const uint8_t ff_dither_8x8_32[][8]
planar GBRA 4:4:4:4 64bpp, big-endian
#define av_assert0(cond)
assert() equivalent, that is always enabled.
const uint8_t ff_dither_2x2_4[][8]
static void filter(int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, int clip)
void(* yuv2interleavedX_fn)(struct SwsContext *c, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest, int dstW)
Write one line of horizontally scaled chroma to interleaved output with multi-point vertical scaling ...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
const uint8_t ff_dither_4x4_16[][8]
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
static av_always_inline void yuv2ya16_2_c_template(SwsContext *c, const int32_t *buf[2], const int32_t *unused_ubuf[2], const int32_t *unused_vbuf[2], const int32_t *abuf[2], uint16_t *dest, int dstW, int yalpha, int unused_uvalpha, int y, enum AVPixelFormat target, int unused_hasAlpha, int unused_eightbytes)
void(* yuv2anyX_fn)(struct SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t **dest, int dstW, int y)
Write one line of horizontally scaled Y/U/V/A to YUV/RGB output by doing multi-point vertical scaling...
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
static void yuv2ya8_2_c(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined ...
#define SWS_FULL_CHR_H_INT
#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...
static void yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t **dest, int dstW, int y)
static av_always_inline void yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum AVPixelFormat target)
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
planar GBR 4:4:4 48bpp, big-endian
static av_always_inline void yuv2rgb_full_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha)
static av_always_inline void yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y, enum AVPixelFormat target, int hasAlpha)
enum AVPixelFormat dstFormat
Destination pixel format.
uint8_t * table_gU[256+2 *YUVRGB_TABLE_HEADROOM]
static void yuv2p010cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest8, int chrDstW)
static void yuv2p010l1_c(const int16_t *src, uint16_t *dest, int dstW, int big_endian)
#define yuv2planeX_float(template, dest_type, BE_LE)
void(* yuv2packed1_fn)(struct SwsContext *c, const int16_t *lumSrc, const int16_t *chrUSrc[2], const int16_t *chrVSrc[2], const int16_t *alpSrc, uint8_t *dest, int dstW, int uvalpha, int y)
Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output without any additional v...
planar GBR 4:4:4 27bpp, big-endian
#define AV_PIX_FMT_BGR32_1
static av_always_inline void yuv2rgba64_full_1_c_template(SwsContext *c, const int32_t *buf0, const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf0, uint16_t *dest, int dstW, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes)
16 bits gray, 16 bits alpha (big-endian)
like NV12, with 16bpp per component, big-endian
static void yuv2p010l1_BE_c(const int16_t *src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
static const uint8_t dither[8][8]
static av_always_inline void yuv2rgba64_X_c_template(SwsContext *c, const int16_t *lumFilter, const int32_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int32_t **chrUSrc, const int32_t **chrVSrc, int chrFilterSize, const int32_t **alpSrc, uint16_t *dest, int dstW, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes)
static void yuv2p010lX_LE_c(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
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().
like NV12, with 16bpp per component, little-endian
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian
static av_always_inline void yuv2planeX_10_c_template(const int16_t *filter, int filterSize, const int16_t **src, uint16_t *dest, int dstW, int big_endian, int output_bits)
static const uint8_t offset[127][2]
static av_always_inline void yuv2plane1_float_c_template(const int32_t *src, float *dest, int dstW)
#define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t)
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...
static av_always_inline void yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum AVPixelFormat target)
static av_always_inline void yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y, enum AVPixelFormat target)
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
as above, but U and V bytes are swapped
planar GBR 4:4:4:4 48bpp, big-endian
void(* yuv2planar1_fn)(const int16_t *src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
Write one line of horizontally scaled data to planar output without any additional vertical scaling (...
static av_always_inline void yuv2planeX_float_c_template(const int16_t *filter, int filterSize, const int32_t **src, float *dest, int dstW)
planar GBR 4:4:4:4 40bpp, big-endian
static void yuv2ya8_X_c(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
static av_always_inline void yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y, enum AVPixelFormat target)
static av_always_inline void yuv2plane1_float_bswap_c_template(const int32_t *src, uint32_t *dest, int dstW)
static void yuv2plane1_8_c(const int16_t *src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
int table_gV[256+2 *YUVRGB_TABLE_HEADROOM]
packed RGB 8:8:8, 24bpp, BGRBGR...
uint8_t * table_rV[256+2 *YUVRGB_TABLE_HEADROOM]
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian
static av_always_inline void yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter, const int32_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int32_t **unused_chrUSrc, const int32_t **unused_chrVSrc, int unused_chrFilterSize, const int32_t **alpSrc, uint16_t *dest, int dstW, int y, enum AVPixelFormat target, int unused_hasAlpha, int unused_eightbytes)
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
planar GBR 4:4:4:4 48bpp, little-endian
#define AV_PIX_FMT_BGR555
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
#define YUV2PACKED16WRAPPER(name, base, ext, fmt, hasAlpha, eightbytes)
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
static av_always_inline void yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y, enum AVPixelFormat target)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
static void yuv2ya8_1_c(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y)
planar GBR 4:4:4 30bpp, big-endian
static av_always_inline void yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha)
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
planar GBR 4:4:4 42bpp, little-endian
const uint8_t ff_dither_8x8_73[][8]
static av_always_inline void yuv2422_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y, enum AVPixelFormat target)
planar GBR 4:4:4 42bpp, big-endian
static av_always_inline void yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, unsigned A1, unsigned A2, const void *_r, const void *_g, const void *_b, int y, enum AVPixelFormat target, int hasAlpha)
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined ...
static av_always_inline void yuv2rgba64_full_X_c_template(SwsContext *c, const int16_t *lumFilter, const int32_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int32_t **chrUSrc, const int32_t **chrVSrc, int chrFilterSize, const int32_t **alpSrc, uint16_t *dest, int dstW, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes)
static void yuv2p010lX_c(const int16_t *filter, int filterSize, const int16_t **src, uint16_t *dest, int dstW, int big_endian)
static av_always_inline uint32_t av_float2int(float f)
Reinterpret a float as a 32-bit integer.
static av_always_inline void yuv2planeX_float_bswap_c_template(const int16_t *filter, int filterSize, const int32_t **src, uint32_t *dest, int dstW)
#define YUV2RGBWRAPPER(name, base, ext, fmt, hasAlpha)
#define AV_PIX_FMT_BGR565
const uint8_t * chrDither8
static av_always_inline void yuv2ya16_1_c_template(SwsContext *c, const int32_t *buf0, const int32_t *unused_ubuf[2], const int32_t *unused_vbuf[2], const int32_t *abuf0, uint16_t *dest, int dstW, int unused_uvalpha, int y, enum AVPixelFormat target, int unused_hasAlpha, int unused_eightbytes)
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
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
void(* yuv2planarX_fn)(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
Write one line of horizontally scaled data to planar output with multi-point vertical scaling between...
void(* yuv2packed2_fn)(struct SwsContext *c, const int16_t *lumSrc[2], const int16_t *chrUSrc[2], const int16_t *chrVSrc[2], const int16_t *alpSrc[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)
Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output by doing bilinear scalin...
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
static av_always_inline void yuv2rgb_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y, enum AVPixelFormat target, int hasAlpha)
planar GBR 4:4:4 27bpp, little-endian
void(* yuv2packedX_fn)(struct SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output by doing multi-point ver...
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
#define AV_PIX_FMT_BGR444
#define output_pixel(pos, val, bias, signedness)
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
#define AV_PIX_FMT_RGB555
static av_always_inline void yuv2rgb_write_full(SwsContext *c, uint8_t *dest, int i, int Y, int A, int U, int V, int y, enum AVPixelFormat target, int hasAlpha, int err[4])
static av_always_inline void yuv2rgba64_full_2_c_template(SwsContext *c, const int32_t *buf[2], const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf[2], uint16_t *dest, int dstW, int yalpha, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes)
static av_always_inline void yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0, const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf0, uint16_t *dest, int dstW, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes)
#define AV_PIX_FMT_RGB32_1
static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest, int chrDstW)
static av_always_inline void yuv2rgba64_2_c_template(SwsContext *c, const int32_t *buf[2], const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf[2], uint16_t *dest, int dstW, int yalpha, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes)
16 bits gray, 16 bits alpha (little-endian)
#define AV_PIX_FMT_RGB565
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 ...
#define yuv2plane1_float(template, dest_type, BE_LE)
static void yuv2p016cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest8, int chrDstW)
int depth
Number of bits in the component.
IEEE-754 single precision Y, 32bpp, little-endian.
planar GBRA 4:4:4:4 64bpp, little-endian
#define YUV2PACKEDWRAPPER(name, base, ext, fmt)
int flags
Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc...
AVPixelFormat
Pixel format.
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