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>C Specification</h2>
17
18<BLOCKQUOTE>
19<pre><CODE>// loopFlag
20#define AXPBADDR_LOOP_OFF   0       // one shot
21#define AXPBADDR_LOOP_ON    1       // looped
22
23// format
24#define AX_PB_FORMAT_PCM16  0x000A  // signed 16 bit PCM (mono)
25#define AX_PB_FORMAT_PCM8   0x0019  // signed 8 bit PCM (mono)
26#define AX_PB_FORMAT_ADPCM  0x0000  // ADPCM encoded (mono)
27
28typedef struct _AXPBADDR
29{
30
31    u16 loopFlag;                   // one shot or looped sample (see above)
32    u16 format;                     // sample format used (see above)
33    u16 loopAddressHi;              // Loop start
34    u16 loopAddressLo;
35    u16 endAddressHi;               // Loop/sample end, including last sample played
36    u16 endAddressLo;
37    u16 currentAddressHi;           // Current playback position
38    u16 currentAddressLo;
39
40} AXPBADDR;</CODE></pre>
41</BLOCKQUOTE>
42
43<h2>Description</h2>
44
45<p>The <code>AXPBADDR</code> structure specifies the address and other information about the sampling data.</p>
46
47<p>The <code>loopFlag</code> parameter specifies whether to loop the sampling data or play it only once.</p>
48
49<p>The <code>format</code> specifies the classification of the sampling data. This in turn dictates the addressing mode of the DSP streaming cache.</p>
50
51<p>Specify  <code>AX_PB_FORMAT_PCM16</code> for <code>format</code> 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>
52
53<p>Specify  <code>AX_PB_FORMAT_PCM8</code> for <code>format</code> 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>
54
55<p>Finally, specify <code>AX_PB_FORMAT_ADPCM</code> for <code>format</code> 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>
56
57<p>The addresses are specified as physical addresses in main memory.</p>
58
59<p>The <code>loopAddressHi</code> and <code>loopAddressLo</code> values specify the loop starting address for the sampling data. The <code>loopAddressHi</code> value defines the upper 16 bits of the 32-bit  loop starting address, and <code>loopAddressLo</code> defines the lower 16 bits. <strong>If the sampling data is played only once, specify the same values for <code>loopAddressHi/Lo</code> and for <code>currentAddressHi/Lo</code> (described below).</strong></p>
60
61<p>The <code>endAddressHi</code> and <code>endAddressLo</code> 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>
62
63<p>The <code>currentAddressHi</code> and <code>currentAddressLo</code> values specify the current playback address in the sampling data. Normally, <code>currentAddressHi/Lo</code> specifies the starting address for playback of the sampling data when voices are initialized, and after that the DSP updates the value automatically. </p>
64
65<h3>The DSP-ADPCM data format</h3>
66
67<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>
68
69<p><strong><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>
70
71<p>When specifying the addresses for sampling data that is encoded in DSP ADPCM in the <code>AXPBADDR</code> structure, the addresses (<code>loopAddress</code>, <code>endAddress</code>, and <code>currentAddress</code>) 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>
72
73<blockquote><code>nibble_address = ((sample/14)*16) + (sample % 14) + 2);</code></blockquote>
74
75<h3>Synchronization</h3>
76
77<p>If the <code>loopFlag</code> parameter has changed, assert the <code>AX_SYNC_USER_LOOP</code> bit in the <code>axvpb.sync</code> member.</p>
78
79<p>If <code>loopAddress*</code> has changed, assert the <code>AX_SYNC_USER_LOOPADDR</code> bit in the <code>axvpb.sync</code> member.</p>
80
81<p>If <code>currentAddress*</code> has changed, assert the <code>AX_SYNC_USER_CURRADDR</code> bit in the <code>axvpb.sync</code> member.</p>
82
83<p>If <code>endAddress*</code> has changed, assert the <code>AX_SYNC_USER_ENDADDR</code> bit in the <code>axvpb.sync</code> member.</p>
84
85<p>To force synchronization of the entire structure, assert the <code>AX_SYNC_USER_ADDR</code> bit.</p>
86
87<h2>See Also</h2>
88
89<p>
90<code><a href="../Voice_Parameter_Blocks/sync.html">axvpb.sync</a><br> <a href="../Voice_Parameters/AXSetVoiceAddr.html">AXSetVoiceAddr</a><br></code>
91</p>
92
93<h2>Revision History</h2>
94
95<P>
962006/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.
97</P>
98<hr>
99<P>CONFIDENTIAL</p>
100</BODY>
101</HTML>
102