1fa225cbcSrjs/*
2fa225cbcSrjs * Copyright © 2009 Intel Corporation
3fa225cbcSrjs *
4fa225cbcSrjs * Permission is hereby granted, free of charge, to any person obtaining a
5fa225cbcSrjs * copy of this software and associated documentation files (the "Software"),
6fa225cbcSrjs * to deal in the Software without restriction, including without limitation
7fa225cbcSrjs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8fa225cbcSrjs * and/or sell copies of the Software, and to permit persons to whom the
9fa225cbcSrjs * Software is furnished to do so, subject to the following conditions:
10fa225cbcSrjs *
11fa225cbcSrjs * The above copyright notice and this permission notice (including the next
12fa225cbcSrjs * paragraph) shall be included in all copies or substantial portions of the
13fa225cbcSrjs * Software.
14fa225cbcSrjs *
15fa225cbcSrjs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16fa225cbcSrjs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17fa225cbcSrjs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18fa225cbcSrjs * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19fa225cbcSrjs * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20fa225cbcSrjs * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21fa225cbcSrjs * SOFTWARE.
22fa225cbcSrjs *
23fa225cbcSrjs * Author:
24fa225cbcSrjs *    Zou Nan hai <nanhai.zou@intel.com>
25fa225cbcSrjs *    Yan Li <li.l.yan@intel.com>
26fa225cbcSrjs *    Liu Xi bin<xibin.liu@intel.com>
27fa225cbcSrjs */
28fa225cbcSrjs/* GRF allocation:
29fa225cbcSrjs   g1~g30: constant buffer
30fa225cbcSrjs           g1~g2:intra IQ matrix
31fa225cbcSrjs           g3~g4:non intra IQ matrix
32fa225cbcSrjs           g5~g20:IDCT table
33fa225cbcSrjs   g31:    thread payload 
34fa225cbcSrjs   g32:    message descriptor for reading reference data
35fa225cbcSrjs   g58~g81:reference data
36fa225cbcSrjs   g82:    thread payload backup
37fa225cbcSrjs   g83~g106:IDCT data                           */
38fa225cbcSrjsmov (8) g82.0<1>UD g31.0<8,8,1>UD {align1};
39fa225cbcSrjsmov(2) g31.0<1>UD g82.12<2,2,1>UW {align1};
40fa225cbcSrjsmov (1) g126.8<1>UD ip {align1};
41fa225cbcSrjsmov (1) ip g21.0<1,1,1>UD {align1};
42fa225cbcSrjs 
43fa225cbcSrjs//Y, (x', y') = (x, y) + (motion_vector.x >> 1, motion_vector.y >> 1) 
44fa225cbcSrjsasr (2) g31.14<1>W g82.20<2,2,1>W 1W {align1};
45fa225cbcSrjsadd (2) g32.0<1>UD g31.0<2,2,1>UD g31.14<2,2,1>W {align1};
46fa225cbcSrjsdefine(`input_surface',	`7')
47fa225cbcSrjsdefine(`mv1',	`g82.20')
48fa225cbcSrjsdefine(`mv2',	`g82.22') 
49fa225cbcSrjsinclude(`motion_frame_y.g4i')
50fa225cbcSrjs
51fa225cbcSrjs//UV, (x', y') = (x >> 1, y >> 1) + (motion_vector.x >> 2, motion_vector.y >> 2)
52fa225cbcSrjsshr (2) g31.0<1>UD g31.0<2,2,1>UD 1UD {align1};
53fa225cbcSrjsasr (2) g31.14<1>W g82.20<2,2,1>W 2W {align1};
54fa225cbcSrjsadd (2) g32.0<1>UD g31.0<2,2,1>UD g31.14<2,2,1>W {align1};
55fa225cbcSrjsdefine(`input_surface1', `8')
56fa225cbcSrjsdefine(`input_surface2', `9')
57fa225cbcSrjsinclude(`motion_frame_uv.g4i')
58fa225cbcSrjs
59fa225cbcSrjsinclude(`addidct.g4i')
60fa225cbcSrjssend (16) 0 acc0<1>UW g0<8,8,1>UW 
61fa225cbcSrjs	thread_spawner(0, 0, 0) mlen 1 rlen 0 { align1 EOT};
62