65 |
#include "utils/timer.h" |
#include "utils/timer.h" |
66 |
#include "bitstream/mbcoding.h" |
#include "bitstream/mbcoding.h" |
67 |
|
|
68 |
#if defined(ARCH_X86) |
#if defined(ARCH_IS_IA32) |
69 |
|
|
70 |
#if defined(_MSC_VER) |
#if defined(_MSC_VER) |
71 |
# include <windows.h> |
# include <windows.h> |
136 |
/* enable native assembly optimizations by default */ |
/* enable native assembly optimizations by default */ |
137 |
unsigned int cpu_flags = XVID_CPU_ASM; |
unsigned int cpu_flags = XVID_CPU_ASM; |
138 |
|
|
139 |
#if defined(ARCH_X86) |
#if defined(ARCH_IS_IA32) |
140 |
cpu_flags |= check_cpu_features(); |
cpu_flags |= check_cpu_features(); |
141 |
if ((cpu_flags & XVID_CPU_SSE) && sigill_check(sse_os_trigger)) |
if ((cpu_flags & XVID_CPU_SSE) && sigill_check(sse_os_trigger)) |
142 |
cpu_flags &= ~XVID_CPU_SSE; |
cpu_flags &= ~XVID_CPU_SSE; |
145 |
cpu_flags &= ~XVID_CPU_SSE2; |
cpu_flags &= ~XVID_CPU_SSE2; |
146 |
#endif |
#endif |
147 |
|
|
148 |
#if defined(ARCH_PPC) |
#if defined(ARCH_IS_PPC) |
149 |
#if defined(ARCH_PPC_ALTIVEC) |
#if defined(ARCH_IS_PPC_ALTIVEC) |
150 |
cpu_flags |= XVID_CPU_ALTIVEC; |
cpu_flags |= XVID_CPU_ALTIVEC; |
151 |
#endif |
#endif |
152 |
#endif |
#endif |
229 |
transfer_8to16copy = transfer_8to16copy_c; |
transfer_8to16copy = transfer_8to16copy_c; |
230 |
transfer_16to8copy = transfer_16to8copy_c; |
transfer_16to8copy = transfer_16to8copy_c; |
231 |
transfer_8to16sub = transfer_8to16sub_c; |
transfer_8to16sub = transfer_8to16sub_c; |
232 |
|
transfer_8to16subro = transfer_8to16subro_c; |
233 |
transfer_8to16sub2 = transfer_8to16sub2_c; |
transfer_8to16sub2 = transfer_8to16sub2_c; |
234 |
transfer_16to8add = transfer_16to8add_c; |
transfer_16to8add = transfer_16to8add_c; |
235 |
transfer8x8_copy = transfer8x8_copy_c; |
transfer8x8_copy = transfer8x8_copy_c; |
318 |
|
|
319 |
// Halfpel8_Refine = Halfpel8_Refine_c; |
// Halfpel8_Refine = Halfpel8_Refine_c; |
320 |
|
|
321 |
#if defined(ARCH_X86) |
#if defined(ARCH_IS_IA32) |
322 |
|
|
323 |
if ((cpu_flags & XVID_CPU_ASM)) |
if ((cpu_flags & XVID_CPU_ASM)) |
324 |
{ |
{ |
355 |
transfer_8to16copy = transfer_8to16copy_mmx; |
transfer_8to16copy = transfer_8to16copy_mmx; |
356 |
transfer_16to8copy = transfer_16to8copy_mmx; |
transfer_16to8copy = transfer_16to8copy_mmx; |
357 |
transfer_8to16sub = transfer_8to16sub_mmx; |
transfer_8to16sub = transfer_8to16sub_mmx; |
358 |
|
transfer_8to16subro = transfer_8to16subro_mmx; |
359 |
transfer_8to16sub2 = transfer_8to16sub2_mmx; |
transfer_8to16sub2 = transfer_8to16sub2_mmx; |
360 |
transfer_16to8add = transfer_16to8add_mmx; |
transfer_16to8add = transfer_16to8add_mmx; |
361 |
transfer8x8_copy = transfer8x8_copy_mmx; |
transfer8x8_copy = transfer8x8_copy_mmx; |
476 |
transfer_8to16copy = transfer_8to16copy_3dne; |
transfer_8to16copy = transfer_8to16copy_3dne; |
477 |
transfer_16to8copy = transfer_16to8copy_3dne; |
transfer_16to8copy = transfer_16to8copy_3dne; |
478 |
transfer_8to16sub = transfer_8to16sub_3dne; |
transfer_8to16sub = transfer_8to16sub_3dne; |
479 |
|
transfer_8to16subro = transfer_8to16subro_3dne; |
480 |
transfer_8to16sub2 = transfer_8to16sub2_3dne; |
transfer_8to16sub2 = transfer_8to16sub2_3dne; |
481 |
transfer_16to8add = transfer_16to8add_3dne; |
transfer_16to8add = transfer_16to8add_3dne; |
482 |
transfer8x8_copy = transfer8x8_copy_3dne; |
transfer8x8_copy = transfer8x8_copy_3dne; |
525 |
} |
} |
526 |
#endif |
#endif |
527 |
|
|
528 |
#if defined(ARCH_IA64) |
#if defined(ARCH_IS_IA64) |
529 |
if ((cpu_flags & XVID_CPU_ASM)) { //use assembler routines? |
if ((cpu_flags & XVID_CPU_ASM)) { //use assembler routines? |
530 |
idct_ia64_init(); |
idct_ia64_init(); |
531 |
fdct = fdct_ia64; |
fdct = fdct_ia64; |
552 |
} |
} |
553 |
#endif |
#endif |
554 |
|
|
555 |
#if defined(ARCH_PPC) |
#if defined(ARCH_IS_PPC) |
556 |
if ((cpu_flags & XVID_CPU_ASM)) |
if ((cpu_flags & XVID_CPU_ASM)) |
557 |
{ |
{ |
558 |
calc_cbp = calc_cbp_ppc; |
calc_cbp = calc_cbp_ppc; |
664 |
#define TEST_FDCT (TEST_FORWARD) |
#define TEST_FDCT (TEST_FORWARD) |
665 |
#define TEST_IDCT (0) |
#define TEST_IDCT (0) |
666 |
|
|
667 |
int test_transform(void * funcA, void * funcB, const char * nameB, |
static int test_transform(void * funcA, void * funcB, const char * nameB, |
668 |
int test, int flags) |
int test, int flags) |
669 |
{ |
{ |
670 |
int i; |
int i; |
744 |
#define TEST_DEQUANT_INTRA (TEST_INTRA) |
#define TEST_DEQUANT_INTRA (TEST_INTRA) |
745 |
#define TEST_DEQUANT_INTER (0) |
#define TEST_DEQUANT_INTER (0) |
746 |
|
|
747 |
int test_quant(void * funcA, void * funcB, const char * nameB, |
static int test_quant(void * funcA, void * funcB, const char * nameB, |
748 |
int test, int flags) |
int test, int flags) |
749 |
{ |
{ |
750 |
int q,i; |
int q,i; |
831 |
|
|
832 |
printf("xvid_init_test\n"); |
printf("xvid_init_test\n"); |
833 |
|
|
834 |
#if defined(ARCH_X86) |
#if defined(ARCH_IS_IA32) |
835 |
cpu_flags = detect_cpu_flags(); |
cpu_flags = detect_cpu_flags(); |
836 |
idct_int32_init(); |
idct_int32_init(); |
837 |
emms_mmx(); |
emms_mmx(); |