diff options
Diffstat (limited to 'libavutil/softfloat.h')
-rw-r--r-- | libavutil/softfloat.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index 392b6d8..70a9adf 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -36,6 +36,12 @@ typedef struct SoftFloat{ int32_t exp; }SoftFloat; +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)); +} + static av_const SoftFloat av_normalize_sf(SoftFloat a){ if(a.mant){ #if 1 |