summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_onyx_if.c
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-04-18 10:38:20 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-04-18 10:38:20 -0700
commit400973c3610e9cd423a475b3a8ad5b4fd110a942 (patch)
treed9bdcc0a28e7304c08b50b8e90ea13b742edf132 /vp9/encoder/vp9_onyx_if.c
parent6b47f8457875e04ff73d83cc414a39295bbf8989 (diff)
parent219a006b9c0d7cc994167d339ac96825cc4eff74 (diff)
downloadlibvpx-400973c3610e9cd423a475b3a8ad5b4fd110a942.tar
libvpx-400973c3610e9cd423a475b3a8ad5b4fd110a942.tar.gz
libvpx-400973c3610e9cd423a475b3a8ad5b4fd110a942.tar.bz2
libvpx-400973c3610e9cd423a475b3a8ad5b4fd110a942.zip
Merge "Adding get_pass() function."
Diffstat (limited to 'vp9/encoder/vp9_onyx_if.c')
-rw-r--r--vp9/encoder/vp9_onyx_if.c48
1 files changed, 20 insertions, 28 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 42ed11d0a..78372b803 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -676,6 +676,23 @@ static void init_config(struct VP9_COMP *cpi, VP9_CONFIG *oxcf) {
cpi->fixed_divide[i] = 0x80000 / i;
}
+static int get_pass(MODE mode) {
+ switch (mode) {
+ case REALTIME:
+ case ONE_PASS_GOOD:
+ case ONE_PASS_BEST:
+ return 0;
+
+ case TWO_PASS_FIRST:
+ return 1;
+
+ case TWO_PASS_SECOND_GOOD:
+ case TWO_PASS_SECOND_BEST:
+ return 2;
+ }
+ return -1;
+}
+
void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
VP9_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
@@ -690,34 +707,9 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
assert(cm->bit_depth > BITS_8);
cpi->oxcf = *oxcf;
-
- switch (cpi->oxcf.mode) {
- // Real time and one pass deprecated in test code base
- case ONE_PASS_GOOD:
- cpi->pass = 0;
- break;
-
- case ONE_PASS_BEST:
- cpi->pass = 0;
- break;
-
- case TWO_PASS_FIRST:
- cpi->pass = 1;
- break;
-
- case TWO_PASS_SECOND_GOOD:
- cpi->pass = 2;
- break;
-
- case TWO_PASS_SECOND_BEST:
- cpi->pass = 2;
- break;
-
- case REALTIME:
- cpi->pass = 0;
- cpi->oxcf.play_alternate = 0;
- break;
- }
+ cpi->pass = get_pass(cpi->oxcf.mode);
+ if (cpi->oxcf.mode == REALTIME)
+ cpi->oxcf.play_alternate = 0;
cpi->oxcf.lossless = oxcf->lossless;
if (cpi->oxcf.lossless) {