Update field trial for allowing cropped resolution when limiting max layers.
Make max_ratio:0.1 default. BUG: webrtc:12459 Change-Id: Ia938836f2b95467fce66a38f2525b1d2be1a352b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206803 Commit-Queue: Åsa Persson <asapersson@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33261}
This commit is contained in:
@ -42,6 +42,8 @@ constexpr webrtc::DataRate Interpolate(const webrtc::DataRate& a,
|
||||
constexpr char kUseLegacySimulcastLayerLimitFieldTrial[] =
|
||||
"WebRTC-LegacySimulcastLayerLimit";
|
||||
|
||||
constexpr double kDefaultMaxRoundupRate = 0.1;
|
||||
|
||||
// TODO(webrtc:12415): Flip this to a kill switch when this feature launches.
|
||||
bool EnableLowresBitrateInterpolation(
|
||||
const webrtc::WebRtcKeyValueConfig& trials) {
|
||||
@ -209,7 +211,7 @@ SimulcastFormat InterpolateSimulcastFormat(
|
||||
static_cast<float>(total_pixels_up - total_pixels_down);
|
||||
|
||||
// Use upper resolution if |rate| is below the configured threshold.
|
||||
size_t max_layers = (max_roundup_rate && rate < max_roundup_rate.value())
|
||||
size_t max_layers = (rate < max_roundup_rate.value_or(kDefaultMaxRoundupRate))
|
||||
? formats[index - 1].max_layers
|
||||
: formats[index].max_layers;
|
||||
webrtc::DataRate max_bitrate = Interpolate(formats[index - 1].max_bitrate,
|
||||
|
||||
@ -377,7 +377,9 @@ TEST(SimulcastTest, BitratesForCloseToStandardResolution) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, MaxLayers) {
|
||||
TEST(SimulcastTest, MaxLayersWithRoundUpDisabled) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
"WebRTC-SimulcastLayerLimitRoundUp/max_ratio:0.0/");
|
||||
FieldTrialBasedConfig trials;
|
||||
const size_t kMinLayers = 1;
|
||||
const int kMaxLayers = 3;
|
||||
@ -403,9 +405,8 @@ TEST(SimulcastTest, MaxLayers) {
|
||||
EXPECT_EQ(1u, streams.size());
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, MaxLayersWithFieldTrial) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
"WebRTC-SimulcastLayerLimitRoundUp/max_ratio:0.1/");
|
||||
TEST(SimulcastTest, MaxLayersWithDefaultRoundUpRatio) {
|
||||
// Default: "WebRTC-SimulcastLayerLimitRoundUp/max_ratio:0.1/"
|
||||
FieldTrialBasedConfig trials;
|
||||
const size_t kMinLayers = 1;
|
||||
const int kMaxLayers = 3;
|
||||
@ -420,7 +421,7 @@ TEST(SimulcastTest, MaxLayersWithFieldTrial) {
|
||||
kBitratePriority, kQpMax, !kScreenshare,
|
||||
true, trials);
|
||||
EXPECT_EQ(3u, streams.size());
|
||||
streams = cricket::GetSimulcastConfig(kMinLayers, kMaxLayers, 960, 510,
|
||||
streams = cricket::GetSimulcastConfig(kMinLayers, kMaxLayers, 960, 508,
|
||||
kBitratePriority, kQpMax, !kScreenshare,
|
||||
true, trials);
|
||||
EXPECT_EQ(2u, streams.size());
|
||||
@ -439,6 +440,29 @@ TEST(SimulcastTest, MaxLayersWithFieldTrial) {
|
||||
EXPECT_EQ(1u, streams.size());
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, MaxLayersWithRoundUpRatio) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
"WebRTC-SimulcastLayerLimitRoundUp/max_ratio:0.13/");
|
||||
FieldTrialBasedConfig trials;
|
||||
const size_t kMinLayers = 1;
|
||||
const int kMaxLayers = 3;
|
||||
|
||||
std::vector<VideoStream> streams;
|
||||
streams = cricket::GetSimulcastConfig(kMinLayers, kMaxLayers, 480, 270,
|
||||
kBitratePriority, kQpMax, !kScreenshare,
|
||||
true, trials);
|
||||
EXPECT_EQ(2u, streams.size());
|
||||
// Lowest cropped height where max layers from higher resolution is used.
|
||||
streams = cricket::GetSimulcastConfig(kMinLayers, kMaxLayers, 480, 252,
|
||||
kBitratePriority, kQpMax, !kScreenshare,
|
||||
true, trials);
|
||||
EXPECT_EQ(2u, streams.size());
|
||||
streams = cricket::GetSimulcastConfig(kMinLayers, kMaxLayers, 480, 250,
|
||||
kBitratePriority, kQpMax, !kScreenshare,
|
||||
true, trials);
|
||||
EXPECT_EQ(1u, streams.size());
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, BitratesInterpolatedForResBelow180p) {
|
||||
// TODO(webrtc:12415): Remove when feature launches.
|
||||
test::ScopedFieldTrials field_trials(
|
||||
|
||||
Reference in New Issue
Block a user