X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_unsharp_opencl.c;h=19c91857cb719fc4c90fbd72bceca174ba8e8a32;hb=0dc11d8bbd470db89fbc17b7434e992c9129b310;hp=c2ebf70ad9f0e3b82f4c59e493a8ae1e9920ff57;hpb=b4718b76937a6677ce89866e06d929d778c57b64;p=ffmpeg diff --git a/libavfilter/vf_unsharp_opencl.c b/libavfilter/vf_unsharp_opencl.c index c2ebf70ad9f..19c91857cb7 100644 --- a/libavfilter/vf_unsharp_opencl.c +++ b/libavfilter/vf_unsharp_opencl.c @@ -320,18 +320,17 @@ static int unsharp_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) } } - if (ctx->global) { - global_work[0] = output->width; - global_work[1] = output->height; - } else { - global_work[0] = FFALIGN(output->width, 16); - global_work[1] = FFALIGN(output->height, 16); - local_work[0] = 16; - local_work[1] = 16; - } + err = ff_opencl_filter_work_size_from_image(avctx, global_work, output, p, + ctx->global ? 0 : 16); + if (err < 0) + goto fail; + + local_work[0] = 16; + local_work[1] = 16; av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " - "(%zux%zu).\n", p, global_work[0], global_work[1]); + "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", + p, global_work[0], global_work[1]); cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel, 2, NULL, global_work, ctx->global ? NULL : local_work,