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 --- libavformat/flvdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavformat/flvdec.c') diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 51a8126904..4fc5a4949e 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -26,7 +26,7 @@ #include "libavutil/avstring.h" #include "libavutil/dict.h" -#include "libavutil/intfloat_readwrite.h" +#include "libavutil/intfloat.h" #include "libavutil/mathematics.h" #include "libavcodec/bytestream.h" #include "libavcodec/mpeg4audio.h" @@ -189,7 +189,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream for (i = 0; i < arraylen && avio_tell(ioc) < max_pos - 1; i++) { if (avio_r8(ioc) != AMF_DATA_TYPE_NUMBER) goto finish; - num_val = av_int2dbl(avio_rb64(ioc)); + num_val = av_int2double(avio_rb64(ioc)); current_array[i] = num_val; } if (times && filepositions) { @@ -230,7 +230,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst switch(amf_type) { case AMF_DATA_TYPE_NUMBER: - num_val = av_int2dbl(avio_rb64(ioc)); break; + num_val = av_int2double(avio_rb64(ioc)); break; case AMF_DATA_TYPE_BOOL: num_val = avio_r8(ioc); break; case AMF_DATA_TYPE_STRING: -- cgit v1.2.3