Initialize signal processing function pointers statically

The last run-time logic for selecting function pointers was removed in
May 2016, here: https://codereview.webrtc.org/1955413003

It would be even better if we could eliminate the function pointers
entirely and just have different implementations that we select at
compile time; I've left a TODO asking for this.

Bug: webrtc:9553
Change-Id: Ica71d71e19759da00967168f6479b7eb8b46c590
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144053
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28414}
This commit is contained in:
Karl Wiberg
2019-06-28 14:51:49 +02:00
committed by Commit Bot
parent a47ba4119f
commit 225842ced8
17 changed files with 76 additions and 179 deletions

View File

@ -83,7 +83,6 @@ class ExpandTest : public ::testing::Test {
&statistics_,
test_sample_rate_hz_,
num_channels_) {
WebRtcSpl_Init();
input_file_.set_output_rate_hz(test_sample_rate_hz_);
}

View File

@ -133,7 +133,6 @@ NetEqImpl::NetEqImpl(const NetEq::Config& config,
last_output_sample_rate_hz_ = fs;
output_size_samples_ = static_cast<size_t>(kOutputSizeMs * 8 * fs_mult_);
decoder_frame_length_ = 3 * output_size_samples_;
WebRtcSpl_Init();
if (create_components) {
SetSampleRateAndChannels(fs, 1); // Default is 1 channel.
}

View File

@ -55,7 +55,6 @@ TEST(Normal, CreateAndDestroy) {
}
TEST(Normal, AvoidDivideByZero) {
WebRtcSpl_Init();
MockDecoderDatabase db;
int fs = 8000;
size_t channels = 1;
@ -91,7 +90,6 @@ TEST(Normal, AvoidDivideByZero) {
}
TEST(Normal, InputLengthAndChannelsDoNotMatch) {
WebRtcSpl_Init();
MockDecoderDatabase db;
int fs = 8000;
size_t channels = 2;
@ -116,7 +114,6 @@ TEST(Normal, InputLengthAndChannelsDoNotMatch) {
}
TEST(Normal, LastModeExpand120msPacket) {
WebRtcSpl_Init();
MockDecoderDatabase db;
const int kFs = 48000;
const size_t kPacketsizeBytes = 11520u;

View File

@ -65,7 +65,6 @@ class TimeStretchTest : public ::testing::Test {
block_size_(30 * sample_rate_hz_ / 1000), // 30 ms
audio_(new int16_t[block_size_]),
background_noise_(kNumChannels) {
WebRtcSpl_Init();
}
const int16_t* Next30Ms() {