diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-02 03:56:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-02 22:55:44 +0200 |
commit | 79aa2ff1991593148b4e5eba0ff05f7a2f2f849e (patch) | |
tree | ef2cfc896f34ff9570864314f01f623e6a8512d6 /libavutil/softfloat.h | |
parent | c4be288fdbe1993110f1abd28ea57587cb2bc221 (diff) | |
download | ffmpeg-79aa2ff1991593148b4e5eba0ff05f7a2f2f849e.tar.gz |
avutil/softfloat: use ldexp(), fixes undefined shift
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/softfloat.h')
-rw-r--r-- | libavutil/softfloat.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index fa91d1e1cb..e6d30ad333 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -50,8 +50,7 @@ static const SoftFloat FLOAT_0999999 = { 0x3FFFFBCE, 0}; */ static inline av_const double av_sf2double(SoftFloat v) { v.exp -= ONE_BITS +1; - if(v.exp > 0) return (double)v.mant * (double)(1 << v.exp); - else return (double)v.mant / (double)(1 << (-v.exp)); + return ldexp(v.mant, v.exp); } static av_const SoftFloat av_normalize_sf(SoftFloat a){ |