From 7bd73b638a98cfc8978f7162a4058728c77a132c Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 28 Apr 2016 17:06:18 -0700 Subject: [PATCH] vp9: Move the initialization of some rc variables to rc_init. And initialize a variable (avg_source_sad) that was not initialized to 0. Change-Id: I63223e20fffe2a2ea38f03da62dad16af0618ea4 --- vp9/encoder/vp9_encoder.c | 3 --- vp9/encoder/vp9_ratectrl.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 68537e97f..4be043df5 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -1692,9 +1692,6 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf, cpi->use_skin_detection = 0; cpi->common.buffer_pool = pool; - cpi->rc.high_source_sad = 0; - cpi->rc.count_last_scene_change = 0; - init_config(cpi, oxcf); vp9_rc_init(&cpi->oxcf, oxcf->pass, &cpi->rc); diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index d53e60aea..0675d4a00 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -339,6 +339,9 @@ void vp9_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) { rc->total_target_vs_actual = 0; rc->avg_intersize_gfint = 0; rc->avg_frame_low_motion = 0; + rc->high_source_sad = 0; + rc->count_last_scene_change = 0; + rc->avg_source_sad = 0; rc->frames_since_key = 8; // Sensible default for first frame. rc->this_key_frame_forced = 0; -- 2.40.0