--- xvid.c 2002/06/13 21:35:01 1.17 +++ xvid.c 2002/06/23 03:58:32 1.21 @@ -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.17 2002/06/13 21:35:01 edgomez Exp $ + * $Id: xvid.c,v 1.21 2002/06/23 03:58:32 suxen_drol Exp $ * ****************************************************************************/ @@ -80,6 +81,18 @@ 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; @@ -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; @@ -263,6 +279,32 @@ #endif +#ifdef ARCH_IA64 + if ((cpu_flags & XVID_CPU_IA64) > 0) { //use assembler routines? + idct_ia64_init(); + fdct = fdct_ia64; + idct = idct_ia64; //not yet working, crashes + interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_ia64; + interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_ia64; + interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_ia64; + sad16 = sad16_ia64; + sad16bi = sad16bi_ia64; + sad8 = sad8_ia64; + dev16 = dev16_ia64; + quant_intra = quant_intra_ia64; + dequant_intra = dequant_intra_ia64; + quant_inter = quant_inter_ia64; + dequant_inter = dequant_inter_ia64; + transfer_8to16copy = transfer_8to16copy_ia64; + transfer_16to8copy = transfer_16to8copy_ia64; + transfer_8to16sub = transfer_8to16sub_ia64; + transfer_8to16sub2 = transfer_8to16sub2_ia64; + transfer_16to8add = transfer_16to8add_ia64; + transfer8x8_copy = transfer8x8_copy_ia64; + DEBUG("Using IA-64 assembler routines.\n"); + } +#endif + #ifdef ARCH_PPC #ifdef ARCH_PPC_ALTIVEC calc_cbp = calc_cbp_altivec; @@ -277,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; } @@ -336,6 +372,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);