Merge "vp9: Fix to usage of flag USE_ALTREF_FOR_ONE_PASS"
This commit is contained in:
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
#define FRAME_OVERHEAD_BITS 200
|
#define FRAME_OVERHEAD_BITS 200
|
||||||
|
|
||||||
// Use this macro to turn on/off use of alt-refs in one-pass mode.
|
// Use this macro to turn on/off use of alt-refs in one-pass vbr mode.
|
||||||
#define USE_ALTREF_FOR_ONE_PASS 0
|
#define USE_ALTREF_FOR_ONE_PASS 0
|
||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
@@ -566,9 +566,9 @@ int vp9_rc_regulate_q(const VP9_COMP *cpi, int target_bits_per_frame,
|
|||||||
VPXMAX(cpi->rc.q_1_frame, cpi->rc.q_2_frame));
|
VPXMAX(cpi->rc.q_1_frame, cpi->rc.q_2_frame));
|
||||||
}
|
}
|
||||||
#if USE_ALTREF_FOR_ONE_PASS
|
#if USE_ALTREF_FOR_ONE_PASS
|
||||||
if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_VBR &&
|
if (cpi->oxcf.enable_auto_arf && cpi->oxcf.pass == 0 &&
|
||||||
cpi->oxcf.lag_in_frames > 0 && cpi->rc.is_src_frame_alt_ref &&
|
cpi->oxcf.rc_mode == VPX_VBR && cpi->oxcf.lag_in_frames > 0 &&
|
||||||
!cpi->rc.alt_ref_gf_group) {
|
cpi->rc.is_src_frame_alt_ref && !cpi->rc.alt_ref_gf_group) {
|
||||||
q = VPXMIN(q, (q + cpi->rc.last_boosted_qindex) >> 1);
|
q = VPXMIN(q, (q + cpi->rc.last_boosted_qindex) >> 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1528,8 +1528,14 @@ void vp9_rc_get_one_pass_vbr_params(VP9_COMP *cpi) {
|
|||||||
adjust_gfint_frame_constraint(cpi, rc->frames_to_key);
|
adjust_gfint_frame_constraint(cpi, rc->frames_to_key);
|
||||||
rc->frames_till_gf_update_due = rc->baseline_gf_interval;
|
rc->frames_till_gf_update_due = rc->baseline_gf_interval;
|
||||||
cpi->refresh_golden_frame = 1;
|
cpi->refresh_golden_frame = 1;
|
||||||
rc->source_alt_ref_pending = USE_ALTREF_FOR_ONE_PASS;
|
rc->source_alt_ref_pending = 0;
|
||||||
rc->alt_ref_gf_group = USE_ALTREF_FOR_ONE_PASS;
|
rc->alt_ref_gf_group = 0;
|
||||||
|
#if USE_ALTREF_FOR_ONE_PASS
|
||||||
|
if (cpi->oxcf.enable_auto_arf) {
|
||||||
|
rc->source_alt_ref_pending = 1;
|
||||||
|
rc->alt_ref_gf_group = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (cm->frame_type == KEY_FRAME)
|
if (cm->frame_type == KEY_FRAME)
|
||||||
target = calc_iframe_target_size_one_pass_vbr(cpi);
|
target = calc_iframe_target_size_one_pass_vbr(cpi);
|
||||||
@@ -2140,6 +2146,7 @@ void adjust_gf_boost_lag_one_pass_vbr(VP9_COMP *cpi, uint64_t avg_sad_current) {
|
|||||||
rc->gfu_boost = DEFAULT_GF_BOOST >> 2;
|
rc->gfu_boost = DEFAULT_GF_BOOST >> 2;
|
||||||
}
|
}
|
||||||
#if USE_ALTREF_FOR_ONE_PASS
|
#if USE_ALTREF_FOR_ONE_PASS
|
||||||
|
if (cpi->oxcf.enable_auto_arf) {
|
||||||
// Don't use alt-ref if there is a scene cut within the group,
|
// Don't use alt-ref if there is a scene cut within the group,
|
||||||
// or content is not low.
|
// or content is not low.
|
||||||
if ((rc->high_source_sad_lagindex > 0 &&
|
if ((rc->high_source_sad_lagindex > 0 &&
|
||||||
@@ -2155,6 +2162,7 @@ void adjust_gf_boost_lag_one_pass_vbr(VP9_COMP *cpi, uint64_t avg_sad_current) {
|
|||||||
rc->baseline_gf_interval < rc->frames_to_key)
|
rc->baseline_gf_interval < rc->frames_to_key)
|
||||||
rc->baseline_gf_interval = 10;
|
rc->baseline_gf_interval = 10;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
target = calc_pframe_target_size_one_pass_vbr(cpi);
|
target = calc_pframe_target_size_one_pass_vbr(cpi);
|
||||||
vp9_rc_set_frame_target(cpi, target);
|
vp9_rc_set_frame_target(cpi, target);
|
||||||
@@ -2284,7 +2292,10 @@ void vp9_avg_source_sad(VP9_COMP *cpi) {
|
|||||||
cpi->ext_refresh_frame_flags_pending == 0) {
|
cpi->ext_refresh_frame_flags_pending == 0) {
|
||||||
int target;
|
int target;
|
||||||
cpi->refresh_golden_frame = 1;
|
cpi->refresh_golden_frame = 1;
|
||||||
rc->source_alt_ref_pending = USE_ALTREF_FOR_ONE_PASS;
|
rc->source_alt_ref_pending = 0;
|
||||||
|
#if USE_ALTREF_FOR_ONE_PASS
|
||||||
|
if (cpi->oxcf.enable_auto_arf) rc->source_alt_ref_pending = 1;
|
||||||
|
#endif
|
||||||
rc->gfu_boost = DEFAULT_GF_BOOST >> 1;
|
rc->gfu_boost = DEFAULT_GF_BOOST >> 1;
|
||||||
rc->baseline_gf_interval =
|
rc->baseline_gf_interval =
|
||||||
VPXMIN(20, VPXMAX(10, rc->baseline_gf_interval));
|
VPXMIN(20, VPXMAX(10, rc->baseline_gf_interval));
|
||||||
|
Reference in New Issue
Block a user