55 |
#include "utils/timer.h" |
#include "utils/timer.h" |
56 |
#include "bitstream/mbcoding.h" |
#include "bitstream/mbcoding.h" |
57 |
|
|
58 |
int xvid_init(void *handle, int opt, void *param1, void *param2) |
int |
59 |
|
xvid_init(void *handle, |
60 |
|
int opt, |
61 |
|
void *param1, |
62 |
|
void *param2) |
63 |
{ |
{ |
64 |
int cpu_flags; |
int cpu_flags; |
65 |
XVID_INIT_PARAM *init_param; |
XVID_INIT_PARAM *init_param; |
86 |
fdct = fdct_int32; |
fdct = fdct_int32; |
87 |
idct = idct_int32; |
idct = idct_int32; |
88 |
|
|
89 |
|
sadInit = 0; |
90 |
|
|
91 |
emms = emms_c; |
emms = emms_c; |
92 |
|
|
93 |
quant_intra = quant_intra_c; |
quant_intra = quant_intra_c; |
103 |
transfer_8to16copy = transfer_8to16copy_c; |
transfer_8to16copy = transfer_8to16copy_c; |
104 |
transfer_16to8copy = transfer_16to8copy_c; |
transfer_16to8copy = transfer_16to8copy_c; |
105 |
transfer_8to16sub = transfer_8to16sub_c; |
transfer_8to16sub = transfer_8to16sub_c; |
106 |
|
transfer_8to16sub2 = transfer_8to16sub2_c; |
107 |
transfer_16to8add = transfer_16to8add_c; |
transfer_16to8add = transfer_16to8add_c; |
108 |
transfer8x8_copy = transfer8x8_copy_c; |
transfer8x8_copy = transfer8x8_copy_c; |
109 |
|
|
131 |
|
|
132 |
calc_cbp = calc_cbp_c; |
calc_cbp = calc_cbp_c; |
133 |
sad16 = sad16_c; |
sad16 = sad16_c; |
134 |
|
sad16bi = sad16bi_c; |
135 |
sad8 = sad8_c; |
sad8 = sad8_c; |
136 |
dev16 = dev16_c; |
dev16 = dev16_c; |
137 |
|
|
199 |
interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dn; |
interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dn; |
200 |
} |
} |
201 |
|
|
202 |
|
if ((cpu_flags & XVID_CPU_SSE2) > 0) { |
203 |
|
#ifdef EXPERIMENTAL_SSE2_CODE |
204 |
|
quant_intra = quant_intra_sse2; |
205 |
|
dequant_intra = dequant_intra_sse2; |
206 |
|
quant_inter = quant_inter_sse2; |
207 |
|
dequant_inter = dequant_inter_sse2; |
208 |
|
|
209 |
|
calc_cbp = calc_cbp_sse2; |
210 |
|
sad16 = sad16_sse2; |
211 |
|
dev16 = dev16_sse2; |
212 |
|
idct = idct_sse2; |
213 |
|
fdct = fdct_sse2; |
214 |
|
#endif |
215 |
|
} |
216 |
#endif |
#endif |
217 |
#ifdef ARCH_PPC |
#ifdef ARCH_PPC |
218 |
#ifdef ARCH_PPC_ALTIVEC |
#ifdef ARCH_PPC_ALTIVEC |
219 |
calc_cbp = calc_cbp_altivec; |
calc_cbp = calc_cbp_altivec; |
220 |
fdct = fdct_altivec; |
fdct = fdct_altivec; |
221 |
idct = idct_altivec; |
idct = idct_altivec; |
222 |
|
sadInit = sadInit_altivec; |
223 |
sad16 = sad16_altivec; |
sad16 = sad16_altivec; |
224 |
sad8 = sad8_altivec; |
sad8 = sad8_altivec; |
225 |
dev16 = dev16_altivec; |
dev16 = dev16_altivec; |
237 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
238 |
} |
} |
239 |
|
|
240 |
int xvid_decore(void * handle, int opt, void * param1, void * param2) |
int |
241 |
{ |
xvid_decore(void *handle, |
242 |
switch (opt) |
int opt, |
243 |
|
void *param1, |
244 |
|
void *param2) |
245 |
{ |
{ |
246 |
|
switch (opt) { |
247 |
case XVID_DEC_DECODE : |
case XVID_DEC_DECODE : |
248 |
return decoder_decode((DECODER *) handle, (XVID_DEC_FRAME *) param1); |
return decoder_decode((DECODER *) handle, (XVID_DEC_FRAME *) param1); |
249 |
|
|
259 |
} |
} |
260 |
|
|
261 |
|
|
262 |
int xvid_encore(void * handle, int opt, void * param1, void * param2) |
int |
263 |
{ |
xvid_encore(void *handle, |
264 |
switch (opt) |
int opt, |
265 |
|
void *param1, |
266 |
|
void *param2) |
267 |
{ |
{ |
268 |
|
switch (opt) { |
269 |
case XVID_ENC_ENCODE : |
case XVID_ENC_ENCODE : |
270 |
return encoder_encode((Encoder *) handle, (XVID_ENC_FRAME *) param1, (XVID_ENC_STATS *) param2); |
return encoder_encode((Encoder *) handle, (XVID_ENC_FRAME *) param1, |
271 |
|
(XVID_ENC_STATS *) param2); |
272 |
|
|
273 |
case XVID_ENC_CREATE : |
case XVID_ENC_CREATE : |
274 |
return encoder_create((XVID_ENC_PARAM *) param1); |
return encoder_create((XVID_ENC_PARAM *) param1); |