[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.14 - (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 : edgomez 1.13 * $Id$
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 :     #ifdef ARCH_IS_IA32
46 :     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 :     #ifdef ARCH_IS_IA32
74 :     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.6 /*****************************************************************************
87 : edgomez 1.12 * transfer8to16 + substraction *writeback* op API
88 : edgomez 1.6 ****************************************************************************/
89 :    
90 : edgomez 1.4 typedef void (TRANSFER_8TO16SUB) (int16_t * const dct,
91 :     uint8_t * const cur,
92 :     const uint8_t * ref,
93 :     const uint32_t stride);
94 : edgomez 1.6
95 : edgomez 1.4 typedef TRANSFER_8TO16SUB *TRANSFER_8TO16SUB_PTR;
96 : Isibaar 1.1
97 : edgomez 1.6 /* Our global function pointer - Initialized in xvid.c */
98 : Isibaar 1.1 extern TRANSFER_8TO16SUB_PTR transfer_8to16sub;
99 : edgomez 1.6
100 :     /* Implemented functions */
101 : edgomez 1.13 extern TRANSFER_8TO16SUB transfer_8to16sub_c;
102 :    
103 :     #ifdef ARCH_IS_IA32
104 :     extern TRANSFER_8TO16SUB transfer_8to16sub_mmx;
105 :     extern TRANSFER_8TO16SUB transfer_8to16sub_3dne;
106 :     #endif
107 :    
108 :     #ifdef ARCH_IS_IA64
109 :     extern TRANSFER_8TO16SUB transfer_8to16sub_ia64;
110 :     #endif
111 : Isibaar 1.1
112 : edgomez 1.14 #ifdef ARCH_IS_PPC
113 :     extern TRANSFER_8TO16SUB transfer_8to16sub_altivec_c;
114 :     #endif
115 :    
116 : edgomez 1.6 /*****************************************************************************
117 : edgomez 1.12 * transfer8to16 + substraction *readonly* op API
118 :     ****************************************************************************/
119 :    
120 :     typedef void (TRANSFER_8TO16SUBRO) (int16_t * const dct,
121 :     const uint8_t * const cur,
122 :     const uint8_t * ref,
123 :     const uint32_t stride);
124 :    
125 :     typedef TRANSFER_8TO16SUBRO *TRANSFER_8TO16SUBRO_PTR;
126 :    
127 :     /* Our global function pointer - Initialized in xvid.c */
128 :     extern TRANSFER_8TO16SUBRO_PTR transfer_8to16subro;
129 :    
130 :     /* Implemented functions */
131 : edgomez 1.13 extern TRANSFER_8TO16SUBRO transfer_8to16subro_c;
132 :    
133 :     #ifdef ARCH_IS_IA32
134 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_mmx;
135 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_3dne;
136 :     #endif
137 : edgomez 1.12
138 : edgomez 1.14 #ifdef ARCH_IS_PPC
139 :     extern TRANSFER_8TO16SUBRO transfer_8to16subro_altivec_c;
140 :     #endif
141 :    
142 : edgomez 1.12 /*****************************************************************************
143 : edgomez 1.6 * transfer8to16 + substraction op API - Bidirectionnal Version
144 :     ****************************************************************************/
145 :    
146 : edgomez 1.4 typedef void (TRANSFER_8TO16SUB2) (int16_t * const dct,
147 :     uint8_t * const cur,
148 :     const uint8_t * ref1,
149 :     const uint8_t * ref2,
150 :     const uint32_t stride);
151 : edgomez 1.6
152 : edgomez 1.4 typedef TRANSFER_8TO16SUB2 *TRANSFER_8TO16SUB2_PTR;
153 : suxen_drol 1.3
154 : edgomez 1.6 /* Our global function pointer - Initialized in xvid.c */
155 : suxen_drol 1.3 extern TRANSFER_8TO16SUB2_PTR transfer_8to16sub2;
156 : edgomez 1.6
157 :     /* Implemented functions */
158 : edgomez 1.14 TRANSFER_8TO16SUB2 transfer_8to16sub2_c;
159 : suxen_drol 1.3
160 : edgomez 1.13 #ifdef ARCH_IS_IA32
161 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_mmx;
162 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_xmm;
163 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_3dne;
164 :     #endif
165 :    
166 :     #ifdef ARCH_IS_IA64
167 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_ia64;
168 :     #endif
169 : suxen_drol 1.3
170 : edgomez 1.14 #ifdef ARCH_IS_PPC
171 :     extern TRANSFER_8TO16SUB2 transfer_8to16sub2_altivec_c;
172 :     #endif
173 :    
174 : edgomez 1.6 /*****************************************************************************
175 :     * transfer16to8 + addition op API
176 :     ****************************************************************************/
177 :    
178 : edgomez 1.4 typedef void (TRANSFER_16TO8ADD) (uint8_t * const dst,
179 :     const int16_t * const src,
180 :     uint32_t stride);
181 : edgomez 1.6
182 : edgomez 1.4 typedef TRANSFER_16TO8ADD *TRANSFER_16TO8ADD_PTR;
183 : edgomez 1.6
184 :     /* Our global function pointer - Initialized in xvid.c */
185 : Isibaar 1.1 extern TRANSFER_16TO8ADD_PTR transfer_16to8add;
186 : edgomez 1.6
187 :     /* Implemented functions */
188 : edgomez 1.13 extern TRANSFER_16TO8ADD transfer_16to8add_c;
189 :    
190 :     #ifdef ARCH_IS_IA32
191 :     extern TRANSFER_16TO8ADD transfer_16to8add_mmx;
192 :     extern TRANSFER_16TO8ADD transfer_16to8add_3dne;
193 :     #endif
194 :    
195 :     #ifdef ARCH_IS_IA64
196 :     extern TRANSFER_16TO8ADD transfer_16to8add_ia64;
197 :     #endif
198 : Isibaar 1.1
199 : edgomez 1.14 #ifdef ARCH_IS_PPC
200 :     extern TRANSFER_16TO8ADD transfer_16to8add_altivec_c;
201 :     #endif
202 :    
203 : edgomez 1.6 /*****************************************************************************
204 :     * transfer8to8 + no op
205 :     ****************************************************************************/
206 :    
207 : edgomez 1.4 typedef void (TRANSFER8X8_COPY) (uint8_t * const dst,
208 :     const uint8_t * const src,
209 :     const uint32_t stride);
210 : edgomez 1.6
211 : edgomez 1.4 typedef TRANSFER8X8_COPY *TRANSFER8X8_COPY_PTR;
212 : edgomez 1.6
213 :     /* Our global function pointer - Initialized in xvid.c */
214 : Isibaar 1.1 extern TRANSFER8X8_COPY_PTR transfer8x8_copy;
215 : edgomez 1.6
216 :     /* Implemented functions */
217 : edgomez 1.13 extern TRANSFER8X8_COPY transfer8x8_copy_c;
218 : edgomez 1.12
219 : edgomez 1.13 #ifdef ARCH_IS_IA32
220 :     extern TRANSFER8X8_COPY transfer8x8_copy_mmx;
221 :     extern TRANSFER8X8_COPY transfer8x8_copy_3dne;
222 :     #endif
223 :    
224 :     #ifdef ARCH_IS_IA64
225 :     extern TRANSFER8X8_COPY transfer8x8_copy_ia64;
226 : edgomez 1.14 #endif
227 :    
228 :     #ifdef ARCH_IS_PPC
229 :     extern TRANSFER8X8_COPY transfer8x8_copy_altivec_c;
230 : edgomez 1.13 #endif
231 : edgomez 1.12
232 :     static __inline void
233 :     transfer16x16_copy(uint8_t * const dst,
234 :     const uint8_t * const src,
235 :     const uint32_t stride)
236 :     {
237 :     transfer8x8_copy(dst, src, stride);
238 :     transfer8x8_copy(dst + 8, src + 8, stride);
239 :     transfer8x8_copy(dst + 8*stride, src + 8*stride, stride);
240 :     transfer8x8_copy(dst + 8*stride + 8, src + 8*stride + 8, stride);
241 :     }
242 :    
243 :     static __inline void
244 :     transfer32x32_copy(uint8_t * const dst,
245 :     const uint8_t * const src,
246 :     const uint32_t stride)
247 :     {
248 :     transfer16x16_copy(dst, src, stride);
249 :     transfer16x16_copy(dst + 16, src + 16, stride);
250 :     transfer16x16_copy(dst + 16*stride, src + 16*stride, stride);
251 :     transfer16x16_copy(dst + 16*stride + 16, src + 16*stride + 16, stride);
252 :     }
253 :    
254 : Isibaar 1.1
255 : edgomez 1.6 #endif

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