video_dmem.h
3.5 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
154
155
156
157
158
159
160
#
# video_dmem.h
#
# This file lays out the overall DMEM usage for the RSP MPEG video decoding
# task.
#ifdef _LANGUAGE_C
# ifndef eval
# define eval(s) (s)
# endif
#endif
#include <rsp.h>
#include <rcp.h>
#include <sptask.h>
/*
* Memory layout of DMEM:
*
* ----------------------------------------------
* | Cosine matrices and constants for IDCT |
* | (80 bytes) |
* | |
* |--------------------------------------------|
* | Q matrices and constants for IQ |
* | (272 bytes) |
* | |
* |--------------------------------------------|
* | Switch table and constants for MC |
* | (32 bytes) |
* | |
* |--------------------------------------------|
* | Constants for Recon |
* | (16 bytes) |
* | |
* |--------------------------------------------|
* | Macroblock data |
* | (3328 bytes) |
* | |
* |--------------------------------------------|
* | Temporary workspace |
* | (? bytes) |
* | |
* ----------------------------------------------
*/
.data RSP_DMEM_BASE
#define IDCT_CONST_BASE RSP_DMEM_BASE
#################################
# IDCT Constants #
# (80 bytes) #
#################################
#include "idct_dmem.h"
#define IQ_CONST_BASE (IDCT_CONST_BASE+80)
#################################
# IQ Constants and QMAT #
# (272 bytes) #
#################################
#include "iq_dmem.h"
#define MC_CONST_BASE (IQ_CONST_BASE+272)
#################################
# MC Constants #
# (32 bytes) #
#################################
#include "mc_dmem.h"
#define REC_CONST_BASE (MC_CONST_BASE+32)
#################################
# Recon Constants #
# (16 bytes) #
#################################
#include "recon_dmem.h"
#define MB_BASE (REC_CONST_BASE+16)
#define MB_DMEM_SIZE 832
#define MB_BASE2 (MB_BASE+MB_DMEM_SIZE)
#################################
# MacroBlock Data #
# (3328 bytes) #
#################################
.space 0x0d00
/* all addresses are offsets to MB_BASE or MB_BASE2 */
#define MBH_MBTYPE 0
#define MBH_CBP 2
#define MBH_QUANT 4
#define MBH_MVFX 6
#define MBH_MVFY 8
#define MBH_MVBX 10
#define MBH_MVBY 12
#define MBH_BNUM 14
#define MB_DATA 16
#define MB_DATA_SIZE (6*64*2)
#define MB_YREF_SIZE (16*17*2)
#define MB_UVREF_SIZE (16*9*2)
#ifdef _FETCH_REF
#define MBS_FYPTR (MB_DATA+MB_DATA_SIZE)
#define MBS_FYLEN (MBS_FYPTR+4)
#define MBS_FUVPTR (MBS_FYPTR+8)
#define MBS_FUVLEN (MBS_FYPTR+12)
#define MBS_BYPTR (MBS_FYPTR+16)
#define MBS_BYLEN (MBS_FYPTR+20)
#define MBS_BUVPTR (MBS_FYPTR+24)
#define MBS_BUVLEN (MBS_FYPTR+28)
#define MBS_OUTYBUF (MBS_FYPTR+32)
#define MBS_OUTUVBUF (MBS_FYPTR+36)
#endif
#define MB_SIZE 2496
#define MB_DATA_FREF (MB_BASE+MB_DMEM_SIZE*2)
#define MB_DATA_BREF (MB_DATA_FREF+MB_YREF_SIZE+MB_UVREF_SIZE)
#define TEMP_BASE (MB_BASE+0x0d00)
#################################
# Temp Workspace #
# #
#################################
.space 0x0100