aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorLinjie Fu <linjie.fu@intel.com>2020-01-15 14:59:34 +0800
committerMark Thompson <sw@jkqxz.net>2020-02-24 00:09:51 +0000
commitd2aa1fbfd4c4599fc0ae8f32b5e95ad65546944b (patch)
tree59de7aee0772aa95720e54c5588a6a8326372dc4 /libswscale
parent1c37cad084041c74c6f21505e24670611e6f28a5 (diff)
downloadffmpeg-d2aa1fbfd4c4599fc0ae8f32b5e95ad65546944b.tar.gz
swscale: Add swscale input support for Y210LE
Add swscale input support for Y210LE, output support and fate test could be added later if there is requirement for software CSC to this packed format. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/input.c24
-rw-r--r--libswscale/utils.c1
2 files changed, 25 insertions, 0 deletions
diff --git a/libswscale/input.c b/libswscale/input.c
index 159f70307d..8346cf4da6 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -552,6 +552,24 @@ static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con
av_assert1(src1 == src2);
}
+static void y210le_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)
+{
+ int i;
+ for (i = 0; i < width; i++) {
+ AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 2) >> 6);
+ AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> 6);
+ }
+}
+
+static void y210le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0,
+ const uint8_t *unused1, int width, uint32_t *unused2)
+{
+ int i;
+ for (i = 0; i < width; i++)
+ AV_WN16(dst + i * 2, AV_RL16(src + i * 4) >> 6);
+}
+
static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width,
uint32_t *unused)
{
@@ -1154,6 +1172,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_P016BE:
c->chrToYV12 = p016BEToUV_c;
break;
+ case AV_PIX_FMT_Y210LE:
+ c->chrToYV12 = y210le_UV_c;
+ break;
}
if (c->chrSrcHSubSample) {
switch (srcFormat) {
@@ -1586,6 +1607,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c->lumToYV12 = grayf32ToY16_bswap_c;
#endif
break;
+ case AV_PIX_FMT_Y210LE:
+ c->lumToYV12 = y210le_Y_c;
+ break;
}
if (c->needAlpha) {
if (is16BPS(srcFormat) || isNBPS(srcFormat)) {
diff --git a/libswscale/utils.c b/libswscale/utils.c
index e9c66aeb4f..bb3495b990 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -266,6 +266,7 @@ static const FormatEntry format_entries[] = {
[AV_PIX_FMT_YUVA444P12LE] = { 1, 1 },
[AV_PIX_FMT_NV24] = { 1, 1 },
[AV_PIX_FMT_NV42] = { 1, 1 },
+ [AV_PIX_FMT_Y210LE] = { 1, 0 },
};
int sws_isSupportedInput(enum AVPixelFormat pix_fmt)