--- xvid.c 2002/06/14 13:27:52 1.18 +++ xvid.c 2002/07/09 01:09:33 1.26 @@ -31,11 +31,12 @@ * * 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.18 2002/06/14 13:27:52 Isibaar Exp $ + * $Id: xvid.c,v 1.26 2002/07/09 01:09:33 chenm001 Exp $ * ****************************************************************************/ @@ -80,16 +81,26 @@ 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; + + printf("init_param->cpu_flags %x\n",init_param->cpu_flags);//NIC + + if ((init_param->cpu_flags & XVID_CPU_CHKONLY)) + { + //init_param->cpu_flags = check_cpu_features();//nic + 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 + //cpu_flags = check_cpu_features();//nic init_param->cpu_flags = cpu_flags; } @@ -184,9 +195,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 +236,9 @@ interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_xmm; interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_xmm; + /* Buffer transfer */ + transfer_8to16sub2 = transfer_8to16sub2_xmm; + /* Colorspace transformation */ yuv_to_yv12 = yuv_to_yv12_xmm; @@ -303,12 +319,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; } @@ -333,7 +343,14 @@ return decoder_decode((DECODER *) handle, (XVID_DEC_FRAME *) param1); case XVID_DEC_CREATE: - return decoder_create((XVID_DEC_PARAM *) param1); + /* *************************************************************************** + NIC uso il secondo parametro 'param2' ma in realta` non so bene per cosa e` + stato pensato ..... e quindi in futuro potrebbe essere un problema + *************************************************************************** */ + if(param2!=NULL) + return IM1_decoder_create((XVID_DEC_PARAM *) param1,(XVID_DEC_FRAME *) param2); + else + return decoder_create((XVID_DEC_PARAM *) param1); //NIC commentata case XVID_DEC_DESTROY: return decoder_destroy((DECODER *) handle); @@ -362,6 +379,12 @@ { switch (opt) { case XVID_ENC_ENCODE: +#ifdef BFRAMES + if (((Encoder *) handle)->mbParam.max_bframes >= 0) + return encoder_encode_bframes((Encoder *) handle, (XVID_ENC_FRAME *) param1, + (XVID_ENC_STATS *) param2); + else +#endif return encoder_encode((Encoder *) handle, (XVID_ENC_FRAME *) param1, (XVID_ENC_STATS *) param2);