--- plugin_single.c 2003/05/12 12:33:16 1.1.2.1 +++ plugin_single.c 2003/11/19 15:42:38 1.1.2.6 @@ -1,26 +1,26 @@ /***************************************************************************** * - * XviD Standard Plugins - * - single-pass bitrate controller implementation - + * XviD Standard Plugins + * - single-pass bitrate controller implementation - * * Copyright(C) 2002 Benjamin Lambert * 2002-2003 Edouard Gomez * - * 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 - * (at your option) any later version. + * 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 + * (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 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * 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 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: plugin_single.c,v 1.1.2.1 2003/05/12 12:33:16 suxen_drol Exp $ + * $Id: plugin_single.c,v 1.1.2.6 2003/11/19 15:42:38 syskin Exp $ * ****************************************************************************/ @@ -30,7 +30,7 @@ #include "../xvid.h" #include "../image/image.h" -#define DEFAULT_INITIAL_QUANTIZER 5 +#define DEFAULT_INITIAL_QUANTIZER 8 #define DEFAULT_BITRATE 900000 /* 900kbps */ #define DEFAULT_DELAY_FACTOR 16 @@ -126,9 +126,9 @@ *handle = rc; /* A bit of debug info */ - DPRINTF(DPRINTF_RC, "bytes_per_sec: %i\n", rc->bytes_per_sec); - DPRINTF(DPRINTF_RC, "frame rate : %f\n", (double) create->fbase / create->fincr); - DPRINTF(DPRINTF_RC, "target_framesize: %f\n", rc->target_framesize); + DPRINTF(XVID_DEBUG_RC, "bytes_per_sec: %i\n", rc->bytes_per_sec); + DPRINTF(XVID_DEBUG_RC, "frame rate : %f\n", (double) create->fbase / create->fincr); + DPRINTF(XVID_DEBUG_RC, "target_framesize: %f\n", rc->target_framesize); return (0); } @@ -173,11 +173,15 @@ double base_quality; double target_quality; - /* Update internal values */ rc->time += (double) data->fincr / data->fbase; rc->total_size += data->length; + if(data->type == XVID_TYPE_BVOP) + return (0); + + rc->rtn_quant = data->quant; + /* Compute the deviation from expected total size */ deviation = (int64_t) ((double) rc->total_size - (double) rc->bytes_per_sec * rc->time); @@ -262,6 +266,7 @@ { switch (opt) { case XVID_PLG_INFO: + case XVID_PLG_FRAME : return 0; case XVID_PLG_CREATE: