// Boost for arf frame
Boost = (cpi->gfu_boost * 3 * GFQ_ADJUSTMENT) / (2 * 100);
- Boost += (cpi->baseline_gf_interval * 50);
+ Boost += (i * 50);
allocation_chunks = (i * 100) + Boost;
// Normalize Altboost and allocations chunck down to prevent overflow
vp8_avg_stats(§ionstats);
- if (sectionstats.pcnt_motion < .17)
- cpi->section_is_low_motion = 1;
- else
- cpi->section_is_low_motion = 0;
-
- if (sectionstats.mvc_abs + sectionstats.mvr_abs > 45)
- cpi->section_is_fast_motion = 1;
- else
- cpi->section_is_fast_motion = 0;
-
cpi->section_intra_rating = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error);
Ratio = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error);
cpi->ni_av_qi = cpi->worst_quality;
}
}
- else
+ // The last few frames of a clip almost always have to few or too many
+ // bits and for the sake of over exact rate control we dont want to make
+ // radical adjustments to the allowed quantizer range just to use up a
+ // few surplus bits or get beneath the target rate.
+ else if ( (cpi->common.current_video_frame <
+ (((unsigned int)cpi->total_stats->count * 255)>>8)) &&
+ ((cpi->common.current_video_frame + cpi->baseline_gf_interval) <
+ (unsigned int)cpi->total_stats->count) )
{
if (frames_left < 1)
frames_left = 1;
vp8_avg_stats(§ionstats);
- if (sectionstats.pcnt_motion < .17)
- cpi->section_is_low_motion = 1;
- else
- cpi->section_is_low_motion = 0;
-
- if (sectionstats.mvc_abs + sectionstats.mvr_abs > 45)
- cpi->section_is_fast_motion = 1;
- else
- cpi->section_is_fast_motion = 0;
-
- cpi->section_intra_rating = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error);
+ cpi->section_intra_rating = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error);
Ratio = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error);
// if( (Ratio > 11) ) //&& (sectionstats.pcnt_second_ref < .20) )