recon.s
3.47 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#include "recon.h"
/*
Inputs:
rec_in_dat - Input IDCT'ed data address
rec_in_ref - Reference block address
rec_in_cbp - Coded Block Pattern
Outputs:
data at rec_out_dat - reconstructed data
*/
recon:
nop
nop
recon_init:
andi flag, mbtype, MBT_INTRA
addi uvflag, rzero, 0
addi caddr, rzero, RECON_CONSTS
lqv consts, 0(caddr)
addi loopcnt, rzero, FOUR
recon_loop:
bgtz loopcnt, recon_y
addi loopcnt, loopcnt, NEG1
addi rec_in_ref, rec_in_ref, CR_OFFSET
addi rec_out_dat, rec_out_dat, CR_OFFSET
recon_uv:
bgtz flag, sav_intra
nop
lhv ref_r0, 0(rec_in_ref)
lhv ref_r1, 16(rec_in_ref)
lhv ref_r2, 32(rec_in_ref)
lhv ref_r3, 48(rec_in_ref)
lhv ref_r4, 64(rec_in_ref)
lhv ref_r5, 80(rec_in_ref)
lhv ref_r6, 96(rec_in_ref)
lhv ref_r7, 112(rec_in_ref)
j shift_lo
nop
recon_y:
bgtz flag, sav_intra
nop
luv ref_r0, 0(rec_in_ref)
luv ref_r1, 16(rec_in_ref)
luv ref_r2, 32(rec_in_ref)
luv ref_r3, 48(rec_in_ref)
luv ref_r4, 64(rec_in_ref)
luv ref_r5, 80(rec_in_ref)
luv ref_r6, 96(rec_in_ref)
luv ref_r7, 112(rec_in_ref)
shift_lo:
vmudm ref_r0, ref_r0, consts[SHIFTDN]
vmudm ref_r1, ref_r1, consts[SHIFTDN]
vmudm ref_r2, ref_r2, consts[SHIFTDN]
vmudm ref_r3, ref_r3, consts[SHIFTDN]
vmudm ref_r4, ref_r4, consts[SHIFTDN]
vmudm ref_r5, ref_r5, consts[SHIFTDN]
vmudm ref_r6, ref_r6, consts[SHIFTDN]
vmudm ref_r7, ref_r7, consts[SHIFTDN]
andi dummy, rec_in_cbp, 1
blez dummy, recon_noadd
srl rec_in_cbp, rec_in_cbp, 1
recon_add:
lqv err_r0, 0(rec_in_dat)
lqv err_r1, 16(rec_in_dat)
lqv err_r2, 32(rec_in_dat)
lqv err_r3, 48(rec_in_dat)
lqv err_r4, 64(rec_in_dat)
lqv err_r5, 80(rec_in_dat)
lqv err_r6, 96(rec_in_dat)
lqv err_r7, 112(rec_in_dat)
vadd ref_r0, ref_r0, err_r0
vadd ref_r1, ref_r1, err_r1
vadd ref_r2, ref_r2, err_r2
vadd ref_r3, ref_r3, err_r3
vadd ref_r4, ref_r4, err_r4
vadd ref_r5, ref_r5, err_r5
vadd ref_r6, ref_r6, err_r6
vadd ref_r7, ref_r7, err_r7
j recon_noadd
nop
sav_intra:
lqv ref_r0, 0(rec_in_dat)
lqv ref_r1, 16(rec_in_dat)
lqv ref_r2, 32(rec_in_dat)
lqv ref_r3, 48(rec_in_dat)
lqv ref_r4, 64(rec_in_dat)
lqv ref_r5, 80(rec_in_dat)
lqv ref_r6, 96(rec_in_dat)
lqv ref_r7, 112(rec_in_dat)
recon_noadd:
vmudn ref_r0, ref_r0, consts[SHIFTUP]
vmudn ref_r1, ref_r1, consts[SHIFTUP]
vmudn ref_r2, ref_r2, consts[SHIFTUP]
vmudn ref_r3, ref_r3, consts[SHIFTUP]
vmudn ref_r4, ref_r4, consts[SHIFTUP]
vmudn ref_r5, ref_r5, consts[SHIFTUP]
vmudn ref_r6, ref_r6, consts[SHIFTUP]
vmudn ref_r7, ref_r7, consts[SHIFTUP]
bgez loopcnt, sav_y
nop
sav_uv:
shv ref_r0, 0(rec_out_dat)
shv ref_r1, 16(rec_out_dat)
shv ref_r2, 32(rec_out_dat)
shv ref_r3, 48(rec_out_dat)
shv ref_r4, 64(rec_out_dat)
shv ref_r5, 80(rec_out_dat)
shv ref_r6, 96(rec_out_dat)
shv ref_r7, 112(rec_out_dat)
j recon_next
nop
sav_y:
suv ref_r0, 0(rec_out_dat)
suv ref_r1, 16(rec_out_dat)
suv ref_r2, 32(rec_out_dat)
suv ref_r3, 48(rec_out_dat)
suv ref_r4, 64(rec_out_dat)
suv ref_r5, 80(rec_out_dat)
suv ref_r6, 96(rec_out_dat)
suv ref_r7, 112(rec_out_dat)
recon_next:
bltz loopcnt, recon_final
nop
andi dummy, loopcnt, 1
lb offset, RECON_OFF(dummy)
add rec_in_ref, rec_in_ref, offset
addi rec_in_dat, rec_in_dat, 128
add rec_out_dat, rec_out_dat, offset
j recon_loop
nop
recon_final:
bgtz uvflag, recon_ret
addi uvflag, rzero, 1
addi rec_in_ref, rec_in_ref, 1
addi rec_in_dat, rec_in_dat, 128
addi rec_out_dat, rec_out_dat, 1
j recon_uv
nop
recon_ret:
jr return
nop
#include "recon_un.h"