forked from len0rd/rockbox
Slightly improve av_log2 in codeclib on ARMv6.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23866 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
18c56ef386
commit
2aeb6c781d
1 changed files with 1 additions and 2 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue