2 * Copyright © <2010>, Intel Corporation.
\r
4 * This program is licensed under the terms and conditions of the
\r
5 * Eclipse Public License (EPL), version 1.0. The full text of the EPL is at
\r
6 * http://www.opensource.org/licenses/eclipse-1.0.php.
\r
9 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
\r
10 // AVC Child Kernel (Vertical and horizontal de-block a 4:2:0 MB Y comp)
\r
12 // First, de-block vertical edges from left to right.
\r
13 // Second, de-block horizontal edge from top to bottom.
\r
15 // ***** MBAFF Mode *****
\r
16 // This version deblocks top MB first, followed by bottom MB.
\r
18 // Need variable CurMB to indicate top MB or bottom MB (CurMB = 0 or 1).
\r
19 // We can use BotFieldFlag in BitFields to represent it.
\r
22 // 1) Access control data for top
\r
23 // CntrlDataOffsetY + CurMB * Control data block size (64 DWs for CL, 16 DWs for BLC)
\r
25 // 2) Load frame/field video data based on flags: FieldModeCurrentMbFlag, FieldModeLeftMbFlag, FieldModeaboveMbFlag,
\r
28 // if (pCntlData->BitField & FieldModeCurrentMbFlag)
\r
29 // cur_y = ORIX_CUR.y + CurMB * 1; // Add field vertical offset for bot field MB .
\r
31 // cur_y = ORIX_CUR.y + CurMB * MB_Rows_Y; // Add bottom MB vertical offset for bot MB
\r
34 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
\r
37 .kernel AVC_ILDB_CHILD_MBAFF_Y
\r
38 #if defined(COMBINED_KERNEL)
\r
39 ILDB_LABEL(AVC_ILDB_CHILD_Y):
\r
42 #include "setupVPKernel.asm"
\r
43 #include "AVC_ILDB.inc"
\r
45 #if defined(_DEBUG)
\r
46 mov (1) EntrySignatureC:w 0xE998:w
\r
49 // Setup temp buf used by load and save code
\r
50 #define BUF_B RTempB
\r
51 #define BUF_D RTempD
\r
53 // Init local variables
\r
54 // These coordinates are in progressive fashion
\r
55 mul (4) ORIX_CUR<2>:w ORIX<0;1,0>:w 16:w { NoDDClr } // Expand X addr to bytes, repeat 4 times
\r
56 mul (4) ORIY_CUR<2>:w ORIY<0;1,0>:w 32:w { NoDDChk } // Expand Y addr to bytes, repeat 4 times
\r
58 mov (2) f0.0<1>:w 0:w
\r
60 mov (1) GateWayOffsetC:uw ORIY:uw // Use row # as Gateway offset
\r
62 //=== Null Kernel ===============================================================
\r
64 //===============================================================================
\r
66 //====================================================================================
\r
67 // Assuming the MB control data is laid out in scan line order in a rectangle with width = 16 bytes.
\r
68 // Control data has dimension of X x Y = 16 x N bytes, where N = W x H / 16
\r
69 // Each MB has 256 bytes of control data
\r
71 // For CRESTLINE, 256 bytes are stored in memory and fetched into GRF.
\r
72 // MB_offset = MBsCntX * CurRow + CurCol
\r
73 // Byte_offset = MB_offset * (256 << Mbaff_flag), Mbaff_flag = 0 or 1.
\r
74 // Base address of a control data block = (x, y) = (0, y'=y/x), region width is 16 bytes
\r
75 // where y' = Byte_offset / 16 = MB_offset * (16 << Mbaff_flag)
\r
76 // MBCntrlDataOffsetY holds y'.
\r
78 // For BearLake-C, 64 bytes are stored in memory and dataport expands to 256 bytes. Need to use a special read command on BL-C.
\r
79 // MB_offset = MBsCntX * CurRow + CurCol
\r
80 // Byte_offset = MB_offset * (64 << Mbaff_flag), Mbaff_flag = 0 or 1.
\r
81 // MBCntrlDataOffsetY holds globel byte offset.
\r
83 #if !defined(DEV_CL)
\r
84 mul (1) CntrlDataOffsetY:ud MBsCntX:w ORIY:w
\r
85 add (1) CntrlDataOffsetY:ud CntrlDataOffsetY:ud ORIX:w
\r
86 mul (1) CntrlDataOffsetY:ud CntrlDataOffsetY:ud 128:uw
\r
89 //====================================================================================
\r
91 add (1) ORIX_LEFT:w ORIX_LEFT:w -4:w
\r
92 add (1) ORIY_TOP:w ORIY_TOP:w -4:w
\r
95 //=========== Process Top MB ============
\r
96 and (1) BitFields:w BitFields:w TopFieldFlag:w // Reset BotFieldFlag
\r
98 RE_ENTRY: // for bootom field
\r
100 // Load current MB control data
\r
101 #if defined(DEV_CL)
\r
102 #include "load_ILDB_Cntrl_Data_64DW.asm" // Crestline
\r
104 #include "load_ILDB_Cntrl_Data_16DW.asm" // Cantiga and beyond
\r
107 // Init addr register for vertical control data
\r
108 mov (1) ECM_AddrReg<1>:w CNTRL_DATA_BASE:w // Init edge control map AddrReg
\r
110 // Check loaded control data
\r
111 and.z.f0.1 (16) null<1>:uw r[ECM_AddrReg, wEdgeCntlMap_IntLeftVert]<16;16,1>:uw 0xFFFF:uw // Skip ILDB?
\r
112 and.nz.f0.0 (1) null:w r[ECM_AddrReg, ExtBitFlags]:ub DISABLE_ILDB_FLAG:w // Skip ILDB?
\r
114 // Use free cycles here
\r
115 // Set DualFieldMode for all data read, write and deblocking
\r
116 and (1) CTemp1_W:uw r[ECM_AddrReg, BitFlags]:ub FieldModeAboveMbFlag+FieldModeCurrentMbFlag:uw
\r
118 // Get Vert Edge Pattern (frame vs. field MBs)
\r
119 and (1) VertEdgePattern:uw r[ECM_AddrReg, BitFlags]:ub FieldModeLeftMbFlag+FieldModeCurrentMbFlag:uw
\r
121 (f0.1.all16h) jmpi SKIP_ILDB // Skip ILDB
\r
122 (f0.0) jmpi SKIP_ILDB // Skip ILDB
\r
124 // Set DualFieldMode for all data read, write and deblocking
\r
125 // and (1) CTemp1_W:uw r[ECM_AddrReg, BitFlags]:ub FieldModeAboveMbFlag+FieldModeCurrentMbFlag:uw
\r
126 cmp.z.f0.0 (1) null:w CTemp1_W:uw ABOVE_FIELD_CUR_FRAME:w
\r
127 and (1) DualFieldMode:w f0.0:w 0x0001:w
\r
129 // Load current MB // DDD1
\r
130 #include "load_Cur_Y_16x16T_Mbaff.asm" // Load cur Y, 16x16, transpose
\r
131 #include "load_Left_Y_4x16T_Mbaff.asm" // Load left MB (4x16) Y data from memory if exists
\r
133 #include "Transpose_Cur_Y_16x16.asm"
\r
134 #include "Transpose_Left_Y_4x16.asm"
\r
136 //---------- Perform vertical ILDB filting on Y----------
\r
137 #include "AVC_ILDB_Filter_Mbaff_Y_v.asm"
\r
138 //-------------------------------------------------------
\r
140 #include "save_Left_Y_16x4T_Mbaff.asm" // Write left MB (4x16) Y data to memory if exists
\r
141 #include "load_Top_Y_16x4_Mbaff.asm" // Load top MB (16x4) Y data from memory if exists
\r
142 #include "Transpose_Cur_Y_16x16.asm" // Transpose a MB for horizontal edge de-blocking
\r
144 //---------- Perform horizontal ILDB filting on Y ----------
\r
145 #include "AVC_ILDB_Filter_Mbaff_Y_h.asm"
\r
146 //----------------------------------------------------------
\r
148 #include "save_Cur_Y_16x16_Mbaff.asm" // Write cur MB (16x16)
\r
149 #include "save_Top_Y_16x4_Mbaff.asm" // Write top MB (16x4) if not the top row
\r
152 //----------------------------------------------------------
\r
153 and.z.f0.0 (1) null:w BitFields:w BotFieldFlag:w
\r
155 //=========== Process Bottom MB ============
\r
156 or (1) BitFields:w BitFields:w BotFieldFlag:w // Set BotFieldFlag to 1
\r
157 (f0.0) jmpi RE_ENTRY // Loop back for bottom deblocking
\r
159 // Fall through to finish
\r
161 //=========== Check write commit of the last write ============
\r
162 mov (8) WritebackResponse(0)<1> WritebackResponse(0)
\r
166 //---------------------------------------------------------------------------
\r
167 // Send notification thru Gateway to root thread, update luma Status[CurRow]
\r
169 #include "AVC_ILDB_ForwardMsg.asm"
\r
171 #if !defined(GW_DCN) // For non-ILK chipsets
\r
172 //child send EOT : Request type = 1
\r
174 #endif // !defined(DEV_ILK)
\r
176 // The thread finishs here
\r
177 //------------------------------------------------------------------------------
\r
180 ////////////////////////////////////////////////////////////////////////////////
\r
181 // Include other subrutines being called
\r
182 #include "AVC_ILDB_Luma_Core_Mbaff.asm"
\r
184 #if !defined(COMBINED_KERNEL) // For standalone kernel only
\r