diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2015-02-20 01:35:35 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-02-21 00:54:40 +0100 |
commit | 9abc80f1ed673141326341e26a05c3e1f78576d0 (patch) | |
tree | ca91fca7b76eec0d98a2b420f0220ec0df13a239 /libavcodec/opus_silk.c | |
parent | 76ce9bd8e26dcb3652240a1072840ff4011d7cdc (diff) | |
download | ffmpeg-9abc80f1ed673141326341e26a05c3e1f78576d0.tar.gz |
libavcodec: Make use of av_clip functions
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/opus_silk.c')
-rw-r--r-- | libavcodec/opus_silk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c index 3552484542..f881325d7b 100644 --- a/libavcodec/opus_silk.c +++ b/libavcodec/opus_silk.c @@ -1077,7 +1077,7 @@ static inline void silk_decode_lpc(SilkContext *s, SilkFrame *frame, weight = y + ((213 * fpart * y) >> 16); value = cur * 128 + (lsf_res[i] * 16384) / weight; - nlsf[i] = av_clip(value, 0, 32767); + nlsf[i] = av_clip_uintp2(value, 15); } /* stabilize the NLSF coefficients */ @@ -1288,8 +1288,8 @@ static void silk_decode_frame(SilkContext *s, OpusRangeCoder *rc, } else { /* gain is coded relative */ int delta_gain = opus_rc_getsymbol(rc, silk_model_gain_delta); - log_gain = av_clip(FFMAX((delta_gain<<1) - 16, - frame->log_gain + delta_gain - 4), 0, 63); + log_gain = av_clip_uintp2(FFMAX((delta_gain<<1) - 16, + frame->log_gain + delta_gain - 4), 6); } frame->log_gain = log_gain; |