changeset 2457:114415032922 libavformat

Simplify
author conrad
date Wed, 05 Sep 2007 00:23:41 +0000
parents bceeae973b13
children 7286ab3bf026
files matroskaenc.c
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/matroskaenc.c	Wed Sep 05 00:23:39 2007 +0000
+++ b/matroskaenc.c	Wed Sep 05 00:23:41 2007 +0000
@@ -76,13 +76,7 @@
 
 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