Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::MACEState_t Struct Reference

State of MACE compression/decompression. More...

Public Member Functions

void Clear (void)
 Reset the state.
 
int32_t CoefficientStep (uint_t uTableOffset, uint_t bUse3Bits)
 Perform a decompression step.
 

Public Attributes

int32_t m_iSample1
 Last running samples.
 
int32_t m_iSample2
 Second temp sample.
 
int32_t m_iLastStep
 Mask with 0x8000 for + or - direction.
 
int32_t m_iTableIndex
 Index to the slope table.
 
int32_t m_iLastAmplitude
 m_iLastSlope * m_iLastStep
 
int32_t m_iLastSlope
 Last Slope value.
 

Static Public Attributes

static const int16_t g_Table4Small [4]
 Base coefficients for 2 bit samples.
 
static const int16_t g_Table4Big [512]
 Log table for 2 bit samples.
 
static const int16_t g_Table8Small [8]
 Base coefficients for 3 bit samples.
 
static const int16_t g_Table8Big [1024]
 Log table for 3 bit samples.
 

Detailed Description

State of MACE compression/decompression.


To initialize this structure, fill all members with zero

Member Function Documentation

◆ Clear()

void BURGER_API Burger::MACEState_t::Clear ( void )

Reset the state.


Clear out the MACEState_t structure

◆ CoefficientStep()

int32_t BURGER_API Burger::MACEState_t::CoefficientStep ( uint_t uTableOffset,
uint_t bUse3Bits )

Perform a decompression step.


Given a 2 or 3 bit number from the MACE compressed stream, look up in the coefficient tables that currently active slope and determine the value of the next audio sample.

Note
This routine uses some magic numbers. It took a while to glean the the magic numbers. Braver men have tried to understand this routine and failed.
Parameters
uTableOffsetCoefficient index into the slope tables
bUse3BitsTRUE if the offset is 3 bits or FALSE if it's 2 bits wide

Member Data Documentation

◆ g_Table4Big

const int16_t Burger::MACEState_t::g_Table4Big
static

Log table for 2 bit samples.

◆ g_Table4Small

const int16_t Burger::MACEState_t::g_Table4Small
static
Initial value:
= {
- 18, 140, 140,- 18
}

Base coefficients for 2 bit samples.

◆ g_Table8Big

const int16_t Burger::MACEState_t::g_Table8Big
static

Log table for 3 bit samples.

◆ g_Table8Small

const int16_t Burger::MACEState_t::g_Table8Small
static
Initial value:
= {
- 13, 8, 76, 222, 222, 76, 8,- 13
}

Base coefficients for 3 bit samples.

◆ m_iLastAmplitude

int32_t Burger::MACEState_t::m_iLastAmplitude

m_iLastSlope * m_iLastStep

◆ m_iLastSlope

int32_t Burger::MACEState_t::m_iLastSlope

Last Slope value.

◆ m_iLastStep

int32_t Burger::MACEState_t::m_iLastStep

Mask with 0x8000 for + or - direction.

◆ m_iSample1

int32_t Burger::MACEState_t::m_iSample1

Last running samples.

◆ m_iSample2

int32_t Burger::MACEState_t::m_iSample2

Second temp sample.

◆ m_iTableIndex

int32_t Burger::MACEState_t::m_iTableIndex

Index to the slope table.