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
|
bitstream.c
|
||||||
decoder.c
|
decoder.c
|
||||||
shndec.c
|
shndec.c
|
||||||
|
#if !(defined(CPU_ARM) && (ARM_ARCH > 4))
|
||||||
tables.c
|
tables.c
|
||||||
|
#endif
|
||||||
#if defined(CPU_COLDFIRE)
|
#if defined(CPU_COLDFIRE)
|
||||||
coldfire.S
|
coldfire.S
|
||||||
#elif defined(CPU_ARM)
|
#elif defined(CPU_ARM)
|
||||||
|
|
|
@ -21,6 +21,13 @@
|
||||||
|
|
||||||
#include <limits.h>
|
#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 */
|
/* From libavutil/common.h */
|
||||||
extern const uint8_t ff_log2_tab[256];
|
extern const uint8_t ff_log2_tab[256];
|
||||||
|
|
||||||
|
@ -41,6 +48,7 @@ static inline int av_log2(unsigned int v)
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file golomb.h
|
* @file golomb.h
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue