summaryrefslogtreecommitdiffstats
path: root/libavutil/softfloat.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-02 03:56:13 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-02 22:55:44 +0200
commit79aa2ff1991593148b4e5eba0ff05f7a2f2f849e (patch)
treeef2cfc896f34ff9570864314f01f623e6a8512d6 /libavutil/softfloat.h
parentc4be288fdbe1993110f1abd28ea57587cb2bc221 (diff)
downloadffmpeg-streaming-79aa2ff1991593148b4e5eba0ff05f7a2f2f849e.zip
ffmpeg-streaming-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.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index fa91d1e..e6d30ad 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){
OpenPOWER on IntegriCloud