Commit 213839ed authored by Mark Thompson's avatar Mark Thompson

vf_avgblur_opencl: Don't run kernel on pixels outside the image

The output frame size is larger than the image containing a subsampled
plane - use the actual size of the image being written rather than the
dimensions of the intended output frame.
Reviewed-by: 's avatarDylan Fernando <dylanf123@gmail.com>
parent 9f178751
...@@ -170,8 +170,10 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) ...@@ -170,8 +170,10 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
goto fail; goto fail;
} }
global_work[0] = output->width; err = ff_opencl_filter_work_size_from_image(avctx, global_work,
global_work[1] = output->height; intermediate, p, 0);
if (err < 0)
goto fail;
av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d "
"(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n",
...@@ -206,8 +208,10 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) ...@@ -206,8 +208,10 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
goto fail; goto fail;
} }
global_work[0] = output->width; err = ff_opencl_filter_work_size_from_image(avctx, global_work,
global_work[1] = output->height; output, p, 0);
if (err < 0)
goto fail;
av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d "
"(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment