Remove unused unreferenced code in webrtc/
The code removed here are .c, .cc and .h files that are not referenced from anywhere else. E.g. if git-grep showed no occurrence of the file it's removed. This process was repeated until no more unreferenced files were present. BUG= R=andrew@webrtc.org, henrike@webrtc.org, phoglund@webrtc.org, stefan@webrtc.org, turaj@webrtc.org, wu@webrtc.org, xians@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1945004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4511 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_TRANSFORM_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_TRANSFORM_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/settings.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
/* Cosine table 1 in Q14 */
|
||||
extern const int16_t kCosTab1[FRAMESAMPLES/2];
|
||||
|
||||
/* Sine table 1 in Q14 */
|
||||
extern const int16_t kSinTab1[FRAMESAMPLES/2];
|
||||
|
||||
/* Cosine table 2 in Q14 */
|
||||
extern const int16_t kCosTab2[FRAMESAMPLES/4];
|
||||
|
||||
/* Sine table 2 in Q14 */
|
||||
extern const int16_t kSinTab2[FRAMESAMPLES/4];
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_TRANSFORM_H_ */
|
||||
@@ -1,173 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
//#include "isac_codec.h"
|
||||
//#include "isac_structs.h"
|
||||
#include "isacfix.h"
|
||||
|
||||
|
||||
#define NUM_CODECS 1
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
FILE *inFileList;
|
||||
FILE *audioFile;
|
||||
FILE *outFile;
|
||||
char audioFileName[501];
|
||||
short audioBuff[960];
|
||||
short encoded[600];
|
||||
short startAudio;
|
||||
short encodedLen;
|
||||
ISACFIX_MainStruct *isac_struct;
|
||||
unsigned long int hist[601];
|
||||
|
||||
// reset the histogram
|
||||
for(short n=0; n < 601; n++)
|
||||
{
|
||||
hist[n] = 0;
|
||||
}
|
||||
|
||||
|
||||
inFileList = fopen(argv[1], "r");
|
||||
if(inFileList == NULL)
|
||||
{
|
||||
printf("Could not open the input file.\n");
|
||||
getchar();
|
||||
exit(-1);
|
||||
}
|
||||
outFile = fopen(argv[2], "w");
|
||||
if(outFile == NULL)
|
||||
{
|
||||
printf("Could not open the histogram file.\n");
|
||||
getchar();
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
short frameSizeMsec = 30;
|
||||
if(argc > 3)
|
||||
{
|
||||
frameSizeMsec = atoi(argv[3]);
|
||||
}
|
||||
|
||||
short audioOffset = 0;
|
||||
if(argc > 4)
|
||||
{
|
||||
audioOffset = atoi(argv[4]);
|
||||
}
|
||||
int ok;
|
||||
ok = WebRtcIsacfix_Create(&isac_struct);
|
||||
// instantaneous mode
|
||||
ok |= WebRtcIsacfix_EncoderInit(isac_struct, 1);
|
||||
// is not used but initialize
|
||||
ok |= WebRtcIsacfix_DecoderInit(isac_struct);
|
||||
ok |= WebRtcIsacfix_Control(isac_struct, 32000, frameSizeMsec);
|
||||
|
||||
if(ok != 0)
|
||||
{
|
||||
printf("\nProblem in seting up iSAC\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
while( fgets(audioFileName, 500, inFileList) != NULL )
|
||||
{
|
||||
// remove trailing white-spaces and any Cntrl character
|
||||
if(strlen(audioFileName) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
short n = strlen(audioFileName) - 1;
|
||||
while(isspace(audioFileName[n]) || iscntrl(audioFileName[n]))
|
||||
{
|
||||
audioFileName[n] = '\0';
|
||||
n--;
|
||||
if(n < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// remove leading spaces
|
||||
if(strlen(audioFileName) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
n = 0;
|
||||
while((isspace(audioFileName[n]) || iscntrl(audioFileName[n])) &&
|
||||
(audioFileName[n] != '\0'))
|
||||
{
|
||||
n++;
|
||||
}
|
||||
memmove(audioFileName, &audioFileName[n], 500 - n);
|
||||
if(strlen(audioFileName) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
audioFile = fopen(audioFileName, "rb");
|
||||
if(audioFile == NULL)
|
||||
{
|
||||
printf("\nCannot open %s!!!!!\n", audioFileName);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if(audioOffset > 0)
|
||||
{
|
||||
fseek(audioFile, (audioOffset<<1), SEEK_SET);
|
||||
}
|
||||
|
||||
while(fread(audioBuff, sizeof(short), (480*frameSizeMsec/30), audioFile) >= (480*frameSizeMsec/30))
|
||||
{
|
||||
startAudio = 0;
|
||||
do
|
||||
{
|
||||
encodedLen = WebRtcIsacfix_Encode(isac_struct,
|
||||
&audioBuff[startAudio], encoded);
|
||||
startAudio += 160;
|
||||
} while(encodedLen == 0);
|
||||
|
||||
if(encodedLen < 0)
|
||||
{
|
||||
printf("\nEncoding Error!!!\n");
|
||||
exit(0);
|
||||
}
|
||||
hist[encodedLen]++;
|
||||
}
|
||||
fclose(audioFile);
|
||||
}
|
||||
fclose(inFileList);
|
||||
unsigned long totalFrames = 0;
|
||||
for(short n=0; n < 601; n++)
|
||||
{
|
||||
totalFrames += hist[n];
|
||||
fprintf(outFile, "%10lu\n", hist[n]);
|
||||
}
|
||||
fclose(outFile);
|
||||
|
||||
short topTenCntr = 0;
|
||||
printf("\nTotal number of Frames %lu\n\n", totalFrames);
|
||||
printf("Payload Len # occurences\n");
|
||||
printf("=========== ============\n");
|
||||
|
||||
for(short n = 600; (n >= 0) && (topTenCntr < 10); n--)
|
||||
{
|
||||
if(hist[n] > 0)
|
||||
{
|
||||
topTenCntr++;
|
||||
printf(" %3d %3d\n", n, hist[n]);
|
||||
}
|
||||
}
|
||||
WebRtcIsacfix_Free(isac_struct);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,260 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
/******************************************************************
|
||||
Stand Alone test application for ISACFIX and ISAC LC
|
||||
|
||||
******************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "typedefs.h"
|
||||
|
||||
#include "isacfix.h"
|
||||
ISACFIX_MainStruct *ISACfix_inst;
|
||||
|
||||
#define FS 16000
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint32_t arrival_time; /* samples */
|
||||
uint32_t sample_count; /* samples */
|
||||
uint16_t rtp_number;
|
||||
} BottleNeckModel;
|
||||
|
||||
void get_arrival_time(int current_framesamples, /* samples */
|
||||
int packet_size, /* bytes */
|
||||
int bottleneck, /* excluding headers; bits/s */
|
||||
BottleNeckModel *BN_data)
|
||||
{
|
||||
const int HeaderSize = 35;
|
||||
int HeaderRate;
|
||||
|
||||
HeaderRate = HeaderSize * 8 * FS / current_framesamples; /* bits/s */
|
||||
|
||||
/* everything in samples */
|
||||
BN_data->sample_count = BN_data->sample_count + current_framesamples;
|
||||
|
||||
BN_data->arrival_time += ((packet_size + HeaderSize) * 8 * FS) / (bottleneck + HeaderRate);
|
||||
|
||||
if (BN_data->arrival_time < BN_data->sample_count)
|
||||
BN_data->arrival_time = BN_data->sample_count;
|
||||
|
||||
BN_data->rtp_number++;
|
||||
}
|
||||
|
||||
/*
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
*/
|
||||
int main(int argc, char* argv[]){
|
||||
|
||||
/* Parameters */
|
||||
FILE *pInFile, *pOutFile, *pChcFile;
|
||||
int8_t inFile[40];
|
||||
int8_t outFile[40];
|
||||
int8_t chcFile[40];
|
||||
int8_t codec[10];
|
||||
int16_t bitrt, spType, size;
|
||||
uint16_t frameLen;
|
||||
int16_t sigOut[1000], sigIn[1000];
|
||||
uint16_t bitStream[500]; /* double to 32 kbps for 60 ms */
|
||||
|
||||
int16_t chc, ok;
|
||||
int noOfCalls, cdlen;
|
||||
int16_t noOfLostFrames;
|
||||
int err, errtype;
|
||||
|
||||
BottleNeckModel BN_data;
|
||||
|
||||
int totalbits =0;
|
||||
int totalsmpls =0;
|
||||
|
||||
/*End Parameters*/
|
||||
|
||||
|
||||
if ((argc==6)||(argc==7) ){
|
||||
|
||||
strcpy(codec,argv[5]);
|
||||
|
||||
if(argc==7){
|
||||
if (!_stricmp("isac",codec)){
|
||||
bitrt = atoi(argv[6]);
|
||||
if ( (bitrt<10000)&&(bitrt>32000)){
|
||||
printf("Error: Supported bit rate in the range 10000-32000 bps!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
}else{
|
||||
printf("Error: Codec not recognized. Check spelling!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
} else {
|
||||
printf("Error: Codec not recognized. Check spelling!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
printf("Error: Wrong number of input parameter!\n\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
frameLen = atoi(argv[4]);
|
||||
strcpy(chcFile,argv[3]);
|
||||
strcpy(outFile,argv[2]);
|
||||
strcpy(inFile,argv[1]);
|
||||
|
||||
/* Open file streams */
|
||||
if( (pInFile = fopen(inFile,"rb")) == NULL ) {
|
||||
printf( "Error: Did not find input file!\n" );
|
||||
exit(-1);
|
||||
}
|
||||
strcat(outFile,"_");
|
||||
strcat(outFile, argv[4]);
|
||||
strcat(outFile,"_");
|
||||
strcat(outFile, codec);
|
||||
|
||||
if (argc==7){
|
||||
strcat(outFile,"_");
|
||||
strcat(outFile, argv[6]);
|
||||
}
|
||||
if (_stricmp("none", chcFile)){
|
||||
strcat(outFile,"_");
|
||||
strcat(outFile, "plc");
|
||||
}
|
||||
|
||||
strcat(outFile, ".otp");
|
||||
|
||||
if (_stricmp("none", chcFile)){
|
||||
if( (pChcFile = fopen(chcFile,"rb")) == NULL ) {
|
||||
printf( "Error: Did not find channel file!\n" );
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
/******************************************************************/
|
||||
if (!_stricmp("isac", codec)){ /* ISAC */
|
||||
if ((frameLen!=480)&&(frameLen!=960)) {
|
||||
printf("Error: ISAC only supports 480 and 960 samples per frame (not %d)\n", frameLen);
|
||||
exit(-1);
|
||||
}
|
||||
if( (pOutFile = fopen(outFile,"wb")) == NULL ) {
|
||||
printf( "Could not open output file!\n" );
|
||||
exit(-1);
|
||||
}
|
||||
ok=WebRtcIsacfix_Create(&ISACfix_inst);
|
||||
if (ok!=0) {
|
||||
printf("Couldn't allocate memory for iSAC fix instance\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
BN_data.arrival_time = 0;
|
||||
BN_data.sample_count = 0;
|
||||
BN_data.rtp_number = 0;
|
||||
|
||||
WebRtcIsacfix_EncoderInit(ISACfix_inst,1);
|
||||
WebRtcIsacfix_DecoderInit(ISACfix_inst);
|
||||
err = WebRtcIsacfix_Control(ISACfix_inst, bitrt, (frameLen>>4));
|
||||
if (err < 0) {
|
||||
/* exit if returned with error */
|
||||
errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst);
|
||||
printf("\n\n Error in initialization: %d.\n\n", errtype);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
/* loop over frame */
|
||||
while (fread(sigIn,sizeof(int16_t),frameLen,pInFile) == frameLen) {
|
||||
|
||||
noOfCalls=0;
|
||||
cdlen=0;
|
||||
while (cdlen<=0) {
|
||||
cdlen=WebRtcIsacfix_Encode(ISACfix_inst,&sigIn[noOfCalls*160],(int16_t*)bitStream);
|
||||
if(cdlen==-1){
|
||||
errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst);
|
||||
printf("\n\nError in encoder: %d.\n\n", errtype);
|
||||
exit(-1);
|
||||
}
|
||||
noOfCalls++;
|
||||
}
|
||||
|
||||
|
||||
if(_stricmp("none", chcFile)){
|
||||
if (fread(&chc,sizeof(int16_t),1,pChcFile)!=1) /* packet may be lost */
|
||||
break;
|
||||
} else {
|
||||
chc = 1; /* packets never lost */
|
||||
}
|
||||
|
||||
/* simulate packet handling through NetEq and the modem */
|
||||
get_arrival_time(frameLen, cdlen, bitrt, &BN_data);
|
||||
|
||||
if (chc){ /* decode */
|
||||
|
||||
err = WebRtcIsacfix_UpdateBwEstimate1(ISACfix_inst,
|
||||
bitStream,
|
||||
cdlen,
|
||||
BN_data.rtp_number,
|
||||
BN_data.arrival_time);
|
||||
|
||||
if (err < 0) {
|
||||
/* exit if returned with error */
|
||||
errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst);
|
||||
printf("\n\nError in decoder: %d.\n\n", errtype);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
size = WebRtcIsacfix_Decode(ISACfix_inst, bitStream, cdlen, sigOut, &spType);
|
||||
if(size<=0){
|
||||
/* exit if returned with error */
|
||||
errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst);
|
||||
printf("\n\nError in decoder: %d.\n\n", errtype);
|
||||
exit(-1);
|
||||
}
|
||||
} else { /* PLC */
|
||||
if (frameLen == 480){
|
||||
noOfLostFrames = 1;
|
||||
} else{
|
||||
noOfLostFrames = 2;
|
||||
}
|
||||
size = WebRtcIsacfix_DecodePlc(ISACfix_inst, sigOut, noOfLostFrames );
|
||||
if(size<=0){
|
||||
errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst);
|
||||
printf("\n\nError in decoder: %d.\n\n", errtype);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Write decoded speech to file */
|
||||
fwrite(sigOut,sizeof(short),size,pOutFile);
|
||||
|
||||
totalbits += 8 * cdlen;
|
||||
totalsmpls += size;
|
||||
|
||||
}
|
||||
/******************************************************************/
|
||||
}
|
||||
|
||||
// printf("\n\ntotal bits = %d bits", totalbits);
|
||||
printf("\nmeasured average bitrate = %0.3f kbits/s", (double)totalbits * 16 / totalsmpls);
|
||||
printf("\n");
|
||||
|
||||
|
||||
fclose(pInFile);
|
||||
fclose(pOutFile);
|
||||
if (_stricmp("none", chcFile)){
|
||||
fclose(pChcFile);
|
||||
}
|
||||
|
||||
if (!_stricmp("isac", codec)){
|
||||
WebRtcIsacfix_Free(ISACfix_inst);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user