--- decoder.c 2003/06/09 01:15:59 1.49.2.6 +++ decoder.c 2003/06/09 19:41:53 1.49.2.8 @@ -3,23 +3,24 @@ * XVID MPEG-4 VIDEO CODEC * - Decoder Module - * - * This file is part of XviD, a free MPEG-4 video encoder/decoder + * Copyright(C) 2002 MinChen + * 2002-2003 Peter Ross * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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 * - * $Id: decoder.c,v 1.49.2.6 2003/06/09 01:15:59 edgomez Exp $ + * $Id: decoder.c,v 1.49.2.8 2003/06/09 19:41:53 edgomez Exp $ * ****************************************************************************/ @@ -1741,6 +1742,7 @@ WARPPOINTS gmc_warp; int coding_type; int success, output, seen_something; + idctFuncPtr idct_save; if (XVID_MAJOR(frame->version) != 1 || (stats && XVID_MAJOR(stats->version) != 1)) /* v1.x.x */ return XVID_ERR_VERSION; @@ -1786,6 +1788,7 @@ success = 0; output = 0; seen_something = 0; + idct_save = idct; repeat: @@ -1827,6 +1830,14 @@ dec->p_bmv.x = dec->p_bmv.y = dec->p_fmv.y = dec->p_fmv.y = 0; /* init pred vector to 0 */ +#if defined(ARCH_IS_IA32) + /* + * /!\ Ugly hack /!\ + * IA32: Prior to xvid bitstream 10, we were using Walten's mmx/xmm idct + */ + if((idct == simple_idct_mmx) && (dec->bs_version < 10)) + idct = idct_mmx; +#endif /* packed_mode: special-N_VOP treament */ if (dec->packed_mode && coding_type == N_VOP) @@ -1956,5 +1967,7 @@ emms(); stop_global_timer(); + idct = idct_save; + return BitstreamPos(&bs) / 8; /* number of bytes consumed */ }