]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/scale_cuda: add support for RGB formats
authorTimo Rothenpieler <timo@rothenpieler.org>
Wed, 4 Nov 2020 18:53:41 +0000 (19:53 +0100)
committerTimo Rothenpieler <timo@rothenpieler.org>
Wed, 4 Nov 2020 18:53:41 +0000 (19:53 +0100)
libavfilter/vf_scale_cuda.c

index 5405e6a4ed565d19b6a115d433a878c9882780d6..fb585e5edc53539b89bd19b47526f6cd1dd76e7b 100644 (file)
@@ -48,6 +48,8 @@ static const enum AVPixelFormat supported_formats[] = {
     AV_PIX_FMT_P010,
     AV_PIX_FMT_P016,
     AV_PIX_FMT_YUV444P16,
+    AV_PIX_FMT_0RGB32,
+    AV_PIX_FMT_0BGR32,
 };
 
 #define DIV_UP(a, b) ( ((a) + (b) - 1) / (b) )
@@ -517,6 +519,13 @@ static int scalecuda_resize(AVFilterContext *ctx,
                            out->data[1], out->width / 2, out->height / 2, out->linesize[1] / 4,
                            2, 16);
         break;
+    case AV_PIX_FMT_0RGB32:
+    case AV_PIX_FMT_0BGR32:
+        call_resize_kernel(ctx, s->cu_func_uchar4, 4,
+                           in->data[0], in->width, in->height, in->linesize[0],
+                           out->data[0], out->width, out->height, out->linesize[0] / 4,
+                           1, 8);
+        break;
     default:
         return AVERROR_BUG;
     }