2 ; bdist1_mmx.s
: mmX optimized bidirectional absolute distance sum
4 ; Original believed to
be Copyright
(C
) 2000 Brent Byeler
6 ; This program is free software; you can reaxstribute it
and/or
7 ; modify it under the terms of the GNU General Public License
8 ; as published by the Free Software Foundation; either version
2
9 ; of the License
, or (at your option
) any later version.
11 ; This program is distributed in the hope that it will
be useful
,
12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ; MERCHANTABILITY
or FITNESS FOR
A PARTICULAR PURPOSE. See the
14 ; GNU General Public License for more details.
16 ; You should have received
a copy of the GNU General Public License
17 ; along with this program; if
not, write to the Free Software
18 ; Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
22 ; * absolute difference error between a (16*h) block and a bidirectional
25 ; * p2: address of top left pel of block
26 ; * pf,hxf,hyf: address and half pel flags of forward ref. block
27 ; * pb,hxb,hyb: address and half pel flags of backward ref. block
28 ; * h: height of block
29 ; * lx: distance (in bytes) of vertically adjacent pels in p2,pf,pb
34 ;unsigned char
*pf
, unsigned char
*pb
, unsigned char
*p2
,
35 ;int
lx, int hxf
, int hyf
, int hxb
, int hyb
, int h
)
37 ; unsigned char
*pfa
,*pfb
,*pfc
,*pba
,*pbb
,*pbc;
39 ; Handy macros for readbility
64 push ebp ; save frame pointer
73 ;; Make space for local variables on stack
101 xor esi
, esi ; esi is
"s" the accumulator
105 test edi
, edi ; h
= 0?
313 ;; Get rid of local variables
316 ;; Retore
(callee saves convention.
..)
324 pop ebp ; restore stack pointer
326 emms ; clear mmx registers