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.addr</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.addr</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18// loopFlag
19#define AXPBADDR_LOOP_OFF   0       // one shot
20#define AXPBADDR_LOOP_ON    1       // looped
21
22// format
23#define AX_PB_FORMAT_PCM16  0x000A  // signed 16 bit PCM (mono)
24#define AX_PB_FORMAT_PCM8   0x0019  // signed 8 bit PCM (mono)
25#define AX_PB_FORMAT_ADPCM  0x0000  // ADPCM encoded (mono)
26
27typedef struct _AXPBADDR
28{
29
30    u16 loopFlag;                   // one shot or looped sample? (See above)
31    u16 format;                     // sample format used (see above)
32    u16 loopAddressHi;              // Loop start
33    u16 loopAddressLo;
34    u16 endAddressHi;               // Loop/sample end, including last sample played
35    u16 endAddressLo;
36    u16 currentAddressHi;           // Current playback position
37    u16 currentAddressLo;
38
39} AXPBADDR;
40</pre></dd></dl>
41
42<h2>Description</h2>
43<p>The <code>AXPBADDR</code> structure specifies the address and other information about the sampling data.</p>
44
45<p>The <SPAN class="argument">loopFlag</SPAN> parameter specifies whether to loop the sampling data or play it only once.</p>
46
47<p>The <SPAN class="argument">format</SPAN> parameter specifies the classification of the sampling data. This in turn dictates the addressing mode of the DSP streaming cache.</p>
48
49<p>Specify <CODE>AX_PB_FORMAT_PCM16</CODE> for <SPAN class="argument">format</SPAN> if the sampling data are encoded as 16-bit PCM. With this setting, the streaming cache accesses main memory in units of WORDs (16 bits), so the addresses mentioned below also need to be specified in units of WORDs (16 bits).</p>
50
51<p>Specify <CODE>AX_PB_FORMAT_PCM8</CODE> for <SPAN class="argument">format</SPAN> if the sampling data are encoded as 8-bit PCM. With this setting, the streaming cache accesses main memory in bytes, so the addresses mentioned below also need to be specified in bytes.</p>
52
53<p>Finally, specify <CODE>AX_PB_FORMAT_ADPCM</CODE> for <SPAN class="argument">format</SPAN> if the sampling data is encoded as DSP ADPCM. With this setting, the streaming cache accesses main memory in units of nibbles  (4 bits), so the addresses mentioned below also need to be specified in units of nibbles (4 bits).</p>
54
55<p>The addresses are specified as physical addresses in main memory.</p>
56
57<p>The <SPAN class="argument">loopAddressHi</SPAN> and <SPAN class="argument">loopAddressLo</SPAN> values specify the loop starting address for the sampling data. The <SPAN class="argument">loopAddressHi</SPAN> value defines the upper 16 bits of the 32-bit  loop starting address, and <SPAN class="argument">loopAddressLo</SPAN> defines the lower 16 bits. If the sampling data is played only once, specify the same values for <SPAN class="argument">loopAddressHi/Lo</SPAN> and for <SPAN class="argument">currentAddressHi/Lo</SPAN> (described below).</p>
58
59<p>The <SPAN class="argument">endAddressHi</SPAN> and <SPAN class="argument">endAddressLo</SPAN> values specify the loop ending address for the sampling data  (i.e., the address of the sample at the end of the loop). If the sampling data is played only once, specify the address of the last sample in the data.</p>
60
61<p>The <SPAN class="argument">currentAddressHi</SPAN> and <SPAN class="argument">currentAddressLo</SPAN> values specify the current playback address in the sampling data. Normally, <SPAN class="argument">currentAddressHi/Lo</SPAN> specifies the starting address for playback of the sampling data when voices are initialized, and after that the DSP updates the value automatically.</p>
62
63<h3>The DSP-ADPCM data format</h3>
64<p>Each frame of DSP ADPCM data is 8 bytes long. The first byte is the frame header and contains the predictor and scale values needed to decode the samples in the given frame. The following seven bytes contain a payload of 14 samples.</p>
65
66<p><strong>The DSP hardware ADPCM decoder assumes that the frame header of every frame of DSP ADPCM data is set to an 8-byte boundary. </strong> However, DSP ADPCM data does not need to end on an 8-byte boundary.</p>
67
68<p>When specifying the addresses for sampling data that is encoded in DSP ADPCM in the <code>AXPBADDR</code> structure, the addresses (<SPAN class="argument">loopAddress</SPAN>, <SPAN class="argument">endAddress</SPAN>, and <SPAN class="argument">currentAddress</SPAN>) must not specify a frame header in main memory. A simple formula for calculating the appropriate nibble address for a given sample offset (starting from zero) is given below:</p>
69
70<blockquote><code>nibble_address = ((sample / 14) * 16) + (sample % 14) + 2);</code></blockquote>
71
72<h3>Synchronization</h3>
73<p>If the <SPAN class="argument">loopFlag</SPAN> parameter has changed, assert the <CODE>AX_SYNC_USER_LOOP</CODE> bit in the <CODE>axvpb.sync</CODE> member.</p>
74
75<p>If a <SPAN class="argument">loopAddress*</SPAN> parameter has changed, assert the <CODE>AX_SYNC_USER_LOOPADDR</CODE> bit in the <CODE>axvpb.sync</CODE> member.</p>
76
77<p>If a <SPAN class="argument">currentAddress*</SPAN> parameter has changed, assert the <CODE>AX_SYNC_USER_CURRADDR</CODE> bit in the <CODE>axvpb.sync</CODE> member.</p>
78
79<p>If an <SPAN class="argument">endAddress*</SPAN> parameter has changed, assert the <CODE>AX_SYNC_USER_ENDADDR</CODE> bit in the <CODE>axvpb.sync</CODE> member.</p>
80
81<p>To force synchronization of the entire structure, assert the <code>AX_SYNC_USER_ADDR</code> bit.</p>
82
83<h2>See Also</h2>
84<p class="reference">
85<a href="../Voice_Parameter_Blocks/sync.html">axvpb.sync</a>, <a href="../Voice_Parameters/AXSetVoiceAddr.html">AXSetVoiceAddr</a>
86</p>
87
88<h2>Revision History</h2>
89<P>
902006/11/21 Changed the A memory to main memory. Deleted the zero buffer explanation because it is no longer necessary.<br>2006/03/01 Initial version.<BR>
91</P>
92
93<hr><p>CONFIDENTIAL</p></body>
94</html>
95