[svn] / trunk / xvidcore / src / utils / mem_transfer.h Repository:
ViewVC logotype

Annotation of /trunk/xvidcore/src/utils/mem_transfer.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1988 - (view) (download)

1 : edgomez 213 /*****************************************************************************
2 :     *
3 :     * XVID MPEG-4 VIDEO CODEC
4 :     * - 8<->16 bit buffer transfer header -
5 :     *
6 : edgomez 1382 * Copyright(C) 2001-2003 Peter Ross <pross@xvid.org>
7 : edgomez 439 *
8 : edgomez 851 * This program is free software ; you can redistribute it and/or modify
9 :     * it under the terms of the GNU General Public License as published by
10 :     * the Free Software Foundation ; either version 2 of the License, or
11 : edgomez 213 * (at your option) any later version.
12 :     *
13 :     * This program is distributed in the hope that it will be useful,
14 : edgomez 851 * but WITHOUT ANY WARRANTY ; without even the implied warranty of
15 : edgomez 213 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 :     * GNU General Public License for more details.
17 :     *
18 :     * You should have received a copy of the GNU General Public License
19 : edgomez 851 * along with this program ; if not, write to the Free Software
20 : edgomez 213 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 :     *
22 : Isibaar 1988 * $Id$
23 : edgomez 213 *
24 :     ****************************************************************************/
25 :    
26 : Isibaar 3 #ifndef _MEM_TRANSFER_H
27 :     #define _MEM_TRANSFER_H
28 :    
29 : edgomez 213 /*****************************************************************************
30 :     * transfer8to16 API
31 :     ****************************************************************************/
32 :    
33 : edgomez 195 typedef void (TRANSFER_8TO16COPY) (int16_t * const dst,
34 :     const uint8_t * const src,
35 :     uint32_t stride);
36 : edgomez 213
37 : edgomez 195 typedef TRANSFER_8TO16COPY *TRANSFER_8TO16COPY_PTR;
38 : edgomez 213
39 :     /* Our global function pointer - Initialized in xvid.c */
40 : Isibaar 3 extern TRANSFER_8TO16COPY_PTR transfer_8to16copy;
41 : edgomez 213
42 :     /* Implemented functions */
43 : edgomez 1382 extern TRANSFER_8TO16COPY transfer_8to16copy_c;
44 : Isibaar 3
45 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
46 : edgomez 1382 extern TRANSFER_8TO16COPY transfer_8to16copy_mmx;
47 :     extern TRANSFER_8TO16COPY transfer_8to16copy_3dne;
48 :     #endif
49 :    
50 :     #ifdef ARCH_IS_IA64
51 :     extern TRANSFER_8TO16COPY transfer_8to16copy_ia64;
52 :     #endif
53 :    
54 : edgomez 1413 #ifdef ARCH_IS_PPC
55 :     extern TRANSFER_8TO16COPY transfer_8to16copy_altivec_c;
56 :     #endif
57 :    
58 : edgomez 213 /*****************************************************************************
59 :     * transfer16to8 API
60 :     ****************************************************************************/
61 :    
62 : edgomez 195 typedef void (TRANSFER_16TO8COPY) (uint8_t * const dst,
63 :     const int16_t * const src,
64 :     uint32_t stride);
65 :     typedef TRANSFER_16TO8COPY *TRANSFER_16TO8COPY_PTR;
66 : edgomez 213
67 :     /* Our global function pointer - Initialized in xvid.c */
68 : Isibaar 3 extern TRANSFER_16TO8COPY_PTR transfer_16to8copy;
69 : edgomez 213
70 :     /* Implemented functions */
71 : edgomez 1382 extern TRANSFER_16TO8COPY transfer_16to8copy_c;
72 : Isibaar 3
73 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
74 : edgomez 1382 extern TRANSFER_16TO8COPY transfer_16to8copy_mmx;
75 :     extern TRANSFER_16TO8COPY transfer_16to8copy_3dne;
76 :     #endif
77 :    
78 :     #ifdef ARCH_IS_IA64
79 :     extern TRANSFER_16TO8COPY transfer_16to8copy_ia64;
80 :     #endif
81 :    
82 : edgomez 1413 #ifdef ARCH_IS_PPC
83 :     extern TRANSFER_16TO8COPY transfer_16to8copy_altivec_c;
84 :     #endif
85 :    
86 : edgomez 1586 #ifdef ARCH_IS_X86_64
87 :     extern TRANSFER_16TO8COPY transfer_16to8copy_x86_64;
88 :     #endif
89 :    
90 : edgomez 213 /*****************************************************************************
91 : edgomez 851 * transfer8to16 + substraction *writeback* op API
92 : edgomez 213 ****************************************************************************/
93 :    
94 : edgomez 195 typedef void (TRANSFER_8TO16SUB) (int16_t * const dct,
95 :     uint8_t * const cur,
96 :     const uint8_t * ref,
97 :     const uint32_t stride);
98 : edgomez 213
99 : edgomez 195 typedef TRANSFER_8TO16SUB *TRANSFER_8TO16SUB_PTR;
100 : Isibaar 3
101 : edgomez 213 /* Our global function pointer - Initialized in xvid.c */
102 : Isibaar 3 extern TRANSFER_8TO16SUB_PTR transfer_8to16sub;
103 : edgomez 213
104 :     /* Implemented functions */
105 : edgomez 1382 extern TRANSFER_8TO16SUB transfer_8to16sub_c;
106 : Isibaar 3
107 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
108 : edgomez 1382 extern TRANSFER_8TO16SUB transfer_8to16sub_mmx;
109 :     extern TRANSFER_8TO16SUB transfer_8to16sub_3dne;
110 :     #endif
111 :    
112 :     #ifdef ARCH_IS_IA64
113 :     extern TRANSFER_8TO16SUB transfer_8to16sub_ia64;
114 :     #endif
115 :    
116 : edgomez 1413 #ifdef ARCH_IS_PPC
117 :     extern TRANSFER_8TO16SUB transfer_8to16sub_altivec_c;
118 :     #endif
119 :    
120 : edgomez 1586 #ifdef ARCH_IS_X86_64
121 :     extern TRANSFER_8TO16SUB transfer_8to16sub_x86_64;
122 :     #endif
123 :    
124 : edgomez 213 /*****************************************************************************
125 : edgomez 851 * transfer8to16 + substraction *readonly* op API
126 :     ****************************************************************************/
127 :    
128 :     typedef void (TRANSFER_8TO16SUBRO) (int16_t * const dct,
129 :     const uint8_t * const cur,
130 :     const uint8_t * ref,
131 :     const uint32_t stride);
132 :    
133 :     typedef TRANSFER_8TO16SUBRO *TRANSFER_8TO16SUBRO_PTR;
134 :    
135 :     /* Our global function pointer - Initialized in xvid.c */
136 :     extern TRANSFER_8TO16SUBRO_PTR transfer_8to16subro;
137 :    
138 :     /* Implemented functions */
139 : edgomez 1382 extern TRANSFER_8TO16SUBRO transfer_8to16subro_c;
140 : edgomez 851
141 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
142 : edgomez 1382 extern TRANSFER_8TO16SUBRO transfer_8to16subro_mmx;
143 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_3dne;
144 :     #endif
145 :    
146 : edgomez 1413 #ifdef ARCH_IS_PPC
147 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_altivec_c;
148 :     #endif
149 :    
150 : edgomez 1586 #ifdef ARCH_IS_X86_64
151 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_x86_64;
152 :     #endif
153 :    
154 : edgomez 851 /*****************************************************************************
155 : edgomez 213 * transfer8to16 + substraction op API - Bidirectionnal Version
156 :     ****************************************************************************/
157 :    
158 : edgomez 195 typedef void (TRANSFER_8TO16SUB2) (int16_t * const dct,
159 :     uint8_t * const cur,
160 :     const uint8_t * ref1,
161 :     const uint8_t * ref2,
162 :     const uint32_t stride);
163 : edgomez 213
164 : edgomez 195 typedef TRANSFER_8TO16SUB2 *TRANSFER_8TO16SUB2_PTR;
165 : suxen_drol 118
166 : edgomez 213 /* Our global function pointer - Initialized in xvid.c */
167 : suxen_drol 118 extern TRANSFER_8TO16SUB2_PTR transfer_8to16sub2;
168 : edgomez 213
169 :     /* Implemented functions */
170 : edgomez 1413 TRANSFER_8TO16SUB2 transfer_8to16sub2_c;
171 : suxen_drol 118
172 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
173 : edgomez 1382 extern TRANSFER_8TO16SUB2 transfer_8to16sub2_mmx;
174 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_xmm;
175 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_3dne;
176 :     #endif
177 : suxen_drol 118
178 : edgomez 1382 #ifdef ARCH_IS_IA64
179 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_ia64;
180 :     #endif
181 :    
182 : edgomez 1413 #ifdef ARCH_IS_PPC
183 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_altivec_c;
184 :     #endif
185 :    
186 : edgomez 1586 #ifdef ARCH_IS_X86_64
187 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_x86_64;
188 :     #endif
189 :    
190 : edgomez 213 /*****************************************************************************
191 : syskin 1583 * transfer8to16 + substraction op API - Bidirectionnal Version *readonly*
192 :     ****************************************************************************/
193 :    
194 :     typedef void (TRANSFER_8TO16SUB2RO) (int16_t * const dct,
195 :     const uint8_t * const cur,
196 :     const uint8_t * ref1,
197 :     const uint8_t * ref2,
198 :     const uint32_t stride);
199 :    
200 :     typedef TRANSFER_8TO16SUB2RO *TRANSFER_8TO16SUB2RO_PTR;
201 :    
202 :     /* Our global function pointer - Initialized in xvid.c */
203 :     extern TRANSFER_8TO16SUB2RO_PTR transfer_8to16sub2ro;
204 :    
205 :     /* Implemented functions */
206 :     TRANSFER_8TO16SUB2RO transfer_8to16sub2ro_c;
207 :    
208 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
209 : syskin 1583 extern TRANSFER_8TO16SUB2RO transfer_8to16sub2ro_xmm;
210 :     #endif
211 :    
212 : edgomez 1586 #ifdef ARCH_IS_X86_64
213 :     extern TRANSFER_8TO16SUB2RO transfer_8to16sub2ro_x86_64;
214 :     #endif
215 :    
216 : syskin 1583 /*****************************************************************************
217 : edgomez 213 * transfer16to8 + addition op API
218 :     ****************************************************************************/
219 :    
220 : edgomez 195 typedef void (TRANSFER_16TO8ADD) (uint8_t * const dst,
221 :     const int16_t * const src,
222 :     uint32_t stride);
223 : edgomez 213
224 : edgomez 195 typedef TRANSFER_16TO8ADD *TRANSFER_16TO8ADD_PTR;
225 : edgomez 213
226 :     /* Our global function pointer - Initialized in xvid.c */
227 : Isibaar 3 extern TRANSFER_16TO8ADD_PTR transfer_16to8add;
228 : edgomez 213
229 :     /* Implemented functions */
230 : edgomez 1382 extern TRANSFER_16TO8ADD transfer_16to8add_c;
231 : Isibaar 3
232 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
233 : edgomez 1382 extern TRANSFER_16TO8ADD transfer_16to8add_mmx;
234 :     extern TRANSFER_16TO8ADD transfer_16to8add_3dne;
235 :     #endif
236 :    
237 :     #ifdef ARCH_IS_IA64
238 :     extern TRANSFER_16TO8ADD transfer_16to8add_ia64;
239 :     #endif
240 :    
241 : edgomez 1413 #ifdef ARCH_IS_PPC
242 :     extern TRANSFER_16TO8ADD transfer_16to8add_altivec_c;
243 :     #endif
244 :    
245 : edgomez 1586 #ifdef ARCH_IS_X86_64
246 :     extern TRANSFER_16TO8ADD transfer_16to8add_x86_64;
247 :     #endif
248 :    
249 : edgomez 213 /*****************************************************************************
250 :     * transfer8to8 + no op
251 :     ****************************************************************************/
252 :    
253 : edgomez 195 typedef void (TRANSFER8X8_COPY) (uint8_t * const dst,
254 :     const uint8_t * const src,
255 :     const uint32_t stride);
256 : edgomez 213
257 : edgomez 195 typedef TRANSFER8X8_COPY *TRANSFER8X8_COPY_PTR;
258 : edgomez 213
259 :     /* Our global function pointer - Initialized in xvid.c */
260 : Isibaar 3 extern TRANSFER8X8_COPY_PTR transfer8x8_copy;
261 : edgomez 213
262 :     /* Implemented functions */
263 : edgomez 1382 extern TRANSFER8X8_COPY transfer8x8_copy_c;
264 : Isibaar 3
265 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
266 : edgomez 1382 extern TRANSFER8X8_COPY transfer8x8_copy_mmx;
267 :     extern TRANSFER8X8_COPY transfer8x8_copy_3dne;
268 :     #endif
269 : edgomez 851
270 : edgomez 1382 #ifdef ARCH_IS_IA64
271 :     extern TRANSFER8X8_COPY transfer8x8_copy_ia64;
272 :     #endif
273 :    
274 : edgomez 1413 #ifdef ARCH_IS_PPC
275 :     extern TRANSFER8X8_COPY transfer8x8_copy_altivec_c;
276 :     #endif
277 :    
278 : edgomez 1586 #ifdef ARCH_IS_X86_64
279 :     extern TRANSFER8X8_COPY transfer8x8_copy_x86_64;
280 :     #endif
281 :    
282 : suxen_drol 1632 /*****************************************************************************
283 :     * transfer8to4 + no op
284 :     ****************************************************************************/
285 :    
286 :     typedef void (TRANSFER8X4_COPY) (uint8_t * const dst,
287 :     const uint8_t * const src,
288 :     const uint32_t stride);
289 :    
290 :     typedef TRANSFER8X4_COPY *TRANSFER8X4_COPY_PTR;
291 :    
292 :     /* Our global function pointer - Initialized in xvid.c */
293 :     extern TRANSFER8X4_COPY_PTR transfer8x4_copy;
294 :    
295 :     /* Implemented functions */
296 :     extern TRANSFER8X4_COPY transfer8x4_copy_c;
297 :    
298 : Isibaar 1795 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
299 : suxen_drol 1632 extern TRANSFER8X4_COPY transfer8x4_copy_mmx;
300 :     extern TRANSFER8X4_COPY transfer8x4_copy_3dne;
301 :     #endif
302 :    
303 :    
304 : edgomez 851 static __inline void
305 :     transfer16x16_copy(uint8_t * const dst,
306 :     const uint8_t * const src,
307 :     const uint32_t stride)
308 :     {
309 :     transfer8x8_copy(dst, src, stride);
310 :     transfer8x8_copy(dst + 8, src + 8, stride);
311 :     transfer8x8_copy(dst + 8*stride, src + 8*stride, stride);
312 :     transfer8x8_copy(dst + 8*stride + 8, src + 8*stride + 8, stride);
313 :     }
314 :    
315 :     static __inline void
316 :     transfer32x32_copy(uint8_t * const dst,
317 :     const uint8_t * const src,
318 :     const uint32_t stride)
319 :     {
320 :     transfer16x16_copy(dst, src, stride);
321 :     transfer16x16_copy(dst + 16, src + 16, stride);
322 :     transfer16x16_copy(dst + 16*stride, src + 16*stride, stride);
323 :     transfer16x16_copy(dst + 16*stride + 16, src + 16*stride + 16, stride);
324 :     }
325 :    
326 :    
327 : edgomez 213 #endif

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