Commit 43482bd1 authored by James Almer's avatar James Almer Committed by Michael Niedermayer

swr/resample: use av_clip functions

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent be920e48
......@@ -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)
#elif defined(TEMPLATE_RESAMPLE_S16)
......@@ -66,7 +66,7 @@
# define FELEM_MAX INT16_MAX
# define FELEM_MIN INT16_MIN
# define OUT(d, v) (v) = ((v) + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;\
(d) = (unsigned)((v) + 32768) > 65535 ? ((v)>>31) ^ 32767 : (v)
(d) = av_clip_int16(v)
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment