Delete unused methods
Bug: none Change-Id: I4ebd0d0c1be0bb1cabc2757cdfe82f0515f8a7da Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351544 Reviewed-by: Per Åhgren <peah@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42417}
This commit is contained in:
parent
933357ec0e
commit
19510f861f
@ -201,57 +201,5 @@ TEST(AudioUtilTest, DownmixInterleavedToMono) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(AudioUtilTest, DownmixToMonoTest) {
|
||||
{
|
||||
const size_t kNumFrames = 4;
|
||||
const int kNumChannels = 1;
|
||||
const float input_data[kNumChannels][kNumFrames] = {{1.f, 2.f, -1.f, -3.f}};
|
||||
const float* input[kNumChannels];
|
||||
for (int i = 0; i < kNumChannels; ++i) {
|
||||
input[i] = input_data[i];
|
||||
}
|
||||
|
||||
float downmixed[kNumFrames];
|
||||
|
||||
DownmixToMono<float, float>(input, kNumFrames, kNumChannels, downmixed);
|
||||
|
||||
EXPECT_THAT(downmixed, ElementsAreArray(input_data[0]));
|
||||
}
|
||||
{
|
||||
const size_t kNumFrames = 3;
|
||||
const int kNumChannels = 2;
|
||||
const float input_data[kNumChannels][kNumFrames] = {{1.f, 2.f, -1.f},
|
||||
{3.f, 0.f, 1.f}};
|
||||
const float* input[kNumChannels];
|
||||
for (int i = 0; i < kNumChannels; ++i) {
|
||||
input[i] = input_data[i];
|
||||
}
|
||||
|
||||
float downmixed[kNumFrames];
|
||||
const float expected[kNumFrames] = {2.f, 1.f, 0.f};
|
||||
|
||||
DownmixToMono<float, float>(input, kNumFrames, kNumChannels, downmixed);
|
||||
|
||||
EXPECT_THAT(downmixed, ElementsAreArray(expected));
|
||||
}
|
||||
{
|
||||
const size_t kNumFrames = 3;
|
||||
const int kNumChannels = 3;
|
||||
const int16_t input_data[kNumChannels][kNumFrames] = {
|
||||
{30000, -5, -30000}, {30000, -10, -30999}, {24001, -20, -30000}};
|
||||
const int16_t* input[kNumChannels];
|
||||
for (int i = 0; i < kNumChannels; ++i) {
|
||||
input[i] = input_data[i];
|
||||
}
|
||||
|
||||
int16_t downmixed[kNumFrames];
|
||||
const int16_t expected[kNumFrames] = {28000, -11, -30333};
|
||||
|
||||
DownmixToMono<int16_t, int32_t>(input, kNumFrames, kNumChannels, downmixed);
|
||||
|
||||
EXPECT_THAT(downmixed, ElementsAreArray(expected));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
@ -149,26 +149,9 @@ void Interleave(const DeinterleavedView<const T>& deinterleaved,
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: b/335805780 - Accept DeInterleavedView and MonoView.
|
||||
// Possibly just delete this method if it isn't used.
|
||||
template <typename T, typename Intermediate>
|
||||
void DownmixToMono(const T* const* input_channels,
|
||||
size_t num_frames,
|
||||
int num_channels,
|
||||
T* out) {
|
||||
for (size_t i = 0; i < num_frames; ++i) {
|
||||
Intermediate value = input_channels[0][i];
|
||||
for (int j = 1; j < num_channels; ++j) {
|
||||
value += input_channels[j][i];
|
||||
}
|
||||
out[i] = value / num_channels;
|
||||
}
|
||||
}
|
||||
|
||||
// Downmixes an interleaved multichannel signal to a single channel by averaging
|
||||
// all channels.
|
||||
// TODO: b/335805780 - Accept InterleavedView and DeinterleavedView.
|
||||
// Possibly just delete this method if it isn't used.
|
||||
template <typename T, typename Intermediate>
|
||||
void DownmixInterleavedToMonoImpl(const T* interleaved,
|
||||
size_t num_frames,
|
||||
|
||||
@ -223,12 +223,6 @@ void AcmReceiver::FlushBuffers() {
|
||||
neteq_->FlushBuffers();
|
||||
}
|
||||
|
||||
void AcmReceiver::RemoveAllCodecs() {
|
||||
MutexLock lock(&mutex_);
|
||||
neteq_->RemoveAllPayloadTypes();
|
||||
last_decoder_ = absl::nullopt;
|
||||
}
|
||||
|
||||
absl::optional<uint32_t> AcmReceiver::GetPlayoutTimestamp() {
|
||||
return neteq_->GetPlayoutTimestamp();
|
||||
}
|
||||
|
||||
@ -168,11 +168,6 @@ class AcmReceiver {
|
||||
//
|
||||
void FlushBuffers();
|
||||
|
||||
//
|
||||
// Remove all registered codecs.
|
||||
//
|
||||
void RemoveAllCodecs();
|
||||
|
||||
// Returns the RTP timestamp for the last sample delivered by GetAudio().
|
||||
// The return value will be empty if no valid timestamp is available.
|
||||
absl::optional<uint32_t> GetPlayoutTimestamp();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user