[FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: 255 * 256 * 128 -> max

lance.lmwang at gmail.com lance.lmwang at gmail.com
Tue Aug 11 18:33:31 EEST 2020


On Tue, Aug 11, 2020 at 05:24:06PM +0200, Paul B Mahol wrote:
> NAK
> 
> On 8/11/20, lance.lmwang at gmail.com <lance.lmwang at gmail.com> wrote:
> > From: Limin Wang <lance.lmwang at gmail.com>
> >
> > max is initialized to ((1 << depth) - 1) * 256 * 128 before.
> >
> > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > ---
> >  libavfilter/vf_w3fdif.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
> > index 5d64dbd..0f9efbf 100644
> > --- a/libavfilter/vf_w3fdif.c
> > +++ b/libavfilter/vf_w3fdif.c
> > @@ -163,7 +163,7 @@ static void filter_scale(uint8_t *out_pixel, const
> > int32_t *work_pixel, int line
> >      int j;
> >
> >      for (j = 0; j < linesize; j++, out_pixel++, work_pixel++)
> > -        *out_pixel = av_clip(*work_pixel, 0, 255 * 256 * 128) >> 15;
> > +        *out_pixel = av_clip(*work_pixel, 0, max) >> 15;
> >  }
> >
> >  static void filter16_simple_low(int32_t *work_line,
> > --
> > 1.8.3.1
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 
> 
> Change is pointless and give no real benefits.

1. max is input as parameter and calculated already, why use it is pointless?
2. keep 8 bit and 16bit with same code so that we can remove the duplicate code
later.

-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list