diff mbox series

[FFmpeg-devel,2/2] avfilter/vf_gblur: remove unnecessary check

Message ID 20200104102316.80671-2-quinkblack@foxmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] avfilter/vf_gblur: fix divide by zero
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

zhilizhao Jan. 4, 2020, 10:23 a.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

---
 libavfilter/vf_gblur.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Paul B Mahol Jan. 4, 2020, 11:03 a.m. UTC | #1
Invalid, sigma can be 0.

On 1/4/20, quinkblack@foxmail.com <quinkblack@foxmail.com> wrote:
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> ---
>  libavfilter/vf_gblur.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
> index e057937fb7..0d7d5438d1 100644
> --- a/libavfilter/vf_gblur.c
> +++ b/libavfilter/vf_gblur.c
> @@ -189,9 +189,6 @@ static void gaussianiir2d(AVFilterContext *ctx, int
> plane)
>      const int nb_threads = ff_filter_get_nb_threads(ctx);
>      ThreadData td;
>
> -    if (s->sigma <= 0 || s->steps < 0)
> -        return;
> -
>      td.width = width;
>      td.height = height;
>      ctx->internal->execute(ctx, filter_horizontally, &td, NULL,
> FFMIN(height, nb_threads));
> @@ -301,7 +298,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> *in)
>          uint16_t *dst16 = (uint16_t *)out->data[plane];
>          int y, x;
>
> -        if (!s->sigma || !(s->planes & (1 << plane))) {
> +        if (!(s->planes & (1 << plane))) {
>              if (out != in)
>                  av_image_copy_plane(out->data[plane], out->linesize[plane],
>                                      in->data[plane], in->linesize[plane],
> --
> 2.22.0
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index e057937fb7..0d7d5438d1 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -189,9 +189,6 @@  static void gaussianiir2d(AVFilterContext *ctx, int plane)
     const int nb_threads = ff_filter_get_nb_threads(ctx);
     ThreadData td;
 
-    if (s->sigma <= 0 || s->steps < 0)
-        return;
-
     td.width = width;
     td.height = height;
     ctx->internal->execute(ctx, filter_horizontally, &td, NULL, FFMIN(height, nb_threads));
@@ -301,7 +298,7 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         uint16_t *dst16 = (uint16_t *)out->data[plane];
         int y, x;
 
-        if (!s->sigma || !(s->planes & (1 << plane))) {
+        if (!(s->planes & (1 << plane))) {
             if (out != in)
                 av_image_copy_plane(out->data[plane], out->linesize[plane],
                                     in->data[plane], in->linesize[plane],