recon.s
3.52 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
#include "recon.h"
/*
Inputs:
rec_in_dat - Input IDCT'ed data address
rec_in_ref - Reference block address
rec_in_cbp - Coded Block Pattern
rec_in_intra - Intra block flag
Outputs:
data at rec_out_dat - reconstructed data
*/
recon:
addi caddr, rzero, RECON_CONSTS
lqv consts[0], 0(caddr)
addi loopcnt, rzero, 12
recon_loop:
blez loopcnt, recon_ret
addi loopcnt, loopcnt, -2
addi uvflag, loopcnt, -2
andi dummy, rec_in_cbp, 1
blez dummy, recon_next
srl rec_in_cbp, rec_in_cbp, 1
bgtz rec_in_intra, recon_noref
nop
bgtz uvflag, recon_y
nop
recon_uv:
lhv ref_r0[0], 0(rec_in_ref)
lhv ref_r1[0], 16(rec_in_ref)
lhv ref_r2[0], 32(rec_in_ref)
lhv ref_r3[0], 48(rec_in_ref)
lhv ref_r4[0], 64(rec_in_ref)
lhv ref_r5[0], 80(rec_in_ref)
lhv ref_r6[0], 96(rec_in_ref)
j shift_lo
lhv ref_r7[0], 112(rec_in_ref)
recon_y:
luv ref_r0[0], 0(rec_in_ref)
luv ref_r1[0], 16(rec_in_ref)
luv ref_r2[0], 32(rec_in_ref)
luv ref_r3[0], 48(rec_in_ref)
luv ref_r4[0], 64(rec_in_ref)
luv ref_r5[0], 80(rec_in_ref)
luv ref_r6[0], 96(rec_in_ref)
luv ref_r7[0], 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]
lqv err_r0[0], 0(rec_in_dat)
vmudm ref_r4, ref_r4, consts[SHIFTDN]
lqv err_r1[0], 16(rec_in_dat)
vmudm ref_r5, ref_r5, consts[SHIFTDN]
lqv err_r2[0], 32(rec_in_dat)
vmudm ref_r6, ref_r6, consts[SHIFTDN]
lqv err_r3[0], 48(rec_in_dat)
vmudm ref_r7, ref_r7, consts[SHIFTDN]
lqv err_r4[0], 64(rec_in_dat)
vadd ref_r0, ref_r0, err_r0
lqv err_r5[0], 80(rec_in_dat)
vadd ref_r1, ref_r1, err_r1
lqv err_r6[0], 96(rec_in_dat)
vadd ref_r2, ref_r2, err_r2
lqv err_r7[0], 112(rec_in_dat)
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
shift_hi:
sqv vzero[0], 0(rec_in_dat)
vmudn ref_r0, ref_r0, consts[SHIFTUP]
sqv vzero[0], 16(rec_in_dat)
vmudn ref_r1, ref_r1, consts[SHIFTUP]
sqv vzero[0], 32(rec_in_dat)
vmudn ref_r2, ref_r2, consts[SHIFTUP]
sqv vzero[0], 48(rec_in_dat)
vmudn ref_r3, ref_r3, consts[SHIFTUP]
sqv vzero[0], 64(rec_in_dat)
vmudn ref_r4, ref_r4, consts[SHIFTUP]
sqv vzero[0], 80(rec_in_dat)
vmudn ref_r5, ref_r5, consts[SHIFTUP]
sqv vzero[0], 96(rec_in_dat)
vmudn ref_r6, ref_r6, consts[SHIFTUP]
sqv vzero[0], 112(rec_in_dat)
vmudn ref_r7, ref_r7, consts[SHIFTUP]
bgtz uvflag, sav_y
nop
sav_uv:
shv ref_r0[0], 0(rec_out_dat)
shv ref_r1[0], 16(rec_out_dat)
shv ref_r2[0], 32(rec_out_dat)
shv ref_r3[0], 48(rec_out_dat)
shv ref_r4[0], 64(rec_out_dat)
shv ref_r5[0], 80(rec_out_dat)
shv ref_r6[0], 96(rec_out_dat)
j recon_next
shv ref_r7[0], 112(rec_out_dat)
sav_y:
suv ref_r0[0], 0(rec_out_dat)
suv ref_r1[0], 16(rec_out_dat)
suv ref_r2[0], 32(rec_out_dat)
suv ref_r3[0], 48(rec_out_dat)
suv ref_r4[0], 64(rec_out_dat)
suv ref_r5[0], 80(rec_out_dat)
suv ref_r6[0], 96(rec_out_dat)
suv ref_r7[0], 112(rec_out_dat)
recon_next:
lh offset, RECON_OFF(loopcnt)
add rec_in_ref, rec_in_ref, offset
addi rec_in_dat, rec_in_dat, 128
j recon_loop
add rec_out_dat, rec_out_dat, offset
recon_noref:
lqv ref_r0[0], 0(rec_in_dat)
lqv ref_r1[0], 16(rec_in_dat)
lqv ref_r2[0], 32(rec_in_dat)
lqv ref_r3[0], 48(rec_in_dat)
lqv ref_r4[0], 64(rec_in_dat)
lqv ref_r5[0], 80(rec_in_dat)
lqv ref_r6[0], 96(rec_in_dat)
j shift_hi
lqv ref_r7[0], 112(rec_in_dat)
recon_ret:
jr return
nop
#include "recon_un.h"