mpaud.h
5.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
#ifndef _mpaud_h_
#define _mpaud_h_
/*
* File: mpaud.h
*
* This file lays out the DMEM usage for the RSP mpeg audio task.
*
*/
#define eval(s) (s)
/*
* Memory layout of DMEM:
*
* Our aim is to minimize DMEM use so that we can process as
* many samples as possible with a single command.
* The buffer area is a resource managed by the Host rather than
* divided into hard defined regions.
*
* -------------------------------------------------
* | Program data from compiler... | (must be first)
* | 800 bytes |
* | Includes constants |
* | coefficient table for resampler |
* | |
* |-----------------------------------------------|
* | Buffers available for command results |
* | Managed by the Host CPU |
* | |
* | |
* |-----------------------------------------------|
* | Scratch space for intermediate results |
* | Not touched by the Host CPU |
* | Whatever is left |
* | |
* | |
* -------------------------------------------------
*
*/
#ifndef DCACHEBASE
# define DCACHEBASE 0x00000000
#endif
#ifndef DCACHEBASEHI
# define DCACHEBASEHI 0x0000
#endif
#ifndef DCACHEBASELO
# define DCACHEBASELO 0x0000
#endif
/* These relate to the illustration above. Note that everything should
be kept 8 byte aligned */
#define RSP_DMEM_SIZE8 4096
#define RSP_PDATA_SIZE8 1424 /* This will change in the
initial stages as we develop
algorithms. */
#define RSP_PAR_SIZE8 16 /* Parameter values, such as
current buffer location */
#define RSP_DCT_SIZE8 128
#define RSP_IQIN_SIZE8 64 /* Input values for Inverse
quantization */
#define RSP_IQD_SIZE8 64 /* Coefficient D[] for Inverse
quantization */
#define RSP_IQC_SIZE8 128 /* Coefficient C[] for Inverse
quantization */
#define RSP_IQSCALE_SIZE8 128 /* scalefactors for Inverse
quantization */
#define RSP_OLABUFF_SIZE8 1024 /* OLA buffer - size is for one
word. Buffer is double precision */
#define RSP_COMMAND_SIZE8 32 /* Local command buffer size - one
command at moment */
#define RSP_MPAUD_COMMAND_SIZE8 32 /* Size of a single command */
#define RSP_PDATA_OFFSET eval(0)
#define RSP_PAR_OFFSET eval(RSP_PDATA_OFFSET + RSP_PDATA_SIZE8)
#define RSP_DCTIN_OFFSET eval(RSP_PAR_OFFSET + RSP_PAR_SIZE8)
#define RSP_DCTOUT_OFFSET eval(RSP_DCTIN_OFFSET + RSP_DCT_SIZE8)
/*
* DCT output and the inverse quantization input are the same
*/
#define RSP_IQIN_OFFSET RSP_DCTOUT_OFFSET
#define RSP_IQD_OFFSET eval(RSP_DCTOUT_OFFSET + RSP_DCT_SIZE8)
#define RSP_IQC_OFFSET eval(RSP_IQD_OFFSET + RSP_IQD_SIZE8)
#define RSP_IQSCALE_OFFSET eval(RSP_IQC_OFFSET + RSP_IQC_SIZE8)
/*
* Overlap add input is the same the the DCT input (and it runs
* into the DCTOUT area because it has length 64
*/
#define RSP_OLAIN_OFFSET RSP_DCTIN_OFFSET
/*
* Overlap and add buffers
*/
#define RSP_OLABUFF_HIGH_OFFSET eval(RSP_IQSCALE_OFFSET + RSP_IQSCALE_SIZE8)
#define RSP_OLABUFF_LOW_OFFSET eval(RSP_OLABUFF_HIGH_OFFSET + RSP_OLABUFF_SIZE8)
/*
* Task and Command buffer uses the same location as the input -
* basically I only store one command at a time
*/
#define RSP_COMMAND_OFFSET eval(RSP_IQIN_OFFSET)
.print "\n"
.print "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
.print "DCT input data offset is 0x%x\n", RSP_DCTIN_OFFSET
.print "DCT output data offset is 0x%x\n", RSP_DCTOUT_OFFSET
.print "IQ input data offset is 0x%x\n", RSP_IQIN_OFFSET
.print "D[] data offset is 0x%x\n", RSP_IQD_OFFSET
.print "C[] data offset is 0x%x\n", RSP_IQC_OFFSET
.print "scalefactor[] data offset is 0x%x\n", RSP_IQSCALE_OFFSET
.print "OLA input data offset is 0x%x\n", RSP_OLAIN_OFFSET
.print "OLA input buffer (high) offset is 0x%x\n", RSP_OLABUFF_HIGH_OFFSET
.print "OLA input buffer (low) offset is 0x%x\n", RSP_OLABUFF_LOW_OFFSET
.print "Command buffer offset is 0x%x\n", RSP_COMMAND_OFFSET
.print "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
.print "\n"
/*
* Defines for parameter offsets
*/
#define OLA_HIGH_OFFSET 0
#define OLA_LOW_OFFSET 2
#define OLA_DRAMBUFF_OFFSET 4
#endif /* _mpaud_h_ */