Debian Codegraph @

src/shaders/post_processing/gen5_6/Core_Kernels/Scaling.inc

raw
1 /*
2 * All Video Processing kernels
3 * Copyright © <2010>, Intel Corporation.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 * This file was originally licensed under the following license
26 *
27 * Licensed under the Apache License, Version 2.0 (the "License");
28 * you may not use this file except in compliance with the License.
29 * You may obtain a copy of the License at
30 *
31 * http://www.apache.org/licenses/LICENSE-2.0
32 *
33 * Unless required by applicable law or agreed to in writing, software
34 * distributed under the License is distributed on an "AS IS" BASIS,
35 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36 * See the License for the specific language governing permissions and
37 * limitations under the License.
38 *
39 */
40
41 // File name: Scaling.inc
42
43 #ifndef _SCALING_INC_
44 #define _SCALING_INC_
45
46 // Local variables----------------------------------------------------------------------------------
47 #define MSGHDR_SCALE m1 // Message Payload Header (Uses m2, m3, m4, m5 implicitly)
48
49 //--------------------------------------------------------------------------------------------------
50 //r10.0 thru r33.0; Primary surface read from sampler (16x8)
51 #define DEST_Y uwTOP_Y
52 #define DEST_U uwTOP_U
53 #define DEST_V uwTOP_V
54
55 //r10.0 thru r41.0
56 .declare DEST_B Base=REG(r,10) ElementSize=2 SrcRegion=REGION(8,1) DstRegion=<1> Type=uw
57 .declare DEST_G Base=REG(r,18) ElementSize=2 SrcRegion=REGION(8,1) DstRegion=<1> Type=uw
58 .declare DEST_R Base=REG(r,26) ElementSize=2 SrcRegion=REGION(8,1) DstRegion=<1> Type=uw
59 .declare DEST_A Base=REG(r,34) ElementSize=2 SrcRegion=REGION(8,1) DstRegion=<1> Type=uw
60
61 //r56.0 thru r79.0
62 .declare SCALE_RESPONSE_YF Base=REG(r,nBOT_Y) ElementSize=4 SrcRegion=REGION(8,1) Type=f
63 .declare SCALE_RESPONSE_UF Base=REG(r,nBOT_U) ElementSize=4 SrcRegion=REGION(8,1) Type=f
64 .declare SCALE_RESPONSE_VF Base=REG(r,nBOT_V) ElementSize=4 SrcRegion=REGION(8,1) Type=f
65
66 .declare SCALE_RESPONSE_YW Base=REG(r,nBOT_Y) ElementSize=2 SrcRegion=REGION(16,1) Type=uw
67 .declare SCALE_RESPONSE_UW Base=REG(r,nBOT_U) ElementSize=2 SrcRegion=REGION(16,1) Type=uw
68 .declare SCALE_RESPONSE_VW Base=REG(r,nBOT_V) ElementSize=2 SrcRegion=REGION(16,1) Type=uw
69
70 .declare SCALE_RESPONSE_YD Base=REG(r,nBOT_Y) ElementSize=4 SrcRegion=REGION(8,1) Type=ud
71 .declare SCALE_RESPONSE_UD Base=REG(r,nBOT_U) ElementSize=4 SrcRegion=REGION(8,1) Type=ud
72 .declare SCALE_RESPONSE_VD Base=REG(r,nBOT_V) ElementSize=4 SrcRegion=REGION(8,1) Type=ud
73
74 .declare SCALE_RESPONSE_YB Base=REG(r,nBOT_Y) ElementSize=1 SrcRegion=REGION(8,4) Type=ub
75 .declare SCALE_RESPONSE_UB Base=REG(r,nBOT_U) ElementSize=1 SrcRegion=REGION(8,4) Type=ub
76 .declare SCALE_RESPONSE_VB Base=REG(r,nBOT_V) ElementSize=1 SrcRegion=REGION(8,4) Type=ub
77
78 .declare SAMPLER_RAMP Base=REG(r,42) ElementSize=4 SrcRegion=<8;8,1> Type=f // 2 GRFs, 16 elements
79
80 //#define SCALE_STEP_X REG2(r,43,0)
81 //#define SCALE_COORD_X REG2(r,43,3)
82
83 #define SCALE_LINE_P255 REG2(r,43,4) // = 255.0 Used in 'line' inst to multiply 255, add 0.5, and round to int.
84 #define SCALE_LINE_P0_5 REG2(r,43,7) // = 0.5
85
86 //r44.0 thru r45.0
87 #define SCALE_COORD_Y REG(r,44) //2GRF
88
89
90 // Send Message [DevILK] Message Descriptor
91 // MBZ MsgL=5 MsgR=8 H MBZ SIMD MsgType SmplrIndx BindTab
92 // 000 0 101 0 1000 1 0 10 0000 0000 00000000
93 // 0 A 8 A 0 0 0 0
94 // MsgL=1+2*2(u,v)=5 MsgR=8
95 #define SMPLR_MSG_DSC 0x0A8A0000 // ILK Sampler Message Descriptor
96
97 // Re-define new number of lines
98 #undef nY_NUM_OF_ROWS
99 #undef nUV_NUM_OF_ROWS
100
101 #define nY_NUM_OF_ROWS 8
102 #define nUV_NUM_OF_ROWS 8
103
104
105 #endif //_SCALING_INC_