[FFmpeg-cvslog] r9735 - trunk/libavcodec/alac.c

vitor subversion
Wed Jul 18 16:15:14 CEST 2007


Author: vitor
Date: Wed Jul 18 16:15:14 2007
New Revision: 9735

Log:
Remove reimplementation of av_log2

Modified:
   trunk/libavcodec/alac.c

Modified: trunk/libavcodec/alac.c
==============================================================================
--- trunk/libavcodec/alac.c	(original)
+++ trunk/libavcodec/alac.c	Wed Jul 18 16:15:14 2007
@@ -139,17 +139,9 @@ static int alac_set_info(ALACContext *al
     return 0;
 }
 
-/* hideously inefficient. could use a bitmask search,
- * alternatively bsr on x86,
- */
-static int count_leading_zeros(int32_t input)
+static inline int count_leading_zeros(int32_t input)
 {
-    int i = 0;
-    while (!(0x80000000 & input) && i < 32) {
-        i++;
-        input = input << 1;
-    }
-    return i;
+    return 31-av_log2(input);
 }
 
 static void bastardized_rice_decompress(ALACContext *alac,




More information about the ffmpeg-cvslog mailing list