22 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
23 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 |
* |
* |
25 |
* $Id: plugin_2pass2.c,v 1.1.2.5 2003-05-17 13:36:38 suxen_drol Exp $ |
* $Id: plugin_2pass2.c,v 1.1.2.6 2003-05-20 17:28:25 edgomez Exp $ |
26 |
* |
* |
27 |
*****************************************************************************/ |
*****************************************************************************/ |
28 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
#if 0 |
190 |
static void print_stats(rc_2pass2_t * rc) |
static void print_stats(rc_2pass2_t * rc) |
191 |
{ |
{ |
192 |
int i; |
int i; |
193 |
for (i = 0; i < rc->num_frames; i++) { |
for (i = 0; i < rc->num_frames; i++) { |
194 |
stat_t * s = &rc->stats[i]; |
stat_t * s = &rc->stats[i]; |
195 |
DPRINTF(XVID_DEBUG_RC, "%i %i %i %i\n", s->type, s->quant, s->length, s->scaled_length); |
DPRINTF(XVID_DEBUG_RC, "%i %i %i %i\n", s->type, s->quant, s->length, s->scaled_length); |
|
|
|
196 |
} |
} |
197 |
} |
} |
198 |
|
#endif |
199 |
|
|
200 |
/* pre-process the statistics data |
/* pre-process the statistics data |
201 |
- for each type, count, tot_length, min_length, max_length |
- for each type, count, tot_length, min_length, max_length |
328 |
s->scaled_length = s->length; |
s->scaled_length = s->length; |
329 |
}else { |
}else { |
330 |
len = (int)((double)s->length * scaler * s->weight / rc->avg_weight); |
len = (int)((double)s->length * scaler * s->weight / rc->avg_weight); |
331 |
if (len < min_size[s->type]) { /* force frame size */ |
if (len < min_size[s->type-1]) { /* force frame size */ |
332 |
s->scaled_length = min_size[s->type]; |
s->scaled_length = min_size[s->type-1]; |
333 |
target -= s->scaled_length; |
target -= s->scaled_length; |
334 |
pass1_length -= s->length; |
pass1_length -= s->length; |
335 |
}else{ |
}else{ |
668 |
|
|
669 |
|
|
670 |
pre_process0(rc); |
pre_process0(rc); |
671 |
|
|
672 |
if (rc->param.bitrate) { |
if (rc->param.bitrate) { |
673 |
zone_process(rc, create); |
zone_process(rc, create); |
674 |
internal_scale(rc); |
internal_scale(rc); |