summaryrefslogtreecommitdiff
path: root/libavfilter/vf_overlay_opencl.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2018-03-19 22:52:30 +0000
committerMark Thompson <sw@jkqxz.net>2018-03-22 23:12:47 +0000
commit2a1542d105dc3161516e34eef77bcd64aa72cab4 (patch)
tree2f32963bfb6d8a00b9136b8a4f169922840a905e /libavfilter/vf_overlay_opencl.c
parentb78d55b2e63e410abe744932fda9358633743a9e (diff)
downloadffmpeg-2a1542d105dc3161516e34eef77bcd64aa72cab4.tar.gz
lavfi/opencl: Derive global work size from plane image sizes
Add a new function to find the global work size given the output image and the required block alignment, then use it in the overlay, program and unsharp filters. Fixes the overlay and unsharp filters applying the kernel to locations outside the frame when subsampled planes are present.
Diffstat (limited to 'libavfilter/vf_overlay_opencl.c')
-rw-r--r--libavfilter/vf_overlay_opencl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_overlay_opencl.c b/libavfilter/vf_overlay_opencl.c
index ee8381dfee..16e10f4371 100644
--- a/libavfilter/vf_overlay_opencl.c
+++ b/libavfilter/vf_overlay_opencl.c
@@ -216,8 +216,10 @@ static int overlay_opencl_blend(FFFrameSync *fs)
goto fail_kernel_arg;
}
- global_work[0] = output->width;
- global_work[1] = output->height;
+ err = ff_opencl_filter_work_size_from_image(avctx, global_work,
+ output, plane, 0);
+ if (err < 0)
+ goto fail;
cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel, 2, NULL,
global_work, NULL, 0, NULL, NULL);