use av_clip_int16() where it makes sense

Originally committed as revision 10078 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Aurelien Jacobs
2007-08-11 22:48:55 +00:00
parent 160ab30fcc
commit aee481cebe
14 changed files with 34 additions and 64 deletions

View File

@@ -279,7 +279,7 @@ int av_resample(AVResampleContext *c, short *dst, short *src, int *consumed, int
}
#ifdef CONFIG_RESAMPLE_AUDIOPHILE_KIDDY_MODE
dst[dst_index] = av_clip(lrintf(val), -32768, 32767);
dst[dst_index] = av_clip_int16(lrintf(val));
#else
val = (val + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;
dst[dst_index] = (unsigned)(val + 32768) > 65535 ? (val>>31) ^ 32767 : val;