axvpb.pb.adpcm

C Specification

typedef struct _AXPBADPCM
{

u16 a[8][2];        // coef table a1[0],a2[0],a1[1],a2[1]....
u16 gain;           // gain to be applied (0 for ADPCM, 0x0800 for PCM8/16)
u16 pred_scale;     // predictor / scale combination (nibbles, as in hardware)
u16 yn1;            // y[n - 1]
u16 yn2;            // y[n - 2]

} AXPBADPCM;

Description

The ADPCM values specify the coefficients and processing context for playback of ADPCM-encoded samples.

The decoding coefficients must be stored in the coefficient table a[][]. The initial-state values for the predictor, scale, and histories must be stored in pred_scale, yn1, and yn2. These values are provided by the Nintendo Revolution DSP-ADPCM encoding tool. See "DSPADPCM" in the Nintendo Revolution Audio Programmer's Guide for more details.

Values to be stored in a[][] are stored as coef[] in the header of the output data from DSPADPCM. Here's how a[][] corresponds to coef[]:


a[0][0] = coef[0];
a[0][1] = coef[1];
a[1][0] = coef[2];
a[1][1] = coef[3];
a[2][0] = coef[4];
a[2][1] = coef[5];
a[3][0] = coef[6];
a[3][1] = coef[7];
a[4][0] = coef[8];
a[4][1] = coef[9];
a[5][0] = coef[10];
a[5][1] = coef[11];
a[6][0] = coef[12];
a[6][1] = coef[13];
a[7][0] = coef[14];
a[7][1] = coef[15];

The gain must be set to 0x0800 and all other parameters set to zero, for 16-bit PCM samples. The gain must be set to 0x0100 for 8-bit PCM. Once these parameters have been initialized, they must not be modified for the remainder of the voice's lifetime. This applies to all sample types.

Assert the AX_SYNC_USER_ADPCM bit to the axvpb.sync member to change these values.

See Also

axvpb.sync
AXSetVoiceAdpcm

Revision History

03/01/2006 Initial version.