~ubuntu-branches/ubuntu/natty/libva/natty

« back to all changes in this revision

Viewing changes to i965_drv_video/shaders/h264/ildb/AVC_ILDB_Filter_Mbaff_UV_h.asm

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Artur Rona, Reinhard Tartler
  • Date: 2011-02-13 19:01:16 UTC
  • mfrom: (3.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110213190116-wy9fqh71nmomiacl
Tags: 1.0.8-3
[ Artur Rona ]
* Update library dependencies to fix FTBFS properly.

[ Reinhard Tartler ]
* Disable i965 driver on hurd-i386, Closes: #613102

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © <2010>, Intel Corporation.
 
3
 *
 
4
 * This program is licensed under the terms and conditions of the
 
5
 * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at
 
6
 * http://www.opensource.org/licenses/eclipse-1.0.php.
 
7
 *
 
8
 */
 
9
////////// AVC ILDB filter horizontal Mbaff UV ///////////////////////////////////////////////////////
 
10
//
 
11
//      This filter code prepares the src data and control data for ILDB filtering on all horizontal edges of UV.
 
12
//
 
13
//      It sssumes the data for horizontal de-blocking is already transposed.  
 
14
//
 
15
//              Chroma:
 
16
//
 
17
//              +-------+-------+               H0 Edge
 
18
//              |               |               |
 
19
//              |               |               |
 
20
//              |               |               |
 
21
//              +-------+-------+               H1 Edge
 
22
//              |               |               |
 
23
//              |               |               |
 
24
//              |               |               |
 
25
//              +-------+-------+
 
26
//
 
27
/////////////////////////////////////////////////////////////////////////////
 
28
 
 
29
#if defined(_DEBUG) 
 
30
        mov             (1)             EntrySignatureC:w                       0xBBBC:w
 
31
#endif  
 
32
 
 
33
//=============== Chroma deblocking ================
 
34
 
 
35
//---------- Deblock UV external top edge ----------
 
36
 
 
37
        and.z.f0.0  (1) null:w          r[ECM_AddrReg, BitFlags]:ub             FilterTopMbEdgeFlag:w           // Check for FilterTopMbEdgeFlag 
 
38
 
 
39
        mov     (1)     f0.1:w          DualFieldMode:w         // Check for dual field mode
 
40
 
 
41
        // Get Luma maskA and maskB     
 
42
        shr (16)        TempRow0(0)<1>          r[ECM_AddrReg, wEdgeCntlMapA_ExtTopHorz0]<0;1,0>:uw             RRampW(0)
 
43
        shr (16)        TempRow1(0)<1>          r[ECM_AddrReg, wEdgeCntlMapB_ExtTopHorz0]<0;1,0>:uw             RRampW(0)
 
44
 
 
45
    (f0.0)      jmpi    H0_UV_DONE                              // Skip H0 UV edge
 
46
 
 
47
        (f0.1) jmpi DUAL_FIELD_UV
 
48
 
 
49
        // Non dual field mode  
 
50
 
 
51
        // Extract UV MaskA and MaskB from every other bit of Y masks
 
52
        and.nz.f0.0 (8) null:w                  TempRow0(0)<16;8,2>             1:w
 
53
        and.nz.f0.1 (8) null:w                  TempRow1(0)<16;8,2>             1:w
 
54
 
 
55
        // Ext U
 
56
        //      p1 = Prev MB U row 0
 
57
        //      p0 = Prev MB U row 1
 
58
        //      q0 = Cur MB U row 0
 
59
        //      q1 = Cur MB U row 1
 
60
        mov (1) P_AddrReg:w             PREV_MB_U_BASE:w        { NoDDClr }
 
61
        mov (1) Q_AddrReg:w             SRC_MB_U_BASE:w         { NoDDChk }
 
62
        
 
63
        mov     (8) Mbaff_ALPHA(0,0)<1>         r[ECM_AddrReg, bAlphaTop0_Cb]<0;1,0>:ub
 
64
        mov     (8) Mbaff_BETA(0,0)<1>          r[ECM_AddrReg, bBetaTop0_Cb]<0;1,0>:ub
 
65
        mov (8) Mbaff_TC0(0,0)<1>               r[ECM_AddrReg, bTc0_h00_0_Cb]<1;2,0>:ub
 
66
 
 
67
        // Store UV MaskA and MaskB
 
68
        mov (2)         MaskA<1>:uw                     f0.0<2;2,1>:uw
 
69
 
 
70
        CALL(FILTER_UV_MBAFF, 1)        
 
71
 
 
72
        // Ext V
 
73
        mov (1) P_AddrReg:w             PREV_MB_V_BASE:w        { NoDDClr }
 
74
        mov (1) Q_AddrReg:w             SRC_MB_V_BASE:w         { NoDDChk }
 
75
 
 
76
        mov     (8) Mbaff_ALPHA(0,0)<1>         r[ECM_AddrReg, bAlphaTop0_Cr]<0;1,0>:ub
 
77
        mov     (8) Mbaff_BETA(0,0)<1>          r[ECM_AddrReg, bBetaTop0_Cr]<0;1,0>:ub
 
78
        mov (8) Mbaff_TC0(0,0)<1>               r[ECM_AddrReg, bTc0_h00_0_Cr]<1;2,0>:ub
 
79
 
 
80
        // Set UV MaskA and MaskB
 
81
        mov (2)         f0.0<1>:uw              MaskA<2;2,1>:uw
 
82
 
 
83
        CALL(FILTER_UV_MBAFF, 1)        
 
84
 
 
85
        jmpi H0_UV_DONE 
 
86
        
 
87
DUAL_FIELD_UV:
 
88
        // Dual field mode, FieldModeCurrentMbFlag=0 && FieldModeAboveMbFlag=1
 
89
 
 
90
        //===== Ext U, Top field
 
91
 
 
92
        // Extract UV MaskA and MaskB from every other bit of Y masks
 
93
        and.nz.f0.0 (8) null:w                  TempRow0(0)<16;8,2>             1:w
 
94
        and.nz.f0.1 (8) null:w                  TempRow1(0)<16;8,2>             1:w
 
95
 
 
96
        mov (1) P_AddrReg:w             ABOVE_CUR_MB_BASE:w                     { NoDDClr }
 
97
        mov (1) Q_AddrReg:w             ABOVE_CUR_MB_BASE+32:w          { NoDDChk }
 
98
 
 
99
        mov (16) ABOVE_CUR_MB_UW(0)<1>  PREV_MB_UW(0, 0)<16;8,1>        // Copy p1, p0
 
100
        mov (16) ABOVE_CUR_MB_UW(1)<1>  SRC_UW(0, 0)<16;8,1>            // Copy q1, q0
 
101
 
 
102
        //===== Ext U, top field
 
103
        mov     (8) Mbaff_ALPHA(0,0)<1>         r[ECM_AddrReg, bAlphaTop0_Cb]<0;1,0>:ub
 
104
        mov     (8) Mbaff_BETA(0,0)<1>          r[ECM_AddrReg, bBetaTop0_Cb]<0;1,0>:ub
 
105
        mov (8) Mbaff_TC0(0,0)<1>               r[ECM_AddrReg, bTc0_h00_0_Cb]<1;2,0>:ub
 
106
 
 
107
        // Store UV MaskA and MaskB
 
108
        mov (2)         MaskA<1>:uw                     f0.0<2;2,1>:uw
 
109
 
 
110
        CALL(FILTER_UV_MBAFF, 1)        // Ext U, top field
 
111
 
 
112
        //===== Ext V, top field
 
113
        mov (1) P_AddrReg:w             ABOVE_CUR_MB_BASE+1:w           { NoDDClr }
 
114
        mov (1) Q_AddrReg:w             ABOVE_CUR_MB_BASE+33:w          { NoDDChk }
 
115
 
 
116
        mov     (8) Mbaff_ALPHA(0,0)<1>         r[ECM_AddrReg, bAlphaTop0_Cr]<0;1,0>:ub
 
117
        mov     (8) Mbaff_BETA(0,0)<1>          r[ECM_AddrReg, bBetaTop0_Cr]<0;1,0>:ub
 
118
        mov (8) Mbaff_TC0(0,0)<1>               r[ECM_AddrReg, bTc0_h00_0_Cr]<1;2,0>:ub
 
119
 
 
120
        // Set UV MaskA and MaskB
 
121
        mov (2)         f0.0<1>:uw              MaskA<2;2,1>:uw
 
122
 
 
123
        CALL(FILTER_UV_MBAFF, 1)        // Ext U, top field
 
124
 
 
125
        // Prefetch for bottom field
 
126
        // Get bot field Luma maskA and maskB   
 
127
        shr (16)        TempRow0(0)<1>          r[ECM_AddrReg, wEdgeCntlMapA_ExtTopHorz1]<0;1,0>:uw             RRampW(0)
 
128
        shr (16)        TempRow1(0)<1>          r[ECM_AddrReg, wEdgeCntlMapB_ExtTopHorz1]<0;1,0>:uw             RRampW(0)
 
129
 
 
130
        // Save deblocked top field rows
 
131
        mov (8) PREV_MB_UW(1, 0)<1>             ABOVE_CUR_MB_UW(0, 8)   // Copy p0
 
132
        mov (8) SRC_UW(0, 0)<1>                 ABOVE_CUR_MB_UW(1, 0)   // Copy q0
 
133
        //==========================================================================
 
134
 
 
135
        //===== Ext U, Bot field 
 
136
        
 
137
        // Extract UV MaskA and MaskB from every other bit of Y masks
 
138
        and.nz.f0.0 (8) null:w                  TempRow0(0)<16;8,2>             1:w
 
139
        and.nz.f0.1 (8) null:w                  TempRow1(0)<16;8,2>             1:w
 
140
 
 
141
        mov (1) P_AddrReg:w             ABOVE_CUR_MB_BASE:w                     { NoDDClr }
 
142
        mov (1) Q_AddrReg:w             ABOVE_CUR_MB_BASE+32:w          { NoDDChk }
 
143
 
 
144
        mov (16) ABOVE_CUR_MB_UW(0)<1>  PREV_MB_UW(0, 8)<16;8,1>        // Copy p1, p0
 
145
        mov (16) ABOVE_CUR_MB_UW(1)<1>  SRC_UW(0, 8)<16;8,1>            // Copy q1, q0
 
146
 
 
147
        //===== Ext U, bottom field
 
148
        mov     (8) Mbaff_ALPHA(0,0)<1>         r[ECM_AddrReg, bAlphaTop1_Cb]<0;1,0>:ub
 
149
        mov     (8) Mbaff_BETA(0,0)<1>          r[ECM_AddrReg, bBetaTop1_Cb]<0;1,0>:ub
 
150
        mov (8) Mbaff_TC0(0,0)<1>               r[ECM_AddrReg, bTc0_h00_1_Cb]<1;2,0>:ub
 
151
 
 
152
        // Store UV MaskA and MaskB
 
153
        mov (2)         MaskA<1>:uw                     f0.0<2;2,1>:uw
 
154
 
 
155
        CALL(FILTER_UV_MBAFF, 1)        // Ext U, bottom field
 
156
 
 
157
        //===== Ext V, bot field
 
158
        mov (1) P_AddrReg:w             ABOVE_CUR_MB_BASE+1:w           { NoDDClr }
 
159
        mov (1) Q_AddrReg:w             ABOVE_CUR_MB_BASE+33:w          { NoDDChk }
 
160
 
 
161
        mov     (8) Mbaff_ALPHA(0,0)<1>         r[ECM_AddrReg, bAlphaTop1_Cr]<0;1,0>:ub
 
162
        mov     (8) Mbaff_BETA(0,0)<1>          r[ECM_AddrReg, bBetaTop1_Cr]<0;1,0>:ub
 
163
        mov (8) Mbaff_TC0(0,0)<1>               r[ECM_AddrReg, bTc0_h00_1_Cr]<1;2,0>:ub
 
164
 
 
165
        // Set UV MaskA and MaskB
 
166
        mov (2)         f0.0<1>:uw              MaskA<2;2,1>:uw
 
167
 
 
168
        CALL(FILTER_UV_MBAFF, 1)        // Ext V, bottom field
 
169
        
 
170
        // Save deblocked bot field rows
 
171
        mov (8) PREV_MB_UW(1, 8)<1>             ABOVE_CUR_MB_UW(0, 8)   // Copy p0
 
172
        mov (8) SRC_UW(0, 8)<1>                 ABOVE_CUR_MB_UW(1, 0)   // Copy q0
 
173
        //========================================
 
174
 
 
175
H0_UV_DONE:
 
176
 
 
177
//---------- Deblock U internal horz middle edge ----------
 
178
 
 
179
        //***** Need to take every other bit to form U maskA in core
 
180
        shr (16)        TempRow0(0)<1>          r[ECM_AddrReg, wEdgeCntlMap_IntMidHorz]<0;1,0>:uw               RRampW(0)
 
181
 
 
182
        //      p1 = Cur MB U row 2
 
183
        //      p0 = Cur MB U row 3
 
184
        //      q0 = Cur MB U row 4
 
185
        //      q1 = Cur MB U row 5
 
186
        mov (1) P_AddrReg:w             4*UV_ROW_WIDTH+SRC_MB_U_BASE:w          { NoDDClr }
 
187
        mov (1) Q_AddrReg:w             8*UV_ROW_WIDTH+SRC_MB_U_BASE:w          { NoDDChk }
 
188
 
 
189
        mov     (8) Mbaff_ALPHA(0,0)<1>         r[ECM_AddrReg, bAlphaInternal_Cb]<0;1,0>:ub
 
190
        mov     (8) Mbaff_BETA(0,0)<1>          r[ECM_AddrReg, bBetaInternal_Cb]<0;1,0>:ub
 
191
        mov (8) Mbaff_TC0(0,0)<1>               r[ECM_AddrReg, bTc0_h20_Cb]<1;2,0>:ub
 
192
 
 
193
        and.nz.f0.0 (8) null:w                  TempRow0(0)<16;8,2>             1:w
 
194
 
 
195
        // Store UV MaskA and MaskB
 
196
        mov (1) f0.1:uw         0:w
 
197
        mov (1) MaskB:uw        0:w                     { NoDDClr }
 
198
        mov (1) MaskA:uw        f0.0:uw         { NoDDChk }
 
199
 
 
200
        CALL(FILTER_UV_MBAFF, 1)        
 
201
//-----------------------------------------------
 
202
 
 
203
 
 
204
//---------- Deblock V internal horz middle edge ----------
 
205
 
 
206
        //      p1 = Cur MB V row 2
 
207
        //      p0 = Cur MB V row 3
 
208
        //      q0 = Cur MB V row 4
 
209
        //      q1 = Cur MB V row 5
 
210
        mov (1) P_AddrReg:w             4*UV_ROW_WIDTH+SRC_MB_V_BASE:w          { NoDDClr }
 
211
        mov (1) Q_AddrReg:w             8*UV_ROW_WIDTH+SRC_MB_V_BASE:w          { NoDDChk }
 
212
 
 
213
        mov     (8) Mbaff_ALPHA(0,0)<1>         r[ECM_AddrReg, bAlphaInternal_Cr]<0;1,0>:ub
 
214
        mov     (8) Mbaff_BETA(0,0)<1>          r[ECM_AddrReg, bBetaInternal_Cr]<0;1,0>:ub
 
215
        mov (8) Mbaff_TC0(0,0)<1>               r[ECM_AddrReg, bTc0_h20_Cr]<1;2,0>:ub
 
216
 
 
217
        // Set UV MaskA and MaskB
 
218
        mov (2)         f0.0<1>:uw              MaskA<2;2,1>:uw
 
219
 
 
220
        CALL(FILTER_UV_MBAFF, 1)        
 
221
//-----------------------------------------------
 
222
 
 
223