swscale/input: add VYU444 input support

Signed-off-by: James Almer <jamrial@gmail.com>
pull/153/merge
James Almer 1 month ago
parent ec7f5e314d
commit ea05edc9e0
  1. 24
      libswscale/input.c
  2. 1
      libswscale/utils.c

@ -746,6 +746,24 @@ static void read_uyva_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0,
}
}
static void vyuToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
uint32_t *unused2, void *opq)
{
int i;
for (i = 0; i < width; i++)
dst[i] = src[i * 3 + 1];
}
static void vyuToUV_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 * 3 + 2];
dstV[i] = src[i * 3];
}
}
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)
{
@ -1342,6 +1360,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
case AV_PIX_FMT_UYVY422:
*chrToYV12 = uyvyToUV_c;
break;
case AV_PIX_FMT_VYU444:
*chrToYV12 = vyuToUV_c;
break;
case AV_PIX_FMT_NV12:
case AV_PIX_FMT_NV16:
case AV_PIX_FMT_NV24:
@ -1905,6 +1926,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
case AV_PIX_FMT_UYVY422:
*lumToYV12 = uyvyToY_c;
break;
case AV_PIX_FMT_VYU444:
*lumToYV12 = vyuToY_c;
break;
case AV_PIX_FMT_BGR24:
*lumToYV12 = bgr24ToY_c;
break;

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

Loading…
Cancel
Save