swscale/input: add UYVA input support

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-10-06 19:43:24 -03:00
parent bb37d3c33e
commit ec7f5e314d
2 changed files with 16 additions and 0 deletions

View File

@ -736,6 +736,16 @@ static void read_ayuv_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unuse
dst[i] = src[i * 4];
}
static void read_uyva_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
{
int i;
for (i = 0; i < width; i++) {
dstU[i] = src[i * 4];
dstV[i] = src[i * 4 + 2];
}
}
static void read_xv30le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
uint32_t *unused2, void *opq)
{
@ -1476,6 +1486,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
case AV_PIX_FMT_AYUV64LE:
*chrToYV12 = read_ayuv64le_UV_c;
break;
case AV_PIX_FMT_UYVA:
*chrToYV12 = read_uyva_UV_c;
break;
case AV_PIX_FMT_XV36LE:
*chrToYV12 = read_xv36le_UV_c;
break;
@ -1875,6 +1888,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
*lumToYV12 = read_xv30le_Y_c;
break;
case AV_PIX_FMT_AYUV:
case AV_PIX_FMT_UYVA:
*lumToYV12 = read_ayuv_Y_c;
break;
case AV_PIX_FMT_AYUV64LE:
@ -2061,6 +2075,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
*alpToYV12 = read_ya16be_alpha_c;
break;
case AV_PIX_FMT_VUYA:
case AV_PIX_FMT_UYVA:
*alpToYV12 = read_vuya_A_c;
break;
case AV_PIX_FMT_AYUV:

View File

@ -269,6 +269,7 @@ static const FormatEntry format_entries[] = {
[AV_PIX_FMT_XV30LE] = { 1, 1 },
[AV_PIX_FMT_XV36LE] = { 1, 1 },
[AV_PIX_FMT_AYUV] = { 1, 0 },
[AV_PIX_FMT_UYVA] = { 1, 0 },
};
/**