[svn] / trunk / xvidcore / src / image / x86_asm / interpolate8x8_mmx.asm Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/image/x86_asm/interpolate8x8_mmx.asm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 651, Sun Nov 17 00:20:30 2002 UTC revision 1382, Mon Mar 22 22:36:25 2004 UTC
# Line 1  Line 1 
1  ;/*****************************************************************************  ;/*****************************************************************************
2  ; *  ; *
3  ; *  XVID MPEG-4 VIDEO CODEC  ; *  XVID MPEG-4 VIDEO CODEC
4  ; *      mmx 8x8 block-based halfpel interpolation  ; *  - mmx 8x8 block-based halfpel interpolation -
5  ; *  ; *
6  ; *  Copyright(C) 2002 Peter Ross <pross@xvid.org>  ; *  Copyright(C) 2001 Peter Ross <pross@xvid.org>
7    ; *               2002 Michael Militzer <isibaar@xvid.org>
8  ; *  ; *
9  ; *  This file is part of XviD, a free MPEG-4 video encoder/decoder  ; *  This program is free software ; you can redistribute it and/or modify
10  ; *  ; *  it under the terms of the GNU General Public License as published by
 ; *  XviD is free software; you can redistribute it and/or modify it  
 ; *  under the terms of the GNU General Public License as published by  
11  ; *  the Free Software Foundation; either version 2 of the License, or  ; *  the Free Software Foundation; either version 2 of the License, or
12  ; *  (at your option) any later version.  ; *  (at your option) any later version.
13  ; *  ; *
# Line 21  Line 20 
20  ; *  along with this program; if not, write to the Free Software  ; *  along with this program; if not, write to the Free Software
21  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22  ; *  ; *
 ; *  Under section 8 of the GNU General Public License, the copyright  
 ; *  holders of XVID explicitly forbid distribution in the following  
 ; *  countries:  
 ; *  
 ; *    - Japan  
 ; *    - United States of America  
 ; *  
 ; *  Linking XviD statically or dynamically with other modules is making a  
 ; *  combined work based on XviD.  Thus, the terms and conditions of the  
 ; *  GNU General Public License cover the whole combination.  
 ; *  
 ; *  As a special exception, the copyright holders of XviD give you  
 ; *  permission to link XviD with independent modules that communicate with  
 ; *  XviD solely through the VFW1.1 and DShow interfaces, regardless of the  
 ; *  license terms of these independent modules, and to copy and distribute  
 ; *  the resulting combined work under terms of your choice, provided that  
 ; *  every copy of the combined work is accompanied by a complete copy of  
 ; *  the source code of XviD (the version of XviD used to produce the  
 ; *  combined work), being distributed under the terms of the GNU General  
 ; *  Public License plus this exception.  An independent module is a module  
 ; *  which is not derived from or based on XviD.  
 ; *  
 ; *  Note that people who make modified versions of XviD are not obligated  
 ; *  to grant this special exception for their modified versions; it is  
 ; *  their choice whether to do so.  The GNU General Public License gives  
 ; *  permission to release a modified version without this exception; this  
 ; *  exception also makes it possible to release a modified version which  
 ; *  carries forward this exception.  
 ; *  
 ; * $Id: interpolate8x8_mmx.asm,v 1.11 2002-11-17 00:20:30 edgomez Exp $  
 ; *  
23  ; ****************************************************************************/  ; ****************************************************************************/
24    
25  bits 32  BITS 32
26    
27  %macro cglobal 1  %macro cglobal 1
28          %ifdef PREFIX          %ifdef PREFIX
# Line 65  Line 33 
33          %endif          %endif
34  %endmacro  %endmacro
35    
36  section .data  ;=============================================================================
37    ; Read only data
38    ;=============================================================================
39    
40  align 16  %ifdef FORMAT_COFF
41    SECTION .rodata data
42    %else
43    SECTION .rodata data align=16
44    %endif
45    
46    ;-----------------------------------------------------------------------------
47    ; (16 - r) rounding table
48    ;-----------------------------------------------------------------------------
49    
50    ALIGN 16
51    rounding_lowpass_mmx:
52            times 4 dw 16
53            times 4 dw 15
54    
55  ;===========================================================================  ;-----------------------------------------------------------------------------
56  ; (1 - r) rounding table  ; (1 - r) rounding table
57  ;===========================================================================  ;-----------------------------------------------------------------------------
58    
59  rounding1_mmx  rounding1_mmx:
60  times 4 dw 1  times 4 dw 1
61  times 4 dw 0  times 4 dw 0
62    
63  ;===========================================================================  ;-----------------------------------------------------------------------------
64  ; (2 - r) rounding table  ; (2 - r) rounding table
65  ;===========================================================================  ;-----------------------------------------------------------------------------
66    
67  rounding2_mmx  rounding2_mmx:
68  times 4 dw 2  times 4 dw 2
69  times 4 dw 1  times 4 dw 1
70    
71  mmx_one  mmx_one:
72  times 8 db 1  times 8 db 1
73    
74  section .text  mmx_two:
75            times 8 db 2
76    
77    mmx_three:
78            times 8 db 3
79    
80    mmx_five:
81            times 4 dw 5
82    
83    mmx_mask:
84            times 8 db 254
85    
86    mmx_mask2:
87            times 8 db 252
88    
89    ;=============================================================================
90    ; Code
91    ;=============================================================================
92    
93    SECTION .text
94    
95    cglobal interpolate8x8_halfpel_h_mmx
96    cglobal interpolate8x8_halfpel_v_mmx
97    cglobal interpolate8x8_halfpel_hv_mmx
98    cglobal interpolate8x8_avg4_mmx
99    cglobal interpolate8x8_avg2_mmx
100    cglobal interpolate8x8_6tap_lowpass_h_mmx
101    cglobal interpolate8x8_6tap_lowpass_v_mmx
102    
103  %macro  CALC_AVG 6  %macro  CALC_AVG 6
104          punpcklbw %3, %6          punpcklbw %3, %6
# Line 101  Line 111 
111    
112          psrlw %1, 1                     ; mm01 >>= 1          psrlw %1, 1                     ; mm01 >>= 1
113          psrlw %2, 1          psrlw %2, 1
   
114  %endmacro  %endmacro
115    
116    
117  ;===========================================================================  ;-----------------------------------------------------------------------------
118  ;  ;
119  ; void interpolate8x8_halfpel_h_mmx(uint8_t * const dst,  ; void interpolate8x8_halfpel_h_mmx(uint8_t * const dst,
120  ;                                               const uint8_t * const src,  ;                                               const uint8_t * const src,
121  ;                                               const uint32_t stride,  ;                                               const uint32_t stride,
122  ;                                               const uint32_t rounding);  ;                                               const uint32_t rounding);
123  ;  ;
124  ;===========================================================================  ;-----------------------------------------------------------------------------
125    
126  %macro COPY_H_MMX 0  %macro COPY_H_MMX 0
127                  movq mm0, [esi]                  movq mm0, [esi]
# Line 132  Line 141 
141                  add edi, edx            ; dst += stride                  add edi, edx            ; dst += stride
142  %endmacro  %endmacro
143    
144  align 16  ALIGN 16
145  cglobal interpolate8x8_halfpel_h_mmx  interpolate8x8_halfpel_h_mmx:
 interpolate8x8_halfpel_h_mmx  
146    
147                  push    esi                  push    esi
148                  push    edi                  push    edi
   
149                  mov     eax, [esp + 8 + 16]             ; rounding                  mov     eax, [esp + 8 + 16]             ; rounding
150    
 interpolate8x8_halfpel_h_mmx.start  
151                  movq mm7, [rounding1_mmx + eax * 8]                  movq mm7, [rounding1_mmx + eax * 8]
152    
153                  mov     edi, [esp + 8 + 4]              ; dst                  mov     edi, [esp + 8 + 4]              ; dst
# Line 165  Line 171 
171                  ret                  ret
172    
173    
174  ;===========================================================================  ;-----------------------------------------------------------------------------
175  ;  ;
176  ; void interpolate8x8_halfpel_v_mmx(uint8_t * const dst,  ; void interpolate8x8_halfpel_v_mmx(uint8_t * const dst,
177  ;                                               const uint8_t * const src,  ;                                               const uint8_t * const src,
178  ;                                               const uint32_t stride,  ;                                               const uint32_t stride,
179  ;                                               const uint32_t rounding);  ;                                               const uint32_t rounding);
180  ;  ;
181  ;===========================================================================  ;-----------------------------------------------------------------------------
182    
183  %macro COPY_V_MMX 0  %macro COPY_V_MMX 0
184                  movq mm0, [esi]                  movq mm0, [esi]
# Line 192  Line 198 
198                  add edi, edx            ; dst += stride                  add edi, edx            ; dst += stride
199  %endmacro  %endmacro
200    
201  align 16  ALIGN 16
202  cglobal interpolate8x8_halfpel_v_mmx  interpolate8x8_halfpel_v_mmx:
 interpolate8x8_halfpel_v_mmx  
203    
204                  push    esi                  push    esi
205                  push    edi                  push    edi
206    
207                  mov     eax, [esp + 8 + 16]             ; rounding                  mov     eax, [esp + 8 + 16]             ; rounding
208    
 interpolate8x8_halfpel_v_mmx.start  
209                  movq mm7, [rounding1_mmx + eax * 8]                  movq mm7, [rounding1_mmx + eax * 8]
210    
211                  mov     edi, [esp + 8 + 4]              ; dst                  mov     edi, [esp + 8 + 4]              ; dst
# Line 226  Line 230 
230                  ret                  ret
231    
232    
233  ;===========================================================================  ;-----------------------------------------------------------------------------
234  ;  ;
235  ; void interpolate8x8_halfpel_hv_mmx(uint8_t * const dst,  ; void interpolate8x8_halfpel_hv_mmx(uint8_t * const dst,
236  ;                                               const uint8_t * const src,  ;                                               const uint8_t * const src,
# Line 234  Line 238 
238  ;                                               const uint32_t rounding);  ;                                               const uint32_t rounding);
239  ;  ;
240  ;  ;
241  ;===========================================================================  ;-----------------------------------------------------------------------------
242    
243  %macro COPY_HV_MMX 0  %macro COPY_HV_MMX 0
244                  ; current row                  ; current row
   
245                  movq mm0, [esi]                  movq mm0, [esi]
246                  movq mm2, [esi + 1]                  movq mm2, [esi + 1]
247    
# Line 254  Line 257 
257                  paddusw mm1, mm3                  paddusw mm1, mm3
258    
259                  ; next row                  ; next row
   
260                  movq mm4, [esi + edx]                  movq mm4, [esi + edx]
261                  movq mm2, [esi + edx + 1]                  movq mm2, [esi + edx + 1]
262    
# Line 270  Line 272 
272                  paddusw mm5, mm3                  paddusw mm5, mm3
273    
274                  ; add current + next row                  ; add current + next row
   
275                  paddusw mm0, mm4                ; mm01 += mm45                  paddusw mm0, mm4                ; mm01 += mm45
276                  paddusw mm1, mm5                  paddusw mm1, mm5
277                  paddusw mm0, mm7                ; mm01 += rounding2                  paddusw mm0, mm7                ; mm01 += rounding2
# Line 286  Line 287 
287                  add edi, edx            ; dst += stride                  add edi, edx            ; dst += stride
288  %endmacro  %endmacro
289    
290  align 16  ALIGN 16
291  cglobal interpolate8x8_halfpel_hv_mmx  interpolate8x8_halfpel_hv_mmx:
 interpolate8x8_halfpel_hv_mmx  
292    
293                  push    esi                  push    esi
294                  push    edi                  push    edi
295    
296                  mov     eax, [esp + 8 + 16]             ; rounding                  mov     eax, [esp + 8 + 16]             ; rounding
 interpolate8x8_halfpel_hv_mmx.start  
297    
298                  movq mm7, [rounding2_mmx + eax * 8]                  movq mm7, [rounding2_mmx + eax * 8]
299    
# Line 320  Line 319 
319                  pop esi                  pop esi
320    
321                  ret                  ret
322    
323    ;-----------------------------------------------------------------------------
324    ;
325    ; void interpolate8x8_avg2_mmx(uint8_t const *dst,
326    ;                              const uint8_t * const src1,
327    ;                              const uint8_t * const src2,
328    ;                              const uint32_t stride,
329    ;                              const uint32_t rounding,
330    ;                              const uint32_t height);
331    ;
332    ;-----------------------------------------------------------------------------
333    
334    %macro AVG2_MMX_RND0 0
335      movq mm0, [eax]           ; src1 -> mm0
336      movq mm1, [ebx]           ; src2 -> mm1
337    
338      movq mm4, [eax+edx]
339      movq mm5, [ebx+edx]
340    
341      movq mm2, mm0             ; src1 -> mm2
342      movq mm3, mm1             ; src2 -> mm3
343    
344      pand mm2, mm7             ; isolate the lsb
345      pand mm3, mm7             ; isolate the lsb
346    
347      por mm2, mm3              ; ODD(src1) OR ODD(src2) -> mm2
348    
349      movq mm3, mm4
350      movq mm6, mm5
351    
352      pand mm3, mm7
353      pand mm6, mm7
354    
355      por mm3, mm6
356    
357      pand mm0, [mmx_mask]
358      pand mm1, [mmx_mask]
359      pand mm4, [mmx_mask]
360      pand mm5, [mmx_mask]
361    
362      psrlq mm0, 1              ; src1 / 2
363      psrlq mm1, 1              ; src2 / 2
364    
365      psrlq mm4, 1
366      psrlq mm5, 1
367    
368      paddb mm0, mm1            ; src1/2 + src2/2 -> mm0
369      paddb mm0, mm2            ; correct rounding error
370    
371      paddb mm4, mm5
372      paddb mm4, mm3
373    
374      lea eax, [eax+2*edx]
375      lea ebx, [ebx+2*edx]
376    
377      movq [ecx], mm0           ; (src1 + src2 + 1) / 2 -> dst
378      movq [ecx+edx], mm4
379    %endmacro
380    
381    %macro AVG2_MMX_RND1 0
382      movq mm0, [eax]           ; src1 -> mm0
383      movq mm1, [ebx]           ; src2 -> mm1
384    
385      movq mm4, [eax+edx]
386      movq mm5, [ebx+edx]
387    
388      movq mm2, mm0             ; src1 -> mm2
389      movq mm3, mm1             ; src2 -> mm3
390    
391      pand mm2, mm7             ; isolate the lsb
392      pand mm3, mm7             ; isolate the lsb
393    
394      pand mm2, mm3             ; ODD(src1) AND ODD(src2) -> mm2
395    
396      movq mm3, mm4
397      movq mm6, mm5
398    
399      pand mm3, mm7
400      pand mm6, mm7
401    
402      pand mm3, mm6
403    
404      pand mm0, [mmx_mask]
405      pand mm1, [mmx_mask]
406      pand mm4, [mmx_mask]
407      pand mm5, [mmx_mask]
408    
409      psrlq mm0, 1              ; src1 / 2
410      psrlq mm1, 1              ; src2 / 2
411    
412      psrlq mm4, 1
413      psrlq mm5, 1
414    
415      paddb mm0, mm1            ; src1/2 + src2/2 -> mm0
416      paddb mm0, mm2            ; correct rounding error
417    
418      paddb mm4, mm5
419      paddb mm4, mm3
420    
421      lea eax, [eax+2*edx]
422      lea ebx, [ebx+2*edx]
423    
424      movq [ecx], mm0           ; (src1 + src2 + 1) / 2 -> dst
425      movq [ecx+edx], mm4
426    %endmacro
427    
428    ALIGN 16
429    interpolate8x8_avg2_mmx:
430    
431      push ebx
432    
433      mov eax, [esp + 4 + 20]   ; rounding
434      test eax, eax
435    
436      jnz near .rounding1
437    
438      mov eax, [esp + 4 + 24]   ; height -> eax
439      sub eax, 8
440      test eax, eax
441    
442      mov ecx, [esp + 4 + 4]    ; dst -> edi
443      mov eax, [esp + 4 + 8]    ; src1 -> esi
444      mov ebx, [esp + 4 + 12]   ; src2 -> eax
445      mov edx, [esp + 4 + 16]   ; stride -> edx
446    
447      movq mm7, [mmx_one]
448    
449      jz near .start0
450    
451      AVG2_MMX_RND0
452      lea ecx, [ecx+2*edx]
453    
454    .start0
455    
456      AVG2_MMX_RND0
457      lea ecx, [ecx+2*edx]
458      AVG2_MMX_RND0
459      lea ecx, [ecx+2*edx]
460      AVG2_MMX_RND0
461      lea ecx, [ecx+2*edx]
462      AVG2_MMX_RND0
463    
464      pop ebx
465      ret
466    
467    .rounding1
468      mov eax, [esp + 4 + 24]       ; height -> eax
469      sub eax, 8
470      test eax, eax
471    
472      mov ecx, [esp + 4 + 4]        ; dst -> edi
473      mov eax, [esp + 4 + 8]        ; src1 -> esi
474      mov ebx, [esp + 4 + 12]       ; src2 -> eax
475      mov edx, [esp + 4 + 16]       ; stride -> edx
476    
477      movq mm7, [mmx_one]
478    
479      jz near .start1
480    
481      AVG2_MMX_RND1
482      lea ecx, [ecx+2*edx]
483    
484    .start1
485    
486      AVG2_MMX_RND1
487      lea ecx, [ecx+2*edx]
488      AVG2_MMX_RND1
489      lea ecx, [ecx+2*edx]
490      AVG2_MMX_RND1
491      lea ecx, [ecx+2*edx]
492      AVG2_MMX_RND1
493    
494      pop ebx
495      ret
496    
497    
498    ;-----------------------------------------------------------------------------
499    ;
500    ; void interpolate8x8_avg4_mmx(uint8_t const *dst,
501    ;                              const uint8_t * const src1,
502    ;                              const uint8_t * const src2,
503    ;                              const uint8_t * const src3,
504    ;                              const uint8_t * const src4,
505    ;                              const uint32_t stride,
506    ;                              const uint32_t rounding);
507    ;
508    ;-----------------------------------------------------------------------------
509    
510    %macro AVG4_MMX_RND0 0
511      movq mm0, [eax]           ; src1 -> mm0
512      movq mm1, [ebx]           ; src2 -> mm1
513    
514      movq mm2, mm0
515      movq mm3, mm1
516    
517      pand mm2, [mmx_three]
518      pand mm3, [mmx_three]
519    
520      pand mm0, [mmx_mask2]
521      pand mm1, [mmx_mask2]
522    
523      psrlq mm0, 2
524      psrlq mm1, 2
525    
526      lea eax, [eax+edx]
527      lea ebx, [ebx+edx]
528    
529      paddb mm0, mm1
530      paddb mm2, mm3
531    
532      movq mm4, [esi]           ; src3 -> mm0
533      movq mm5, [edi]           ; src4 -> mm1
534    
535      movq mm1, mm4
536      movq mm3, mm5
537    
538      pand mm1, [mmx_three]
539      pand mm3, [mmx_three]
540    
541      pand mm4, [mmx_mask2]
542      pand mm5, [mmx_mask2]
543    
544      psrlq mm4, 2
545      psrlq mm5, 2
546    
547      paddb mm4, mm5
548      paddb mm0, mm4
549    
550      paddb mm1, mm3
551      paddb mm2, mm1
552    
553      paddb mm2, [mmx_two]
554      pand mm2, [mmx_mask2]
555    
556      psrlq mm2, 2
557      paddb mm0, mm2
558    
559      lea esi, [esi+edx]
560      lea edi, [edi+edx]
561    
562      movq [ecx], mm0           ; (src1 + src2 + src3 + src4 + 2) / 4 -> dst
563    %endmacro
564    
565    %macro AVG4_MMX_RND1 0
566      movq mm0, [eax]           ; src1 -> mm0
567      movq mm1, [ebx]           ; src2 -> mm1
568    
569      movq mm2, mm0
570      movq mm3, mm1
571    
572      pand mm2, [mmx_three]
573      pand mm3, [mmx_three]
574    
575      pand mm0, [mmx_mask2]
576      pand mm1, [mmx_mask2]
577    
578      psrlq mm0, 2
579      psrlq mm1, 2
580    
581      lea eax,[eax+edx]
582      lea ebx,[ebx+edx]
583    
584      paddb mm0, mm1
585      paddb mm2, mm3
586    
587      movq mm4, [esi]           ; src3 -> mm0
588      movq mm5, [edi]           ; src4 -> mm1
589    
590      movq mm1, mm4
591      movq mm3, mm5
592    
593      pand mm1, [mmx_three]
594      pand mm3, [mmx_three]
595    
596      pand mm4, [mmx_mask2]
597      pand mm5, [mmx_mask2]
598    
599      psrlq mm4, 2
600      psrlq mm5, 2
601    
602      paddb mm4, mm5
603      paddb mm0, mm4
604    
605      paddb mm1, mm3
606      paddb mm2, mm1
607    
608      paddb mm2, [mmx_one]
609      pand mm2, [mmx_mask2]
610    
611      psrlq mm2, 2
612      paddb mm0, mm2
613    
614      lea esi,[esi+edx]
615      lea edi,[edi+edx]
616    
617      movq [ecx], mm0           ; (src1 + src2 + src3 + src4 + 2) / 4 -> dst
618    %endmacro
619    
620    ALIGN 16
621    interpolate8x8_avg4_mmx:
622    
623      push ebx
624      push edi
625      push esi
626    
627      mov eax, [esp + 12 + 28]      ; rounding
628    
629      test eax, eax
630    
631      mov ecx, [esp + 12 + 4]       ; dst -> edi
632      mov eax, [esp + 12 + 8]       ; src1 -> esi
633      mov ebx, [esp + 12 + 12]      ; src2 -> eax
634      mov esi, [esp + 12 + 16]      ; src3 -> esi
635      mov edi, [esp + 12 + 20]      ; src4 -> edi
636      mov edx, [esp + 12 + 24]      ; stride -> edx
637    
638      movq mm7, [mmx_one]
639    
640      jnz near .rounding1
641    
642      AVG4_MMX_RND0
643      lea ecx, [ecx+edx]
644      AVG4_MMX_RND0
645      lea ecx, [ecx+edx]
646      AVG4_MMX_RND0
647      lea ecx, [ecx+edx]
648      AVG4_MMX_RND0
649      lea ecx, [ecx+edx]
650      AVG4_MMX_RND0
651      lea ecx, [ecx+edx]
652      AVG4_MMX_RND0
653      lea ecx, [ecx+edx]
654      AVG4_MMX_RND0
655      lea ecx, [ecx+edx]
656      AVG4_MMX_RND0
657    
658      pop esi
659      pop edi
660      pop ebx
661      ret
662    
663    .rounding1
664      AVG4_MMX_RND1
665      lea ecx, [ecx+edx]
666      AVG4_MMX_RND1
667      lea ecx, [ecx+edx]
668      AVG4_MMX_RND1
669      lea ecx, [ecx+edx]
670      AVG4_MMX_RND1
671      lea ecx, [ecx+edx]
672      AVG4_MMX_RND1
673      lea ecx, [ecx+edx]
674      AVG4_MMX_RND1
675      lea ecx, [ecx+edx]
676      AVG4_MMX_RND1
677      lea ecx, [ecx+edx]
678      AVG4_MMX_RND1
679    
680      pop esi
681      pop edi
682      pop ebx
683      ret
684    
685    
686    ;-----------------------------------------------------------------------------
687    ;
688    ; void interpolate8x8_6tap_lowpass_h_mmx(uint8_t const *dst,
689    ;                                        const uint8_t * const src,
690    ;                                        const uint32_t stride,
691    ;                                        const uint32_t rounding);
692    ;
693    ;-----------------------------------------------------------------------------
694    
695    %macro LOWPASS_6TAP_H_MMX 0
696      movq mm0, [eax]
697      movq mm2, [eax+1]
698    
699      movq mm1, mm0
700      movq mm3, mm2
701    
702      punpcklbw mm0, mm7
703      punpcklbw mm2, mm7
704    
705      punpckhbw mm1, mm7
706      punpckhbw mm3, mm7
707    
708      paddw mm0, mm2
709      paddw mm1, mm3
710    
711      psllw mm0, 2
712      psllw mm1, 2
713    
714      movq mm2, [eax-1]
715      movq mm4, [eax+2]
716    
717      movq mm3, mm2
718      movq mm5, mm4
719    
720      punpcklbw mm2, mm7
721      punpcklbw mm4, mm7
722    
723      punpckhbw mm3, mm7
724      punpckhbw mm5, mm7
725    
726      paddw mm2, mm4
727      paddw mm3, mm5
728    
729      psubsw mm0, mm2
730      psubsw mm1, mm3
731    
732      pmullw mm0, [mmx_five]
733      pmullw mm1, [mmx_five]
734    
735      movq mm2, [eax-2]
736      movq mm4, [eax+3]
737    
738      movq mm3, mm2
739      movq mm5, mm4
740    
741      punpcklbw mm2, mm7
742      punpcklbw mm4, mm7
743    
744      punpckhbw mm3, mm7
745      punpckhbw mm5, mm7
746    
747      paddw mm2, mm4
748      paddw mm3, mm5
749    
750      paddsw mm0, mm2
751      paddsw mm1, mm3
752    
753      paddsw mm0, mm6
754      paddsw mm1, mm6
755    
756      psraw mm0, 5
757      psraw mm1, 5
758    
759      lea eax, [eax+edx]
760      packuswb mm0, mm1
761      movq [ecx], mm0
762    %endmacro
763    
764    ALIGN 16
765    interpolate8x8_6tap_lowpass_h_mmx:
766    
767      mov eax, [esp + 16]           ; rounding
768    
769      movq mm6, [rounding_lowpass_mmx + eax * 8]
770    
771      mov ecx, [esp + 4]            ; dst -> edi
772      mov eax, [esp + 8]            ; src -> esi
773      mov edx, [esp + 12]           ; stride -> edx
774    
775      pxor mm7, mm7
776    
777      LOWPASS_6TAP_H_MMX
778      lea ecx, [ecx+edx]
779      LOWPASS_6TAP_H_MMX
780      lea ecx, [ecx+edx]
781      LOWPASS_6TAP_H_MMX
782      lea ecx, [ecx+edx]
783      LOWPASS_6TAP_H_MMX
784      lea ecx, [ecx+edx]
785      LOWPASS_6TAP_H_MMX
786      lea ecx, [ecx+edx]
787      LOWPASS_6TAP_H_MMX
788      lea ecx, [ecx+edx]
789      LOWPASS_6TAP_H_MMX
790      lea ecx, [ecx+edx]
791      LOWPASS_6TAP_H_MMX
792    
793      ret
794    
795    ;-----------------------------------------------------------------------------
796    ;
797    ; void interpolate8x8_6tap_lowpass_v_mmx(uint8_t const *dst,
798    ;                                        const uint8_t * const src,
799    ;                                        const uint32_t stride,
800    ;                                        const uint32_t rounding);
801    ;
802    ;-----------------------------------------------------------------------------
803    
804    %macro LOWPASS_6TAP_V_MMX 0
805      movq mm0, [eax]
806      movq mm2, [eax+edx]
807    
808      movq mm1, mm0
809      movq mm3, mm2
810    
811      punpcklbw mm0, mm7
812      punpcklbw mm2, mm7
813    
814      punpckhbw mm1, mm7
815      punpckhbw mm3, mm7
816    
817      paddw mm0, mm2
818      paddw mm1, mm3
819    
820      psllw mm0, 2
821      psllw mm1, 2
822    
823      movq mm4, [eax+2*edx]
824      sub eax, ebx
825      movq mm2, [eax+2*edx]
826    
827      movq mm3, mm2
828      movq mm5, mm4
829    
830      punpcklbw mm2, mm7
831      punpcklbw mm4, mm7
832    
833      punpckhbw mm3, mm7
834      punpckhbw mm5, mm7
835    
836      paddw mm2, mm4
837      paddw mm3, mm5
838    
839      psubsw mm0, mm2
840      psubsw mm1, mm3
841    
842      pmullw mm0, [mmx_five]
843      pmullw mm1, [mmx_five]
844    
845      movq mm2, [eax+edx]
846      movq mm4, [eax+2*ebx]
847    
848      movq mm3, mm2
849      movq mm5, mm4
850    
851      punpcklbw mm2, mm7
852      punpcklbw mm4, mm7
853    
854      punpckhbw mm3, mm7
855      punpckhbw mm5, mm7
856    
857      paddw mm2, mm4
858      paddw mm3, mm5
859    
860      paddsw mm0, mm2
861      paddsw mm1, mm3
862    
863      paddsw mm0, mm6
864      paddsw mm1, mm6
865    
866      psraw mm0, 5
867      psraw mm1, 5
868    
869      lea eax, [eax+4*edx]
870      packuswb mm0, mm1
871      movq [ecx], mm0
872    %endmacro
873    
874    ALIGN 16
875    interpolate8x8_6tap_lowpass_v_mmx:
876    
877      push ebx
878    
879      mov eax, [esp + 4 + 16]           ; rounding
880    
881      movq mm6, [rounding_lowpass_mmx + eax * 8]
882    
883      mov ecx, [esp + 4 + 4]            ; dst -> edi
884      mov eax, [esp + 4 + 8]            ; src -> esi
885      mov edx, [esp + 4 + 12]           ; stride -> edx
886    
887      mov ebx, edx
888      shl ebx, 1
889      add ebx, edx
890    
891      pxor mm7, mm7
892    
893      LOWPASS_6TAP_V_MMX
894      lea ecx, [ecx+edx]
895      LOWPASS_6TAP_V_MMX
896      lea ecx, [ecx+edx]
897      LOWPASS_6TAP_V_MMX
898      lea ecx, [ecx+edx]
899      LOWPASS_6TAP_V_MMX
900      lea ecx, [ecx+edx]
901      LOWPASS_6TAP_V_MMX
902      lea ecx, [ecx+edx]
903      LOWPASS_6TAP_V_MMX
904      lea ecx, [ecx+edx]
905      LOWPASS_6TAP_V_MMX
906      lea ecx, [ecx+edx]
907      LOWPASS_6TAP_V_MMX
908    
909      pop ebx
910      ret

Legend:
Removed from v.651  
changed lines
  Added in v.1382

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4