1 |
|
/***************************************************************************** |
2 |
|
* |
3 |
|
* XVID MPEG-4 VIDEO CODEC |
4 |
|
* - 8<->16 bit buffer transfer header - |
5 |
|
* |
6 |
|
* Copyright(C) 2001-2003 Peter Ross <pross@xvid.org> |
7 |
|
* |
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 |
|
* (at your option) any later version. |
12 |
|
* |
13 |
|
* This program is distributed in the hope that it will be useful, |
14 |
|
* but WITHOUT ANY WARRANTY ; without even the implied warranty of |
15 |
|
* 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 |
|
* along with this program ; if not, write to the Free Software |
20 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
|
* |
22 |
|
* $Id: mem_transfer.h,v 1.12.2.1 2003-06-09 13:55:44 edgomez Exp $ |
23 |
|
* |
24 |
|
****************************************************************************/ |
25 |
|
|
26 |
#ifndef _MEM_TRANSFER_H |
#ifndef _MEM_TRANSFER_H |
27 |
#define _MEM_TRANSFER_H |
#define _MEM_TRANSFER_H |
28 |
|
|
29 |
// transfer8to16 |
/***************************************************************************** |
30 |
|
* transfer8to16 API |
31 |
|
****************************************************************************/ |
32 |
|
|
33 |
typedef void (TRANSFER_8TO16COPY)(int16_t * const dst, |
typedef void (TRANSFER_8TO16COPY)(int16_t * const dst, |
34 |
const uint8_t * const src, |
const uint8_t * const src, |
35 |
uint32_t stride); |
uint32_t stride); |
36 |
|
|
37 |
typedef TRANSFER_8TO16COPY* TRANSFER_8TO16COPY_PTR; |
typedef TRANSFER_8TO16COPY* TRANSFER_8TO16COPY_PTR; |
38 |
|
|
39 |
|
/* Our global function pointer - Initialized in xvid.c */ |
40 |
extern TRANSFER_8TO16COPY_PTR transfer_8to16copy; |
extern TRANSFER_8TO16COPY_PTR transfer_8to16copy; |
41 |
|
|
42 |
|
/* Implemented functions */ |
43 |
TRANSFER_8TO16COPY transfer_8to16copy_c; |
TRANSFER_8TO16COPY transfer_8to16copy_c; |
44 |
TRANSFER_8TO16COPY transfer_8to16copy_mmx; |
TRANSFER_8TO16COPY transfer_8to16copy_mmx; |
45 |
|
TRANSFER_8TO16COPY transfer_8to16copy_3dne; |
46 |
|
TRANSFER_8TO16COPY transfer_8to16copy_ia64; |
47 |
|
|
48 |
|
/***************************************************************************** |
49 |
|
* transfer16to8 API |
50 |
|
****************************************************************************/ |
51 |
|
|
|
// transfer16to8 |
|
52 |
typedef void (TRANSFER_16TO8COPY)(uint8_t * const dst, |
typedef void (TRANSFER_16TO8COPY)(uint8_t * const dst, |
53 |
const int16_t * const src, |
const int16_t * const src, |
54 |
uint32_t stride); |
uint32_t stride); |
55 |
typedef TRANSFER_16TO8COPY* TRANSFER_16TO8COPY_PTR; |
typedef TRANSFER_16TO8COPY* TRANSFER_16TO8COPY_PTR; |
56 |
|
|
57 |
|
/* Our global function pointer - Initialized in xvid.c */ |
58 |
extern TRANSFER_16TO8COPY_PTR transfer_16to8copy; |
extern TRANSFER_16TO8COPY_PTR transfer_16to8copy; |
59 |
|
|
60 |
|
/* Implemented functions */ |
61 |
TRANSFER_16TO8COPY transfer_16to8copy_c; |
TRANSFER_16TO8COPY transfer_16to8copy_c; |
62 |
TRANSFER_16TO8COPY transfer_16to8copy_mmx; |
TRANSFER_16TO8COPY transfer_16to8copy_mmx; |
63 |
|
TRANSFER_16TO8COPY transfer_16to8copy_3dne; |
64 |
|
TRANSFER_16TO8COPY transfer_16to8copy_ia64; |
65 |
|
|
66 |
|
/***************************************************************************** |
67 |
|
* transfer8to16 + substraction *writeback* op API |
68 |
|
****************************************************************************/ |
69 |
|
|
|
// transfer8to16sub |
|
70 |
typedef void (TRANSFER_8TO16SUB)(int16_t * const dct, |
typedef void (TRANSFER_8TO16SUB)(int16_t * const dct, |
71 |
uint8_t * const cur, |
uint8_t * const cur, |
72 |
const uint8_t * ref, |
const uint8_t * ref, |
73 |
const uint32_t stride); |
const uint32_t stride); |
74 |
|
|
75 |
typedef TRANSFER_8TO16SUB* TRANSFER_8TO16SUB_PTR; |
typedef TRANSFER_8TO16SUB* TRANSFER_8TO16SUB_PTR; |
76 |
|
|
77 |
|
/* Our global function pointer - Initialized in xvid.c */ |
78 |
extern TRANSFER_8TO16SUB_PTR transfer_8to16sub; |
extern TRANSFER_8TO16SUB_PTR transfer_8to16sub; |
79 |
|
|
80 |
|
/* Implemented functions */ |
81 |
TRANSFER_8TO16SUB transfer_8to16sub_c; |
TRANSFER_8TO16SUB transfer_8to16sub_c; |
82 |
TRANSFER_8TO16SUB transfer_8to16sub_mmx; |
TRANSFER_8TO16SUB transfer_8to16sub_mmx; |
83 |
|
TRANSFER_8TO16SUB transfer_8to16sub_3dne; |
84 |
|
TRANSFER_8TO16SUB transfer_8to16sub_ia64; |
85 |
|
|
86 |
|
/***************************************************************************** |
87 |
|
* transfer8to16 + substraction *readonly* op API |
88 |
|
****************************************************************************/ |
89 |
|
|
90 |
|
typedef void (TRANSFER_8TO16SUBRO) (int16_t * const dct, |
91 |
|
const uint8_t * const cur, |
92 |
|
const uint8_t * ref, |
93 |
|
const uint32_t stride); |
94 |
|
|
95 |
|
typedef TRANSFER_8TO16SUBRO *TRANSFER_8TO16SUBRO_PTR; |
96 |
|
|
97 |
|
/* Our global function pointer - Initialized in xvid.c */ |
98 |
|
extern TRANSFER_8TO16SUBRO_PTR transfer_8to16subro; |
99 |
|
|
100 |
|
/* Implemented functions */ |
101 |
|
TRANSFER_8TO16SUBRO transfer_8to16subro_c; |
102 |
|
TRANSFER_8TO16SUBRO transfer_8to16subro_mmx; |
103 |
|
TRANSFER_8TO16SUBRO transfer_8to16subro_3dne; |
104 |
|
|
105 |
|
/***************************************************************************** |
106 |
|
* transfer8to16 + substraction op API - Bidirectionnal Version |
107 |
|
****************************************************************************/ |
108 |
|
|
109 |
|
typedef void (TRANSFER_8TO16SUB2) (int16_t * const dct, |
110 |
|
uint8_t * const cur, |
111 |
|
const uint8_t * ref1, |
112 |
|
const uint8_t * ref2, |
113 |
|
const uint32_t stride); |
114 |
|
|
115 |
|
typedef TRANSFER_8TO16SUB2 *TRANSFER_8TO16SUB2_PTR; |
116 |
|
|
117 |
|
/* Our global function pointer - Initialized in xvid.c */ |
118 |
|
extern TRANSFER_8TO16SUB2_PTR transfer_8to16sub2; |
119 |
|
|
120 |
|
/* Implemented functions */ |
121 |
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_c; |
122 |
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_mmx; |
123 |
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_xmm; |
124 |
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_3dne; |
125 |
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_ia64; |
126 |
|
|
127 |
|
|
128 |
|
/***************************************************************************** |
129 |
|
* transfer16to8 + addition op API |
130 |
|
****************************************************************************/ |
131 |
|
|
|
// transfer16to8add |
|
132 |
typedef void (TRANSFER_16TO8ADD)(uint8_t * const dst, |
typedef void (TRANSFER_16TO8ADD)(uint8_t * const dst, |
133 |
const int16_t * const src, |
const int16_t * const src, |
134 |
uint32_t stride); |
uint32_t stride); |
135 |
|
|
136 |
typedef TRANSFER_16TO8ADD* TRANSFER_16TO8ADD_PTR; |
typedef TRANSFER_16TO8ADD* TRANSFER_16TO8ADD_PTR; |
137 |
|
|
138 |
|
/* Our global function pointer - Initialized in xvid.c */ |
139 |
extern TRANSFER_16TO8ADD_PTR transfer_16to8add; |
extern TRANSFER_16TO8ADD_PTR transfer_16to8add; |
140 |
|
|
141 |
|
/* Implemented functions */ |
142 |
TRANSFER_16TO8ADD transfer_16to8add_c; |
TRANSFER_16TO8ADD transfer_16to8add_c; |
143 |
TRANSFER_16TO8ADD transfer_16to8add_mmx; |
TRANSFER_16TO8ADD transfer_16to8add_mmx; |
144 |
|
TRANSFER_16TO8ADD transfer_16to8add_3dne; |
145 |
|
TRANSFER_16TO8ADD transfer_16to8add_ia64; |
146 |
|
|
147 |
|
/***************************************************************************** |
148 |
|
* transfer8to8 + no op |
149 |
|
****************************************************************************/ |
150 |
|
|
|
// transfer8x8_copy |
|
151 |
typedef void (TRANSFER8X8_COPY)(uint8_t * const dst, |
typedef void (TRANSFER8X8_COPY)(uint8_t * const dst, |
152 |
const uint8_t * const src, |
const uint8_t * const src, |
153 |
const uint32_t stride); |
const uint32_t stride); |
154 |
|
|
155 |
typedef TRANSFER8X8_COPY* TRANSFER8X8_COPY_PTR; |
typedef TRANSFER8X8_COPY* TRANSFER8X8_COPY_PTR; |
156 |
|
|
157 |
|
/* Our global function pointer - Initialized in xvid.c */ |
158 |
extern TRANSFER8X8_COPY_PTR transfer8x8_copy; |
extern TRANSFER8X8_COPY_PTR transfer8x8_copy; |
159 |
|
|
160 |
|
/* Implemented functions */ |
161 |
TRANSFER8X8_COPY transfer8x8_copy_c; |
TRANSFER8X8_COPY transfer8x8_copy_c; |
162 |
TRANSFER8X8_COPY transfer8x8_copy_mmx; |
TRANSFER8X8_COPY transfer8x8_copy_mmx; |
163 |
|
TRANSFER8X8_COPY transfer8x8_copy_3dne; |
164 |
|
TRANSFER8X8_COPY transfer8x8_copy_ia64; |
165 |
|
|
166 |
|
|
167 |
|
static __inline void |
168 |
|
transfer16x16_copy(uint8_t * const dst, |
169 |
|
const uint8_t * const src, |
170 |
|
const uint32_t stride) |
171 |
|
{ |
172 |
|
transfer8x8_copy(dst, src, stride); |
173 |
|
transfer8x8_copy(dst + 8, src + 8, stride); |
174 |
|
transfer8x8_copy(dst + 8*stride, src + 8*stride, stride); |
175 |
|
transfer8x8_copy(dst + 8*stride + 8, src + 8*stride + 8, stride); |
176 |
|
} |
177 |
|
|
178 |
|
static __inline void |
179 |
|
transfer32x32_copy(uint8_t * const dst, |
180 |
|
const uint8_t * const src, |
181 |
|
const uint32_t stride) |
182 |
|
{ |
183 |
|
transfer16x16_copy(dst, src, stride); |
184 |
|
transfer16x16_copy(dst + 16, src + 16, stride); |
185 |
|
transfer16x16_copy(dst + 16*stride, src + 16*stride, stride); |
186 |
|
transfer16x16_copy(dst + 16*stride + 16, src + 16*stride + 16, stride); |
187 |
|
} |
188 |
|
|
189 |
|
|
190 |
#endif /* _MEM_TRANSFER_H_ */ |
#endif |