--- branches/dev-api-4/xvidcore/src/xvid.c 2003/06/09 19:42:25 1058 +++ branches/dev-api-4/xvidcore/src/xvid.c 2003/08/23 15:11:23 1127 @@ -19,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.7 2003-06-09 19:42:08 edgomez Exp $ + * $Id: xvid.c,v 1.45.2.14 2003-08-23 15:11:23 edgomez Exp $ * ****************************************************************************/ @@ -46,6 +46,7 @@ #include "utils/emms.h" #include "utils/timer.h" #include "bitstream/mbcoding.h" +#include "image/qpel.h" #if defined(_DEBUG) unsigned int xvid_debug = 0; /* xvid debug mask */ @@ -163,7 +164,7 @@ { unsigned int cpu_flags; - if (XVID_MAJOR(init->version) != 1) /* v1.x.x */ + if (XVID_VERSION_MAJOR(init->version) != 1) /* v1.x.x */ return XVID_ERR_VERSION; cpu_flags = (init->cpu_flags & XVID_CPU_FORCE) ? init->cpu_flags : detect_cpu_flags(); @@ -182,6 +183,11 @@ /* Restore FPU context : emms_c is a nop functions */ emms = emms_c; + /* Qpel stuff */ + xvid_QP_Funcs = &xvid_QP_Funcs_C; + xvid_QP_Add_Funcs = &xvid_QP_Add_Funcs_C; + xvid_Init_QP(); + /* Quantization functions */ quant_intra = quant_intra_c; dequant_intra = dequant_intra_c; @@ -305,7 +311,11 @@ /* Forward and Inverse Discrete Cosine Transformation functions */ fdct = fdct_mmx; - idct = simple_idct_mmx; + idct = idct_mmx; + + /* Qpel stuff */ + xvid_QP_Funcs = &xvid_QP_Funcs_mmx; + xvid_QP_Add_Funcs = &xvid_QP_Add_Funcs_mmx; /* Quantization related functions */ quant_intra = quant_intra_mmx; @@ -391,9 +401,7 @@ if ((cpu_flags & XVID_CPU_MMXEXT)) { /* Inverse DCT */ -#if 0 /* We don't use Walken idct anymore! */ idct = idct_xmm; -#endif /* Interpolation */ interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_xmm; @@ -439,9 +447,7 @@ if ((cpu_flags & XVID_CPU_3DNOWEXT)) { /* Inverse DCT */ -#if 0 /* We don't use Walken idct anymore! */ idct = idct_3dne; -#endif /* Buffer transfer */ transfer_8to16copy = transfer_8to16copy_3dne; @@ -474,7 +480,8 @@ interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dne; } - +#if defined(EXPERIMENTAL_SSE2_CODE) /* mark the whole SSE2 stuff as experimental. At least on + my P4, it crashes... */ if ((cpu_flags & XVID_CPU_SSE2)) { calc_cbp = calc_cbp_sse2; @@ -485,11 +492,9 @@ quant_inter = quant_inter_sse2; dequant_inter = dequant_inter_sse2; -#if defined(EXPERIMENTAL_SSE2_CODE) /* ME; slower than xmm */ sad16 = sad16_sse2; dev16 = dev16_sse2; -#endif /* Forward and Inverse DCT */ #if 0 /* Both function are known to be unprecise, better keep them deactivated */ idct = idct_sse2; @@ -497,6 +502,7 @@ #endif } #endif +#endif #if defined(ARCH_IS_IA64) if ((cpu_flags & XVID_CPU_ASM)) { /* use assembler routines? */ @@ -521,7 +527,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 @@ -554,7 +559,7 @@ static int xvid_gbl_info(xvid_gbl_info_t * info) { - if (XVID_MAJOR(info->version) != 1) /* v1.x.x */ + if (XVID_VERSION_MAJOR(info->version) != 1) /* v1.x.x */ return XVID_ERR_VERSION; info->actual_version = XVID_VERSION; @@ -580,7 +585,7 @@ int height2; IMAGE img; - if (XVID_MAJOR(convert->version) != 1) /* v1.x.x */ + if (XVID_VERSION_MAJOR(convert->version) != 1) /* v1.x.x */ return XVID_ERR_VERSION; #if 0