summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2022-09-03 15:58:47 -0700
committerPhilip Langdale <philipl@overt.org>2022-09-06 12:49:10 -0700
commit8d9462844a85b0546c827a5f2c4cc7a1ba49dc9d (patch)
tree8561b2649cadd9b9454ce6a3f15808794fb4e497 /libswscale
parentf4097e4c1f1bb244cae78c363a69d5e84495b616 (diff)
downloadffmpeg-8d9462844a85b0546c827a5f2c4cc7a1ba49dc9d.tar.gz
swscale/input: add support for XV36LE
Diffstat (limited to 'libswscale')
-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 92681c9c53..8032360907 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_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)
+{
+ int i;
+ for (i = 0; i < width; i++)
+ AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2) >> 4);
+}
+
+
+static void read_xv36le_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_RL16(src + i * 8 + 0) >> 4);
+ AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 4) >> 4);
+ }
+}
+
/* This is almost identical to the previous, end exists only because
* yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
@@ -1381,6 +1400,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_AYUV64LE:
c->chrToYV12 = read_ayuv64le_UV_c;
break;
+ case AV_PIX_FMT_XV36LE:
+ c->chrToYV12 = read_xv36le_UV_c;
+ break;
case AV_PIX_FMT_P010LE:
case AV_PIX_FMT_P210LE:
case AV_PIX_FMT_P410LE:
@@ -1759,6 +1781,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_AYUV64LE:
c->lumToYV12 = read_ayuv64le_Y_c;
break;
+ case AV_PIX_FMT_XV36LE:
+ c->lumToYV12 = read_xv36le_Y_c;
+ break;
case AV_PIX_FMT_YUYV422:
case AV_PIX_FMT_YVYU422:
case AV_PIX_FMT_YA8:
diff --git a/libswscale/utils.c b/libswscale/utils.c
index a621a35862..a67e07b612 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -262,6 +262,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_XV36LE] = { 1, 0 },
};
int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos,
diff --git a/libswscale/version.h b/libswscale/version.h
index 17264b45da..403fc8f9e7 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 104
+#define LIBSWSCALE_VERSION_MICRO 105
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \