From bc0a97431072afdad009930c186a71c129bdea2c Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 24 Aug 2015 13:00:50 -0700 Subject: Fix to golden update in cyclic_refresh. For one pass CBR: only check for updating refresh_golden if ext_refresh_frame_flags_pending is not set (i.e., == 0). And move the resetting of ext_refresh_frame_flags_pending = 0 down to after the encode_loop (and account for dropped frames). This is to prevent changing refresh_golden flga when the user supplies the reference/update flags. Change-Id: I4d87b3e705ba43f243667e367503b585c61e2a54 --- vp9/encoder/vp9_encoder.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vp9/encoder') diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index d9ecb9a1c..3cb935f97 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -3270,6 +3270,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi, if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->frame_type != KEY_FRAME && !cpi->use_svc && + cpi->ext_refresh_frame_flags_pending == 0 && (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR)) vp9_cyclic_refresh_check_golden_update(cpi); @@ -3578,7 +3579,6 @@ static void set_ext_overrides(VP9_COMP *cpi) { cpi->refresh_last_frame = cpi->ext_refresh_last_frame; cpi->refresh_golden_frame = cpi->ext_refresh_golden_frame; cpi->refresh_alt_ref_frame = cpi->ext_refresh_alt_ref_frame; - cpi->ext_refresh_frame_flags_pending = 0; } } @@ -3747,6 +3747,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, if (vp9_rc_drop_frame(cpi)) { vp9_rc_postencode_update_drop_frame(cpi); ++cm->current_video_frame; + cpi->ext_refresh_frame_flags_pending = 0; return; } } @@ -3828,6 +3829,8 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, } } + cpi->ext_refresh_frame_flags_pending = 0; + if (cpi->refresh_golden_frame == 1) cpi->frame_flags |= FRAMEFLAGS_GOLDEN; else -- cgit v1.2.3