avfilter/vf_scale_cuda: Fix incorrect scaling of > 8bit content
authorPhilip Langdale <philipl@overt.org>
Tue, 14 May 2019 02:15:41 +0000 (19:15 -0700)
committerPhilip Langdale <philipl@overt.org>
Wed, 15 May 2019 18:40:50 +0000 (11:40 -0700)
When i converted the filter to use texture objects instead of
texture references, I incorrect dropped the `pixel_size` scaling
factor when setting `pitchInBytes`. `src_pitch` is in pixels and
so must be scaled up.

libavfilter/vf_scale_cuda.c

index c97a802..ecfd6a1 100644 (file)
@@ -357,7 +357,7 @@ static int call_resize_kernel(AVFilterContext *ctx, CUfunction func, int channel
         .res.pitch2D.numChannels = channels,
         .res.pitch2D.width = src_width,
         .res.pitch2D.height = src_height,
-        .res.pitch2D.pitchInBytes = src_pitch,
+        .res.pitch2D.pitchInBytes = src_pitch * pixel_size,
         .res.pitch2D.devPtr = (CUdeviceptr)src_dptr,
     };