search for: byte_to_unary_table

Displaying 10 results from an estimated 10 matches for "byte_to_unary_table".

2014 Oct 11
1
bitmath.h static array
There is a function FLAC__clz_soft_uint32 in bitmath.h: static inline unsigned int FLAC__clz_soft_uint32(unsigned int word) { static const unsigned char byte_to_unary_table[] = { 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, .................................... 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return (word) > 0xffffff ? byte_to_unary_table[(word) >> 24] : (word) > 0xffff ? byte_to_unary_table[(word) >&g...
2012 May 09
1
[PATCH 2/2] bitmath: Finish up optimizations
...clz (unsigned int x) If x is 0, the result is undefined" */ -static inline uint32_t -COUNT_ZERO_MSBS (uint32_t word) -{ - if (word == 0) - return 32; - return __builtin_clz (word); -} -#else -/* counts the # of zero MSBs in a word */ -#define COUNT_ZERO_MSBS(word) ( \ - (word) > 0xffffff ? byte_to_unary_table[(word) >> 24] : \ - !(word) ? 32 : \ - (word) > 0xffff ? byte_to_unary_table[(word) >> 16] + 8 : \ - (word) > 0xff ? byte_to_unary_table[(word) >> 8] + 16 : \ - byte_to_unary_table[(word)] + 24 \ -) -#endif - - /* * This should be at least twice as large as the largest nu...
2004 Sep 10
4
bitbuffer optimizations
...-- src/libFLAC/bitbuffer.c.orig 2003-01-30 17:36:01.000000000 +0100 +++ src/libFLAC/bitbuffer.c 2003-01-30 21:53:18.000000000 +0100 @@ -51,6 +51,25 @@ */ static const unsigned FLAC__BITBUFFER_DEFAULT_CAPACITY = ((65536 - 64) * 8) / FLAC__BITS_PER_BLURB; /* blurbs */ +static const unsigned char byte_to_unary_table[] = { + 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
2005 Jan 01
2
libFLAC bitbuffer optimizations
...e archives: --- orig/src/libFLAC/bitbuffer.c +++ mod/src/libFLAC/bitbuffer.c @@ -62,6 +62,24 @@ * keeping in mind the limit from the first paragraph. */ static const unsigned FLAC__BITBUFFER_DEFAULT_CAPACITY = ((65536 - 64) * 8) / FLAC__BITS_PER_BLURB; /* blurbs */ +static const unsigned char byte_to_unary_table[] = { + 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1,...
2008 Mar 14
2
bitreader optimizations
...5 diff -u -r1.15 bitreader.c --- src/libFLAC/bitreader.c 28 Feb 2008 05:34:26 -0000 1.15 +++ src/libFLAC/bitreader.c 14 Mar 2008 11:07:07 -0000 @@ -69,13 +69,12 @@ #endif /* counts the # of zero MSBs in a word */ #define COUNT_ZERO_MSBS(word) ( \ - (word) <= 0xffff ? \ - ( (word) <= 0xff? byte_to_unary_table[word] + 24 : byte_to_unary_table[(word) >> 8] + 16 ) : \ - ( (word) <= 0xffffff? byte_to_unary_table[word >> 16] + 8 : byte_to_unary_table[(word) >> 24] ) \ + word > 0xffffff ? byte_to_unary_table[(word) >> 24] : \ + !word ? 32 : \ + word > 0xffff ? byte_to_unary_t...
2004 Dec 28
2
libFLAC bitbuffer optimizations
Pulled from my Arch archive, this following patch seems to have made quite a difference in getting my ARM7TDMI chip to play FLAC (compression levels 0-2) on my ipod. I don't have benchmarks with hard numbers, but playing with skips vs playing without skips is a fairly noticeable difference. memcpy and memset on uClibc are optimized in asm for the ARM7TDMI in uClibc. Other hardware/libc
2012 Aug 28
3
[PATCH 1/3] Make FLAC__clz_soft_uint32 static.
...h +++ b/src/libFLAC/include/private/bitmath.h @@ -42,7 +42,7 @@ #endif /* Will never be emitted for MSVC, GCC, Intel compilers */ -inline unsigned int FLAC__clz_soft_uint32(unsigned int word) +static inline unsigned int FLAC__clz_soft_uint32(unsigned int word) { static const unsigned char byte_to_unary_table[] = { 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, -- 1.7.7.6
2012 Jun 24
3
Patch for cross compilation with MinGW32
...8 100644 --- src/libFLAC/include/private/bitmath.h +++ src/libFLAC/include/private/bitmath.h @@ -42,6 +42,7 @@ #endif /* Will never be emitted for MSVC, GCC, Intel compilers */ +#ifndef __MINGW32__ inline unsigned int FLAC__clz_soft_uint32(unsigned int word) { static const unsigned char byte_to_unary_table[] = { @@ -69,6 +70,7 @@ inline unsigned int FLAC__clz_soft_uint32(unsigned int word) (word) > 0xff ? byte_to_unary_table[(word) >> 8] + 16 : byte_to_unary_table[(word)] + 24; } +#endif static inline unsigned int FLAC__clz_uint32(FLAC__uint32 v) { diff --git src/share/grabbag...
2012 Apr 05
2
[PATCH 2/2] V2: Use a single definition of MIN and MAX in sources
...@@ -38,6 +38,7 @@ #include "private/bitmath.h" #include "private/bitreader.h" #include "private/crc.h" +#include "private/macros.h" #include "FLAC/assert.h" #include "share/endswap.h" @@ -109,15 +110,6 @@ static const unsigned char byte_to_unary_table[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -#ifdef min -#undef min -#endif -#define min(x,y) ((x)<(y)?(x):(y)) -#ifdef max -#undef max -#endif -#define max(x,y) ((x)>(y)?(x):(y)) - /* adjust for compilers that can't understand using LLU suffix for uint64_t literals */...
2012 Apr 07
1
[PATCH 2/2] Update and improve autotools build
...0:2 $(LOCAL_EXTRA_LDFLAGS) @LT_NO_UNDEFINED@ libFLAC_la_SOURCES = \ bitmath.c \ bitreader.c \ diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c index 7e17fd8..ae515a0 100644 --- a/src/libFLAC/bitreader.c +++ b/src/libFLAC/bitreader.c @@ -117,10 +117,6 @@ static const unsigned char byte_to_unary_table[] = { #define FLAC__U64L(x) x##LLU #endif -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - /* WATCHOUT: assembly routines rely on the order in which these fields are declared */ struct FLAC__BitReader { /* any partially-consumed word at the head will stay right-justified as bits are co...