--- xvid.c 2002/07/21 23:34:08 1.32 +++ xvid.c 2002/09/04 22:08:45 1.36 @@ -3,6 +3,8 @@ * XVID MPEG-4 VIDEO CODEC * - Native API implementation - * + * Copyright(C) 2001-2002 Peter Ross + * * This program is an implementation of a part of one or more MPEG-4 * Video tools as specified in ISO/IEC 14496-2 standard. Those intending * to use this software module in hardware or software products are @@ -26,18 +28,7 @@ * along with this program ; if not, write to the Free Software * 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.32 2002/07/21 23:34:08 chl Exp $ + * $Id: xvid.c,v 1.36 2002/09/04 22:08:45 edgomez Exp $ * ****************************************************************************/ @@ -81,12 +72,12 @@ /* -calls the funcptr, and returns whether SIGILL (illegal instruction) was signalled -return values: --1 : could not determine -0 : SIGILL was *not* signalled -1 : SIGILL was signalled -*/ + * Calls the funcptr, and returns whether SIGILL (illegal instruction) was signalled + * Return values: + * -1 : could not determine + * 0 : SIGILL was *not* signalled + * 1 : SIGILL was signalled + */ int sigill_check(void (*func)()) @@ -245,10 +236,11 @@ /* Functions used in motion estimation algorithms */ calc_cbp = calc_cbp_c; sad16 = sad16_c; - sad16bi = sad16bi_c; sad8 = sad8_c; - dev16 = dev16_c; + sad16bi = sad16bi_c; sad8bi = sad8bi_c; + dev16 = dev16_c; + Halfpel8_Refine = Halfpel8_Refine_c; #ifdef ARCH_X86 @@ -303,10 +295,21 @@ calc_cbp = calc_cbp_mmx; sad16 = sad16_mmx; sad8 = sad8_mmx; + sad16bi = sad16bi_mmx; + sad8bi = sad8bi_mmx; dev16 = dev16_mmx; } + /* these 3dnow functions are faster than mmx, but slower than xmm. */ + if ((cpu_flags & XVID_CPU_3DNOW) > 0) { + + /* ME functions */ + sad16bi = sad16bi_3dn; + sad8bi = sad8bi_3dn; + } + + if ((cpu_flags & XVID_CPU_MMXEXT) > 0) { /* Inverse DCT */ @@ -329,8 +332,9 @@ /* ME functions */ sad16 = sad16_xmm; - sad16bi = sad16bi_xmm; sad8 = sad8_xmm; + sad16bi = sad16bi_xmm; + sad8bi = sad8bi_xmm; dev16 = dev16_xmm; } @@ -460,12 +464,6 @@ { 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);