Enable field trial LegacySimulcastLayerLimit by default

When using simulcast, if the source is too small, it might end up generating
layer sizes that are problematic for hardware encoders.

We can temporarily restore the old behavior that adapts the layer count to the source size until we fix the HW encoder behavior.
to fix HW encoder issues

Bug: webrtc:10849, chromium:990823
Change-Id: Ie1486c9209b408c797c92d1b319d4116fe77171b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148069
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28761}
This commit is contained in:
Florent Castelli 2019-08-05 17:12:20 +02:00 committed by Commit Bot
parent 45231be79c
commit 9b1700cfae
2 changed files with 11 additions and 8 deletions

View File

@ -183,7 +183,8 @@ int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& layers) {
}
int LimitSimulcastLayerCount(int width, int height, int layer_count) {
if (webrtc::field_trial::IsEnabled(kUseLegacySimulcastLayerLimitFieldTrial)) {
if (!webrtc::field_trial::IsDisabled(
kUseLegacySimulcastLayerLimitFieldTrial)) {
int adaptive_layer_count =
kSimulcastFormats[FindSimulcastFormatIndex(width, height)].max_layers;
if (layer_count > adaptive_layer_count) {

View File

@ -140,20 +140,22 @@ TEST(SimulcastTest, GetConfigWithLimitedMaxLayers) {
}
TEST(SimulcastTest, GetConfigWithLimitedMaxLayersForResolution) {
test::ScopedFieldTrials field_trials(
"WebRTC-LegacySimulcastLayerLimit/Enabled/");
const size_t kMaxLayers = 3;
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
kMaxLayers, 800, 600, kBitratePriority, kQpMax, !kScreenshare);
EXPECT_EQ(3u, streams.size());
EXPECT_EQ(200u, streams[0].width);
EXPECT_EQ(150u, streams[0].height);
EXPECT_EQ(400u, streams[1].width);
EXPECT_EQ(300u, streams[1].height);
EXPECT_EQ(800u, streams[2].width);
EXPECT_EQ(600u, streams[2].height);
EXPECT_EQ(2u, streams.size());
EXPECT_EQ(400u, streams[0].width);
EXPECT_EQ(300u, streams[0].height);
EXPECT_EQ(800u, streams[1].width);
EXPECT_EQ(600u, streams[1].height);
}
TEST(SimulcastTest, GetConfigWithNotLimitedMaxLayersForResolution) {
test::ScopedFieldTrials field_trials(
"WebRTC-LegacySimulcastLayerLimit/Disabled/");
const size_t kMaxLayers = 3;
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
kMaxLayers, 800, 600, kBitratePriority, kQpMax, !kScreenshare);