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 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
50 // and.z.f0.1 (1) null:uw r[ECM_AddrReg, wEdgeCntlMapA_ExtTopHorz0]:uw 0xFFFF:uw // MaskA = 0?
\r
52 // Get (alpha >> 2) + 2
\r
53 shr (1) alpha2:w r[ECM_AddrReg, bAlphaTop0_Y]:ub 2:w // alpha >> 2
\r
55 // p3 = Prev MB Y row 0 = r[P_AddrReg, 0]<16;16,1>
\r
56 // p2 = Prev MB Y row 1 = r[P_AddrReg, 16]<16;16,1>
\r
57 // p1 = Prev MB Y row 2 = r[P_AddrReg, 32]<16;16,1>
\r
58 // p0 = Prev MB Y row 3 = r[P_AddrReg, 48]<16;16,1>
\r
59 // q0 = Cur MB Y row 0 = r[Q_AddrReg, 0]<16;16,1>
\r
60 // q1 = Cur MB Y row 1 = r[Q_AddrReg, 16]<16;16,1>
\r
61 // q2 = Cur MB Y row 2 = r[Q_AddrReg, 32]<16;16,1>
\r
62 // q3 = Cur MB Y row 3 = r[Q_AddrReg, 48]<16;16,1>
\r
63 // mov (1) P_AddrReg:w PREV_MB_Y_BASE:w { NoDDClr }
\r
64 mov (1) P_AddrReg:w TOP_MB_Y_BASE:w { NoDDClr }
\r
65 mov (1) Q_AddrReg:w SRC_MB_Y_BASE:w { NoDDChk }
\r
67 // Get horizontal border edge control data
\r
68 // alpha = bAlphaTop0_Y
\r
69 // beta = bBetaTop0_Y
\r
70 mov (2) alpha<1>:w r[ECM_AddrReg, bAlphaTop0_Y]<2;2,1>:ub { NoDDClr } // 2 channels for alpha and beta
\r
72 mov (2) MaskA<1>:uw r[ECM_AddrReg, wEdgeCntlMapA_ExtTopHorz0]<2;2,1>:uw { NoDDClr, NoDDChk }
\r
74 // tc0 has bTc0_h03_0_Y | bTc0_h02_0_Y | bTc0_h01_0_Y | bTc0_h00_0_Y
\r
75 mov (4) tc0<1>:ub r[ECM_AddrReg, bTc0_h00_0_Y]<4;4,1>:ub { NoDDChk }
\r
77 // (f0.0) jmpi BYPASS_EXT_TOP_EDGE_Y
\r
78 // (f0.0.anyv) jmpi BYPASS_EXT_TOP_EDGE_Y
\r
80 add (1) alpha2:w alpha2:w 2:w // alpha2 = (alpha >> 2) + 2
\r
82 // CALL(FILTER_Y, 1)
\r
83 PRED_CALL(-f0.0, FILTER_Y, 1)
\r
85 //BYPASS_EXT_TOP_EDGE_Y:
\r
86 //------------------------------------------------------------------
\r
87 // Same alpha, alpha2, beta and MaskB for all internal edges
\r
89 // Get (alpha >> 2) + 2
\r
90 shr (1) alpha2:w r[ECM_AddrReg, bAlphaInternal_Y]:ub 2:w // alpha >> 2
\r
92 // alpha = bAlphaInternal_Y
\r
93 // beta = bBetaInternal_Y
\r
94 mov (2) alpha<1>:w r[ECM_AddrReg, bAlphaInternal_Y]<2;2,1>:ub { NoDDClr }
\r
96 // Set MaskB = 0 for all 3 int edges, so it always uses bS < 4 algorithm.
\r
97 mov (1) MaskB:uw 0:w { NoDDChk }
\r
99 add (1) alpha2:w alpha2:w 2:w // alpha2 = (alpha >> 2) + 2
\r
102 //---------- Deblock Y internal top edge (H1) ----------
\r
104 // Bypass deblocking if FilterInternal4x4EdgesFlag = 0
\r
105 and.z.f0.0 (1) null:w r[ECM_AddrReg, BitFlags]:ub FilterInternal4x4EdgesFlag:w // Check for FilterInternal4x4EdgesFlag
\r
107 // p3 = Cur MB Y row 0 = r[P_AddrReg, 0]<16;16,1>
\r
108 // p2 = Cur MB Y row 1 = r[P_AddrReg, 16]<16;16,1>
\r
109 // p1 = Cur MB Y row 2 = r[P_AddrReg, 32]<16;16,1>
\r
110 // p0 = Cur MB Y row 3 = r[P_AddrReg, 48]<16;16,1>
\r
111 // q0 = Cur MB Y row 4 = r[Q_AddrReg, 0]<16;16,1>
\r
112 // q1 = Cur MB Y row 5 = r[Q_AddrReg, 16]<16;16,1>
\r
113 // q2 = Cur MB Y row 6 = r[Q_AddrReg, 32]<16;16,1>
\r
114 // q3 = Cur MB Y row 7 = r[Q_AddrReg, 48]<16;16,1>
\r
115 mov (1) P_AddrReg:w SRC_MB_Y_BASE:w { NoDDClr }
\r
116 mov (1) Q_AddrReg:w 4*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDChk }
\r
118 mov (1) MaskA:uw r[ECM_AddrReg, wEdgeCntlMap_IntTopHorz]:uw { NoDDClr }
\r
120 // tc0 has bTc0_h13_Y + bTc0_h12_Y + bTc0_h11_Y + bTc0_h10_Y
\r
121 mov (4) tc0<1>:ub r[ECM_AddrReg, bTc0_h10_Y]<4;4,1>:ub { NoDDChk }
\r
123 // (f0.0) jmpi BYPASS_4x4_DEBLOCK_H
\r
124 // (f0.0.anyv) jmpi BYPASS_4x4_DEBLOCK_H
\r
126 // CALL(FILTER_Y, 1)
\r
127 PRED_CALL(-f0.0, FILTER_Y, 1)
\r
129 //BYPASS_4x4_DEBLOCK_H:
\r
130 //------------------------------------------------------------------
\r
133 //---------- Deblock Y internal mid horizontal edge (H2) ----------
\r
135 // Bypass deblocking if FilterInternal8x8EdgesFlag = 0
\r
136 and.z.f0.0 (1) null:w r[ECM_AddrReg, BitFlags]:ub FilterInternal8x8EdgesFlag:w // Check for FilterInternal4x4EdgesFlag
\r
138 // and.z.f0.1 (1) null:uw r[ECM_AddrReg, wEdgeCntlMap_IntMidHorz]:uw 0xFFFF:uw // MaskA = 0?
\r
140 // p3 = Cur MB Y row 4 = r[P_AddrReg, 0]<16;16,1>
\r
141 // p2 = Cur MB Y row 5 = r[P_AddrReg, 16]<16;16,1>
\r
142 // p1 = Cur MB Y row 6 = r[P_AddrReg, 32]<16;16,1>
\r
143 // p0 = Cur MB Y row 7 = r[P_AddrReg, 48]<16;16,1>
\r
144 // q0 = Cur MB Y row 8 = r[Q_AddrReg, 0]<16;16,1>
\r
145 // q1 = Cur MB Y row 9 = r[Q_AddrReg, 16]<16;16,1>
\r
146 // q2 = Cur MB Y row 10 = r[Q_AddrReg, 32]<16;16,1>
\r
147 // q3 = Cur MB Y row 11 = r[Q_AddrReg, 48]<16;16,1>
\r
148 mov (1) P_AddrReg:w 4*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDClr }
\r
149 mov (1) Q_AddrReg:w 8*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDChk }
\r
151 mov (1) MaskA:uw r[ECM_AddrReg, wEdgeCntlMap_IntMidHorz]:uw { NoDDClr }
\r
152 // mov (1) MaskB:uw 0:w // Set MaskB = 0, so it always uses bS < 4 algorithm.
\r
154 // tc0 has bTc0_h23_Y + bTc0_h22_Y + bTc0_h21_Y + bTc0_h20_Y
\r
155 mov (4) tc0<1>:ub r[ECM_AddrReg, bTc0_h20_Y]<4;4,1>:ub { NoDDChk }
\r
157 // (f0.0) jmpi BYPASS_8x8_DEBLOCK_H
\r
158 // (f0.0.anyv) jmpi BYPASS_8x8_DEBLOCK_H
\r
160 // CALL(FILTER_Y, 1)
\r
161 PRED_CALL(-f0.0, FILTER_Y, 1)
\r
163 //BYPASS_8x8_DEBLOCK_H:
\r
164 //-----------------------------------------------
\r
167 //---------- Deblock Y internal bottom edge (H3) ----------
\r
169 // Bypass deblocking if FilterInternal4x4EdgesFlag = 0
\r
170 and.z.f0.0 (1) null:w r[ECM_AddrReg, BitFlags]:ub FilterInternal4x4EdgesFlag:w // Check for FilterInternal4x4EdgesFlag
\r
172 // and.z.f0.1 (1) null:uw r[ECM_AddrReg, wEdgeCntlMap_IntBotHorz]:uw 0xFFFF:uw // MaskA = 0?
\r
174 // p3 = Cur MB Y row 8 = r[P_AddrReg, 0]<16;16,1>
\r
175 // p2 = Cur MB Y row 9 = r[P_AddrReg, 16]<16;16,1>
\r
176 // p1 = Cur MB Y row 10 = r[P_AddrReg, 32]<16;16,1>
\r
177 // p0 = Cur MB Y row 11 = r[P_AddrReg, 48]<16;16,1>
\r
178 // q0 = Cur MB Y row 12 = r[Q_AddrReg, 0]<16;16,1>
\r
179 // q1 = Cur MB Y row 13 = r[Q_AddrReg, 16]<16;16,1>
\r
180 // q2 = Cur MB Y row 14 = r[Q_AddrReg, 32]<16;16,1>
\r
181 // q3 = Cur MB Y row 15 = r[Q_AddrReg, 48]<16;16,1>
\r
182 mov (1) P_AddrReg:w 8*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDClr }
\r
183 mov (1) Q_AddrReg:w 12*Y_ROW_WIDTH+SRC_MB_Y_BASE:w { NoDDChk }
\r
186 mov (1) MaskA:uw r[ECM_AddrReg, wEdgeCntlMap_IntBotHorz]:uw { NoDDClr }
\r
187 // mov (1) MaskB:uw 0:w // Set MaskB = 0, so it always uses bS < 4 algorithm.
\r
189 // tc0 has bTc0_h33_Y + bTc0_h32_Y + bTc0_h31_Y + bTc0_h30_Y
\r
190 mov (4) tc0<1>:ub r[ECM_AddrReg, bTc0_h30_Y]<4;4,1>:ub { NoDDChk }
\r
192 // (f0.0) jmpi BYPASS_4x4_DEBLOCK_H2
\r
193 // (f0.0.anyv) jmpi BYPASS_4x4_DEBLOCK_H2
\r
195 // CALL(FILTER_Y, 1)
\r
196 PRED_CALL(-f0.0, FILTER_Y, 1)
\r
198 //BYPASS_4x4_DEBLOCK_H2:
\r
199 //-----------------------------------------------
\r