1 |
/****************************************************************************** |
/****************************************************************************** |
2 |
* |
* |
3 |
* XviD Bit Rate Controller Library |
* Xvid Bit Rate Controller Library |
4 |
* - VBR 2 pass bitrate controller implementation - |
* - VBR 2 pass bitrate controller implementation - |
5 |
* |
* |
6 |
* Copyright (C) 2002 Foxer <email?> |
* Copyright (C) 2002 Benjamin Lambert <foxer@hotmail.com> |
7 |
* 2002 Dirk Knop <dknop@gwdg.de> |
* 2002 Dirk Knop <dknop@gwdg.de> |
8 |
* 2002-2003 Edouard Gomez <ed.gomez@free.fr> |
* 2002-2003 Edouard Gomez <ed.gomez@free.fr> |
9 |
* 2003 Pete Ross <pross@xvid.org> |
* 2003 Pete Ross <pross@xvid.org> |
10 |
* |
* |
11 |
* This curve treatment algorithm is the one originally implemented by Foxer |
* This curve treatment algorithm is the one originally implemented by Foxer |
12 |
* and tuned by Dirk Knop for the XviD vfw frontend. |
* and tuned by Dirk Knop for the Xvid vfw frontend. |
13 |
* |
* |
14 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
15 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
219 |
*--------------------------------*/ |
*--------------------------------*/ |
220 |
double desired_total; |
double desired_total; |
221 |
double real_total; |
double real_total; |
222 |
|
|
223 |
|
int scaled_frames; |
224 |
} rc_2pass2_t; |
} rc_2pass2_t; |
225 |
|
|
226 |
|
|
346 |
|
|
347 |
rc->fq_error = 0; |
rc->fq_error = 0; |
348 |
rc->min_quant = 1; |
rc->min_quant = 1; |
349 |
|
rc->scaled_frames = 0; |
350 |
|
|
351 |
/* Count frames (and intra frames) in the stats file, store the result into |
/* Count frames (and intra frames) in the stats file, store the result into |
352 |
* the rc structure */ |
* the rc structure */ |
797 |
rc->last_quant[s->type-1] = data->quant; |
rc->last_quant[s->type-1] = data->quant; |
798 |
|
|
799 |
/* Don't forget to force 1st pass frame type ;-) */ |
/* Don't forget to force 1st pass frame type ;-) */ |
800 |
|
if (rc->scaled_frames) |
801 |
data->type = s->type; |
data->type = s->type; |
802 |
|
|
803 |
|
rc->scaled_frames++; |
804 |
return 0; |
return 0; |
805 |
} |
} |
806 |
|
|