diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-07-19 14:50:22 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-07-19 14:50:22 +0000 |
commit | 7cb8f314db095715698329fafae5eadeb5504610 (patch) | |
tree | 25901c70ba2e574205d22a54eab5a39ec290147d /libavformat | |
parent | a254c5745b27eec28430402f49937d9505691f20 (diff) | |
download | ffmpeg-7cb8f314db095715698329fafae5eadeb5504610.tar.gz |
remove non portable get/put_be64_double()
Originally committed as revision 4461 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avio.h | 2 | ||||
-rw-r--r-- | libavformat/aviobuf.c | 22 | ||||
-rw-r--r-- | libavformat/ffm.c | 20 |
3 files changed, 10 insertions, 34 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h index b8ef9db5eb..51ef472244 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -104,7 +104,6 @@ void put_le16(ByteIOContext *s, unsigned int val); void put_be16(ByteIOContext *s, unsigned int val); void put_tag(ByteIOContext *s, const char *tag); -void put_be64_double(ByteIOContext *s, double val); void put_strz(ByteIOContext *s, const char *buf); offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence); @@ -132,7 +131,6 @@ unsigned int get_le32(ByteIOContext *s); uint64_t get_le64(ByteIOContext *s); unsigned int get_le16(ByteIOContext *s); -double get_be64_double(ByteIOContext *s); char *get_strz(ByteIOContext *s, char *buf, int maxlen); unsigned int get_be16(ByteIOContext *s); unsigned int get_be24(ByteIOContext *s); diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 17a5bdf521..f6f65c1e13 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -210,17 +210,6 @@ void put_be32(ByteIOContext *s, unsigned int val) put_byte(s, val); } -/* IEEE format is assumed */ -void put_be64_double(ByteIOContext *s, double val) -{ - union { - double d; - uint64_t ull; - } u; - u.d = val; - put_be64(s, u.ull); -} - void put_strz(ByteIOContext *s, const char *str) { if (str) @@ -449,17 +438,6 @@ unsigned int get_be32(ByteIOContext *s) return val; } -double get_be64_double(ByteIOContext *s) -{ - union { - double d; - uint64_t ull; - } u; - - u.ull = get_be64(s); - return u.d; -} - char *get_strz(ByteIOContext *s, char *buf, int maxlen) { int i = 0; diff --git a/libavformat/ffm.c b/libavformat/ffm.c index 55a4f63417..99e7e89b4e 100644 --- a/libavformat/ffm.c +++ b/libavformat/ffm.c @@ -182,10 +182,10 @@ static int ffm_write_header(AVFormatContext *s) put_be32(pb, codec->rc_max_rate); put_be32(pb, codec->rc_min_rate); put_be32(pb, codec->rc_buffer_size); - put_be64_double(pb, codec->i_quant_factor); - put_be64_double(pb, codec->b_quant_factor); - put_be64_double(pb, codec->i_quant_offset); - put_be64_double(pb, codec->b_quant_offset); + put_be64(pb, av_dbl2int(codec->i_quant_factor)); + put_be64(pb, av_dbl2int(codec->b_quant_factor)); + put_be64(pb, av_dbl2int(codec->i_quant_offset)); + put_be64(pb, av_dbl2int(codec->b_quant_offset)); put_be32(pb, codec->dct_algo); put_be32(pb, codec->strict_std_compliance); put_be32(pb, codec->max_b_frames); @@ -197,7 +197,7 @@ static int ffm_write_header(AVFormatContext *s) put_be32(pb, codec->mb_decision); put_be32(pb, codec->nsse_weight); put_be32(pb, codec->frame_skip_cmp); - put_be64_double(pb, codec->rc_buffer_aggressivity); + put_be64(pb, av_dbl2int(codec->rc_buffer_aggressivity)); break; case CODEC_TYPE_AUDIO: put_be32(pb, codec->sample_rate); @@ -513,10 +513,10 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) codec->rc_max_rate = get_be32(pb); codec->rc_min_rate = get_be32(pb); codec->rc_buffer_size = get_be32(pb); - codec->i_quant_factor = get_be64_double(pb); - codec->b_quant_factor = get_be64_double(pb); - codec->i_quant_offset = get_be64_double(pb); - codec->b_quant_offset = get_be64_double(pb); + codec->i_quant_factor = av_int2dbl(get_be64(pb)); + codec->b_quant_factor = av_int2dbl(get_be64(pb)); + codec->i_quant_offset = av_int2dbl(get_be64(pb)); + codec->b_quant_offset = av_int2dbl(get_be64(pb)); codec->dct_algo = get_be32(pb); codec->strict_std_compliance = get_be32(pb); codec->max_b_frames = get_be32(pb); @@ -528,7 +528,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) codec->mb_decision = get_be32(pb); codec->nsse_weight = get_be32(pb); codec->frame_skip_cmp = get_be32(pb); - codec->rc_buffer_aggressivity = get_be64_double(pb); + codec->rc_buffer_aggressivity = av_int2dbl(get_be64(pb)); break; case CODEC_TYPE_AUDIO: codec->sample_rate = get_be32(pb); |