summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-12-05 21:32:23 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-12-05 21:32:23 +0000
commit2aeb6c781dd48df39e1cb029e9be33b05347b9d2 (patch)
treed7d8b728a8403de436bbf3c7366798a391673a4e /apps/codecs
parent18c56ef386de6a705ab375dee59dbfda15ae1ce2 (diff)
Slightly improve av_log2 in codeclib on ARMv6.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23866 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/lib/codeclib.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h
index bf7b41775a..a5ecb73027 100644
--- a/apps/codecs/lib/codeclib.h
+++ b/apps/codecs/lib/codeclib.h
@@ -79,8 +79,7 @@ unsigned udiv32_arm(unsigned a, unsigned b);
#if (defined(CPU_ARM) && (ARM_ARCH > 4))
static inline unsigned int av_log2(uint32_t v)
{
- unsigned int lz = __builtin_clz(v);
- return 31 - lz + (lz >> 5); /* make sure av_log2(0) returns 0 */
+ return v ? 31 - __builtin_clz(v) : v;
}
#else
/* From libavutil/common.h */