--- xvid.c 2002/10/11 23:18:37 1.33.2.9 +++ xvid.c 2002/11/16 23:38:16 1.39 @@ -3,41 +3,54 @@ * XVID MPEG-4 VIDEO CODEC * - Native API implementation - * - * 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 - * advised that its use may infringe existing patents or copyrights, and - * any such use would be at such party's own risk. The original - * developer of this software module and his/her company, and subsequent - * editors and their companies, will have no liability for use of this - * software or modifications or derivatives thereof. - * - * This program is free software ; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation ; either version 2 of the License, or + * Copyright(C) 2001-2002 Peter Ross + * + * This file is part of XviD, a free MPEG-4 video encoder/decoder + * + * XviD is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY ; without even the implied warranty of + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program ; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - ****************************************************************************/ - -/***************************************************************************** - * - * History + * Under section 8 of the GNU General Public License, the copyright + * holders of XVID explicitly forbid distribution in the following + * countries: + * + * - Japan + * - United States of America + * + * Linking XviD statically or dynamically with other modules is making a + * combined work based on XviD. Thus, the terms and conditions of the + * GNU General Public License cover the whole combination. + * + * As a special exception, the copyright holders of XviD give you + * permission to link XviD with independent modules that communicate with + * XviD solely through the VFW1.1 and DShow interfaces, regardless of the + * license terms of these independent modules, and to copy and distribute + * the resulting combined work under terms of your choice, provided that + * every copy of the combined work is accompanied by a complete copy of + * the source code of XviD (the version of XviD used to produce the + * combined work), being distributed under the terms of the GNU General + * Public License plus this exception. An independent module is a module + * which is not derived from or based on XviD. + * + * Note that people who make modified versions of XviD are not obligated + * to grant this special exception for their modified versions; it is + * their choice whether to do so. The GNU General Public License gives + * permission to release a modified version without this exception; this + * exception also makes it possible to release a modified version which + * carries forward this exception. * - * - 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.33.2.9 2002/10/11 23:18:37 Isibaar Exp $ + * $Id: xvid.c,v 1.39 2002/11/16 23:38:16 edgomez Exp $ * ****************************************************************************/ @@ -50,7 +63,6 @@ #include "image/colorspace.h" #include "image/interpolate8x8.h" #include "utils/mem_transfer.h" -#include "utils/mbfunctions.h" #include "quant/quant_h263.h" #include "quant/quant_mpeg4.h" #include "motion/motion.h" @@ -82,12 +94,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)()) @@ -217,28 +229,11 @@ transfer_16to8add = transfer_16to8add_c; transfer8x8_copy = transfer8x8_copy_c; - /* Interlacing functions */ - MBFieldTest = MBFieldTest_c; - /* Image interpolation related functions */ interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_c; interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_c; interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_c; - interpolate16x16_lowpass_h = interpolate16x16_lowpass_h_c; - interpolate16x16_lowpass_v = interpolate16x16_lowpass_v_c; - interpolate16x16_lowpass_hv = interpolate16x16_lowpass_hv_c; - - interpolate8x8_lowpass_h = interpolate8x8_lowpass_h_c; - interpolate8x8_lowpass_v = interpolate8x8_lowpass_v_c; - interpolate8x8_lowpass_hv = interpolate8x8_lowpass_hv_c; - - interpolate8x8_6tap_lowpass_h = interpolate8x8_6tap_lowpass_h_c; - interpolate8x8_6tap_lowpass_v = interpolate8x8_6tap_lowpass_v_c; - - interpolate8x8_avg2 = interpolate8x8_avg2_c; - interpolate8x8_avg4 = interpolate8x8_avg4_c; - /* Initialize internal colorspace transformation tables */ colorspace_init(); @@ -256,8 +251,6 @@ yv12_to_rgb565 = yv12_to_rgb565_c; yv12_to_rgb24 = yv12_to_rgb24_c; yv12_to_rgb32 = yv12_to_rgb32_c; - yv12_to_abgr = yv12_to_abgr_c; - yv12_to_rgba = yv12_to_rgba_c; yv12_to_yuv = yv12_to_yuv_c; yv12_to_yuyv = yv12_to_yuyv_c; yv12_to_uyvy = yv12_to_uyvy_c; @@ -269,9 +262,8 @@ sad16bi = sad16bi_c; sad8bi = sad8bi_c; dev16 = dev16_c; - sad16v = sad16v_c; -// Halfpel8_Refine = Halfpel8_Refine_c; + Halfpel8_Refine = Halfpel8_Refine_c; #ifdef ARCH_X86 if ((cpu_flags & XVID_CPU_MMX) > 0) { @@ -302,20 +294,12 @@ transfer_16to8add = transfer_16to8add_mmx; transfer8x8_copy = transfer8x8_copy_mmx; - /* Interlacing Functions */ - MBFieldTest = MBFieldTest_mmx; /* Image Interpolation related functions */ interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_mmx; interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_mmx; interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_mmx; - interpolate8x8_6tap_lowpass_h = interpolate8x8_6tap_lowpass_h_mmx; - interpolate8x8_6tap_lowpass_v = interpolate8x8_6tap_lowpass_v_mmx; - -// interpolate8x8_avg2 = interpolate8x8_avg2_mmx; - interpolate8x8_avg4 = interpolate8x8_avg4_mmx; - /* Image RGB->YV12 related functions */ rgb24_to_yv12 = rgb24_to_yv12_mmx; rgb32_to_yv12 = rgb32_to_yv12_mmx; @@ -336,7 +320,6 @@ sad16bi = sad16bi_mmx; sad8bi = sad8bi_mmx; dev16 = dev16_mmx; - sad16v = sad16v_mmx; } @@ -375,7 +358,7 @@ sad16bi = sad16bi_xmm; sad8bi = sad8bi_xmm; dev16 = dev16_xmm; - sad16v = sad16v_xmm; + } if ((cpu_flags & XVID_CPU_3DNOW) > 0) { @@ -413,7 +396,7 @@ if ((cpu_flags & XVID_CPU_IA64) > 0) { //use assembler routines? idct_ia64_init(); fdct = fdct_ia64; - idct = idct_ia64; //not yet working, crashes + idct = idct_ia64; interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_ia64; interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_ia64; interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_ia64; @@ -421,7 +404,7 @@ sad16bi = sad16bi_ia64; sad8 = sad8_ia64; dev16 = dev16_ia64; -// Halfpel8_Refine = Halfpel8_Refine_ia64; + Halfpel8_Refine = Halfpel8_Refine_ia64; quant_intra = quant_intra_ia64; dequant_intra = dequant_intra_ia64; quant_inter = quant_inter_ia64; @@ -432,7 +415,7 @@ transfer_8to16sub2 = transfer_8to16sub2_ia64; transfer_16to8add = transfer_16to8add_ia64; transfer8x8_copy = transfer8x8_copy_ia64; - DEBUG("Using IA-64 assembler routines.\n"); +// DEBUG("Using IA-64 assembler routines.\n"); } #endif @@ -503,12 +486,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);