--- xvid.c 2002/06/21 16:12:47 1.20 +++ xvid.c 2002/07/09 01:37:21 1.27 @@ -27,15 +27,17 @@ * 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.20 2002/06/21 16:12:47 suxen_drol Exp $ + * $Id: xvid.c,v 1.27 2002/07/09 01:37:21 chenm001 Exp $ * ****************************************************************************/ @@ -80,16 +82,24 @@ init_param = (XVID_INIT_PARAM *) param1; + /* Inform the client the API version */ + init_param->api_version = API_VERSION; + + /* Inform the client the core build - unused because we're still alpha */ + init_param->core_build = 1000; + + if ((init_param->cpu_flags & XVID_CPU_CHKONLY)) + { + init_param->cpu_flags = check_cpu_features(); + return XVID_ERR_OK; + } + /* Do we have to force CPU features ? */ if ((init_param->cpu_flags & XVID_CPU_FORCE) > 0) { cpu_flags = init_param->cpu_flags; } else { -#ifdef ARCH_X86 cpu_flags = check_cpu_features(); -#else - cpu_flags = 0; -#endif init_param->cpu_flags = cpu_flags; } @@ -184,9 +194,11 @@ transfer_8to16copy = transfer_8to16copy_mmx; transfer_16to8copy = transfer_16to8copy_mmx; transfer_8to16sub = transfer_8to16sub_mmx; + transfer_8to16sub2 = transfer_8to16sub2_mmx; transfer_16to8add = transfer_16to8add_mmx; transfer8x8_copy = transfer8x8_copy_mmx; + /* Image Interpolation related functions */ interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_mmx; interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_mmx; @@ -223,6 +235,10 @@ interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_xmm; interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_xmm; + /* Quantization */ + dequant_intra = dequant_intra_xmm; + dequant_inter = dequant_inter_xmm; + /* Buffer transfer */ transfer_8to16sub2 = transfer_8to16sub2_xmm; @@ -231,6 +247,7 @@ /* ME functions */ sad16 = sad16_xmm; + sad16bi = sad16bi_xmm; sad8 = sad8_xmm; dev16 = dev16_xmm; @@ -247,6 +264,8 @@ if ((cpu_flags & XVID_CPU_SSE2) > 0) { #ifdef EXPERIMENTAL_SSE2_CODE + calc_cbp = calc_cbp_sse2; + /* Quantization */ quant_intra = quant_intra_sse2; dequant_intra = dequant_intra_sse2; @@ -254,7 +273,6 @@ dequant_inter = dequant_inter_sse2; /* ME */ - calc_cbp = calc_cbp_sse2; sad16 = sad16_sse2; dev16 = dev16_sse2; @@ -306,12 +324,6 @@ #endif #endif - /* Inform the client the API version */ - init_param->api_version = API_VERSION; - - /* Inform the client the core build - unused because we're still alpha */ - init_param->core_build = 1000; - return XVID_ERR_OK; }