[FFmpeg-cvslog] swr/resample: fix filter rounding and cliping for s32

Michael Niedermayer git at videolan.org
Mon Feb 4 04:18:59 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Feb  4 03:25:07 2013 +0100| [91debec976d2535e402c8f6326e70589a2776a38] | committer: Michael Niedermayer

swr/resample: fix filter rounding and cliping for s32

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91debec976d2535e402c8f6326e70589a2776a38
---

 libswresample/resample.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index d3fe1a7..fb9da7c 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -142,7 +142,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
             break;
         case AV_SAMPLE_FMT_S32P:
             for(i=0;i<tap_count;i++)
-                ((int32_t*)filter)[ph * alloc + i] = av_clip(lrintf(tab[i] * scale / norm), INT32_MIN, INT32_MAX);
+                ((int32_t*)filter)[ph * alloc + i] = av_clipl_int32(llrint(tab[i] * scale / norm));
             break;
         case AV_SAMPLE_FMT_FLTP:
             for(i=0;i<tap_count;i++)



More information about the ffmpeg-cvslog mailing list