summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2021-02-03 22:09:24 -0800
committerMarco Paniconi <marpan@google.com>2021-02-03 22:12:25 -0800
commit0d8354669ac525a27c78bc8c761e98e0f8c3905c (patch)
treee4935d44cde2d5ba17fcb1592cfb8b12b0a40d49
parent5a4cfa95630ee3ebb5d74cd6c21336492e8707a4 (diff)
downloadlibvpx-0d8354669ac525a27c78bc8c761e98e0f8c3905c.tar.gz
libvpx-0d8354669ac525a27c78bc8c761e98e0f8c3905c.tar.bz2
libvpx-0d8354669ac525a27c78bc8c761e98e0f8c3905c.zip
svc: Fix an existing unittest for flexible mode
The flag update_pattern_ was being set to 0 (because it was set before reset) instead of 1. And the example flexible mode pattern was not setting non-reference frame on top temporal top spatial. Change-Id: I8aee56ce13cc4e0d614126592f9d0f691fe527b0
-rw-r--r--test/svc_datarate_test.cc12
-rw-r--r--vp9/encoder/vp9_svc_layercontext.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/test/svc_datarate_test.cc b/test/svc_datarate_test.cc
index 3af225596..95d82ce54 100644
--- a/test/svc_datarate_test.cc
+++ b/test/svc_datarate_test.cc
@@ -153,8 +153,8 @@ class DatarateOnePassCbrSvc : public OnePassCbrSvc {
ref_frame_config->reference_last[sl] = 1;
ref_frame_config->reference_golden[sl] = 0;
ref_frame_config->reference_alt_ref[sl] = 0;
- ref_frame_config->update_buffer_slot[sl] |=
- 1 << ref_frame_config->alt_fb_idx[sl];
+ // Non reference frame on top temporal top spatial.
+ ref_frame_config->update_buffer_slot[sl] = 0;
}
// Force no update on all spatial layers for temporal enhancement layer
// frames.
@@ -275,8 +275,10 @@ class DatarateOnePassCbrSvc : public OnePassCbrSvc {
layer_id.spatial_layer_id = 0;
layer_id.temporal_layer_id = (video->frame() % 2 != 0);
temporal_layer_id_ = layer_id.temporal_layer_id;
- for (int i = 0; i < number_spatial_layers_; i++)
+ for (int i = 0; i < number_spatial_layers_; i++) {
layer_id.temporal_layer_id_per_spatial[i] = temporal_layer_id_;
+ ref_frame_config.duration[i] = 1;
+ }
encoder->Control(VP9E_SET_SVC_LAYER_ID, &layer_id);
set_frame_flags_bypass_mode(layer_id.temporal_layer_id,
number_spatial_layers_, 0, &ref_frame_config,
@@ -750,14 +752,14 @@ TEST_P(DatarateOnePassCbrSvcSingleBR, OnePassCbrSvc3SL2TLDynamicPatternChange) {
cfg_.g_threads = 1;
cfg_.rc_dropframe_thresh = 30;
cfg_.kf_max_dist = 9999;
- // Change SVC pattern on the fly.
- update_pattern_ = 1;
::libvpx_test::I420VideoSource video("niklas_640_480_30.yuv", 640, 480, 30, 1,
0, 400);
top_sl_width_ = 640;
top_sl_height_ = 480;
cfg_.rc_target_bitrate = 800;
ResetModel();
+ // Change SVC pattern on the fly.
+ update_pattern_ = 1;
AssignLayerBitrates();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
CheckLayerRateTargeting(number_spatial_layers_, number_temporal_layers_, 0.78,
diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c
index b6c7c74e1..f9a0de62a 100644
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -956,7 +956,7 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) {
if (cpi->common.frame_type != KEY_FRAME && !cpi->ext_refresh_last_frame &&
!cpi->ext_refresh_golden_frame && !cpi->ext_refresh_alt_ref_frame)
svc->non_reference_frame = 1;
- // For non-flexible mode, where update_buffer_slot is used, need to check if
+ // For flexible mode, where update_buffer_slot is used, need to check if
// all buffer slots are not refreshed.
if (svc->temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
if (svc->update_buffer_slot[svc->spatial_layer_id] != 0)