summaryrefslogtreecommitdiff
path: root/libavfilter/opencl.h
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/opencl.h
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/opencl.h')
-rw-r--r--libavfilter/opencl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavfilter/opencl.h b/libavfilter/opencl.h
index 4d740c18ab..45fe2a2e27 100644
--- a/libavfilter/opencl.h
+++ b/libavfilter/opencl.h
@@ -84,4 +84,12 @@ int ff_opencl_filter_load_program(AVFilterContext *avctx,
int ff_opencl_filter_load_program_from_file(AVFilterContext *avctx,
const char *filename);
+/**
+ * Find the work size needed needed for a given plane of an image.
+ */
+int ff_opencl_filter_work_size_from_image(AVFilterContext *avctx,
+ size_t *work_size,
+ AVFrame *frame, int plane,
+ int block_alignment);
+
#endif /* AVFILTER_OPENCL_H */