summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2007-07-18 14:15:14 +0000
committerVitor Sessak <vitor1001@gmail.com>2007-07-18 14:15:14 +0000
commitd0da8020499151144b2b4c4952a6367f4e68d77c (patch)
tree4806542d3f07a8f319a4007fb0050e6328a0cda2 /libavcodec
parentef0d7a0d4fd4e45a58e164c365a2b31c4719bc3b (diff)
Remove reimplementation of av_log2
Originally committed as revision 9735 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/alac.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 3883f418f4..5655ea3c6f 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -139,17 +139,9 @@ static int alac_set_info(ALACContext *alac)
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,