Commit 79aa2ff1 authored by Michael Niedermayer's avatar Michael Niedermayer

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

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c4be288f
......@@ -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){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment