--- xvid.c 2003/03/26 11:01:03 1.45.2.2 +++ xvid.c 2003/07/14 12:40:16 1.45.2.10 @@ -3,6 +3,8 @@ * XVID MPEG-4 VIDEO CODEC * - Native API implementation - * + * Copyright(C) 2001-2003 Peter Ross + * * 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 @@ -17,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid.c,v 1.45.2.2 2003/03/26 11:01:03 suxen_drol Exp $ + * $Id: xvid.c,v 1.45.2.10 2003/07/14 12:40:16 syskin Exp $ * ****************************************************************************/ @@ -45,6 +47,10 @@ #include "utils/timer.h" #include "bitstream/mbcoding.h" +#if defined(_DEBUG) +unsigned int xvid_debug = 0; /* xvid debug mask */ +#endif + #if defined(ARCH_IS_IA32) #if defined(_MSC_VER) @@ -282,8 +288,7 @@ #if defined(ARCH_IS_IA32) - if ((cpu_flags & XVID_CPU_ASM)) - { + if ((cpu_flags & XVID_CPU_ASM)) { vfilter_31 = xvid_VFilter_31_x86; hfilter_31 = xvid_HFilter_31_x86; } @@ -398,7 +403,7 @@ add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_xmm; /* Quantization */ - quant4_intra = quant4_intra_xmm; +// quant4_intra = quant4_intra_xmm; quant4_inter = quant4_inter_xmm; dequant_intra = dequant_intra_xmm; @@ -446,7 +451,7 @@ /* Quantization */ dequant4_intra = dequant4_intra_3dne; dequant4_inter = dequant4_inter_3dne; - quant_intra = quant_intra_3dne; +// quant_intra = quant_intra_3dne; quant_inter = quant_inter_3dne; dequant_intra = dequant_intra_3dne; dequant_inter = dequant_inter_3dne; @@ -482,8 +487,10 @@ dev16 = dev16_sse2; #endif /* Forward and Inverse DCT */ +#if 0 /* Both function are known to be unprecise, better keep them deactivated */ idct = idct_sse2; fdct = fdct_sse2; +#endif } #endif @@ -510,7 +517,6 @@ transfer_8to16sub2 = transfer_8to16sub2_ia64; transfer_16to8add = transfer_16to8add_ia64; transfer8x8_copy = transfer8x8_copy_ia64; - DPRINTF(DPRINTF_DEBUG, "Using IA-64 assembler routines."); } #endif @@ -532,7 +538,11 @@ } #endif - return 0; +#if defined(_DEBUG) + xvid_debug = init->debug; +#endif + + return 0; } @@ -568,7 +578,9 @@ if (XVID_MAJOR(convert->version) != 1) /* v1.x.x */ return XVID_ERR_VERSION; - // const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); +#if 0 + const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); +#endif width = convert->width; height = convert->height; width2 = convert->width/2; @@ -640,7 +652,7 @@ { int i, diff = 0; for (i = 0; i < size; i++) - diff += ABS(blockA[i]-blockB[i]); + diff += abs(blockA[i]-blockB[i]); return diff; }