1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 6<title>axvpb.pb.adpcm</title> 7<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 8<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows"> 9<META http-equiv="Content-Style-Type" content="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">axvpb.pb.adpcm</h1> 15 16 17<h2>C Specification</h2> 18<BLOCKQUOTE> 19<pre><CODE>typedef struct _AXPBADPCM 20{ 21 22 u16 a[8][2]; // coef table a1[0],a2[0],a1[1],a2[1].... 23 u16 gain; // Gain to apply (ADPCM: 0 PCM8: 0x0800 PCM16: 0x0100) 24 u16 pred_scale; // predictor / scale combination (nibbles, as in hardware) 25 u16 yn1; // y[n - 1] 26 u16 yn2; // y[n - 2] 27 28} AXPBADPCM;</CODE></pre> 29</BLOCKQUOTE> 30<h2>Description</h2> 31 32<p>The <CODE>ADPCM</CODE> values specify the coefficients and processing context for playback of ADPCM-encoded samples.</p> 33 34<p>The decoding coefficients must be stored in the coefficient table <code>a[][]</code>. The initial-state values for the predictor, scale, and histories must be stored in <code>pred_scale</code>, <code>yn1</code>, and <code>yn2</code>. These values are provided by the GameCube's DSP ADPCM encoding tool. See "DSPADPCM" in the <em>Nintendo Revolution Audio Programmer's Guide</em> for more details.</p> 35<p>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[]:</p> 36<BLOCKQUOTE> 37<pre><CODE> 38a[0][0] = coef[0]; 39a[0][1] = coef[1]; 40a[1][0] = coef[2]; 41a[1][1] = coef[3]; 42a[2][0] = coef[4]; 43a[2][1] = coef[5]; 44a[3][0] = coef[6]; 45a[3][1] = coef[7]; 46a[4][0] = coef[8]; 47a[4][1] = coef[9]; 48a[5][0] = coef[10]; 49a[5][1] = coef[11]; 50a[6][0] = coef[12]; 51a[6][1] = coef[13]; 52a[7][0] = coef[14]; 53a[7][1] = coef[15]; 54</CODE></pre> 55</BLOCKQUOTE> 56<p>The gain must be set to <code>0x0800</code> and all other parameters set to zero, for 16-bit PCM samples. The gain must be set to <code>0x0100</code> for 8-bit PCM. Once these parameters have been initialized, they must <i><b>not</b></i> be modified for the remainder of the voice's lifetime. This applies to all sample types.</p> 57 58<p>Assert the <code>AX_SYNC_USER_ADPCM</code> bit to <code>the axvpb.sync</code> member to change these values.</p> 59 60<h2>See Also</h2> 61<p> 62<code><a href="../Voice_Parameter_Blocks/sync.html">axvpb.sync</a><br> <a href="../Voice_Parameters/AXSetVoiceAdpcm.html">AXSetVoiceAdpcm</a></code> 63</p> 64 65<h2>Revision History</h2> 66 67<P>2006/03/01 Initial version.</P><hr> 68<P>CONFIDENTIAL</p> 69</BODY> 70</HTML> 71