[FFmpeg-devel] [PATCH] swr/resample: use av_clip functions

Timothy Gu timothygu99 at gmail.com
Mon Apr 6 01:40:42 CEST 2015


On Sun, Apr 5, 2015 at 11:40 AM James Almer <jamrial at gmail.com> wrote:

> On 05/04/15 3:26 PM, James Almer wrote:
> > Signed-off-by: James Almer <jamrial at gmail.com>
> > ---
> >  libswresample/resample_template.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libswresample/resample_template.c b/libswresample/resample_
> template.c
> > index 7e80ef9..d71efd6 100644
> > --- a/libswresample/resample_template.c
> > +++ b/libswresample/resample_template.c
> > @@ -53,7 +53,7 @@
> >  #    define FELEM_MAX INT32_MAX
> >  #    define FELEM_MIN INT32_MIN
> >  #    define OUT(d, v) (v) = ((v) + (1<<(FILTER_SHIFT-1)))>>
> FILTER_SHIFT;\
> > -                      (d) = (uint64_t)((v) + 0x80000000) > 0xFFFFFFFF ?
> ((v)>>63) ^ 0x7FFFFFFF : (v)
> > +                      (d) = av_clipl_int32(v)
>
> Unlike the s16 template, this code is not being tested by fate-swr for
> some reason. You can change this
> line to "(d) = 0" and fate will still pass.
>

Not sure why, but s32 functions are not tested at all:
http://coverage.ffmpeg.org/ffmpeg/libswresample/resample_dsp.c.gcov.html

Timothy


More information about the ffmpeg-devel mailing list