Delete obsolete isac "assign" api

Bug: None
Change-Id: I116e3f4b89e2c1e1f0d06e2ff5d58d2a50e2aadb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153665
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29239}
This commit is contained in:
Niels Möller
2019-09-19 14:37:59 +02:00
committed by Commit Bot
parent d8ffbb0bc4
commit 6a092637f0
7 changed files with 6 additions and 200 deletions

View File

@ -23,34 +23,6 @@ typedef struct {
extern "C" {
#endif
/**************************************************************************
* WebRtcIsacfix_AssignSize(...)
*
* Functions used when malloc is not allowed
* Output the number of bytes needed to allocate for iSAC struct.
*
*/
int16_t WebRtcIsacfix_AssignSize(int* sizeinbytes);
/**************************************************************************
* WebRtcIsacfix_Assign(...)
*
* Functions used when malloc is not allowed, it
* places a struct at the given address.
*
* Input:
* - *ISAC_main_inst : a pointer to the coder instance.
* - ISACFIX_inst_Addr : address of the memory where a space is
* for iSAC structure.
*
* Return value : 0 - Ok
* -1 - Error
*/
int16_t WebRtcIsacfix_Assign(ISACFIX_MainStruct** inst,
void* ISACFIX_inst_Addr);
/****************************************************************************
* WebRtcIsacfix_Create(...)
*

View File

@ -48,45 +48,6 @@ static void InitializeDecoderBitstream(size_t stream_size_bytes,
memset(bitstream->stream, 0, sizeof(bitstream->stream));
}
/**************************************************************************
* WebRtcIsacfix_AssignSize(...)
*
* Functions used when malloc is not allowed
* Returns number of bytes needed to allocate for iSAC struct.
*
*/
int16_t WebRtcIsacfix_AssignSize(int *sizeinbytes) {
*sizeinbytes=sizeof(ISACFIX_SubStruct)*2/sizeof(int16_t);
return(0);
}
/***************************************************************************
* WebRtcIsacfix_Assign(...)
*
* Functions used when malloc is not allowed
* Place struct at given address
*
* If successful, Return 0, else Return -1
*/
int16_t WebRtcIsacfix_Assign(ISACFIX_MainStruct **inst, void *ISACFIX_inst_Addr) {
if (ISACFIX_inst_Addr!=NULL) {
ISACFIX_SubStruct* self = ISACFIX_inst_Addr;
*inst = (ISACFIX_MainStruct*)self;
self->errorcode = 0;
self->initflag = 0;
self->ISACenc_obj.SaveEnc_ptr = NULL;
WebRtcIsacfix_InitBandwidthEstimator(&self->bwestimator_obj);
return(0);
} else {
return(-1);
}
}
#ifndef ISACFIX_NO_DYNAMIC_MEM
/****************************************************************************
* WebRtcIsacfix_Create(...)
*
@ -147,10 +108,6 @@ int16_t WebRtcIsacfix_CreateInternal(ISACFIX_MainStruct *ISAC_main_inst)
}
#endif
/****************************************************************************
* WebRtcIsacfix_Free(...)
*

View File

@ -538,16 +538,8 @@ TEST(IsacFixTest, Kenny) {
/* Initialize the ISAC and BN structs */
if (testNum != 8) {
if (1) {
err = WebRtcIsacfix_Create(&ISAC_main_inst);
} else {
/* Test the Assign functions */
int sss;
void* ppp;
err = WebRtcIsacfix_AssignSize(&sss);
ppp = malloc(sss);
err = WebRtcIsacfix_Assign(&ISAC_main_inst, ppp);
}
err = WebRtcIsacfix_Create(&ISAC_main_inst);
/* Error check */
if (err < 0) {
printf("\n\n Error in create.\n\n");

View File

@ -21,42 +21,6 @@ typedef struct WebRtcISACStruct ISACStruct;
extern "C" {
#endif
/******************************************************************************
* WebRtcIsac_AssignSize(...)
*
* This function returns the size of the ISAC instance, so that the instance
* can be created outside iSAC.
*
* Input:
* - samplingRate : sampling rate of the input/output audio.
*
* Output:
* - sizeinbytes : number of bytes needed to allocate for the
* instance.
*
* Return value : 0 - Ok
* -1 - Error
*/
int16_t WebRtcIsac_AssignSize(int* sizeinbytes);
/******************************************************************************
* WebRtcIsac_Assign(...)
*
* This function assignes the memory already created to the ISAC instance.
*
* Input:
* - *ISAC_main_inst : a pointer to the coder instance.
* - samplingRate : sampling rate of the input/output audio.
* - ISAC_inst_Addr : the already allocated memory, where we put the
* iSAC structure.
*
* Return value : 0 - Ok
* -1 - Error
*/
int16_t WebRtcIsac_Assign(ISACStruct** ISAC_main_inst, void* ISAC_inst_Addr);
/******************************************************************************
* WebRtcIsac_Create(...)
*

View File

@ -206,62 +206,6 @@ static void GetSendBandwidthInfo(ISACMainStruct* instISAC,
}
/****************************************************************************
* WebRtcIsac_AssignSize(...)
*
* This function returns the size of the ISAC instance, so that the instance
* can be created out side iSAC.
*
* Output:
* - sizeinbytes : number of bytes needed to allocate for the
* instance.
*
* Return value : 0 - Ok
* -1 - Error
*/
int16_t WebRtcIsac_AssignSize(int* sizeInBytes) {
*sizeInBytes = sizeof(ISACMainStruct) * 2 / sizeof(int16_t);
return 0;
}
/****************************************************************************
* WebRtcIsac_Assign(...)
*
* This function assigns the memory already created to the ISAC instance.
*
* Input:
* - ISAC_main_inst : address of the pointer to the coder instance.
* - instISAC_Addr : the already allocated memory, where we put the
* iSAC structure.
*
* Return value : 0 - Ok
* -1 - Error
*/
int16_t WebRtcIsac_Assign(ISACStruct** ISAC_main_inst,
void* instISAC_Addr) {
if (instISAC_Addr != NULL) {
ISACMainStruct* instISAC = (ISACMainStruct*)instISAC_Addr;
instISAC->errorCode = 0;
instISAC->initFlag = 0;
/* Assign the address. */
*ISAC_main_inst = (ISACStruct*)instISAC_Addr;
/* Default is wideband. */
instISAC->encoderSamplingRateKHz = kIsacWideband;
instISAC->decoderSamplingRateKHz = kIsacWideband;
instISAC->bandwidthKHz = isac8kHz;
instISAC->in_sample_rate_hz = 16000;
WebRtcIsac_InitTransform(&instISAC->transform_tables);
return 0;
} else {
return -1;
}
}
/****************************************************************************
* WebRtcIsac_Create(...)
*

View File

@ -91,7 +91,6 @@ int main(int argc, char* argv[]) {
size_t maxStreamLen60 = 0;
short sampFreqKHz = 32;
short samplesIn10Ms;
short useAssign = 0;
// FILE logFile;
bool doTransCoding = false;
int32_t rateTransCoding = 0;
@ -186,7 +185,6 @@ int main(int argc, char* argv[]) {
/* Loop over all command line arguments */
CodingMode = 0;
testNum = 0;
useAssign = 0;
// logFile = NULL;
char transCodingFileName[500];
int16_t totFileLoop = 0;
@ -210,11 +208,6 @@ int main(int argc, char* argv[]) {
strcpy(transCodingFileName, argv[i]);
}
/*Should we use assign API*/
if (!strcmp("-assign", argv[i])) {
useAssign = 1;
}
/* Set Sampling Rate */
if (!strcmp("-FS", argv[i])) {
i++;
@ -452,22 +445,10 @@ int main(int argc, char* argv[]) {
/* Initialize the ISAC and BN structs */
if (testNum != 8) {
if (!useAssign) {
err = WebRtcIsac_Create(&ISAC_main_inst);
WebRtcIsac_SetEncSampRate(ISAC_main_inst, sampFreqKHz * 1000);
WebRtcIsac_SetDecSampRate(ISAC_main_inst,
sampFreqKHz >= 32 ? 32000 : 16000);
} else {
/* Test the Assign functions */
int sss;
void* ppp;
err = WebRtcIsac_AssignSize(&sss);
ppp = malloc(sss);
err = WebRtcIsac_Assign(&ISAC_main_inst, ppp);
WebRtcIsac_SetEncSampRate(ISAC_main_inst, sampFreqKHz * 1000);
WebRtcIsac_SetDecSampRate(ISAC_main_inst,
sampFreqKHz >= 32 ? 32000 : 16000);
}
err = WebRtcIsac_Create(&ISAC_main_inst);
WebRtcIsac_SetEncSampRate(ISAC_main_inst, sampFreqKHz * 1000);
WebRtcIsac_SetDecSampRate(ISAC_main_inst,
sampFreqKHz >= 32 ? 32000 : 16000);
/* Error check */
if (err < 0) {
printf("\n\n Error in create.\n\n");

View File

@ -110,9 +110,6 @@ int main(int argc, char* argv[]) {
/* handling wrong input arguments in the command line */
if (argc < 5) {
int size;
WebRtcIsac_AssignSize(&size);
printf("\n\nWrong number of arguments or flag values.\n\n");
printf("Usage:\n\n");
@ -140,7 +137,6 @@ int main(int argc, char* argv[]) {
printf("-dec............ the input file is a bit-stream, decode it.\n\n");
printf("Example usage:\n\n");
printf("%s speechIn.pcm speechOut.pcm -B 40000 -fs 32\n\n", argv[0]);
printf("structure size %d bytes\n", size);
exit(0);
}