Commit 7229576d authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

clean-up clz functions



The functions called clz8 and clz aren't used, remove them. clz16 is renamed
to pimp_clz16.
Signed-off-by: default avatarErik Faye-Lund <kusmabite@gmail.com>
parent c1eb209b
......@@ -94,7 +94,7 @@ unsigned pimp_get_amiga_delta(unsigned int period, unsigned int delta_scale)
{
int d1, d2;
unsigned int delta;
unsigned int shamt = clz16(period) - 1;
unsigned int shamt = pimp_clz16(period) - 1;
unsigned int p = period << shamt;
unsigned int p_frac = p & ((1 << AMIGA_DELTA_LUT_FRAC_BITS) - 1);
p >>= AMIGA_DELTA_LUT_FRAC_BITS;
......
......@@ -15,21 +15,7 @@ extern "C" {
extern const unsigned char pimp_clz_lut[256];
static INLINE unsigned clz(unsigned input)
{
/* two iterations of binary search */
unsigned c = 0;
if (input & 0xFFFF0000) input >>= 16;
else c = 16;
if (input & 0xFF00) input >>= 8;
else c += 8;
/* a 256 entries lut ain't too bad... */
return pimp_clz_lut[input] + c;
}
static INLINE unsigned clz16(unsigned input)
static INLINE unsigned pimp_clz16(unsigned input)
{
/* one iteration of binary search */
unsigned c = 0;
......@@ -41,12 +27,6 @@ static INLINE unsigned clz16(unsigned input)
return pimp_clz_lut[input] + c;
}
static INLINE unsigned clz8(unsigned input)
{
return pimp_clz_lut[input];
}
#ifndef NO_LINEAR_PERIODS
unsigned pimp_get_linear_delta(unsigned int period, unsigned int delta_scale);
unsigned pimp_get_linear_period(int note, int fine_tune);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment