Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5361 | serge | 1 | /* |
2 | * Copyright 2000-2011 Intel Corporation All Rights Reserved |
||
3 | * |
||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
||
5 | * you may not use this file except in compliance with the License. |
||
6 | * You may obtain a copy of the License at |
||
7 | * |
||
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
||
9 | * |
||
10 | * Unless required by applicable law or agreed to in writing, software |
||
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
13 | * See the License for the specific language governing permissions and |
||
14 | * limitations under the License. |
||
15 | */ |
||
16 | // 20 // Total instruction count |
||
17 | // 1 // Total kernel count |
||
18 | |||
19 | |||
20 | // Module name: common.inc |
||
21 | // |
||
22 | // Common header file for all Video-Processing kernels |
||
23 | // |
||
24 | |||
25 | .default_execution_size (16) |
||
26 | .default_register_type :ub |
||
27 | |||
28 | .reg_count_total 128 |
||
29 | .reg_count_payload 7 |
||
30 | |||
31 | //========== Common constants ========== |
||
32 | |||
33 | |||
34 | //========== Macros ========== |
||
35 | |||
36 | |||
37 | //Fast Jump, For more details see "Set_Layer_N.asm" |
||
38 | |||
39 | |||
40 | //========== Defines ==================== |
||
41 | |||
42 | //========== Static Parameters (Common To All) ========== |
||
43 | //r1 |
||
44 | |||
45 | |||
46 | //r2 |
||
47 | |||
48 | // e.g. byte0 byte1 byte2 |
||
49 | // YUYV 0 1 3 |
||
50 | // YVYU 0 3 1 |
||
51 | |||
52 | //Color Pipe (IECP) parameters |
||
53 | |||
54 | |||
55 | //r4 |
||
56 | |||
57 | // e.g. byte0 byte1 byte2 |
||
58 | // YUYV 0 1 3 |
||
59 | // YVYU 0 3 1 |
||
60 | |||
61 | |||
62 | //========== Inline parameters (Common To All) =========== |
||
63 | |||
64 | |||
65 | //============== Binding Index Table=========== |
||
66 | //Common between DNDI and DNUV |
||
67 | |||
68 | |||
69 | //================= Common Message Descriptor ===== |
||
70 | // Message descriptor for thread spawning |
||
71 | // Message Descriptors |
||
72 | // = 000 0001 (min message len 1 ) 0,0000 (resp len 0 -add later) |
||
73 | // 0000,0000,0000 |
||
74 | // 0001(Spawn a root thread),0001 (Root thread spawn thread) |
||
75 | // = 0x02000011 |
||
76 | // Thread Spawner Message Descriptor |
||
77 | |||
78 | |||
79 | // Message descriptor for atomic operation add |
||
80 | // Message Descriptors |
||
81 | // = 000 0110 (min message len 6 ) 0,0000 (resp len 0 -add later) |
||
82 | // 1(header present)001,10(typed atomic operation)0(return enabled)0(slot group, low 8 bits),0111 (AOP_Add) |
||
83 | // 0000,0000 (Binding table index, added later) |
||
84 | // = 0x02000011 |
||
85 | |||
86 | // Atomic Operation Add Message Descriptor |
||
87 | |||
88 | |||
89 | // Message descriptor for dataport media write |
||
90 | // Message Descriptors |
||
91 | // = 000 0001 (min message len 1 - add later) 00000 (resp len 0) |
||
92 | // 1 (header present 1) 0 1010 (media block write) 000000 |
||
93 | // 00000000 (binding table index - set later) |
||
94 | // = 0x020A8000 |
||
95 | |||
96 | |||
97 | // Message Length defines |
||
98 | |||
99 | |||
100 | // Response Length defines |
||
101 | |||
102 | |||
103 | // Block Width and Height Size defines |
||
104 | |||
105 | |||
106 | // Extended Message Descriptors |
||
107 | |||
108 | |||
109 | // Common message descriptors: |
||
110 | |||
111 | |||
112 | //===================== Math Function Control =================================== |
||
113 | |||
114 | |||
115 | //============ Message Registers =============== |
||
116 | // buf4 starts from r28 |
||
117 | |||
118 | |||
119 | //#define mMSGHDR_EOT r43 // Dummy Message Register for EOT |
||
120 | |||
121 | |||
122 | .declare mubMSGPAYLOAD Base=r30 ElementSize=1 SrcRegion=<16;16,1> Type=ub |
||
123 | .declare muwMSGPAYLOAD Base=r30 ElementSize=2 SrcRegion=<16;16,1> Type=uw |
||
124 | .declare mudMSGPAYLOAD Base=r30 ElementSize=4 SrcRegion=<8;8,1> Type=ud |
||
125 | .declare mfMSGPAYLOAD Base=r30 ElementSize=4 SrcRegion=<8;8,1> Type=f |
||
126 | |||
127 | //=================== End of thread instruction =========================== |
||
128 | |||
129 | |||
130 | //=====================Pointers Used===================================== |
||
131 | |||
132 | |||
133 | //======================================================================= |
||
134 | |||
135 | |||
136 | //r9-r17 |
||
137 | // Define temp space for any usages |
||
138 | |||
139 | |||
140 | // Common Buffers |
||
141 | |||
142 | |||
143 | // End of common.inc |
||
144 | |||
145 | // FileName: DI_Save_NV12_16x4.asm |
||
146 | // Author: Vivek Kumar |
||
147 | // Description: Save two 16x4 blocks of DI output in NV12 format |
||
148 | |||
149 | |||
150 | // FileName: DNDI.inc |
||
151 | // Author: Vivek Kumar |
||
152 | // Description: Include file for DN, DI and DNDI |
||
153 | // Inputs: DI_ENABLE, DN_ENABLE, DN_PLANAR, DN_PACKED |
||
154 | |||
155 | |||
156 | // End of common.inc |
||
157 | |||
158 | |||
159 | //Interface: |
||
160 | //Static Parameters: |
||
161 | //r1 |
||
162 | |||
163 | |||
164 | //====================== Binding table (Explicit To DNDI)========================================= |
||
165 | |||
166 | |||
167 | .declare mudMSGHDR_DNDI Base=r18 ElementSize=4 Type=ud |
||
168 | .declare mdMSGHDR_DNDI Base=r18 ElementSize=4 Type=d |
||
169 | .declare mwMSGHDR_DNDI Base=r18 ElementSize=2 Type=w |
||
170 | |||
171 | |||
172 | .declare mudMSGHDR_STMM Base=r20 ElementSize=4 Type=ud |
||
173 | |||
174 | |||
175 | .declare mudMSGHDR_HIST Base=r22 ElementSize=4 Type=ud |
||
176 | |||
177 | |||
178 | .declare mudMSGHDR_ENC_STATS Base=r24 ElementSize=4 Type=ud |
||
179 | .declare muwMSGHDR_ENC_STATS Base=r24 ElementSize=2 Type=uw |
||
180 | .declare mubMSGHDR_ENC_STATS Base=r24 ElementSize=1 Type=ub |
||
181 | |||
182 | |||
183 | .declare mudMSGHDR_DN_OUT Base=r31.0 ElementSize=4 Type=ud |
||
184 | .declare mdMSGHDR_DN_OUT Base=r31.0 ElementSize=4 Type=d |
||
185 | .declare mubMSGHDR_DN_OUT Base=r31.0 ElementSize=1 Type=ub |
||
186 | |||
187 | |||
188 | .declare mudMSGHDR_UVCOPY Base=r36 ElementSize=4 Type=ud |
||
189 | .declare mdMSGHDR_UVCOPY Base=r36 ElementSize=4 Type=d |
||
190 | .declare mudMSGHDR_UCOPY Base=r36 ElementSize=4 Type=ud |
||
191 | .declare mudMSGHDR_VCOPY Base=r38 ElementSize=4 Type=ud |
||
192 | |||
193 | |||
194 | .declare mudMSGHDR_DI_OUT1 Base=r18.0 ElementSize=4 Type=ud |
||
195 | .declare mubMSGHDR_DI_OUT1 Base=r18.0 ElementSize=1 Type=ub |
||
196 | |||
197 | |||
198 | .declare mudMSGHDR_DI_OUT2 Base=r23.0 ElementSize=4 Type=ud |
||
199 | .declare mubMSGHDR_DI_OUT2 Base=r23.0 ElementSize=1 Type=ub |
||
200 | |||
201 | //r45 |
||
202 | //Use r45 as message header, so no need to "mov" the data. |
||
203 | |||
204 | .declare mudDN_Y_OUT Base=r45.0 ElementSize=4 SrcRegion=<8;8,1> DstRegion=<1> Type=ud |
||
205 | |||
206 | // Message response (Denoised & DI-ed pixels & statistics); Use buffer 5 |
||
207 | .declare udDNDI_RESP Base=r46.0 ElementSize=4 SrcRegion=<8;8,1> DstRegion=<1> Type=ud |
||
208 | .declare uwDNDI_RESP Base=r46.0 ElementSize=2 SrcRegion=<16;16,1> DstRegion=<1> Type=uw |
||
209 | .declare ubDNDI_RESP Base=r46.0 ElementSize=1 SrcRegion=<16;16,1> DstRegion=<1> Type=ub |
||
210 | |||
211 | // Message response (UV Copy); Use buffer 5 |
||
212 | .declare udDNDI_UV_RESP Base=r58.0 ElementSize=4 SrcRegion=<8;8,1> DstRegion=<1> Type=ud |
||
213 | .declare ubDNDI_UV_RESP Base=r58.0 ElementSize=1 SrcRegion=<16;16,1> DstRegion=<1> Type=ub |
||
214 | |||
215 | //Temp GRFs: For 42X to 422 Conversion |
||
216 | .declare uwDNDI_UVCOPY_TEMP Base=r10.0 ElementSize=2 SrcRegion=<16;16,1> DstRegion=<1> Type=uw //8 GRFs |
||
217 | .declare ubDNDI_UVCOPY_TEMP Base=r10.0 ElementSize=1 SrcRegion=<16;16,1> DstRegion=<1> Type=ub //8 GRFs |
||
218 | //--------------------------------------------------------------------------- |
||
219 | // Message descriptors |
||
220 | //--------------------------------------------------------------------------- |
||
221 | // Extended message descriptor |
||
222 | // Message descriptor for sampler read |
||
223 | // = 000 0010 (message len 2) 00000 (resp len - set later, 12 or 5 or 11) |
||
224 | // 1 (header present 1) 0 11 (SIMD32/64 mode) |
||
225 | // 1000 (message type) 0000 (DI state index) |
||
226 | // 00000000 (binding table index - set later) |
||
227 | // = 0x040b8000 |
||
228 | |||
229 | |||
230 | // Attention: The Message Length is The Number of GRFs with Data Only, without the Header |
||
231 | |||
232 | |||
233 | //--------------------------------------------------------------------------- |
||
234 | // VDI Return Data format |
||
235 | //--------------------------------------------------------------------------- |
||
236 | // Defines for DI enabled |
||
237 | |||
238 | |||
239 | // Defines for DI disabled |
||
240 | |||
241 | |||
242 | mov (2) r27.0<1>:d r7.0<2;2,1>:w { NoDDClr } |
||
243 | mov (1) r27.2<1>:ud 0x3000F:ud { NoDDChk } // Block width and height (16x4) |
||
244 | |||
245 | //Bottom field Y |
||
246 | mov (8) mudMSGHDR_DI_OUT1(1)<1> udDNDI_RESP(0,0) |
||
247 | mov (8) mudMSGHDR_DI_OUT1(2)<1> udDNDI_RESP(0,8) |
||
248 | // Top field Y |
||
249 | mov (8) mudMSGHDR_DI_OUT2(1)<1> udDNDI_RESP(4,0) |
||
250 | mov (8) mudMSGHDR_DI_OUT2(2)<1> udDNDI_RESP(4,8) |
||
251 | |||
252 | //copy message desrcptor to the message header |
||
253 | mov (8) r18.0<1>:ud r27<8;8,1>:ud |
||
254 | mov (8) r23.0<1>:ud r27<8;8,1>:ud |
||
255 | |||
256 | //Change origin to U/V block |
||
257 | asr (1) r27.1<1>:d r27.1<0;1,0>:d 1:w { NoDDClr } // U/V block origin should be half of Y's |
||
258 | mov (1) r27.2<1>:ud 0x1000F:ud { NoDDChk } // Block width and height (16x2) |
||
259 | |||
260 | // Bottom field U/V |
||
261 | mov (16) r21.0<2>:ub ubDNDI_RESP(2, 1)<32;8,2> { NoDDClr } |
||
262 | mov (16) r21.1<2>:ub ubDNDI_RESP(2, 0)<32;8,2> { NoDDChk } |
||
263 | |||
264 | // Top field U/V |
||
265 | mov (16) r26.0<2>:ub ubDNDI_RESP(6, 1)<32;8,2> { NoDDClr } |
||
266 | mov (16) r26.1<2>:ub ubDNDI_RESP(6, 0)<32;8,2> { NoDDChk } |
||
267 | |||
268 | //copy message desrcptor to the message header |
||
269 | mov (8) r21<1>:ud r27<8;8,1>:ud |
||
270 | mov (8) r26<1>:ud r27<8;8,1>:ud |
||
271 | |||
272 | //Send out Y component on previous frame to surface |
||
273 | send (8) null<1>:d r18.0 0x5 0x60A801B:ud |
||
274 | //Send out Y component on current frame to surface |
||
275 | send (8) null<1>:d r23.0 0x5 0x60A801E:ud |
||
276 | //Send out U/V component on previous frame to surface |
||
277 | send (8) null<1>:d r21 0x5 0x40A801C:ud |
||
278 | //Send out U/V component on current frame to surface |
||
279 | send (8) null<1>:d r26 0x5 0x40A801F:ud1>1>1>1>8;8,1>1>8;8,1>1>32;8,2>2>32;8,2>2>32;8,2>2>32;8,2>2>1>0;1,0>1>8;8,1>1>8;8,1>1>1>1>1>1>1>2;2,1>1>1>16;16,1>1>16;16,1>1>16;16,1>1>8;8,1>1>16;16,1>1>16;16,1>1>8;8,1>1>8;8,1>8;8,1>8;8,1>16;16,1>16;16,1> |