~ubuntu-branches/ubuntu/maverick/vlc/maverick

« back to all changes in this revision

Viewing changes to extras/x264/common/i386/mc-a.asm

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello, Mario Limonciello, Martin Hamrle
  • Date: 2008-03-25 20:08:07 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20080325200807-64amsvla1tnnen5s
Tags: 0.8.6.release.e+x264svn20071224+faad2.6.1-0ubuntu1
[ Mario Limonciello ]
* New upstream version. (LP: #206918)
  - New versioning scheme to bring attention to the fact that
    faad and x264 are in the .orig.tar.gz.
  - Fixes 6 CVEs (LP: #196452)
    + CVE: 2007-6681
    + CVE: 2007-6682
    + CVE: 2007-6683
    + CVE: 2008-0295
    + CVE: 2008-0296
* Drop 021_CVE-2008-0984 as it's included upstream.
* debian/rules:
  - Adjust items touched for faad2 when building.
  - Apply all faad2 patches when building
* debian/control:
  - Add dpatch, libfaad-dev, and autotools-dev to build-depends to allow 
    faad2 to build again.
  - Add automake, cvs, and libtool to build depends (now needed for building VLC)

[ Martin Hamrle ]
 * Add new package with pulse output plugin (LP: #196417)
   - debian/patches/030_pulse.diff:
     + patch from upstream trunk to support pulseaudio output
   - debian/rules:
     + enable pulseaudio
   - debian/control:
     + add dependencies to libpulse-dev
     + new package description
   - Creates a NEW binary package, requiring FFe (LP: #204050)

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
;=============================================================================
62
62
 
63
63
;-----------------------------------------------------------------------------
64
 
; void x264_pixel_avg_w4_mmxext( uint8_t *dst,  int i_dst_stride,
65
 
;                                uint8_t *src1, int i_src1_stride,
66
 
;                                uint8_t *src2, int i_src2_stride,
67
 
;                                int i_height );
68
 
;-----------------------------------------------------------------------------
69
 
cglobal x264_pixel_avg_w4_mmxext
70
 
    push        ebp
71
 
    push        ebx
72
 
    push        esi
73
 
    push        edi
74
 
 
75
 
    mov         edi, [esp+20]       ; dst
76
 
    mov         ebx, [esp+28]       ; src1
77
 
    mov         ecx, [esp+36]       ; src2
78
 
    mov         esi, [esp+24]       ; i_dst_stride
79
 
    mov         eax, [esp+32]       ; i_src1_stride
80
 
    mov         edx, [esp+40]       ; i_src2_stride
81
 
    mov         ebp, [esp+44]       ; i_height
82
 
ALIGN 4
83
 
.height_loop    
84
 
    movd        mm0, [ebx]
85
 
    pavgb       mm0, [ecx]
86
 
    movd        mm1, [ebx+eax]
87
 
    pavgb       mm1, [ecx+edx]
88
 
    movd        [edi], mm0
89
 
    movd        [edi+esi], mm1
90
 
    dec         ebp
91
 
    dec         ebp
92
 
    lea         ebx, [ebx+eax*2]
93
 
    lea         ecx, [ecx+edx*2]
94
 
    lea         edi, [edi+esi*2]
95
 
    jg          .height_loop
96
 
 
97
 
    pop         edi
98
 
    pop         esi
99
 
    pop         ebx
100
 
    pop         ebp
101
 
    ret
102
 
 
103
 
                          
104
 
 
105
 
;-----------------------------------------------------------------------------
106
 
; void x264_pixel_avg_w8_mmxext( uint8_t *dst,  int i_dst_stride,
107
 
;                                uint8_t *src1, int i_src1_stride,
108
 
;                                uint8_t *src2, int i_src2_stride,
109
 
;                                int i_height );
110
 
;-----------------------------------------------------------------------------
111
 
cglobal x264_pixel_avg_w8_mmxext
112
 
    push        ebp
113
 
    push        ebx
114
 
    push        esi
115
 
    push        edi
116
 
 
117
 
    mov         edi, [esp+20]       ; dst
118
 
    mov         ebx, [esp+28]       ; src1
119
 
    mov         ecx, [esp+36]       ; src2
120
 
    mov         esi, [esp+24]       ; i_dst_stride
121
 
    mov         eax, [esp+32]       ; i_src1_stride
122
 
    mov         edx, [esp+40]       ; i_src2_stride
123
 
    mov         ebp, [esp+44]       ; i_height
124
 
ALIGN 4
125
 
.height_loop    
126
 
    movq        mm0, [ebx]
127
 
    pavgb       mm0, [ecx]
128
 
    movq        [edi], mm0
129
 
    dec         ebp
130
 
    lea         ebx, [ebx+eax]
131
 
    lea         ecx, [ecx+edx]
132
 
    lea         edi, [edi+esi]
133
 
    jg          .height_loop
134
 
 
135
 
    pop         edi
136
 
    pop         esi
137
 
    pop         ebx
138
 
    pop         ebp
139
 
    ret
140
 
 
141
 
 
142
 
 
143
 
;-----------------------------------------------------------------------------
144
 
; void x264_pixel_avg_w16_mmxext( uint8_t *dst,  int i_dst_stride,
145
 
;                                 uint8_t *src1, int i_src1_stride,
146
 
;                                 uint8_t *src2, int i_src2_stride,
147
 
;                                 int i_height );
148
 
;-----------------------------------------------------------------------------
149
 
cglobal x264_pixel_avg_w16_mmxext
150
 
    push        ebp
151
 
    push        ebx
152
 
    push        esi
153
 
    push        edi
154
 
 
155
 
    mov         edi, [esp+20]       ; dst
156
 
    mov         ebx, [esp+28]       ; src1
157
 
    mov         ecx, [esp+36]       ; src2
158
 
    mov         esi, [esp+24]       ; i_dst_stride
159
 
    mov         eax, [esp+32]       ; i_src1_stride
160
 
    mov         edx, [esp+40]       ; i_src2_stride
161
 
    mov         ebp, [esp+44]       ; i_height
162
 
ALIGN 4
163
 
.height_loop    
164
 
    movq        mm0, [ebx  ]
165
 
    movq        mm1, [ebx+8]
166
 
    pavgb       mm0, [ecx  ]
167
 
    pavgb       mm1, [ecx+8]
168
 
    movq        [edi  ], mm0
169
 
    movq        [edi+8], mm1
170
 
    dec         ebp
171
 
    lea         ebx, [ebx+eax]
172
 
    lea         ecx, [ecx+edx]
173
 
    lea         edi, [edi+esi]
174
 
    jg          .height_loop
175
 
 
176
 
    pop         edi
177
 
    pop         esi
178
 
    pop         ebx
179
 
    pop         ebp
180
 
    ret
181
 
 
182
 
 
183
 
 
184
 
;-----------------------------------------------------------------------------
185
 
; void x264_pixel_avg_w20_mmxext( uint8_t *dst,  int i_dst_stride,
186
 
;                                 uint8_t *src1, int i_src1_stride,
187
 
;                                 uint8_t *src2, int i_src2_stride,
188
 
;                                 int i_height );
189
 
;-----------------------------------------------------------------------------
190
 
cglobal x264_pixel_avg_w20_mmxext
191
 
    push        ebp
192
 
    push        ebx
193
 
    push        esi
194
 
    push        edi
195
 
 
196
 
    mov         edi, [esp+20]       ; dst
197
 
    mov         ebx, [esp+28]       ; src1
198
 
    mov         ecx, [esp+36]       ; src2
199
 
    mov         esi, [esp+24]       ; i_dst_stride
200
 
    mov         eax, [esp+32]       ; i_src1_stride
201
 
    mov         edx, [esp+40]       ; i_src2_stride
202
 
    mov         ebp, [esp+44]       ; i_height
203
 
ALIGN 4
204
 
.height_loop    
205
 
    movq        mm0, [ebx   ]
206
 
    movq        mm1, [ebx+8 ]
207
 
    movd        mm2, [ebx+16]
208
 
    pavgb       mm0, [ecx   ]
209
 
    pavgb       mm1, [ecx+8 ]
210
 
    pavgb       mm2, [ecx+16]
211
 
    movq        [edi   ], mm0
212
 
    movq        [edi+8 ], mm1
213
 
    movd        [edi+16], mm2
214
 
    dec         ebp
215
 
    lea         ebx, [ebx+eax]
216
 
    lea         ecx, [ecx+edx]
217
 
    lea         edi, [edi+esi]
218
 
    jg          .height_loop
219
 
 
220
 
    pop         edi
221
 
    pop         esi
222
 
    pop         ebx
223
 
    pop         ebp
224
 
    ret
225
 
 
226
 
 
227
 
 
228
 
ALIGN 16
229
 
;-----------------------------------------------------------------------------
230
 
; void x264_pixel_avg_w16_sse2( uint8_t *dst,  int i_dst_stride,
231
 
;                               uint8_t *src1, int i_src1_stride,
232
 
;                               uint8_t *src2, int i_src2_stride,
233
 
;                               int i_height );
234
 
;-----------------------------------------------------------------------------
235
 
cglobal x264_pixel_avg_w16_sse2
236
 
    push        ebp
237
 
    push        ebx
238
 
    push        esi
239
 
    push        edi
240
 
 
241
 
    mov         edi, [esp+20]       ; dst
242
 
    mov         ebx, [esp+28]       ; src1
243
 
    mov         ecx, [esp+36]       ; src2
244
 
    mov         esi, [esp+24]       ; i_dst_stride
245
 
    mov         eax, [esp+32]       ; i_src1_stride
246
 
    mov         edx, [esp+40]       ; i_src2_stride
247
 
    mov         ebp, [esp+44]       ; i_height
248
 
ALIGN 4
249
 
.height_loop    
250
 
    movdqu      xmm0, [ebx]
251
 
    pavgb       xmm0, [ecx]
252
 
    movdqu      [edi], xmm0
253
 
 
254
 
    dec         ebp
255
 
    lea         ebx, [ebx+eax]
256
 
    lea         ecx, [ecx+edx]
257
 
    lea         edi, [edi+esi]
258
 
    jg          .height_loop
259
 
 
260
 
    pop         edi
261
 
    pop         esi
262
 
    pop         ebx
263
 
    pop         ebp
264
 
    ret
 
64
; void x264_pixel_avg_w4_mmxext( uint8_t *dst, int dst_stride,
 
65
;                                uint8_t *src, int src_stride,
 
66
;                                int height );
 
67
;-----------------------------------------------------------------------------
 
68
%macro AVG_START 1
 
69
cglobal %1
 
70
    push   ebx
 
71
    mov    eax, [esp+12]  ; dst
 
72
    mov    ebx, [esp+16]  ; dst_stride
 
73
    mov    ecx, [esp+20]  ; src
 
74
    mov    edx, [esp+24]  ; src_stride
 
75
    ; esi = height
 
76
.height_loop:
 
77
%endmacro
 
78
 
 
79
%macro AVG_END 0
 
80
    sub    esi, 2
 
81
    lea    eax, [eax+ebx*2]
 
82
    lea    ecx, [ecx+edx*2]
 
83
    jg     .height_loop
 
84
    pop    ebx
 
85
    pop    esi
 
86
    ret
 
87
%endmacro
 
88
 
 
89
AVG_START x264_pixel_avg_w4_mmxext
 
90
    movd   mm0, [ecx]
 
91
    movd   mm1, [ecx+edx]
 
92
    pavgb  mm0, [eax]
 
93
    pavgb  mm1, [eax+ebx]
 
94
    movd   [eax], mm0
 
95
    movd   [eax+ebx], mm1
 
96
AVG_END
 
97
 
 
98
AVG_START x264_pixel_avg_w8_mmxext
 
99
    movq   mm0, [ecx]
 
100
    movq   mm1, [ecx+edx]
 
101
    pavgb  mm0, [eax]
 
102
    pavgb  mm1, [eax+ebx]
 
103
    movq   [eax], mm0
 
104
    movq   [eax+ebx], mm1
 
105
AVG_END
 
106
 
 
107
AVG_START x264_pixel_avg_w16_mmxext
 
108
    movq   mm0, [ecx]
 
109
    movq   mm1, [ecx+8]
 
110
    movq   mm2, [ecx+edx]
 
111
    movq   mm3, [ecx+edx+8]
 
112
    pavgb  mm0, [eax]
 
113
    pavgb  mm1, [eax+8]
 
114
    pavgb  mm2, [eax+ebx]
 
115
    pavgb  mm3, [eax+ebx+8]
 
116
    movq   [eax], mm0
 
117
    movq   [eax+8], mm1
 
118
    movq   [eax+ebx], mm2
 
119
    movq   [eax+ebx+8], mm3
 
120
AVG_END
 
121
 
 
122
AVG_START x264_pixel_avg_w16_sse2
 
123
    movdqu xmm0, [ecx]
 
124
    movdqu xmm1, [ecx+edx]
 
125
    pavgb  xmm0, [eax]
 
126
    pavgb  xmm1, [eax+ebx]
 
127
    movdqa [eax], xmm0
 
128
    movdqa [eax+ebx], xmm1
 
129
AVG_END
 
130
 
 
131
%macro AVGH 2
 
132
cglobal x264_pixel_avg_%1x%2_mmxext
 
133
    push esi
 
134
    mov esi, %2
 
135
    jmp x264_pixel_avg_w%1_mmxext
 
136
%endmacro
 
137
 
 
138
AVGH 16, 16
 
139
AVGH 16, 8
 
140
AVGH 8, 16
 
141
AVGH 8, 8
 
142
AVGH 8, 4
 
143
AVGH 4, 8
 
144
AVGH 4, 4
 
145
AVGH 4, 2
 
146
 
 
147
%macro AVG2_START 1
 
148
cglobal %1
 
149
    push   ebx
 
150
    push   esi
 
151
    push   edi
 
152
    push   ebp
 
153
    mov    eax, [esp+20]  ; dst
 
154
    mov    ebx, [esp+24]  ; dst_stride
 
155
    mov    ecx, [esp+28]  ; src1
 
156
    mov    edx, [esp+32]  ; src_stride
 
157
    mov    edi, [esp+36]  ; src2
 
158
    mov    esi, [esp+40]  ; height
 
159
    sub    edi, ecx
 
160
    lea    ebp, [edi+edx]
 
161
.height_loop:
 
162
%endmacro
 
163
 
 
164
%macro AVG2_END 0
 
165
    sub    esi, 2
 
166
    lea    eax, [eax+ebx*2]
 
167
    lea    ecx, [ecx+edx*2]
 
168
    jg     .height_loop
 
169
    pop    ebp
 
170
    pop    edi
 
171
    pop    esi
 
172
    pop    ebx
 
173
    ret
 
174
%endmacro
 
175
 
 
176
AVG2_START x264_pixel_avg2_w4_mmxext
 
177
    movd   mm0, [ecx]
 
178
    movd   mm1, [ecx+edx]
 
179
    pavgb  mm0, [ecx+edi]
 
180
    pavgb  mm1, [ecx+ebp]
 
181
    movd   [eax], mm0
 
182
    movd   [eax+ebx], mm1
 
183
AVG2_END
 
184
 
 
185
AVG2_START x264_pixel_avg2_w8_mmxext
 
186
    movq   mm0, [ecx]
 
187
    movq   mm1, [ecx+edx]
 
188
    pavgb  mm0, [ecx+edi]
 
189
    pavgb  mm1, [ecx+ebp]
 
190
    movq   [eax], mm0
 
191
    movq   [eax+ebx], mm1
 
192
AVG2_END
 
193
 
 
194
AVG2_START x264_pixel_avg2_w16_mmxext
 
195
    movq   mm0, [ecx]
 
196
    movq   mm1, [ecx+8]
 
197
    movq   mm2, [ecx+edx]
 
198
    movq   mm3, [ecx+edx+8]
 
199
    pavgb  mm0, [ecx+edi]
 
200
    pavgb  mm1, [ecx+edi+8]
 
201
    pavgb  mm2, [ecx+ebp]
 
202
    pavgb  mm3, [ecx+ebp+8]
 
203
    movq   [eax], mm0
 
204
    movq   [eax+8], mm1
 
205
    movq   [eax+ebx], mm2
 
206
    movq   [eax+ebx+8], mm3
 
207
AVG2_END
 
208
 
 
209
AVG2_START x264_pixel_avg2_w20_mmxext
 
210
    movq   mm0, [ecx]
 
211
    movq   mm1, [ecx+8]
 
212
    movd   mm2, [ecx+16]
 
213
    movq   mm3, [ecx+edx]
 
214
    movq   mm4, [ecx+edx+8]
 
215
    movd   mm5, [ecx+edx+16]
 
216
    pavgb  mm0, [ecx+edi]
 
217
    pavgb  mm1, [ecx+edi+8]
 
218
    pavgb  mm2, [ecx+edi+16]
 
219
    pavgb  mm3, [ecx+ebp]
 
220
    pavgb  mm4, [ecx+ebp+8]
 
221
    pavgb  mm5, [ecx+ebp+16]
 
222
    movq   [eax], mm0
 
223
    movq   [eax+8], mm1
 
224
    movd   [eax+16], mm2
 
225
    movq   [eax+ebx], mm3
 
226
    movq   [eax+ebx+8], mm4
 
227
    movd   [eax+ebx+16], mm5
 
228
AVG2_END
 
229
 
265
230
 
266
231
 
267
232
;=============================================================================
519
484
;=============================================================================
520
485
 
521
486
;-----------------------------------------------------------------------------
522
 
;   void x264_mc_chroma_mmxext( uint8_t *src, int i_src_stride,
523
 
;                               uint8_t *dst, int i_dst_stride,
 
487
;   void x264_mc_chroma_mmxext( uint8_t *dst, int i_dst_stride,
 
488
;                               uint8_t *src, int i_src_stride,
524
489
;                               int dx, int dy,
525
490
;                               int i_width, int i_height )
526
491
;-----------------------------------------------------------------------------
536
501
    mov     edi, edx
537
502
    sar     ecx, 3
538
503
    sar     edx, 3
539
 
    imul    ecx, [picesp+4+8]
 
504
    imul    ecx, [picesp+4+16]
540
505
    add     ecx, edx
541
 
    add     [picesp+4+4], ecx     ; src += (dx>>3) + (dy>>3) * src_stride
 
506
    add     [picesp+4+12], ecx   ; src += (dx>>3) + (dy>>3) * src_stride
542
507
 
543
508
    pxor    mm3, mm3
544
509
 
561
526
    pmullw  mm6, mm4            ; mm6 = (8-dx)*dy =     cC
562
527
    pmullw  mm4, mm0            ; mm4 = (8-dx)*(8-dy) = cA
563
528
 
564
 
    mov     eax, [picesp+4+4]   ; src
565
 
    mov     edi, [picesp+4+12]  ; dst
566
 
    mov     ecx, [picesp+4+8]   ; i_src_stride
 
529
    mov     eax, [picesp+4+12]  ; src
 
530
    mov     edi, [picesp+4+4]   ; dst
 
531
    mov     ecx, [picesp+4+16]  ; i_src_stride
567
532
    mov     edx, [picesp+4+32]  ; i_height
568
533
 
569
534
ALIGN 4
595
560
    movd    [edi], mm0
596
561
 
597
562
    add     eax, ecx
598
 
    add     edi, [picesp+4+16]
 
563
    add     edi, [picesp+4+8]
599
564
 
600
565
    dec     edx
601
566
    jnz     .height_loop
603
568
    sub     [picesp+4+28], dword 8
604
569
    jnz     .finish            ; width != 8 so assume 4
605
570
 
606
 
    mov     edi, [picesp+4+12] ; dst
607
 
    mov     eax, [picesp+4+4]  ; src
 
571
    mov     edi, [picesp+4+4]  ; dst
 
572
    mov     eax, [picesp+4+12] ; src
608
573
    mov     edx, [picesp+4+32] ; i_height
609
574
    add     edi, 4
610
575
    add     eax, 4