1 |
/***************************************************************************** |
/***************************************************************************** |
2 |
* |
* |
3 |
* XviD Standard Plugins |
* Xvid Standard Plugins |
4 |
* - single-pass bitrate controller implementation - |
* - single-pass bitrate controller implementation - |
5 |
* |
* |
6 |
* Copyright(C) 2002-2004 Benjamin Lambert <foxer@hotmail.com> |
* Copyright(C) 2002-2004 Benjamin Lambert <foxer@hotmail.com> |
30 |
#include "../xvid.h" |
#include "../xvid.h" |
31 |
#include "../image/image.h" |
#include "../image/image.h" |
32 |
|
|
33 |
#define DEFAULT_INITIAL_QUANTIZER 4 |
#define DEFAULT_INITIAL_QUANTIZER 8 |
34 |
|
|
35 |
#define DEFAULT_BITRATE 900000 /* 900kbps */ |
#define DEFAULT_BITRATE 900000 /* 900kbps */ |
36 |
#define DEFAULT_DELAY_FACTOR 16 |
#define DEFAULT_DELAY_FACTOR 16 |
187 |
rc->total_size += data->length; |
rc->total_size += data->length; |
188 |
|
|
189 |
/* Compute the deviation from expected total size */ |
/* Compute the deviation from expected total size */ |
190 |
deviation = |
deviation = (int64_t) |
191 |
rc->total_size - rc->bytes_per_sec * rc->time; |
(rc->total_size - rc->bytes_per_sec * rc->time); |
192 |
|
|
193 |
averaging_period = (double) rc->averaging_period; |
averaging_period = (double) rc->averaging_period; |
194 |
|
|