--- xvid.c 2003/02/12 11:46:18 1.33.2.23 +++ xvid.c 2003/02/19 21:13:00 1.43 @@ -3,15 +3,6 @@ * XVID MPEG-4 VIDEO CODEC * - Native API implementation - * - * This program is an implementation of a part of one or more MPEG-4 - * Video tools as specified in ISO/IEC 14496-2 standard. Those intending - * to use this software module in hardware or software products are - * advised that its use may infringe existing patents or copyrights, and - * any such use would be at such party's own risk. The original - * developer of this software module and his/her company, and subsequent - * editors and their companies, will have no liability for use of this - * software or modifications or derivatives thereof. - * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation ; either version 2 of the License, or @@ -26,18 +17,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - ****************************************************************************/ - -/***************************************************************************** - * - * History - * - * - 23.06.2002 added XVID_CPU_CHKONLY - * - 17.03.2002 Added interpolate8x8_halfpel_hv_xmm - * - 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.23 2003/02/12 11:46:18 syskin Exp $ + * $Id: xvid.c,v 1.43 2003/02/19 21:13:00 edgomez Exp $ * ****************************************************************************/ @@ -65,7 +45,7 @@ #include "utils/timer.h" #include "bitstream/mbcoding.h" -#if defined(ARCH_X86) +#if defined(ARCH_IS_IA32) #if defined(_MSC_VER) # include @@ -84,12 +64,14 @@ /* -calls the funcptr, and returns whether SIGILL (illegal instruction) was signalled -return values: --1 : could not determine -0 : SIGILL was *not* signalled -1 : SIGILL was signalled -*/ + * Calls the funcptr, and returns whether SIGILL (illegal instruction) was + * signalled + * + * Return values: + * -1 : could not determine + * 0 : SIGILL was *not* signalled + * 1 : SIGILL was signalled + */ int sigill_check(void (*func)()) @@ -136,7 +118,7 @@ /* enable native assembly optimizations by default */ unsigned int cpu_flags = XVID_CPU_ASM; -#if defined(ARCH_X86) +#if defined(ARCH_IS_IA32) cpu_flags |= check_cpu_features(); if ((cpu_flags & XVID_CPU_SSE) && sigill_check(sse_os_trigger)) cpu_flags &= ~XVID_CPU_SSE; @@ -145,8 +127,8 @@ cpu_flags &= ~XVID_CPU_SSE2; #endif -#if defined(ARCH_PPC) -#if defined(ARCH_PPC_ALTIVEC) +#if defined(ARCH_IS_PPC) +#if defined(ARCH_IS_PPC_ALTIVEC) cpu_flags |= XVID_CPU_ALTIVEC; #endif #endif @@ -316,9 +298,9 @@ dev16 = dev16_c; sad16v = sad16v_c; -// Halfpel8_Refine = Halfpel8_Refine_c; +/* Halfpel8_Refine = Halfpel8_Refine_c; */ -#if defined(ARCH_X86) +#if defined(ARCH_IS_IA32) if ((cpu_flags & XVID_CPU_ASM)) { @@ -525,11 +507,11 @@ } #endif -#if defined(ARCH_IA64) - if ((cpu_flags & XVID_CPU_ASM)) { //use assembler routines? +#if defined(ARCH_IS_IA64) + if ((cpu_flags & XVID_CPU_ASM)) { /* use assembler routines? */ idct_ia64_init(); fdct = fdct_ia64; - idct = idct_ia64; //not yet working, crashes + idct = idct_ia64; /*not yet working, crashes */ interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_ia64; interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_ia64; interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_ia64; @@ -537,7 +519,7 @@ sad16bi = sad16bi_ia64; sad8 = sad8_ia64; dev16 = dev16_ia64; -// Halfpel8_Refine = Halfpel8_Refine_ia64; +/* Halfpel8_Refine = Halfpel8_Refine_ia64; */ quant_intra = quant_intra_ia64; dequant_intra = dequant_intra_ia64; quant_inter = quant_inter_ia64; @@ -548,11 +530,11 @@ transfer_8to16sub2 = transfer_8to16sub2_ia64; transfer_16to8add = transfer_16to8add_ia64; transfer8x8_copy = transfer8x8_copy_ia64; - DEBUG("Using IA-64 assembler routines.\n"); + DPRINTF(DPRINTF_DEBUG, "Using IA-64 assembler routines."); } #endif -#if defined(ARCH_PPC) +#if defined(ARCH_IS_PPC) if ((cpu_flags & XVID_CPU_ASM)) { calc_cbp = calc_cbp_ppc; @@ -578,7 +560,11 @@ 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; @@ -664,7 +650,7 @@ #define TEST_FDCT (TEST_FORWARD) #define TEST_IDCT (0) -int test_transform(void * funcA, void * funcB, const char * nameB, +static int test_transform(void * funcA, void * funcB, const char * nameB, int test, int flags) { int i; @@ -744,14 +730,14 @@ #define TEST_DEQUANT_INTRA (TEST_INTRA) #define TEST_DEQUANT_INTER (0) -int test_quant(void * funcA, void * funcB, const char * nameB, +static 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; + int retA = 0, retB = 0; 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); @@ -831,7 +817,7 @@ printf("xvid_init_test\n"); -#if defined(ARCH_X86) +#if defined(ARCH_IS_IA32) cpu_flags = detect_cpu_flags(); idct_int32_init(); emms_mmx();