aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2022-09-04 16:32:06 -0700
committerPhilip Langdale <philipl@overt.org>2022-09-06 12:49:10 -0700
commit198b5b90d5ab1c48aa54e0c6f2b6acd28487b0b3 (patch)
tree4ce59541c8d1ed257ef691296976aaafb6262bb0
parent5bdd7261150db5d254d588f6cf8f038c149e63b5 (diff)
downloadffmpeg-198b5b90d5ab1c48aa54e0c6f2b6acd28487b0b3.tar.gz
swscale/input: add support for XV30LE
-rw-r--r--libswscale/input.c25
-rw-r--r--libswscale/utils.c1
-rw-r--r--libswscale/version.h2
3 files changed, 27 insertions, 1 deletions
diff --git a/libswscale/input.c b/libswscale/input.c
index babedfd541..f4f08c8f72 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -685,6 +685,25 @@ static void read_vuya_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unuse
dst[i] = src[i * 4 + 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)
+{
+ int i;
+ for (i = 0; i < width; i++)
+ AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 10) & 0x3FFu);
+}
+
+
+static void read_xv30le_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++) {
+ AV_WN16(dstU + i * 2, AV_RL32(src + i * 4) & 0x3FFu);
+ AV_WN16(dstV + i * 2, (AV_RL32(src + i * 4) >> 20) & 0x3FFu);
+ }
+}
+
static void read_xv36le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
uint32_t *unused2, void *opq)
{
@@ -1390,6 +1409,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_VUYX:
c->chrToYV12 = read_vuyx_UV_c;
break;
+ case AV_PIX_FMT_XV30LE:
+ c->chrToYV12 = read_xv30le_UV_c;
+ break;
case AV_PIX_FMT_AYUV64LE:
c->chrToYV12 = read_ayuv64le_UV_c;
break;
@@ -1777,6 +1799,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_VUYX:
c->lumToYV12 = read_vuyx_Y_c;
break;
+ case AV_PIX_FMT_XV30LE:
+ c->lumToYV12 = read_xv30le_Y_c;
+ break;
case AV_PIX_FMT_AYUV64LE:
c->lumToYV12 = read_ayuv64le_Y_c;
break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index a7f77cd39d..ab86037cd4 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -264,6 +264,7 @@ static const FormatEntry format_entries[] = {
[AV_PIX_FMT_VUYX] = { 1, 1 },
[AV_PIX_FMT_RGBAF16BE] = { 1, 0 },
[AV_PIX_FMT_RGBAF16LE] = { 1, 0 },
+ [AV_PIX_FMT_XV30LE] = { 1, 0 },
[AV_PIX_FMT_XV36LE] = { 1, 0 },
};
diff --git a/libswscale/version.h b/libswscale/version.h
index dd517a1fc6..d2880590a6 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -29,7 +29,7 @@
#include "version_major.h"
#define LIBSWSCALE_VERSION_MINOR 8
-#define LIBSWSCALE_VERSION_MICRO 106
+#define LIBSWSCALE_VERSION_MICRO 107
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \