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::DecompressMicrosoftADPCM Class Reference

Decompress Microsoft ADPCM format. More...

Inheritance diagram for Burger::DecompressMicrosoftADPCM:
Collaboration diagram for Burger::DecompressMicrosoftADPCM:

Public Member Functions

const Burger::StaticRTTIget_StaticRTTI (void) const noexcept override
 Get the description to the class.
 
 DecompressMicrosoftADPCM ()
 Default constructor.
 
eError Reset (void) override
 Resets the MAC6 decompresser to defaults.
 
eError Process (void *pOutput, uintptr_t uOutputChunkSize, const void *pInput, uintptr_t uInputChunkLength) override
 Decompress audio data using Microsoft ADPCM compression.
 
void SetBlockSize (uint_t uBlockSize)
 Set the block size for decompressing ADPCM data.
 
void SetSamplesPerBlock (uint_t uSamplesPerBlock)
 Set the number of samples in a block of ADPCM data.
 
void SetMonoDecoder (const void *pInput)
 Obtain the coefficients from the ADPCM stream.
 
void SetStereoDecoder (const void *pInput)
 Obtain the coefficients from the ADPCM stream.
 
uint_t ADPCMDecodeBlock (int16_t *pOutput, const uint8_t *pInput, uintptr_t uInputLength)
 Decode the a block of ADPCM samples.
 
- Public Member Functions inherited from Burger::DecompressAudio
SoundManager::eDataType GetDataType (void) const
 Returns the uncompressed data type this codec will output.
 
void SetMono (void)
 Alert the decompression codec to create a single audio channel.
 
void SetStereo (void)
 Alert the decompression codec to create stereo channels.
 
uint_t IsStereo (void) const
 Obtain the stereo/mono state of the decompresser.
 
- Public Member Functions inherited from Burger::Decompress
 Decompress (void)
 Default constructor.
 
uintptr_t GetTotalInputSize (void) const noexcept
 Get the total processed input data in bytes.
 
uintptr_t GetTotalOutputSize (void) const noexcept
 Get the total processed output data in bytes.
 
uintptr_t GetProcessedInputSize (void) const noexcept
 Get the total processed output data in bytes from the last process pass.
 
uintptr_t GetProcessedOutputSize (void) const noexcept
 Get the total processed output data in bytes from the last process pass.
 
uint32_t GetSignature (void) const noexcept
 Return the signature for this decompressor.
 
- Public Member Functions inherited from Burger::Base
const char * get_class_name (void) const noexcept
 Get the name of the class.
 
virtual ~Base () noexcept=default
 Destructor.
 

Static Public Member Functions

static DecompressMicrosoftADPCMNew (void)
 Allocate and initialize a DecompressMicrosoftADPCM.
 

Static Public Attributes

static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
static const uint32_t Signature = 0x4D50434D
 'MPCM'
 
- Static Public Attributes inherited from Burger::DecompressAudio
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::Decompress
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::Base
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 

Protected Types

enum  eState {
  STATE_INIT , STATE_INITMONO , STATE_GETDECODERMONO , STATE_WRITESAMPLESMONO ,
  STATE_WRITINGSAMPLESMONO , STATE_INITSTEREO , STATE_GETDECODERSTEREO , STATE_WRITESAMPLESSTEREO ,
  STATE_WRITINGSAMPLESSTEREO , STATE_FILLINGCACHE , STATE_CACHEFULL
}
 

Protected Attributes

ADPCMState_t m_Decoders [2]
 Decoders for left and right channels.
 
uint_t m_uCacheCount
 Number of valid bytes in m_Cache.
 
uint_t m_uCacheSize
 Maximum size of byte of m_Cache.
 
uint_t m_uBlockSize
 Size of each compressed block (wBlockAlign)
 
uint_t m_uSamplesPerBlock
 Number of samples to decompress per block (wSamplesPerBlock)
 
uint_t m_uSamplesRemaining
 Number of samples left to decompress from a block in progress.
 
eState m_eState
 State of the decompression.
 
eState m_eNextState
 Pending state of the decompression after a cache fill/flush is performed.
 
uint8_t m_Cache [32]
 Data cache.
 
- Protected Attributes inherited from Burger::DecompressAudio
SoundManager::eDataType m_eDataType
 Data type the decompresser will create.
 
uint_t m_bStereo
 TRUE if data is stereo
 
- Protected Attributes inherited from Burger::Decompress
uintptr_t m_uTotalInput
 Total number of bytes processed for input.
 
uintptr_t m_uTotalOutput
 Total number of bytes processed for output.
 
uintptr_t m_uInputLength
 Number of input bytes processed from the last call to Process()
 
uintptr_t m_uOutputLength
 Number of output bytes processed from the last call to Process()
 
uint32_t m_uSignature
 4 character code to identify this decompresser
 

Additional Inherited Members

- Protected Member Functions inherited from Burger::DecompressAudio
 DecompressAudio (SoundManager::eDataType uDataType)
 Constructor.
 

Detailed Description

Decompress Microsoft ADPCM format.


Decompress audio data in Microsoft ADPCM format

See also
Decompress and DecompressAudio

Member Enumeration Documentation

◆ eState

Enumerator
STATE_INIT 

Initial state.

STATE_INITMONO 

Start mono decoding.

STATE_GETDECODERMONO 

Process the mono decoder.

STATE_WRITESAMPLESMONO 

Set up to write out the samples from 4 bits to 16.

STATE_WRITINGSAMPLESMONO 

Write out the samples from 4 bits to 16.

STATE_INITSTEREO 

Start stereo decoding.

STATE_GETDECODERSTEREO 

Process the stereo decoder.

STATE_WRITESAMPLESSTEREO 

Set up to write out the samples from 4 bits to 16 in stereo.

STATE_WRITINGSAMPLESSTEREO 

Write out the samples from 4 bits to 16 in stereo.

STATE_FILLINGCACHE 

Input starved, waiting for more input.

STATE_CACHEFULL 

Output is pending, waiting for an output buffer.

Constructor & Destructor Documentation

◆ DecompressMicrosoftADPCM()

Burger::DecompressMicrosoftADPCM::DecompressMicrosoftADPCM ( )

Default constructor.


Initializes the defaults

Member Function Documentation

◆ ADPCMDecodeBlock()

uint_t BURGER_API Burger::DecompressMicrosoftADPCM::ADPCMDecodeBlock ( int16_t * pOutput,
const uint8_t * pInput,
uintptr_t uInputLength )

Decode the a block of ADPCM samples.


Function that will process a buffer of ADPCM samples and stores them into the output buffer.

Note
This function will only process a single block of ADPCM data, note the entire input buffer
Parameters
pOutputBuffer to get the decompressed sound data
pInputPointer to ADPCM data
uInputLengthNumber of bytes of ADPCM data
Returns
Number of bytes output

◆ get_StaticRTTI()

const Burger::StaticRTTI * Burger::DecompressMicrosoftADPCM::get_StaticRTTI ( void ) const
overridevirtualnoexcept

Get the description to the class.


This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.

Returns
Pointer to a global, read only instance of StaticRTTI for the true class

Reimplemented from Burger::DecompressAudio.

◆ New()

Burger::DecompressMicrosoftADPCM *BURGER_API Burger::DecompressMicrosoftADPCM::New ( void )
static

Allocate and initialize a DecompressMicrosoftADPCM.


Returns
A pointer to a default DecompressMicrosoftADPCM class or NULL if out of memory
See also
Delete(const T *)

◆ Process()

Burger::eError Burger::DecompressMicrosoftADPCM::Process ( void * pOutput,
uintptr_t uOutputChunkLength,
const void * pInput,
uintptr_t uInputChunkLength )
overridevirtual

Decompress audio data using Microsoft ADPCM compression.


Using the Microsoft version of ADPCM compression algorithm, decompress the audio data data

Parameters
pOutputPointer to the buffer to accept the decompressed data
uOutputChunkLengthNumber of bytes in the output buffer
pInputPointer to data to compress
uInputChunkLengthNumber of bytes in the data to decompress
Returns
Decompress::eError code with zero if no failure, non-zero is an error code
See also
DecompressAudio

Implements Burger::Decompress.

◆ Reset()

Burger::eError Burger::DecompressMicrosoftADPCM::Reset ( void )
overridevirtual

Resets the MAC6 decompresser to defaults.


Returns
kErrorNone if successful

Implements Burger::Decompress.

◆ SetBlockSize()

void Burger::DecompressMicrosoftADPCM::SetBlockSize ( uint_t uBlockSize)
inline

Set the block size for decompressing ADPCM data.


Parameters
uBlockSizeSize, in bytes, of each ADPCM block

◆ SetMonoDecoder()

void BURGER_API Burger::DecompressMicrosoftADPCM::SetMonoDecoder ( const void * pInput)

Obtain the coefficients from the ADPCM stream.


From a stream of 7 bytes, initialize the coefficient tables for mono ADPCM decoding

Parameters
pInputPointer to a stream of 7 bytes to extract the coefficients from

◆ SetSamplesPerBlock()

void Burger::DecompressMicrosoftADPCM::SetSamplesPerBlock ( uint_t uSamplesPerBlock)
inline

Set the number of samples in a block of ADPCM data.


When decompressing ADPCM data, it's necessary to have the samples per block value since this value is not stored in the data stream.

Parameters
uSamplesPerBlockNumber of audio samples in a block

◆ SetStereoDecoder()

void BURGER_API Burger::DecompressMicrosoftADPCM::SetStereoDecoder ( const void * pInput)

Obtain the coefficients from the ADPCM stream.


From a stream of 14 bytes, initialize the coefficient tables for stereo ADPCM decoding

Parameters
pInputPointer to a stream of 14 bytes to extract the coefficients from

Member Data Documentation

◆ g_StaticRTTI

const Burger::StaticRTTI Burger::DecompressMicrosoftADPCM::g_StaticRTTI
static

The global description of the class.


This record contains the name of this class and a reference to the parent

◆ m_Cache

uint8_t Burger::DecompressMicrosoftADPCM::m_Cache[32]
protected

Data cache.

◆ m_Decoders

ADPCMState_t Burger::DecompressMicrosoftADPCM::m_Decoders[2]
protected

Decoders for left and right channels.

◆ m_eNextState

eState Burger::DecompressMicrosoftADPCM::m_eNextState
protected

Pending state of the decompression after a cache fill/flush is performed.

◆ m_eState

eState Burger::DecompressMicrosoftADPCM::m_eState
protected

State of the decompression.

◆ m_uBlockSize

uint_t Burger::DecompressMicrosoftADPCM::m_uBlockSize
protected

Size of each compressed block (wBlockAlign)

◆ m_uCacheCount

uint_t Burger::DecompressMicrosoftADPCM::m_uCacheCount
protected

Number of valid bytes in m_Cache.

◆ m_uCacheSize

uint_t Burger::DecompressMicrosoftADPCM::m_uCacheSize
protected

Maximum size of byte of m_Cache.

◆ m_uSamplesPerBlock

uint_t Burger::DecompressMicrosoftADPCM::m_uSamplesPerBlock
protected

Number of samples to decompress per block (wSamplesPerBlock)

◆ m_uSamplesRemaining

uint_t Burger::DecompressMicrosoftADPCM::m_uSamplesRemaining
protected

Number of samples left to decompress from a block in progress.

◆ Signature

const uint32_t Burger::DecompressMicrosoftADPCM::Signature = 0x4D50434D
static

'MPCM'