Remove unused function in RC The function av1_estimate_q_constant_quality_two_pass() has been deprecated. Change-Id: I3667ceb61afa214a46d28bd348b5195728174c55
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c index 47a4901..0f374cc 100644 --- a/av1/encoder/ratectrl.c +++ b/av1/encoder/ratectrl.c
@@ -1214,113 +1214,6 @@ *q_out = q; } -// Get the value for q and its upper and lower bounds for consant quality mode. -// This is called for every frame in a gf group right after the gf structure is -// determined. -int av1_estimate_q_constant_quality_two_pass(const AV1_COMP *cpi, int width, - int height, int *arf_q, - int gf_index) { - const AV1_COMMON *const cm = &cpi->common; - const RATE_CONTROL *const rc = &cpi->rc; - const GF_GROUP *gf_group = &cpi->gf_group; - const AV1EncoderConfig *const oxcf = &cpi->oxcf; - const int cq_level = get_active_cq_level(rc, oxcf, frame_is_intra_only(cm), - cm->superres_scale_denominator); - int active_best_quality = 0; - int active_worst_quality = rc->active_worst_quality; - int q; - const int bit_depth = cm->seq_params.bit_depth; - - const int is_intrl_arf_boost = - gf_group->update_type[gf_index] == INTNL_ARF_UPDATE; - - const int is_boosted_frame = gf_group->update_type[gf_index] == GF_UPDATE || - gf_group->update_type[gf_index] == ARF_UPDATE || - is_intrl_arf_boost; - - int is_fwd_kf = 0; - if (gf_group->update_type[gf_index] == ARF_UPDATE) { - assert(is_altref_enabled(cpi)); - const int arf_src_index = gf_group->arf_src_offset[gf_index]; - is_fwd_kf = arf_src_index == (rc->frames_to_key - 1); - } - - if (gf_group->update_type[gf_index] == KF_UPDATE || is_fwd_kf) { - get_intra_q_and_bounds_two_pass(cpi, width, height, &active_best_quality, - &active_worst_quality, arf_q, cq_level, - is_fwd_kf); - } else if (is_boosted_frame) { - // Use the lower of active_worst_quality and recent - // average Q as basis for GF/ARF best Q limit unless last frame was - // a key frame. - if (gf_group->update_type[0] != KF_UPDATE && - rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) { - q = rc->avg_frame_qindex[INTER_FRAME]; - } else { - q = active_worst_quality; - } - if (gf_group->update_type[gf_index] != ARF_UPDATE && !is_intrl_arf_boost) { - active_best_quality = cq_level; - } else { - if (gf_group->update_type[gf_index] == ARF_UPDATE) { - active_best_quality = get_gf_active_quality(rc, q, bit_depth); - const int min_boost = get_gf_high_motion_quality(q, bit_depth); - const int boost = min_boost - active_best_quality; - - active_best_quality = min_boost - (int)(boost * rc->arf_boost_factor); - *arf_q = active_best_quality; - // Tweak active_best_quality for AOM_Q mode when superres is on, as this - // will be used directly as 'q' later. - if ((oxcf->superres_mode == SUPERRES_QTHRESH || - oxcf->superres_mode == SUPERRES_AUTO) && - cm->superres_scale_denominator != SCALE_NUMERATOR) { - active_best_quality = - AOMMAX(active_best_quality - - ((cm->superres_scale_denominator - SCALE_NUMERATOR) * - SUPERRES_QADJ_PER_DENOM_ARFFRAME), - 0); - } - } else { - assert(rc->arf_q >= 0); // Ensure it is set to a valid value. - assert(is_intrl_arf_boost); - active_best_quality = rc->arf_q; - int this_height = gf_group->pyramid_level[gf_index]; - while (this_height < gf_group->pyramid_height) { - active_best_quality = (active_best_quality + cq_level + 1) / 2; - ++this_height; - } - } - } - } else { - active_best_quality = cq_level; - } - - aom_clear_system_state(); - // Static forced key frames Q restrictions dealt with elsewhere. - if ((gf_group->update_type[gf_index] != KF_UPDATE) || - !rc->this_key_frame_forced || - (cpi->twopass.last_kfgroup_zeromotion_pct < STATIC_MOTION_THRESH)) { - const int qdelta = av1_frame_type_qdelta(cpi, active_worst_quality); - active_worst_quality = - AOMMAX(active_worst_quality + qdelta, active_best_quality); - } - - active_best_quality = - clamp(active_best_quality, rc->best_quality, rc->worst_quality); - active_worst_quality = - clamp(active_worst_quality, active_best_quality, rc->worst_quality); - - q = active_best_quality; - clamp(q, active_best_quality, active_worst_quality); - - assert(active_worst_quality <= rc->worst_quality && - active_worst_quality >= rc->best_quality); - assert(active_best_quality <= rc->worst_quality && - active_best_quality >= rc->best_quality); - assert(q <= rc->worst_quality && q >= rc->best_quality); - return q; -} - static int rc_pick_q_and_bounds_two_pass(const AV1_COMP *cpi, int width, int height, int gf_index, int *bottom_index, int *top_index,
diff --git a/av1/encoder/ratectrl.h b/av1/encoder/ratectrl.h index 1be8a2b..c5541d3 100644 --- a/av1/encoder/ratectrl.h +++ b/av1/encoder/ratectrl.h
@@ -272,10 +272,6 @@ void av1_rc_set_frame_target(struct AV1_COMP *cpi, int target, int width, int height); -int av1_estimate_q_constant_quality_two_pass(const struct AV1_COMP *cpi, - int width, int height, int *arf_q, - int gf_index); - int av1_calc_pframe_target_size_one_pass_vbr( const struct AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type);