swscale/input: add V30X input support

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-10-07 13:36:19 -03:00
parent ea05edc9e0
commit 04612351ab
3 changed files with 28 additions and 1 deletions

View File

@ -764,6 +764,26 @@ static void vyuToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, cons
}
}
static void read_v30xle_Y_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++)
AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 12) & 0x3FFu);
}
static void read_v30xle_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++) {
unsigned int uv = AV_RL32(src + i * 4);
AV_WN16(dstU + i * 2, (uv >> 2) & 0x3FFu);
AV_WN16(dstV + i * 2, (uv >> 22) & 0x3FFu);
}
}
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)
{
@ -1501,6 +1521,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
case AV_PIX_FMT_XV30LE:
*chrToYV12 = read_xv30le_UV_c;
break;
case AV_PIX_FMT_V30XLE:
*chrToYV12 = read_v30xle_UV_c;
break;
case AV_PIX_FMT_AYUV:
*chrToYV12 = read_ayuv_UV_c;
break;
@ -1908,6 +1931,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
case AV_PIX_FMT_XV30LE:
*lumToYV12 = read_xv30le_Y_c;
break;
case AV_PIX_FMT_V30XLE:
*lumToYV12 = read_v30xle_Y_c;
break;
case AV_PIX_FMT_AYUV:
case AV_PIX_FMT_UYVA:
*lumToYV12 = read_ayuv_Y_c;

View File

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

View File

@ -28,7 +28,7 @@
#include "version_major.h"
#define LIBSWSCALE_VERSION_MINOR 4
#define LIBSWSCALE_VERSION_MINOR 5
#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \