summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ratectrl.c
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-08-08 14:27:34 -0700
committerDmitry Kovalev <dkovalev@google.com>2014-08-08 14:27:54 -0700
commit91c2f1e45a91cbed855c0708d7fde666601772a9 (patch)
tree5eb7a7d1f5060c4c8eec3e5bc99e51e396c0d4fc /vp9/encoder/vp9_ratectrl.c
parent2fe6fa72fc6b1bd8f4264f4527aed2cc63cf8616 (diff)
downloadlibvpx-91c2f1e45a91cbed855c0708d7fde666601772a9.tar
libvpx-91c2f1e45a91cbed855c0708d7fde666601772a9.tar.gz
libvpx-91c2f1e45a91cbed855c0708d7fde666601772a9.tar.bz2
libvpx-91c2f1e45a91cbed855c0708d7fde666601772a9.zip
Moving pass from VP9_COMP to VP9EncoderConfig.
We had a very complicated way to initialize cpi->pass from cfg->g_pass: switch (cfg->g_pass) { case VPX_RC_ONE_PASS: oxcf->mode = ONE_PASS_GOOD; break; case VPX_RC_FIRST_PASS: oxcf->mode = TWO_PASS_FIRST; break; case VPX_RC_LAST_PASS: oxcf->mode = TWO_PASS_SECOND_BEST; break; } cpi->pass = get_pass(oxcf->mode). Now pass is moved to VP9EncoderConfig and initialization is simple: switch (cfg->g_pass) { case VPX_RC_ONE_PASS: oxcf->pass = 0; break; case VPX_RC_FIRST_PASS: oxcf->pass = 1; break; case VPX_RC_LAST_PASS: oxcf->pass = 2; break; } Change-Id: I8f582203a4575f5e39b071598484a8ad2b72e0d9
Diffstat (limited to 'vp9/encoder/vp9_ratectrl.c')
-rw-r--r--vp9/encoder/vp9_ratectrl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index 73c6b89e8..04ab79538 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -277,7 +277,7 @@ static double get_rate_correction_factor(const VP9_COMP *cpi) {
if (cpi->common.frame_type == KEY_FRAME) {
return rc->rate_correction_factors[KF_STD];
- } else if (cpi->pass == 2) {
+ } else if (cpi->oxcf.pass == 2) {
RATE_FACTOR_LEVEL rf_lvl =
cpi->twopass.gf_group.rf_level[cpi->twopass.gf_group.index];
return rc->rate_correction_factors[rf_lvl];
@@ -296,7 +296,7 @@ static void set_rate_correction_factor(VP9_COMP *cpi, double factor) {
if (cpi->common.frame_type == KEY_FRAME) {
rc->rate_correction_factors[KF_STD] = factor;
- } else if (cpi->pass == 2) {
+ } else if (cpi->oxcf.pass == 2) {
RATE_FACTOR_LEVEL rf_lvl =
cpi->twopass.gf_group.rf_level[cpi->twopass.gf_group.index];
rc->rate_correction_factors[rf_lvl] = factor;
@@ -923,7 +923,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
int vp9_rc_pick_q_and_bounds(const VP9_COMP *cpi,
int *bottom_index, int *top_index) {
int q;
- if (cpi->pass == 0) {
+ if (cpi->oxcf.pass == 0) {
if (cpi->oxcf.rc_mode == VPX_CBR)
q = rc_pick_q_and_bounds_one_pass_cbr(cpi, bottom_index, top_index);
else
@@ -991,7 +991,7 @@ static void update_golden_frame_stats(VP9_COMP *cpi) {
// this frame refreshes means next frames don't unless specified by user
rc->frames_since_golden = 0;
- if (cpi->pass == 2) {
+ if (cpi->oxcf.pass == 2) {
if (!rc->source_alt_ref_pending &&
cpi->twopass.gf_group.rf_level[0] == GF_ARF_STD)
rc->source_alt_ref_active = 0;
@@ -1242,7 +1242,7 @@ void vp9_rc_get_svc_params(VP9_COMP *cpi) {
(~VP9_LAST_FLAG & ~VP9_GOLD_FLAG & ~VP9_ALT_FLAG);
}
- if (cpi->pass == 0 && cpi->oxcf.rc_mode == VPX_CBR) {
+ if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR) {
target = calc_iframe_target_size_one_pass_cbr(cpi);
}
} else {
@@ -1260,7 +1260,7 @@ void vp9_rc_get_svc_params(VP9_COMP *cpi) {
cpi->ref_frame_flags &= (~VP9_ALT_FLAG);
}
- if (cpi->pass == 0 && cpi->oxcf.rc_mode == VPX_CBR) {
+ if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR) {
target = calc_pframe_target_size_one_pass_cbr(cpi);
}
}