aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/output.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2022-09-05 20:00:59 -0700
committerPhilip Langdale <philipl@overt.org>2022-09-10 12:29:12 -0700
commit68181623e984b249402ac6fd0849c032b05ae143 (patch)
tree527438a6c1e5d2187bb377e9467c05f267c77ed9 /libswscale/output.c
parent366f073c624779af852bacbc9a0a416e27ff96f7 (diff)
downloadffmpeg-68181623e984b249402ac6fd0849c032b05ae143.tar.gz
swscale/output: add support for XV30LE
Diffstat (limited to 'libswscale/output.c')
-rw-r--r--libswscale/output.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index 228dab462e..39e2a04609 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2601,6 +2601,34 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,
}
static void
+yuv2xv30le_X_c(SwsContext *c, const int16_t *lumFilter,
+ const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrUSrc,
+ const int16_t **chrVSrc, int chrFilterSize,
+ const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+{
+ int i;
+ for (i = 0; i < dstW; i++) {
+ int Y = 1 << 16, U = 1 << 16, V = 1 << 16;
+ int j;
+
+ for (j = 0; j < lumFilterSize; j++)
+ Y += lumSrc[j][i] * lumFilter[j];
+
+ for (j = 0; j < chrFilterSize; j++) {
+ U += chrUSrc[j][i] * chrFilter[j];
+ V += chrVSrc[j][i] * chrFilter[j];
+ }
+
+ Y = av_clip_uintp2(Y >> 17, 10);
+ U = av_clip_uintp2(U >> 17, 10);
+ V = av_clip_uintp2(V >> 17, 10);
+
+ AV_WL32(dest + 4 * i, U | Y << 10 | V << 20);
+ }
+}
+
+static void
yuv2xv36le_X_c(SwsContext *c, const int16_t *lumFilter,
const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
@@ -3218,6 +3246,9 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
case AV_PIX_FMT_VUYX:
*yuv2packedX = yuv2vuyx_X_c;
break;
+ case AV_PIX_FMT_XV30LE:
+ *yuv2packedX = yuv2xv30le_X_c;
+ break;
case AV_PIX_FMT_XV36LE:
*yuv2packedX = yuv2xv36le_X_c;
break;