#include <IMA_ADPCM.h>
Typically, IMA ADPCM data is stored as blocks of data with the PredictedValue and StepIndex values held in a header to each block. When decoding, these values should be writen to this class to initialise the decoding of a block. When encoding, these values should be writen out to a block's header prior to encoding the samples in the block.
Note, when IMA ADPCM data is stored in Microsoft WAV files, the PredictedValue found in the block's header is used as the first sample for that block. The first ADPCM value in the block's data then represents the second sample.
Definition at line 56 of file IMA_ADPCM.h.
Public Member Functions | |
| IMPORT void | EncodeInit (int16_t sample1, int16_t sample2) |
| IMPORT unsigned | Encode (int16_t pcm16) |
| IMPORT int | Decode (unsigned adpcm) |
| IMPORT unsigned | Encode (uint8_t *dst, int dstOffset, const int16_t *src, size_t srcSize) |
| IMPORT unsigned | Decode (int16_t *dst, const uint8_t *src, int srcOffset, unsigned srcSize) |
Public Attributes | |
| int16_t | PredictedValue |
| uint8_t | StepIndex |
|
||||||||||||
|
Initialise the PredictedValue and StepIndex members to the optimum values for encoding an audio stream whoes first two PCM samples have the values given. Use of this method at the start of audio stream encoding gives improved accuracy over a naive initialisation which sets PredictedValue and StepIndex to predetermined constant values.
Definition at line 59 of file IMA_ADPCM.cpp. |
|
|
Encode a single linear PCM sample as an ADPCM value.
Definition at line 74 of file IMA_ADPCM.cpp. |
|
|
Decode a single ADPCM value into a 16bit linear PCM value.
Definition at line 132 of file IMA_ADPCM.cpp. |
|
||||||||||||||||||||
|
Encode a buffer of 16 bit uniform PCM values into ADPCM values. Two ADPCM values are stored in each byte. The value stored in bits 0-3 corresponds to the sample preceding that stored in bits 4-7. Note, if the last encoded ADPCM value is stored in bits 0-3, then bits 4-7 will be cleared to zero.
Definition at line 167 of file IMA_ADPCM.cpp. |
|
||||||||||||||||||||
|
Decode a buffer of ADPCM values into 16 bit uniform PCM values. Two ADPCM values are stored in each byte. The value stored in bits 0-3 corresponds to the sample preceding that stored in bits 4-7.
Definition at line 204 of file IMA_ADPCM.cpp. |
|
|
The predicted value of the next sample. Typically, this value is read from the header, or written to the header, of a block of ADPCM values. Definition at line 152 of file IMA_ADPCM.h. |
|
|
The step index used for the next ADPCM value Typically, this value is read from the header, or written to the header, of a block of ADPCM values. Definition at line 159 of file IMA_ADPCM.h. |
1.4.4