aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-11-04 21:35:15 -0300
committerJames Almer <jamrial@gmail.com>2024-11-06 17:34:32 -0300
commitc8438546ff165acadf65bf66e5a43589898c4503 (patch)
treeeeefd89bfd6bda6c8e2f2bbe24e7383028f876b2
parente7382b4d0101f02e61fdf5ad2c48aca500bb413f (diff)
downloadffmpeg-c8438546ff165acadf65bf66e5a43589898c4503.tar.gz
avfilter/vsrc_testsrc: add support for RGB48/RGBA64
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavfilter/vsrc_testsrc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 1342f63d25..e9a3a29c0d 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -1000,6 +1000,7 @@ static void rgbtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
uint8_t *dst = dstp[0];
ptrdiff_t dst_linesize = dst_linesizep[0];
uint32_t v;
+ uint64_t v16;
uint8_t *p;
uint16_t *p16;
@@ -1016,6 +1017,23 @@ static void rgbtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
p = dst + 3*x + y*dst_linesize;
AV_WL24(p, v);
break;
+ case AV_PIX_FMT_RGB48:
+ case AV_PIX_FMT_BGR48:
+ v16 = ((uint64_t)r << (rgba_map[R]*16)) + ((uint64_t)g << (rgba_map[G]*16)) + ((uint64_t)b << (rgba_map[B]*16));
+ p16 = (uint16_t *)(dst + 6*x + y*dst_linesize);
+ *p16++ = v16 >> 32;
+ *p16++ = v16 >> 16;
+ *p16++ = v16;
+ break;
+ case AV_PIX_FMT_RGBA64:
+ case AV_PIX_FMT_BGRA64:
+ v16 = ((uint64_t)r << (rgba_map[R]*16)) + ((uint64_t)g << (rgba_map[G]*16)) + ((uint64_t)b << (rgba_map[B]*16));
+ p16 = (uint16_t *)(dst + 8*x + y*dst_linesize);
+ *p16++ = v16 >> 32;
+ *p16++ = v16 >> 16;
+ *p16++ = v16;
+ *p16++ = 0xffff;
+ break;
case AV_PIX_FMT_RGBA:
case AV_PIX_FMT_BGRA:
case AV_PIX_FMT_ARGB:
@@ -1114,6 +1132,8 @@ static const enum AVPixelFormat rgbtest_pix_fmts[] = {
AV_PIX_FMT_RGB444, AV_PIX_FMT_BGR444,
AV_PIX_FMT_RGB565, AV_PIX_FMT_BGR565,
AV_PIX_FMT_RGB555, AV_PIX_FMT_BGR555,
+ AV_PIX_FMT_RGB48, AV_PIX_FMT_BGR48,
+ AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
AV_PIX_FMT_X2RGB10LE, AV_PIX_FMT_X2BGR10LE,