# HG changeset patch # User vitor # Date 1184768114 0 # Node ID 50454f3b0e88c44589183815cb830f855d2637f8 # Parent 1a25f2f6316e8cec2a7fb85f2ac9afa4c46a3655 Remove reimplementation of av_log2 diff -r 1a25f2f6316e -r 50454f3b0e88 alac.c --- a/alac.c Wed Jul 18 08:11:16 2007 +0000 +++ b/alac.c Wed Jul 18 14:15:14 2007 +0000 @@ -139,17 +139,9 @@ 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,