103b705cfSriastradh/*
203b705cfSriastradh * Copyright © 2008 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 *    Zhang Hua jun <huajun.zhang@intel.com>
2603b705cfSriastradh *    Xing Dong sheng <dongsheng.xing@intel.com>
2703b705cfSriastradh *
2803b705cfSriastradh */
2903b705cfSriastradhmov (8) g76.0<1>UD g1.0<8,8,1>UD {align1};
3003b705cfSriastradh//mov (8) g77.0<1>UD g2.0<8,8,1>UD {align1};
3103b705cfSriastradh
3203b705cfSriastradhinclude(`block_clear.g4i')
3303b705cfSriastradhmov (8) g115.0<1>UD g1.0<8,8,1>UD {align1};
3403b705cfSriastradhmov (8) g116.0<1>UD g1.0<8,8,1>UD {align1};
3503b705cfSriastradh/*Y buffer*/
3603b705cfSriastradhmov(1) g1.8<1>UD 0x007000fUD  { align1 };
3703b705cfSriastradhasr (2) g115.14<1>W g1.14<2,2,1>W 1UW {align1};
3803b705cfSriastradhadd (2) g115.0<1>UD g116.0<2,2,1>UD g115.14<2,2,1>W {align1};
3903b705cfSriastradhand (1) g115.4<1>UD g115.4<1,1,1>UD 0xFFFFFFFEUD {align1};
4003b705cfSriastradhmov (1) g115.8<1>UD 0x1fUD  { align1 }; //read 1 line, 32 columns.
4103b705cfSriastradh/*first vector*/
4203b705cfSriastradhand.nz (1) null g1.31<1,1,1>UB 0x1UW {align1};
4303b705cfSriastradh(f0) add (1) g115.4<1>UD g115.4<1,1,1>UD 1UD {align1};
4403b705cfSriastradhdefine(`surface',`4')
4503b705cfSriastradhdefine(`mv1',`g1.14')
4603b705cfSriastradhdefine(`mv2',`g1.16')
4703b705cfSriastradhinclude(`motion_field_y.g4i')
4803b705cfSriastradhmov (8) g28.0<1>UD g96.0<8,8,1>UD {align1};
4903b705cfSriastradhmov (8) g30.0<1>UD g97.0<8,8,1>UD {align1};
5003b705cfSriastradhmov (8) g32.0<1>UD g98.0<8,8,1>UD {align1};
5103b705cfSriastradhmov (8) g34.0<1>UD g99.0<8,8,1>UD {align1};
5203b705cfSriastradhmov (8) g36.0<1>UD g100.0<8,8,1>UD {align1};
5303b705cfSriastradhmov (8) g38.0<1>UD g101.0<8,8,1>UD {align1};
5403b705cfSriastradhmov (8) g40.0<1>UD g102.0<8,8,1>UD {align1};
5503b705cfSriastradhmov (8) g42.0<1>UD g103.0<8,8,1>UD {align1};
5603b705cfSriastradh/*second vector*/
5703b705cfSriastradhasr (2) g115.14<1>W g1.22<2,2,1>W 1UW {align1};
5803b705cfSriastradhadd (2) g115.0<1>UD g116.0<2,2,1>UD g115.14<2,2,1>W {align1};
5903b705cfSriastradhand (1) g115.4<1>UD g115.4<1,1,1>UD 0xFFFFFFFEUD {align1};
6003b705cfSriastradhmov (1) g115.8<1>UD 0x1fUD { align1 };              //read 1 line, 32 columns.
6103b705cfSriastradh
6203b705cfSriastradhand.nz (1) null g1.31<1,1,1>UB 0x4UW {align1};
6303b705cfSriastradh(f0) add (1) g115.4<1>UD g115.4<1,1,1>UD 1UD {align1};
6403b705cfSriastradhdefine(`surface',`4')
6503b705cfSriastradhdefine(`mv1',`g1.22')
6603b705cfSriastradhdefine(`mv2',`g1.24')
6703b705cfSriastradhinclude(`motion_field_y.g4i')
6803b705cfSriastradhmov (8) g29.0<1>UD g96.0<8,8,1>UD {align1};
6903b705cfSriastradhmov (8) g31.0<1>UD g97.0<8,8,1>UD {align1};
7003b705cfSriastradhmov (8) g33.0<1>UD g98.0<8,8,1>UD {align1};
7103b705cfSriastradhmov (8) g35.0<1>UD g99.0<8,8,1>UD {align1};
7203b705cfSriastradhmov (8) g37.0<1>UD g100.0<8,8,1>UD {align1};
7303b705cfSriastradhmov (8) g39.0<1>UD g101.0<8,8,1>UD {align1};
7403b705cfSriastradhmov (8) g41.0<1>UD g102.0<8,8,1>UD {align1};
7503b705cfSriastradhmov (8) g43.0<1>UD g103.0<8,8,1>UD {align1};
7603b705cfSriastradh/*U buffer,  V buffer*/
7703b705cfSriastradh/*first vector*/
7803b705cfSriastradhmov(1) g115.8<1>UD 0x007000fUD  { align1 };
7903b705cfSriastradhasr (2) g115.14<1>W g1.14<2,2,1>W 2UW {align1};
8003b705cfSriastradhasr (2) g115.0<1>D g116.0<2,2,1>D 1D {align1};
8103b705cfSriastradhadd (2) g115.0<1>D g115.0<2,2,1>D g115.14<2,2,1>W {align1};
8203b705cfSriastradhand (1) g115.4<1>UD g115.4<1,1,1>UD 0xFFFFFFFEUD {align1};
8303b705cfSriastradh
8403b705cfSriastradhand.nz (1) null g1.31<1,1,1>UB 0x1UW {align1};
8503b705cfSriastradh(f0) add (1) g115.4<1>UD g115.4<1,1,1>UD 1UD {align1};
8603b705cfSriastradhdefine(`surface_u',`5')
8703b705cfSriastradhdefine(`surface_v',`6')
8803b705cfSriastradhdefine(`mv1',`g1.14')
8903b705cfSriastradhdefine(`mv2',`g1.16')
9003b705cfSriastradhinclude(`motion_field_uv.g4i')
9103b705cfSriastradhmov (8) g44.0<1>UW g78.0<8,8,1>UW {align1};
9203b705cfSriastradhmov (8) g45.0<1>UW g79.0<8,8,1>UW {align1};
9303b705cfSriastradhmov (8) g46.0<1>UW g80.0<8,8,1>UW {align1};
9403b705cfSriastradhmov (8) g47.0<1>UW g81.0<8,8,1>UW {align1};
9503b705cfSriastradhmov (8) g48.0<1>UW g82.0<8,8,1>UW {align1};
9603b705cfSriastradhmov (8) g49.0<1>UW g83.0<8,8,1>UW {align1};
9703b705cfSriastradhmov (8) g50.0<1>UW g84.0<8,8,1>UW {align1};
9803b705cfSriastradhmov (8) g51.0<1>UW g85.0<8,8,1>UW {align1};
9903b705cfSriastradh/*second vector*/
10003b705cfSriastradhasr (2) g115.14<1>W g1.22<2,2,1>W 2UW {align1};
10103b705cfSriastradhasr (2) g115.0<1>D g116.0<2,2,1>D 1D {align1};
10203b705cfSriastradhadd (2) g115.0<1>D g115.0<2,2,1>D g115.14<2,2,1>W {align1};
10303b705cfSriastradhand (1) g115.4<1>UD g115.4<1,1,1>UD 0xFFFFFFFEUD {align1};
10403b705cfSriastradh
10503b705cfSriastradhand.nz (1) null g1.31<1,1,1>UB 0x4UW {align1};
10603b705cfSriastradh(f0) add (1) g115.4<1>UD g115.4<1,1,1>UD 1UD {align1};
10703b705cfSriastradhdefine(`mv1',`g1.22')
10803b705cfSriastradhdefine(`mv2',`g1.24')
10903b705cfSriastradhinclude(`motion_field_uv.g4i')
11003b705cfSriastradhmov (8) g44.16<1>UW g78.0<8,8,1>UW {align1};
11103b705cfSriastradhmov (8) g45.16<1>UW g79.0<8,8,1>UW {align1};
11203b705cfSriastradhmov (8) g46.16<1>UW g80.0<8,8,1>UW {align1};
11303b705cfSriastradhmov (8) g47.16<1>UW g81.0<8,8,1>UW {align1};
11403b705cfSriastradhmov (8) g48.16<1>UW g82.0<8,8,1>UW {align1};
11503b705cfSriastradhmov (8) g49.16<1>UW g83.0<8,8,1>UW {align1};
11603b705cfSriastradhmov (8) g50.16<1>UW g84.0<8,8,1>UW {align1};
11703b705cfSriastradhmov (8) g51.16<1>UW g85.0<8,8,1>UW {align1};
11803b705cfSriastradh
11903b705cfSriastradhinclude(`addidct.g4i')
12003b705cfSriastradh//send (16) 0 acc0<1>UW g0<8,8,1>UW 
12103b705cfSriastradh//	thread_spawner(0, 0, 0) mlen 1 rlen 0 { align1 EOT};
122