Fix VP9 K-SVC full stack tests.

- Added field trial to force issuing of key frame on deactivation of
spatial layer. This fixes video corruptions in VP9 K-SVC tests where
layers can be activated/deactivated on-fly due to bandwidth change.

- Added 100ms network delay to the test with restricted link capacity.
This fixes rapid drop of available bandwidth which happens when
bandwidth overuse is detected in the very beginning of call and several
feedback packets arrive without any delay. Also, this makes the test
more realistic.

- Disabled filtering of spatial layer in the test with restricted
link capacity. 1) We don't really need filtering in this test.
2) It appeared that in video quality tests filtering is done before
sending packets to network simulator. Filtering of high layers causes
channel underuse which is compensated by increase of sent bitrate.
This is why we got sent/media bitrates about 2Mbps in test where link
was limited to 1Mbps.

Bug: chromium:889017
Change-Id: I33ffcee0274523f6183c3bbd27d3d29395417d52
Reviewed-on: https://webrtc-review.googlesource.com/c/103520
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24988}
This commit is contained in:
Sergey Silkin
2018-10-03 18:04:57 +02:00
committed by Commit Bot
parent 8db246a6bb
commit e7ce888abe
3 changed files with 26 additions and 10 deletions

View File

@ -160,6 +160,8 @@ VP9EncoderImpl::VP9EncoderImpl(const cricket::VideoCodec& codec)
num_temporal_layers_(0),
num_spatial_layers_(0),
num_active_spatial_layers_(0),
layer_deactivation_requires_key_frame_(webrtc::field_trial::IsEnabled(
"WebRTC-Vp9IssueKeyFrameOnLayerDeactivation")),
is_svc_(false),
inter_layer_pred_(InterLayerPredMode::kOn),
external_ref_control_(
@ -212,8 +214,12 @@ bool VP9EncoderImpl::SetSvcRates(
config_->rc_target_bitrate = bitrate_allocation.get_sum_kbps();
if (ExplicitlyConfiguredSpatialLayers()) {
const bool layer_activation_requires_key_frame =
inter_layer_pred_ == InterLayerPredMode::kOff ||
inter_layer_pred_ == InterLayerPredMode::kOnKeyPic;
for (size_t sl_idx = 0; sl_idx < num_spatial_layers_; ++sl_idx) {
const bool was_layer_enabled = (config_->ss_target_bitrate[sl_idx] > 0);
const bool was_layer_active = (config_->ss_target_bitrate[sl_idx] > 0);
config_->ss_target_bitrate[sl_idx] =
bitrate_allocation.GetSpatialLayerSum(sl_idx) / 1000;
@ -222,16 +228,16 @@ bool VP9EncoderImpl::SetSvcRates(
bitrate_allocation.GetTemporalLayerSum(sl_idx, tl_idx) / 1000;
}
const bool is_layer_enabled = (config_->ss_target_bitrate[sl_idx] > 0);
if (is_layer_enabled && !was_layer_enabled) {
if (inter_layer_pred_ == InterLayerPredMode::kOff ||
inter_layer_pred_ == InterLayerPredMode::kOnKeyPic) {
// TODO(wemb:1526): remove key frame request when issue is fixed.
force_key_frame_ = true;
}
const bool is_active_layer = (config_->ss_target_bitrate[sl_idx] > 0);
if (!was_layer_active && is_active_layer &&
layer_activation_requires_key_frame) {
force_key_frame_ = true;
} else if (was_layer_active && !is_active_layer &&
layer_deactivation_requires_key_frame_) {
force_key_frame_ = true;
}
if (!was_layer_enabled) {
if (!was_layer_active) {
// Reset frame rate controller if layer is resumed after pause.
framerate_controller_[sl_idx].Reset();
}

View File

@ -115,6 +115,7 @@ class VP9EncoderImpl : public VP9Encoder {
uint8_t num_temporal_layers_;
uint8_t num_spatial_layers_; // Number of configured SLs
uint8_t num_active_spatial_layers_; // Number of actively encoded SLs
bool layer_deactivation_requires_key_frame_;
bool is_svc_;
InterLayerPredMode inter_layer_pred_;
bool external_ref_control_;