[Ffmpeg-cvslog] CVS: ffmpeg/libavformat avio.h, 1.21, 1.22 aviobuf.c, 1.29, 1.30 ffm.c, 1.43, 1.44

Michael Niedermayer CVS michael
Tue Jul 19 16:50:25 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv28554

Modified Files:
	avio.h aviobuf.c ffm.c 
Log Message:
remove non portable get/put_be64_double()


Index: avio.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/avio.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- avio.h	19 Jul 2005 14:41:08 -0000	1.21
+++ avio.h	19 Jul 2005 14:50:22 -0000	1.22
@@ -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);

Index: aviobuf.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/aviobuf.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- aviobuf.c	19 Jul 2005 14:41:08 -0000	1.29
+++ aviobuf.c	19 Jul 2005 14:50:22 -0000	1.30
@@ -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;

Index: ffm.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/ffm.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- ffm.c	17 Jul 2005 22:24:35 -0000	1.43
+++ ffm.c	19 Jul 2005 14:50:22 -0000	1.44
@@ -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);





More information about the ffmpeg-cvslog mailing list