[FFmpeg-devel] libavfilter/unsharpen: patch fixes and resubmission

Michael Niedermayer michaelni at gmx.at
Wed Dec 24 19:21:17 CET 2014


On Tue, Dec 23, 2014 at 09:26:04PM +0000, Titov, Alexey wrote:
> Hi,
> 
> I've fixed the patch according to the reviewers suggestions. Attached are the two patches (original and fixes)
> 
> Regards,
> Alexey
> 
> From e94ea7add32791a1c9ac04dbd68b78cf799ca92d Mon Sep 17 00:00:00 2001
> From: atitov <alexey.titov at amd.com>
> Date: Wed, 17 Dec 2014 16:02:17 -0800
> Subject: [PATCH 1/2] libavfilter: unsharpen opencl filter optimizations
> 
> ---
> libavfilter/unsharp.h               |   4 ++
> libavfilter/unsharp_opencl.c        |  76 +++++++++++++++-------
> libavfilter/unsharp_opencl_kernel.h | 122 ++++++++++++++++++++++++++----------
> libavutil/opencl.c                  |  19 +++++-
> 4 files changed, 165 insertions(+), 56 deletions(-)
> 
> diff --git a/libavfilter/unsharp.h b/libavfilter/unsharp.h
> index c2aed64..fc651c0 100644
> --- a/libavfilter/unsharp.h
> +++ b/libavfilter/unsharp.h
> @@ -41,6 +41,10 @@ typedef struct {
>      cl_kernel kernel_chroma;
>      cl_mem cl_luma_mask;
>      cl_mem cl_chroma_mask;
> +    cl_mem cl_luma_mask_x;
> +    cl_mem cl_chroma_mask_x;
> +    cl_mem cl_luma_mask_y;
> +    cl_mem cl_chroma_mask_y;
>      int in_plane_size[8];
>      int out_plane_size[8];
>      int plane_num;
> diff --git a/libavfilter/unsharp_opencl.c b/libavfilter/unsharp_opencl.c
> index 5c6b5ef..a99fc5b 100644
> --- a/libavfilter/unsharp_opencl.c
> +++ b/libavfilter/unsharp_opencl.c
> @@ -87,42 +87,36 @@ end:
>      return ret;
> }
> -static int compute_mask_matrix(cl_mem cl_mask_matrix, int step_x, int step_y)
> +static int copy_separable_masks(cl_mem cl_mask_x, cl_mem cl_mask_y, int step_x, int step_y)
> {
> -    int i, j, ret = 0;
> -    uint32_t *mask_matrix, *mask_x, *mask_y;
> -    size_t size_matrix = sizeof(uint32_t) * (2 * step_x + 1) * (2 * step_y + 1);
> -    mask_x = av_mallocz_array(2 * step_x + 1, sizeof(uint32_t));
> +    int ret = 0;
> +    uint32_t *mask_x, *mask_y;
> +    size_t size_mask_x = sizeof(uint32_t) * (2 * step_x + 1);
> +    size_t size_mask_y = sizeof(uint32_t) * (2 * step_y + 1);
> +    mask_x = av_mallocz_array(size_mask_x);
>      if (!mask_x) {

>          ret = AVERROR(ENOMEM);
>          goto end;
>      }
> -    mask_y = av_mallocz_array(2 * step_y + 1, sizeof(uint32_t));
> +    mask_y = av_mallocz_array(size_mask_y);
>      if (!mask_y) {
>          ret = AVERROR(ENOMEM);

and the 2nd patch changes this back basically

> -    mask_x = av_mallocz_array(size_mask_x);
> +    mask_x = av_mallocz_array((2 * step_x + 1), sizeof(uint32_t));

please stash the 2 patches together, also pease remove unneeded
and unrelated changes


[...]
> diff --git a/libavutil/opencl.c b/libavutil/opencl.c
> index 36cb6fe..738d0db 100644
> --- a/libavutil/opencl.c
> +++ b/libavutil/opencl.c

changes to libavutil should probably be in a seperate patch

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141224/cb58d736/attachment.asc>


More information about the ffmpeg-devel mailing list