103b705cfSriastradh/*
203b705cfSriastradh * Copyright © 2009 Intel Corporation
303b705cfSriastradh *
403b705cfSriastradh * Permission is hereby granted, free of charge, to any person obtaining a
503b705cfSriastradh * copy of this software and associated documentation files (the "Software"),
603b705cfSriastradh * to deal in the Software without restriction, including without limitation
703b705cfSriastradh * the rights to use, copy, modify, merge, publish, distribute, sublicense,
803b705cfSriastradh * and/or sell copies of the Software, and to permit persons to whom the
903b705cfSriastradh * Software is furnished to do so, subject to the following conditions:
1003b705cfSriastradh *
1103b705cfSriastradh * The above copyright notice and this permission notice (including the next
1203b705cfSriastradh * paragraph) shall be included in all copies or substantial portions of the
1303b705cfSriastradh * Software.
1403b705cfSriastradh *
1503b705cfSriastradh * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1603b705cfSriastradh * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1703b705cfSriastradh * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1803b705cfSriastradh * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1903b705cfSriastradh * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2003b705cfSriastradh * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2103b705cfSriastradh * SOFTWARE.
2203b705cfSriastradh *
2303b705cfSriastradh * Author:
2403b705cfSriastradh *    Zou Nan hai <nanhai.zou@intel.com>
2503b705cfSriastradh *    Yan Li <li.l.yan@intel.com>
2603b705cfSriastradh *    Liu Xi bin<xibin.liu@intel.com>
2703b705cfSriastradh */
2803b705cfSriastradh/* GRF allocation:
2903b705cfSriastradh   g1~g30: constant buffer
3003b705cfSriastradh           g1~g2:intra IQ matrix
3103b705cfSriastradh           g3~g4:non intra IQ matrix
3203b705cfSriastradh           g5~g20:IDCT table
3303b705cfSriastradh   g31:    thread payload 
3403b705cfSriastradh   g58~g81:reference data
3503b705cfSriastradh   g82:    thread payload backup
3603b705cfSriastradh   g83~g106:IDCT data
3703b705cfSriastradh   g115:   message descriptor for reading reference data   */
3803b705cfSriastradhmov (8) g82.0<1>UD g31.0<8,8,1>UD {align1};
3903b705cfSriastradhmov (2) g31.0<1>UD g82.12<2,2,1>UW {align1};
4003b705cfSriastradhmov (1) g126.8<1>UD ip {align1};
4103b705cfSriastradhmov (1) ip g21.0<1,1,1>UD {align1};
4203b705cfSriastradh
4303b705cfSriastradh/*field 0 of Y*/
4403b705cfSriastradhasr (2) g31.14<1>W g82.16<2,2,1>W 1W {align1};
4503b705cfSriastradhshl (1) g31.16<1>W g31.16<1,1,1>W 1W {align1};
4603b705cfSriastradhadd (2) g115.0<1>UD g31.0<2,2,1>UD g31.14<2,2,1>W {align1};
4703b705cfSriastradhand (1) g115.4<1>UD g115.4<1,1,1>UD 0xFFFFFFFEUD {align1};
4803b705cfSriastradhand.nz (1) null g82.2<1,1,1>UW 0x1000UW {align1};             //motion vertical field select
4903b705cfSriastradh(f0) add (1) g115.4<1>UD g115.4<1,1,1>UD 1UD {align1};
5003b705cfSriastradhdefine(`surface',`4')
5103b705cfSriastradhdefine(`mv1',`g82.16')
5203b705cfSriastradhdefine(`mv2',`g82.18')
5303b705cfSriastradhinclude(`motion_field_y.g4i')
5403b705cfSriastradhmov (8) g58.0<1>UD g32.0<8,8,1>UD {align1};
5503b705cfSriastradhmov (8) g60.0<1>UD g33.0<8,8,1>UD {align1};
5603b705cfSriastradhmov (8) g62.0<1>UD g34.0<8,8,1>UD {align1};
5703b705cfSriastradhmov (8) g64.0<1>UD g35.0<8,8,1>UD {align1};
5803b705cfSriastradhmov (8) g66.0<1>UD g36.0<8,8,1>UD {align1};
5903b705cfSriastradhmov (8) g68.0<1>UD g37.0<8,8,1>UD {align1};
6003b705cfSriastradhmov (8) g70.0<1>UD g38.0<8,8,1>UD {align1};
6103b705cfSriastradhmov (8) g72.0<1>UD g39.0<8,8,1>UD {align1};
6203b705cfSriastradh
6303b705cfSriastradh/*field 1 of Y*/
6403b705cfSriastradhasr (2) g31.14<1>W g82.24<2,2,1>W 1W {align1};
6503b705cfSriastradhshl (1) g31.16<1>W g31.16<1,1,1>W 1W {align1};
6603b705cfSriastradhadd (2) g115.0<1>UD g31.0<2,2,1>UD g31.14<2,2,1>W {align1};
6703b705cfSriastradhand (1) g115.4<1>UD g115.4<1,1,1>UD 0xFFFFFFFEUD {align1};
6803b705cfSriastradhand.nz (1) null g82.2<1,1,1>UW 0x4000UW {align1};
6903b705cfSriastradh(f0) add (1) g115.4<1>UD g115.4<1,1,1>UD 1UD {align1};
7003b705cfSriastradhdefine(`surface',`4')
7103b705cfSriastradhdefine(`mv1',`g82.24')
7203b705cfSriastradhdefine(`mv2',`g82.26')
7303b705cfSriastradhinclude(`motion_field_y.g4i')
7403b705cfSriastradhmov (8) g59.0<1>UD g32.0<8,8,1>UD {align1};
7503b705cfSriastradhmov (8) g61.0<1>UD g33.0<8,8,1>UD {align1};
7603b705cfSriastradhmov (8) g63.0<1>UD g34.0<8,8,1>UD {align1};
7703b705cfSriastradhmov (8) g65.0<1>UD g35.0<8,8,1>UD {align1};
7803b705cfSriastradhmov (8) g67.0<1>UD g36.0<8,8,1>UD {align1};
7903b705cfSriastradhmov (8) g69.0<1>UD g37.0<8,8,1>UD {align1};
8003b705cfSriastradhmov (8) g71.0<1>UD g38.0<8,8,1>UD {align1};
8103b705cfSriastradhmov (8) g73.0<1>UD g39.0<8,8,1>UD {align1};
8203b705cfSriastradh
8303b705cfSriastradh/*field 0 of UV*/
8403b705cfSriastradhshr (2) g31.0<1>UD g31.0<2,2,1>UD 1UD {align1};
8503b705cfSriastradhasr (2) g82.16<1>W g82.16<2,2,1>W 1W {align1};
8603b705cfSriastradhasr (2) g31.14<1>W g82.16<2,2,1>W 1W {align1};
8703b705cfSriastradhshl (1) g31.16<1>W g31.16<1,1,1>W 1W {align1};
8803b705cfSriastradhadd (2) g115.0<1>UD g31.0<2,2,1>UD g31.14<2,2,1>W {align1};
8903b705cfSriastradhand (1) g115.4<1>UD g115.4<1,1,1>UD 0xFFFFFFFEUD {align1};
9003b705cfSriastradhand.nz (1) null g82.2<1,1,1>UW 0x1000UW {align1};
9103b705cfSriastradh(f0) add (1) g115.4<1>UD g115.4<1,1,1>UD 1UD {align1};
9203b705cfSriastradhdefine(`surface_u', `5')
9303b705cfSriastradhdefine(`surface_v', `6')
9403b705cfSriastradhdefine(`mv1',`g82.16')
9503b705cfSriastradhdefine(`mv2',`g82.18')
9603b705cfSriastradhinclude(`motion_field_uv.g4i')
9703b705cfSriastradhmov (8) g74.0<1>UW g32.0<8,8,1>UW {align1};
9803b705cfSriastradhmov (8) g75.0<1>UW g33.0<8,8,1>UW {align1};
9903b705cfSriastradhmov (8) g76.0<1>UW g34.0<8,8,1>UW {align1};
10003b705cfSriastradhmov (8) g77.0<1>UW g35.0<8,8,1>UW {align1};
10103b705cfSriastradhmov (8) g78.0<1>UW g36.0<8,8,1>UW {align1};
10203b705cfSriastradhmov (8) g79.0<1>UW g37.0<8,8,1>UW {align1};
10303b705cfSriastradhmov (8) g80.0<1>UW g38.0<8,8,1>UW {align1};
10403b705cfSriastradhmov (8) g81.0<1>UW g39.0<8,8,1>UW {align1};
10503b705cfSriastradh
10603b705cfSriastradh/*field 1 of UV*/
10703b705cfSriastradhasr (2) g82.24<1>W g82.24<2,2,1>W 1W {align1};
10803b705cfSriastradhasr (2) g31.14<1>W g82.24<2,2,1>W 1W {align1};
10903b705cfSriastradhshl (1) g31.16<1>W g31.16<1,1,1>W 1W {align1};
11003b705cfSriastradhadd (2) g115.0<1>UD g31.0<2,2,1>UD g31.14<2,2,1>W {align1};
11103b705cfSriastradhand (1) g115.4<1>UD g115.4<1,1,1>UD 0xFFFFFFFEUD {align1};
11203b705cfSriastradhand.nz (1) null g82.2<1,1,1>UW 0x4000UW {align1};
11303b705cfSriastradh(f0) add (1) g115.4<1>UD g115.4<1,1,1>UD 1UD {align1};
11403b705cfSriastradhdefine(`surface_u', `5')
11503b705cfSriastradhdefine(`surface_v', `6')
11603b705cfSriastradhdefine(`mv1',`g82.24')
11703b705cfSriastradhdefine(`mv2',`g82.26')
11803b705cfSriastradhinclude(`motion_field_uv.g4i')
11903b705cfSriastradhmov (8) g74.16<1>UW g32.0<8,8,1>UW {align1};
12003b705cfSriastradhmov (8) g75.16<1>UW g33.0<8,8,1>UW {align1};
12103b705cfSriastradhmov (8) g76.16<1>UW g34.0<8,8,1>UW {align1};
12203b705cfSriastradhmov (8) g77.16<1>UW g35.0<8,8,1>UW {align1};
12303b705cfSriastradhmov (8) g78.16<1>UW g36.0<8,8,1>UW {align1};
12403b705cfSriastradhmov (8) g79.16<1>UW g37.0<8,8,1>UW {align1};
12503b705cfSriastradhmov (8) g80.16<1>UW g38.0<8,8,1>UW {align1};
12603b705cfSriastradhmov (8) g81.16<1>UW g39.0<8,8,1>UW {align1};
12703b705cfSriastradh
12803b705cfSriastradhinclude(`addidct.g4i')
12903b705cfSriastradhsend (16) 0 acc0<1>UW g0<8,8,1>UW 
13003b705cfSriastradh	thread_spawner(0, 0, 0) mlen 1 rlen 0 { align1 EOT};
131