[svn] / trunk / xvidcore / src / quant / x86_asm / quantize_h263_mmx.asm Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/quant/x86_asm/quantize_h263_mmx.asm

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

revision 1431, Thu Apr 15 12:05:19 2004 UTC revision 1432, Thu Apr 15 19:44:06 2004 UTC
# Line 21  Line 21 
21  ; *  along with this program ; if not, write to the Free Software  ; *  along with this program ; if not, write to the Free Software
22  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23  ; *  ; *
24  ; * $Id: quantize_h263_mmx.asm,v 1.3 2004-04-12 15:49:56 edgomez Exp $  ; * $Id: quantize_h263_mmx.asm,v 1.4 2004-04-15 19:44:06 edgomez Exp $
25  ; *  ; *
26  ; ****************************************************************************/  ; ****************************************************************************/
27    
# Line 132  Line 132 
132    push esi    push esi
133    
134    mov esi, [esp + 4 + 8]     ; data    mov esi, [esp + 4 + 8]     ; data
135      mov ecx,[esp + 4 + 16]     ; dcscalar
136    movsx eax, word [esi]      ; data[0]    movsx eax, word [esi]      ; data[0]
137    
138    mov ecx,[esp + 4 + 16]         ; dcscalar    sar ecx,1                  ; dcscalar /2
139    mov edx,eax    mov edx,eax
140    sar ecx,1    sar edx,31                 ; sgn(data[0])
141    add eax,ecx    xor ecx,edx                ; *sgn(data[0])
142    sub edx,ecx    sub eax,edx
143    cmovl eax,edx             ; +/- dcscalar/2    add eax,ecx                ; + (dcscalar/2)*sgn(data[0])
144    
145    mov ecx, [esp + 4 + 12]    ; quant    mov ecx, [esp + 4 + 12]    ; quant
146    cdq    cdq
147    idiv dword [esp + 4 + 16]  ; dcscalar    idiv dword [esp + 4 + 16]  ; dcscalar
# Line 624  Line 625 
625    
626     ; deal with DC     ; deal with DC
627    mov eax, [esp+ 8]                ; coeff    mov eax, [esp+ 8]                ; coeff
628    movsx eax,word [eax]    movd mm1,[esp+16]                ; dcscalar
629    mov ecx,2047    movd mm0,[eax]                   ; coeff[0]
630    imul dword [esp+16]              ; dcscalar    pmullw mm0,mm1                   ; * dcscalar
631    mov edx, [esp+ 4]                ; data    mov edx, [esp+ 4]                ; data
632    cmp eax,ecx    paddsw mm0, mm5                  ; saturate +
633    cmovg eax,ecx    psubsw mm0, mm5
634    not ecx    psubsw mm0, mm5                  ; saturate -
635    cmp eax,ecx    paddsw mm0, mm5
636    cmovl eax,ecx    movd eax,mm0
   
637    mov [edx], ax    mov [edx], ax
638    
639    xor eax, eax                    ; return 0    xor eax, eax                    ; return 0
# Line 711  Line 711 
711    
712     ; deal with DC     ; deal with DC
713    mov eax, [esp+ 8]                 ; coeff    mov eax, [esp+ 8]                 ; coeff
714    mov edx, [esp+ 4]                 ; data    movd mm1,[esp+16]                 ; dcscalar
715    movd mm0, [eax]    movd mm0, [eax]
716    pmullw mm0, [esp+16]              ; dcscalar    pmullw mm0, mm1
717      mov edx, [esp+ 4]                 ; data
718    pminsw mm0,mm4    pminsw mm0,mm4
719    pmaxsw mm0,mm5    pmaxsw mm0,mm5
720    movd eax, mm0    movd eax, mm0
# Line 740  Line 741 
741    mov eax, [esp+ 8]                 ; coeff    mov eax, [esp+ 8]                 ; coeff
742    
743    movd xmm6,ecx                     ; quant    movd xmm6,ecx                     ; quant
744  ;  shr ecx,1  
745    shl ecx,31    shl ecx,31
746    pshuflw xmm6,xmm6,0    pshuflw xmm6,xmm6,0
747    pcmpeqw xmm0,xmm0    pcmpeqw xmm0,xmm0

Legend:
Removed from v.1431  
changed lines
  Added in v.1432

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