Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5361 | serge | 1 | /* |
2 | * Copyright © 2009 Intel Corporation |
||
3 | * |
||
4 | * Permission is hereby granted, free of charge, to any person obtaining a |
||
5 | * copy of this software and associated documentation files (the "Software"), |
||
6 | * to deal in the Software without restriction, including without limitation |
||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||
8 | * and/or sell copies of the Software, and to permit persons to whom the |
||
9 | * Software is furnished to do so, subject to the following conditions: |
||
10 | * |
||
11 | * The above copyright notice and this permission notice (including the next |
||
12 | * paragraph) shall be included in all copies or substantial portions of the |
||
13 | * Software. |
||
14 | * |
||
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||
18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||
19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||
20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||
21 | * SOFTWARE. |
||
22 | * |
||
23 | * Author: |
||
24 | * Zou Nan hai |
||
25 | * Yan Li |
||
26 | * Liu Xi bin |
||
27 | */ |
||
28 | /* |
||
29 | GRF allocation: |
||
30 | g1~g30: constant buffer |
||
31 | g1~g2:intra IQ matrix |
||
32 | g3~g4:non intra IQ matrix |
||
33 | g5~g20:IDCT tab |
||
34 | g31: read and write message descriptor |
||
35 | g32~g55:DCT data |
||
36 | g58~g81:reference data |
||
37 | g82: thread payload |
||
38 | g83~g106:IDCT data |
||
39 | */ |
||
40 | |||
41 | mov (8) g82.0<1>UD g31.0<8,8,1>UD {align1}; |
||
42 | mov (2) g31.0<1>UD g82.12<2,2,1>UW {align1}; |
||
43 | //shl (1) g31.4<1>UD g31.4<1,1,1>UD 1UD {align1}; |
||
44 | |||
45 | include(`iq_intra.g4i') |
||
46 | |||
47 | //defined for idct |
||
48 | define(`ROW_SHIFT', `11UD') |
||
49 | define(`ROW_ADD', `0x400UD') |
||
50 | define(`COL_SHIFT', `20UD') |
||
51 | define(`COL_ADD', `0x80000UD') |
||
52 | |||
53 | mov (1) a0.0<1>UD 0x06F006E0UD {align1}; //0x06F006E0UD+0x00200020UD=0x07100700UD (g56.0 and g56.16) |
||
54 | |||
55 | //Y0 |
||
56 | mov (1) g125.0<1>UD ip {align1}; |
||
57 | jmpi IDCT_START; |
||
58 | add (8) g83.0<1>W g32.0<16,8,2>W 128UW {align1}; |
||
59 | add (8) g84.0<1>W g33.0<16,8,2>W 128UW {align1}; |
||
60 | add (8) g85.0<1>W g34.0<16,8,2>W 128UW {align1}; |
||
61 | add (8) g86.0<1>W g35.0<16,8,2>W 128UW {align1}; |
||
62 | add (8) g87.0<1>W g36.0<16,8,2>W 128UW {align1}; |
||
63 | add (8) g88.0<1>W g37.0<16,8,2>W 128UW {align1}; |
||
64 | add (8) g89.0<1>W g38.0<16,8,2>W 128UW {align1}; |
||
65 | add (8) g90.0<1>W g39.0<16,8,2>W 128UW {align1}; |
||
66 | |||
67 | //Y1 |
||
68 | mov (1) g125.0<1>UD ip {align1}; |
||
69 | jmpi IDCT_START; |
||
70 | add (8) g83.16<1>W g32.0<16,8,2>W 128UW {align1}; |
||
71 | add (8) g84.16<1>W g33.0<16,8,2>W 128UW {align1}; |
||
72 | add (8) g85.16<1>W g34.0<16,8,2>W 128UW {align1}; |
||
73 | add (8) g86.16<1>W g35.0<16,8,2>W 128UW {align1}; |
||
74 | add (8) g87.16<1>W g36.0<16,8,2>W 128UW {align1}; |
||
75 | add (8) g88.16<1>W g37.0<16,8,2>W 128UW {align1}; |
||
76 | add (8) g89.16<1>W g38.0<16,8,2>W 128UW {align1}; |
||
77 | add (8) g90.16<1>W g39.0<16,8,2>W 128UW {align1}; |
||
78 | |||
79 | //Y2 |
||
80 | mov (1) g125.0<1>UD ip {align1}; |
||
81 | jmpi IDCT_START; |
||
82 | add (8) g91.0<1>W g32.0<16,8,2>W 128UW {align1}; |
||
83 | add (8) g92.0<1>W g33.0<16,8,2>W 128UW {align1}; |
||
84 | add (8) g93.0<1>W g34.0<16,8,2>W 128UW {align1}; |
||
85 | add (8) g94.0<1>W g35.0<16,8,2>W 128UW {align1}; |
||
86 | add (8) g95.0<1>W g36.0<16,8,2>W 128UW {align1}; |
||
87 | add (8) g96.0<1>W g37.0<16,8,2>W 128UW {align1}; |
||
88 | add (8) g97.0<1>W g38.0<16,8,2>W 128UW {align1}; |
||
89 | add (8) g98.0<1>W g39.0<16,8,2>W 128UW {align1}; |
||
90 | |||
91 | //Y3 |
||
92 | mov (1) g125.0<1>UD ip {align1}; |
||
93 | jmpi IDCT_START; |
||
94 | add (8) g91.16<1>W g32.0<16,8,2>W 128UW {align1}; |
||
95 | add (8) g92.16<1>W g33.0<16,8,2>W 128UW {align1}; |
||
96 | add (8) g93.16<1>W g34.0<16,8,2>W 128UW {align1}; |
||
97 | add (8) g94.16<1>W g35.0<16,8,2>W 128UW {align1}; |
||
98 | add (8) g95.16<1>W g36.0<16,8,2>W 128UW {align1}; |
||
99 | add (8) g96.16<1>W g37.0<16,8,2>W 128UW {align1}; |
||
100 | add (8) g97.16<1>W g38.0<16,8,2>W 128UW {align1}; |
||
101 | add (8) g98.16<1>W g39.0<16,8,2>W 128UW {align1}; |
||
102 | |||
103 | //U |
||
104 | mov (1) g125.0<1>UD ip {align1}; |
||
105 | jmpi IDCT_START; |
||
106 | add (16) g99.0<1>W g32.0<16,8,2>W 128UW {align1}; |
||
107 | add (16) g100.0<1>W g34.0<16,8,2>W 128UW {align1}; |
||
108 | add (16) g101.0<1>W g36.0<16,8,2>W 128UW {align1}; |
||
109 | add (16) g102.0<1>W g38.0<16,8,2>W 128UW {align1}; |
||
110 | |||
111 | //V |
||
112 | mov (1) g125.0<1>UD ip {align1}; |
||
113 | jmpi IDCT_START; |
||
114 | add (16) g103.0<1>W g32.0<16,8,2>W 128UW {align1}; |
||
115 | add (16) g104.0<1>W g34.0<16,8,2>W 128UW {align1}; |
||
116 | add (16) g105.0<1>W g36.0<16,8,2>W 128UW {align1}; |
||
117 | add (16) g106.0<1>W g38.0<16,8,2>W 128UW {align1}; |
||
118 | |||
119 | //send msg |
||
120 | mov (1) g31.8<1>UD 0x00F000FUD {align1}; |
||
121 | mov.sat (16) g83.0<2>UB g83.0<16,16,1>W {align1}; |
||
122 | mov.sat (16) g84.0<2>UB g84.0<16,16,1>W {align1}; |
||
123 | mov.sat (16) g85.0<2>UB g85.0<16,16,1>W {align1}; |
||
124 | mov.sat (16) g86.0<2>UB g86.0<16,16,1>W {align1}; |
||
125 | mov.sat (16) g87.0<2>UB g87.0<16,16,1>W {align1}; |
||
126 | mov.sat (16) g88.0<2>UB g88.0<16,16,1>W {align1}; |
||
127 | mov.sat (16) g89.0<2>UB g89.0<16,16,1>W {align1}; |
||
128 | mov.sat (16) g90.0<2>UB g90.0<16,16,1>W {align1}; |
||
129 | mov.sat (16) g91.0<2>UB g91.0<16,16,1>W {align1}; |
||
130 | mov.sat (16) g92.0<2>UB g92.0<16,16,1>W {align1}; |
||
131 | mov.sat (16) g93.0<2>UB g93.0<16,16,1>W {align1}; |
||
132 | mov.sat (16) g94.0<2>UB g94.0<16,16,1>W {align1}; |
||
133 | mov.sat (16) g95.0<2>UB g95.0<16,16,1>W {align1}; |
||
134 | mov.sat (16) g96.0<2>UB g96.0<16,16,1>W {align1}; |
||
135 | mov.sat (16) g97.0<2>UB g97.0<16,16,1>W {align1}; |
||
136 | mov.sat (16) g98.0<2>UB g98.0<16,16,1>W {align1}; |
||
137 | |||
138 | and.nz (1) null g82.2<1,1,1>UW 0x20UW{align1}; |
||
139 | (f0) jmpi field_dct; |
||
140 | |||
141 | mov (16) m1.0<1>UB g83.0<16,16,2>UB {align1}; |
||
142 | mov (16) m1.16<1>UB g84.0<16,16,2>UB {align1}; |
||
143 | mov (16) m2.0<1>UB g85.0<16,16,2>UB {align1}; |
||
144 | mov (16) m2.16<1>UB g86.0<16,16,2>UB {align1}; |
||
145 | mov (16) m3.0<1>UB g87.0<16,16,2>UB {align1}; |
||
146 | mov (16) m3.16<1>UB g88.0<16,16,2>UB {align1}; |
||
147 | mov (16) m4.0<1>UB g89.0<16,16,2>UB {align1}; |
||
148 | mov (16) m4.16<1>UB g90.0<16,16,2>UB {align1}; |
||
149 | mov (16) m5.0<1>UB g91.0<16,16,2>UB {align1}; |
||
150 | mov (16) m5.16<1>UB g92.0<16,16,2>UB {align1}; |
||
151 | mov (16) m6.0<1>UB g93.0<16,16,2>UB {align1}; |
||
152 | mov (16) m6.16<1>UB g94.0<16,16,2>UB {align1}; |
||
153 | mov (16) m7.0<1>UB g95.0<16,16,2>UB {align1}; |
||
154 | mov (16) m7.16<1>UB g96.0<16,16,2>UB {align1}; |
||
155 | mov (16) m8.0<1>UB g97.0<16,16,2>UB {align1}; |
||
156 | mov (16) m8.16<1>UB g98.0<16,16,2>UB {align1}; |
||
157 | jmpi write_back; |
||
158 | |||
159 | field_dct: |
||
160 | mov (16) m1.0<1>UB g83.0<16,16,2>UB {align1}; |
||
161 | mov (16) m1.16<1>UB g91.0<16,16,2>UB {align1}; |
||
162 | mov (16) m2.0<1>UB g84.0<16,16,2>UB {align1}; |
||
163 | mov (16) m2.16<1>UB g92.0<16,16,2>UB {align1}; |
||
164 | mov (16) m3.0<1>UB g85.0<16,16,2>UB {align1}; |
||
165 | mov (16) m3.16<1>UB g93.0<16,16,2>UB {align1}; |
||
166 | mov (16) m4.0<1>UB g86.0<16,16,2>UB {align1}; |
||
167 | mov (16) m4.16<1>UB g94.0<16,16,2>UB {align1}; |
||
168 | mov (16) m5.0<1>UB g87.0<16,16,2>UB {align1}; |
||
169 | mov (16) m5.16<1>UB g95.0<16,16,2>UB {align1}; |
||
170 | mov (16) m6.0<1>UB g88.0<16,16,2>UB {align1}; |
||
171 | mov (16) m6.16<1>UB g96.0<16,16,2>UB {align1}; |
||
172 | mov (16) m7.0<1>UB g89.0<16,16,2>UB {align1}; |
||
173 | mov (16) m7.16<1>UB g97.0<16,16,2>UB {align1}; |
||
174 | mov (16) m8.0<1>UB g90.0<16,16,2>UB {align1}; |
||
175 | mov (16) m8.16<1>UB g98.0<16,16,2>UB {align1}; |
||
176 | |||
177 | write_back: |
||
178 | send (16) 0 acc0<1>UW g31<8,8,1>UW write(0,0,2,0) mlen 9 rlen 0 {align1}; |
||
179 | |||
180 | //U |
||
181 | mov (1) g31.8<1>UD 0x0070007UD { align1 }; |
||
182 | shr (2) g31.0<1>UD g82.12<2,2,1>UW 1D {align1}; |
||
183 | mov.sat (16) g99.0<2>UB g99.0<16,16,1>W {align1}; |
||
184 | mov.sat (16) g100.0<2>UB g100.0<16,16,1>W {align1}; |
||
185 | mov.sat (16) g101.0<2>UB g101.0<16,16,1>W {align1}; |
||
186 | mov.sat (16) g102.0<2>UB g102.0<16,16,1>W {align1}; |
||
187 | |||
188 | mov (16) m1.0<1>UB g99.0<16,16,2>UB {align1}; |
||
189 | mov (16) m1.16<1>UB g100.0<16,16,2>UB {align1}; |
||
190 | mov (16) m2.0<1>UB g101.0<16,16,2>UB {align1}; |
||
191 | mov (16) m2.16<1>UB g102.0<16,16,2>UB {align1}; |
||
192 | send (16) 0 acc0<1>UW g31<8,8,1>UW write(1, 0, 2, 0) mlen 3 rlen 0 { align1 }; |
||
193 | |||
194 | //V |
||
195 | mov.sat (16) g103.0<2>UB g103.0<16,16,1>W {align1}; |
||
196 | mov.sat (16) g104.0<2>UB g104.0<16,16,1>W {align1}; |
||
197 | mov.sat (16) g105.0<2>UB g105.0<16,16,1>W {align1}; |
||
198 | mov.sat (16) g106.0<2>UB g106.0<16,16,1>W {align1}; |
||
199 | |||
200 | mov (16) m1.0<1>UB g103.0<16,16,2>UB {align1}; |
||
201 | mov (16) m1.16<1>UB g104.0<16,16,2>UB {align1}; |
||
202 | mov (16) m2.0<1>UB g105.0<16,16,2>UB {align1}; |
||
203 | mov (16) m2.16<1>UB g106.0<16,16,2>UB {align1}; |
||
204 | send (16) 0 acc0<1>UW g31<8,8,1>UW write(2, 0, 2, 0) mlen 3 rlen 0 { align1 }; |
||
205 | |||
206 | OUT: |
||
207 | send (16) 0 acc0<1>UW g0<8,8,1>UW |
||
208 | thread_spawner(0, 0, 0) mlen 1 rlen 0 { align1 EOT}; |
||
209 | |||
210 | include(`do_iq_intra.g4i') |
||
211 | include(`idct.g4i')8,8,1>1>8,8,1>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>8,8,1>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>2,2,1>1>1>8,8,1>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>16,16,2>1>1,1,1>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>16,16,1>2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>16,8,2>1>1>1>1,1,1>1>2,2,1>1>8,8,1>1> |