diff options
author | Philip Langdale <philipl@overt.org> | 2022-09-05 13:41:00 -0700 |
---|---|---|
committer | Philip Langdale <philipl@overt.org> | 2022-09-10 12:29:12 -0700 |
commit | 366f073c624779af852bacbc9a0a416e27ff96f7 (patch) | |
tree | 2df07d3614a3d5cc362abc1150cf1704d8e4b917 /libswscale/output.c | |
parent | caf8d4d256cc21f09570bdcbdbe8dde4406834ca (diff) | |
download | ffmpeg-366f073c624779af852bacbc9a0a416e27ff96f7.tar.gz |
swscale/output: add support for XV36LE
Diffstat (limited to 'libswscale/output.c')
-rw-r--r-- | libswscale/output.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libswscale/output.c b/libswscale/output.c index da6c026916..228dab462e 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -2601,6 +2601,32 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter, } 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, + 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 << 14, U = 1 << 14, V = 1 << 14; + 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]; + } + + AV_WL16(dest + 8 * i + 2, av_clip_uintp2(Y >> 15, 12) << 4); + AV_WL16(dest + 8 * i + 0, av_clip_uintp2(U >> 15, 12) << 4); + AV_WL16(dest + 8 * i + 4, av_clip_uintp2(V >> 15, 12) << 4); + } +} + +static void yuv2vuyX_X_c(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, @@ -3192,5 +3218,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, case AV_PIX_FMT_VUYX: *yuv2packedX = yuv2vuyx_X_c; break; + case AV_PIX_FMT_XV36LE: + *yuv2packedX = yuv2xv36le_X_c; + break; } } |