[FFmpeg-cvslog] avutil/softfloat: use ldexp(), fixes undefined shift

Michael Niedermayer git at videolan.org
Wed May 3 00:15:42 EEST 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue May  2 03:56:13 2017 +0200| [79aa2ff1991593148b4e5eba0ff05f7a2f2f849e] | committer: Michael Niedermayer

avutil/softfloat: use ldexp(), fixes undefined shift

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79aa2ff1991593148b4e5eba0ff05f7a2f2f849e
---

 libavutil/softfloat.h | 3 +--
 1 file changed, 1 insertion(+), 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){



More information about the ffmpeg-cvslog mailing list