summaryrefslogtreecommitdiff
path: root/libavfilter/vf_program_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_program_opencl.c
parentb78d55b2e63e410abe744932fda9358633743a9e (diff)
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_program_opencl.c')
-rw-r--r--libavfilter/vf_program_opencl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/vf_program_opencl.c b/libavfilter/vf_program_opencl.c
index 4ee9668236..0bcf188ac7 100644
--- a/libavfilter/vf_program_opencl.c
+++ b/libavfilter/vf_program_opencl.c
@@ -142,10 +142,10 @@ static int program_opencl_run(AVFilterContext *avctx)
}
}
- cle = clGetImageInfo(dst, CL_IMAGE_WIDTH, sizeof(size_t),
- &global_work[0], NULL);
- cle = clGetImageInfo(dst, CL_IMAGE_HEIGHT, sizeof(size_t),
- &global_work[1], NULL);
+ err = ff_opencl_filter_work_size_from_image(avctx, global_work,
+ output, plane, 0);
+ if (err < 0)
+ goto fail;
av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d "
"(%zux%zu).\n", plane, global_work[0], global_work[1]);