1fa225cbcSrjs/* 2fa225cbcSrjs * Copyright © 2008 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 * Zhang Hua jun <huajun.zhang@intel.com> 26fa225cbcSrjs * Xing Dong sheng <dongsheng.xing@intel.com> 27fa225cbcSrjs * 28fa225cbcSrjs */ 29fa225cbcSrjs 30fa225cbcSrjs/* shader for backward predict mc 31fa225cbcSrjs*/ 32fa225cbcSrjsmov (8) g76.0<1>UD g1.0<8,8,1>UD {align1}; 33fa225cbcSrjs//mov (8) g77.0<1>UD g2.0<8,8,1>UD {align1}; 34fa225cbcSrjs 35fa225cbcSrjsinclude(`block_clear.g4i') 36fa225cbcSrjs 37fa225cbcSrjsmov (2) g1.14<1>UW g1.18<2,2,1>UW {align1}; 38fa225cbcSrjs/* save payload */ 39fa225cbcSrjsmov (8) g115.0<1>UD g1.0<8,8,1>UD {align1}; 40fa225cbcSrjs/* 8x8 media read/write payload */ 41fa225cbcSrjsmov (1) g1.8<1>UD 0x0070007UD {align1}; 42fa225cbcSrjs/* save payload, again */ 43fa225cbcSrjsdefine(`dest', `g118') 44fa225cbcSrjsdefine(`input_surface', `7') 45fa225cbcSrjsdefine(`mv1', `g115.14') 46fa225cbcSrjsdefine(`mv2', `g115.16') 47fa225cbcSrjs/* Y */ 48fa225cbcSrjs/* (x', y') = (x, y) + (motion_vector.x >> 1, motion_vector.y >> 1) */ 49fa225cbcSrjsasr (2) g1.14<1>W g115.14<2,2,1>W 1W {align1}; 50fa225cbcSrjsadd (2) g2.0<1>UD g115.0<2,2,1>UD g1.14<2,2,1>W {align1}; 51fa225cbcSrjsinclude(`motion_frame_y.g4i') 52fa225cbcSrjs/* motion_vector = motion_vector >> 1 */ 53fa225cbcSrjs/* (x', y') = (x, y) + (motion_vector.x >> 1, motion_vector.y >> 1) */ 54fa225cbcSrjsshr (2) g1.0<1>UD g115.0<2,2,1>UD 1UD {align1}; 55fa225cbcSrjsasr (2) g115.14<1>W g115.14<2,2,1>W 1W {align1}; 56fa225cbcSrjsasr (2) g1.14<1>W g115.14<2,2,1>W 1W {align1}; 57fa225cbcSrjsadd (2) g2.0<1>UD g1.0<2,2,1>UD g1.14<2,2,1>W {align1}; 58fa225cbcSrjs/* U */ 59fa225cbcSrjsdefine(`input_surface1', `8') 60fa225cbcSrjsdefine(`input_surface2', `9') 61fa225cbcSrjsmov (1) g2.8<1>UD 0x007000fUD {align1}; 62fa225cbcSrjsinclude(`motion_frame_uv.g4i') 63fa225cbcSrjs 64fa225cbcSrjs/* V */ 65fa225cbcSrjs/* (x', y') = (x, y) + (motion_vector.x >> 1, motion_vector.y >> 1) */ 66fa225cbcSrjsinclude(`addidct.g4i') 67fa225cbcSrjs 68fa225cbcSrjssend (16) 0 acc0<1>UW g0<8,8,1>UW 69fa225cbcSrjs thread_spawner(0, 0, 0) mlen 1 rlen 0 { align1 EOT}; 70