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<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18typedef struct _AXPBADPCM
19{
20
21    u16 a[8][2];        // coef table a1[0],a2[0],a1[1],a2[1]....
22    u16 gain;           // Gain to apply (ADPCM: 0   PCM8: 0x0800    PCM16: 0x0100)
23    u16 pred_scale;     // predictor / scale combination (nibbles, as in hardware)
24    u16 yn1;            // y[n - 1]
25    u16 yn2;            // y[n - 2]
26
27} AXPBADPCM;
28</pre></dd></dl>
29
30<h2>Description</h2>
31<p>The <SPAN class="argument">adpcm</SPAN> values specify the coefficients and processing context for playback of ADPCM-encoded samples.</p>
32
33<p>The decoding coefficients must be stored in the coefficient table <SPAN class="argument">a[][]</SPAN>. The initial-state values for the predictor, scale, and histories must be stored in <SPAN class="argument">pred_scale</SPAN>, <SPAN class="argument">yn1</SPAN>, and <SPAN class="argument">yn2</SPAN>. These values are provided by the GameCube's DSP ADPCM encoding tool. See &quot;DSPADPCM&quot; in the <em>Nintendo&nbsp;Revolution Audio Programmer's Guide</em> for more details.</p>
34<p>Values to be stored in <SPAN class="argument">a[ ][ ]</SPAN> are stored as <code>coef[]</code> in the header of the output data from DSPADPCM. Here's how <SPAN class="argument">a[ ][ ]</SPAN> corresponds to <code>coef[]</code>:</p>
35<BLOCKQUOTE>
36<pre><CODE>
37a[0][0] = coef[0];
38a[0][1] = coef[1];
39a[1][0] = coef[2];
40a[1][1] = coef[3];
41a[2][0] = coef[4];
42a[2][1] = coef[5];
43a[3][0] = coef[6];
44a[3][1] = coef[7];
45a[4][0] = coef[8];
46a[4][1] = coef[9];
47a[5][0] = coef[10];
48a[5][1] = coef[11];
49a[6][0] = coef[12];
50a[6][1] = coef[13];
51a[7][0] = coef[14];
52a[7][1] = coef[15];
53</CODE></pre>
54</BLOCKQUOTE>
55<p>The gain must be set to <SPAN class="argument">0x0800</SPAN> 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>
56
57<p>Assert the <code>AX_SYNC_USER_ADPCM</code> bit to <code>the axvpb.sync</code> member to change these values.</p>
58
59<h2>See Also</h2>
60<p class="reference">
61<a href="../Voice_Parameter_Blocks/sync.html">axvpb.sync</a>, <a href="../Voice_Parameters/AXSetVoiceAdpcm.html">AXSetVoiceAdpcm</a>
62</p>
63
64<h2>Revision History</h2>
65<P>
662006/03/01 Initial version.<BR>
67</P>
68
69<hr><p>CONFIDENTIAL</p></body>
70</html>
71