forked from len0rd/rockbox
Use clz instruction to calculate integer logarithms, speeds up decoding of one flac 8 sample by 12%.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23783 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
07fe3562a1
commit
685ca2672e
2 changed files with 10 additions and 0 deletions
|
@ -1,7 +1,9 @@
|
|||
bitstream.c
|
||||
decoder.c
|
||||
shndec.c
|
||||
#if !(defined(CPU_ARM) && (ARM_ARCH > 4))
|
||||
tables.c
|
||||
#endif
|
||||
#if defined(CPU_COLDFIRE)
|
||||
coldfire.S
|
||||
#elif defined(CPU_ARM)
|
||||
|
|
|
@ -21,6 +21,13 @@
|
|||
|
||||
#include <limits.h>
|
||||
|
||||
#if (defined(CPU_ARM) && (ARM_ARCH > 4))
|
||||
static inline int av_log2(uint32_t v)
|
||||
{
|
||||
return 31 - __builtin_clz(v);
|
||||
}
|
||||
#else
|
||||
|
||||
/* From libavutil/common.h */
|
||||
extern const uint8_t ff_log2_tab[256];
|
||||
|
||||
|
@ -41,6 +48,7 @@ static inline int av_log2(unsigned int v)
|
|||
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file golomb.h
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue