| @@ -650,6 +650,32 @@ static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *u · 649 unmodified lines |
| 650 | 650 | AV_WN16(dst + i * 2, AV_RL16(src + i * 8)); |
| 651 | 651 | } |
| 652 | 652 | |
| 653 | +static void read_vuya_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, |
| 654 | + const uint8_t *unused1, int width, uint32_t *unused2) |
| 655 | +{ |
| 656 | + int i; |
| 657 | + for (i = 0; i < width; i++) { |
| 658 | + dstU[i] = src[i * 4 + 1]; |
| 659 | + dstV[i] = src[i * 4]; |
| 660 | + } |
| 661 | +} |
| 662 | + |
| 663 | +static void read_vuya_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, |
| 664 | + uint32_t *unused2) |
| 665 | +{ |
| 666 | + int i; |
| 667 | + for (i = 0; i < width; i++) |
| 668 | + dst[i] = src[i * 4 + 2]; |
| 669 | +} |
| 670 | + |
| 671 | +static void read_vuya_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, |
| 672 | + uint32_t *unused2) |
| 673 | +{ |
| 674 | + int i; |
| 675 | + for (i = 0; i < width; i++) |
| 676 | + dst[i] = src[i * 4 + 3]; |
| 677 | +} |
| 678 | + |
| 653 | 679 | /* This is almost identical to the previous, end exists only because |
| 654 | 680 | * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */ |
| 655 | 681 | static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, |
| @@ -1229,6 +1255,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 573 unmodified lines |
| 1229 | 1255 | c->chrToYV12 = bswap16UV_c; |
| 1230 | 1256 | break; |
| 1231 | 1257 | #endif |
| 1258 | + case AV_PIX_FMT_VUYA: |
| 1259 | + c->chrToYV12 = read_vuya_UV_c; |
| 1260 | + break; |
| 1232 | 1261 | case AV_PIX_FMT_AYUV64LE: |
| 1233 | 1262 | c->chrToYV12 = read_ayuv64le_UV_c; |
| 1234 | 1263 | break; |
| @@ -1591,6 +1620,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 356 unmodified lines |
| 1591 | 1620 | case AV_PIX_FMT_YA16BE: |
| 1592 | 1621 | c->lumToYV12 = read_ya16be_gray_c; |
| 1593 | 1622 | break; |
| 1623 | + case AV_PIX_FMT_VUYA: |
| 1624 | + c->lumToYV12 = read_vuya_Y_c; |
| 1625 | + break; |
| 1594 | 1626 | case AV_PIX_FMT_AYUV64LE: |
| 1595 | 1627 | c->lumToYV12 = read_ayuv64le_Y_c; |
| 1596 | 1628 | break; |
| @@ -1746,6 +1778,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 149 unmodified lines |
| 1746 | 1778 | case AV_PIX_FMT_YA16BE: |
| 1747 | 1779 | c->alpToYV12 = read_ya16be_alpha_c; |
| 1748 | 1780 | break; |
| 1781 | + case AV_PIX_FMT_VUYA: |
| 1782 | + c->alpToYV12 = read_vuya_A_c; |
| 1783 | + break; |
| 1749 | 1784 | case AV_PIX_FMT_AYUV64LE: |
| 1750 | 1785 | c->alpToYV12 = read_ayuv64le_A_c; |
| 1751 | 1786 | break; |