--- xvid.c 2002/11/08 10:10:48 1.33.2.13 +++ xvid.c 2003/02/12 11:46:18 1.33.2.23 @@ -37,10 +37,15 @@ * - 22.12.2001 API change: added xvid_init() - Isibaar * - 16.12.2001 inital version; (c)2001 peter ross * - * $Id: xvid.c,v 1.33.2.13 2002/11/08 10:10:48 suxen_drol Exp $ + * $Id: xvid.c,v 1.33.2.23 2003/02/12 11:46:18 syskin Exp $ * ****************************************************************************/ +#include +#include +#include +#include + #include "xvid.h" #include "decoder.h" #include "encoder.h" @@ -49,6 +54,7 @@ #include "dct/fdct.h" #include "image/colorspace.h" #include "image/interpolate8x8.h" +#include "image/reduced.h" #include "utils/mem_transfer.h" #include "utils/mbfunctions.h" #include "quant/quant_h263.h" @@ -59,25 +65,21 @@ #include "utils/timer.h" #include "bitstream/mbcoding.h" -#if defined(ARCH_X86) && defined(EXPERIMENTAL_SSE2_CODE) +#if defined(ARCH_X86) -#ifdef WIN32 -#include +#if defined(_MSC_VER) +# include #else -#include -#include -#endif - - -#ifndef WIN32 +# include +# include -static jmp_buf mark; + static jmp_buf mark; -static void -sigill_handler(int signal) -{ - longjmp(mark, 1); -} + static void + sigill_handler(int signal) + { + longjmp(mark, 1); + } #endif @@ -92,7 +94,7 @@ int sigill_check(void (*func)()) { -#ifdef WIN32 +#if defined(_MSC_VER) _try { func(); } @@ -126,6 +128,33 @@ } #endif + +/* detect cpu flags */ +static unsigned int +detect_cpu_flags() +{ + /* enable native assembly optimizations by default */ + unsigned int cpu_flags = XVID_CPU_ASM; + +#if defined(ARCH_X86) + cpu_flags |= check_cpu_features(); + if ((cpu_flags & XVID_CPU_SSE) && sigill_check(sse_os_trigger)) + cpu_flags &= ~XVID_CPU_SSE; + + if ((cpu_flags & XVID_CPU_SSE2) && sigill_check(sse2_os_trigger)) + cpu_flags &= ~XVID_CPU_SSE2; +#endif + +#if defined(ARCH_PPC) +#if defined(ARCH_PPC_ALTIVEC) + cpu_flags |= XVID_CPU_ALTIVEC; +#endif +#endif + + return cpu_flags; +} + + /***************************************************************************** * XviD Init Entry point * @@ -159,15 +188,7 @@ } else { - cpu_flags = check_cpu_features(); - -#if defined(ARCH_X86) && defined(EXPERIMENTAL_SSE2_CODE) - if ((cpu_flags & XVID_CPU_SSE) && sigill_check(sse_os_trigger)) - cpu_flags &= ~XVID_CPU_SSE; - - if ((cpu_flags & XVID_CPU_SSE2) && sigill_check(sse2_os_trigger)) - cpu_flags &= ~XVID_CPU_SSE2; -#endif + cpu_flags = detect_cpu_flags(); } if ((init_param->cpu_flags & XVID_CPU_CHKONLY)) @@ -208,6 +229,7 @@ transfer_8to16copy = transfer_8to16copy_c; transfer_16to8copy = transfer_16to8copy_c; transfer_8to16sub = transfer_8to16sub_c; + transfer_8to16subro = transfer_8to16subro_c; transfer_8to16sub2 = transfer_8to16sub2_c; transfer_16to8add = transfer_16to8add_c; transfer8x8_copy = transfer8x8_copy_c; @@ -234,6 +256,14 @@ interpolate8x8_avg2 = interpolate8x8_avg2_c; interpolate8x8_avg4 = interpolate8x8_avg4_c; + /* reduced resoltuion */ + copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_C; + add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_C; + vfilter_31 = xvid_VFilter_31_C; + hfilter_31 = xvid_HFilter_31_C; + filter_18x18_to_8x8 = xvid_Filter_18x18_To_8x8_C; + filter_diff_18x18_to_8x8 = xvid_Filter_Diff_18x18_To_8x8_C; + /* Initialize internal colorspace transformation tables */ colorspace_init(); @@ -288,7 +318,13 @@ // Halfpel8_Refine = Halfpel8_Refine_c; -#ifdef ARCH_X86 +#if defined(ARCH_X86) + + if ((cpu_flags & XVID_CPU_ASM)) + { + vfilter_31 = xvid_VFilter_31_x86; + hfilter_31 = xvid_HFilter_31_x86; + } if ((cpu_flags & XVID_CPU_MMX) || (cpu_flags & XVID_CPU_MMXEXT) || (cpu_flags & XVID_CPU_3DNOW) || (cpu_flags & XVID_CPU_3DNOWEXT) || @@ -298,7 +334,7 @@ emms = emms_mmx; } - if ((cpu_flags & XVID_CPU_MMX) > 0) { + if ((cpu_flags & XVID_CPU_MMX)) { /* Forward and Inverse Discrete Cosine Transformation functions */ fdct = fdct_mmx; @@ -319,6 +355,7 @@ transfer_8to16copy = transfer_8to16copy_mmx; transfer_16to8copy = transfer_16to8copy_mmx; transfer_8to16sub = transfer_8to16sub_mmx; + transfer_8to16subro = transfer_8to16subro_mmx; transfer_8to16sub2 = transfer_8to16sub2_mmx; transfer_16to8add = transfer_16to8add_mmx; transfer8x8_copy = transfer8x8_copy_mmx; @@ -334,9 +371,16 @@ interpolate8x8_6tap_lowpass_h = interpolate8x8_6tap_lowpass_h_mmx; interpolate8x8_6tap_lowpass_v = interpolate8x8_6tap_lowpass_v_mmx; -// interpolate8x8_avg2 = interpolate8x8_avg2_mmx; + interpolate8x8_avg2 = interpolate8x8_avg2_mmx; interpolate8x8_avg4 = interpolate8x8_avg4_mmx; + /* reduced resolution */ + copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_mmx; + add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_mmx; + hfilter_31 = xvid_HFilter_31_mmx; + filter_18x18_to_8x8 = xvid_Filter_18x18_To_8x8_mmx; + filter_diff_18x18_to_8x8 = xvid_Filter_Diff_18x18_To_8x8_mmx; + /* image input xxx_to_yv12 related functions */ yv12_to_yv12 = yv12_to_yv12_mmx; bgr_to_yv12 = bgr_to_yv12_mmx; @@ -361,11 +405,12 @@ sad8bi = sad8bi_mmx; dev16 = dev16_mmx; sad16v = sad16v_mmx; - } /* these 3dnow functions are faster than mmx, but slower than xmm. */ - if ((cpu_flags & XVID_CPU_3DNOW) > 0) { + if ((cpu_flags & XVID_CPU_3DNOW)) { + + emms = emms_3dn; /* ME functions */ sad16bi = sad16bi_3dn; @@ -376,7 +421,7 @@ } - if ((cpu_flags & XVID_CPU_MMXEXT) > 0) { + if ((cpu_flags & XVID_CPU_MMXEXT)) { /* Inverse DCT */ idct = idct_xmm; @@ -386,7 +431,14 @@ interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_xmm; interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_xmm; + /* reduced resolution */ + copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_xmm; + add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_xmm; + /* Quantization */ + quant4_intra = quant4_intra_xmm; + quant4_inter = quant4_inter_xmm; + dequant_intra = dequant_intra_xmm; dequant_inter = dequant_inter_xmm; @@ -407,7 +459,7 @@ sad16v = sad16v_xmm; } - if ((cpu_flags & XVID_CPU_3DNOW) > 0) { + if ((cpu_flags & XVID_CPU_3DNOW)) { /* Interpolation */ interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_3dn; @@ -415,8 +467,44 @@ interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dn; } - if ((cpu_flags & XVID_CPU_SSE2) > 0) { -#ifdef EXPERIMENTAL_SSE2_CODE + if ((cpu_flags & XVID_CPU_3DNOWEXT)) { + + /* Inverse DCT */ + idct = idct_3dne; + + /* Buffer transfer */ + transfer_8to16copy = transfer_8to16copy_3dne; + transfer_16to8copy = transfer_16to8copy_3dne; + transfer_8to16sub = transfer_8to16sub_3dne; + transfer_8to16subro = transfer_8to16subro_3dne; + transfer_8to16sub2 = transfer_8to16sub2_3dne; + transfer_16to8add = transfer_16to8add_3dne; + transfer8x8_copy = transfer8x8_copy_3dne; + + /* Quantization */ + dequant4_intra = dequant4_intra_3dne; + dequant4_inter = dequant4_inter_3dne; + quant_intra = quant_intra_3dne; + quant_inter = quant_inter_3dne; + dequant_intra = dequant_intra_3dne; + dequant_inter = dequant_inter_3dne; + + /* ME functions */ + calc_cbp = calc_cbp_3dne; + sad16 = sad16_3dne; + sad8 = sad8_3dne; + sad16bi = sad16bi_3dne; + sad8bi = sad8bi_3dne; + dev16 = dev16_3dne; + + /* Interpolation */ + interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_3dne; + interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_3dne; + interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dne; + } + + + if ((cpu_flags & XVID_CPU_SSE2)) { calc_cbp = calc_cbp_sse2; @@ -426,20 +514,19 @@ quant_inter = quant_inter_sse2; dequant_inter = dequant_inter_sse2; - /* ME */ +#if defined(EXPERIMENTAL_SSE2_CODE) + /* ME; slower than xmm */ sad16 = sad16_sse2; dev16 = dev16_sse2; - +#endif /* Forward and Inverse DCT */ idct = idct_sse2; fdct = fdct_sse2; -#endif } - #endif -#ifdef ARCH_IA64 - if ((cpu_flags & XVID_CPU_IA64) > 0) { //use assembler routines? +#if defined(ARCH_IA64) + if ((cpu_flags & XVID_CPU_ASM)) { //use assembler routines? idct_ia64_init(); fdct = fdct_ia64; idct = idct_ia64; //not yet working, crashes @@ -465,18 +552,22 @@ } #endif -#ifdef ARCH_PPC -#ifdef ARCH_PPC_ALTIVEC - calc_cbp = calc_cbp_altivec; - fdct = fdct_altivec; - idct = idct_altivec; - sadInit = sadInit_altivec; - sad16 = sad16_altivec; - sad8 = sad8_altivec; - dev16 = dev16_altivec; -#else - calc_cbp = calc_cbp_ppc; -#endif +#if defined(ARCH_PPC) + if ((cpu_flags & XVID_CPU_ASM)) + { + calc_cbp = calc_cbp_ppc; + } + + if ((cpu_flags & XVID_CPU_ALTIVEC)) + { + calc_cbp = calc_cbp_altivec; + fdct = fdct_altivec; + idct = idct_altivec; + sadInit = sadInit_altivec; + sad16 = sad16_altivec; + sad8 = sad8_altivec; + dev16 = dev16_altivec; + } #endif return XVID_ERR_OK; @@ -487,7 +578,7 @@ static int xvid_init_convert(XVID_INIT_CONVERTINFO* convert) { - const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); + // const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); const int width = convert->width; const int height = convert->height; const int width2 = convert->width/2; @@ -515,6 +606,330 @@ } + +void fill8(uint8_t * block, int size, int value) +{ + int i; + for (i = 0; i < size; i++) + block[i] = value; +} + +void fill16(int16_t * block, int size, int value) +{ + int i; + for (i = 0; i < size; i++) + block[i] = value; +} + +#define RANDOM(min,max) min + (rand() % (max-min)) + +void random8(uint8_t * block, int size, int min, int max) +{ + int i; + for (i = 0; i < size; i++) + block[i] = RANDOM(min,max); +} + +void random16(int16_t * block, int size, int min, int max) +{ + int i; + for (i = 0; i < size; i++) + block[i] = RANDOM(min,max); +} + +int compare16(const int16_t * blockA, const int16_t * blockB, int size) +{ + int i; + for (i = 0; i < size; i++) + if (blockA[i] != blockB[i]) + return 1; + + return 0; +} + +int diff16(const int16_t * blockA, const int16_t * blockB, int size) +{ + int i, diff = 0; + for (i = 0; i < size; i++) + diff += ABS(blockA[i]-blockB[i]); + return diff; +} + + +#define XVID_TEST_RANDOM 0x00000001 /* random input data */ +#define XVID_TEST_VERBOSE 0x00000002 /* verbose error output */ + + +#define TEST_FORWARD 0x00000001 /* intra */ +#define TEST_FDCT (TEST_FORWARD) +#define TEST_IDCT (0) + +int test_transform(void * funcA, void * funcB, const char * nameB, + int test, int flags) +{ + int i; + int64_t timeSTART; + int64_t timeA = 0; + int64_t timeB = 0; + DECLARE_ALIGNED_MATRIX(arrayA, 1, 64, int16_t, CACHE_LINE); + DECLARE_ALIGNED_MATRIX(arrayB, 1, 64, int16_t, CACHE_LINE); + int min, max; + int count = 0; + + int tmp; + int min_error = 0x10000*64; + int max_error = 0; + + + if ((test & TEST_FORWARD)) /* forward */ + { + min = -256; + max = 255; + }else{ /* inverse */ + min = -2048; + max = 2047; + } + + for (i = 0; i < 64*64; i++) + { + if ((flags & XVID_TEST_RANDOM)) + { + random16(arrayA, 64, min, max); + }else{ + fill16(arrayA, 64, i); + } + memcpy(arrayB, arrayA, 64*sizeof(int16_t)); + + if ((test & TEST_FORWARD)) + { + timeSTART = read_counter(); + ((fdctFunc*)funcA)(arrayA); + timeA += read_counter() - timeSTART; + + timeSTART = read_counter(); + ((fdctFunc*)funcB)(arrayB); + timeB += read_counter() - timeSTART; + } + else + { + timeSTART = read_counter(); + ((idctFunc*)funcA)(arrayA); + timeA += read_counter() - timeSTART; + + timeSTART = read_counter(); + ((idctFunc*)funcB)(arrayB); + timeB += read_counter() - timeSTART; + } + + tmp = diff16(arrayA, arrayB, 64) / 64; + if (tmp > max_error) + max_error = tmp; + if (tmp < min_error) + min_error = tmp; + + count++; + } + + /* print the "average difference" of best/worst transforms */ + printf("%s:\t%i\t(min_error:%i, max_error:%i)\n", nameB, (int)(timeB / count), min_error, max_error); + + return 0; +} + + +#define TEST_QUANT 0x00000001 /* forward quantization */ +#define TEST_INTRA 0x00000002 /* intra */ +#define TEST_QUANT_INTRA (TEST_QUANT|TEST_INTRA) +#define TEST_QUANT_INTER (TEST_QUANT) +#define TEST_DEQUANT_INTRA (TEST_INTRA) +#define TEST_DEQUANT_INTER (0) + +int test_quant(void * funcA, void * funcB, const char * nameB, + int test, int flags) +{ + int q,i; + int64_t timeSTART; + int64_t timeA = 0; + int64_t timeB = 0; + int retA, retB; + DECLARE_ALIGNED_MATRIX(arrayX, 1, 64, int16_t, CACHE_LINE); + DECLARE_ALIGNED_MATRIX(arrayA, 1, 64, int16_t, CACHE_LINE); + DECLARE_ALIGNED_MATRIX(arrayB, 1, 64, int16_t, CACHE_LINE); + int min, max; + int count = 0; + int errors = 0; + + if ((test & TEST_QUANT)) /* quant */ + { + min = -2048; + max = 2047; + }else{ /* dequant */ + min = -256; + max = 255; + } + + for (q = 1; q <= 31; q++) /* quantizer */ + { + for (i = min; i < max; i++) /* input coeff */ + { + if ((flags & XVID_TEST_RANDOM)) + { + random16(arrayX, 64, min, max); + }else{ + fill16(arrayX, 64, i); + } + + if ((test & TEST_INTRA)) /* intra */ + { + timeSTART = read_counter(); + ((quanth263_intraFunc*)funcA)(arrayA, arrayX, q, q); + timeA += read_counter() - timeSTART; + + timeSTART = read_counter(); + ((quanth263_intraFunc*)funcB)(arrayB, arrayX, q, q); + timeB += read_counter() - timeSTART; + } + else /* inter */ + { + timeSTART = read_counter(); + retA = ((quanth263_interFunc*)funcA)(arrayA, arrayX, q); + timeA += read_counter() - timeSTART; + + timeSTART = read_counter(); + retB = ((quanth263_interFunc*)funcB)(arrayB, arrayX, q); + timeB += read_counter() - timeSTART; + } + + /* compare return value from quant_inter, and compare (de)quantiz'd arrays */ + if ( ((test&TEST_QUANT) && !(test&TEST_INTRA) && retA != retB ) || + compare16(arrayA, arrayB, 64)) + { + errors++; + if ((flags & XVID_TEST_VERBOSE)) + printf("%s error: q=%i, i=%i\n", nameB, q, i); + } + + count++; + } + } + + printf("%s:\t%i", nameB, (int)(timeB / count)); + if (errors>0) + printf("\t(%i errors out of %i)", errors, count); + printf("\n"); + + return 0; +} + + + +int xvid_init_test(int flags) +{ + int cpu_flags; + + srand(time(0)); + + printf("xvid_init_test\n"); + +#if defined(ARCH_X86) + cpu_flags = detect_cpu_flags(); + idct_int32_init(); + emms_mmx(); + + printf("--- fdct ---\n"); + test_transform(fdct_int32, fdct_int32, "c", TEST_FDCT, flags); + if (cpu_flags & XVID_CPU_MMX) + test_transform(fdct_int32, fdct_mmx, "mmx", TEST_FDCT, flags); + if (cpu_flags & XVID_CPU_SSE2) + test_transform(fdct_int32, fdct_sse2, "sse2", TEST_FDCT, flags); + + printf("\n--- idct ---\n"); + test_transform(idct_int32, idct_int32, "c", TEST_IDCT, flags); + if (cpu_flags & XVID_CPU_MMX) + test_transform(idct_int32, idct_mmx, "mmx", TEST_IDCT, flags); + if (cpu_flags & XVID_CPU_MMXEXT) + test_transform(idct_int32, idct_xmm, "xmm", TEST_IDCT, flags); + if (cpu_flags & XVID_CPU_3DNOWEXT) + test_transform(idct_int32, idct_3dne, "3dne", TEST_IDCT, flags); + if (cpu_flags & XVID_CPU_SSE2) + test_transform(idct_int32, idct_sse2, "sse2", TEST_IDCT, flags); + + printf("\n--- quant intra ---\n"); + test_quant(quant_intra_c, quant_intra_c, "c", TEST_QUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_MMX) + test_quant(quant_intra_c, quant_intra_mmx, "mmx", TEST_QUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_3DNOWEXT) + test_quant(quant_intra_c, quant_intra_3dne, "3dne", TEST_QUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_SSE2) + test_quant(quant_intra_c, quant_intra_sse2, "sse2", TEST_QUANT_INTRA, flags); + + printf("\n--- quant inter ---\n"); + test_quant(quant_inter_c, quant_inter_c, "c", TEST_QUANT_INTER, flags); + if (cpu_flags & XVID_CPU_MMX) + test_quant(quant_inter_c, quant_inter_mmx, "mmx", TEST_QUANT_INTER, flags); + if (cpu_flags & XVID_CPU_3DNOWEXT) + test_quant(quant_inter_c, quant_inter_3dne, "3dne", TEST_QUANT_INTER, flags); + if (cpu_flags & XVID_CPU_SSE2) + test_quant(quant_inter_c, quant_inter_sse2, "sse2", TEST_QUANT_INTER, flags); + + printf("\n--- dequant intra ---\n"); + test_quant(dequant_intra_c, dequant_intra_c, "c", TEST_DEQUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_MMX) + test_quant(dequant_intra_c, dequant_intra_mmx, "mmx", TEST_DEQUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_MMXEXT) + test_quant(dequant_intra_c, dequant_intra_xmm, "xmm", TEST_DEQUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_3DNOWEXT) + test_quant(dequant_intra_c, dequant_intra_3dne, "3dne", TEST_DEQUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_SSE2) + test_quant(dequant_intra_c, dequant_intra_sse2, "sse2", TEST_DEQUANT_INTRA, flags); + + printf("\n--- dequant inter ---\n"); + test_quant(dequant_inter_c, dequant_inter_c, "c", TEST_DEQUANT_INTER, flags); + if (cpu_flags & XVID_CPU_MMX) + test_quant(dequant_inter_c, dequant_inter_mmx, "mmx", TEST_DEQUANT_INTER, flags); + if (cpu_flags & XVID_CPU_MMXEXT) + test_quant(dequant_inter_c, dequant_inter_xmm, "xmm", TEST_DEQUANT_INTER, flags); + if (cpu_flags & XVID_CPU_3DNOWEXT) + test_quant(dequant_inter_c, dequant_inter_3dne, "3dne", TEST_DEQUANT_INTER, flags); + if (cpu_flags & XVID_CPU_SSE2) + test_quant(dequant_inter_c, dequant_inter_sse2, "sse2", TEST_DEQUANT_INTER, flags); + + printf("\n--- quant4_intra ---\n"); + test_quant(quant4_intra_c, quant4_intra_c, "c", TEST_QUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_MMX) + test_quant(quant4_intra_c, quant4_intra_mmx, "mmx", TEST_QUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_MMXEXT) + test_quant(quant4_intra_c, quant4_intra_xmm, "xmm", TEST_QUANT_INTRA, flags); + + printf("\n--- quant4_inter ---\n"); + test_quant(quant4_inter_c, quant4_inter_c, "c", TEST_QUANT_INTER, flags); + if (cpu_flags & XVID_CPU_MMX) + test_quant(quant4_inter_c, quant4_inter_mmx, "mmx", TEST_QUANT_INTER, flags); + if (cpu_flags & XVID_CPU_MMXEXT) + test_quant(quant4_inter_c, quant4_inter_xmm, "xmm", TEST_QUANT_INTER, flags); + + printf("\n--- dequant4_intra ---\n"); + test_quant(dequant4_intra_c, dequant4_intra_c, "c", TEST_DEQUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_MMX) + test_quant(dequant4_intra_c, dequant4_intra_mmx, "mmx", TEST_DEQUANT_INTRA, flags); + if (cpu_flags & XVID_CPU_3DNOWEXT) + test_quant(dequant4_intra_c, dequant4_intra_3dne, "3dne", TEST_DEQUANT_INTRA, flags); + + printf("\n--- dequant4_inter ---\n"); + test_quant(dequant4_inter_c, dequant4_inter_c, "c", TEST_DEQUANT_INTER, flags); + if (cpu_flags & XVID_CPU_MMX) + test_quant(dequant4_inter_c, dequant4_inter_mmx, "mmx", TEST_DEQUANT_INTER, flags); + if (cpu_flags & XVID_CPU_3DNOWEXT) + test_quant(dequant4_inter_c, dequant4_inter_3dne, "3dne", TEST_DEQUANT_INTER, flags); + + emms_mmx(); + +#endif + + return XVID_ERR_OK; +} + + int xvid_init(void *handle, int opt, @@ -529,6 +944,9 @@ case XVID_INIT_CONVERT : return xvid_init_convert((XVID_INIT_CONVERTINFO*)param1); + case XVID_INIT_TEST : + return xvid_init_test((int)param1); + default : return XVID_ERR_FAIL; }