To fix warnings in test files.
Review URL: http://webrtc-codereview.appspot.com/169001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@641 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -57,7 +57,6 @@ int main(int argc, char* argv[])
|
|||||||
WebRtc_Word16 stream_len = 0;
|
WebRtc_Word16 stream_len = 0;
|
||||||
WebRtc_Word16 shortdata[480];
|
WebRtc_Word16 shortdata[480];
|
||||||
WebRtc_Word16 decoded[480];
|
WebRtc_Word16 decoded[480];
|
||||||
WebRtc_Word16 decoded2[480];
|
|
||||||
WebRtc_Word16 streamdata[500];
|
WebRtc_Word16 streamdata[500];
|
||||||
WebRtc_Word16 speechType[1];
|
WebRtc_Word16 speechType[1];
|
||||||
char law[2];
|
char law[2];
|
||||||
@@ -168,4 +167,3 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -391,13 +391,14 @@ int main(int argc, char* argv[])
|
|||||||
printf("No value provided for BottleNeck and cannot read file %s\n", bottleneck_file);
|
printf("No value provided for BottleNeck and cannot read file %s\n", bottleneck_file);
|
||||||
exit(0);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
|
int aux_var;
|
||||||
printf("reading bottleneck rates from file %s\n\n",bottleneck_file);
|
printf("reading bottleneck rates from file %s\n\n",bottleneck_file);
|
||||||
if (fscanf(f_bn, "%d", &bottleneck) == EOF) {
|
if (fscanf(f_bn, "%d", &aux_var) == EOF) {
|
||||||
/* Set pointer to beginning of file */
|
/* Set pointer to beginning of file */
|
||||||
fseek(f_bn, 0L, SEEK_SET);
|
fseek(f_bn, 0L, SEEK_SET);
|
||||||
fscanf(f_bn, "%d", &bottleneck);
|
fscanf(f_bn, "%d", &aux_var);
|
||||||
}
|
}
|
||||||
|
bottleneck = (WebRtc_Word16)aux_var;
|
||||||
/* Bottleneck is a cosine function
|
/* Bottleneck is a cosine function
|
||||||
* Matlab code for writing the bottleneck file:
|
* Matlab code for writing the bottleneck file:
|
||||||
* BottleNeck_10ms = 20e3 + 10e3 * cos((0:5999)/5999*2*pi);
|
* BottleNeck_10ms = 20e3 + 10e3 * cos((0:5999)/5999*2*pi);
|
||||||
@@ -635,11 +636,13 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
/* read next bottleneck rate */
|
/* read next bottleneck rate */
|
||||||
if (f_bn != NULL) {
|
if (f_bn != NULL) {
|
||||||
if (fscanf(f_bn, "%d", &bottleneck) == EOF) {
|
int aux_var;
|
||||||
|
if (fscanf(f_bn, "%d", &aux_var) == EOF) {
|
||||||
/* Set pointer to beginning of file */
|
/* Set pointer to beginning of file */
|
||||||
fseek(f_bn, 0L, SEEK_SET);
|
fseek(f_bn, 0L, SEEK_SET);
|
||||||
fscanf(f_bn, "%d", &bottleneck);
|
fscanf(f_bn, "%d", &aux_var);
|
||||||
}
|
}
|
||||||
|
bottleneck = (WebRtc_Word16)aux_var;
|
||||||
if (CodingMode == 1) {
|
if (CodingMode == 1) {
|
||||||
WebRtcIsacfix_Control(ISAC_main_inst, bottleneck, framesize);
|
WebRtcIsacfix_Control(ISAC_main_inst, bottleneck, framesize);
|
||||||
}
|
}
|
||||||
@@ -838,6 +841,5 @@ int main(int argc, char* argv[])
|
|||||||
WebRtcIsacfix_FreeInternal(ISAC_main_inst);
|
WebRtcIsacfix_FreeInternal(ISAC_main_inst);
|
||||||
}
|
}
|
||||||
WebRtcIsacfix_Free(ISAC_main_inst);
|
WebRtcIsacfix_Free(ISAC_main_inst);
|
||||||
|
return 0;
|
||||||
// exit(0);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ int main(int argc, char* argv[])
|
|||||||
WebRtc_Word16 decodedTC[MAX_FRAMESAMPLES << 1];
|
WebRtc_Word16 decodedTC[MAX_FRAMESAMPLES << 1];
|
||||||
WebRtc_UWord16 streamdata[500];
|
WebRtc_UWord16 streamdata[500];
|
||||||
WebRtc_Word16 speechType[1];
|
WebRtc_Word16 speechType[1];
|
||||||
WebRtc_Word16 prevFrameSize = 1;
|
|
||||||
WebRtc_Word16 rateBPS = 0;
|
WebRtc_Word16 rateBPS = 0;
|
||||||
WebRtc_Word16 fixedFL = 0;
|
WebRtc_Word16 fixedFL = 0;
|
||||||
WebRtc_Word16 payloadSize = 0;
|
WebRtc_Word16 payloadSize = 0;
|
||||||
@@ -85,14 +84,9 @@ int main(int argc, char* argv[])
|
|||||||
int totalbits =0;
|
int totalbits =0;
|
||||||
int totalsmpls =0;
|
int totalsmpls =0;
|
||||||
|
|
||||||
/* For fault test 10, garbage data */
|
|
||||||
//FILE *seedfile;
|
|
||||||
unsigned int random_seed = (unsigned int) time(NULL);//1196764538
|
|
||||||
|
|
||||||
/* If use GNS file */
|
/* If use GNS file */
|
||||||
FILE *fp_gns = NULL;
|
FILE *fp_gns = NULL;
|
||||||
int gns = 0;
|
int gns = 0;
|
||||||
int cur_delay = 0;
|
|
||||||
char gns_file[100];
|
char gns_file[100];
|
||||||
short maxStreamLen30 = 0;
|
short maxStreamLen30 = 0;
|
||||||
short maxStreamLen60 = 0;
|
short maxStreamLen60 = 0;
|
||||||
@@ -107,7 +101,6 @@ int main(int argc, char* argv[])
|
|||||||
FILE* transCodingFile;
|
FILE* transCodingFile;
|
||||||
FILE* transcodingBitstream;
|
FILE* transcodingBitstream;
|
||||||
WebRtc_UWord32 numTransCodingBytes=0;
|
WebRtc_UWord32 numTransCodingBytes=0;
|
||||||
WebRtc_UWord32 numREDTransCodingBytes=0;
|
|
||||||
|
|
||||||
/* only one structure used for ISAC encoder */
|
/* only one structure used for ISAC encoder */
|
||||||
ISACStruct* ISAC_main_inst;
|
ISACStruct* ISAC_main_inst;
|
||||||
@@ -941,7 +934,7 @@ int main(int argc, char* argv[])
|
|||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
printf(" Error: in decoding the transcoded stream");
|
printf(" Error: in decoding the transcoded stream");
|
||||||
cout << fflush;
|
cout << flush;
|
||||||
if(testNum == 0)
|
if(testNum == 0)
|
||||||
{
|
{
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
|
|||||||
@@ -72,12 +72,16 @@ int main(int argc, char* argv[])
|
|||||||
fileNameWB[0] = '\0';
|
fileNameWB[0] = '\0';
|
||||||
fileNameSWB[0] = '\0';
|
fileNameSWB[0] = '\0';
|
||||||
|
|
||||||
|
char myFlag[20];
|
||||||
|
strcpy(myFlag, "-wb");
|
||||||
// READ THE WIDEBAND AND SUPER-WIDEBAND FILE NAMES
|
// READ THE WIDEBAND AND SUPER-WIDEBAND FILE NAMES
|
||||||
if(readParamString(argc, argv, "-wb", fileNameWB, MAX_FILE_NAME) <= 0)
|
if(readParamString(argc, argv, myFlag, fileNameWB, MAX_FILE_NAME) <= 0)
|
||||||
{
|
{
|
||||||
printf("No wideband file is specified");
|
printf("No wideband file is specified");
|
||||||
}
|
}
|
||||||
if(readParamString(argc, argv, "-swb", fileNameSWB, MAX_FILE_NAME) <= 0)
|
|
||||||
|
strcpy(myFlag, "-swb");
|
||||||
|
if(readParamString(argc, argv, myFlag, fileNameSWB, MAX_FILE_NAME) <= 0)
|
||||||
{
|
{
|
||||||
printf("No super-wideband file is specified");
|
printf("No super-wideband file is specified");
|
||||||
}
|
}
|
||||||
@@ -90,7 +94,8 @@ int main(int argc, char* argv[])
|
|||||||
encoderSampRate[1] = kIsacSuperWideband;
|
encoderSampRate[1] = kIsacSuperWideband;
|
||||||
OPEN_FILE_RB(inFile[1], fileNameSWB);
|
OPEN_FILE_RB(inFile[1], fileNameSWB);
|
||||||
|
|
||||||
short codingMode = readSwitch(argc, argv, "-I");
|
strcpy(myFlag, "-I");
|
||||||
|
short codingMode = readSwitch(argc, argv, myFlag);
|
||||||
|
|
||||||
for(clientCntr = 0; clientCntr < NUM_CLIENTS; clientCntr++)
|
for(clientCntr = 0; clientCntr < NUM_CLIENTS; clientCntr++)
|
||||||
{
|
{
|
||||||
@@ -193,8 +198,6 @@ int main(int argc, char* argv[])
|
|||||||
short receiverIdx;
|
short receiverIdx;
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
char rot[4] = {'\\', '|', '/', '-'};
|
|
||||||
unsigned int rotCntr = 0;
|
|
||||||
short num10ms[MAX_NUM_CLIENTS];
|
short num10ms[MAX_NUM_CLIENTS];
|
||||||
memset(num10ms, 0, sizeof(short)*MAX_NUM_CLIENTS);
|
memset(num10ms, 0, sizeof(short)*MAX_NUM_CLIENTS);
|
||||||
FILE* arrivalTimeFile1 = fopen("arrivalTime1.dat", "wb");
|
FILE* arrivalTimeFile1 = fopen("arrivalTime1.dat", "wb");
|
||||||
|
|||||||
@@ -57,12 +57,9 @@ int main(int argc, char* argv[])
|
|||||||
FILE* outp;
|
FILE* outp;
|
||||||
char inname[500];
|
char inname[500];
|
||||||
char outname[500];
|
char outname[500];
|
||||||
char usageFileName[500] = "usage.txt";
|
|
||||||
|
|
||||||
/* Runtime statistics */
|
/* Runtime statistics */
|
||||||
double starttime;
|
double starttime;
|
||||||
double runtime;
|
|
||||||
double length_file;
|
|
||||||
double rate;
|
double rate;
|
||||||
double rateRCU;
|
double rateRCU;
|
||||||
double rateLB;
|
double rateLB;
|
||||||
@@ -87,12 +84,16 @@ int main(int argc, char* argv[])
|
|||||||
WebRtc_Word16 err;
|
WebRtc_Word16 err;
|
||||||
WebRtc_Word16 cur_framesmpls;
|
WebRtc_Word16 cur_framesmpls;
|
||||||
int endfile;
|
int endfile;
|
||||||
|
#ifdef WIN32
|
||||||
|
double length_file;
|
||||||
|
double runtime;
|
||||||
char outDrive[10];
|
char outDrive[10];
|
||||||
char outPath[500];
|
char outPath[500];
|
||||||
char outPrefix[500];
|
char outPrefix[500];
|
||||||
char outSuffix[500];
|
char outSuffix[500];
|
||||||
char bitrateFileName[500];
|
char bitrateFileName[500];
|
||||||
FILE* bitrateFile;
|
FILE* bitrateFile;
|
||||||
|
#endif
|
||||||
FILE* histFile;
|
FILE* histFile;
|
||||||
FILE* averageFile;
|
FILE* averageFile;
|
||||||
int sampFreqKHz;
|
int sampFreqKHz;
|
||||||
@@ -341,6 +342,7 @@ valid values are 8 and 16.\n", sampFreqKHz);
|
|||||||
if(onlyDecode)
|
if(onlyDecode)
|
||||||
{
|
{
|
||||||
WebRtc_UWord8 auxUW8;
|
WebRtc_UWord8 auxUW8;
|
||||||
|
size_t auxSizet;
|
||||||
if(fread(&auxUW8, sizeof(WebRtc_UWord8), 1, inp) < 1)
|
if(fread(&auxUW8, sizeof(WebRtc_UWord8), 1, inp) < 1)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@@ -351,7 +353,8 @@ valid values are 8 and 16.\n", sampFreqKHz);
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
stream_len |= (WebRtc_UWord16)auxUW8;
|
stream_len |= (WebRtc_UWord16)auxUW8;
|
||||||
if(fread(payload, 1, stream_len, inp) < stream_len)
|
auxSizet = (size_t)stream_len;
|
||||||
|
if(fread(payload, 1, auxSizet, inp) < auxSizet)
|
||||||
{
|
{
|
||||||
printf("last payload is corrupted\n");
|
printf("last payload is corrupted\n");
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user