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

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

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

revision 1.3, Mon Apr 12 15:49:56 2004 UTC revision 1.6, Sun Aug 22 11:46:10 2004 UTC
# Line 32  Line 32 
32    
33  %macro cglobal 1  %macro cglobal 1
34         %ifdef PREFIX         %ifdef PREFIX
35                    %ifdef MARK_FUNCS
36                            global _%1:function
37                            %define %1 _%1:function
38                    %else
39                  global _%1                  global _%1
40                  %define %1 _%1                  %define %1 _%1
41                    %endif
42            %else
43                    %ifdef MARK_FUNCS
44                            global %1:function
45          %else          %else
46                  global %1                  global %1
47          %endif          %endif
48            %endif
49  %endmacro  %endmacro
50    
51  ;=============================================================================  ;=============================================================================
# Line 44  Line 53 
53  ;=============================================================================  ;=============================================================================
54    
55  %ifdef FORMAT_COFF  %ifdef FORMAT_COFF
56  SECTION .rodata data  SECTION .rodata
57  %else  %else
58  SECTION .rodata data align=16  SECTION .rodata align=16
59  %endif  %endif
60    
61  ALIGN 16  ALIGN 16
# Line 132  Line 141 
141    push esi    push esi
142    
143    mov esi, [esp + 4 + 8]     ; data    mov esi, [esp + 4 + 8]     ; data
144      mov ecx,[esp + 4 + 16]     ; dcscalar
145    movsx eax, word [esi]      ; data[0]    movsx eax, word [esi]      ; data[0]
146    
147    mov ecx,[esp + 4 + 16]         ; dcscalar    sar ecx,1                  ; dcscalar /2
148    mov edx,eax    mov edx,eax
149    sar ecx,1    sar edx,31                 ; sgn(data[0])
150    add eax,ecx    xor ecx,edx                ; *sgn(data[0])
151    sub edx,ecx    sub eax,edx
152    cmovl eax,edx             ; +/- dcscalar/2    add eax,ecx                ; + (dcscalar/2)*sgn(data[0])
153    
154    mov ecx, [esp + 4 + 12]    ; quant    mov ecx, [esp + 4 + 12]    ; quant
155    cdq    cdq
156    idiv dword [esp + 4 + 16]  ; dcscalar    idiv dword [esp + 4 + 16]  ; dcscalar
# Line 624  Line 634 
634    
635     ; deal with DC     ; deal with DC
636    mov eax, [esp+ 8]                ; coeff    mov eax, [esp+ 8]                ; coeff
637    movsx eax,word [eax]    movd mm1,[esp+16]                ; dcscalar
638    mov ecx,2047    movd mm0,[eax]                   ; coeff[0]
639    imul dword [esp+16]              ; dcscalar    pmullw mm0,mm1                   ; * dcscalar
640    mov edx, [esp+ 4]                ; data    mov edx, [esp+ 4]                ; data
641    cmp eax,ecx    paddsw mm0, mm5                  ; saturate +
642    cmovg eax,ecx    psubsw mm0, mm5
643    not ecx    psubsw mm0, mm5                  ; saturate -
644    cmp eax,ecx    paddsw mm0, mm5
645    cmovl eax,ecx    movd eax,mm0
   
646    mov [edx], ax    mov [edx], ax
647    
648    xor eax, eax                    ; return 0    xor eax, eax                    ; return 0
# Line 711  Line 720 
720    
721     ; deal with DC     ; deal with DC
722    mov eax, [esp+ 8]                 ; coeff    mov eax, [esp+ 8]                 ; coeff
723    mov edx, [esp+ 4]                 ; data    movd mm1,[esp+16]                 ; dcscalar
724    movd mm0, [eax]    movd mm0, [eax]
725    pmullw mm0, [esp+16]              ; dcscalar    pmullw mm0, mm1
726      mov edx, [esp+ 4]                 ; data
727    pminsw mm0,mm4    pminsw mm0,mm4
728    pmaxsw mm0,mm5    pmaxsw mm0,mm5
729    movd eax, mm0    movd eax, mm0
# Line 740  Line 750 
750    mov eax, [esp+ 8]                 ; coeff    mov eax, [esp+ 8]                 ; coeff
751    
752    movd xmm6,ecx                     ; quant    movd xmm6,ecx                     ; quant
753  ;  shr ecx,1  
754    shl ecx,31    shl ecx,31
755    pshuflw xmm6,xmm6,0    pshuflw xmm6,xmm6,0
756    pcmpeqw xmm0,xmm0    pcmpeqw xmm0,xmm0

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

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