--- xvid.c 2003/07/14 12:40:16 1.45.2.10 +++ xvid.c 2003/08/22 15:52:35 1.45.2.13 @@ -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.10 2003/07/14 12:40:16 syskin Exp $ + * $Id: xvid.c,v 1.45.2.13 2003/08/22 15:52:35 Isibaar 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_mmx(); + /* Quantization functions */ quant_intra = quant_intra_c; dequant_intra = dequant_intra_c; @@ -307,6 +313,10 @@ fdct = fdct_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; dequant_intra = dequant_intra_mmx; @@ -403,7 +413,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; @@ -451,7 +461,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; @@ -470,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; @@ -481,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; @@ -493,6 +502,7 @@ #endif } #endif +#endif #if defined(ARCH_IS_IA64) if ((cpu_flags & XVID_CPU_ASM)) { /* use assembler routines? */ @@ -549,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; @@ -575,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