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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (view) (download)

1 : edgomez 1.6 /*****************************************************************************
2 :     *
3 :     * XVID MPEG-4 VIDEO CODEC
4 :     * - 8<->16 bit buffer transfer header -
5 :     *
6 : edgomez 1.13 * Copyright(C) 2001-2003 Peter Ross <pross@xvid.org>
7 : edgomez 1.12 *
8 :     * 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 1.6 * (at your option) any later version.
12 :     *
13 :     * This program is distributed in the hope that it will be useful,
14 : edgomez 1.12 * but WITHOUT ANY WARRANTY ; without even the implied warranty of
15 : edgomez 1.6 * 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 1.12 * along with this program ; if not, write to the Free Software
20 : edgomez 1.6 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 :     *
22 : Isibaar 1.18 * $Id: mem_transfer.h,v 1.17 2005/09/13 12:12:15 suxen_drol Exp $
23 : edgomez 1.6 *
24 :     ****************************************************************************/
25 :    
26 : Isibaar 1.1 #ifndef _MEM_TRANSFER_H
27 :     #define _MEM_TRANSFER_H
28 :    
29 : edgomez 1.6 /*****************************************************************************
30 :     * transfer8to16 API
31 :     ****************************************************************************/
32 :    
33 : edgomez 1.4 typedef void (TRANSFER_8TO16COPY) (int16_t * const dst,
34 :     const uint8_t * const src,
35 :     uint32_t stride);
36 : edgomez 1.6
37 : edgomez 1.4 typedef TRANSFER_8TO16COPY *TRANSFER_8TO16COPY_PTR;
38 : edgomez 1.6
39 :     /* Our global function pointer - Initialized in xvid.c */
40 : Isibaar 1.1 extern TRANSFER_8TO16COPY_PTR transfer_8to16copy;
41 : edgomez 1.6
42 :     /* Implemented functions */
43 : edgomez 1.13 extern TRANSFER_8TO16COPY transfer_8to16copy_c;
44 :    
45 : Isibaar 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
46 : edgomez 1.13 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 : Isibaar 1.1
54 : edgomez 1.14 #ifdef ARCH_IS_PPC
55 :     extern TRANSFER_8TO16COPY transfer_8to16copy_altivec_c;
56 :     #endif
57 :    
58 : edgomez 1.6 /*****************************************************************************
59 :     * transfer16to8 API
60 :     ****************************************************************************/
61 :    
62 : edgomez 1.4 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 1.6
67 :     /* Our global function pointer - Initialized in xvid.c */
68 : Isibaar 1.1 extern TRANSFER_16TO8COPY_PTR transfer_16to8copy;
69 : edgomez 1.6
70 :     /* Implemented functions */
71 : edgomez 1.13 extern TRANSFER_16TO8COPY transfer_16to8copy_c;
72 :    
73 : Isibaar 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
74 : edgomez 1.13 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 : Isibaar 1.1
82 : edgomez 1.14 #ifdef ARCH_IS_PPC
83 :     extern TRANSFER_16TO8COPY transfer_16to8copy_altivec_c;
84 :     #endif
85 :    
86 : edgomez 1.16 #ifdef ARCH_IS_X86_64
87 :     extern TRANSFER_16TO8COPY transfer_16to8copy_x86_64;
88 :     #endif
89 :    
90 : edgomez 1.6 /*****************************************************************************
91 : edgomez 1.12 * transfer8to16 + substraction *writeback* op API
92 : edgomez 1.6 ****************************************************************************/
93 :    
94 : edgomez 1.4 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 1.6
99 : edgomez 1.4 typedef TRANSFER_8TO16SUB *TRANSFER_8TO16SUB_PTR;
100 : Isibaar 1.1
101 : edgomez 1.6 /* Our global function pointer - Initialized in xvid.c */
102 : Isibaar 1.1 extern TRANSFER_8TO16SUB_PTR transfer_8to16sub;
103 : edgomez 1.6
104 :     /* Implemented functions */
105 : edgomez 1.13 extern TRANSFER_8TO16SUB transfer_8to16sub_c;
106 :    
107 : Isibaar 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
108 : edgomez 1.13 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 : Isibaar 1.1
116 : edgomez 1.14 #ifdef ARCH_IS_PPC
117 :     extern TRANSFER_8TO16SUB transfer_8to16sub_altivec_c;
118 :     #endif
119 :    
120 : edgomez 1.16 #ifdef ARCH_IS_X86_64
121 :     extern TRANSFER_8TO16SUB transfer_8to16sub_x86_64;
122 :     #endif
123 :    
124 : edgomez 1.6 /*****************************************************************************
125 : edgomez 1.12 * 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 1.13 extern TRANSFER_8TO16SUBRO transfer_8to16subro_c;
140 :    
141 : Isibaar 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
142 : edgomez 1.13 extern TRANSFER_8TO16SUBRO transfer_8to16subro_mmx;
143 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_3dne;
144 :     #endif
145 : edgomez 1.12
146 : edgomez 1.14 #ifdef ARCH_IS_PPC
147 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_altivec_c;
148 :     #endif
149 :    
150 : edgomez 1.16 #ifdef ARCH_IS_X86_64
151 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_x86_64;
152 :     #endif
153 :    
154 : edgomez 1.12 /*****************************************************************************
155 : edgomez 1.6 * transfer8to16 + substraction op API - Bidirectionnal Version
156 :     ****************************************************************************/
157 :    
158 : edgomez 1.4 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 1.6
164 : edgomez 1.4 typedef TRANSFER_8TO16SUB2 *TRANSFER_8TO16SUB2_PTR;
165 : suxen_drol 1.3
166 : edgomez 1.6 /* Our global function pointer - Initialized in xvid.c */
167 : suxen_drol 1.3 extern TRANSFER_8TO16SUB2_PTR transfer_8to16sub2;
168 : edgomez 1.6
169 :     /* Implemented functions */
170 : edgomez 1.14 TRANSFER_8TO16SUB2 transfer_8to16sub2_c;
171 : suxen_drol 1.3
172 : Isibaar 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
173 : edgomez 1.13 extern TRANSFER_8TO16SUB2 transfer_8to16sub2_mmx;
174 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_xmm;
175 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_3dne;
176 :     #endif
177 :    
178 :     #ifdef ARCH_IS_IA64
179 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_ia64;
180 :     #endif
181 : suxen_drol 1.3
182 : edgomez 1.14 #ifdef ARCH_IS_PPC
183 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_altivec_c;
184 :     #endif
185 :    
186 : edgomez 1.16 #ifdef ARCH_IS_X86_64
187 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_x86_64;
188 :     #endif
189 :    
190 : edgomez 1.6 /*****************************************************************************
191 : syskin 1.15 * 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 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
209 : syskin 1.15 extern TRANSFER_8TO16SUB2RO transfer_8to16sub2ro_xmm;
210 :     #endif
211 :    
212 : edgomez 1.16 #ifdef ARCH_IS_X86_64
213 :     extern TRANSFER_8TO16SUB2RO transfer_8to16sub2ro_x86_64;
214 :     #endif
215 :    
216 : syskin 1.15 /*****************************************************************************
217 : edgomez 1.6 * transfer16to8 + addition op API
218 :     ****************************************************************************/
219 :    
220 : edgomez 1.4 typedef void (TRANSFER_16TO8ADD) (uint8_t * const dst,
221 :     const int16_t * const src,
222 :     uint32_t stride);
223 : edgomez 1.6
224 : edgomez 1.4 typedef TRANSFER_16TO8ADD *TRANSFER_16TO8ADD_PTR;
225 : edgomez 1.6
226 :     /* Our global function pointer - Initialized in xvid.c */
227 : Isibaar 1.1 extern TRANSFER_16TO8ADD_PTR transfer_16to8add;
228 : edgomez 1.6
229 :     /* Implemented functions */
230 : edgomez 1.13 extern TRANSFER_16TO8ADD transfer_16to8add_c;
231 :    
232 : Isibaar 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
233 : edgomez 1.13 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 : Isibaar 1.1
241 : edgomez 1.14 #ifdef ARCH_IS_PPC
242 :     extern TRANSFER_16TO8ADD transfer_16to8add_altivec_c;
243 :     #endif
244 :    
245 : edgomez 1.16 #ifdef ARCH_IS_X86_64
246 :     extern TRANSFER_16TO8ADD transfer_16to8add_x86_64;
247 :     #endif
248 :    
249 : edgomez 1.6 /*****************************************************************************
250 :     * transfer8to8 + no op
251 :     ****************************************************************************/
252 :    
253 : edgomez 1.4 typedef void (TRANSFER8X8_COPY) (uint8_t * const dst,
254 :     const uint8_t * const src,
255 :     const uint32_t stride);
256 : edgomez 1.6
257 : edgomez 1.4 typedef TRANSFER8X8_COPY *TRANSFER8X8_COPY_PTR;
258 : edgomez 1.6
259 :     /* Our global function pointer - Initialized in xvid.c */
260 : Isibaar 1.1 extern TRANSFER8X8_COPY_PTR transfer8x8_copy;
261 : edgomez 1.6
262 :     /* Implemented functions */
263 : edgomez 1.13 extern TRANSFER8X8_COPY transfer8x8_copy_c;
264 : edgomez 1.12
265 : Isibaar 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
266 : edgomez 1.13 extern TRANSFER8X8_COPY transfer8x8_copy_mmx;
267 :     extern TRANSFER8X8_COPY transfer8x8_copy_3dne;
268 :     #endif
269 :    
270 :     #ifdef ARCH_IS_IA64
271 :     extern TRANSFER8X8_COPY transfer8x8_copy_ia64;
272 : edgomez 1.14 #endif
273 :    
274 :     #ifdef ARCH_IS_PPC
275 :     extern TRANSFER8X8_COPY transfer8x8_copy_altivec_c;
276 : edgomez 1.13 #endif
277 : edgomez 1.12
278 : edgomez 1.16 #ifdef ARCH_IS_X86_64
279 :     extern TRANSFER8X8_COPY transfer8x8_copy_x86_64;
280 :     #endif
281 :    
282 : suxen_drol 1.17 /*****************************************************************************
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 1.18 #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
299 : suxen_drol 1.17 extern TRANSFER8X4_COPY transfer8x4_copy_mmx;
300 :     extern TRANSFER8X4_COPY transfer8x4_copy_3dne;
301 :     #endif
302 :    
303 :    
304 : edgomez 1.12 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 : Isibaar 1.1
327 : edgomez 1.6 #endif

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