[FFmpeg-devel] [PATCH] swr/resample: use av_clip_int16 instead of av_clip
Ganesh Ajjanagadde
gajjanagadde at gmail.com
Wed Dec 23 23:50:33 CET 2015
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
libswresample/resample.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 6c83eef..7e3bda5 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -200,7 +200,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
switch(c->format){
case AV_SAMPLE_FMT_S16P:
for(i=0;i<tap_count;i++)
- ((int16_t*)filter)[ph * alloc + i] = av_clip(lrintf(tab[i] * scale / norm), INT16_MIN, INT16_MAX);
+ ((int16_t*)filter)[ph * alloc + i] = av_clip_int16(lrintf(tab[i] * scale / norm));
if (tap_count % 2 == 0) {
for (i = 0; i < tap_count; i++)
((int16_t*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((int16_t*)filter)[ph * alloc + i];
@@ -208,7 +208,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
else {
for (i = 1; i <= tap_count; i++)
((int16_t*)filter)[(phase_count-ph) * alloc + tap_count-i] =
- av_clip(lrintf(tab[i] * scale / (norm - tab[0] + tab[tap_count])), INT16_MIN, INT16_MAX);
+ av_clip_int16(lrintf(tab[i] * scale / (norm - tab[0] + tab[tap_count])));
}
break;
case AV_SAMPLE_FMT_S32P:
--
2.6.4
More information about the ffmpeg-devel
mailing list