3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - 8<->16 bit buffer transfer header - |
* - 8<->16 bit buffer transfer header - |
5 |
* |
* |
6 |
* Copyright(C) 2002 Michael Militzer <isibaar@xvid.org> |
* Copyright(C) 2001-2003 Peter Ross <pross@xvid.org> |
7 |
* |
* |
8 |
* This file is part of XviD, a free MPEG-4 video encoder/decoder |
* 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 |
|
* XviD is free software; you can redistribute it and/or modify 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 |
* the Free Software Foundation; either version 2 of the License, or |
11 |
* (at your option) any later version. |
* (at your option) any later version. |
12 |
* |
* |
19 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
|
* Under section 8 of the GNU General Public License, the copyright |
|
|
* holders of XVID explicitly forbid distribution in the following |
|
|
* countries: |
|
|
* |
|
|
* - Japan |
|
|
* - United States of America |
|
|
* |
|
|
* Linking XviD statically or dynamically with other modules is making a |
|
|
* combined work based on XviD. Thus, the terms and conditions of the |
|
|
* GNU General Public License cover the whole combination. |
|
|
* |
|
|
* As a special exception, the copyright holders of XviD give you |
|
|
* permission to link XviD with independent modules that communicate with |
|
|
* XviD solely through the VFW1.1 and DShow interfaces, regardless of the |
|
|
* license terms of these independent modules, and to copy and distribute |
|
|
* the resulting combined work under terms of your choice, provided that |
|
|
* every copy of the combined work is accompanied by a complete copy of |
|
|
* the source code of XviD (the version of XviD used to produce the |
|
|
* combined work), being distributed under the terms of the GNU General |
|
|
* Public License plus this exception. An independent module is a module |
|
|
* which is not derived from or based on XviD. |
|
|
* |
|
|
* Note that people who make modified versions of XviD are not obligated |
|
|
* to grant this special exception for their modified versions; it is |
|
|
* their choice whether to do so. The GNU General Public License gives |
|
|
* permission to release a modified version without this exception; this |
|
|
* exception also makes it possible to release a modified version which |
|
|
* carries forward this exception. |
|
|
* |
|
22 |
* $Id$ |
* $Id$ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
42 |
/* Implemented functions */ |
/* 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; |
TRANSFER_8TO16COPY transfer_8to16copy_ia64; |
47 |
|
|
48 |
/***************************************************************************** |
/***************************************************************************** |
60 |
/* Implemented functions */ |
/* 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; |
TRANSFER_16TO8COPY transfer_16to8copy_ia64; |
65 |
|
|
66 |
/***************************************************************************** |
/***************************************************************************** |
67 |
* transfer8to16 + substraction op API |
* transfer8to16 + substraction *writeback* op API |
68 |
****************************************************************************/ |
****************************************************************************/ |
69 |
|
|
70 |
typedef void (TRANSFER_8TO16SUB) (int16_t * const dct, |
typedef void (TRANSFER_8TO16SUB) (int16_t * const dct, |
80 |
/* Implemented functions */ |
/* 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; |
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 |
* transfer8to16 + substraction op API - Bidirectionnal Version |
107 |
****************************************************************************/ |
****************************************************************************/ |
108 |
|
|
121 |
TRANSFER_8TO16SUB2 transfer_8to16sub2_c; |
TRANSFER_8TO16SUB2 transfer_8to16sub2_c; |
122 |
TRANSFER_8TO16SUB2 transfer_8to16sub2_mmx; |
TRANSFER_8TO16SUB2 transfer_8to16sub2_mmx; |
123 |
TRANSFER_8TO16SUB2 transfer_8to16sub2_xmm; |
TRANSFER_8TO16SUB2 transfer_8to16sub2_xmm; |
124 |
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_3dne; |
125 |
TRANSFER_8TO16SUB2 transfer_8to16sub2_ia64; |
TRANSFER_8TO16SUB2 transfer_8to16sub2_ia64; |
126 |
|
|
127 |
|
|
141 |
/* Implemented functions */ |
/* 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; |
TRANSFER_16TO8ADD transfer_16to8add_ia64; |
146 |
|
|
147 |
/***************************************************************************** |
/***************************************************************************** |
160 |
/* Implemented functions */ |
/* 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; |
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 |
#endif |