From 3383a53e7d0abb9639c3ea3481f0eda9dca61a26 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 27 Nov 2011 14:04:16 +0000 Subject: 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 --- libavcodec/binkaudio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavcodec/binkaudio.c') diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 1dceeb74c3..adffc6b2b6 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -35,7 +35,7 @@ #include "dct.h" #include "rdft.h" #include "fmtconvert.h" -#include "libavutil/intfloat_readwrite.h" +#include "libavutil/intfloat.h" extern const uint16_t ff_wma_critical_freqs[25]; @@ -193,8 +193,8 @@ static int decode_block(BinkAudioContext *s, int16_t *out, int use_dct) if (s->version_b) { if (get_bits_left(gb) < 64) return AVERROR_INVALIDDATA; - coeffs[0] = av_int2flt(get_bits(gb, 32)) * s->root; - coeffs[1] = av_int2flt(get_bits(gb, 32)) * s->root; + coeffs[0] = av_int2float(get_bits_long(gb, 32)) * s->root; + coeffs[1] = av_int2float(get_bits_long(gb, 32)) * s->root; } else { if (get_bits_left(gb) < 58) return AVERROR_INVALIDDATA; -- cgit v1.2.3