annotate x86/x86util.asm @ 12498:c997f09d1e10 libavcodec

Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm, which will hopefully solve the Win64/FATE failures caused by these functions.
author rbultje
date Fri, 17 Sep 2010 01:56:06 +0000
parents 846779f6b164
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
1 ;*****************************************************************************
8804
ba83a0c57e9f Fix wrong file name in header, noticed by David DeHaven, dave sagetv com.
diego
parents: 8510
diff changeset
2 ;* x86util.asm
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
3 ;*****************************************************************************
12005
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
4 ;* Copyright (C) 2008-2010 x264 project
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
5 ;*
12005
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
6 ;* Authors: Loren Merritt <lorenm@u.washington.edu>
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
7 ;* Holger Lubitz <holger@lubitz.org>
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
8 ;*
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
9 ;* This file is part of FFmpeg.
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
10 ;*
12005
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
11 ;* FFmpeg is free software; you can redistribute it and/or
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
12 ;* modify it under the terms of the GNU Lesser General Public
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
13 ;* License as published by the Free Software Foundation; either
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
14 ;* version 2.1 of the License, or (at your option) any later version.
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
15 ;*
12005
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
16 ;* FFmpeg is distributed in the hope that it will be useful,
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
17 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
18 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
19 ;* Lesser General Public License for more details.
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
20 ;*
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
21 ;* You should have received a copy of the GNU Lesser General Public
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
22 ;* License along with FFmpeg; if not, write to the Free Software
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
23 ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
88563eada57f Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents: 11931
diff changeset
24 ;******************************************************************************
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
25
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
26 %macro SBUTTERFLY 4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
27 mova m%4, m%2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
28 punpckl%1 m%2, m%3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
29 punpckh%1 m%4, m%3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
30 SWAP %3, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
31 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
32
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
33 %macro SBUTTERFLY2 4
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
34 mova m%4, m%2
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
35 punpckh%1 m%2, m%3
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
36 punpckl%1 m%4, m%3
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
37 SWAP %2, %4, %3
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
38 %endmacro
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
39
12086
d780ae746855 Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents: 12013
diff changeset
40 %macro TRANSPOSE4x4B 5
d780ae746855 Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents: 12013
diff changeset
41 SBUTTERFLY bw, %1, %2, %5
d780ae746855 Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents: 12013
diff changeset
42 SBUTTERFLY bw, %3, %4, %5
d780ae746855 Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents: 12013
diff changeset
43 SBUTTERFLY wd, %1, %3, %5
d780ae746855 Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents: 12013
diff changeset
44 SBUTTERFLY wd, %2, %4, %5
d780ae746855 Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents: 12013
diff changeset
45 SWAP %2, %3
d780ae746855 Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents: 12013
diff changeset
46 %endmacro
d780ae746855 Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents: 12013
diff changeset
47
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
48 %macro TRANSPOSE4x4W 5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
49 SBUTTERFLY wd, %1, %2, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
50 SBUTTERFLY wd, %3, %4, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
51 SBUTTERFLY dq, %1, %3, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
52 SBUTTERFLY dq, %2, %4, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
53 SWAP %2, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
54 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
55
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
56 %macro TRANSPOSE2x4x4W 5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
57 SBUTTERFLY wd, %1, %2, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
58 SBUTTERFLY wd, %3, %4, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
59 SBUTTERFLY dq, %1, %3, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
60 SBUTTERFLY dq, %2, %4, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
61 SBUTTERFLY qdq, %1, %2, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
62 SBUTTERFLY qdq, %3, %4, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
63 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
64
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
65 %macro TRANSPOSE4x4D 5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
66 SBUTTERFLY dq, %1, %2, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
67 SBUTTERFLY dq, %3, %4, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
68 SBUTTERFLY qdq, %1, %3, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
69 SBUTTERFLY qdq, %2, %4, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
70 SWAP %2, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
71 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
72
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
73 %macro TRANSPOSE8x8W 9-11
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
74 %ifdef ARCH_X86_64
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
75 SBUTTERFLY wd, %1, %2, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
76 SBUTTERFLY wd, %3, %4, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
77 SBUTTERFLY wd, %5, %6, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
78 SBUTTERFLY wd, %7, %8, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
79 SBUTTERFLY dq, %1, %3, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
80 SBUTTERFLY dq, %2, %4, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
81 SBUTTERFLY dq, %5, %7, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
82 SBUTTERFLY dq, %6, %8, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
83 SBUTTERFLY qdq, %1, %5, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
84 SBUTTERFLY qdq, %2, %6, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
85 SBUTTERFLY qdq, %3, %7, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
86 SBUTTERFLY qdq, %4, %8, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
87 SWAP %2, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
88 SWAP %4, %7
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
89 %else
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
90 ; in: m0..m7, unless %11 in which case m6 is in %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
91 ; out: m0..m7, unless %11 in which case m4 is in %10
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
92 ; spills into %9 and %10
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
93 %if %0<11
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
94 movdqa %9, m%7
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
95 %endif
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
96 SBUTTERFLY wd, %1, %2, %7
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
97 movdqa %10, m%2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
98 movdqa m%7, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
99 SBUTTERFLY wd, %3, %4, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
100 SBUTTERFLY wd, %5, %6, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
101 SBUTTERFLY wd, %7, %8, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
102 SBUTTERFLY dq, %1, %3, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
103 movdqa %9, m%3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
104 movdqa m%2, %10
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
105 SBUTTERFLY dq, %2, %4, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
106 SBUTTERFLY dq, %5, %7, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
107 SBUTTERFLY dq, %6, %8, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
108 SBUTTERFLY qdq, %1, %5, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
109 SBUTTERFLY qdq, %2, %6, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
110 movdqa %10, m%2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
111 movdqa m%3, %9
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
112 SBUTTERFLY qdq, %3, %7, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
113 SBUTTERFLY qdq, %4, %8, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
114 SWAP %2, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
115 SWAP %4, %7
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
116 %if %0<11
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
117 movdqa m%5, %10
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
118 %endif
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
119 %endif
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
120 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
121
12144
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
122 ; PABSW macros assume %1 != %2, while ABS1/2 macros work in-place
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
123 %macro PABSW_MMX 2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
124 pxor %1, %1
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
125 pcmpgtw %1, %2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
126 pxor %2, %1
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
127 psubw %2, %1
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
128 SWAP %1, %2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
129 %endmacro
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
130
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
131 %macro PSIGNW_MMX 2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
132 pxor %1, %2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
133 psubw %1, %2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
134 %endmacro
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
135
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
136 %macro PABSW_MMX2 2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
137 pxor %1, %1
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
138 psubw %1, %2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
139 pmaxsw %1, %2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
140 %endmacro
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
141
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
142 %macro PABSW_SSSE3 2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
143 pabsw %1, %2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
144 %endmacro
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
145
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
146 %macro PSIGNW_SSSE3 2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
147 psignw %1, %2
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
148 %endmacro
846779f6b164 MMX/SSE VC1 loop filter
conrad
parents: 12086
diff changeset
149
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
150 %macro ABS1_MMX 2 ; a, tmp
12498
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
151 pxor %2, %2
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
152 pcmpgtw %2, %1
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
153 pxor %1, %2
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
154 psubw %1, %2
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
155 %endmacro
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
156
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
157 %macro ABS2_MMX 4 ; a, b, tmp0, tmp1
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
158 pxor %3, %3
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
159 pxor %4, %4
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
160 pcmpgtw %3, %1
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
161 pcmpgtw %4, %2
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
162 pxor %1, %3
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
163 pxor %2, %4
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
164 psubw %1, %3
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
165 psubw %2, %4
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
166 %endmacro
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
167
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
168 %macro ABS1_MMX2 2 ; a, tmp
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
169 pxor %2, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
170 psubw %2, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
171 pmaxsw %1, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
172 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
173
12498
c997f09d1e10 Move hadamard_diff{,16}_{mmx,mmx2,sse2,ssse3}() from inline asm to yasm,
rbultje
parents: 12144
diff changeset
174 %macro ABS2_MMX2 4 ; a, b, tmp0, tmp1
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
175 pxor %3, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
176 pxor %4, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
177 psubw %3, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
178 psubw %4, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
179 pmaxsw %1, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
180 pmaxsw %2, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
181 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
182
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
183 %macro ABS1_SSSE3 2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
184 pabsw %1, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
185 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
186
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
187 %macro ABS2_SSSE3 4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
188 pabsw %1, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
189 pabsw %2, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
190 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
191
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
192 %macro ABSB_MMX 2
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
193 pxor %2, %2
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
194 psubb %2, %1
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
195 pminub %1, %2
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
196 %endmacro
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
197
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
198 %macro ABSB2_MMX 4
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
199 pxor %3, %3
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
200 pxor %4, %4
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
201 psubb %3, %1
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
202 psubb %4, %2
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
203 pminub %1, %3
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
204 pminub %2, %4
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
205 %endmacro
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
206
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
207 %macro ABSB_SSSE3 2
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
208 pabsb %1, %1
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
209 %endmacro
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
210
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
211 %macro ABSB2_SSSE3 4
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
212 pabsb %1, %1
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
213 pabsb %2, %2
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
214 %endmacro
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
215
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
216 %macro ABS4 6
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
217 ABS2 %1, %2, %5, %6
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
218 ABS2 %3, %4, %5, %6
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
219 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
220
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
221 %define ABS1 ABS1_MMX
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
222 %define ABS2 ABS2_MMX
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
223 %define ABSB ABSB_MMX
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
224 %define ABSB2 ABSB2_MMX
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
225
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
226 %macro SPLATB_MMX 3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
227 movd %1, [%2-3] ;to avoid crossing a cacheline
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
228 punpcklbw %1, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
229 %if mmsize==16
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
230 pshuflw %1, %1, 0xff
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
231 punpcklqdq %1, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
232 %else
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
233 pshufw %1, %1, 0xff
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
234 %endif
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
235 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
236
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
237 %macro SPLATB_SSSE3 3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
238 movd %1, [%2-3]
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
239 pshufb %1, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
240 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
241
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
242 %macro PALIGNR_MMX 4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
243 %ifnidn %4, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
244 mova %4, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
245 %endif
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
246 %if mmsize == 8
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
247 psllq %1, (8-%3)*8
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
248 psrlq %4, %3*8
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
249 %else
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
250 pslldq %1, 16-%3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
251 psrldq %4, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
252 %endif
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
253 por %1, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
254 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
255
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
256 %macro PALIGNR_SSSE3 4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
257 palignr %1, %2, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
258 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
259
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
260 %macro DEINTB 5 ; mask, reg1, mask, reg2, optional src to fill masks from
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
261 %ifnum %5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
262 mova m%1, m%5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
263 mova m%3, m%5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
264 %else
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
265 mova m%1, %5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
266 mova m%3, m%1
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
267 %endif
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
268 pand m%1, m%2 ; dst .. y6 .. y4
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
269 pand m%3, m%4 ; src .. y6 .. y4
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
270 psrlw m%2, 8 ; dst .. y7 .. y5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
271 psrlw m%4, 8 ; src .. y7 .. y5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
272 %endmacro
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
273
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
274 %macro SUMSUB_BA 2-3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
275 %if %0==2
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
276 paddw %1, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
277 paddw %2, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
278 psubw %2, %1
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
279 %else
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
280 mova %3, %1
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
281 paddw %1, %2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
282 psubw %2, %3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
283 %endif
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
284 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
285
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
286 %macro SUMSUB_BADC 4-5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
287 %if %0==5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
288 SUMSUB_BA %1, %2, %5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
289 SUMSUB_BA %3, %4, %5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
290 %else
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
291 paddw %1, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
292 paddw %3, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
293 paddw %2, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
294 paddw %4, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
295 psubw %2, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
296 psubw %4, %3
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
297 %endif
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
298 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
299
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
300 %macro SUMSUB2_AB 3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
301 mova %3, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
302 paddw %1, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
303 paddw %1, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
304 psubw %3, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
305 psubw %3, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
306 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
307
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
308 %macro SUMSUB2_BA 3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
309 mova m%3, m%1
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
310 paddw m%1, m%2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
311 paddw m%1, m%2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
312 psubw m%2, m%3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
313 psubw m%2, m%3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
314 %endmacro
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
315
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
316 %macro SUMSUBD2_AB 4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
317 mova %4, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
318 mova %3, %2
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
319 psraw %2, 1 ; %2: %2>>1
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
320 psraw %1, 1 ; %1: %1>>1
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
321 paddw %2, %4 ; %2: %2>>1+%1
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
322 psubw %1, %3 ; %1: %1>>1-%2
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
323 %endmacro
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
324
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
325 %macro DCT4_1D 5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
326 %ifnum %5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
327 SUMSUB_BADC m%4, m%1, m%3, m%2; m%5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
328 SUMSUB_BA m%3, m%4, m%5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
329 SUMSUB2_AB m%1, m%2, m%5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
330 SWAP %1, %3, %4, %5, %2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
331 %else
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
332 SUMSUB_BADC m%4, m%1, m%3, m%2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
333 SUMSUB_BA m%3, m%4
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
334 mova [%5], m%2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
335 SUMSUB2_AB m%1, [%5], m%2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
336 SWAP %1, %3, %4, %2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
337 %endif
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
338 %endmacro
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
339
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
340 %macro IDCT4_1D 5-6
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
341 %ifnum %5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
342 SUMSUBD2_AB m%2, m%4, m%6, m%5
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
343 ; %2: %2>>1-%4 %4: %2+%4>>1
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
344 SUMSUB_BA m%3, m%1, m%6
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
345 ; %3: %1+%3 %1: %1-%3
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
346 SUMSUB_BADC m%4, m%3, m%2, m%1, m%6
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
347 ; %4: %1+%3 + (%2+%4>>1)
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
348 ; %3: %1+%3 - (%2+%4>>1)
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
349 ; %2: %1-%3 + (%2>>1-%4)
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
350 ; %1: %1-%3 - (%2>>1-%4)
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
351 %else
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
352 SUMSUBD2_AB m%2, m%4, [%5], [%5+16]
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
353 SUMSUB_BA m%3, m%1
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
354 SUMSUB_BADC m%4, m%3, m%2, m%1
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
355 %endif
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
356 SWAP %1, %4, %3
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
357 ; %1: %1+%3 + (%2+%4>>1) row0
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
358 ; %2: %1-%3 + (%2>>1-%4) row1
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
359 ; %3: %1-%3 - (%2>>1-%4) row2
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
360 ; %4: %1+%3 - (%2+%4>>1) row3
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
361 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
362
11931
980030a3e315 Update x264asm header files to latest versions.
darkshikari
parents: 10019
diff changeset
363
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
364 %macro LOAD_DIFF 5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
365 %ifidn %3, none
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
366 movh %1, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
367 movh %2, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
368 punpcklbw %1, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
369 punpcklbw %2, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
370 psubw %1, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
371 %else
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
372 movh %1, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
373 punpcklbw %1, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
374 movh %2, %5
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
375 punpcklbw %2, %3
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
376 psubw %1, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
377 %endif
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
378 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
379
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
380 %macro STORE_DCT 6
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
381 movq [%5+%6+ 0], m%1
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
382 movq [%5+%6+ 8], m%2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
383 movq [%5+%6+16], m%3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
384 movq [%5+%6+24], m%4
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
385 movhps [%5+%6+32], m%1
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
386 movhps [%5+%6+40], m%2
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
387 movhps [%5+%6+48], m%3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
388 movhps [%5+%6+56], m%4
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
389 %endmacro
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
390
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
391 %macro LOAD_DIFF_8x4P 7-10 r0,r2,0 ; 4x dest, 2x temp, 2x pointer, increment?
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
392 LOAD_DIFF m%1, m%5, m%7, [%8], [%9]
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
393 LOAD_DIFF m%2, m%6, m%7, [%8+r1], [%9+r3]
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
394 LOAD_DIFF m%3, m%5, m%7, [%8+2*r1], [%9+2*r3]
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
395 LOAD_DIFF m%4, m%6, m%7, [%8+r4], [%9+r5]
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
396 %if %10
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
397 lea %8, [%8+4*r1]
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
398 lea %9, [%9+4*r3]
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
399 %endif
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
400 %endmacro
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
401
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
402 %macro DIFFx2 6-7
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
403 movh %3, %5
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
404 punpcklbw %3, %4
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
405 psraw %1, 6
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
406 paddsw %1, %3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
407 movh %3, %6
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
408 punpcklbw %3, %4
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
409 psraw %2, 6
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
410 paddsw %2, %3
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
411 packuswb %2, %1
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
412 %endmacro
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
413
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
414 %macro STORE_DIFF 4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
415 movh %2, %4
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
416 punpcklbw %2, %3
10019
c08ca946c80a Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents: 8804
diff changeset
417 psraw %1, 6
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
418 paddsw %1, %2
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
419 packuswb %1, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
420 movh %4, %1
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents:
diff changeset
421 %endmacro
12013
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
422
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
423 %macro STORE_DIFFx2 8 ; add1, add2, reg1, reg2, zero, shift, source, stride
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
424 movh %3, [%7]
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
425 movh %4, [%7+%8]
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
426 punpcklbw %3, %5
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
427 punpcklbw %4, %5
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
428 psraw %1, %6
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
429 psraw %2, %6
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
430 paddw %3, %1
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
431 paddw %4, %2
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
432 packuswb %3, %5
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
433 packuswb %4, %5
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
434 movh [%7], %3
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
435 movh [%7+%8], %4
2ae70e2c31a4 MMX idct_add for VP8.
rbultje
parents: 12005
diff changeset
436 %endmacro