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

@ -51,7 +51,6 @@ const int16_t WebRtcCng_kCorrWindow[WEBRTC_CNG_MAX_LPC_ORDER] = {
ComfortNoiseDecoder::ComfortNoiseDecoder() {
/* Needed to get the right function pointers in SPLIB. */
WebRtcSpl_Init();
Reset();
}
@ -217,8 +216,6 @@ ComfortNoiseEncoder::ComfortNoiseEncoder(int fs, int interval, int quality)
enc_seed_(7777) /* For debugging only. */ {
RTC_CHECK_GT(quality, 0);
RTC_CHECK_LE(quality, WEBRTC_CNG_MAX_LPC_ORDER);
/* Needed to get the right function pointers in SPLIB. */
WebRtcSpl_Init();
}
void ComfortNoiseEncoder::Reset(int fs, int interval, int quality) {

View File

@ -53,7 +53,6 @@ int16_t WebRtcIlbcfix_DecoderAssign(IlbcDecoderInstance** iLBC_decinst,
int16_t WebRtcIlbcfix_EncoderCreate(IlbcEncoderInstance **iLBC_encinst) {
*iLBC_encinst=(IlbcEncoderInstance*)malloc(sizeof(IlbcEncoder));
if (*iLBC_encinst!=NULL) {
WebRtcSpl_Init();
return(0);
} else {
return(-1);
@ -63,7 +62,6 @@ int16_t WebRtcIlbcfix_EncoderCreate(IlbcEncoderInstance **iLBC_encinst) {
int16_t WebRtcIlbcfix_DecoderCreate(IlbcDecoderInstance **iLBC_decinst) {
*iLBC_decinst=(IlbcDecoderInstance*)malloc(sizeof(IlbcDecoder));
if (*iLBC_decinst!=NULL) {
WebRtcSpl_Init();
return(0);
} else {
return(-1);

View File

@ -109,7 +109,6 @@ int16_t WebRtcIsacfix_Create(ISACFIX_MainStruct **ISAC_main_inst)
(*(ISACFIX_SubStruct**)ISAC_main_inst)->errorcode = 0;
(*(ISACFIX_SubStruct**)ISAC_main_inst)->initflag = 0;
(*(ISACFIX_SubStruct**)ISAC_main_inst)->ISACenc_obj.SaveEnc_ptr = NULL;
WebRtcSpl_Init();
WebRtcIsacfix_InitBandwidthEstimator(&tempo->bwestimator_obj);
return(0);
} else {

View File

@ -138,8 +138,6 @@ static const int16_t time2spec_out_expected_2[kSamples] = {
class TransformTest : public ::testing::Test {
protected:
TransformTest() { WebRtcSpl_Init(); }
// Pass a function pointer to the Tester function.
void Time2SpecTester(Time2Spec Time2SpecFunction) {
// WebRtcIsacfix_Time2Spec functions hard coded the buffer lengths. It's a