diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-01-27 18:20:43 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-01-28 05:15:35 +0300 |
commit | 733dbe7d18c267728ef03762d83e9e1b086668cd (patch) | |
tree | 41345c1989e46631e4209c3b09206b0fd45bc54a /libavcodec/dsputil.c | |
parent | 2f7d8977bcdeb2c39fd9acbd753d605298824db8 (diff) |
Remove the add bias hack for the C version of DSPContext.float_to_int16_*().
(cherry picked from commit 9d06d7bce3babb82ed650c13ed13a57f6f626a71)
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 2ed0052977..03a5eeea45 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -3910,14 +3910,7 @@ static void vector_clipf_c(float *dst, const float *src, float min, float max, i } static av_always_inline int float_to_int16_one(const float *src){ - int_fast32_t tmp = *(const int32_t*)src; - if(tmp & 0xf0000){ - tmp = (0x43c0ffff - tmp)>>31; - // is this faster on some gcc/cpu combinations? -// if(tmp > 0x43c0ffff) tmp = 0xFFFF; -// else tmp = 0; - } - return tmp - 0x8000; + return av_clip_int16(lrintf(*src)); } void ff_float_to_int16_c(int16_t *dst, const float *src, long len){ |