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 ////////// AVC ILDB filter horizontal Mbaff Y ///////////////////////////////////////////////////////
\r
11 // This filter code prepares the src data and control data for ILDB filtering on all horizontal edges of Y.
\r
13 // It sssumes the data for horizontal de-blocking is already transposed.
\r
17 // +-------+-------+-------+-------+ H0 Edge
\r
21 // +-------+-------+-------+-------+ H1 Edge
\r
25 // +-------+-------+-------+-------+ H2 Edge
\r
29 // +-------+-------+-------+-------+ H3 Edge
\r
33 // +-------+-------+-------+-------+
\r
35 /////////////////////////////////////////////////////////////////////////////
\r
37 #if defined(_DEBUG)
\r
38 mov (1) EntrySignatureC:w 0xBBBB:w
\r
42 //========== Luma deblocking ==========
\r
45 //---------- Deblock Y external top edge (H0) ----------
\r
47 // Bypass deblocking if it is the top edge of the picture.
\r
48 and.z.f0.0 (1) null:w r[ECM_AddrReg, BitFlags]:ub FilterTopMbEdgeFlag:w // Check for FilterTopMbEdgeFlag
\r
49 mov (1) f0.1:w DualFieldMode:w // Check for dual field mode
\r
51 // Non dual field mode
\r
53 // Get (alpha >> 2) + 2
\r
54 shr (16) Mbaff_ALPHA2(0,0)<1> r[ECM_AddrReg, bAlphaTop0_Y]<0;1,0>:ub 2:w // alpha >> 2
\r
56 mov (2) MaskA<1>:uw r[ECM_AddrReg, wEdgeCntlMapA_ExtTopHorz0]<2;2,1>:uw
\r
59 mov (16) Mbaff_ALPHA(0,0)<1> r[ECM_AddrReg, bAlphaTop0_Y]<0;1,0>:ub
\r
60 mov (16) Mbaff_BETA(0,0)<1> r[ECM_AddrReg, bBetaTop0_Y]<0;1,0>:ub
\r
61 mov (16) Mbaff_TC0(0,0)<1> r[ECM_AddrReg, bTc0_h00_0_Y]<1;4,0>:ub
\r
63 add (16) Mbaff_ALPHA2(0,0)<1> Mbaff_ALPHA2(0,0)<16;16,1> 2:w // alpha2 = (alpha >> 2) + 2
\r
65 (f0.0) jmpi H0_Y_DONE // Skip Ext Y deblocking
\r
66 (f0.1) jmpi DUAL_FIELD_Y
\r
68 mov (1) P_AddrReg:w PREV_MB_Y_BASE:w { NoDDClr }
\r
69 mov (1) Q_AddrReg:w SRC_MB_Y_BASE:w { NoDDChk }
\r
71 CALL(FILTER_Y_MBAFF, 1) // Non dual field deblocking
\r
76 // Dual field mode, FieldModeCurrentMbFlag=0 && FieldModeAboveMbFlag=1
\r
78 mov (1) P_AddrReg:w ABOVE_CUR_MB_BASE:w { NoDDClr }
\r
79 mov (1) Q_AddrReg:w ABOVE_CUR_MB_BASE+64:w { NoDDChk }
\r
81 // Must use PREV_MB_YW. TOP_MB_YW is not big enough.
\r
82 // Get top field rows
\r
83 mov (16) ABOVE_CUR_MB_YW(0)<1> PREV_MB_YW(0, 0)<16;8,1> // Copy p3, p2
\r
84 mov (16) ABOVE_CUR_MB_YW(1)<1> PREV_MB_YW(2, 0)<16;8,1> // Copy p1, p0
\r
85 mov (16) ABOVE_CUR_MB_YW(2)<1> SRC_YW(0, 0)<16;8,1> // Copy q0, q1
\r
86 mov (16) ABOVE_CUR_MB_YW(3)<1> SRC_YW(2, 0)<16;8,1> // Copy q2, q3
\r
88 CALL(FILTER_Y_MBAFF, 1) // Ext Y, top field
\r
90 // Save deblocked top field rows
\r
91 mov (8) PREV_MB_YW(1, 0)<1> ABOVE_CUR_MB_YW(0, 8) // Copy p2
\r
92 mov (8) PREV_MB_YW(2, 0)<1> ABOVE_CUR_MB_YW(1, 0) // Copy p1
\r
93 mov (8) PREV_MB_YW(3, 0)<1> ABOVE_CUR_MB_YW(1, 8) // Copy p0
\r
94 mov (8) SRC_YW(0, 0)<1> ABOVE_CUR_MB_YW(2, 0) // Copy q0
\r
95 mov (8) SRC_YW(1, 0)<1> ABOVE_CUR_MB_YW(2, 8) // Copy q1
\r
96 mov (8) SRC_YW(2, 0)<1> ABOVE_CUR_MB_YW(3, 0) // Copy q2
\r
98 //==================================================================================
\r
101 // Get (alpha >> 2) + 2
\r
102 shr (16) Mbaff_ALPHA2(0,0)<1> r[ECM_AddrReg, bAlphaTop1_Y]<0;1,0>:ub 2:w // alpha >> 2
\r
104 mov (1) P_AddrReg:w ABOVE_CUR_MB_BASE:w { NoDDClr }
\r
105 mov (1) Q_AddrReg:w ABOVE_CUR_MB_BASE+64:w { NoDDChk }
\r
107 // Get bot field rows
\r
108 mov (16) ABOVE_CUR_MB_YW(0)<1> PREV_MB_YW(0, 8)<16;8,1> // Copy p3, p2
\r
109 mov (16) ABOVE_CUR_MB_YW(1)<1> PREV_MB_YW(2, 8)<16;8,1> // Copy p1, p0
\r
110 mov (16) ABOVE_CUR_MB_YW(2)<1> SRC_YW(0, 8)<16;8,1> // Copy q0, q1
\r
111 mov (16) ABOVE_CUR_MB_YW(3)<1> SRC_YW(2, 8)<16;8,1> // Copy q2, q3
\r
113 mov (2) MaskA<1>:uw r[ECM_AddrReg, wEdgeCntlMapA_ExtTopHorz1]<2;2,1>:uw
\r
115 mov (16) Mbaff_ALPHA(0,0)<1> r[ECM_AddrReg, bAlphaTop1_Y]<0;1,0>:ub
\r
116 mov (16) Mbaff_BETA(0,0)<1> r[ECM_AddrReg, bBetaTop1_Y]<0;1,0>:ub
\r
117 mov (16) Mbaff_TC0(0,0)<1> r[ECM_AddrReg, bTc0_h00_1_Y]<1;4,0>:ub
\r
119 add (16) Mbaff_ALPHA2(0,0)<1> Mbaff_ALPHA2(0,0)<16;16,1> 2:w // alpha2 = (alpha >> 2) + 2
\r
121 CALL(FILTER_Y_MBAFF, 1) // Ext Y, bot field
\r
123 // Save deblocked top field rows
\r
124 mov (8) PREV_MB_YW(1, 8)<1> ABOVE_CUR_MB_YW(0, 8) // Copy p2
\r
125 mov (8) PREV_MB_YW(2, 8)<1> ABOVE_CUR_MB_YW(1, 0) // Copy p1
\r
126 mov (8) PREV_MB_YW(3, 8)<1> ABOVE_CUR_MB_YW(1, 8) // Copy p0
\r
127 mov (8) SRC_YW(0, 8)<1> ABOVE_CUR_MB_YW(2, 0) // Copy q0
\r
128 mov (8) SRC_YW(1, 8)<1> ABOVE_CUR_MB_YW(2, 8) // Copy q1
\r
129 mov (8) SRC_YW(2, 8)<1> ABOVE_CUR_MB_YW(3, 0) // Copy q2
\r
130 //==================================================================================
\r
135 //------------------------------------------------------------------
\r
136 // Same alpha, alpha2, beta and MaskB for all internal edges
\r
138 // Get (alpha >> 2) + 2
\r
139 shr (16) Mbaff_ALPHA2(0,0)<1> r[ECM_AddrReg, bAlphaInternal_Y]<0;1,0>:ub 2:w // alpha >> 2
\r
141 // alpha = bAlphaInternal_Y
\r
142 // beta = bBetaInternal_Y
\r
143 mov (16) Mbaff_ALPHA(0,0)<1> r[ECM_AddrReg, bAlphaInternal_Y]<0;1,0>:ub
\r
144 mov (16) Mbaff_BETA(0,0)<1> r[ECM_AddrReg, bBetaInternal_Y]<0;1,0>:ub
\r
146 mov (1) MaskB:uw 0:w // Set MaskB = 0 for all 3 edges, so it always uses bS < 4 algorithm.
\r
148 add (16) Mbaff_ALPHA2(0,0)<1> Mbaff_ALPHA2(0,0)<16;16,1> 2:w // alpha2 = (alpha >> 2) + 2
\r
150 //---------- Deblock Y internal top edge (H1) ----------
\r
152 // Bypass deblocking if FilterInternal4x4EdgesFlag = 0
\r
153 and.z.f0.0 (1) null:w r[ECM_AddrReg, BitFlags]:ub FilterInternal4x4EdgesFlag:w // Check for FilterInternal4x4EdgesFlag
\r
154 // (f0.0) jmpi BYPASS_H1_Y
\r
156 // p3 = Cur MB Y row 0 = r[P_AddrReg, 0]<16;16,1>
\r
157 // p2 = Cur MB Y row 1 = r[P_AddrReg, 16]<16;16,1>
\r
158 // p1 = Cur MB Y row 2 = r[P_AddrReg, 32]<16;16,1>
\r
159 // p0 = Cur MB Y row 3 = r[P_AddrReg, 48]<16;16,1>
\r
160 // q0 = Cur MB Y row 4 = r[Q_AddrReg, 0]<16;16,1>
\r
161 // q1 = Cur MB Y row 5 = r[Q_AddrReg, 16]<16;16,1>
\r
162 // q2 = Cur MB Y row 6 = r[Q_AddrReg, 32]<16;16,1>
\r
163 // q3 = Cur MB Y row 7 = r[Q_AddrReg, 48]<16;16,1>
\r
164 mov (1) P_AddrReg:w SRC_MB_Y_BASE:w { NoDDClr }
\r
165 mov (1) Q_AddrReg:w 4*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDChk }
\r
167 mov (1) MaskA:uw r[ECM_AddrReg, wEdgeCntlMap_IntTopHorz]:uw
\r
169 // tc0 has bTc0_h13_Y + bTc0_h12_Y + bTc0_h11_Y + bTc0_h10_Y
\r
170 mov (16) Mbaff_TC0(0,0)<1> r[ECM_AddrReg, bTc0_h10_Y]<1;4,0>:ub
\r
172 // CALL(FILTER_Y_MBAFF, 1)
\r
173 PRED_CALL(-f0.0, FILTER_Y_MBAFF, 1)
\r
176 //------------------------------------------------------------------
\r
179 //---------- Deblock Y internal mid horizontal edge (H2) ----------
\r
181 // Bypass deblocking if FilterInternal8x8EdgesFlag = 0
\r
182 and.z.f0.0 (1) null:w r[ECM_AddrReg, BitFlags]:ub FilterInternal8x8EdgesFlag:w // Check for FilterInternal4x4EdgesFlag
\r
183 // (f0.0) jmpi BYPASS_H2_Y
\r
185 // p3 = Cur MB Y row 4 = r[P_AddrReg, 0]<16;16,1>
\r
186 // p2 = Cur MB Y row 5 = r[P_AddrReg, 16]<16;16,1>
\r
187 // p1 = Cur MB Y row 6 = r[P_AddrReg, 32]<16;16,1>
\r
188 // p0 = Cur MB Y row 7 = r[P_AddrReg, 48]<16;16,1>
\r
189 // q0 = Cur MB Y row 8 = r[Q_AddrReg, 0]<16;16,1>
\r
190 // q1 = Cur MB Y row 9 = r[Q_AddrReg, 16]<16;16,1>
\r
191 // q2 = Cur MB Y row 10 = r[Q_AddrReg, 32]<16;16,1>
\r
192 // q3 = Cur MB Y row 11 = r[Q_AddrReg, 48]<16;16,1>
\r
193 mov (1) P_AddrReg:w 4*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDClr }
\r
194 mov (1) Q_AddrReg:w 8*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDChk }
\r
196 mov (1) MaskA:uw r[ECM_AddrReg, wEdgeCntlMap_IntMidHorz]:uw
\r
198 // tc0 has bTc0_h23_Y + bTc0_h22_Y + bTc0_h21_Y + bTc0_h20_Y
\r
199 mov (16) Mbaff_TC0(0,0)<1> r[ECM_AddrReg, bTc0_h20_Y]<1;4,0>:ub
\r
201 // CALL(FILTER_Y_MBAFF, 1)
\r
202 PRED_CALL(-f0.0, FILTER_Y_MBAFF, 1)
\r
205 //-----------------------------------------------
\r
208 //---------- Deblock Y internal bottom edge (H3) ----------
\r
210 // Bypass deblocking if FilterInternal4x4EdgesFlag = 0
\r
211 and.z.f0.0 (1) null:w r[ECM_AddrReg, BitFlags]:ub FilterInternal4x4EdgesFlag:w // Check for FilterInternal4x4EdgesFlag
\r
212 // (f0.0) jmpi BYPASS_H3_Y
\r
214 // p3 = Cur MB Y row 8 = r[P_AddrReg, 0]<16;16,1>
\r
215 // p2 = Cur MB Y row 9 = r[P_AddrReg, 16]<16;16,1>
\r
216 // p1 = Cur MB Y row 10 = r[P_AddrReg, 32]<16;16,1>
\r
217 // p0 = Cur MB Y row 11 = r[P_AddrReg, 48]<16;16,1>
\r
218 // q0 = Cur MB Y row 12 = r[Q_AddrReg, 0]<16;16,1>
\r
219 // q1 = Cur MB Y row 13 = r[Q_AddrReg, 16]<16;16,1>
\r
220 // q2 = Cur MB Y row 14 = r[Q_AddrReg, 32]<16;16,1>
\r
221 // q3 = Cur MB Y row 15 = r[Q_AddrReg, 48]<16;16,1>
\r
222 mov (1) P_AddrReg:w 8*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDClr }
\r
223 mov (1) Q_AddrReg:w 12*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDChk }
\r
225 mov (1) MaskA:uw r[ECM_AddrReg, wEdgeCntlMap_IntBotHorz]:uw
\r
227 // tc0 has bTc0_h33_Y + bTc0_h32_Y + bTc0_h31_Y + bTc0_h30_Y
\r
228 mov (16) Mbaff_TC0(0,0)<1> r[ECM_AddrReg, bTc0_h30_Y]<1;4,0>:ub
\r
230 // CALL(FILTER_Y_MBAFF, 1)
\r
231 PRED_CALL(-f0.0, FILTER_Y_MBAFF, 1)
\r
234 //-----------------------------------------------
\r