summaryrefslogtreecommitdiff
path: root/libavutil/intfloat_readwrite.h
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-11-27 14:04:16 +0000
committerMans Rullgard <mans@mansr.com>2011-12-11 18:47:19 +0000
commit3383a53e7d0abb9639c3ea3481f0eda9dca61a26 (patch)
treed53f0c38d95d4256b727dc4f4c5add488aabe501 /libavutil/intfloat_readwrite.h
parent5b3265a7181889b53ff8217c1bdccdf966c86955 (diff)
lavu: replace int/float punning functions
The existing functions defined in intfloat_readwrite.[ch] are both slow and incorrect (infinities are not handled). This introduces a new header with fast, inline conversion functions using direct union punning assuming an IEEE-754 system, an assumption already made throughout the code. The one use of Intel/Motorola extended 80-bit format is replaced by simpler code sufficient under the present constraints (positive normal values). The old functions are marked deprecated and retained for compatibility. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavutil/intfloat_readwrite.h')
-rw-r--r--libavutil/intfloat_readwrite.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavutil/intfloat_readwrite.h b/libavutil/intfloat_readwrite.h
index 10ecbed76c..f093b92cd2 100644
--- a/libavutil/intfloat_readwrite.h
+++ b/libavutil/intfloat_readwrite.h
@@ -30,11 +30,11 @@ typedef struct AVExtFloat {
uint8_t mantissa[8];
} AVExtFloat;
-double av_int2dbl(int64_t v) av_const;
-float av_int2flt(int32_t v) av_const;
-double av_ext2dbl(const AVExtFloat ext) av_const;
-int64_t av_dbl2int(double d) av_const;
-int32_t av_flt2int(float d) av_const;
-AVExtFloat av_dbl2ext(double d) av_const;
+attribute_deprecated double av_int2dbl(int64_t v) av_const;
+attribute_deprecated float av_int2flt(int32_t v) av_const;
+attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
+attribute_deprecated int64_t av_dbl2int(double d) av_const;
+attribute_deprecated int32_t av_flt2int(float d) av_const;
+attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
#endif /* AVUTIL_INTFLOAT_READWRITE_H */