]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Simplify
authorconrad <conrad@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 5 Sep 2007 00:23:41 +0000 (00:23 +0000)
committerconrad <conrad@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 5 Sep 2007 00:23:41 +0000 (00:23 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10326 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/matroskaenc.c

index 38ee9d6f9079da366159f75bcaf250e24c4d819e..80c89b4c77da37641ef107e76f71abcf13ef186c 100644 (file)
@@ -76,13 +76,7 @@ static void put_ebml_id(ByteIOContext *pb, unsigned int id)
 
 static int ebml_id_size(unsigned int id)
 {
-    if (id >= 0x3fffff)
-        return 4;
-    if (id >= 0x7fff)
-        return 3;
-    if (id >= 0xff)
-        return 2;
-    return 1;
+    return (av_log2(id+1)-1)/7+1;
 }
 
 // XXX: test this thoroughly and get rid of minbytes hack (currently needed to