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 |
* |
* |
22 |
* $Id: xvid.c,v 1.45.2.12 2003-08-02 15:08:30 edgomez Exp $ |
* $Id: xvid.c,v 1.45.2.13 2003-08-22 15:52:35 Isibaar Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
46 |
#include "utils/emms.h" |
#include "utils/emms.h" |
47 |
#include "utils/timer.h" |
#include "utils/timer.h" |
48 |
#include "bitstream/mbcoding.h" |
#include "bitstream/mbcoding.h" |
49 |
|
#include "image/qpel.h" |
50 |
|
|
51 |
#if defined(_DEBUG) |
#if defined(_DEBUG) |
52 |
unsigned int xvid_debug = 0; /* xvid debug mask */ |
unsigned int xvid_debug = 0; /* xvid debug mask */ |
183 |
/* Restore FPU context : emms_c is a nop functions */ |
/* Restore FPU context : emms_c is a nop functions */ |
184 |
emms = emms_c; |
emms = emms_c; |
185 |
|
|
186 |
|
/* Qpel stuff */ |
187 |
|
xvid_QP_Funcs = &xvid_QP_Funcs_C; |
188 |
|
xvid_QP_Add_Funcs = &xvid_QP_Add_Funcs_C; |
189 |
|
xvid_Init_QP_mmx(); |
190 |
|
|
191 |
/* Quantization functions */ |
/* Quantization functions */ |
192 |
quant_intra = quant_intra_c; |
quant_intra = quant_intra_c; |
193 |
dequant_intra = dequant_intra_c; |
dequant_intra = dequant_intra_c; |
313 |
fdct = fdct_mmx; |
fdct = fdct_mmx; |
314 |
idct = idct_mmx; |
idct = idct_mmx; |
315 |
|
|
316 |
|
/* Qpel stuff */ |
317 |
|
xvid_QP_Funcs = &xvid_QP_Funcs_mmx; |
318 |
|
xvid_QP_Add_Funcs = &xvid_QP_Add_Funcs_mmx; |
319 |
|
|
320 |
/* Quantization related functions */ |
/* Quantization related functions */ |
321 |
quant_intra = quant_intra_mmx; |
quant_intra = quant_intra_mmx; |
322 |
dequant_intra = dequant_intra_mmx; |
dequant_intra = dequant_intra_mmx; |
480 |
interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dne; |
interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dne; |
481 |
} |
} |
482 |
|
|
483 |
|
#if defined(EXPERIMENTAL_SSE2_CODE) /* mark the whole SSE2 stuff as experimental. At least on |
484 |
|
my P4, it crashes... */ |
485 |
if ((cpu_flags & XVID_CPU_SSE2)) { |
if ((cpu_flags & XVID_CPU_SSE2)) { |
486 |
|
|
487 |
calc_cbp = calc_cbp_sse2; |
calc_cbp = calc_cbp_sse2; |
492 |
quant_inter = quant_inter_sse2; |
quant_inter = quant_inter_sse2; |
493 |
dequant_inter = dequant_inter_sse2; |
dequant_inter = dequant_inter_sse2; |
494 |
|
|
|
#if defined(EXPERIMENTAL_SSE2_CODE) |
|
495 |
/* ME; slower than xmm */ |
/* ME; slower than xmm */ |
496 |
sad16 = sad16_sse2; |
sad16 = sad16_sse2; |
497 |
dev16 = dev16_sse2; |
dev16 = dev16_sse2; |
|
#endif |
|
498 |
/* Forward and Inverse DCT */ |
/* Forward and Inverse DCT */ |
499 |
#if 0 /* Both function are known to be unprecise, better keep them deactivated */ |
#if 0 /* Both function are known to be unprecise, better keep them deactivated */ |
500 |
idct = idct_sse2; |
idct = idct_sse2; |
502 |
#endif |
#endif |
503 |
} |
} |
504 |
#endif |
#endif |
505 |
|
#endif |
506 |
|
|
507 |
#if defined(ARCH_IS_IA64) |
#if defined(ARCH_IS_IA64) |
508 |
if ((cpu_flags & XVID_CPU_ASM)) { /* use assembler routines? */ |
if ((cpu_flags & XVID_CPU_ASM)) { /* use assembler routines? */ |