Commit c5bb9753 authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Removing vp9_rescale()."

parents 40e12395 1acc96fb
...@@ -489,14 +489,6 @@ void vp9_new_framerate(VP9_COMP *cpi, double framerate) { ...@@ -489,14 +489,6 @@ void vp9_new_framerate(VP9_COMP *cpi, double framerate) {
vp9_rc_update_framerate(cpi); vp9_rc_update_framerate(cpi);
} }
int64_t vp9_rescale(int64_t val, int64_t num, int denom) {
int64_t llnum = num;
int64_t llden = denom;
int64_t llval = val;
return (llval * llnum / llden);
}
static void set_tile_limits(VP9_COMP *cpi) { static void set_tile_limits(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common; VP9_COMMON *const cm = &cpi->common;
...@@ -591,21 +583,21 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) { ...@@ -591,21 +583,21 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
cpi->oxcf.maximum_buffer_size_ms = 240000; cpi->oxcf.maximum_buffer_size_ms = 240000;
} }
rc->starting_buffer_level = vp9_rescale(cpi->oxcf.starting_buffer_level_ms, rc->starting_buffer_level = cpi->oxcf.starting_buffer_level_ms *
cpi->oxcf.target_bandwidth, 1000); cpi->oxcf.target_bandwidth / 1000;
// Set or reset optimal and maximum buffer levels. // Set or reset optimal and maximum buffer levels.
if (cpi->oxcf.optimal_buffer_level_ms == 0) if (cpi->oxcf.optimal_buffer_level_ms == 0)
rc->optimal_buffer_level = cpi->oxcf.target_bandwidth / 8; rc->optimal_buffer_level = cpi->oxcf.target_bandwidth / 8;
else else
rc->optimal_buffer_level = vp9_rescale(cpi->oxcf.optimal_buffer_level_ms, rc->optimal_buffer_level = cpi->oxcf.optimal_buffer_level_ms *
cpi->oxcf.target_bandwidth, 1000); cpi->oxcf.target_bandwidth / 1000;
if (cpi->oxcf.maximum_buffer_size_ms == 0) if (cpi->oxcf.maximum_buffer_size_ms == 0)
rc->maximum_buffer_size = cpi->oxcf.target_bandwidth / 8; rc->maximum_buffer_size = cpi->oxcf.target_bandwidth / 8;
else else
rc->maximum_buffer_size = vp9_rescale(cpi->oxcf.maximum_buffer_size_ms, rc->maximum_buffer_size = cpi->oxcf.maximum_buffer_size_ms *
cpi->oxcf.target_bandwidth, 1000); cpi->oxcf.target_bandwidth / 1000;
// Under a configuration change, where maximum_buffer_size may change, // Under a configuration change, where maximum_buffer_size may change,
// keep buffer level clipped to the maximum allowed buffer size. // keep buffer level clipped to the maximum allowed buffer size.
rc->bits_off_target = MIN(rc->bits_off_target, rc->maximum_buffer_size); rc->bits_off_target = MIN(rc->bits_off_target, rc->maximum_buffer_size);
......
...@@ -520,8 +520,6 @@ void vp9_scale_references(VP9_COMP *cpi); ...@@ -520,8 +520,6 @@ void vp9_scale_references(VP9_COMP *cpi);
void vp9_update_reference_frames(VP9_COMP *cpi); void vp9_update_reference_frames(VP9_COMP *cpi);
int64_t vp9_rescale(int64_t val, int64_t num, int denom);
void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv); void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv);
YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm, YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm,
......
...@@ -69,8 +69,8 @@ void vp9_init_layer_context(VP9_COMP *const cpi) { ...@@ -69,8 +69,8 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
lc->gold_ref_idx = -1; lc->gold_ref_idx = -1;
} }
lrc->buffer_level = vp9_rescale((int)(oxcf->starting_buffer_level_ms), lrc->buffer_level = oxcf->starting_buffer_level_ms *
lc->target_bandwidth, 1000); lc->target_bandwidth / 1000;
lrc->bits_off_target = lrc->buffer_level; lrc->bits_off_target = lrc->buffer_level;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment