41{ 1, 3, 1, 3, 1, 3, 1, 3, },
42{ 2, 0, 2, 0, 2, 0, 2, 0, },
43{ 1, 3, 1, 3, 1, 3, 1, 3, },
47{ 6, 2, 6, 2, 6, 2, 6, 2, },
48{ 0, 4, 0, 4, 0, 4, 0, 4, },
49{ 6, 2, 6, 2, 6, 2, 6, 2, },
53{ 8, 4, 11, 7, 8, 4, 11, 7, },
54{ 2, 14, 1, 13, 2, 14, 1, 13, },
55{ 10, 6, 9, 5, 10, 6, 9, 5, },
56{ 0, 12, 3, 15, 0, 12, 3, 15, },
57{ 8, 4, 11, 7, 8, 4, 11, 7, },
61{ 17, 9, 23, 15, 16, 8, 22, 14, },
62{ 5, 29, 3, 27, 4, 28, 2, 26, },
63{ 21, 13, 19, 11, 20, 12, 18, 10, },
64{ 0, 24, 6, 30, 1, 25, 7, 31, },
65{ 16, 8, 22, 14, 17, 9, 23, 15, },
66{ 4, 28, 2, 26, 5, 29, 3, 27, },
67{ 20, 12, 18, 10, 21, 13, 19, 11, },
68{ 1, 25, 7, 31, 0, 24, 6, 30, },
69{ 17, 9, 23, 15, 16, 8, 22, 14, },
73{ 0, 55, 14, 68, 3, 58, 17, 72, },
74{ 37, 18, 50, 32, 40, 22, 54, 35, },
75{ 9, 64, 5, 59, 13, 67, 8, 63, },
76{ 46, 27, 41, 23, 49, 31, 44, 26, },
77{ 2, 57, 16, 71, 1, 56, 15, 70, },
78{ 39, 21, 52, 34, 38, 19, 51, 33, },
79{ 11, 66, 7, 62, 10, 65, 6, 60, },
80{ 48, 30, 43, 25, 47, 29, 42, 24, },
81{ 0, 55, 14, 68, 3, 58, 17, 72, },
86{117, 62, 158, 103, 113, 58, 155, 100, },
87{ 34, 199, 21, 186, 31, 196, 17, 182, },
88{144, 89, 131, 76, 141, 86, 127, 72, },
89{ 0, 165, 41, 206, 10, 175, 52, 217, },
90{110, 55, 151, 96, 120, 65, 162, 107, },
91{ 28, 193, 14, 179, 38, 203, 24, 189, },
92{138, 83, 124, 69, 148, 93, 134, 79, },
93{ 7, 172, 48, 213, 3, 168, 45, 210, },
94{117, 62, 158, 103, 113, 58, 155, 100, },
99{ 0, 143, 18, 200, 2, 156, 25, 215, },
100{ 78, 28, 125, 64, 89, 36, 138, 74, },
101{ 10, 180, 3, 161, 16, 195, 8, 175, },
102{109, 51, 93, 38, 121, 60, 105, 47, },
103{ 1, 152, 23, 210, 0, 147, 20, 205, },
104{ 85, 33, 134, 71, 81, 30, 130, 67, },
105{ 14, 190, 6, 171, 12, 185, 5, 166, },
106{117, 57, 101, 44, 113, 54, 97, 41, },
107{ 0, 143, 18, 200, 2, 156, 25, 215, },
112{ 0, 124, 8, 193, 0, 140, 12, 213, },
113{ 55, 14, 104, 42, 66, 19, 119, 52, },
114{ 3, 168, 1, 145, 6, 187, 3, 162, },
115{ 86, 31, 70, 21, 99, 39, 82, 28, },
116{ 0, 134, 11, 206, 0, 129, 9, 200, },
117{ 62, 17, 114, 48, 58, 16, 109, 45, },
118{ 5, 181, 2, 157, 4, 175, 1, 151, },
119{ 95, 36, 78, 26, 90, 34, 74, 24, },
120{ 0, 124, 8, 193, 0, 140, 12, 213, },
125{ 0, 107, 3, 187, 0, 125, 6, 212, },
126{ 39, 7, 86, 28, 49, 11, 102, 36, },
127{ 1, 158, 0, 131, 3, 180, 1, 151, },
128{ 68, 19, 52, 12, 81, 25, 64, 17, },
129{ 0, 119, 5, 203, 0, 113, 4, 195, },
130{ 45, 9, 96, 33, 42, 8, 91, 30, },
131{ 2, 172, 1, 144, 2, 165, 0, 137, },
132{ 77, 23, 60, 15, 72, 21, 56, 14, },
133{ 0, 107, 3, 187, 0, 125, 6, 212, },
140#define IS_BE(ENDIAN_IDENTIFIER) IS_BE_ ## ENDIAN_IDENTIFIER
142#define output_pixel(pos, val, bias, signedness) \
144 AV_WB16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \
146 AV_WL16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \
151 int big_endian,
int output_bits)
157 for (
i = 0;
i < dstW;
i++) {
165 const int32_t **
src, uint16_t *dest,
int dstW,
166 int big_endian,
int output_bits)
172 for (
i = 0;
i < dstW;
i++) {
182 for (j = 0; j < filterSize; j++)
191 const int16_t *chrFilter,
int chrFilterSize,
192 const int16_t **chrUSrc,
const int16_t **chrVSrc,
193 uint8_t *dest8,
int chrDstW,
int output_bits)
195 uint16_t *dest = (uint16_t*)dest8;
202 for (
i = 0;
i < chrDstW;
i++) {
204 int v = 1 << (
shift - 1);
209 for (j = 0; j < chrFilterSize; j++) {
210 u += uSrc[j][
i] * (unsigned)chrFilter[j];
211 v += vSrc[j][
i] * (unsigned)chrFilter[j];
223 static const int big_endian = HAVE_BIGENDIAN;
224 static const int shift = 3;
225 static const float float_mult = 1.0f / 65535.0f;
229 for (
i = 0;
i < dstW; ++
i){
240 static const int big_endian = HAVE_BIGENDIAN;
241 static const int shift = 3;
242 static const float float_mult = 1.0f / 65535.0f;
246 for (
i = 0;
i < dstW; ++
i){
255 float *dest,
int dstW, ptrdiff_t
stride)
257 static const int big_endian = HAVE_BIGENDIAN;
258 static const int shift = 15;
259 static const float float_mult = 1.0f / 65535.0f;
263 for (
i = 0;
i < dstW; ++
i){
264 val = (1 << (
shift - 1)) - 0x40000000;
265 for (j = 0; j < filterSize; ++j){
275 uint32_t *dest,
int dstW, ptrdiff_t
stride)
277 static const int big_endian = HAVE_BIGENDIAN;
278 static const int shift = 15;
279 static const float float_mult = 1.0f / 65535.0f;
283 for (
i = 0;
i < dstW; ++
i){
284 val = (1 << (
shift - 1)) - 0x40000000;
285 for (j = 0; j < filterSize; ++j){
293#define yuv2plane1_float(template, dest_type, BE_LE) \
294static void yuv2plane1_float ## BE_LE ## _c(const int16_t *src, uint8_t *dest, int dstW, \
295 const uint8_t *dither, int offset) \
297 template((const int32_t *)src, (dest_type *)dest, dstW, 1); \
300#define yuv2planeX_float(template, dest_type, BE_LE) \
301static void yuv2planeX_float ## BE_LE ## _c(const int16_t *filter, int filterSize, \
302 const int16_t **src, uint8_t *dest, int dstW, \
303 const uint8_t *dither, int offset) \
305 template(filter, filterSize, (const int32_t **)src, (dest_type *)dest, dstW, 1); \
322#define output_pixel(pos, val) \
324 AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits)); \
326 AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits)); \
330yuv2plane1_10_c_template(
const int16_t *
src, uint16_t *dest,
int dstW,
331 int big_endian,
int output_bits)
334 int shift = 15 - output_bits;
336 for (
i = 0;
i < dstW;
i++) {
344 const int16_t **
src, uint16_t *dest,
int dstW,
345 int big_endian,
int output_bits)
348 int shift = 11 + 16 - output_bits;
350 for (
i = 0;
i < dstW;
i++) {
354 for (j = 0; j < filterSize; j++)
363#define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t) \
364static void yuv2plane1_ ## bits ## BE_LE ## _c(const int16_t *src, \
365 uint8_t *dest, int dstW, \
366 const uint8_t *dither, int offset)\
368 yuv2plane1_ ## template_size ## _c_template((const typeX_t *) src, \
369 (uint16_t *) dest, dstW, is_be, bits); \
371static void yuv2planeX_ ## bits ## BE_LE ## _c(const int16_t *filter, int filterSize, \
372 const int16_t **src, uint8_t *dest, int dstW, \
373 const uint8_t *dither, int offset)\
375 yuv2planeX_## template_size ## _c_template(filter, \
376 filterSize, (const typeX_t **) src, \
377 (uint16_t *) dest, dstW, is_be, bits); \
391#define output_pixel(pos, val) \
393 AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits) << (16 - output_bits)); \
395 AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits) << (16 - output_bits)); \
399yuv2msbplane1_10_c_template(
const int16_t *
src, uint16_t *dest,
int dstW,
400 int big_endian,
int output_bits)
403 int shift = 15 - output_bits;
405 for (
i = 0;
i < dstW;
i++) {
413 const int16_t **
src, uint16_t *dest,
int dstW,
414 int big_endian,
int output_bits)
417 int shift = 11 + 16 - output_bits;
419 for (
i = 0;
i < dstW;
i++) {
423 for (j = 0; j < filterSize; j++)
430#define yuv2MSBNBPS(bits, BE_LE, is_be, template_size, typeX_t) \
431static void yuv2msbplane1_ ## bits ## BE_LE ## _c(const int16_t *src, \
432 uint8_t *dest, int dstW, \
433 const uint8_t *dither, int offset)\
435 yuv2msbplane1_ ## template_size ## _c_template((const typeX_t *) src, \
436 (uint16_t *) dest, dstW, is_be, bits); \
438static void yuv2msbplaneX_ ## bits ## BE_LE ## _c(const int16_t *filter, int filterSize, \
439 const int16_t **src, uint8_t *dest, int dstW, \
440 const uint8_t *dither, int offset)\
442 yuv2msbplaneX_## template_size ## _c_template(filter, \
443 filterSize, (const typeX_t **) src, \
444 (uint16_t *) dest, dstW, is_be, bits); \
454static void yuv2nv12cX_16LE_c(
enum AVPixelFormat dstFormat,
const uint8_t *chrDither,
455 const int16_t *chrFilter,
int chrFilterSize,
456 const int16_t **chrUSrc,
const int16_t **chrVSrc,
457 uint8_t *dest8,
int chrDstW)
463 const int16_t *chrFilter,
int chrFilterSize,
464 const int16_t **chrUSrc,
const int16_t **chrVSrc,
465 uint8_t *dest8,
int chrDstW)
471 const int16_t **
src, uint8_t *dest,
int dstW,
475 for (
i=0;
i<dstW;
i++) {
478 for (j=0; j<filterSize; j++) {
491 for (
i=0;
i<dstW;
i++) {
498 const int16_t *chrFilter,
int chrFilterSize,
499 const int16_t **chrUSrc,
const int16_t **chrVSrc,
500 uint8_t *dest,
int chrDstW)
505 for (
i=0;
i<chrDstW;
i++) {
506 int u = chrDither[
i & 7] << 12;
507 int v = chrDither[(
i + 3) & 7] << 12;
509 for (j=0; j<chrFilterSize; j++) {
510 u += chrUSrc[j][
i] * (unsigned)chrFilter[j];
511 v += chrVSrc[j][
i] * (unsigned)chrFilter[j];
518 for (
i=0;
i<chrDstW;
i++) {
519 int u = chrDither[
i & 7] << 12;
520 int v = chrDither[(
i + 3) & 7] << 12;
522 for (j=0; j<chrFilterSize; j++) {
523 u += chrUSrc[j][
i] * (unsigned)chrFilter[j];
524 v += chrVSrc[j][
i] * (unsigned)chrFilter[j];
533#define output_pixel(pos, val) \
535 AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits) << output_shift); \
537 AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits) << output_shift); \
541 uint16_t *dest,
int dstW,
542 int big_endian,
int output_bits,
int output_shift)
545 int shift = 15 - output_bits;
547 for (
i = 0;
i < dstW;
i++) {
554 const int16_t **
src, uint16_t *dest,
int dstW,
555 int big_endian,
int output_bits,
int output_shift)
558 int shift = 11 + 16 - output_bits;
560 for (
i = 0;
i < dstW;
i++) {
563 for (j = 0; j < filterSize; j++)
571 const int16_t *chrFilter,
int chrFilterSize,
572 const int16_t **chrUSrc,
const int16_t **chrVSrc,
573 uint8_t *dest8,
int chrDstW,
int output_bits,
int output_shift)
575 uint16_t *dest = (uint16_t*)dest8;
577 int shift = 11 + 16 - output_bits;
579 for (
i = 0;
i < chrDstW;
i++) {
581 int v = 1 << (
shift - 1);
583 for (j = 0; j < chrFilterSize; j++) {
584 u += chrUSrc[j][
i] * (unsigned)chrFilter[j];
585 v += chrVSrc[j][
i] * (unsigned)chrFilter[j];
595#define yuv2p01x_wrapper(fmt, bits, shift) \
596 static void yuv2 ## fmt ## l1_LE_c(const int16_t *src, \
597 uint8_t *dest, int dstW, \
598 const uint8_t *dither, int offset) \
600 yuv2p01xl1_c(src, (uint16_t*)dest, dstW, 0, bits, shift); \
603 static void yuv2 ## fmt ## l1_BE_c(const int16_t *src, \
604 uint8_t *dest, int dstW, \
605 const uint8_t *dither, int offset) \
607 yuv2p01xl1_c(src, (uint16_t*)dest, dstW, 1, bits, shift); \
610 static void yuv2 ## fmt ## lX_LE_c(const int16_t *filter, \
611 int filterSize, const int16_t **src, \
612 uint8_t *dest, int dstW, \
613 const uint8_t *dither, int offset) \
615 yuv2p01xlX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 0, \
619 static void yuv2 ## fmt ## lX_BE_c(const int16_t *filter, \
620 int filterSize, const int16_t **src, \
621 uint8_t *dest, int dstW, \
622 const uint8_t *dither, int offset) \
624 yuv2p01xlX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 1, \
628 static void yuv2 ## fmt ## cX_LE_c(enum AVPixelFormat dstFormat, \
629 const uint8_t *chrDither, \
630 const int16_t *chrFilter, \
632 const int16_t **chrUSrc, \
633 const int16_t **chrVSrc, \
634 uint8_t *dest8, int chrDstW) \
636 yuv2p01xcX_c(0, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, \
637 dest8, chrDstW, bits, shift); \
640 static void yuv2 ## fmt ## cX_BE_c(enum AVPixelFormat dstFormat, \
641 const uint8_t *chrDither, \
642 const int16_t *chrFilter, \
644 const int16_t **chrUSrc, \
645 const int16_t **chrVSrc, \
646 uint8_t *dest8, int chrDstW) \
648 yuv2p01xcX_c(1, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, \
649 dest8, chrDstW, bits, shift); \
656#define accumulate_bit(acc, val) \
659#define output_pixel(pos, acc) \
660 if (target == AV_PIX_FMT_MONOBLACK) { \
667yuv2mono_X_c_template(
SwsInternal *
c,
const int16_t *lumFilter,
668 const int16_t **lumSrc,
int lumFilterSize,
669 const int16_t *chrFilter,
const int16_t **chrUSrc,
670 const int16_t **chrVSrc,
int chrFilterSize,
671 const int16_t **alpSrc, uint8_t *dest,
int dstW,
679 for (
i = 0;
i < dstW;
i += 2) {
684 for (j = 0; j < lumFilterSize; j++) {
685 Y1 += lumSrc[j][
i] * (unsigned)lumFilter[j];
686 Y2 += lumSrc[j][
i+1] * (unsigned)lumFilter[j];
690 if ((Y1 | Y2) & 0x100) {
695 Y1 += (7*err + 1*
c->dither_error[0][
i] + 5*
c->dither_error[0][
i+1] + 3*
c->dither_error[0][
i+2] + 8 - 256)>>4;
696 c->dither_error[0][
i] = err;
697 acc = 2*acc + (Y1 >= 128);
700 err = Y2 + ((7*Y1 + 1*
c->dither_error[0][
i+1] + 5*
c->dither_error[0][
i+2] + 3*
c->dither_error[0][
i+3] + 8 - 256)>>4);
701 c->dither_error[0][
i+1] = Y1;
702 acc = 2*acc + (err >= 128);
712 c->dither_error[0][
i] = err;
721 const int16_t *ubuf[2],
const int16_t *vbuf[2],
722 const int16_t *abuf[2], uint8_t *dest,
int dstW,
723 int yalpha,
int uvalpha,
int y,
726 const int16_t *buf0 = buf[0], *buf1 = buf[1];
728 int yalpha1 = 4096 - yalpha;
735 for (
i = 0;
i < dstW;
i +=2) {
738 Y = (buf0[
i + 0] * yalpha1 + buf1[
i + 0] * yalpha) >> 19;
739 Y += (7*err + 1*
c->dither_error[0][
i] + 5*
c->dither_error[0][
i+1] + 3*
c->dither_error[0][
i+2] + 8 - 256)>>4;
740 c->dither_error[0][
i] = err;
741 acc = 2*acc + (
Y >= 128);
744 err = (buf0[
i + 1] * yalpha1 + buf1[
i + 1] * yalpha) >> 19;
745 err += (7*
Y + 1*
c->dither_error[0][
i+1] + 5*
c->dither_error[0][
i+2] + 3*
c->dither_error[0][
i+3] + 8 - 256)>>4;
746 c->dither_error[0][
i+1] =
Y;
747 acc = 2*acc + (err >= 128);
753 c->dither_error[0][
i] = err;
757 for (
i = 0;
i < dstW;
i += 8) {
761 Y = (buf0[
i + 0] * yalpha1 + buf1[
i + 0] * yalpha) >> 19;
763 Y = (buf0[
i + 1] * yalpha1 + buf1[
i + 1] * yalpha) >> 19;
765 Y = (buf0[
i + 2] * yalpha1 + buf1[
i + 2] * yalpha) >> 19;
767 Y = (buf0[
i + 3] * yalpha1 + buf1[
i + 3] * yalpha) >> 19;
769 Y = (buf0[
i + 4] * yalpha1 + buf1[
i + 4] * yalpha) >> 19;
771 Y = (buf0[
i + 5] * yalpha1 + buf1[
i + 5] * yalpha) >> 19;
773 Y = (buf0[
i + 6] * yalpha1 + buf1[
i + 6] * yalpha) >> 19;
775 Y = (buf0[
i + 7] * yalpha1 + buf1[
i + 7] * yalpha) >> 19;
785 const int16_t *ubuf[2],
const int16_t *vbuf[2],
786 const int16_t *abuf0, uint8_t *dest,
int dstW,
795 for (
i = 0;
i < dstW;
i +=2) {
798 Y = ((buf0[
i + 0] + 64) >> 7);
799 Y += (7*err + 1*
c->dither_error[0][
i] + 5*
c->dither_error[0][
i+1] + 3*
c->dither_error[0][
i+2] + 8 - 256)>>4;
800 c->dither_error[0][
i] = err;
801 acc = 2*acc + (
Y >= 128);
804 err = ((buf0[
i + 1] + 64) >> 7);
805 err += (7*
Y + 1*
c->dither_error[0][
i+1] + 5*
c->dither_error[0][
i+2] + 3*
c->dither_error[0][
i+3] + 8 - 256)>>4;
806 c->dither_error[0][
i+1] =
Y;
807 acc = 2*acc + (err >= 128);
813 c->dither_error[0][
i] = err;
817 for (
i = 0;
i < dstW;
i += 8) {
836#define YUV2PACKEDWRAPPER(name, base, ext, fmt) \
837static void name ## ext ## _X_c(SwsInternal *c, const int16_t *lumFilter, \
838 const int16_t **lumSrc, int lumFilterSize, \
839 const int16_t *chrFilter, const int16_t **chrUSrc, \
840 const int16_t **chrVSrc, int chrFilterSize, \
841 const int16_t **alpSrc, uint8_t *dest, int dstW, \
844 name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
845 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
846 alpSrc, dest, dstW, y, fmt); \
849static void name ## ext ## _2_c(SwsInternal *c, const int16_t *buf[2], \
850 const int16_t *ubuf[2], const int16_t *vbuf[2], \
851 const int16_t *abuf[2], uint8_t *dest, int dstW, \
852 int yalpha, int uvalpha, int y) \
854 name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
855 dest, dstW, yalpha, uvalpha, y, fmt); \
858static void name ## ext ## _1_c(SwsInternal *c, const int16_t *buf0, \
859 const int16_t *ubuf[2], const int16_t *vbuf[2], \
860 const int16_t *abuf0, uint8_t *dest, int dstW, \
861 int uvalpha, int y) \
863 name ## base ## _1_c_template(c, buf0, ubuf, vbuf, \
864 abuf0, dest, dstW, uvalpha, \
871#define output_pixels(pos, Y1, U, Y2, V) \
872 if (target == AV_PIX_FMT_YUYV422) { \
873 dest[pos + 0] = Y1; \
875 dest[pos + 2] = Y2; \
877 } else if (target == AV_PIX_FMT_YVYU422) { \
878 dest[pos + 0] = Y1; \
880 dest[pos + 2] = Y2; \
884 dest[pos + 1] = Y1; \
886 dest[pos + 3] = Y2; \
891 const int16_t **lumSrc,
int lumFilterSize,
892 const int16_t *chrFilter,
const int16_t **chrUSrc,
893 const int16_t **chrVSrc,
int chrFilterSize,
894 const int16_t **alpSrc, uint8_t *dest,
int dstW,
899 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
906 for (j = 0; j < lumFilterSize; j++) {
907 Y1 += lumSrc[j][
i * 2] * (unsigned)lumFilter[j];
908 Y2 += lumSrc[j][
i * 2 + 1] * (unsigned)lumFilter[j];
910 for (j = 0; j < chrFilterSize; j++) {
911 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
912 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
918 if ((Y1 | Y2 |
U |
V) & 0x100) {
930 const int16_t *ubuf[2],
const int16_t *vbuf[2],
931 const int16_t *abuf[2], uint8_t *dest,
int dstW,
932 int yalpha,
int uvalpha,
int y,
935 const int16_t *buf0 = buf[0], *buf1 = buf[1],
936 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
937 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
938 int yalpha1 = 4096 - yalpha;
939 int uvalpha1 = 4096 - uvalpha;
944 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
945 int Y1 = (buf0[
i * 2] * yalpha1 + buf1[
i * 2] * yalpha) >> 19;
946 int Y2 = (buf0[
i * 2 + 1] * yalpha1 + buf1[
i * 2 + 1] * yalpha) >> 19;
947 int U = (ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha) >> 19;
948 int V = (vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha) >> 19;
950 if ((Y1 | Y2 |
U |
V) & 0x100) {
963 const int16_t *ubuf[2],
const int16_t *vbuf[2],
964 const int16_t *abuf0, uint8_t *dest,
int dstW,
967 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
970 if (uvalpha < 2048) {
971 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
972 int Y1 = (buf0[
i * 2 ]+64) >> 7;
973 int Y2 = (buf0[
i * 2 + 1]+64) >> 7;
974 int U = (ubuf0[
i] +64) >> 7;
975 int V = (vbuf0[
i] +64) >> 7;
977 if ((Y1 | Y2 |
U |
V) & 0x100) {
987 const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
988 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
989 int Y1 = (buf0[
i * 2 ] + 64) >> 7;
990 int Y2 = (buf0[
i * 2 + 1] + 64) >> 7;
991 int U = (ubuf0[
i] + ubuf1[
i]+128) >> 8;
992 int V = (vbuf0[
i] + vbuf1[
i]+128) >> 8;
994 if ((Y1 | Y2 |
U |
V) & 0x100) {
1012#define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE || \
1013 target == AV_PIX_FMT_RGBF32LE || target == AV_PIX_FMT_RGBF32BE || target == AV_PIX_FMT_RGBAF32LE || target == AV_PIX_FMT_RGBAF32BE) ? R : B)
1014#define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE || \
1015 target == AV_PIX_FMT_RGBF32LE || target == AV_PIX_FMT_RGBF32BE || target == AV_PIX_FMT_RGBAF32LE || target == AV_PIX_FMT_RGBAF32BE) ? B : R)
1016#define output_pixel(pos, val) \
1018 AV_WB16(pos, val); \
1020 AV_WL16(pos, val); \
1022#define output_pixel32(pos, val) \
1024 AV_WB32(pos, val); \
1026 AV_WL32(pos, val); \
1034 static const float float_mult = 1.0f / 65535.0f;
1045 const int32_t **lumSrc,
int lumFilterSize,
1046 const int16_t *chrFilter,
const int32_t **unused_chrUSrc,
1047 const int32_t **unused_chrVSrc,
int unused_chrFilterSize,
1048 const int32_t **alpSrc, uint16_t *dest,
int dstW,
1050 int unused_hasAlpha,
int unused_eightbytes,
int is_be)
1052 int hasAlpha = !!alpSrc;
1055 for (
i = 0;
i < dstW;
i++) {
1057 int Y = -0x40000000;
1060 for (j = 0; j < lumFilterSize; j++)
1061 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
1064 Y += (1<<3) + 0x8000;
1068 A = -0x40000000 + (1<<14);
1069 for (j = 0; j < lumFilterSize; j++)
1070 A += alpSrc[j][
i] * (
unsigned)lumFilter[j];
1084 const int32_t *abuf[2], uint16_t *dest,
int dstW,
1085 int yalpha_param,
int unused_uvalpha,
int y,
1087 int unused_eightbytes,
int is_be)
1089 unsigned yalpha = yalpha_param;
1090 int hasAlpha = abuf && abuf[0] && abuf[1];
1091 const int32_t *buf0 = buf[0], *buf1 = buf[1],
1092 *abuf0 = hasAlpha ? abuf[0] :
NULL,
1093 *abuf1 = hasAlpha ? abuf[1] :
NULL;
1094 unsigned yalpha1 = 4096 - yalpha;
1099 for (
i = 0;
i < dstW;
i++) {
1100 int Y = (int)(buf0[
i] * yalpha1 + buf1[
i] * yalpha) >> 15;
1106 A = (int)(abuf0[
i] * yalpha1 + abuf1[
i] * yalpha) >> 15;
1117 const int32_t *abuf0, uint16_t *dest,
int dstW,
1119 int unused_hasAlpha,
int unused_eightbytes,
int is_be)
1121 int hasAlpha = !!abuf0;
1124 for (
i = 0;
i < dstW;
i++) {
1125 int Y = buf0[
i] >> 3;
1142 int R,
int G,
int B,
int A1,
int A2,
1147 static const float float_mult = 1.0f / 65535.0f;
1148 ptrdiff_t
stride = eightbytes ? 16 : 12;
1164 ptrdiff_t
stride = eightbytes ? 8 : 6;
1188 static const float float_mult = 1.0f / 65535.0f;
1189 ptrdiff_t
stride = eightbytes ? 8 : 6;
1196 ptrdiff_t
stride = eightbytes ? 4 : 3;
1207 const int32_t **lumSrc,
int lumFilterSize,
1208 const int16_t *chrFilter,
const int32_t **chrUSrc,
1209 const int32_t **chrVSrc,
int chrFilterSize,
1210 const int32_t **alpSrc, uint16_t *dest,
int dstW,
1211 int y,
enum AVPixelFormat target,
int hasAlpha,
int eightbytes,
1215 int A1 = 0xffff<<14,
A2 = 0xffff<<14;
1217 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
1219 unsigned Y1 = -0x40000000;
1220 unsigned Y2 = -0x40000000;
1221 unsigned U = -(128 << 23);
1222 unsigned V = -(128 << 23);
1225 for (j = 0; j < lumFilterSize; j++) {
1226 Y1 += lumSrc[j][
i * 2] * (unsigned)lumFilter[j];
1227 Y2 += lumSrc[j][
i * 2 + 1] * (unsigned)lumFilter[j];
1229 for (j = 0; j < chrFilterSize; j++) {;
1230 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
1231 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
1237 for (j = 0; j < lumFilterSize; j++) {
1238 A1 += alpSrc[j][
i * 2] * (unsigned)lumFilter[j];
1239 A2 += alpSrc[j][
i * 2 + 1] * (unsigned)lumFilter[j];
1256 Y1 -=
c->yuv2rgb_y_offset;
1257 Y2 -=
c->yuv2rgb_y_offset;
1258 Y1 *=
c->yuv2rgb_y_coeff;
1259 Y2 *=
c->yuv2rgb_y_coeff;
1260 Y1 += (1 << 13) - (1 << 29);
1261 Y2 += (1 << 13) - (1 << 29);
1264 R =
V *
c->yuv2rgb_v2r_coeff;
1265 G =
V *
c->yuv2rgb_v2g_coeff +
U *
c->yuv2rgb_u2g_coeff;
1266 B =
U *
c->yuv2rgb_u2b_coeff;
1268 output_pixel_rgba(dest,
i, Y1, Y2,
R_B,
G,
B_R,
A1,
A2, target, eightbytes, is_be);
1275 const int32_t *abuf[2], uint16_t *dest,
int dstW,
1276 int yalpha_param,
int uvalpha_param,
int y,
1280 unsigned yalpha = yalpha_param;
1281 unsigned uvalpha = uvalpha_param;
1282 const int32_t *buf0 = buf[0], *buf1 = buf[1],
1283 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
1284 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
1285 *abuf0 = hasAlpha ? abuf[0] :
NULL,
1286 *abuf1 = hasAlpha ? abuf[1] :
NULL;
1287 unsigned yalpha1 = 4096 - yalpha;
1288 unsigned uvalpha1 = 4096 - uvalpha;
1290 int A1 = 0xffff<<14,
A2 = 0xffff<<14;
1295 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
1296 unsigned Y1 = (int)(buf0[
i * 2] * yalpha1 + buf1[
i * 2] * yalpha) >> 14;
1297 unsigned Y2 = (int)(buf0[
i * 2 + 1] * yalpha1 + buf1[
i * 2 + 1] * yalpha) >> 14;
1298 int U = (int)(ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha - (128 << 23)) >> 14;
1299 int V = (int)(vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha - (128 << 23)) >> 14;
1302 Y1 -=
c->yuv2rgb_y_offset;
1303 Y2 -=
c->yuv2rgb_y_offset;
1304 Y1 *=
c->yuv2rgb_y_coeff;
1305 Y2 *=
c->yuv2rgb_y_coeff;
1306 Y1 += (1 << 13) - (1 << 29);
1307 Y2 += (1 << 13) - (1 << 29);
1309 R = (
SUINT)
V *
c->yuv2rgb_v2r_coeff;
1310 G = (
SUINT)
V *
c->yuv2rgb_v2g_coeff + (
SUINT)
U *
c->yuv2rgb_u2g_coeff;
1311 B = (
SUINT)
U *
c->yuv2rgb_u2b_coeff;
1314 A1 = (int)(abuf0[
i * 2 ] * yalpha1 + abuf1[
i * 2 ] * yalpha) >> 1;
1315 A2 = (int)(abuf0[
i * 2 + 1] * yalpha1 + abuf1[
i * 2 + 1] * yalpha) >> 1;
1321 output_pixel_rgba(dest,
i, Y1, Y2,
R_B,
G,
B_R,
A1,
A2, target, eightbytes, is_be);
1328 const int32_t *abuf0, uint16_t *dest,
int dstW,
1330 int hasAlpha,
int eightbytes,
int is_be)
1332 const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
1337 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
1338 SUINT Y1 = (buf0[
i * 2] ) >> 2;
1339 SUINT Y2 = (buf0[
i * 2 + 1]) >> 2;
1340 SUINT U = (ubuf0[
i] - (128 << 11)) >> 2;
1341 SUINT V = (vbuf0[
i] - (128 << 11)) >> 2;
1344 Y1 -=
c->yuv2rgb_y_offset;
1345 Y2 -=
c->yuv2rgb_y_offset;
1346 Y1 *=
c->yuv2rgb_y_coeff;
1347 Y2 *=
c->yuv2rgb_y_coeff;
1348 Y1 += (1 << 13) - (1 << 29);
1349 Y2 += (1 << 13) - (1 << 29);
1352 A1 = abuf0[
i * 2 ] * (
SUINT)(1 << 11);
1353 A2 = abuf0[
i * 2 + 1] * (
SUINT)(1 << 11);
1359 R =
V *
c->yuv2rgb_v2r_coeff;
1360 G =
V *
c->yuv2rgb_v2g_coeff +
U *
c->yuv2rgb_u2g_coeff;
1361 B =
U *
c->yuv2rgb_u2b_coeff;
1363 output_pixel_rgba(dest,
i, Y1, Y2,
R_B,
G,
B_R,
A1,
A2, target, eightbytes, is_be);
1366 const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
1368 unsigned uvalpha1 = 4096 - uvalpha;
1371 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
1372 SUINT Y1 = (buf0[
i * 2] ) >> 2;
1373 SUINT Y2 = (buf0[
i * 2 + 1]) >> 2;
1374 SUINT U = (int)((
SUINT)ubuf0[
i] * uvalpha1 + (
SUINT)ubuf1[
i] * uvalpha - (128 << 23)) >> 14;
1375 SUINT V = (int)((
SUINT)vbuf0[
i] * uvalpha1 + (
SUINT)vbuf1[
i] * uvalpha - (128 << 23)) >> 14;
1378 Y1 -=
c->yuv2rgb_y_offset;
1379 Y2 -=
c->yuv2rgb_y_offset;
1380 Y1 *=
c->yuv2rgb_y_coeff;
1381 Y2 *=
c->yuv2rgb_y_coeff;
1382 Y1 += (1 << 13) - (1 << 29);
1383 Y2 += (1 << 13) - (1 << 29);
1386 A1 = abuf0[
i * 2 ] * (
SUINT)(1 << 11);
1387 A2 = abuf0[
i * 2 + 1] * (
SUINT)(1 << 11);
1393 R =
V *
c->yuv2rgb_v2r_coeff;
1394 G =
V *
c->yuv2rgb_v2g_coeff +
U *
c->yuv2rgb_u2g_coeff;
1395 B =
U *
c->yuv2rgb_u2b_coeff;
1397 output_pixel_rgba(dest,
i, Y1, Y2,
R_B,
G,
B_R,
A1,
A2, target, eightbytes, is_be);
1404 const int32_t **lumSrc,
int lumFilterSize,
1405 const int16_t *chrFilter,
const int32_t **chrUSrc,
1406 const int32_t **chrVSrc,
int chrFilterSize,
1407 const int32_t **alpSrc, uint16_t *dest,
int dstW,
1409 int eightbytes,
int is_be)
1414 for (
i = 0;
i < dstW;
i++) {
1416 int Y = -0x40000000;
1417 int U = -(128 << 23);
1418 int V = -(128 << 23);
1421 for (j = 0; j < lumFilterSize; j++) {
1422 Y += lumSrc[j][
i] * (unsigned)lumFilter[j];
1424 for (j = 0; j < chrFilterSize; j++) {;
1425 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
1426 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
1431 for (j = 0; j < lumFilterSize; j++) {
1432 A += alpSrc[j][
i] * (unsigned)lumFilter[j];
1445 Y -=
c->yuv2rgb_y_offset;
1446 Y *=
c->yuv2rgb_y_coeff;
1447 Y += (1 << 13) - (1<<29);
1450 R = (unsigned)
V *
c->yuv2rgb_v2r_coeff;
1451 G = (unsigned)
V *
c->yuv2rgb_v2g_coeff + (
unsigned)
U *
c->yuv2rgb_u2g_coeff;
1452 B = (unsigned)
U *
c->yuv2rgb_u2b_coeff;
1461 const int32_t *abuf[2], uint16_t *dest,
int dstW,
1462 int yalpha_param,
int uvalpha_param,
int y,
1466 unsigned yalpha = yalpha_param;
1467 unsigned uvalpha = uvalpha_param;
1468 const int32_t *buf0 = buf[0], *buf1 = buf[1],
1469 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
1470 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
1471 *abuf0 = hasAlpha ? abuf[0] :
NULL,
1472 *abuf1 = hasAlpha ? abuf[1] :
NULL;
1473 unsigned yalpha1 = 4096 - yalpha;
1474 unsigned uvalpha1 = 4096 - uvalpha;
1481 for (
i = 0;
i < dstW;
i++) {
1482 unsigned Y = (int)(buf0[
i] * yalpha1 + buf1[
i] * yalpha) >> 14;
1483 unsigned U = (int)(ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha - (128 << 23)) >> 14;
1484 unsigned V = (int)(vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha - (128 << 23)) >> 14;
1487 Y -=
c->yuv2rgb_y_offset;
1488 Y *=
c->yuv2rgb_y_coeff;
1489 Y += (1 << 13) - (1 << 29);
1491 R =
V *
c->yuv2rgb_v2r_coeff;
1492 G =
V *
c->yuv2rgb_v2g_coeff +
U *
c->yuv2rgb_u2g_coeff;
1493 B =
U *
c->yuv2rgb_u2b_coeff;
1496 A = (int)(abuf0[
i] * yalpha1 + abuf1[
i] * yalpha) >> 1;
1508 const int32_t *abuf0, uint16_t *dest,
int dstW,
1510 int hasAlpha,
int eightbytes,
int is_be)
1512 const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
1517 for (
i = 0;
i < dstW;
i++) {
1519 SUINT U = (ubuf0[
i] - (128 << 11)) >> 2;
1520 SUINT V = (vbuf0[
i] - (128 << 11)) >> 2;
1523 Y -=
c->yuv2rgb_y_offset;
1524 Y *=
c->yuv2rgb_y_coeff;
1525 Y += (1 << 13) - (1 << 29);
1528 A = abuf0[
i] * (
SUINT)(1 << 11);
1533 R =
V *
c->yuv2rgb_v2r_coeff;
1534 G =
V *
c->yuv2rgb_v2g_coeff +
U *
c->yuv2rgb_u2g_coeff;
1535 B =
U *
c->yuv2rgb_u2b_coeff;
1540 const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
1541 unsigned uvalpha1 = 4096 - uvalpha;
1545 for (
i = 0;
i < dstW;
i++) {
1547 SUINT U = (ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha - (128 << 23)) >> 14;
1548 SUINT V = (vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha - (128 << 23)) >> 14;
1551 Y -=
c->yuv2rgb_y_offset;
1552 Y *=
c->yuv2rgb_y_coeff;
1553 Y += (1 << 13) - (1 << 29);
1556 A = abuf0[
i] * (
SUINT)(1 << 11);
1561 R =
V *
c->yuv2rgb_v2r_coeff;
1562 G =
V *
c->yuv2rgb_v2g_coeff +
U *
c->yuv2rgb_u2g_coeff;
1563 B =
U *
c->yuv2rgb_u2b_coeff;
1571#undef output_pixel32
1575#define YUV2PACKED16WRAPPER_EXT(name, base, ext, fmt, is_be, hasAlpha, eightbytes) \
1576static void name ## ext ## _X_c(SwsInternal *c, const int16_t *lumFilter, \
1577 const int16_t **_lumSrc, int lumFilterSize, \
1578 const int16_t *chrFilter, const int16_t **_chrUSrc, \
1579 const int16_t **_chrVSrc, int chrFilterSize, \
1580 const int16_t **_alpSrc, uint8_t *_dest, int dstW, \
1583 const int32_t **lumSrc = (const int32_t **) _lumSrc, \
1584 **chrUSrc = (const int32_t **) _chrUSrc, \
1585 **chrVSrc = (const int32_t **) _chrVSrc, \
1586 **alpSrc = (const int32_t **) _alpSrc; \
1587 uint16_t *dest = (uint16_t *) _dest; \
1588 name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
1589 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
1590 alpSrc, dest, dstW, y, fmt, hasAlpha, eightbytes, is_be); \
1593static void name ## ext ## _2_c(SwsInternal *c, const int16_t *_buf[2], \
1594 const int16_t *_ubuf[2], const int16_t *_vbuf[2], \
1595 const int16_t *_abuf[2], uint8_t *_dest, int dstW, \
1596 int yalpha, int uvalpha, int y) \
1598 const int32_t **buf = (const int32_t **) _buf, \
1599 **ubuf = (const int32_t **) _ubuf, \
1600 **vbuf = (const int32_t **) _vbuf, \
1601 **abuf = (const int32_t **) _abuf; \
1602 uint16_t *dest = (uint16_t *) _dest; \
1603 name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
1604 dest, dstW, yalpha, uvalpha, y, fmt, hasAlpha, eightbytes, is_be); \
1607static void name ## ext ## _1_c(SwsInternal *c, const int16_t *_buf0, \
1608 const int16_t *_ubuf[2], const int16_t *_vbuf[2], \
1609 const int16_t *_abuf0, uint8_t *_dest, int dstW, \
1610 int uvalpha, int y) \
1612 const int32_t *buf0 = (const int32_t *) _buf0, \
1613 **ubuf = (const int32_t **) _ubuf, \
1614 **vbuf = (const int32_t **) _vbuf, \
1615 *abuf0 = (const int32_t *) _abuf0; \
1616 uint16_t *dest = (uint16_t *) _dest; \
1617 name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \
1618 dstW, uvalpha, y, fmt, hasAlpha, eightbytes, is_be); \
1620#define YUV2PACKED16WRAPPER(name, base, ext, base_fmt, endianness, hasAlpha, eightbytes) \
1621 YUV2PACKED16WRAPPER_EXT(name, base, ext, base_fmt ## endianness, IS_BE(endianness), hasAlpha, eightbytes)
1675 unsigned A1,
unsigned A2,
1676 const
void *_r, const
void *_g, const
void *_b,
int y,
1681 uint32_t *dest = (uint32_t *) _dest;
1682 const uint32_t *
r = (
const uint32_t *) _r;
1683 const uint32_t *
g = (
const uint32_t *) _g;
1684 const uint32_t *
b = (
const uint32_t *) _b;
1689 dest[
i * 2 + 0] =
r[Y1] +
g[Y1] +
b[Y1] + (hasAlpha ?
A1 << sh : 0);
1690 dest[
i * 2 + 1] =
r[Y2] +
g[Y2] +
b[Y2] + (hasAlpha ?
A2 << sh : 0);
1696 dest[
i * 2 + 0] =
r[Y1] +
g[Y1] +
b[Y1] + (
A1 << sh);
1697 dest[
i * 2 + 1] =
r[Y2] +
g[Y2] +
b[Y2] + (
A2 << sh);
1699#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
1702 av_assert2((((
r[Y1] +
g[Y1] +
b[Y1]) >> sh) & 0xFF) == 0xFF);
1704 dest[
i * 2 + 0] =
r[Y1] +
g[Y1] +
b[Y1];
1705 dest[
i * 2 + 1] =
r[Y2] +
g[Y2] +
b[Y2];
1709 uint8_t *dest = (uint8_t *) _dest;
1710 const uint8_t *
r = (
const uint8_t *) _r;
1711 const uint8_t *
g = (
const uint8_t *) _g;
1712 const uint8_t *
b = (
const uint8_t *) _b;
1714#define r_b ((target == AV_PIX_FMT_RGB24) ? r : b)
1715#define b_r ((target == AV_PIX_FMT_RGB24) ? b : r)
1717 dest[
i * 6 + 0] =
r_b[Y1];
1718 dest[
i * 6 + 1] =
g[Y1];
1719 dest[
i * 6 + 2] =
b_r[Y1];
1720 dest[
i * 6 + 3] =
r_b[Y2];
1721 dest[
i * 6 + 4] =
g[Y2];
1722 dest[
i * 6 + 5] =
b_r[Y2];
1728 uint16_t *dest = (uint16_t *) _dest;
1729 const uint16_t *
r = (
const uint16_t *) _r;
1730 const uint16_t *
g = (
const uint16_t *) _g;
1731 const uint16_t *
b = (
const uint16_t *) _b;
1732 int dr1, dg1, db1, dr2, dg2, db2;
1757 dest[
i * 2 + 0] =
r[Y1 + dr1] +
g[Y1 + dg1] +
b[Y1 + db1];
1760 if (
i * 2 + 1 < dstW)
1761 dest[
i * 2 + 1] =
r[Y2 + dr2] +
g[Y2 + dg2] +
b[Y2 + db2];
1763 uint32_t *dest = (uint32_t *) _dest;
1764 const uint32_t *
r = (
const uint32_t *) _r;
1765 const uint32_t *
g = (
const uint32_t *) _g;
1766 const uint32_t *
b = (
const uint32_t *) _b;
1767 dest[
i * 2 + 0] =
r[Y1] +
g[Y1] +
b[Y1];
1768 dest[
i * 2 + 1] =
r[Y2] +
g[Y2] +
b[Y2];
1770 uint8_t *dest = (uint8_t *) _dest;
1771 const uint8_t *
r = (
const uint8_t *) _r;
1772 const uint8_t *
g = (
const uint8_t *) _g;
1773 const uint8_t *
b = (
const uint8_t *) _b;
1774 int dr1, dg1, db1, dr2, dg2, db2;
1779 dr1 = dg1 = d32[(
i * 2 + 0) & 7];
1780 db1 = d64[(
i * 2 + 0) & 7];
1781 dr2 = dg2 = d32[(
i * 2 + 1) & 7];
1782 db2 = d64[(
i * 2 + 1) & 7];
1786 dr1 = db1 =
d128[(
i * 2 + 0) & 7];
1787 dg1 = d64[(
i * 2 + 0) & 7];
1788 dr2 = db2 =
d128[(
i * 2 + 1) & 7];
1789 dg2 = d64[(
i * 2 + 1) & 7];
1793 dest[
i] =
r[Y1 + dr1] +
g[Y1 + dg1] +
b[Y1 + db1] +
1794 ((
r[Y2 + dr2] +
g[Y2 + dg2] +
b[Y2 + db2]) << 4);
1796 dest[
i * 2 + 0] =
r[Y1 + dr1] +
g[Y1 + dg1] +
b[Y1 + db1];
1797 dest[
i * 2 + 1] =
r[Y2 + dr2] +
g[Y2 + dg2] +
b[Y2 + db2];
1804 const int16_t **lumSrc,
int lumFilterSize,
1805 const int16_t *chrFilter,
const int16_t **chrUSrc,
1806 const int16_t **chrVSrc,
int chrFilterSize,
1807 const int16_t **alpSrc, uint8_t *dest,
int dstW,
1812 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
1818 const void *
r, *
g, *
b;
1820 for (j = 0; j < lumFilterSize; j++) {
1821 Y1 += lumSrc[j][
i * 2] * (unsigned)lumFilter[j];
1822 Y2 += lumSrc[j][
i * 2 + 1] * (unsigned)lumFilter[j];
1824 for (j = 0; j < chrFilterSize; j++) {
1825 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
1826 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
1835 for (j = 0; j < lumFilterSize; j++) {
1836 A1 += alpSrc[j][
i * 2 ] * (unsigned)lumFilter[j];
1837 A2 += alpSrc[j][
i * 2 + 1] * (unsigned)lumFilter[j];
1841 if ((
A1 |
A2) & 0x100) {
1852 r,
g,
b, y, target, hasAlpha);
1858 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1859 const int16_t *abuf[2], uint8_t *dest,
int dstW,
1860 int yalpha,
int uvalpha,
int y,
1863 const int16_t *buf0 = buf[0], *buf1 = buf[1],
1864 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
1865 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
1866 *abuf0 = hasAlpha ? abuf[0] :
NULL,
1867 *abuf1 = hasAlpha ? abuf[1] :
NULL;
1868 int yalpha1 = 4096 - yalpha;
1869 int uvalpha1 = 4096 - uvalpha;
1874 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
1875 int Y1 = (buf0[
i * 2] * yalpha1 + buf1[
i * 2] * yalpha) >> 19;
1876 int Y2 = (buf0[
i * 2 + 1] * yalpha1 + buf1[
i * 2 + 1] * yalpha) >> 19;
1877 int U = (ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha) >> 19;
1878 int V = (vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha) >> 19;
1885 A1 = (abuf0[
i * 2 ] * yalpha1 + abuf1[
i * 2 ] * yalpha) >> 19;
1886 A2 = (abuf0[
i * 2 + 1] * yalpha1 + abuf1[
i * 2 + 1] * yalpha) >> 19;
1892 r,
g,
b, y, target, hasAlpha);
1898 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1899 const int16_t *abuf0, uint8_t *dest,
int dstW,
1903 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
1907 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
1908 int Y1 = (buf0[
i * 2 ] + 64) >> 7;
1909 int Y2 = (buf0[
i * 2 + 1] + 64) >> 7;
1910 int U = (ubuf0[
i] + 64) >> 7;
1911 int V = (vbuf0[
i] + 64) >> 7;
1918 A1 = abuf0[
i * 2 ] * 255 + 16384 >> 15;
1919 A2 = abuf0[
i * 2 + 1] * 255 + 16384 >> 15;
1925 r,
g,
b, y, target, hasAlpha);
1928 const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
1929 int uvalpha1 = 4096 - uvalpha;
1932 for (
i = 0;
i < ((dstW + 1) >> 1);
i++) {
1933 int Y1 = (buf0[
i * 2 ] + 64) >> 7;
1934 int Y2 = (buf0[
i * 2 + 1] + 64) >> 7;
1935 int U = (ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha + (128 << 11)) >> 19;
1936 int V = (vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha + (128 << 11)) >> 19;
1943 A1 = (abuf0[
i * 2 ] + 64) >> 7;
1944 A2 = (abuf0[
i * 2 + 1] + 64) >> 7;
1950 r,
g,
b, y, target, hasAlpha);
1955#define YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \
1956static void name ## ext ## _X_c(SwsInternal *c, const int16_t *lumFilter, \
1957 const int16_t **lumSrc, int lumFilterSize, \
1958 const int16_t *chrFilter, const int16_t **chrUSrc, \
1959 const int16_t **chrVSrc, int chrFilterSize, \
1960 const int16_t **alpSrc, uint8_t *dest, int dstW, \
1963 name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
1964 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
1965 alpSrc, dest, dstW, y, fmt, hasAlpha); \
1968#define YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha) \
1969YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \
1970static void name ## ext ## _2_c(SwsInternal *c, const int16_t *buf[2], \
1971 const int16_t *ubuf[2], const int16_t *vbuf[2], \
1972 const int16_t *abuf[2], uint8_t *dest, int dstW, \
1973 int yalpha, int uvalpha, int y) \
1975 name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
1976 dest, dstW, yalpha, uvalpha, y, fmt, hasAlpha); \
1979#define YUV2RGBWRAPPER(name, base, ext, fmt, hasAlpha) \
1980YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha) \
1981static void name ## ext ## _1_c(SwsInternal *c, const int16_t *buf0, \
1982 const int16_t *ubuf[2], const int16_t *vbuf[2], \
1983 const int16_t *abuf0, uint8_t *dest, int dstW, \
1984 int uvalpha, int y) \
1986 name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \
1987 dstW, uvalpha, y, fmt, hasAlpha); \
1994#if CONFIG_SWSCALE_ALPHA
2013 uint8_t *dest,
int i,
int Y,
int A,
int U,
int V,
2019 Y -=
c->yuv2rgb_y_offset;
2020 Y *= (unsigned)
c->yuv2rgb_y_coeff;
2022 R = (unsigned)
Y +
V*(unsigned)
c->yuv2rgb_v2r_coeff;
2023 G = (unsigned)
Y +
V*(unsigned)
c->yuv2rgb_v2g_coeff +
U*(unsigned)
c->yuv2rgb_u2g_coeff;
2024 B = (unsigned)
Y +
U*(unsigned)
c->yuv2rgb_u2b_coeff;
2025 if ((
R |
G |
B) & 0xC0000000) {
2033 dest[0] = hasAlpha ?
A : 255;
2047 dest[3] = hasAlpha ?
A : 255;
2050 dest[0] = hasAlpha ?
A : 255;
2064 dest[3] = hasAlpha ?
A : 255;
2070 AV_WL32(dest, (3U << 30) + (
R << 20) + (
G << 10) +
B);
2076 AV_WL32(dest, (3U << 30) + (
B << 20) + (
G << 10) +
R);
2085 switch (
c->opts.dither) {
2103 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;
2104 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;
2105 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;
2106 c->dither_error[0][
i] = err[0];
2107 c->dither_error[1][
i] = err[1];
2108 c->dither_error[2][
i] = err[2];
2109 r =
R >> (isrgb8 ? 5 : 7);
2110 g =
G >> (isrgb8 ? 5 : 6);
2111 b =
B >> (isrgb8 ? 6 : 7);
2115 err[0] =
R -
r*(isrgb8 ? 36 : 255);
2116 err[1] =
G -
g*(isrgb8 ? 36 : 85);
2117 err[2] =
B -
b*(isrgb8 ? 85 : 255);
2122#define A_DITHER(u,v) (((((u)+((v)*236))*119)&0xff))
2141#define X_DITHER(u,v) (((((u)^((v)*237))*181)&0x1ff)/2)
2161 dest[0] =
r + 2*
g + 8*
b;
2163 dest[0] =
b + 2*
g + 8*
r;
2165 dest[0] =
r + 8*
g + 64*
b;
2167 dest[0] =
b + 4*
g + 32*
r;
2176 const int16_t **lumSrc,
int lumFilterSize,
2177 const int16_t *chrFilter,
const int16_t **chrUSrc,
2178 const int16_t **chrVSrc,
int chrFilterSize,
2179 const int16_t **alpSrc, uint8_t *dest,
2191 for (
i = 0;
i < dstW;
i++) {
2194 int U = (1<<9)-(128 << 19);
2195 int V = (1<<9)-(128 << 19);
2197 for (j = 0; j < lumFilterSize; j++) {
2198 Y += lumSrc[j][
i] * (unsigned)lumFilter[j];
2200 for (j = 0; j < chrFilterSize; j++) {
2201 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
2202 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
2209 for (j = 0; j < lumFilterSize; j++) {
2210 A += alpSrc[j][
i] * (unsigned)lumFilter[j];
2216 yuv2rgb_write_full(
c, dest,
i,
Y,
A,
U,
V, y, target, hasAlpha, err);
2219 c->dither_error[0][
i] = err[0];
2220 c->dither_error[1][
i] = err[1];
2221 c->dither_error[2][
i] = err[2];
2226 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2227 const int16_t *abuf[2], uint8_t *dest,
int dstW,
2228 int yalpha,
int uvalpha,
int y,
2231 const int16_t *buf0 = buf[0], *buf1 = buf[1],
2232 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
2233 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
2234 *abuf0 = hasAlpha ? abuf[0] :
NULL,
2235 *abuf1 = hasAlpha ? abuf[1] :
NULL;
2236 int yalpha1 = 4096 - yalpha;
2237 int uvalpha1 = 4096 - uvalpha;
2250 for (
i = 0;
i < dstW;
i++) {
2251 int Y = ( buf0[
i] * yalpha1 + buf1[
i] * yalpha ) >> 10;
2252 int U = (ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha-(128 << 19)) >> 10;
2253 int V = (vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha-(128 << 19)) >> 10;
2256 A = (abuf0[
i] * yalpha1 + abuf1[
i] * yalpha + (1<<18)) >> 19;
2261 yuv2rgb_write_full(
c, dest,
i,
Y,
A,
U,
V, y, target, hasAlpha, err);
2264 c->dither_error[0][
i] = err[0];
2265 c->dither_error[1][
i] = err[1];
2266 c->dither_error[2][
i] = err[2];
2271 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2272 const int16_t *abuf0, uint8_t *dest,
int dstW,
2276 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
2287 for (
i = 0;
i < dstW;
i++) {
2288 int Y = buf0[
i] * 4;
2289 int U = (ubuf0[
i] - (128<<7)) * 4;
2290 int V = (vbuf0[
i] - (128<<7)) * 4;
2293 A = (abuf0[
i] + 64) >> 7;
2298 yuv2rgb_write_full(
c, dest,
i,
Y,
A,
U,
V, y, target, hasAlpha, err);
2302 const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
2304 int uvalpha1 = 4096 - uvalpha;
2307 for (
i = 0;
i < dstW;
i++) {
2308 int Y = buf0[
i] * 4;
2309 int U = (ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha - (128 << 19)) >> 10;
2310 int V = (vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha - (128 << 19)) >> 10;
2313 A = (abuf0[
i] + 64) >> 7;
2318 yuv2rgb_write_full(
c, dest,
i,
Y,
A,
U,
V, y, target, hasAlpha, err);
2323 c->dither_error[0][
i] = err[0];
2324 c->dither_error[1][
i] = err[1];
2325 c->dither_error[2][
i] = err[2];
2334#if CONFIG_SWSCALE_ALPHA
2358 const int16_t **lumSrc,
int lumFilterSize,
2359 const int16_t *chrFilter, const int16_t **chrUSrc,
2360 const int16_t **chrVSrc,
int chrFilterSize,
2361 const int16_t **alpSrc, uint8_t **dest,
2367 uint16_t **dest16 = (uint16_t**)dest;
2368 int SH = 22 + 8 -
desc->comp[0].depth;
2371 for (
i = 0;
i < dstW;
i++) {
2374 int U = (1 << 9) - (128 << 19);
2375 int V = (1 << 9) - (128 << 19);
2378 for (j = 0; j < lumFilterSize; j++)
2379 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
2381 for (j = 0; j < chrFilterSize; j++) {
2382 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
2383 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
2393 for (j = 0; j < lumFilterSize; j++)
2394 A += alpSrc[j][
i] * (
unsigned)lumFilter[j];
2400 Y -=
c->yuv2rgb_y_offset;
2401 Y *=
c->yuv2rgb_y_coeff;
2403 R =
Y +
V * (unsigned)
c->yuv2rgb_v2r_coeff;
2404 G =
Y +
V * (unsigned)
c->yuv2rgb_v2g_coeff +
U * (
unsigned)
c->yuv2rgb_u2g_coeff;
2405 B =
Y +
U * (unsigned)
c->yuv2rgb_u2b_coeff;
2407 if ((
R |
G |
B) & 0xC0000000) {
2414 dest16[0][
i] =
G >>
SH;
2415 dest16[1][
i] =
B >>
SH;
2416 dest16[2][
i] =
R >>
SH;
2418 dest16[3][
i] =
A >> (
SH - 3);
2420 dest[0][
i] =
G >> 22;
2421 dest[1][
i] =
B >> 22;
2422 dest[2][
i] =
R >> 22;
2424 dest[3][
i] =
A >> 19;
2427 if (
SH != 22 && (!
isBE(
c->opts.dst_format)) != (!HAVE_BIGENDIAN)) {
2428 for (
i = 0;
i < dstW;
i++) {
2440 const int16_t **lumSrc,
int lumFilterSize,
2441 const int16_t *chrFilter,
const int16_t **chrUSrc,
2442 const int16_t **chrVSrc,
int chrFilterSize,
2443 const int16_t **alpSrc, uint8_t **dest,
2448 uint16_t **dest16 = (uint16_t**)dest;
2453 chrFilter, chrUSrc, chrVSrc, chrFilterSize,
2454 alpSrc, dest, dstW, y);
2456 if (
desc->comp[0].depth <= 8)
2459 if ((!
isBE(
c->opts.dst_format)) != (!HAVE_BIGENDIAN)) {
2460 for (
i = 0;
i < dstW;
i++) {
2468 for (
i = 0;
i < dstW;
i++) {
2469 dest16[0][
i] = dest16[0][
i] <<
shift;
2470 dest16[1][
i] = dest16[1][
i] <<
shift;
2471 dest16[2][
i] = dest16[2][
i] <<
shift;
2473 dest16[3][
i] = dest16[3][
i] <<
shift;
2480 const int16_t **lumSrcx,
int lumFilterSize,
2481 const int16_t *chrFilter,
const int16_t **chrUSrcx,
2482 const int16_t **chrVSrcx,
int chrFilterSize,
2483 const int16_t **alpSrcx, uint8_t **dest,
2489 uint16_t **dest16 = (uint16_t**)dest;
2495 for (
i = 0;
i < dstW;
i++) {
2497 int Y = -0x40000000;
2498 int U = -(128 << 23);
2499 int V = -(128 << 23);
2502 for (j = 0; j < lumFilterSize; j++)
2503 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
2505 for (j = 0; j < chrFilterSize; j++) {
2506 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
2507 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
2518 for (j = 0; j < lumFilterSize; j++)
2519 A += alpSrc[j][
i] * (
unsigned)lumFilter[j];
2525 Y -=
c->yuv2rgb_y_offset;
2526 Y *=
c->yuv2rgb_y_coeff;
2527 Y += (1 << 13) - (1 << 29);
2528 R =
V * (unsigned)
c->yuv2rgb_v2r_coeff;
2529 G =
V * (unsigned)
c->yuv2rgb_v2g_coeff +
U * (
unsigned)
c->yuv2rgb_u2g_coeff;
2530 B =
U * (unsigned)
c->yuv2rgb_u2b_coeff;
2539 if ((!
isBE(
c->opts.dst_format)) != (!HAVE_BIGENDIAN)) {
2540 for (
i = 0;
i < dstW;
i++) {
2552 const int16_t **lumSrcx,
int lumFilterSize,
2553 const int16_t *chrFilter,
const int16_t **chrUSrcx,
2554 const int16_t **chrVSrcx,
int chrFilterSize,
2555 const int16_t **alpSrcx, uint8_t **dest,
2561 uint32_t **dest32 = (uint32_t**)dest;
2566 static const float float_mult = 1.0f / 65535.0f;
2568 for (
i = 0;
i < dstW;
i++) {
2570 int Y = -0x40000000;
2571 int U = -(128 << 23);
2572 int V = -(128 << 23);
2575 for (j = 0; j < lumFilterSize; j++)
2576 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
2578 for (j = 0; j < chrFilterSize; j++) {
2579 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
2580 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
2591 for (j = 0; j < lumFilterSize; j++)
2592 A += alpSrc[j][
i] * (
unsigned)lumFilter[j];
2598 Y -=
c->yuv2rgb_y_offset;
2599 Y *=
c->yuv2rgb_y_coeff;
2600 Y += (1 << 13) - (1 << 29);
2601 R =
V * (unsigned)
c->yuv2rgb_v2r_coeff;
2602 G =
V * (unsigned)
c->yuv2rgb_v2g_coeff +
U * (
unsigned)
c->yuv2rgb_u2g_coeff;
2603 B =
U * (unsigned)
c->yuv2rgb_u2b_coeff;
2615 if ((!
isBE(
c->opts.dst_format)) != (!HAVE_BIGENDIAN)) {
2616 for (
i = 0;
i < dstW;
i++) {
2628 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2629 const int16_t *abuf0, uint8_t *dest,
int dstW,
2632 int hasAlpha = !!abuf0;
2635 for (
i = 0;
i < dstW;
i++) {
2636 int Y = (buf0[
i] + 64) >> 7;
2642 A = (abuf0[
i] + 64) >> 7;
2648 dest[
i * 2 + 1] = hasAlpha ?
A : 255;
2654 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2655 const int16_t *abuf[2], uint8_t *dest,
int dstW,
2656 int yalpha,
int uvalpha,
int y)
2658 int hasAlpha = abuf && abuf[0] && abuf[1];
2659 const int16_t *buf0 = buf[0], *buf1 = buf[1],
2660 *abuf0 = hasAlpha ? abuf[0] :
NULL,
2661 *abuf1 = hasAlpha ? abuf[1] :
NULL;
2662 int yalpha1 = 4096 - yalpha;
2667 for (
i = 0;
i < dstW;
i++) {
2668 int Y = (buf0[
i] * yalpha1 + buf1[
i] * yalpha) >> 19;
2674 A = (abuf0[
i] * yalpha1 + abuf1[
i] * yalpha) >> 19;
2679 dest[
i * 2 + 1] = hasAlpha ?
A : 255;
2685 const int16_t **lumSrc,
int lumFilterSize,
2686 const int16_t *chrFilter,
const int16_t **chrUSrc,
2687 const int16_t **chrVSrc,
int chrFilterSize,
2688 const int16_t **alpSrc, uint8_t *dest,
int dstW,
int y)
2690 int hasAlpha = !!alpSrc;
2693 for (
i = 0;
i < dstW;
i++) {
2695 int Y = 1 << 18,
A = 1 << 18;
2697 for (j = 0; j < lumFilterSize; j++)
2698 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
2705 for (j = 0; j < lumFilterSize; j++)
2706 A += alpSrc[j][
i] * (
unsigned)lumFilter[j];
2715 dest[2 *
i + 1] = hasAlpha ?
A : 255;
2719#define output_pixels(pos, val) \
2721 AV_WB16(pos, val); \
2723 AV_WL16(pos, val); \
2728 const int16_t **_lumSrc,
int lumFilterSize,
2729 const int16_t *chrFilter,
const int16_t **_chrUSrc,
2730 const int16_t **_chrVSrc,
int chrFilterSize,
2731 const int16_t **_alpSrc, uint8_t *dest,
int dstW,
int y,
2732 int A_offset,
int Y_offset,
int U_offset,
int V_offset,
int is_be)
2735 **chrUSrc = (
const int32_t **) _chrUSrc,
2736 **chrVSrc = (
const int32_t **) _chrVSrc,
2737 **alpSrc = (
const int32_t **) _alpSrc;
2738 int hasAlpha = !!alpSrc;
2741 for (
i = 0;
i < dstW;
i++) {
2742 int Y = 1 << 14,
U = 1 << 14;
2743 int V = 1 << 14,
A = 1 << 14;
2751 for (j = 0; j < lumFilterSize; j++)
2752 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
2754 for (j = 0; j < chrFilterSize; j++)
2755 U += chrUSrc[j][
i] * (
unsigned)chrFilter[j];
2757 for (j = 0; j < chrFilterSize; j++)
2758 V += chrVSrc[j][
i] * (
unsigned)chrFilter[j];
2761 for (j = 0; j < lumFilterSize; j++)
2762 A += alpSrc[j][
i] * (
unsigned)lumFilter[j];
2777#define YUV2AYUV64(pixfmt, BE_LE, A, Y, U, V, is_be) \
2779yuv2 ## pixfmt ## BE_LE ##_X_c(SwsInternal *c, const int16_t *lumFilter, \
2780 const int16_t **lumSrc, int lumFilterSize, \
2781 const int16_t *chrFilter, const int16_t **chrUSrc, \
2782 const int16_t **chrVSrc, int chrFilterSize, \
2783 const int16_t **alpSrc, uint8_t *dest, int dstW, int y) \
2785 yuv2ayuv64_X_c(c, lumFilter, lumSrc, lumFilterSize, \
2786 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
2787 alpSrc, dest, dstW, y, A, Y, U, V, is_be); \
2800 const int16_t **lumSrc,
int lumFilterSize,
2801 const int16_t *chrFilter,
const int16_t **chrUSrc,
2802 const int16_t **chrVSrc,
int chrFilterSize,
2803 const int16_t **alpSrc, uint8_t *dest,
int dstW,
int y,
2807 for (
i = 0;
i < dstW;
i++) {
2808 int Y = 1 << 16,
U = 1 << 16,
V = 1 << 16,
A = 0x3;
2811 for (j = 0; j < lumFilterSize; j++)
2812 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
2814 for (j = 0; j < chrFilterSize; j++) {
2815 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
2816 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
2825 (
unsigned)
V << (
shift + 20) |
2826 (
unsigned)
A << (
shift ? 0 : 30 ));
2830#define V30LE_WRAPPER(name, shift) \
2831static void yuv2 ## name ## _X_c(SwsInternal *c, const int16_t *lumFilter, \
2832 const int16_t **lumSrc, int lumFilterSize, \
2833 const int16_t *chrFilter, const int16_t **chrUSrc, \
2834 const int16_t **chrVSrc, int chrFilterSize, \
2835 const int16_t **alpSrc, uint8_t *dest, int dstW, \
2838 yuv2v30_X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
2839 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
2840 alpSrc, dest, dstW, y, shift); \
2846#define output_pixels(pos, val, shift, bits, output_shift) \
2848 AV_WB16(pos, av_clip_uintp2(val >> shift, bits) << output_shift); \
2850 AV_WL16(pos, av_clip_uintp2(val >> shift, bits) << output_shift); \
2855 const int16_t **lumSrc,
int lumFilterSize,
2856 const int16_t *chrFilter,
const int16_t **chrUSrc,
2857 const int16_t **chrVSrc,
int chrFilterSize,
2858 const int16_t **alpSrc, uint8_t *dest,
int dstW,
int y,
int is_be)
2861 for (
i = 0;
i < dstW;
i++) {
2862 int Y = 1 << 14,
U = 1 << 14,
V = 1 << 14,
A = 65535;
2865 for (j = 0; j < lumFilterSize; j++)
2866 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
2868 for (j = 0; j < chrFilterSize; j++) {
2869 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
2870 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
2882#define YUV2XV36(BE_LE, is_be) \
2884yuv2xv36 ## BE_LE ##_X_c(SwsInternal *c, const int16_t *lumFilter, \
2885 const int16_t **lumSrc, int lumFilterSize, \
2886 const int16_t *chrFilter, const int16_t **chrUSrc, \
2887 const int16_t **chrVSrc, int chrFilterSize, \
2888 const int16_t **alpSrc, uint8_t *dest, int dstW, int y) \
2890 yuv2xv36_X_c(c, lumFilter, lumSrc, lumFilterSize, \
2891 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
2892 alpSrc, dest, dstW, y, is_be); \
2898#define output_pixels(pos, A, Y, U, V) \
2899 if (target == AV_PIX_FMT_AYUV) { \
2900 dest[pos + 0] = A; \
2901 dest[pos + 1] = Y; \
2902 dest[pos + 2] = U; \
2903 dest[pos + 3] = V; \
2904 } else if (target == AV_PIX_FMT_UYVA) { \
2905 dest[pos + 0] = U; \
2906 dest[pos + 1] = Y; \
2907 dest[pos + 2] = V; \
2908 dest[pos + 3] = A; \
2910 dest[pos + 0] = V; \
2911 dest[pos + 1] = U; \
2912 dest[pos + 2] = Y; \
2913 dest[pos + 3] = A; \
2918 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2919 const int16_t *abuf0, uint8_t *dest,
int dstW,
2922 int hasAlpha = !!abuf0;
2925 if (uvalpha < 2048) {
2926 for (
i = 0;
i < dstW;
i++) {
2927 int Y = (buf0[
i] + 64) >> 7;
2928 int U = (ubuf[0][
i] + 64) >> 7;
2929 int V = (vbuf[0][
i] + 64) >> 7;
2940 A = (abuf0[
i] + 64) >> 7;
2948 for (
i = 0;
i < dstW;
i++) {
2949 int Y = (buf0[
i] + 64) >> 7;
2950 int U = (ubuf[0][
i] + ubuf[1][
i] + 128) >> 8;
2951 int V = (vbuf[0][
i] + vbuf[1][
i] + 128) >> 8;
2962 A = (abuf0[
i] + 64) >> 7;
2974 const int16_t *ubuf[2],
const int16_t *vbuf[2],
2975 const int16_t *abuf[2], uint8_t *dest,
int dstW,
2976 int yalpha,
int uvalpha,
int y,
2979 int hasAlpha = abuf && abuf[0] && abuf[1];
2980 const int16_t *buf0 = buf[0], *buf1 = buf[1],
2981 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
2982 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
2983 *abuf0 = hasAlpha ? abuf[0] :
NULL,
2984 *abuf1 = hasAlpha ? abuf[1] :
NULL;
2985 int yalpha1 = 4096 - yalpha;
2986 int uvalpha1 = 4096 - uvalpha;
2992 for (
i = 0;
i < dstW;
i++) {
2993 int Y = (buf0[
i] * yalpha1 + buf1[
i] * yalpha) >> 19;
2994 int U = (ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha) >> 19;
2995 int V = (vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha) >> 19;
3006 A = (abuf0[
i] * yalpha1 + abuf1[
i] * yalpha) >> 19;
3016 const int16_t **lumSrc,
int lumFilterSize,
3017 const int16_t *chrFilter,
const int16_t **chrUSrc,
3018 const int16_t **chrVSrc,
int chrFilterSize,
3019 const int16_t **alpSrc, uint8_t *dest,
int dstW,
3024 for (
i = 0;
i < dstW;
i++) {
3026 int Y = 1 << 18,
U = 1 << 18;
3027 int V = 1 << 18,
A = 255;
3029 for (j = 0; j < lumFilterSize; j++)
3030 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
3032 for (j = 0; j < chrFilterSize; j++)
3033 U += chrUSrc[j][
i] * (
unsigned)chrFilter[j];
3035 for (j = 0; j < chrFilterSize; j++)
3036 V += chrVSrc[j][
i] * (
unsigned)chrFilter[j];
3052 for (j = 0; j < lumFilterSize; j++)
3053 A += alpSrc[j][
i] * (
unsigned)lumFilter[j];
3067#define AYUVPACKEDWRAPPER(name, fmt) \
3068static void yuv2 ## name ## _X_c(SwsInternal *c, const int16_t *lumFilter, \
3069 const int16_t **lumSrc, int lumFilterSize, \
3070 const int16_t *chrFilter, const int16_t **chrUSrc, \
3071 const int16_t **chrVSrc, int chrFilterSize, \
3072 const int16_t **alpSrc, uint8_t *dest, int dstW, \
3075 yuv2ayuv_X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
3076 chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
3077 alpSrc, dest, dstW, y, fmt); \
3080static void yuv2 ## name ## _2_c(SwsInternal *c, const int16_t *buf[2], \
3081 const int16_t *ubuf[2], const int16_t *vbuf[2], \
3082 const int16_t *abuf[2], uint8_t *dest, int dstW, \
3083 int yalpha, int uvalpha, int y) \
3085 yuv2ayuv_2_c_template(c, buf, ubuf, vbuf, abuf, \
3086 dest, dstW, yalpha, uvalpha, y, fmt); \
3089static void yuv2 ## name ## _1_c(SwsInternal *c, const int16_t *buf0, \
3090 const int16_t *ubuf[2], const int16_t *vbuf[2], \
3091 const int16_t *abuf0, uint8_t *dest, int dstW, \
3092 int uvalpha, int y) \
3094 yuv2ayuv_1_c_template(c, buf0, ubuf, vbuf, \
3095 abuf0, dest, dstW, uvalpha, \
3103#define output_pixel(pos, val, bits) \
3104 AV_WL16(pos, av_clip_uintp2(val >> shift, bits) << output_shift);
3106#define yuv2y2xx_wrapper(bits) \
3108 yuv2y2 ## bits ## le_X_c(SwsInternal *c, const int16_t *lumFilter, \
3109 const int16_t **lumSrc, int lumFilterSize, \
3110 const int16_t *chrFilter, \
3111 const int16_t **chrUSrc, \
3112 const int16_t **chrVSrc, int chrFilterSize, \
3113 const int16_t **alpSrc, \
3114 uint8_t *dest, int dstW, int y) \
3117 int shift = 11 + 16 - bits; \
3118 int output_shift = 16 - bits; \
3119 for (i = 0; i < ((dstW + 1) >> 1); i++) { \
3120 int Y1 = 1 << (shift - 1), Y2 = 1 << (shift - 1); \
3121 int U = 1 << (shift - 1), V = 1 << (shift - 1); \
3123 for (j = 0; j < lumFilterSize; j++) { \
3124 Y1 += lumSrc[j][i * 2] * (unsigned)lumFilter[j]; \
3125 Y2 += lumSrc[j][i * 2 + 1] * (unsigned)lumFilter[j]; \
3128 for (j = 0; j < chrFilterSize; j++) { \
3129 U += chrUSrc[j][i] * (unsigned)chrFilter[j]; \
3130 V += chrVSrc[j][i] * (unsigned)chrFilter[j]; \
3133 output_pixel(dest + 8 * i + 0, Y1, bits); \
3134 output_pixel(dest + 8 * i + 2, U, bits); \
3135 output_pixel(dest + 8 * i + 4, Y2, bits); \
3136 output_pixel(dest + 8 * i + 6, V, bits); \
3144yuv2y216le_X_c(
SwsInternal *
c, const int16_t *lumFilter,
3145 const int16_t **_lumSrc,
int lumFilterSize,
3146 const int16_t *chrFilter,
3147 const int16_t **_chrUSrc,
3148 const int16_t **_chrVSrc,
int chrFilterSize,
3149 const int16_t **_alpSrc,
3150 uint8_t *dest,
int dstW,
int y)
3157 for (
int i = 0;
i < ((dstW + 1) >> 1);
i++) {
3158 int Y1 = 1 << (
shift - 1), Y2 = 1 << (
shift - 1);
3167 for (
int j = 0; j < lumFilterSize; j++) {
3168 Y1 += lumSrc[j][
i * 2] * (unsigned)lumFilter[j];
3169 Y2 += lumSrc[j][
i * 2 + 1] * (unsigned)lumFilter[j];
3172 for (
int j = 0; j < chrFilterSize; j++) {
3173 U += chrUSrc[j][
i] * (unsigned)chrFilter[j];
3174 V += chrVSrc[j][
i] * (unsigned)chrFilter[j];
3186 const int16_t *ubuf[2],
const int16_t *vbuf[2],
3187 const int16_t *abuf0, uint8_t *dest,
int dstW,
3192 if (uvalpha < 2048) {
3193 for (
i = 0;
i < dstW;
i++) {
3194 int Y = (buf0[
i] + 64) >> 7;
3195 int U = (ubuf[0][
i] + 64) >> 7;
3196 int V = (vbuf[0][
i] + 64) >> 7;
3206 dest[3 *
i + 1] =
Y;
3207 dest[3 *
i + 2] =
U;
3210 for (
i = 0;
i < dstW;
i++) {
3211 int Y = (buf0[
i] + 64) >> 7;
3212 int U = (ubuf[0][
i] + ubuf[1][
i] + 128) >> 8;
3213 int V = (vbuf[0][
i] + vbuf[1][
i] + 128) >> 8;
3223 dest[3 *
i + 1] =
Y;
3224 dest[3 *
i + 2] =
U;
3231 const int16_t *ubuf[2],
const int16_t *vbuf[2],
3232 const int16_t *abuf[2], uint8_t *dest,
int dstW,
3233 int yalpha,
int uvalpha,
int y)
3235 const int16_t *buf0 = buf[0], *buf1 = buf[1],
3236 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
3237 *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
3238 int yalpha1 = 4096 - yalpha;
3239 int uvalpha1 = 4096 - uvalpha;
3245 for (
i = 0;
i < dstW;
i++) {
3246 int Y = (buf0[
i] * yalpha1 + buf1[
i] * yalpha) >> 19;
3247 int U = (ubuf0[
i] * uvalpha1 + ubuf1[
i] * uvalpha) >> 19;
3248 int V = (vbuf0[
i] * uvalpha1 + vbuf1[
i] * uvalpha) >> 19;
3258 dest[3 *
i + 1] =
Y;
3259 dest[3 *
i + 2] =
U;
3265 const int16_t **lumSrc,
int lumFilterSize,
3266 const int16_t *chrFilter,
const int16_t **chrUSrc,
3267 const int16_t **chrVSrc,
int chrFilterSize,
3268 const int16_t **alpSrc, uint8_t *dest,
int dstW,
int y)
3272 for (
i = 0;
i < dstW;
i++) {
3274 int Y = 1 << 18,
U = 1 << 18;
3277 for (j = 0; j < lumFilterSize; j++)
3278 Y += lumSrc[j][
i] * (
unsigned)lumFilter[j];
3280 for (j = 0; j < chrFilterSize; j++)
3281 U += chrUSrc[j][
i] * (
unsigned)chrFilter[j];
3283 for (j = 0; j < chrFilterSize; j++)
3284 V += chrVSrc[j][
i] * (
unsigned)chrFilter[j];
3298 dest[3 *
i + 1] =
Y;
3299 dest[3 *
i + 2] =
U;
3318 if (
desc->comp[0].depth == 10) {
3319 *yuv2plane1 =
isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c;
3320 *
yuv2planeX =
isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c;
3321 *yuv2nv12cX =
isBE(dstFormat) ? yuv2p010cX_BE_c : yuv2p010cX_LE_c;
3322 }
else if (
desc->comp[0].depth == 12) {
3323 *yuv2plane1 =
isBE(dstFormat) ? yuv2p012l1_BE_c : yuv2p012l1_LE_c;
3324 *
yuv2planeX =
isBE(dstFormat) ? yuv2p012lX_BE_c : yuv2p012lX_LE_c;
3325 *yuv2nv12cX =
isBE(dstFormat) ? yuv2p012cX_BE_c : yuv2p012cX_LE_c;
3329 if (
desc->comp[0].depth == 10) {
3330 *yuv2plane1 =
isBE(dstFormat) ? yuv2nv20l1_BE_c : yuv2nv20l1_LE_c;
3331 *
yuv2planeX =
isBE(dstFormat) ? yuv2nv20lX_BE_c : yuv2nv20lX_LE_c;
3332 *yuv2nv12cX =
isBE(dstFormat) ? yuv2nv20cX_BE_c : yuv2nv20cX_LE_c;
3335 }
else if (
is16BPS(dstFormat)) {
3336 *
yuv2planeX =
isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
3337 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c;
3342 if (
desc->comp[0].depth == 10) {
3343 *
yuv2planeX =
isBE(dstFormat) ? yuv2msbplaneX_10BE_c : yuv2msbplaneX_10LE_c;
3344 *yuv2plane1 =
isBE(dstFormat) ? yuv2msbplane1_10BE_c : yuv2msbplane1_10LE_c;
3345 }
else if (
desc->comp[0].depth == 12) {
3346 *
yuv2planeX =
isBE(dstFormat) ? yuv2msbplaneX_12BE_c : yuv2msbplaneX_12LE_c;
3347 *yuv2plane1 =
isBE(dstFormat) ? yuv2msbplane1_12BE_c : yuv2msbplane1_12LE_c;
3350 }
else if (
isNBPS(dstFormat)) {
3351 if (
desc->comp[0].depth == 9) {
3352 *
yuv2planeX =
isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c;
3353 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_9LE_c;
3354 }
else if (
desc->comp[0].depth == 10) {
3355 *
yuv2planeX =
isBE(dstFormat) ? yuv2planeX_10BE_c : yuv2planeX_10LE_c;
3356 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_10BE_c : yuv2plane1_10LE_c;
3357 }
else if (
desc->comp[0].depth == 12) {
3358 *
yuv2planeX =
isBE(dstFormat) ? yuv2planeX_12BE_c : yuv2planeX_12LE_c;
3359 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_12BE_c : yuv2plane1_12LE_c;
3360 }
else if (
desc->comp[0].depth == 14) {
3361 *
yuv2planeX =
isBE(dstFormat) ? yuv2planeX_14BE_c : yuv2planeX_14LE_c;
3362 *yuv2plane1 =
isBE(dstFormat) ? yuv2plane1_14BE_c : yuv2plane1_14LE_c;
3367 *yuv2plane1 = yuv2plane1_floatBE_c;
3370 *yuv2plane1 = yuv2plane1_floatLE_c;
3379 switch (dstFormat) {
3382 *yuv2packedX = yuv2rgba32_full_X_c;
3383 *yuv2packed2 = yuv2rgba32_full_2_c;
3384 *yuv2packed1 = yuv2rgba32_full_1_c;
3386#if CONFIG_SWSCALE_ALPHA
3388 *yuv2packedX = yuv2rgba32_full_X_c;
3389 *yuv2packed2 = yuv2rgba32_full_2_c;
3390 *yuv2packed1 = yuv2rgba32_full_1_c;
3394 *yuv2packedX = yuv2rgbx32_full_X_c;
3395 *yuv2packed2 = yuv2rgbx32_full_2_c;
3396 *yuv2packed1 = yuv2rgbx32_full_1_c;
3402 *yuv2packedX = yuv2argb32_full_X_c;
3403 *yuv2packed2 = yuv2argb32_full_2_c;
3404 *yuv2packed1 = yuv2argb32_full_1_c;
3406#if CONFIG_SWSCALE_ALPHA
3408 *yuv2packedX = yuv2argb32_full_X_c;
3409 *yuv2packed2 = yuv2argb32_full_2_c;
3410 *yuv2packed1 = yuv2argb32_full_1_c;
3414 *yuv2packedX = yuv2xrgb32_full_X_c;
3415 *yuv2packed2 = yuv2xrgb32_full_2_c;
3416 *yuv2packed1 = yuv2xrgb32_full_1_c;
3422 *yuv2packedX = yuv2bgra32_full_X_c;
3423 *yuv2packed2 = yuv2bgra32_full_2_c;
3424 *yuv2packed1 = yuv2bgra32_full_1_c;
3426#if CONFIG_SWSCALE_ALPHA
3428 *yuv2packedX = yuv2bgra32_full_X_c;
3429 *yuv2packed2 = yuv2bgra32_full_2_c;
3430 *yuv2packed1 = yuv2bgra32_full_1_c;
3434 *yuv2packedX = yuv2bgrx32_full_X_c;
3435 *yuv2packed2 = yuv2bgrx32_full_2_c;
3436 *yuv2packed1 = yuv2bgrx32_full_1_c;
3442 *yuv2packedX = yuv2abgr32_full_X_c;
3443 *yuv2packed2 = yuv2abgr32_full_2_c;
3444 *yuv2packed1 = yuv2abgr32_full_1_c;
3446#if CONFIG_SWSCALE_ALPHA
3448 *yuv2packedX = yuv2abgr32_full_X_c;
3449 *yuv2packed2 = yuv2abgr32_full_2_c;
3450 *yuv2packed1 = yuv2abgr32_full_1_c;
3454 *yuv2packedX = yuv2xbgr32_full_X_c;
3455 *yuv2packed2 = yuv2xbgr32_full_2_c;
3456 *yuv2packed1 = yuv2xbgr32_full_1_c;
3461#if CONFIG_SWSCALE_ALPHA
3463 *yuv2packedX = yuv2rgba64le_full_X_c;
3464 *yuv2packed2 = yuv2rgba64le_full_2_c;
3465 *yuv2packed1 = yuv2rgba64le_full_1_c;
3469 *yuv2packedX = yuv2rgbx64le_full_X_c;
3470 *yuv2packed2 = yuv2rgbx64le_full_2_c;
3471 *yuv2packed1 = yuv2rgbx64le_full_1_c;
3475#if CONFIG_SWSCALE_ALPHA
3477 *yuv2packedX = yuv2rgba64be_full_X_c;
3478 *yuv2packed2 = yuv2rgba64be_full_2_c;
3479 *yuv2packed1 = yuv2rgba64be_full_1_c;
3483 *yuv2packedX = yuv2rgbx64be_full_X_c;
3484 *yuv2packed2 = yuv2rgbx64be_full_2_c;
3485 *yuv2packed1 = yuv2rgbx64be_full_1_c;
3489#if CONFIG_SWSCALE_ALPHA
3491 *yuv2packedX = yuv2bgra64le_full_X_c;
3492 *yuv2packed2 = yuv2bgra64le_full_2_c;
3493 *yuv2packed1 = yuv2bgra64le_full_1_c;
3497 *yuv2packedX = yuv2bgrx64le_full_X_c;
3498 *yuv2packed2 = yuv2bgrx64le_full_2_c;
3499 *yuv2packed1 = yuv2bgrx64le_full_1_c;
3503#if CONFIG_SWSCALE_ALPHA
3505 *yuv2packedX = yuv2bgra64be_full_X_c;
3506 *yuv2packed2 = yuv2bgra64be_full_2_c;
3507 *yuv2packed1 = yuv2bgra64be_full_1_c;
3511 *yuv2packedX = yuv2bgrx64be_full_X_c;
3512 *yuv2packed2 = yuv2bgrx64be_full_2_c;
3513 *yuv2packed1 = yuv2bgrx64be_full_1_c;
3517#if CONFIG_SWSCALE_ALPHA
3519 *yuv2packedX = yuv2rgbaf32le_full_X_c;
3520 *yuv2packed2 = yuv2rgbaf32le_full_2_c;
3521 *yuv2packed1 = yuv2rgbaf32le_full_1_c;
3525 *yuv2packedX = yuv2rgbxf32le_full_X_c;
3526 *yuv2packed2 = yuv2rgbxf32le_full_2_c;
3527 *yuv2packed1 = yuv2rgbxf32le_full_1_c;
3531#if CONFIG_SWSCALE_ALPHA
3533 *yuv2packedX = yuv2rgbaf32be_full_X_c;
3534 *yuv2packed2 = yuv2rgbaf32be_full_2_c;
3535 *yuv2packed1 = yuv2rgbaf32be_full_1_c;
3539 *yuv2packedX = yuv2rgbxf32be_full_X_c;
3540 *yuv2packed2 = yuv2rgbxf32be_full_2_c;
3541 *yuv2packed1 = yuv2rgbxf32be_full_1_c;
3546 *yuv2packedX = yuv2rgb24_full_X_c;
3547 *yuv2packed2 = yuv2rgb24_full_2_c;
3548 *yuv2packed1 = yuv2rgb24_full_1_c;
3551 *yuv2packedX = yuv2bgr24_full_X_c;
3552 *yuv2packed2 = yuv2bgr24_full_2_c;
3553 *yuv2packed1 = yuv2bgr24_full_1_c;
3556 *yuv2packedX = yuv2rgb48le_full_X_c;
3557 *yuv2packed2 = yuv2rgb48le_full_2_c;
3558 *yuv2packed1 = yuv2rgb48le_full_1_c;
3561 *yuv2packedX = yuv2bgr48le_full_X_c;
3562 *yuv2packed2 = yuv2bgr48le_full_2_c;
3563 *yuv2packed1 = yuv2bgr48le_full_1_c;
3566 *yuv2packedX = yuv2rgb48be_full_X_c;
3567 *yuv2packed2 = yuv2rgb48be_full_2_c;
3568 *yuv2packed1 = yuv2rgb48be_full_1_c;
3571 *yuv2packedX = yuv2bgr48be_full_X_c;
3572 *yuv2packed2 = yuv2bgr48be_full_2_c;
3573 *yuv2packed1 = yuv2bgr48be_full_1_c;
3576 *yuv2packedX = yuv2bgr4_byte_full_X_c;
3577 *yuv2packed2 = yuv2bgr4_byte_full_2_c;
3578 *yuv2packed1 = yuv2bgr4_byte_full_1_c;
3581 *yuv2packedX = yuv2rgb4_byte_full_X_c;
3582 *yuv2packed2 = yuv2rgb4_byte_full_2_c;
3583 *yuv2packed1 = yuv2rgb4_byte_full_1_c;
3586 *yuv2packedX = yuv2bgr8_full_X_c;
3587 *yuv2packed2 = yuv2bgr8_full_2_c;
3588 *yuv2packed1 = yuv2bgr8_full_1_c;
3591 *yuv2packedX = yuv2rgb8_full_X_c;
3592 *yuv2packed2 = yuv2rgb8_full_2_c;
3593 *yuv2packed1 = yuv2rgb8_full_1_c;
3596 *yuv2packedX = yuv2x2rgb10_full_X_c;
3597 *yuv2packed2 = yuv2x2rgb10_full_2_c;
3598 *yuv2packed1 = yuv2x2rgb10_full_1_c;
3601 *yuv2packedX = yuv2x2bgr10_full_X_c;
3602 *yuv2packed2 = yuv2x2bgr10_full_2_c;
3603 *yuv2packed1 = yuv2x2bgr10_full_1_c;
3606 *yuv2packedX = yuv2rgbf32le_full_X_c;
3607 *yuv2packed2 = yuv2rgbf32le_full_2_c;
3608 *yuv2packed1 = yuv2rgbf32le_full_1_c;
3611 *yuv2packedX = yuv2rgbf32be_full_X_c;
3612 *yuv2packed2 = yuv2rgbf32be_full_2_c;
3613 *yuv2packed1 = yuv2rgbf32be_full_1_c;
3652 if (!*yuv2packedX && !*yuv2anyX)
3656 switch (dstFormat) {
3658#if CONFIG_SWSCALE_ALPHA
3660 *yuv2packed1 = yuv2rgba64le_1_c;
3661 *yuv2packed2 = yuv2rgba64le_2_c;
3662 *yuv2packedX = yuv2rgba64le_X_c;
3666 *yuv2packed1 = yuv2rgbx64le_1_c;
3667 *yuv2packed2 = yuv2rgbx64le_2_c;
3668 *yuv2packedX = yuv2rgbx64le_X_c;
3672#if CONFIG_SWSCALE_ALPHA
3674 *yuv2packed1 = yuv2rgba64be_1_c;
3675 *yuv2packed2 = yuv2rgba64be_2_c;
3676 *yuv2packedX = yuv2rgba64be_X_c;
3680 *yuv2packed1 = yuv2rgbx64be_1_c;
3681 *yuv2packed2 = yuv2rgbx64be_2_c;
3682 *yuv2packedX = yuv2rgbx64be_X_c;
3686#if CONFIG_SWSCALE_ALPHA
3688 *yuv2packed1 = yuv2bgra64le_1_c;
3689 *yuv2packed2 = yuv2bgra64le_2_c;
3690 *yuv2packedX = yuv2bgra64le_X_c;
3694 *yuv2packed1 = yuv2bgrx64le_1_c;
3695 *yuv2packed2 = yuv2bgrx64le_2_c;
3696 *yuv2packedX = yuv2bgrx64le_X_c;
3700#if CONFIG_SWSCALE_ALPHA
3702 *yuv2packed1 = yuv2bgra64be_1_c;
3703 *yuv2packed2 = yuv2bgra64be_2_c;
3704 *yuv2packedX = yuv2bgra64be_X_c;
3708 *yuv2packed1 = yuv2bgrx64be_1_c;
3709 *yuv2packed2 = yuv2bgrx64be_2_c;
3710 *yuv2packedX = yuv2bgrx64be_X_c;
3714#if CONFIG_SWSCALE_ALPHA
3716 *yuv2packed1 = yuv2rgbaf32le_1_c;
3717 *yuv2packed2 = yuv2rgbaf32le_2_c;
3718 *yuv2packedX = yuv2rgbaf32le_X_c;
3722 *yuv2packed1 = yuv2rgbxf32le_1_c;
3723 *yuv2packed2 = yuv2rgbxf32le_2_c;
3724 *yuv2packedX = yuv2rgbxf32le_X_c;
3728#if CONFIG_SWSCALE_ALPHA
3730 *yuv2packed1 = yuv2rgbaf32be_1_c;
3731 *yuv2packed2 = yuv2rgbaf32be_2_c;
3732 *yuv2packedX = yuv2rgbaf32be_X_c;
3736 *yuv2packed1 = yuv2rgbxf32be_1_c;
3737 *yuv2packed2 = yuv2rgbxf32be_2_c;
3738 *yuv2packedX = yuv2rgbxf32be_X_c;
3742 *yuv2packed1 = yuv2rgb48le_1_c;
3743 *yuv2packed2 = yuv2rgb48le_2_c;
3744 *yuv2packedX = yuv2rgb48le_X_c;
3747 *yuv2packed1 = yuv2rgb48be_1_c;
3748 *yuv2packed2 = yuv2rgb48be_2_c;
3749 *yuv2packedX = yuv2rgb48be_X_c;
3752 *yuv2packed1 = yuv2bgr48le_1_c;
3753 *yuv2packed2 = yuv2bgr48le_2_c;
3754 *yuv2packedX = yuv2bgr48le_X_c;
3757 *yuv2packed1 = yuv2bgr48be_1_c;
3758 *yuv2packed2 = yuv2bgr48be_2_c;
3759 *yuv2packedX = yuv2bgr48be_X_c;
3764 *yuv2packed1 = yuv2rgb32_1_c;
3765 *yuv2packed2 = yuv2rgb32_2_c;
3766 *yuv2packedX = yuv2rgb32_X_c;
3768#if CONFIG_SWSCALE_ALPHA
3770 *yuv2packed1 = yuv2rgba32_1_c;
3771 *yuv2packed2 = yuv2rgba32_2_c;
3772 *yuv2packedX = yuv2rgba32_X_c;
3776 *yuv2packed1 = yuv2rgbx32_1_c;
3777 *yuv2packed2 = yuv2rgbx32_2_c;
3778 *yuv2packedX = yuv2rgbx32_X_c;
3785 *yuv2packed1 = yuv2rgb32_1_1_c;
3786 *yuv2packed2 = yuv2rgb32_1_2_c;
3787 *yuv2packedX = yuv2rgb32_1_X_c;
3789#if CONFIG_SWSCALE_ALPHA
3791 *yuv2packed1 = yuv2rgba32_1_1_c;
3792 *yuv2packed2 = yuv2rgba32_1_2_c;
3793 *yuv2packedX = yuv2rgba32_1_X_c;
3797 *yuv2packed1 = yuv2rgbx32_1_1_c;
3798 *yuv2packed2 = yuv2rgbx32_1_2_c;
3799 *yuv2packedX = yuv2rgbx32_1_X_c;
3804 *yuv2packed1 = yuv2rgb24_1_c;
3805 *yuv2packed2 = yuv2rgb24_2_c;
3806 *yuv2packedX = yuv2rgb24_X_c;
3809 *yuv2packed1 = yuv2bgr24_1_c;
3810 *yuv2packed2 = yuv2bgr24_2_c;
3811 *yuv2packedX = yuv2bgr24_X_c;
3817 *yuv2packed1 = yuv2rgb16_1_c;
3818 *yuv2packed2 = yuv2rgb16_2_c;
3819 *yuv2packedX = yuv2rgb16_X_c;
3825 *yuv2packed1 = yuv2rgb15_1_c;
3826 *yuv2packed2 = yuv2rgb15_2_c;
3827 *yuv2packedX = yuv2rgb15_X_c;
3833 *yuv2packed1 = yuv2rgb12_1_c;
3834 *yuv2packed2 = yuv2rgb12_2_c;
3835 *yuv2packedX = yuv2rgb12_X_c;
3839 *yuv2packed1 = yuv2rgb8_1_c;
3840 *yuv2packed2 = yuv2rgb8_2_c;
3841 *yuv2packedX = yuv2rgb8_X_c;
3845 *yuv2packed1 = yuv2rgb4_1_c;
3846 *yuv2packed2 = yuv2rgb4_2_c;
3847 *yuv2packedX = yuv2rgb4_X_c;
3851 *yuv2packed1 = yuv2rgb4b_1_c;
3852 *yuv2packed2 = yuv2rgb4b_2_c;
3853 *yuv2packedX = yuv2rgb4b_X_c;
3857 *yuv2packed1 = yuv2x2rgb10_1_c;
3858 *yuv2packed2 = yuv2x2rgb10_2_c;
3859 *yuv2packedX = yuv2x2rgb10_X_c;
3863 *yuv2packed1 = yuv2x2bgr10_1_c;
3864 *yuv2packed2 = yuv2x2bgr10_2_c;
3865 *yuv2packedX = yuv2x2bgr10_X_c;
3868 *yuv2packedX = yuv2rgbf32le_X_c;
3869 *yuv2packed2 = yuv2rgbf32le_2_c;
3870 *yuv2packed1 = yuv2rgbf32le_1_c;
3873 *yuv2packedX = yuv2rgbf32be_X_c;
3874 *yuv2packed2 = yuv2rgbf32be_2_c;
3875 *yuv2packed1 = yuv2rgbf32be_1_c;
3879 switch (dstFormat) {
3881 *yuv2packed1 = yuv2monowhite_1_c;
3882 *yuv2packed2 = yuv2monowhite_2_c;
3883 *yuv2packedX = yuv2monowhite_X_c;
3886 *yuv2packed1 = yuv2monoblack_1_c;
3887 *yuv2packed2 = yuv2monoblack_2_c;
3888 *yuv2packedX = yuv2monoblack_X_c;
3891 *yuv2packed1 = yuv2yuyv422_1_c;
3892 *yuv2packed2 = yuv2yuyv422_2_c;
3893 *yuv2packedX = yuv2yuyv422_X_c;
3896 *yuv2packed1 = yuv2yvyu422_1_c;
3897 *yuv2packed2 = yuv2yvyu422_2_c;
3898 *yuv2packedX = yuv2yvyu422_X_c;
3901 *yuv2packed1 = yuv2uyvy422_1_c;
3902 *yuv2packed2 = yuv2uyvy422_2_c;
3903 *yuv2packedX = yuv2uyvy422_X_c;
3916 *yuv2packed1 = yuv2ya16le_1_c;
3917 *yuv2packed2 = yuv2ya16le_2_c;
3918 *yuv2packedX = yuv2ya16le_X_c;
3921 *yuv2packed1 = yuv2ya16be_1_c;
3922 *yuv2packed2 = yuv2ya16be_2_c;
3923 *yuv2packedX = yuv2ya16be_X_c;
3926 *yuv2packed1 = yuv2yaf32le_1_c;
3927 *yuv2packed2 = yuv2yaf32le_2_c;
3928 *yuv2packedX = yuv2yaf32le_X_c;
3931 *yuv2packed1 = yuv2yaf32be_1_c;
3932 *yuv2packed2 = yuv2yaf32be_2_c;
3933 *yuv2packedX = yuv2yaf32be_X_c;
3936 *yuv2packedX = yuv2v30xle_X_c;
3939 *yuv2packedX = yuv2ayuv64le_X_c;
3942 *yuv2packedX = yuv2ayuv64be_X_c;
3945 *yuv2packed1 = yuv2ayuv_1_c;
3946 *yuv2packed2 = yuv2ayuv_2_c;
3947 *yuv2packedX = yuv2ayuv_X_c;
3951 *yuv2packed1 = yuv2vuyX_1_c;
3952 *yuv2packed2 = yuv2vuyX_2_c;
3953 *yuv2packedX = yuv2vuyX_X_c;
3956 *yuv2packed1 = yuv2uyva_1_c;
3957 *yuv2packed2 = yuv2uyva_2_c;
3958 *yuv2packedX = yuv2uyva_X_c;
3961 *yuv2packedX = yuv2xv30le_X_c;
3964 *yuv2packedX = yuv2xv36le_X_c;
3967 *yuv2packedX = yuv2xv36be_X_c;
3970 *yuv2packedX = yuv2xv48le_X_c;
3973 *yuv2packedX = yuv2xv48be_X_c;
3976 *yuv2packedX = yuv2y210le_X_c;
3979 *yuv2packedX = yuv2y212le_X_c;
3982 *yuv2packedX = yuv2y216le_X_c;
static double val(void *priv, double ch)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Convenience header that includes libavutil's core.
#define i(width, name, range_min, range_max)
static void yuv2rgb(uint8_t *out, int ridx, int Y, int U, int V)
@ SWS_FULL_CHR_H_INT
Perform full chroma upsampling when upscaling to RGB.
static av_always_inline uint32_t av_float2int(float f)
Reinterpret a float as a 32-bit integer.
static int shift(int a, int b)
#define u(width, name, range_min, range_max)
Macro definitions for various function/variable attributes.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
#define yuv2MSBNBPS(bits, BE_LE, is_be, template_size, typeX_t)
const uint8_t ff_dither_8x8_73[][8]
#define output_pixel32(pos, val)
static av_always_inline void yuv2plane1_16_c_template(const int32_t *src, uint16_t *dest, int dstW, int big_endian, int output_bits)
#define YUV2XV36(BE_LE, is_be)
#define accumulate_bit(acc, val)
static av_always_inline void output_pixel_rgba(uint16_t *dest, int i, unsigned Y1, unsigned Y2, int R, int G, int B, int A1, int A2, enum AVPixelFormat target, int eightbytes, int is_be)
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 av_always_inline void yuv2rgba64_full_X_c_template(SwsInternal *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, int is_be)
#define yuv2plane1_float(template, dest_type, BE_LE)
static av_always_inline void yuv2rgb_full_2_c_template(SwsInternal *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 void yuv2plane1_8_c(const int16_t *src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
static void yuv2ya8_X_c(SwsInternal *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 void yuv2vyu444_X_c(SwsInternal *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 void yuv2ya8_1_c(SwsInternal *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)
const uint8_t ff_dither_2x2_4[][8]
static void yuv2nv12cX_16BE_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest8, int chrDstW)
static void yuv2p01xl1_c(const int16_t *src, uint16_t *dest, int dstW, int big_endian, int output_bits, int output_shift)
static av_always_inline void yuv2ayuv_1_c_template(SwsInternal *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 yuv2ya16_1_c_template(SwsInternal *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, int is_be)
static av_always_inline void yuv2rgba64_X_c_template(SwsInternal *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, int is_be)
static void yuv2vyu444_1_c(SwsInternal *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)
static av_always_inline void yuv2rgb_2_c_template(SwsInternal *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)
#define yuv2p01x_wrapper(fmt, bits, shift)
static av_always_inline void yuv2ayuv_X_c_template(SwsInternal *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)
static av_always_inline void yuv2rgb_full_X_c_template(SwsInternal *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)
static av_always_inline void yuv2plane1_float_bswap_c_template(const int32_t *src, uint32_t *dest, int dstW, ptrdiff_t stride)
const uint8_t ff_dither_2x2_8[][8]
#define V30LE_WRAPPER(name, shift)
const uint8_t ff_dither_4x4_16[][8]
static void yuv2gbrpmsb_full_X_c(SwsInternal *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 yuv2planeX_float_bswap_c_template(const int16_t *filter, int filterSize, const int32_t **src, uint32_t *dest, int dstW, ptrdiff_t stride)
static av_always_inline void yuv2ya16_2_c_template(SwsInternal *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_param, int unused_uvalpha, int y, enum AVPixelFormat target, int unused_hasAlpha, int unused_eightbytes, int is_be)
static av_always_inline void yuv2ya16_X_c_template(SwsInternal *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, int is_be)
static av_always_inline void yuv2rgb_X_c_template(SwsInternal *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)
static av_always_inline void yuv2rgb_write_full(SwsInternal *c, uint8_t *dest, int i, int Y, int A, int U, int V, int y, enum AVPixelFormat target, int hasAlpha, int err[4])
#define output_pixel(pos, val, bias, signedness)
static av_always_inline void yuv2planeX_float_c_template(const int16_t *filter, int filterSize, const int32_t **src, float *dest, int dstW, ptrdiff_t stride)
static av_always_inline void yuv2ayuv_2_c_template(SwsInternal *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 yuv2planeX_float(template, dest_type, BE_LE)
static av_always_inline void yuv2rgba64_full_2_c_template(SwsInternal *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_param, int uvalpha_param, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes, int is_be)
static av_always_inline void yuv2mono_1_c_template(SwsInternal *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 yuv2nv12cX_16_c_template(int big_endian, const uint8_t *chrDither, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest8, int chrDstW, int output_bits)
static av_always_inline void output_pixel_rgba_full(uint16_t *dest, int i, unsigned Y, int R, int G, int B, int A, enum AVPixelFormat target, int eightbytes, int is_be)
static av_always_inline void yuv2mono_2_c_template(SwsInternal *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 yuv2rgb_full_1_c_template(SwsInternal *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 av_always_inline void yuv2422_2_c_template(SwsInternal *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)
const uint8_t ff_dither_8x8_220[][8]
static void yuv2ya8_2_c(SwsInternal *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)
static void yuv2vyu444_2_c(SwsInternal *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)
static av_always_inline void yuv2rgb_1_c_template(SwsInternal *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)
av_cold void ff_sws_init_output_funcs(SwsInternal *c, yuv2planar1_fn *yuv2plane1, yuv2planarX_fn *yuv2planeX, yuv2interleavedX_fn *yuv2nv12cX, yuv2packed1_fn *yuv2packed1, yuv2packed2_fn *yuv2packed2, yuv2packedX_fn *yuv2packedX, yuv2anyX_fn *yuv2anyX)
#define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t)
static void yuv2p01xcX_c(int big_endian, const uint8_t *chrDither, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest8, int chrDstW, int output_bits, int output_shift)
static av_always_inline void yuv2rgba64_2_c_template(SwsInternal *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_param, int uvalpha_param, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes, int is_be)
static void yuv2planeX_8_c(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
#define AYUVPACKEDWRAPPER(name, fmt)
static av_always_inline void yuv2rgba64_full_1_c_template(SwsInternal *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, int is_be)
static av_always_inline void yuv2rgb_write(uint8_t *_dest, int i, int dstW, int Y1, int Y2, unsigned A1, unsigned A2, const void *_r, const void *_g, const void *_b, int y, enum AVPixelFormat target, int hasAlpha)
static void yuv2gbrp_full_X_c(SwsInternal *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)
#define yuv2y2xx_wrapper(bits)
static av_always_inline void yuv2msbplaneX_10_c_template(const int16_t *filter, int filterSize, const int16_t **src, uint16_t *dest, int dstW, int big_endian, int output_bits)
#define YUV2RGBWRAPPER(name, base, ext, fmt, hasAlpha)
static void yuv2nv12cX_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest, int chrDstW)
static av_always_inline void output_pixel_ya(uint16_t *dest, int i, int Y, int A, enum AVPixelFormat target, int is_be)
static av_always_inline void yuv2ayuv64_X_c(SwsInternal *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, int A_offset, int Y_offset, int U_offset, int V_offset, int is_be)
static av_always_inline void yuv2rgba64_1_c_template(SwsInternal *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, int is_be)
static av_always_inline void yuv2422_X_c_template(SwsInternal *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)
#define output_pixels(pos, Y1, U, Y2, V)
static void yuv2gbrpf32_full_X_c(SwsInternal *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)
#define YUV2PACKED16WRAPPER(name, base, ext, base_fmt, endianness, hasAlpha, eightbytes)
const uint8_t ff_dither_8x8_32[][8]
#define YUV2AYUV64(pixfmt, BE_LE, A, Y, U, V, is_be)
static void yuv2p01xlX_c(const int16_t *filter, int filterSize, const int16_t **src, uint16_t *dest, int dstW, int big_endian, int output_bits, int output_shift)
static av_always_inline void yuv2422_1_c_template(SwsInternal *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 yuv2v30_X_c_template(SwsInternal *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, int shift)
static void yuv2gbrp16_full_X_c(SwsInternal *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 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)
#define YUV2PACKEDWRAPPER(name, base, ext, fmt)
static av_always_inline void yuv2plane1_float_c_template(const int32_t *src, float *dest, int dstW, ptrdiff_t stride)
static void yuv2xv36_X_c(SwsInternal *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, int is_be)
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)
static av_always_inline void yuv2rgb_write_full(SwsInternal *c, uint8_t *dest, int i, int R, int A, int G, int B, int y, enum AVPixelFormat target, int hasAlpha, int err[4])
#define YUV2RGBWRAPPER(name, base, ext, fmt, hasAlpha)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
#define AV_PIX_FMT_RGBF32
#define AV_PIX_FMT_RGBAF32
#define AV_PIX_FMT_BGR444
#define AV_PIX_FMT_BGR555
#define AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_X2RGB10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_UYVA
packed UYVA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), UYVAUYVA...
@ AV_PIX_FMT_V30XLE
packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), little-endian
@ AV_PIX_FMT_AYUV64BE
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_GRAYF32LE
IEEE-754 single precision Y, 32bpp, little-endian.
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
@ AV_PIX_FMT_YA16BE
16 bits gray, 16 bits alpha (big-endian)
@ AV_PIX_FMT_XV36LE
packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian,...
@ AV_PIX_FMT_XV30LE
packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channe...
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
@ AV_PIX_FMT_BGR565BE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
@ AV_PIX_FMT_RGBF32LE
IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian.
@ AV_PIX_FMT_VUYX
packed VUYX 4:4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined
@ AV_PIX_FMT_GBRP9LE
planar GBR 4:4:4 27bpp, little-endian
@ AV_PIX_FMT_GBRP10MSBBE
planar GBR 4:4:4 30bpp, lowest bits zero, big-endian
@ AV_PIX_FMT_AYUV64LE
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ AV_PIX_FMT_RGB555BE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
@ AV_PIX_FMT_YVYU422
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
@ AV_PIX_FMT_GBRAP12BE
planar GBR 4:4:4:4 48bpp, big-endian
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_X2BGR10LE
packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_BGR48BE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
@ AV_PIX_FMT_YA16LE
16 bits gray, 16 bits alpha (little-endian)
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
@ AV_PIX_FMT_Y210LE
packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ AV_PIX_FMT_RGBA64BE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb)
@ AV_PIX_FMT_YAF32BE
IEEE-754 single precision packed YA, 32 bits gray, 32 bits alpha, 64bpp, big-endian.
@ AV_PIX_FMT_GBRAP14BE
planar GBR 4:4:4:4 56bpp, big-endian
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_GBRAP16BE
planar GBRA 4:4:4:4 64bpp, big-endian
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
@ AV_PIX_FMT_RGB444LE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_GBRP10MSBLE
planar GBR 4:4:4 30bpp, lowest bits zero, little-endian
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
@ AV_PIX_FMT_YAF32LE
IEEE-754 single precision packed YA, 32 bits gray, 32 bits alpha, 64bpp, little-endian.
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
@ AV_PIX_FMT_BGRA64BE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
@ AV_PIX_FMT_GBRP16BE
planar GBR 4:4:4 48bpp, big-endian
@ AV_PIX_FMT_AYUV
packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
@ AV_PIX_FMT_GBRAP12LE
planar GBR 4:4:4:4 48bpp, little-endian
@ AV_PIX_FMT_GBRP9BE
planar GBR 4:4:4 27bpp, big-endian
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_BGR444BE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
@ AV_PIX_FMT_BGR555BE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
@ AV_PIX_FMT_GBRAPF32BE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
@ AV_PIX_FMT_XV36BE
packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian,...
@ AV_PIX_FMT_GBRP12MSBLE
planar GBR 4:4:4 36bpp, lowest bits zero, little-endian
@ AV_PIX_FMT_Y212LE
packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits,...
@ AV_PIX_FMT_Y216LE
packed YUV 4:2:2 like YUYV422, 32bpp, little-endian
@ AV_PIX_FMT_BGR444LE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_X2RGB10LE
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
@ AV_PIX_FMT_GBRAP14LE
planar GBR 4:4:4:4 56bpp, little-endian
@ AV_PIX_FMT_GRAYF32BE
IEEE-754 single precision Y, 32bpp, big-endian.
@ AV_PIX_FMT_RGB444BE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
@ AV_PIX_FMT_BGR48LE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
@ AV_PIX_FMT_GBRP14LE
planar GBR 4:4:4 42bpp, little-endian
@ AV_PIX_FMT_XV48LE
packed XVYU 4:4:4, 64bpp, little-endian, variant of Y416 where alpha channel is left undefined
@ AV_PIX_FMT_GBRP10LE
planar GBR 4:4:4 30bpp, little-endian
@ AV_PIX_FMT_GBRAP10BE
planar GBR 4:4:4:4 40bpp, big-endian
@ AV_PIX_FMT_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
@ AV_PIX_FMT_BGR555LE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_BGRA64LE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_GBRAP10LE
planar GBR 4:4:4:4 40bpp, little-endian
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_VUYA
packed VUYA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), VUYAVUYA...
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_XV48BE
packed XVYU 4:4:4, 64bpp, big-endian, variant of Y416 where alpha channel is left undefined
@ AV_PIX_FMT_GBRAP16LE
planar GBRA 4:4:4:4 64bpp, little-endian
@ AV_PIX_FMT_RGBAF32BE
IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian.
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
@ AV_PIX_FMT_GBRP14BE
planar GBR 4:4:4 42bpp, big-endian
@ AV_PIX_FMT_BGR565LE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
@ AV_PIX_FMT_X2BGR10BE
packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), big-endian, X=unused/undefined
@ AV_PIX_FMT_RGBF32BE
IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian.
@ AV_PIX_FMT_RGBAF32LE
IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian.
@ AV_PIX_FMT_GBRP16LE
planar GBR 4:4:4 48bpp, little-endian
@ AV_PIX_FMT_VYU444
packed VYU 4:4:4, 24bpp (1 Cr & Cb sample per 1x1 Y), VYUVYU...
@ AV_PIX_FMT_RGB4
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
@ AV_PIX_FMT_BGR4
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
@ AV_PIX_FMT_X2RGB10BE
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined
@ AV_PIX_FMT_GBRP12MSBBE
planar GBR 4:4:4 36bpp, lowest bits zero, big-endian
#define AV_PIX_FMT_RGB32_1
#define AV_PIX_FMT_BGR32_1
#define AV_PIX_FMT_X2BGR10
#define AV_PIX_FMT_BGR565
#define AV_PIX_FMT_RGB565
#define AV_PIX_FMT_BGRA64
#define AV_PIX_FMT_RGB444
#define AV_PIX_FMT_RGB555
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define YUVRGB_TABLE_HEADROOM
void(* yuv2packed1_fn)(SwsInternal *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...
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...
static av_always_inline int isSwappedChroma(enum AVPixelFormat pix_fmt)
void(* yuv2packedX_fn)(SwsInternal *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...
static av_always_inline int isDataInHighBits(enum AVPixelFormat pix_fmt)
static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
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 int isSemiPlanarYUV(enum AVPixelFormat pix_fmt)
void(* yuv2anyX_fn)(SwsInternal *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...
void(* yuv2packed2_fn)(SwsInternal *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...
void(* yuv2interleavedX_fn)(enum AVPixelFormat dstFormat, const uint8_t *chrDither, 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 ...
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
static void FUNC yuv2planeX(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
static const uint16_t dither[8][8]