From 87841c44678f4ea205e4f25213596ef3eb0744b3 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 29 Jun 2022 21:32:42 +0200 Subject: [PATCH 2/2] avutil/hwcontext_opencl: add support fro FLOAT formats Signed-off-by: Paul B Mahol --- libavutil/hwcontext_opencl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c index 4f4bd13405..32aec7d228 100644 --- a/libavutil/hwcontext_opencl.c +++ b/libavutil/hwcontext_opencl.c @@ -1411,7 +1411,8 @@ static int opencl_get_plane_format(enum AVPixelFormat pixfmt, // The bits in each component must be packed in the // most-significant-bits of the relevant bytes. if (comp->shift + comp->depth != 8 && - comp->shift + comp->depth != 16) + comp->shift + comp->depth != 16 && + comp->shift + comp->depth != 32) return AVERROR(EINVAL); // The depth must not vary between components. if (depth && comp->depth != depth) @@ -1455,6 +1456,8 @@ static int opencl_get_plane_format(enum AVPixelFormat pixfmt, } else { if (depth <= 16) image_format->image_channel_data_type = CL_UNORM_INT16; + else if (depth == 32) + image_format->image_channel_data_type = CL_FLOAT; else return AVERROR(EINVAL); } -- 2.36.1