summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorMinghai Shang <minghai@google.com>2014-02-26 13:30:50 -0800
committerMinghai Shang <minghai@google.com>2014-02-26 13:30:50 -0800
commit8c196b27b317e8c588e7af82a9a38cd48b4cb08b (patch)
tree447bc789b44a48cc53af4125ae81ee97370a5ce7 /vp9
parentc79bd22a5f83ce2a2a2a9d9fe37d409c098c41d7 (diff)
downloadlibvpx-8c196b27b317e8c588e7af82a9a38cd48b4cb08b.tar
libvpx-8c196b27b317e8c588e7af82a9a38cd48b4cb08b.tar.gz
libvpx-8c196b27b317e8c588e7af82a9a38cd48b4cb08b.tar.bz2
libvpx-8c196b27b317e8c588e7af82a9a38cd48b4cb08b.zip
[svc] Add target bitrate settings for each layers.
Change-Id: Ia7677fb436667bc4f76db71f65e4784f433f7826
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_onyx.h2
-rw-r--r--vp9/vp9_cx_iface.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/vp9/common/vp9_onyx.h b/vp9/common/vp9_onyx.h
index ab27ca523..222086886 100644
--- a/vp9/common/vp9_onyx.h
+++ b/vp9/common/vp9_onyx.h
@@ -149,6 +149,8 @@ extern "C" {
// Spatial and temporal scalability.
int ss_number_layers; // Number of spatial layers.
int ts_number_layers; // Number of temporal layers.
+ // Bitrate allocation for spatial layers.
+ int ss_target_bitrate[VPX_SS_MAX_LAYERS];
// Bitrate allocation (CBR mode) and framerate factor, for temporal layers.
int ts_target_bitrate[VPX_TS_MAX_LAYERS];
int ts_rate_decimator[VPX_TS_MAX_LAYERS];
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index a4162e942..d7713fd3f 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -355,6 +355,13 @@ static vpx_codec_err_t set_vp9e_config(VP9_CONFIG *oxcf,
oxcf->ss_number_layers = cfg.ss_number_layers;
+ if (oxcf->ss_number_layers > 1) {
+ memcpy(oxcf->ss_target_bitrate, cfg.ss_target_bitrate,
+ sizeof(cfg.ss_target_bitrate));
+ } else if (oxcf->ss_number_layers == 1) {
+ oxcf->ss_target_bitrate[0] = oxcf->target_bandwidth;
+ }
+
oxcf->ts_number_layers = cfg.ts_number_layers;
if (oxcf->ts_number_layers > 1) {
@@ -1160,6 +1167,7 @@ static vpx_codec_enc_cfg_map_t vp9e_usage_cfg_map[] = {
9999, /* kf_max_dist */
VPX_SS_DEFAULT_LAYERS, /* ss_number_layers */
+ {0}, /* ss_target_bitrate */
1, /* ts_number_layers */
{0}, /* ts_target_bitrate */
{0}, /* ts_rate_decimator */