Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6146 | serge | 1 | /* |
2 | * Copyright © <2010>, 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 |
||
6 | * "Software"), to deal in the Software without restriction, including |
||
7 | * without limitation the rights to use, copy, modify, merge, publish, |
||
8 | * distribute, sub license, and/or sell copies of the Software, and to |
||
9 | * permit persons to whom the Software is furnished to do so, subject to |
||
10 | * the following conditions: |
||
11 | * |
||
12 | * The above copyright notice and this permission notice (including the |
||
13 | * next paragraph) shall be included in all copies or substantial portions |
||
14 | * of the Software. |
||
15 | * |
||
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
||
17 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
||
19 | * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR |
||
20 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||
21 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||
22 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||
23 | * |
||
24 | */ |
||
25 | // Modual name: ME_header.inc for Gen8 |
||
26 | // |
||
27 | // Global symbols define |
||
28 | // |
||
29 | |||
30 | /* |
||
31 | * Constant |
||
32 | */ |
||
33 | define(`VME_MESSAGE_TYPE_INTER', `1') |
||
34 | define(`VME_MESSAGE_TYPE_INTRA', `2') |
||
35 | define(`VME_MESSAGE_TYPE_MIXED', `3') |
||
36 | |||
37 | define(`VME_SIC_MESSAGE_TYPE', `1') |
||
38 | define(`VME_IME_MESSAGE_TYPE', `2') |
||
39 | define(`VME_FBR_MESSAGE_TYPE', `3') |
||
40 | |||
41 | define(`BLOCK_32X1', `0x0000001F') |
||
42 | define(`BLOCK_4X16', `0x000F0003') |
||
43 | define(`BLOCK_8X4', `0x00070003') |
||
44 | |||
45 | define(`LUMA_INTRA_16x16_DISABLE', `0x1') |
||
46 | define(`LUMA_INTRA_8x8_DISABLE', `0x2') |
||
47 | define(`LUMA_INTRA_4x4_DISABLE', `0x4') |
||
48 | |||
49 | define(`SUB_PART_8x4_DISABLE', `0x10') |
||
50 | define(`SUB_PART_4x8_DISABLE', `0x20') |
||
51 | |||
52 | define(`INTRA_PRED_AVAIL_FLAG_AE', `0x60') |
||
53 | define(`INTRA_PRED_AVAIL_FLAG_B', `0x10') |
||
54 | define(`INTRA_PRED_AVAIL_FLAG_C', `0x8') |
||
55 | define(`INTRA_PRED_AVAIL_FLAG_D', `0x4') |
||
56 | |||
57 | define(`BIND_IDX_VME', `0') |
||
58 | define(`BIND_IDX_VME_REF0', `1') |
||
59 | define(`BIND_IDX_VME_REF1', `2') |
||
60 | define(`BIND_IDX_OUTPUT', `3') |
||
61 | define(`BIND_IDX_INEP', `4') |
||
62 | |||
63 | define(`SUB_PEL_MODE_INTEGER', `0x00000000') |
||
64 | define(`SUB_PEL_MODE_HALF', `0x00001000') |
||
65 | define(`SUB_PEL_MODE_QUARTER', `0x00003000') |
||
66 | |||
67 | define(`INTER_SAD_NONE', `0x00000000') |
||
68 | define(`INTER_SAD_HAAR', `0x00200000') |
||
69 | |||
70 | define(`INTRA_SAD_NONE', `0x00000000') |
||
71 | define(`INTRA_SAD_HAAR', `0x00800000') |
||
72 | |||
73 | define(`INTER_PART_MASK', `0x00000000') |
||
74 | define(`VP8_INTER_PART_MASK', `0x7e000000') |
||
75 | |||
76 | define(`SEARCH_CTRL_SINGLE', `0x00000000') |
||
77 | define(`SEARCH_CTRL_DUAL_START', `0x00000100') |
||
78 | define(`SEARCH_CTRL_DUAL_RECORD', `0x00000300') |
||
79 | define(`SEARCH_CTRL_DUAL_REFERENCE', `0x00000700') |
||
80 | |||
81 | define(`REF_REGION_SIZE', `0x2830:UW') |
||
82 | define(`MIN_REF_REGION_SIZE', `0x2020:UW') |
||
83 | define(`DREF_REGION_SIZE', `0x2020:UW') |
||
84 | |||
85 | define(`BI_SUB_MB_PART_MASK', `0x0c000000') |
||
86 | define(`MAX_NUM_MV', `0x00000020') |
||
87 | define(`FB_PRUNING_ENABLE', `0x40000000') |
||
88 | |||
89 | define(`SEARCH_PATH_LEN', `0x00003030') |
||
90 | define(`START_CENTER', `0x30000000') |
||
91 | |||
92 | define(`ADAPTIVE_SEARCH_ENABLE', `0x00000002') |
||
93 | define(`INTRA_PREDICTORE_MODE', `0x11111111:UD') |
||
94 | |||
95 | define(`INTRA_PLANAR_MODE_MASK', `0x10001000:UD') |
||
96 | |||
97 | define(`INTER_VME_OUTPUT_IN_OWS', `10') |
||
98 | define(`INTER_VME_OUTPUT_MV_IN_OWS', `8') |
||
99 | |||
100 | define(`INTRAMBFLAG_MASK', `0x00002000') |
||
101 | define(`MVSIZE_UW_BASE', `0x0040') |
||
102 | define(`MFC_MV32_BIT_SHIFT', `5') |
||
103 | define(`CBP_DC_YUV_UW', `0x000E') |
||
104 | |||
105 | define(`DC_HARR_ENABLE', `0x0000') |
||
106 | define(`DC_HARR_DISABLE', `0x0020') |
||
107 | |||
108 | define(`MV32_BIT_MASK', `0x0020') |
||
109 | define(`MV32_BIT_SHIFT', `5') |
||
110 | |||
111 | define(`OBW_CACHE_TYPE', `10') |
||
112 | |||
113 | |||
114 | define(`OBW_MESSAGE_TYPE', `8') |
||
115 | |||
116 | define(`OBW_BIND_IDX', `BIND_IDX_OUTPUT') |
||
117 | |||
118 | define(`OBW_CONTROL_0', `0') /* 1 OWord, low 128 bits */ |
||
119 | define(`OBW_CONTROL_1', `1') /* 1 OWord, high 128 bits */ |
||
120 | define(`OBW_CONTROL_2', `2') /* 2 OWords */ |
||
121 | define(`OBW_CONTROL_3', `3') /* 4 OWords */ |
||
122 | define(`OBW_CONTROL_8', `4') /* 8 OWords */ |
||
123 | |||
124 | define(`FBR_BME_ENABLE', `0x00000000') |
||
125 | define(`FBR_BME_DISABLE', `0x00040000') |
||
126 | |||
127 | define(`OBW_WRITE_COMMIT_CATEGORY', `0') /* category on Ivybridge */ |
||
128 | |||
129 | |||
130 | define(`OBW_HEADER_PRESENT', `1') |
||
131 | |||
132 | /* GRF registers |
||
133 | * r0 header |
||
134 | * r1~r4 constant buffer (reserved) |
||
135 | * r5 inline data |
||
136 | * r6~r11 reserved |
||
137 | * r12 write back of VME message |
||
138 | * r13 write back of Oword Block Write |
||
139 | */ |
||
140 | /* |
||
141 | * GRF 0 -- header |
||
142 | */ |
||
143 | define(`thread_id_ub', `r0.20<0,1,0>:UB') /* thread id in payload */ |
||
144 | |||
145 | /* |
||
146 | * GRF 1~4 -- Constant Buffer (reserved) |
||
147 | */ |
||
148 | |||
149 | /* |
||
150 | * GRF 5 -- inline data |
||
151 | */ |
||
152 | define(`inline_reg0', `r5') |
||
153 | define(`w_in_mb_uw', `inline_reg0.2') |
||
154 | define(`orig_xy_ub', `inline_reg0.0') |
||
155 | define(`orig_x_ub', `inline_reg0.0') /* in macroblock */ |
||
156 | define(`orig_y_ub', `inline_reg0.1') |
||
157 | define(`transform_8x8_ub', `inline_reg0.4') |
||
158 | define(`input_mb_intra_ub', `inline_reg0.5') |
||
159 | define(`num_macroblocks', `inline_reg0.6') |
||
160 | define(`quality_level_ub', `inline_reg0.7') |
||
161 | |||
162 | /* |
||
163 | * GRF 6~11 -- reserved |
||
164 | */ |
||
165 | |||
166 | /* |
||
167 | * GRF 12~15 -- write back for VME message |
||
168 | */ |
||
169 | define(`vme_wb', `r12') |
||
170 | define(`vme_wb0', `r12') |
||
171 | define(`vme_wb1', `r13') |
||
172 | define(`vme_wb2', `r14') |
||
173 | define(`vme_wb3', `r15') |
||
174 | define(`vme_wb4', `r16') |
||
175 | define(`vme_wb5', `r17') |
||
176 | define(`vme_wb6', `r18') |
||
177 | define(`vme_ime_wb7', `r19') |
||
178 | define(`vme_ime_wb8', `r20') |
||
179 | define(`vme_ime_wb9', `r21') |
||
180 | define(`vme_ime_wb10', `r22') |
||
181 | |||
182 | |||
183 | /* |
||
184 | * GRF 24 -- write for VME output message |
||
185 | */ |
||
186 | define(`obw_wb', `null<1>:W') |
||
187 | define(`obw_wb_length', `0') |
||
188 | |||
189 | |||
190 | /* |
||
191 | * GRF 28~30 -- Intra Neighbor Edge Pixels |
||
192 | */ |
||
193 | define(`INEP_ROW', `r28') |
||
194 | define(`INEP_COL0', `r29') |
||
195 | define(`INEP_COL1', `r30') |
||
196 | |||
197 | /* |
||
198 | * GRF 48~50 -- Chroma Neighbor Edge Pixels |
||
199 | */ |
||
200 | define(`CHROMA_ROW', `r48') |
||
201 | define(`CHROMA_COL', `r49') |
||
202 | |||
203 | /* |
||
204 | * temporary registers |
||
205 | */ |
||
206 | define(`tmp_reg0', `r32') |
||
207 | define(`read0_header', `tmp_reg0') |
||
208 | define(`tmp_reg1', `r33') |
||
209 | define(`read1_header', `tmp_reg1') |
||
210 | define(`tmp_reg2', `r34') |
||
211 | define(`vme_m0', `tmp_reg2') |
||
212 | define(`tmp_reg3', `r35') |
||
213 | define(`vme_m1', `tmp_reg3') |
||
214 | define(`intra_flag', `vme_m1.28') |
||
215 | define(`intra_part_mask_ub', `vme_m1.28') |
||
216 | define(`mb_intra_struct_ub', `vme_m1.29') |
||
217 | define(`tmp_reg4', `r36') |
||
218 | define(`obw_m0', `tmp_reg4') |
||
219 | define(`tmp_reg5', `r37') |
||
220 | define(`obw_m1', `tmp_reg5') |
||
221 | define(`tmp_reg6', `r38') |
||
222 | define(`obw_m2', `tmp_reg6') |
||
223 | define(`tmp_reg7', `r39') |
||
224 | define(`obw_m3', `tmp_reg7') |
||
225 | define(`tmp_reg8', `r40') |
||
226 | define(`obw_m4', `tmp_reg8') |
||
227 | define(`tmp_reg9', `r41') |
||
228 | define(`tmp_x_w', `tmp_reg9.0') |
||
229 | define(`tmp_rega', `r42') |
||
230 | define(`tmp_ud0', `tmp_rega.0') |
||
231 | define(`tmp_ud1', `tmp_rega.4') |
||
232 | define(`tmp_ud2', `tmp_rega.8') |
||
233 | define(`tmp_ud3', `tmp_rega.12') |
||
234 | define(`tmp_uw0', `tmp_rega.0') |
||
235 | define(`tmp_uw1', `tmp_rega.2') |
||
236 | define(`tmp_uw2', `tmp_rega.4') |
||
237 | define(`tmp_uw3', `tmp_rega.6') |
||
238 | define(`tmp_uw4', `tmp_rega.8') |
||
239 | define(`tmp_uw5', `tmp_rega.10') |
||
240 | define(`tmp_uw6', `tmp_rega.12') |
||
241 | define(`tmp_uw7', `tmp_rega.14') |
||
242 | |||
243 | define(`vme_m2', `r43') |
||
244 | define(`vme_m3', `r44') |
||
245 | /* |
||
246 | * MRF registers |
||
247 | */ |
||
248 | |||
249 | define(`msg_ind', `64') |
||
250 | define(`msg_reg0', `r64') |
||
251 | define(`msg_reg1', `r65') |
||
252 | define(`msg_reg2', `r66') |
||
253 | define(`msg_reg3', `r67') |
||
254 | define(`msg_reg4', `r68') |
||
255 | define(`msg_reg5', `r69') |
||
256 | define(`msg_reg6', `r70') |
||
257 | define(`msg_reg7', `r71') |
||
258 | define(`msg_reg8', `r72') |
||
259 | define(`msg_reg9', `r73') |
||
260 | |||
261 | define(`ts_msg_ind', `112') |
||
262 | define(`ts_msg_reg0', `r112') |
||
263 | /* |
||
264 | * VME message payload |
||
265 | */ |
||
266 | |||
267 | define(`vme_intra_wb_length', `1') |
||
268 | define(`vme_wb_length', `7') |
||
269 | define(`sic_vme_msg_length', `8') |
||
270 | define(`fbr_vme_msg_length', `8') |
||
271 | define(`ime_vme_msg_length', `6') |
||
272 | |||
273 | define(`vme_msg_ind', `msg_ind') |
||
274 | define(`vme_msg_0', `msg_reg0') |
||
275 | define(`vme_msg_1', `msg_reg1') |
||
276 | define(`vme_msg_2', `msg_reg2') |
||
277 | |||
278 | define(`vme_msg_3', `msg_reg3') |
||
279 | define(`vme_msg_4', `msg_reg4') |
||
280 | |||
281 | |||
282 | define(`vme_msg_5', `msg_reg5') |
||
283 | define(`vme_msg_6', `msg_reg6') |
||
284 | define(`vme_msg_7', `msg_reg7') |
||
285 | define(`vme_msg_8', `msg_reg8') |
||
286 | define(`vme_msg_9', `msg_reg9') |
||
287 | |||
288 | define(`BIND_IDX_CBCR', `6') |
||
289 | |||
290 | |||
291 | define(`LUMA_CHROMA_MODE', `0x0') |
||
292 | define(`LUMA_INTRA_MODE', `0x1') |
||
293 | define(`LUMA_INTRA_DISABLE', `0x2') |
||
294 | |||
295 | define(`RETURN_REG', `r127.0') |
||
296 | define(`RET_ARG', `r127.4') |
||
297 | |||
298 | /* Now at most two registers are used for input parameter */ |
||
299 | define(`INPUT_ARG0', `r125') |
||
300 | define(`INPUT_ARG1', `r126') |
||
301 | |||
302 | /* Two temporal registers are used in the function */ |
||
303 | define(`TEMP_VAR0', `r123') |
||
304 | define(`TEMP_VAR1', `r124') |
||
305 | |||
306 | |||
307 | define(`OBR_MESSAGE_TYPE', `0') |
||
308 | define(`OBR_CACHE_TYPE', `10') |
||
309 | define(`OBR_BIND_IDX', `BIND_IDX_OUTPUT') |
||
310 | |||
311 | define(`OBR_CONTROL_0', `0') /* 1 OWord, low 128 bits */ |
||
312 | define(`OBR_CONTROL_1', `1') /* 1 OWord, high 128 bits */ |
||
313 | define(`OBR_CONTROL_2', `2') /* 2 OWords */ |
||
314 | define(`OBR_CONTROL_4', `3') /* 4 OWords */ |
||
315 | define(`OBR_CONTROL_8', `4') /* 8 OWords */ |
||
316 | define(`OBR_WRITE_COMMIT_CATEGORY', `0') /* category on SNB+ for Data port */ |
||
317 | define(`OBR_HEADER_PRESENT', `1') |
||
318 | |||
319 | define(`mb_hwdep', `r5.6') |
||
320 | define(`MB_AVAIL', `1:d') |
||
321 | define(`MB_PRED_FLAG', `1:w') |
||
322 | |||
323 | define(`mb_pred_mode', `r85') |
||
324 | define(`mb_mvp_ref', `r86') |
||
325 | define(`mba_result', `r87') |
||
326 | define(`mbb_result', `r88') |
||
327 | define(`mbc_result', `r89') |
||
328 | define(`mb_ind', `90') |
||
329 | define(`mb_msg0', `r90') |
||
330 | define(`mb_wb', `r91') |
||
331 | define(`mb_intra_wb', `r91') |
||
332 | define(`mb_inter_wb', `r92') |
||
333 | define(`mb_mv0', `r93') |
||
334 | define(`mb_mv1', `r94') |
||
335 | define(`mb_mv2', `r95') |
||
336 | define(`mb_mv3', `r96') |
||
337 | define(`mb_ref', `r97') |
||
338 | define(`mb_ref_win', `r84') |
||
339 | |||
340 | define(`PRED_L0', `0x0':uw) |
||
341 | define(`PRED_L1', `0x1':uw) |
||
342 | define(`PRED_BI', `0x2':uw) |
||
343 | define(`PRED_DIRECT', `0x3':uw) |
||
344 | define(`PRED_MASK', `0x3':uw) |
||
345 | |||
346 | /* The MAX search len per reference is 16 */ |
||
347 | define(`DSEARCH_PATH_LEN', `0x00001212') |
||
348 | define(`BI_WEIGHT', `0x20':uw) |
||
349 | define(`DSTART_CENTER', `0x00000000') |
||
350 | define(`INTER_MASK', `0x03') |
||
351 | define(`INTER_16X16MODE', `0x0') |
||
352 | define(`INTER_16X8MODE', `0x01') |
||
353 | define(`INTER_8X16MODE', `0x02') |
||
354 | define(`INTER_8X8MODE', `0x03') |
||
355 | define(`INTER_BLOCK0', `0x0') |
||
356 | define(`INTER_BLOCK1', `0x1') |
||
357 | define(`INTER_BLOCK2', `0x2') |
||
358 | define(`INTER_BLOCK3', `0x3') |
||
359 | define(`INTER_16X8MODE', `0x01') |
||
360 | define(`INTER_8X16MODE', `0x02') |
||
361 | |||
362 | |||
363 | define(`OBR_MESSAGE_FENCE', `7') |
||
364 | define(`OBR_MF_NOCOMMIT', `0') |
||
365 | define(`OBR_MF_COMMIT', `0x20') |
||
366 | |||
367 | define(`DEFAULT_QUALITY_LEVEL', `0x01') |
||
368 | define(`HIGH_QUALITY_LEVEL', `DEFAULT_QUALITY_LEVEL') |
||
369 | define(`LOW_QUALITY_LEVEL', `0x02')1>0,1,0>2010> |