summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2013-12-20 10:28:09 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-12-20 10:28:09 -0800
commit68cdbfe50ef7035c84ab98be1c4c01d7202e5106 (patch)
treee2c9761979f069b253b3c58076dbcc5e538bb5a1
parent6afd37aa151e6b617a458d774b47d387c590a590 (diff)
parent5ba4b16c2df952a7e3a88e8dfb213f697f2bf121 (diff)
downloadlibvpx-68cdbfe50ef7035c84ab98be1c4c01d7202e5106.tar
libvpx-68cdbfe50ef7035c84ab98be1c4c01d7202e5106.tar.gz
libvpx-68cdbfe50ef7035c84ab98be1c4c01d7202e5106.tar.bz2
libvpx-68cdbfe50ef7035c84ab98be1c4c01d7202e5106.zip
Merge "Initialize avg_frame_qindex to worst_allowed for 1 pass."
-rw-r--r--vp9/encoder/vp9_onyx_if.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index f52e680a6..fb5fb334c 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -1094,12 +1094,18 @@ static void init_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
// Initialize active best and worst q and average q values.
cpi->rc.active_worst_quality = cpi->oxcf.worst_allowed_q;
- cpi->rc.avg_frame_qindex[0] = (cpi->oxcf.worst_allowed_q +
- cpi->oxcf.best_allowed_q) / 2;
- cpi->rc.avg_frame_qindex[1] = (cpi->oxcf.worst_allowed_q +
- cpi->oxcf.best_allowed_q) / 2;
- cpi->rc.avg_frame_qindex[2] = (cpi->oxcf.worst_allowed_q +
- cpi->oxcf.best_allowed_q) / 2;
+ if (cpi->pass == 0 && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ cpi->rc.avg_frame_qindex[0] = cpi->oxcf.worst_allowed_q;
+ cpi->rc.avg_frame_qindex[1] = cpi->oxcf.worst_allowed_q;
+ cpi->rc.avg_frame_qindex[2] = cpi->oxcf.worst_allowed_q;
+ } else {
+ cpi->rc.avg_frame_qindex[0] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ cpi->rc.avg_frame_qindex[1] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ cpi->rc.avg_frame_qindex[2] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ }
cpi->rc.last_q[0] = cpi->oxcf.best_allowed_q;
cpi->rc.last_q[1] = cpi->oxcf.best_allowed_q;
cpi->rc.last_q[2] = cpi->oxcf.best_allowed_q;