aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/ffmdec.c
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 /libavformat/ffmdec.c
parent5b3265a7181889b53ff8217c1bdccdf966c86955 (diff)
downloadffmpeg-3383a53e7d0abb9639c3ea3481f0eda9dca61a26.tar.gz
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 'libavformat/ffmdec.c')
-rw-r--r--libavformat/ffmdec.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 114576707e..9cee3ad64f 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "ffm.h"
@@ -325,10 +325,10 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->rc_max_rate = avio_rb32(pb);
codec->rc_min_rate = avio_rb32(pb);
codec->rc_buffer_size = avio_rb32(pb);
- codec->i_quant_factor = av_int2dbl(avio_rb64(pb));
- codec->b_quant_factor = av_int2dbl(avio_rb64(pb));
- codec->i_quant_offset = av_int2dbl(avio_rb64(pb));
- codec->b_quant_offset = av_int2dbl(avio_rb64(pb));
+ codec->i_quant_factor = av_int2double(avio_rb64(pb));
+ codec->b_quant_factor = av_int2double(avio_rb64(pb));
+ codec->i_quant_offset = av_int2double(avio_rb64(pb));
+ codec->b_quant_offset = av_int2double(avio_rb64(pb));
codec->dct_algo = avio_rb32(pb);
codec->strict_std_compliance = avio_rb32(pb);
codec->max_b_frames = avio_rb32(pb);
@@ -340,7 +340,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->mb_decision = avio_rb32(pb);
codec->nsse_weight = avio_rb32(pb);
codec->frame_skip_cmp = avio_rb32(pb);
- codec->rc_buffer_aggressivity = av_int2dbl(avio_rb64(pb));
+ codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb));
codec->codec_tag = avio_rb32(pb);
codec->thread_count = avio_r8(pb);
codec->coder_type = avio_rb32(pb);
@@ -350,8 +350,8 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->keyint_min = avio_rb32(pb);
codec->scenechange_threshold = avio_rb32(pb);
codec->b_frame_strategy = avio_rb32(pb);
- codec->qcompress = av_int2dbl(avio_rb64(pb));
- codec->qblur = av_int2dbl(avio_rb64(pb));
+ codec->qcompress = av_int2double(avio_rb64(pb));
+ codec->qblur = av_int2double(avio_rb64(pb));
codec->max_qdiff = avio_rb32(pb);
codec->refs = avio_rb32(pb);
break;