summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/vp9_spatial_svc_encoder.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/vp9_spatial_svc_encoder.c b/examples/vp9_spatial_svc_encoder.c
index ccc9ebdd8..4531a9ea4 100644
--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -670,7 +670,10 @@ int main(int argc, const char **argv) {
die("Failed to initialize encoder\n");
#if OUTPUT_RC_STATS
+ rc.window_count = 1;
rc.window_size = 15; // Silence a static analysis warning.
+ rc.avg_st_encoding_bitrate = 0.0;
+ rc.variance_st_encoding_bitrate = 0.0;
if (svc_ctx.output_rc_stat) {
set_rate_control_stats(&rc, &enc_cfg);
framerate = enc_cfg.g_timebase.den / enc_cfg.g_timebase.num;
@@ -763,6 +766,17 @@ int main(int argc, const char **argv) {
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
layer_id.temporal_layer_id];
}
+ } else {
+ // For the fixed pattern SVC, temporal layer is given by superframe count.
+ unsigned int tl = 0;
+ if (enc_cfg.ts_number_layers == 2)
+ tl = (frame_cnt % 2 != 0);
+ else if (enc_cfg.ts_number_layers == 3) {
+ if (frame_cnt % 2 != 0) tl = 2;
+ if ((frame_cnt > 1) && ((frame_cnt - 2) % 4 == 0)) tl = 1;
+ }
+ for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl)
+ ++rc.layer_input_frames[sl * enc_cfg.ts_number_layers + tl];
}
vpx_usec_timer_start(&timer);
@@ -805,8 +819,6 @@ int main(int argc, const char **argv) {
VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
int num_layers_encoded = 0;
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
- ++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
- layer_id.temporal_layer_id];
sizes[sl] = 0;
if (cx_pkt->data.frame.spatial_layer_encoded[sl]) {
sizes[sl] = sizes_parsed[num_layers_encoded];