History

swscale/input: add VUYA input support

James Almer committed 4 years ago

Commit f0abd071 parent cbb53bf3 files · +37 −1Browse files

Unified · Split

3 files
  1. libswscale/input.c +35 −0
  2. libswscale/utils.c +1 −0
  3. libswscale/version.h +1 −1
libswscale/input.c+35−0
@@ -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 AV_WN16(dst + i * 2, AV_RL16(src + i * 8));650 AV_WN16(dst + i * 2, AV_RL16(src + i * 8));
651}651}
652 652
653static 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
663static 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
671static 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/* This is almost identical to the previous, end exists only because679/* This is almost identical to the previous, end exists only because
654 * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */680 * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
655static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,681static 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 c->chrToYV12 = bswap16UV_c;1255 c->chrToYV12 = bswap16UV_c;
1230 break;1256 break;
1231#endif1257#endif
1258 case AV_PIX_FMT_VUYA:
1259 c->chrToYV12 = read_vuya_UV_c;
1260 break;
1232 case AV_PIX_FMT_AYUV64LE:1261 case AV_PIX_FMT_AYUV64LE:
1233 c->chrToYV12 = read_ayuv64le_UV_c;1262 c->chrToYV12 = read_ayuv64le_UV_c;
1234 break;1263 break;
@@ -1591,6 +1620,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 356 unmodified lines
1591 case AV_PIX_FMT_YA16BE:1620 case AV_PIX_FMT_YA16BE:
1592 c->lumToYV12 = read_ya16be_gray_c;1621 c->lumToYV12 = read_ya16be_gray_c;
1593 break;1622 break;
1623 case AV_PIX_FMT_VUYA:
1624 c->lumToYV12 = read_vuya_Y_c;
1625 break;
1594 case AV_PIX_FMT_AYUV64LE:1626 case AV_PIX_FMT_AYUV64LE:
1595 c->lumToYV12 = read_ayuv64le_Y_c;1627 c->lumToYV12 = read_ayuv64le_Y_c;
1596 break;1628 break;
@@ -1746,6 +1778,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 149 unmodified lines
1746 case AV_PIX_FMT_YA16BE:1778 case AV_PIX_FMT_YA16BE:
1747 c->alpToYV12 = read_ya16be_alpha_c;1779 c->alpToYV12 = read_ya16be_alpha_c;
1748 break;1780 break;
1781 case AV_PIX_FMT_VUYA:
1782 c->alpToYV12 = read_vuya_A_c;
1783 break;
1749 case AV_PIX_FMT_AYUV64LE:1784 case AV_PIX_FMT_AYUV64LE:
1750 c->alpToYV12 = read_ayuv64le_A_c;1785 c->alpToYV12 = read_ayuv64le_A_c;
1751 break;1786 break;
libswscale/utils.c+1−0
@@ -258,6 +258,7 @@ static const FormatEntry format_entries[] = { · 257 unmodified lines
258 [AV_PIX_FMT_P416BE] = { 1, 1 },258 [AV_PIX_FMT_P416BE] = { 1, 1 },
259 [AV_PIX_FMT_P416LE] = { 1, 1 },259 [AV_PIX_FMT_P416LE] = { 1, 1 },
260 [AV_PIX_FMT_NV16] = { 1, 1 },260 [AV_PIX_FMT_NV16] = { 1, 1 },
261 [AV_PIX_FMT_VUYA] = { 1, 0 },
261};262};
262 263
263int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos,264int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos,
libswscale/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "version_major.h"29#include "version_major.h"
30 30
31#define LIBSWSCALE_VERSION_MINOR 831#define LIBSWSCALE_VERSION_MINOR 8
32#define LIBSWSCALE_VERSION_MICRO 10132#define LIBSWSCALE_VERSION_MICRO 102
33 33
34#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \34#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
35 LIBSWSCALE_VERSION_MINOR, \35 LIBSWSCALE_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t