--- trunk/xvidcore/src/divx4.c 2002/09/21 03:11:36 499 +++ trunk/xvidcore/src/divx4.c 2003/02/15 15:22:19 851 @@ -3,8 +3,6 @@ * XVID MPEG-4 VIDEO CODEC * - OpenDivx API wrapper - * - * 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 @@ -30,6 +28,20 @@ * *************************************************************************/ +/************************************************************************** + * + * History: + * + * 24.02.2002 #def BFRAMES compatibility + * 26.02.2001 fixed dec_csp bugs + * 26.12.2001 xvid_init() support + * 22.12.2001 removed some compiler warnings + * 16.12.2001 inital version; (c)2001 peter ross + * + * $Id: divx4.c,v 1.21 2003-02-15 15:22:17 edgomez Exp $ + * + *************************************************************************/ + #include #include #include @@ -94,20 +106,17 @@ static int const divx4_motion_presets[7] = { 0, - PMV_EARLYSTOP16, + 0, - PMV_EARLYSTOP16 | PMV_ADVANCEDDIAMOND16, + PMV_ADVANCEDDIAMOND16, - PMV_EARLYSTOP16 | PMV_HALFPELREFINE16, + PMV_HALFPELREFINE16, - PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | - PMV_HALFPELREFINE8, + PMV_HALFPELREFINE16 | PMV_HALFPELREFINE8, - PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | - PMV_HALFPELREFINE8, + PMV_HALFPELREFINE16 | PMV_HALFPELREFINE8, - PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | PMV_EARLYSTOP8 | - PMV_HALFPELREFINE8 + PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | PMV_HALFPELREFINE8 }; @@ -275,7 +284,7 @@ } /* Decode the bitstream */ - xerr = decoder_decode(dcur->handle, &dcur->xframe); + xerr = decoder_decode(dcur->handle, &dcur->xframe, NULL); /* Restore the real colorspace for this instance */ if (!dframe->render_flag) { @@ -358,6 +367,11 @@ xparam.max_quantizer = eparam->max_quantizer; xparam.max_key_interval = eparam->max_key_interval; + xparam.global = 0; + xparam.max_bframes = -1; /* use "original" IP-frame encoder */ + xparam.bquant_ratio = 200; + xparam.frame_drop_ratio = 0; /* dont drop frames */ + /* Create the encoder session */ xerr = encoder_create(&xparam);