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=utf-8"> 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]; // Decode coefficient table 22 u16 gain; // Gain (Specify 0 for ADPCM; 0x0800 for PCM16; 0x0100 for PCM8) 23 u16 pred_scale; // Predictor and scale 24 u16 yn1; // Log data (y[n - 1]) 25 u16 yn2; // Log data (y[n - 2]) 26 27} AXPBADPCM; 28</pre></dd></dl> 29 30<h2>Description</h2> 31<p>Sets parameters (context) to the <code>AXPBADPCM</code> structure so the ADPCM hardware decoder operates properly.</p> 32 33<p>The AX uses the ADPCM hardware decoder not only for ADPCM data but also for 16-bit PCM and 8-bit PCM data. When playing these data types, therefore, you must appropriately configure the <code>AXPBADPCM</code> structure.</p> 34 35<p>In the case of ADPCM data, for the <code>a[ ][ ]</code> data coefficient table specify the <code>coef[]</code> coefficient that is described in the DSPADPCM tool's output data header (the <code>DSPADPCM</code> structure). The correspondence between the <code>AXPBADPCM</code> structure's <code>a[ ][ ]</code> and the header's <code>coef[]</code> is shown below.</p> 36<BLOCKQUOTE> 37<pre><CODE> 38DSPADPCM *ps = (DSPADPCM*) (Pointer to ADPCM data) 39AXPBADPCM adpcm; 40 41adpcm.a[0][0] = ps->coef[0]; 42adpcm.a[0][1] = ps->coef[1]; 43adpcm.a[1][0] = ps->coef[2]; 44adpcm.a[1][1] = ps->coef[3]; 45adpcm.a[2][0] = ps->coef[4]; 46adpcm.a[2][1] = ps->coef[5]; 47adpcm.a[3][0] = ps->coef[6]; 48adpcm.a[3][1] = ps->coef[7]; 49adpcm.a[4][0] = ps->coef[8]; 50adpcm.a[4][1] = ps->coef[9]; 51adpcm.a[5][0] = ps->coef[10]; 52adpcm.a[5][1] = ps->coef[11]; 53adpcm.a[6][0] = ps->coef[12]; 54adpcm.a[6][1] = ps->coef[13]; 55adpcm.a[7][0] = ps->coef[14]; 56adpcm.a[7][1] = ps->coef[15]; 57</CODE></pre> 58</BLOCKQUOTE> 59 60<p>For <code>gain</code>, specify one of the following values, based on the data type.</p> 61<table border="1" > 62 <tbody> 63 <tr> 64 <td width="120" align="center" bgcolor="#98FB98">ADPCM</td> 65<td>0x0000</td> 66 </tr> 67 <tr> 68 <td align="center" bgcolor="#F0E68C">16-bit PCM (PCM16)</td> 69<td>0x0800</td> 70 </tr> 71 <tr> 72 <td align="center" bgcolor="#98FB98">8-bit PCM (PCM8)</td> 73<td>0x0100</td> 74 </tr> 75 </tbody> 76</table> 77 78<p>In the case of ADPCM data, for the <code>pred_scale</code> predictor and scale and the <code>yn1</code> and <code>yn2</code> log data, specify the values for <code>ps</code>, <code>yn1</code> and <code>yn2</code> described in the DSPADPCM tool's output data header (the <code>DSPADPCM</code> structure).</p> 79 80<BLOCKQUOTE> 81<pre><CODE> 82DSPADPCM *ps = (DSPADPCM*) (Pointer to ADPCM data) 83AXPBADPCM adpcm; 84 85adpcm.pred_scale = ps->ps; 86adpcm.yn1 = ps->yn1; 87adpcm.yn2 = ps->yn2; 88</CODE></pre> 89</BLOCKQUOTE> 90 91<p>For more information about the <code>DSPADPCM</code> structure, see <I>DSPADPCM.pdf</I> in the DSPADPCM tools.</p> 92 93<p>In the case of 16-bit PCM or 8-bit PCM data, you must specify <code>0</code> for all parameters other than <code>gain</code>.</p> 94 95<p><B>Note: The parameters for the voice parameter block are set per the values in the <code>AXPBADPCM</code> structure, but once the voice moves to the running state, the AX library automatically updates the parameters as ADPCM hardware decoder context.</B> <B>Also, when the data is looped ADPCM data, each time the loop occurs the AX library automatically overwrites this context with the loop context, <code>axvpb.pb.adpcmLoop(the AXPBADPCMLOOP structure)</code>. </B> <B>The parameters inside this voice parameter block cannot be changed while voices are playing.</B></p> 96 97<p>If you have changed any members of <code>axvpb.pb.adpcm (AXPBADPCM structure)</code>, set the <code>AX_SYNC_USER_ADPCM</code> bit in the <code>axvpb.sync</code> member.</p> 98 99<h2>See Also</h2> 100<p class="reference"> 101<a href="../Voice_Parameter_Blocks/sync.html">axvpb.sync</a><BR> <a href="AXPBADPCMLOOP_adpcmloop.html">axvpb.pb.adpcmLoop</a><BR> <a href="../Voice_Parameters/AXSetVoiceAdpcm.html">AXSetVoiceAdpcm</a> 102</p> 103 104<h2>Revision History</h2> 105<P> 1062009/05/11 Revised <B>Description</B>.<br>2006/03/01 Initial version.<BR> 107</P> 108 109<hr><p>CONFIDENTIAL</p></body> 110</html> 111