Cleanup expired field trial WebRTC-VoIPChannelRemixingAdjustmentKillSwitch
Bug: chromium:40108588 Change-Id: Ifc334819dd486ac791b5d04faa6d6bd77a481dd7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349644 Reviewed-by: Per Åhgren <peah@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42668}
This commit is contained in:
parent
35f10a083d
commit
f065ff85e2
@ -29,7 +29,6 @@ rtc_library("audio_frame_operations") {
|
|||||||
"../../rtc_base:checks",
|
"../../rtc_base:checks",
|
||||||
"../../rtc_base:logging",
|
"../../rtc_base:logging",
|
||||||
"../../rtc_base:safe_conversions",
|
"../../rtc_base:safe_conversions",
|
||||||
"../../system_wrappers:field_trial",
|
|
||||||
"//third_party/abseil-cpp/absl/base:core_headers",
|
"//third_party/abseil-cpp/absl/base:core_headers",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -49,7 +48,6 @@ if (rtc_include_tests) {
|
|||||||
"../../rtc_base:logging",
|
"../../rtc_base:logging",
|
||||||
"../../rtc_base:macromagic",
|
"../../rtc_base:macromagic",
|
||||||
"../../rtc_base:stringutils",
|
"../../rtc_base:stringutils",
|
||||||
"../../test:field_trial",
|
|
||||||
"../../test:test_support",
|
"../../test:test_support",
|
||||||
"//testing/gtest",
|
"//testing/gtest",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -17,18 +17,11 @@
|
|||||||
#include "audio/utility/channel_mixer.h"
|
#include "audio/utility/channel_mixer.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
#include "system_wrappers/include/field_trial.h"
|
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Selects the default usage of VoIP channel mapping adjustments.
|
|
||||||
bool UseChannelMappingAdjustmentsByDefault() {
|
|
||||||
return !field_trial::IsEnabled(
|
|
||||||
"WebRTC-VoIPChannelRemixingAdjustmentKillSwitch");
|
|
||||||
}
|
|
||||||
|
|
||||||
ChannelLayout CheckInputLayout(ChannelLayout input_layout,
|
ChannelLayout CheckInputLayout(ChannelLayout input_layout,
|
||||||
ChannelLayout output_layout) {
|
ChannelLayout output_layout) {
|
||||||
// Special case for 5.0, 5.1 with back channels when upmixed to 7.0, 7.1,
|
// Special case for 5.0, 5.1 with back channels when upmixed to 7.0, 7.1,
|
||||||
@ -81,9 +74,7 @@ ChannelMixingMatrix::ChannelMixingMatrix(ChannelLayout input_layout,
|
|||||||
int input_channels,
|
int input_channels,
|
||||||
ChannelLayout output_layout,
|
ChannelLayout output_layout,
|
||||||
int output_channels)
|
int output_channels)
|
||||||
: use_voip_channel_mapping_adjustments_(
|
: input_layout_(CheckInputLayout(input_layout, output_layout)),
|
||||||
UseChannelMappingAdjustmentsByDefault()),
|
|
||||||
input_layout_(CheckInputLayout(input_layout, output_layout)),
|
|
||||||
input_channels_(input_channels),
|
input_channels_(input_channels),
|
||||||
output_layout_(output_layout),
|
output_layout_(output_layout),
|
||||||
output_channels_(output_channels) {
|
output_channels_(output_channels) {
|
||||||
@ -123,8 +114,7 @@ bool ChannelMixingMatrix::CreateTransformationMatrix(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If specified, use adjusted channel mapping for the VoIP scenario.
|
// If specified, use adjusted channel mapping for the VoIP scenario.
|
||||||
if (use_voip_channel_mapping_adjustments_ &&
|
if (input_layout_ == CHANNEL_LAYOUT_MONO &&
|
||||||
input_layout_ == CHANNEL_LAYOUT_MONO &&
|
|
||||||
ChannelLayoutToChannelCount(output_layout_) >= 2) {
|
ChannelLayoutToChannelCount(output_layout_) >= 2) {
|
||||||
// Only place the mono input in the front left and right channels.
|
// Only place the mono input in the front left and right channels.
|
||||||
(*matrix_)[0][0] = 1.f;
|
(*matrix_)[0][0] = 1.f;
|
||||||
|
|||||||
@ -36,8 +36,6 @@ class ChannelMixingMatrix {
|
|||||||
bool CreateTransformationMatrix(std::vector<std::vector<float>>* matrix);
|
bool CreateTransformationMatrix(std::vector<std::vector<float>>* matrix);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const bool use_voip_channel_mapping_adjustments_;
|
|
||||||
|
|
||||||
// Result transformation of input channels to output channels
|
// Result transformation of input channels to output channels
|
||||||
std::vector<std::vector<float>>* matrix_;
|
std::vector<std::vector<float>>* matrix_;
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
#include "rtc_base/arraysize.h"
|
#include "rtc_base/arraysize.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
#include "rtc_base/strings/string_builder.h"
|
#include "rtc_base/strings/string_builder.h"
|
||||||
#include "test/field_trial.h"
|
|
||||||
#include "test/gtest.h"
|
#include "test/gtest.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
@ -125,32 +124,7 @@ TEST(ChannelMixingMatrixTest, MonoToStereo) {
|
|||||||
EXPECT_EQ(1.0f, matrix[1][0]);
|
EXPECT_EQ(1.0f, matrix[1][0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ChannelMixingMatrixTest, MonoToTwoOneWithoutVoIPAdjustments) {
|
TEST(ChannelMixingMatrixTest, MonoToTwoOne) {
|
||||||
test::ScopedFieldTrials field_trials(
|
|
||||||
"WebRTC-VoIPChannelRemixingAdjustmentKillSwitch/Enabled/");
|
|
||||||
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
|
||||||
ChannelLayout output_layout = CHANNEL_LAYOUT_2_1;
|
|
||||||
ChannelMixingMatrix matrix_builder(
|
|
||||||
input_layout, ChannelLayoutToChannelCount(input_layout), output_layout,
|
|
||||||
ChannelLayoutToChannelCount(output_layout));
|
|
||||||
std::vector<std::vector<float>> matrix;
|
|
||||||
bool remapping = matrix_builder.CreateTransformationMatrix(&matrix);
|
|
||||||
|
|
||||||
// Input: mono
|
|
||||||
// CENTER
|
|
||||||
// Output: 2.1 FRONT_LEFT 1
|
|
||||||
// FRONT_RIGHT 1
|
|
||||||
// BACK_CENTER 0
|
|
||||||
//
|
|
||||||
EXPECT_FALSE(remapping);
|
|
||||||
EXPECT_EQ(3u, matrix.size());
|
|
||||||
EXPECT_EQ(1u, matrix[0].size());
|
|
||||||
EXPECT_EQ(1.0f, matrix[0][0]);
|
|
||||||
EXPECT_EQ(1.0f, matrix[1][0]);
|
|
||||||
EXPECT_EQ(0.0f, matrix[2][0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(ChannelMixingMatrixTest, MonoToTwoOneWithVoIPAdjustments) {
|
|
||||||
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
||||||
ChannelLayout output_layout = CHANNEL_LAYOUT_2_1;
|
ChannelLayout output_layout = CHANNEL_LAYOUT_2_1;
|
||||||
ChannelMixingMatrix matrix_builder(
|
ChannelMixingMatrix matrix_builder(
|
||||||
@ -173,39 +147,7 @@ TEST(ChannelMixingMatrixTest, MonoToTwoOneWithVoIPAdjustments) {
|
|||||||
EXPECT_EQ(0.0f, matrix[2][0]);
|
EXPECT_EQ(0.0f, matrix[2][0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ChannelMixingMatrixTest, MonoToFiveOneWithoutVoIPAdjustments) {
|
TEST(ChannelMixingMatrixTest, MonoToFiveOne) {
|
||||||
test::ScopedFieldTrials field_trials(
|
|
||||||
"WebRTC-VoIPChannelRemixingAdjustmentKillSwitch/Enabled/");
|
|
||||||
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
|
||||||
ChannelLayout output_layout = CHANNEL_LAYOUT_5_1;
|
|
||||||
const int input_channels = ChannelLayoutToChannelCount(input_layout);
|
|
||||||
const int output_channels = ChannelLayoutToChannelCount(output_layout);
|
|
||||||
ChannelMixingMatrix matrix_builder(input_layout, input_channels,
|
|
||||||
output_layout, output_channels);
|
|
||||||
std::vector<std::vector<float>> matrix;
|
|
||||||
bool remapping = matrix_builder.CreateTransformationMatrix(&matrix);
|
|
||||||
// Input: mono
|
|
||||||
// CENTER
|
|
||||||
// Output: 5.1 LEFT 0
|
|
||||||
// RIGHT 0
|
|
||||||
// CENTER 1
|
|
||||||
// LFE 0
|
|
||||||
// SIDE_LEFT 0
|
|
||||||
// SIDE_RIGHT 0
|
|
||||||
//
|
|
||||||
EXPECT_TRUE(remapping);
|
|
||||||
EXPECT_EQ(static_cast<size_t>(output_channels), matrix.size());
|
|
||||||
for (int n = 0; n < output_channels; n++) {
|
|
||||||
EXPECT_EQ(static_cast<size_t>(input_channels), matrix[n].size());
|
|
||||||
if (n == CENTER) {
|
|
||||||
EXPECT_EQ(1.0f, matrix[CENTER][0]);
|
|
||||||
} else {
|
|
||||||
EXPECT_EQ(0.0f, matrix[n][0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(ChannelMixingMatrixTest, MonoToFiveOneWithVoIPAdjustments) {
|
|
||||||
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
||||||
ChannelLayout output_layout = CHANNEL_LAYOUT_5_1;
|
ChannelLayout output_layout = CHANNEL_LAYOUT_5_1;
|
||||||
const int input_channels = ChannelLayoutToChannelCount(input_layout);
|
const int input_channels = ChannelLayoutToChannelCount(input_layout);
|
||||||
@ -235,41 +177,7 @@ TEST(ChannelMixingMatrixTest, MonoToFiveOneWithVoIPAdjustments) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ChannelMixingMatrixTest, MonoToSevenOneWithoutVoIPAdjustments) {
|
TEST(ChannelMixingMatrixTest, MonoToSevenOne) {
|
||||||
test::ScopedFieldTrials field_trials(
|
|
||||||
"WebRTC-VoIPChannelRemixingAdjustmentKillSwitch/Enabled/");
|
|
||||||
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
|
||||||
ChannelLayout output_layout = CHANNEL_LAYOUT_7_1;
|
|
||||||
const int input_channels = ChannelLayoutToChannelCount(input_layout);
|
|
||||||
const int output_channels = ChannelLayoutToChannelCount(output_layout);
|
|
||||||
ChannelMixingMatrix matrix_builder(input_layout, input_channels,
|
|
||||||
output_layout, output_channels);
|
|
||||||
std::vector<std::vector<float>> matrix;
|
|
||||||
bool remapping = matrix_builder.CreateTransformationMatrix(&matrix);
|
|
||||||
// Input: mono
|
|
||||||
// CENTER
|
|
||||||
// Output: 7.1 LEFT 0
|
|
||||||
// RIGHT 0
|
|
||||||
// CENTER 1
|
|
||||||
// LFE 0
|
|
||||||
// SIDE_LEFT 0
|
|
||||||
// SIDE_RIGHT 0
|
|
||||||
// BACK_LEFT 0
|
|
||||||
// BACK_RIGHT 0
|
|
||||||
//
|
|
||||||
EXPECT_TRUE(remapping);
|
|
||||||
EXPECT_EQ(static_cast<size_t>(output_channels), matrix.size());
|
|
||||||
for (int n = 0; n < output_channels; n++) {
|
|
||||||
EXPECT_EQ(static_cast<size_t>(input_channels), matrix[n].size());
|
|
||||||
if (n == CENTER) {
|
|
||||||
EXPECT_EQ(1.0f, matrix[CENTER][0]);
|
|
||||||
} else {
|
|
||||||
EXPECT_EQ(0.0f, matrix[n][0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(ChannelMixingMatrixTest, MonoToSevenOneWithVoIPAdjustments) {
|
|
||||||
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
|
||||||
ChannelLayout output_layout = CHANNEL_LAYOUT_7_1;
|
ChannelLayout output_layout = CHANNEL_LAYOUT_7_1;
|
||||||
const int input_channels = ChannelLayoutToChannelCount(input_layout);
|
const int input_channels = ChannelLayoutToChannelCount(input_layout);
|
||||||
|
|||||||
@ -865,9 +865,6 @@ POLICY_EXEMPT_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([
|
|||||||
FieldTrial('WebRTC-VideoRateControl',
|
FieldTrial('WebRTC-VideoRateControl',
|
||||||
42220259,
|
42220259,
|
||||||
INDEFINITE),
|
INDEFINITE),
|
||||||
FieldTrial('WebRTC-VoIPChannelRemixingAdjustmentKillSwitch',
|
|
||||||
40108588,
|
|
||||||
date(2024, 4, 1)),
|
|
||||||
FieldTrial('WebRTC-Vp9ExternalRefCtrl',
|
FieldTrial('WebRTC-Vp9ExternalRefCtrl',
|
||||||
42234783,
|
42234783,
|
||||||
date(2024, 4, 1)),
|
date(2024, 4, 1)),
|
||||||
@ -884,7 +881,7 @@ POLICY_EXEMPT_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([
|
|||||||
]) # yapf: disable
|
]) # yapf: disable
|
||||||
|
|
||||||
POLICY_EXEMPT_FIELD_TRIALS_DIGEST: str = \
|
POLICY_EXEMPT_FIELD_TRIALS_DIGEST: str = \
|
||||||
'ad853beba9dddb16d9f45164a8d69b5d01e7d1c9'
|
'a3a5347c082f66bf6c338b8fed783ebff5a50561'
|
||||||
|
|
||||||
REGISTERED_FIELD_TRIALS: FrozenSet[FieldTrial] = ACTIVE_FIELD_TRIALS.union(
|
REGISTERED_FIELD_TRIALS: FrozenSet[FieldTrial] = ACTIVE_FIELD_TRIALS.union(
|
||||||
POLICY_EXEMPT_FIELD_TRIALS)
|
POLICY_EXEMPT_FIELD_TRIALS)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user