Mercurial > libavformat.hg
changeset 823:e8b4454b997d libavformat
remove non portable get/put_be64_double()
author | michael |
---|---|
date | Tue, 19 Jul 2005 14:50:22 +0000 |
parents | 2614d3c1f415 |
children | 779b1e87b865 |
files | avio.h aviobuf.c ffm.c |
diffstat | 3 files changed, 10 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/avio.h Tue Jul 19 14:41:08 2005 +0000 +++ b/avio.h Tue Jul 19 14:50:22 2005 +0000 @@ -104,7 +104,6 @@ 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 @@ 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);
--- a/aviobuf.c Tue Jul 19 14:41:08 2005 +0000 +++ b/aviobuf.c Tue Jul 19 14:50:22 2005 +0000 @@ -210,17 +210,6 @@ 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 @@ 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;
--- a/ffm.c Tue Jul 19 14:41:08 2005 +0000 +++ b/ffm.c Tue Jul 19 14:50:22 2005 +0000 @@ -182,10 +182,10 @@ 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 @@ 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 @@ 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 @@ 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);