From a286ff8077e054b8a43e8bb2bc5afb17d331d9d8 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Thu, 10 Apr 2014 16:35:10 -0700 Subject: [PATCH] Moving last_frame_type update out from vp9_rc_postencode_update. Change-Id: Ib00a694b9cf8e0c276dfefddab8cb36b8693e022 --- vp9/encoder/vp9_onyx_if.c | 1 + vp9/encoder/vp9_ratectrl.c | 3 +-- vp9/encoder/vp9_ratectrl.h | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 2f1381476..864dfc4ad 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -2660,6 +2660,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, get_ref_frame_flags(cpi); + cm->last_frame_type = cm->frame_type; vp9_rc_postencode_update(cpi, *size); if (cm->frame_type == KEY_FRAME) { diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 6a9ffd25d..00489cd23 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -1065,11 +1065,10 @@ static void update_golden_frame_stats(VP9_COMP *cpi) { } void vp9_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) { - VP9_COMMON *const cm = &cpi->common; + const VP9_COMMON *const cm = &cpi->common; const VP9_CONFIG *const oxcf = &cpi->oxcf; RATE_CONTROL *const rc = &cpi->rc; - cm->last_frame_type = cm->frame_type; // Update rate control heuristics rc->projected_frame_size = (int)(bytes_used << 3); diff --git a/vp9/encoder/vp9_ratectrl.h b/vp9/encoder/vp9_ratectrl.h index 7693c2b13..0b12a4c58 100644 --- a/vp9/encoder/vp9_ratectrl.h +++ b/vp9/encoder/vp9_ratectrl.h @@ -125,8 +125,7 @@ void vp9_rc_get_svc_params(struct VP9_COMP *cpi); // Post encode update of the rate control parameters based // on bytes used -void vp9_rc_postencode_update(struct VP9_COMP *cpi, - uint64_t bytes_used); +void vp9_rc_postencode_update(struct VP9_COMP *cpi, uint64_t bytes_used); // Post encode update of the rate control parameters for dropped frames void vp9_rc_postencode_update_drop_frame(struct VP9_COMP *cpi); -- 2.40.0