diff options
Diffstat (limited to 'src/modules/audio_coding/codecs/isac/fix/test')
17 files changed, 2855 insertions, 0 deletions
diff --git a/src/modules/audio_coding/codecs/isac/fix/test/ISACHist.cc b/src/modules/audio_coding/codecs/isac/fix/test/ISACHist.cc new file mode 100644 index 0000000000..753acd7e65 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/ISACHist.cc @@ -0,0 +1,173 @@ +/* + * 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; +} + diff --git a/src/modules/audio_coding/codecs/isac/fix/test/Isac_test.cc b/src/modules/audio_coding/codecs/isac/fix/test/Isac_test.cc new file mode 100644 index 0000000000..2791db4512 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/Isac_test.cc @@ -0,0 +1,260 @@ +/* + * 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 { + WebRtc_UWord32 arrival_time; /* samples */ + WebRtc_UWord32 sample_count; /* samples */ + WebRtc_UWord16 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; + WebRtc_Word8 inFile[40]; + WebRtc_Word8 outFile[40]; + WebRtc_Word8 chcFile[40]; + WebRtc_Word8 codec[10]; + WebRtc_Word16 bitrt, spType, size; + WebRtc_UWord16 frameLen; + WebRtc_Word16 sigOut[1000], sigIn[1000]; + WebRtc_UWord16 bitStream[500]; /* double to 32 kbps for 60 ms */ + + WebRtc_Word16 chc, ok; + int noOfCalls, cdlen; + WebRtc_Word16 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(WebRtc_Word16),frameLen,pInFile) == frameLen) { + + noOfCalls=0; + cdlen=0; + while (cdlen<=0) { + cdlen=WebRtcIsacfix_Encode(ISACfix_inst,&sigIn[noOfCalls*160],(WebRtc_Word16*)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(WebRtc_Word16),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; + +} diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/ChannelFiles.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/ChannelFiles.txt new file mode 100644 index 0000000000..05f7410141 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/ChannelFiles.txt @@ -0,0 +1,3 @@ +bottlenecks.txt +lowrates.txt +tworates.txt diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/InputFiles.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/InputFiles.txt new file mode 100644 index 0000000000..f26b7afb6c --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/InputFiles.txt @@ -0,0 +1,31 @@ +DTMF_16kHz_long.pcm +DTMF_16kHz_short.pcm +F00.INP +F01.INP +F02.INP +F03.INP +F04.INP +F05.INP +F06.INP +longtest.pcm +ltest_speech_clean.pcm +ltest_music.pcm +ltest_speech_noisy.pcm +misc2.pcm +purenb.pcm +sawsweep_380_60.pcm +sinesweep.pcm +sinesweep_half.pcm +speechmusic.pcm +speechmusic_nb.pcm +speechoffice0dB.pcm +speech_and_misc_NB.pcm +speech_and_misc_WB.pcm +testM4.pcm +testM4D_rev.pcm +testM4D.pcm +testfile.pcm +tone_cisco.pcm +tone_cisco_long.pcm +wb_contspeech.pcm +wb_speech_office25db.pcm
\ No newline at end of file diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/InputFilesFew.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/InputFilesFew.txt new file mode 100644 index 0000000000..08bbde30d7 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/InputFilesFew.txt @@ -0,0 +1,6 @@ +DTMF_16kHz_short.pcm +ltest_speech_noisy.pcm +misc2.pcm +sinesweep.pcm +speechmusic.pcm +tone_cisco.pcm diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/ListOfTestCases.xls b/src/modules/audio_coding/codecs/isac/fix/test/QA/ListOfTestCases.xls Binary files differnew file mode 100644 index 0000000000..f0889ef4ed --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/ListOfTestCases.xls diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/diffiSAC.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/diffiSAC.txt new file mode 100644 index 0000000000..96b87c066b --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/diffiSAC.txt @@ -0,0 +1,481 @@ +#!/bin/bash +(set -o igncr) 2>/dev/null && set -o igncr; # force bash to ignore \r character + +diff ../dataqa350/i30_1DTMF_16kHz_long.pcm ../dataqa351/i30_1DTMF_16kHz_long.pcm +diff ../dataqa350/i60_1DTMF_16kHz_long.pcm ../dataqa351/i60_1DTMF_16kHz_long.pcm +diff ../dataqa350/i30_2DTMF_16kHz_long.pcm ../dataqa351/i30_2DTMF_16kHz_long.pcm +diff ../dataqa350/i60_2DTMF_16kHz_long.pcm ../dataqa351/i60_2DTMF_16kHz_long.pcm +diff ../dataqa350/i30_3DTMF_16kHz_long.pcm ../dataqa351/i30_3DTMF_16kHz_long.pcm +diff ../dataqa350/i60_3DTMF_16kHz_long.pcm ../dataqa351/i60_3DTMF_16kHz_long.pcm +diff ../dataqa350/i30_4DTMF_16kHz_long.pcm ../dataqa351/i30_4DTMF_16kHz_long.pcm +diff ../dataqa350/i60_4DTMF_16kHz_long.pcm ../dataqa351/i60_4DTMF_16kHz_long.pcm +diff ../dataqa350/i30_5DTMF_16kHz_long.pcm ../dataqa351/i30_5DTMF_16kHz_long.pcm +diff ../dataqa350/i60_5DTMF_16kHz_long.pcm ../dataqa351/i60_5DTMF_16kHz_long.pcm +diff ../dataqa350/i30_6DTMF_16kHz_long.pcm ../dataqa351/i30_6DTMF_16kHz_long.pcm +diff ../dataqa350/i60_6DTMF_16kHz_long.pcm ../dataqa351/i60_6DTMF_16kHz_long.pcm +diff ../dataqa350/a1DTMF_16kHz_long.pcm ../dataqa351/a1DTMF_16kHz_long.pcm +diff ../dataqa350/a2DTMF_16kHz_long.pcm ../dataqa351/a2DTMF_16kHz_long.pcm +diff ../dataqa350/a3DTMF_16kHz_long.pcm ../dataqa351/a3DTMF_16kHz_long.pcm +diff ../dataqa350/i30_7DTMF_16kHz_short.pcm ../dataqa351/i30_7DTMF_16kHz_short.pcm +diff ../dataqa350/i60_7DTMF_16kHz_short.pcm ../dataqa351/i60_7DTMF_16kHz_short.pcm +diff ../dataqa350/i30_8DTMF_16kHz_short.pcm ../dataqa351/i30_8DTMF_16kHz_short.pcm +diff ../dataqa350/i60_8DTMF_16kHz_short.pcm ../dataqa351/i60_8DTMF_16kHz_short.pcm +diff ../dataqa350/i30_9DTMF_16kHz_short.pcm ../dataqa351/i30_9DTMF_16kHz_short.pcm +diff ../dataqa350/i60_9DTMF_16kHz_short.pcm ../dataqa351/i60_9DTMF_16kHz_short.pcm +diff ../dataqa350/i30_10DTMF_16kHz_short.pcm ../dataqa351/i30_10DTMF_16kHz_short.pcm +diff ../dataqa350/i60_10DTMF_16kHz_short.pcm ../dataqa351/i60_10DTMF_16kHz_short.pcm +diff ../dataqa350/i30_11DTMF_16kHz_short.pcm ../dataqa351/i30_11DTMF_16kHz_short.pcm +diff ../dataqa350/i60_11DTMF_16kHz_short.pcm ../dataqa351/i60_11DTMF_16kHz_short.pcm +diff ../dataqa350/i30_12DTMF_16kHz_short.pcm ../dataqa351/i30_12DTMF_16kHz_short.pcm +diff ../dataqa350/i60_12DTMF_16kHz_short.pcm ../dataqa351/i60_12DTMF_16kHz_short.pcm +diff ../dataqa350/a4DTMF_16kHz_short.pcm ../dataqa351/a4DTMF_16kHz_short.pcm +diff ../dataqa350/a5DTMF_16kHz_short.pcm ../dataqa351/a5DTMF_16kHz_short.pcm +diff ../dataqa350/a6DTMF_16kHz_short.pcm ../dataqa351/a6DTMF_16kHz_short.pcm +diff ../dataqa350/i30_13F00.INP ../dataqa350/i30_13F00.INP +diff ../dataqa350/i60_13F00.INP ../dataqa350/i60_13F00.INP +diff ../dataqa350/i30_14F00.INP ../dataqa350/i30_14F00.INP +diff ../dataqa350/i60_14F00.INP ../dataqa350/i60_14F00.INP +diff ../dataqa350/i30_15F00.INP ../dataqa350/i30_15F00.INP +diff ../dataqa350/i60_15F00.INP ../dataqa350/i60_15F00.INP +diff ../dataqa350/i30_16F00.INP ../dataqa350/i30_16F00.INP +diff ../dataqa350/i60_16F00.INP ../dataqa350/i60_16F00.INP +diff ../dataqa350/i30_17F00.INP ../dataqa350/i30_17F00.INP +diff ../dataqa350/i60_17F00.INP ../dataqa350/i60_17F00.INP +diff ../dataqa350/i30_18F00.INP ../dataqa350/i30_18F00.INP +diff ../dataqa350/i60_18F00.INP ../dataqa350/i60_18F00.INP +diff ../dataqa350/a7F00.INP ../dataqa350/a7F00.INP +diff ../dataqa350/a8F00.INP ../dataqa350/a8F00.INP +diff ../dataqa350/a9F00.INP ../dataqa350/a9F00.INP +diff ../dataqa350/i30_19F01.INP ../dataqa350/i30_19F01.INP +diff ../dataqa350/i60_19F01.INP ../dataqa350/i60_19F01.INP +diff ../dataqa350/i30_20F01.INP ../dataqa350/i30_20F01.INP +diff ../dataqa350/i60_20F01.INP ../dataqa350/i60_20F01.INP +diff ../dataqa350/i30_21F01.INP ../dataqa350/i30_21F01.INP +diff ../dataqa350/i60_21F01.INP ../dataqa350/i60_21F01.INP +diff ../dataqa350/i30_22F01.INP ../dataqa350/i30_22F01.INP +diff ../dataqa350/i60_22F01.INP ../dataqa350/i60_22F01.INP +diff ../dataqa350/i30_23F01.INP ../dataqa350/i30_23F01.INP +diff ../dataqa350/i60_23F01.INP ../dataqa350/i60_23F01.INP +diff ../dataqa350/i30_24F01.INP ../dataqa350/i30_24F01.INP +diff ../dataqa350/i60_24F01.INP ../dataqa350/i60_24F01.INP +diff ../dataqa350/a10F01.INP ../dataqa350/a10F01.INP +diff ../dataqa350/a11F01.INP ../dataqa350/a11F01.INP +diff ../dataqa350/a12F01.INP ../dataqa350/a12F01.INP +diff ../dataqa350/i30_25F02.INP ../dataqa350/i30_25F02.INP +diff ../dataqa350/i60_25F02.INP ../dataqa350/i60_25F02.INP +diff ../dataqa350/i30_26F02.INP ../dataqa350/i30_26F02.INP +diff ../dataqa350/i60_26F02.INP ../dataqa350/i60_26F02.INP +diff ../dataqa350/i30_27F02.INP ../dataqa350/i30_27F02.INP +diff ../dataqa350/i60_27F02.INP ../dataqa350/i60_27F02.INP +diff ../dataqa350/i30_28F02.INP ../dataqa350/i30_28F02.INP +diff ../dataqa350/i60_28F02.INP ../dataqa350/i60_28F02.INP +diff ../dataqa350/i30_29F02.INP ../dataqa350/i30_29F02.INP +diff ../dataqa350/i60_29F02.INP ../dataqa350/i60_29F02.INP +diff ../dataqa350/i30_30F02.INP ../dataqa350/i30_30F02.INP +diff ../dataqa350/i60_30F02.INP ../dataqa350/i60_30F02.INP +diff ../dataqa350/a13F02.INP ../dataqa350/a13F02.INP +diff ../dataqa350/a14F02.INP ../dataqa350/a14F02.INP +diff ../dataqa350/a15F02.INP ../dataqa350/a15F02.INP +diff ../dataqa350/i30_31F03.INP ../dataqa350/i30_31F03.INP +diff ../dataqa350/i60_31F03.INP ../dataqa350/i60_31F03.INP +diff ../dataqa350/i30_32F03.INP ../dataqa350/i30_32F03.INP +diff ../dataqa350/i60_32F03.INP ../dataqa350/i60_32F03.INP +diff ../dataqa350/i30_33F03.INP ../dataqa350/i30_33F03.INP +diff ../dataqa350/i60_33F03.INP ../dataqa350/i60_33F03.INP +diff ../dataqa350/i30_34F03.INP ../dataqa350/i30_34F03.INP +diff ../dataqa350/i60_34F03.INP ../dataqa350/i60_34F03.INP +diff ../dataqa350/i30_35F03.INP ../dataqa350/i30_35F03.INP +diff ../dataqa350/i60_35F03.INP ../dataqa350/i60_35F03.INP +diff ../dataqa350/i30_36F03.INP ../dataqa350/i30_36F03.INP +diff ../dataqa350/i60_36F03.INP ../dataqa350/i60_36F03.INP +diff ../dataqa350/a16F03.INP ../dataqa350/a16F03.INP +diff ../dataqa350/a17F03.INP ../dataqa350/a17F03.INP +diff ../dataqa350/a18F03.INP ../dataqa350/a18F03.INP +diff ../dataqa350/i30_37F04.INP ../dataqa350/i30_37F04.INP +diff ../dataqa350/i60_37F04.INP ../dataqa350/i60_37F04.INP +diff ../dataqa350/i30_38F04.INP ../dataqa350/i30_38F04.INP +diff ../dataqa350/i60_38F04.INP ../dataqa350/i60_38F04.INP +diff ../dataqa350/i30_39F04.INP ../dataqa350/i30_39F04.INP +diff ../dataqa350/i60_39F04.INP ../dataqa350/i60_39F04.INP +diff ../dataqa350/i30_40F04.INP ../dataqa350/i30_40F04.INP +diff ../dataqa350/i60_40F04.INP ../dataqa350/i60_40F04.INP +diff ../dataqa350/i30_41F04.INP ../dataqa350/i30_41F04.INP +diff ../dataqa350/i60_41F04.INP ../dataqa350/i60_41F04.INP +diff ../dataqa350/i30_42F04.INP ../dataqa350/i30_42F04.INP +diff ../dataqa350/i60_42F04.INP ../dataqa350/i60_42F04.INP +diff ../dataqa350/a19F04.INP ../dataqa350/a19F04.INP +diff ../dataqa350/a20F04.INP ../dataqa350/a20F04.INP +diff ../dataqa350/a21F04.INP ../dataqa350/a21F04.INP +diff ../dataqa350/i30_43F05.INP ../dataqa350/i30_43F05.INP +diff ../dataqa350/i60_43F05.INP ../dataqa350/i60_43F05.INP +diff ../dataqa350/i30_44F05.INP ../dataqa350/i30_44F05.INP +diff ../dataqa350/i60_44F05.INP ../dataqa350/i60_44F05.INP +diff ../dataqa350/i30_45F05.INP ../dataqa350/i30_45F05.INP +diff ../dataqa350/i60_45F05.INP ../dataqa350/i60_45F05.INP +diff ../dataqa350/i30_46F05.INP ../dataqa350/i30_46F05.INP +diff ../dataqa350/i60_46F05.INP ../dataqa350/i60_46F05.INP +diff ../dataqa350/i30_47F05.INP ../dataqa350/i30_47F05.INP +diff ../dataqa350/i60_47F05.INP ../dataqa350/i60_47F05.INP +diff ../dataqa350/i30_48F05.INP ../dataqa350/i30_48F05.INP +diff ../dataqa350/i60_48F05.INP ../dataqa350/i60_48F05.INP +diff ../dataqa350/a22F05.INP ../dataqa350/a22F05.INP +diff ../dataqa350/a23F05.INP ../dataqa350/a23F05.INP +diff ../dataqa350/a24F05.INP ../dataqa350/a24F05.INP +diff ../dataqa350/i30_49F06.INP ../dataqa350/i30_49F06.INP +diff ../dataqa350/i60_49F06.INP ../dataqa350/i60_49F06.INP +diff ../dataqa350/i30_50F06.INP ../dataqa350/i30_50F06.INP +diff ../dataqa350/i60_50F06.INP ../dataqa350/i60_50F06.INP +diff ../dataqa350/i30_51F06.INP ../dataqa350/i30_51F06.INP +diff ../dataqa350/i60_51F06.INP ../dataqa350/i60_51F06.INP +diff ../dataqa350/i30_52F06.INP ../dataqa350/i30_52F06.INP +diff ../dataqa350/i60_52F06.INP ../dataqa350/i60_52F06.INP +diff ../dataqa350/i30_53F06.INP ../dataqa350/i30_53F06.INP +diff ../dataqa350/i60_53F06.INP ../dataqa350/i60_53F06.INP +diff ../dataqa350/i30_54F06.INP ../dataqa350/i30_54F06.INP +diff ../dataqa350/i60_54F06.INP ../dataqa350/i60_54F06.INP +diff ../dataqa350/a25F06.INP ../dataqa350/a25F06.INP +diff ../dataqa350/a26F06.INP ../dataqa350/a26F06.INP +diff ../dataqa350/a27F06.INP ../dataqa350/a27F06.INP +diff ../dataqa350/i30_55longtest.pcm ../dataqa351/i30_55longtest.pcm +diff ../dataqa350/i60_55longtest.pcm ../dataqa351/i60_55longtest.pcm +diff ../dataqa350/i30_56longtest.pcm ../dataqa351/i30_56longtest.pcm +diff ../dataqa350/i60_56longtest.pcm ../dataqa351/i60_56longtest.pcm +diff ../dataqa350/i30_57longtest.pcm ../dataqa351/i30_57longtest.pcm +diff ../dataqa350/i60_57longtest.pcm ../dataqa351/i60_57longtest.pcm +diff ../dataqa350/i30_58longtest.pcm ../dataqa351/i30_58longtest.pcm +diff ../dataqa350/i60_58longtest.pcm ../dataqa351/i60_58longtest.pcm +diff ../dataqa350/i30_59longtest.pcm ../dataqa351/i30_59longtest.pcm +diff ../dataqa350/i60_59longtest.pcm ../dataqa351/i60_59longtest.pcm +diff ../dataqa350/i30_60longtest.pcm ../dataqa351/i30_60longtest.pcm +diff ../dataqa350/i60_60longtest.pcm ../dataqa351/i60_60longtest.pcm +diff ../dataqa350/a28longtest.pcm ../dataqa351/a28longtest.pcm +diff ../dataqa350/a29longtest.pcm ../dataqa351/a29longtest.pcm +diff ../dataqa350/a30longtest.pcm ../dataqa351/a30longtest.pcm +diff ../dataqa350/i30_61ltest_speech_clean.pcm ../dataqa351/i30_61ltest_speech_clean.pcm +diff ../dataqa350/i60_61ltest_speech_clean.pcm ../dataqa351/i60_61ltest_speech_clean.pcm +diff ../dataqa350/i30_62ltest_speech_clean.pcm ../dataqa351/i30_62ltest_speech_clean.pcm +diff ../dataqa350/i60_62ltest_speech_clean.pcm ../dataqa351/i60_62ltest_speech_clean.pcm +diff ../dataqa350/i30_63ltest_speech_clean.pcm ../dataqa351/i30_63ltest_speech_clean.pcm +diff ../dataqa350/i60_63ltest_speech_clean.pcm ../dataqa351/i60_63ltest_speech_clean.pcm +diff ../dataqa350/i30_64ltest_speech_clean.pcm ../dataqa351/i30_64ltest_speech_clean.pcm +diff ../dataqa350/i60_64ltest_speech_clean.pcm ../dataqa351/i60_64ltest_speech_clean.pcm +diff ../dataqa350/i30_65ltest_speech_clean.pcm ../dataqa351/i30_65ltest_speech_clean.pcm +diff ../dataqa350/i60_65ltest_speech_clean.pcm ../dataqa351/i60_65ltest_speech_clean.pcm +diff ../dataqa350/i30_66ltest_speech_clean.pcm ../dataqa351/i30_66ltest_speech_clean.pcm +diff ../dataqa350/i60_66ltest_speech_clean.pcm ../dataqa351/i60_66ltest_speech_clean.pcm +diff ../dataqa350/a31ltest_speech_clean.pcm ../dataqa351/a31ltest_speech_clean.pcm +diff ../dataqa350/a32ltest_speech_clean.pcm ../dataqa351/a32ltest_speech_clean.pcm +diff ../dataqa350/a33ltest_speech_clean.pcm ../dataqa351/a33ltest_speech_clean.pcm +diff ../dataqa350/i30_67ltest_music.pcm ../dataqa351/i30_67ltest_music.pcm +diff ../dataqa350/i60_67ltest_music.pcm ../dataqa351/i60_67ltest_music.pcm +diff ../dataqa350/i30_68ltest_music.pcm ../dataqa351/i30_68ltest_music.pcm +diff ../dataqa350/i60_68ltest_music.pcm ../dataqa351/i60_68ltest_music.pcm +diff ../dataqa350/i30_69ltest_music.pcm ../dataqa351/i30_69ltest_music.pcm +diff ../dataqa350/i60_69ltest_music.pcm ../dataqa351/i60_69ltest_music.pcm +diff ../dataqa350/i30_70ltest_music.pcm ../dataqa351/i30_70ltest_music.pcm +diff ../dataqa350/i60_70ltest_music.pcm ../dataqa351/i60_70ltest_music.pcm +diff ../dataqa350/i30_71ltest_music.pcm ../dataqa351/i30_71ltest_music.pcm +diff ../dataqa350/i60_71ltest_music.pcm ../dataqa351/i60_71ltest_music.pcm +diff ../dataqa350/i30_72ltest_music.pcm ../dataqa351/i30_72ltest_music.pcm +diff ../dataqa350/i60_72ltest_music.pcm ../dataqa351/i60_72ltest_music.pcm +diff ../dataqa350/a34ltest_music.pcm ../dataqa351/a34ltest_music.pcm +diff ../dataqa350/a35ltest_music.pcm ../dataqa351/a35ltest_music.pcm +diff ../dataqa350/a36ltest_music.pcm ../dataqa351/a36ltest_music.pcm +diff ../dataqa350/i30_73ltest_speech_noisy.pcm ../dataqa351/i30_73ltest_speech_noisy.pcm +diff ../dataqa350/i60_73ltest_speech_noisy.pcm ../dataqa351/i60_73ltest_speech_noisy.pcm +diff ../dataqa350/i30_74ltest_speech_noisy.pcm ../dataqa351/i30_74ltest_speech_noisy.pcm +diff ../dataqa350/i60_74ltest_speech_noisy.pcm ../dataqa351/i60_74ltest_speech_noisy.pcm +diff ../dataqa350/i30_75ltest_speech_noisy.pcm ../dataqa351/i30_75ltest_speech_noisy.pcm +diff ../dataqa350/i60_75ltest_speech_noisy.pcm ../dataqa351/i60_75ltest_speech_noisy.pcm +diff ../dataqa350/i30_76ltest_speech_noisy.pcm ../dataqa351/i30_76ltest_speech_noisy.pcm +diff ../dataqa350/i60_76ltest_speech_noisy.pcm ../dataqa351/i60_76ltest_speech_noisy.pcm +diff ../dataqa350/i30_77ltest_speech_noisy.pcm ../dataqa351/i30_77ltest_speech_noisy.pcm +diff ../dataqa350/i60_77ltest_speech_noisy.pcm ../dataqa351/i60_77ltest_speech_noisy.pcm +diff ../dataqa350/i30_78ltest_speech_noisy.pcm ../dataqa351/i30_78ltest_speech_noisy.pcm +diff ../dataqa350/i60_78ltest_speech_noisy.pcm ../dataqa351/i60_78ltest_speech_noisy.pcm +diff ../dataqa350/a37ltest_speech_noisy.pcm ../dataqa351/a37ltest_speech_noisy.pcm +diff ../dataqa350/a38ltest_speech_noisy.pcm ../dataqa351/a38ltest_speech_noisy.pcm +diff ../dataqa350/a39ltest_speech_noisy.pcm ../dataqa351/a39ltest_speech_noisy.pcm +diff ../dataqa350/i30_79misc2.pcm ../dataqa351/i30_79misc2.pcm +diff ../dataqa350/i60_79misc2.pcm ../dataqa351/i60_79misc2.pcm +diff ../dataqa350/i30_80misc2.pcm ../dataqa351/i30_80misc2.pcm +diff ../dataqa350/i60_80misc2.pcm ../dataqa351/i60_80misc2.pcm +diff ../dataqa350/i30_81misc2.pcm ../dataqa351/i30_81misc2.pcm +diff ../dataqa350/i60_81misc2.pcm ../dataqa351/i60_81misc2.pcm +diff ../dataqa350/i30_82misc2.pcm ../dataqa351/i30_82misc2.pcm +diff ../dataqa350/i60_82misc2.pcm ../dataqa351/i60_82misc2.pcm +diff ../dataqa350/i30_83misc2.pcm ../dataqa351/i30_83misc2.pcm +diff ../dataqa350/i60_83misc2.pcm ../dataqa351/i60_83misc2.pcm +diff ../dataqa350/i30_84misc2.pcm ../dataqa351/i30_84misc2.pcm +diff ../dataqa350/i60_84misc2.pcm ../dataqa351/i60_84misc2.pcm +diff ../dataqa350/a40misc2.pcm ../dataqa351/a40misc2.pcm +diff ../dataqa350/a41misc2.pcm ../dataqa351/a41misc2.pcm +diff ../dataqa350/a42misc2.pcm ../dataqa351/a42misc2.pcm +diff ../dataqa350/i30_85purenb.pcm ../dataqa351/i30_85purenb.pcm +diff ../dataqa350/i60_85purenb.pcm ../dataqa351/i60_85purenb.pcm +diff ../dataqa350/i30_86purenb.pcm ../dataqa351/i30_86purenb.pcm +diff ../dataqa350/i60_86purenb.pcm ../dataqa351/i60_86purenb.pcm +diff ../dataqa350/i30_87purenb.pcm ../dataqa351/i30_87purenb.pcm +diff ../dataqa350/i60_87purenb.pcm ../dataqa351/i60_87purenb.pcm +diff ../dataqa350/i30_88purenb.pcm ../dataqa351/i30_88purenb.pcm +diff ../dataqa350/i60_88purenb.pcm ../dataqa351/i60_88purenb.pcm +diff ../dataqa350/i30_89purenb.pcm ../dataqa351/i30_89purenb.pcm +diff ../dataqa350/i60_89purenb.pcm ../dataqa351/i60_89purenb.pcm +diff ../dataqa350/i30_90purenb.pcm ../dataqa351/i30_90purenb.pcm +diff ../dataqa350/i60_90purenb.pcm ../dataqa351/i60_90purenb.pcm +diff ../dataqa350/a43purenb.pcm ../dataqa351/a43purenb.pcm +diff ../dataqa350/a44purenb.pcm ../dataqa351/a44purenb.pcm +diff ../dataqa350/a45purenb.pcm ../dataqa351/a45purenb.pcm +diff ../dataqa350/i30_91sawsweep_380_60.pcm ../dataqa351/i30_91sawsweep_380_60.pcm +diff ../dataqa350/i60_91sawsweep_380_60.pcm ../dataqa351/i60_91sawsweep_380_60.pcm +diff ../dataqa350/i30_92sawsweep_380_60.pcm ../dataqa351/i30_92sawsweep_380_60.pcm +diff ../dataqa350/i60_92sawsweep_380_60.pcm ../dataqa351/i60_92sawsweep_380_60.pcm +diff ../dataqa350/i30_93sawsweep_380_60.pcm ../dataqa351/i30_93sawsweep_380_60.pcm +diff ../dataqa350/i60_93sawsweep_380_60.pcm ../dataqa351/i60_93sawsweep_380_60.pcm +diff ../dataqa350/i30_94sawsweep_380_60.pcm ../dataqa351/i30_94sawsweep_380_60.pcm +diff ../dataqa350/i60_94sawsweep_380_60.pcm ../dataqa351/i60_94sawsweep_380_60.pcm +diff ../dataqa350/i30_95sawsweep_380_60.pcm ../dataqa351/i30_95sawsweep_380_60.pcm +diff ../dataqa350/i60_95sawsweep_380_60.pcm ../dataqa351/i60_95sawsweep_380_60.pcm +diff ../dataqa350/i30_96sawsweep_380_60.pcm ../dataqa351/i30_96sawsweep_380_60.pcm +diff ../dataqa350/i60_96sawsweep_380_60.pcm ../dataqa351/i60_96sawsweep_380_60.pcm +diff ../dataqa350/a46sawsweep_380_60.pcm ../dataqa351/a46sawsweep_380_60.pcm +diff ../dataqa350/a47sawsweep_380_60.pcm ../dataqa351/a47sawsweep_380_60.pcm +diff ../dataqa350/a48sawsweep_380_60.pcm ../dataqa351/a48sawsweep_380_60.pcm +diff ../dataqa350/i30_97sinesweep.pcm ../dataqa351/i30_97sinesweep.pcm +diff ../dataqa350/i60_97sinesweep.pcm ../dataqa351/i60_97sinesweep.pcm +diff ../dataqa350/i30_98sinesweep.pcm ../dataqa351/i30_98sinesweep.pcm +diff ../dataqa350/i60_98sinesweep.pcm ../dataqa351/i60_98sinesweep.pcm +diff ../dataqa350/i30_99sinesweep.pcm ../dataqa351/i30_99sinesweep.pcm +diff ../dataqa350/i60_99sinesweep.pcm ../dataqa351/i60_99sinesweep.pcm +diff ../dataqa350/i30_100sinesweep.pcm ../dataqa351/i30_100sinesweep.pcm +diff ../dataqa350/i60_100sinesweep.pcm ../dataqa351/i60_100sinesweep.pcm +diff ../dataqa350/i30_101sinesweep.pcm ../dataqa351/i30_101sinesweep.pcm +diff ../dataqa350/i60_101sinesweep.pcm ../dataqa351/i60_101sinesweep.pcm +diff ../dataqa350/i30_102sinesweep.pcm ../dataqa351/i30_102sinesweep.pcm +diff ../dataqa350/i60_102sinesweep.pcm ../dataqa351/i60_102sinesweep.pcm +diff ../dataqa350/a49sinesweep.pcm ../dataqa351/a49sinesweep.pcm +diff ../dataqa350/a50sinesweep.pcm ../dataqa351/a50sinesweep.pcm +diff ../dataqa350/a51sinesweep.pcm ../dataqa351/a51sinesweep.pcm +diff ../dataqa350/i30_103sinesweep_half.pcm ../dataqa351/i30_103sinesweep_half.pcm +diff ../dataqa350/i60_103sinesweep_half.pcm ../dataqa351/i60_103sinesweep_half.pcm +diff ../dataqa350/i30_104sinesweep_half.pcm ../dataqa351/i30_104sinesweep_half.pcm +diff ../dataqa350/i60_104sinesweep_half.pcm ../dataqa351/i60_104sinesweep_half.pcm +diff ../dataqa350/i30_105sinesweep_half.pcm ../dataqa351/i30_105sinesweep_half.pcm +diff ../dataqa350/i60_105sinesweep_half.pcm ../dataqa351/i60_105sinesweep_half.pcm +diff ../dataqa350/i30_106sinesweep_half.pcm ../dataqa351/i30_106sinesweep_half.pcm +diff ../dataqa350/i60_106sinesweep_half.pcm ../dataqa351/i60_106sinesweep_half.pcm +diff ../dataqa350/i30_107sinesweep_half.pcm ../dataqa351/i30_107sinesweep_half.pcm +diff ../dataqa350/i60_107sinesweep_half.pcm ../dataqa351/i60_107sinesweep_half.pcm +diff ../dataqa350/i30_108sinesweep_half.pcm ../dataqa351/i30_108sinesweep_half.pcm +diff ../dataqa350/i60_108sinesweep_half.pcm ../dataqa351/i60_108sinesweep_half.pcm +diff ../dataqa350/a52sinesweep_half.pcm ../dataqa351/a52sinesweep_half.pcm +diff ../dataqa350/a53sinesweep_half.pcm ../dataqa351/a53sinesweep_half.pcm +diff ../dataqa350/a54sinesweep_half.pcm ../dataqa351/a54sinesweep_half.pcm +diff ../dataqa350/i30_109speechmusic.pcm ../dataqa351/i30_109speechmusic.pcm +diff ../dataqa350/i60_109speechmusic.pcm ../dataqa351/i60_109speechmusic.pcm +diff ../dataqa350/i30_110speechmusic.pcm ../dataqa351/i30_110speechmusic.pcm +diff ../dataqa350/i60_110speechmusic.pcm ../dataqa351/i60_110speechmusic.pcm +diff ../dataqa350/i30_111speechmusic.pcm ../dataqa351/i30_111speechmusic.pcm +diff ../dataqa350/i60_111speechmusic.pcm ../dataqa351/i60_111speechmusic.pcm +diff ../dataqa350/i30_112speechmusic.pcm ../dataqa351/i30_112speechmusic.pcm +diff ../dataqa350/i60_112speechmusic.pcm ../dataqa351/i60_112speechmusic.pcm +diff ../dataqa350/i30_113speechmusic.pcm ../dataqa351/i30_113speechmusic.pcm +diff ../dataqa350/i60_113speechmusic.pcm ../dataqa351/i60_113speechmusic.pcm +diff ../dataqa350/i30_114speechmusic.pcm ../dataqa351/i30_114speechmusic.pcm +diff ../dataqa350/i60_114speechmusic.pcm ../dataqa351/i60_114speechmusic.pcm +diff ../dataqa350/a55speechmusic.pcm ../dataqa351/a55speechmusic.pcm +diff ../dataqa350/a56speechmusic.pcm ../dataqa351/a56speechmusic.pcm +diff ../dataqa350/a57speechmusic.pcm ../dataqa351/a57speechmusic.pcm +diff ../dataqa350/i30_115speechmusic_nb.pcm ../dataqa351/i30_115speechmusic_nb.pcm +diff ../dataqa350/i60_115speechmusic_nb.pcm ../dataqa351/i60_115speechmusic_nb.pcm +diff ../dataqa350/i30_116speechmusic_nb.pcm ../dataqa351/i30_116speechmusic_nb.pcm +diff ../dataqa350/i60_116speechmusic_nb.pcm ../dataqa351/i60_116speechmusic_nb.pcm +diff ../dataqa350/i30_117speechmusic_nb.pcm ../dataqa351/i30_117speechmusic_nb.pcm +diff ../dataqa350/i60_117speechmusic_nb.pcm ../dataqa351/i60_117speechmusic_nb.pcm +diff ../dataqa350/i30_118speechmusic_nb.pcm ../dataqa351/i30_118speechmusic_nb.pcm +diff ../dataqa350/i60_118speechmusic_nb.pcm ../dataqa351/i60_118speechmusic_nb.pcm +diff ../dataqa350/i30_119speechmusic_nb.pcm ../dataqa351/i30_119speechmusic_nb.pcm +diff ../dataqa350/i60_119speechmusic_nb.pcm ../dataqa351/i60_119speechmusic_nb.pcm +diff ../dataqa350/i30_120speechmusic_nb.pcm ../dataqa351/i30_120speechmusic_nb.pcm +diff ../dataqa350/i60_120speechmusic_nb.pcm ../dataqa351/i60_120speechmusic_nb.pcm +diff ../dataqa350/a58speechmusic_nb.pcm ../dataqa351/a58speechmusic_nb.pcm +diff ../dataqa350/a59speechmusic_nb.pcm ../dataqa351/a59speechmusic_nb.pcm +diff ../dataqa350/a60speechmusic_nb.pcm ../dataqa351/a60speechmusic_nb.pcm +diff ../dataqa350/i30_121speechoffice0dB.pcm ../dataqa351/i30_121speechoffice0dB.pcm +diff ../dataqa350/i60_121speechoffice0dB.pcm ../dataqa351/i60_121speechoffice0dB.pcm +diff ../dataqa350/i30_122speechoffice0dB.pcm ../dataqa351/i30_122speechoffice0dB.pcm +diff ../dataqa350/i60_122speechoffice0dB.pcm ../dataqa351/i60_122speechoffice0dB.pcm +diff ../dataqa350/i30_123speechoffice0dB.pcm ../dataqa351/i30_123speechoffice0dB.pcm +diff ../dataqa350/i60_123speechoffice0dB.pcm ../dataqa351/i60_123speechoffice0dB.pcm +diff ../dataqa350/i30_124speechoffice0dB.pcm ../dataqa351/i30_124speechoffice0dB.pcm +diff ../dataqa350/i60_124speechoffice0dB.pcm ../dataqa351/i60_124speechoffice0dB.pcm +diff ../dataqa350/i30_125speechoffice0dB.pcm ../dataqa351/i30_125speechoffice0dB.pcm +diff ../dataqa350/i60_125speechoffice0dB.pcm ../dataqa351/i60_125speechoffice0dB.pcm +diff ../dataqa350/i30_126speechoffice0dB.pcm ../dataqa351/i30_126speechoffice0dB.pcm +diff ../dataqa350/i60_126speechoffice0dB.pcm ../dataqa351/i60_126speechoffice0dB.pcm +diff ../dataqa350/a61speechoffice0dB.pcm ../dataqa351/a61speechoffice0dB.pcm +diff ../dataqa350/a62speechoffice0dB.pcm ../dataqa351/a62speechoffice0dB.pcm +diff ../dataqa350/a63speechoffice0dB.pcm ../dataqa351/a63speechoffice0dB.pcm +diff ../dataqa350/i30_127speech_and_misc_NB.pcm ../dataqa351/i30_127speech_and_misc_NB.pcm +diff ../dataqa350/i60_127speech_and_misc_NB.pcm ../dataqa351/i60_127speech_and_misc_NB.pcm +diff ../dataqa350/i30_128speech_and_misc_NB.pcm ../dataqa351/i30_128speech_and_misc_NB.pcm +diff ../dataqa350/i60_128speech_and_misc_NB.pcm ../dataqa351/i60_128speech_and_misc_NB.pcm +diff ../dataqa350/i30_129speech_and_misc_NB.pcm ../dataqa351/i30_129speech_and_misc_NB.pcm +diff ../dataqa350/i60_129speech_and_misc_NB.pcm ../dataqa351/i60_129speech_and_misc_NB.pcm +diff ../dataqa350/i30_130speech_and_misc_NB.pcm ../dataqa351/i30_130speech_and_misc_NB.pcm +diff ../dataqa350/i60_130speech_and_misc_NB.pcm ../dataqa351/i60_130speech_and_misc_NB.pcm +diff ../dataqa350/i30_131speech_and_misc_NB.pcm ../dataqa351/i30_131speech_and_misc_NB.pcm +diff ../dataqa350/i60_131speech_and_misc_NB.pcm ../dataqa351/i60_131speech_and_misc_NB.pcm +diff ../dataqa350/i30_132speech_and_misc_NB.pcm ../dataqa351/i30_132speech_and_misc_NB.pcm +diff ../dataqa350/i60_132speech_and_misc_NB.pcm ../dataqa351/i60_132speech_and_misc_NB.pcm +diff ../dataqa350/a64speech_and_misc_NB.pcm ../dataqa351/a64speech_and_misc_NB.pcm +diff ../dataqa350/a65speech_and_misc_NB.pcm ../dataqa351/a65speech_and_misc_NB.pcm +diff ../dataqa350/a66speech_and_misc_NB.pcm ../dataqa351/a66speech_and_misc_NB.pcm +diff ../dataqa350/i30_133speech_and_misc_WB.pcm ../dataqa351/i30_133speech_and_misc_WB.pcm +diff ../dataqa350/i60_133speech_and_misc_WB.pcm ../dataqa351/i60_133speech_and_misc_WB.pcm +diff ../dataqa350/i30_134speech_and_misc_WB.pcm ../dataqa351/i30_134speech_and_misc_WB.pcm +diff ../dataqa350/i60_134speech_and_misc_WB.pcm ../dataqa351/i60_134speech_and_misc_WB.pcm +diff ../dataqa350/i30_135speech_and_misc_WB.pcm ../dataqa351/i30_135speech_and_misc_WB.pcm +diff ../dataqa350/i60_135speech_and_misc_WB.pcm ../dataqa351/i60_135speech_and_misc_WB.pcm +diff ../dataqa350/i30_136speech_and_misc_WB.pcm ../dataqa351/i30_136speech_and_misc_WB.pcm +diff ../dataqa350/i60_136speech_and_misc_WB.pcm ../dataqa351/i60_136speech_and_misc_WB.pcm +diff ../dataqa350/i30_137speech_and_misc_WB.pcm ../dataqa351/i30_137speech_and_misc_WB.pcm +diff ../dataqa350/i60_137speech_and_misc_WB.pcm ../dataqa351/i60_137speech_and_misc_WB.pcm +diff ../dataqa350/i30_138speech_and_misc_WB.pcm ../dataqa351/i30_138speech_and_misc_WB.pcm +diff ../dataqa350/i60_138speech_and_misc_WB.pcm ../dataqa351/i60_138speech_and_misc_WB.pcm +diff ../dataqa350/a67speech_and_misc_WB.pcm ../dataqa351/a67speech_and_misc_WB.pcm +diff ../dataqa350/a68speech_and_misc_WB.pcm ../dataqa351/a68speech_and_misc_WB.pcm +diff ../dataqa350/a69speech_and_misc_WB.pcm ../dataqa351/a69speech_and_misc_WB.pcm +diff ../dataqa350/i30_139testM4.pcm ../dataqa351/i30_139testM4.pcm +diff ../dataqa350/i60_139testM4.pcm ../dataqa351/i60_139testM4.pcm +diff ../dataqa350/i30_140testM4.pcm ../dataqa351/i30_140testM4.pcm +diff ../dataqa350/i60_140testM4.pcm ../dataqa351/i60_140testM4.pcm +diff ../dataqa350/i30_141testM4.pcm ../dataqa351/i30_141testM4.pcm +diff ../dataqa350/i60_141testM4.pcm ../dataqa351/i60_141testM4.pcm +diff ../dataqa350/i30_142testM4.pcm ../dataqa351/i30_142testM4.pcm +diff ../dataqa350/i60_142testM4.pcm ../dataqa351/i60_142testM4.pcm +diff ../dataqa350/i30_143testM4.pcm ../dataqa351/i30_143testM4.pcm +diff ../dataqa350/i60_143testM4.pcm ../dataqa351/i60_143testM4.pcm +diff ../dataqa350/i30_144testM4.pcm ../dataqa351/i30_144testM4.pcm +diff ../dataqa350/i60_144testM4.pcm ../dataqa351/i60_144testM4.pcm +diff ../dataqa350/a70testM4.pcm ../dataqa351/a70testM4.pcm +diff ../dataqa350/a71testM4.pcm ../dataqa351/a71testM4.pcm +diff ../dataqa350/a72testM4.pcm ../dataqa351/a72testM4.pcm +diff ../dataqa350/i30_145testM4D_rev.pcm ../dataqa351/i30_145testM4D_rev.pcm +diff ../dataqa350/i60_145testM4D_rev.pcm ../dataqa351/i60_145testM4D_rev.pcm +diff ../dataqa350/i30_146testM4D_rev.pcm ../dataqa351/i30_146testM4D_rev.pcm +diff ../dataqa350/i60_146testM4D_rev.pcm ../dataqa351/i60_146testM4D_rev.pcm +diff ../dataqa350/i30_147testM4D_rev.pcm ../dataqa351/i30_147testM4D_rev.pcm +diff ../dataqa350/i60_147testM4D_rev.pcm ../dataqa351/i60_147testM4D_rev.pcm +diff ../dataqa350/i30_148testM4D_rev.pcm ../dataqa351/i30_148testM4D_rev.pcm +diff ../dataqa350/i60_148testM4D_rev.pcm ../dataqa351/i60_148testM4D_rev.pcm +diff ../dataqa350/i30_149testM4D_rev.pcm ../dataqa351/i30_149testM4D_rev.pcm +diff ../dataqa350/i60_149testM4D_rev.pcm ../dataqa351/i60_149testM4D_rev.pcm +diff ../dataqa350/i30_150testM4D_rev.pcm ../dataqa351/i30_150testM4D_rev.pcm +diff ../dataqa350/i60_150testM4D_rev.pcm ../dataqa351/i60_150testM4D_rev.pcm +diff ../dataqa350/a73testM4D_rev.pcm ../dataqa351/a73testM4D_rev.pcm +diff ../dataqa350/a74testM4D_rev.pcm ../dataqa351/a74testM4D_rev.pcm +diff ../dataqa350/a75testM4D_rev.pcm ../dataqa351/a75testM4D_rev.pcm +diff ../dataqa350/i30_151testM4D.pcm ../dataqa351/i30_151testM4D.pcm +diff ../dataqa350/i60_151testM4D.pcm ../dataqa351/i60_151testM4D.pcm +diff ../dataqa350/i30_152testM4D.pcm ../dataqa351/i30_152testM4D.pcm +diff ../dataqa350/i60_152testM4D.pcm ../dataqa351/i60_152testM4D.pcm +diff ../dataqa350/i30_153testM4D.pcm ../dataqa351/i30_153testM4D.pcm +diff ../dataqa350/i60_153testM4D.pcm ../dataqa351/i60_153testM4D.pcm +diff ../dataqa350/i30_154testM4D.pcm ../dataqa351/i30_154testM4D.pcm +diff ../dataqa350/i60_154testM4D.pcm ../dataqa351/i60_154testM4D.pcm +diff ../dataqa350/i30_155testM4D.pcm ../dataqa351/i30_155testM4D.pcm +diff ../dataqa350/i60_155testM4D.pcm ../dataqa351/i60_155testM4D.pcm +diff ../dataqa350/i30_156testM4D.pcm ../dataqa351/i30_156testM4D.pcm +diff ../dataqa350/i60_156testM4D.pcm ../dataqa351/i60_156testM4D.pcm +diff ../dataqa350/a76testM4D.pcm ../dataqa351/a76testM4D.pcm +diff ../dataqa350/a77testM4D.pcm ../dataqa351/a77testM4D.pcm +diff ../dataqa350/a78testM4D.pcm ../dataqa351/a78testM4D.pcm +diff ../dataqa350/i30_157testfile.pcm ../dataqa351/i30_157testfile.pcm +diff ../dataqa350/i60_157testfile.pcm ../dataqa351/i60_157testfile.pcm +diff ../dataqa350/i30_158testfile.pcm ../dataqa351/i30_158testfile.pcm +diff ../dataqa350/i60_158testfile.pcm ../dataqa351/i60_158testfile.pcm +diff ../dataqa350/i30_159testfile.pcm ../dataqa351/i30_159testfile.pcm +diff ../dataqa350/i60_159testfile.pcm ../dataqa351/i60_159testfile.pcm +diff ../dataqa350/i30_160testfile.pcm ../dataqa351/i30_160testfile.pcm +diff ../dataqa350/i60_160testfile.pcm ../dataqa351/i60_160testfile.pcm +diff ../dataqa350/i30_161testfile.pcm ../dataqa351/i30_161testfile.pcm +diff ../dataqa350/i60_161testfile.pcm ../dataqa351/i60_161testfile.pcm +diff ../dataqa350/i30_162testfile.pcm ../dataqa351/i30_162testfile.pcm +diff ../dataqa350/i60_162testfile.pcm ../dataqa351/i60_162testfile.pcm +diff ../dataqa350/a79testfile.pcm ../dataqa351/a79testfile.pcm +diff ../dataqa350/a80testfile.pcm ../dataqa351/a80testfile.pcm +diff ../dataqa350/a81testfile.pcm ../dataqa351/a81testfile.pcm +diff ../dataqa350/i30_163tone_cisco.pcm ../dataqa351/i30_163tone_cisco.pcm +diff ../dataqa350/i60_163tone_cisco.pcm ../dataqa351/i60_163tone_cisco.pcm +diff ../dataqa350/i30_164tone_cisco.pcm ../dataqa351/i30_164tone_cisco.pcm +diff ../dataqa350/i60_164tone_cisco.pcm ../dataqa351/i60_164tone_cisco.pcm +diff ../dataqa350/i30_165tone_cisco.pcm ../dataqa351/i30_165tone_cisco.pcm +diff ../dataqa350/i60_165tone_cisco.pcm ../dataqa351/i60_165tone_cisco.pcm +diff ../dataqa350/i30_166tone_cisco.pcm ../dataqa351/i30_166tone_cisco.pcm +diff ../dataqa350/i60_166tone_cisco.pcm ../dataqa351/i60_166tone_cisco.pcm +diff ../dataqa350/i30_167tone_cisco.pcm ../dataqa351/i30_167tone_cisco.pcm +diff ../dataqa350/i60_167tone_cisco.pcm ../dataqa351/i60_167tone_cisco.pcm +diff ../dataqa350/i30_168tone_cisco.pcm ../dataqa351/i30_168tone_cisco.pcm +diff ../dataqa350/i60_168tone_cisco.pcm ../dataqa351/i60_168tone_cisco.pcm +diff ../dataqa350/a82tone_cisco.pcm ../dataqa351/a82tone_cisco.pcm +diff ../dataqa350/a83tone_cisco.pcm ../dataqa351/a83tone_cisco.pcm +diff ../dataqa350/a84tone_cisco.pcm ../dataqa351/a84tone_cisco.pcm +diff ../dataqa350/i30_169tone_cisco_long.pcm ../dataqa351/i30_169tone_cisco_long.pcm +diff ../dataqa350/i60_169tone_cisco_long.pcm ../dataqa351/i60_169tone_cisco_long.pcm +diff ../dataqa350/i30_170tone_cisco_long.pcm ../dataqa351/i30_170tone_cisco_long.pcm +diff ../dataqa350/i60_170tone_cisco_long.pcm ../dataqa351/i60_170tone_cisco_long.pcm +diff ../dataqa350/i30_171tone_cisco_long.pcm ../dataqa351/i30_171tone_cisco_long.pcm +diff ../dataqa350/i60_171tone_cisco_long.pcm ../dataqa351/i60_171tone_cisco_long.pcm +diff ../dataqa350/i30_172tone_cisco_long.pcm ../dataqa351/i30_172tone_cisco_long.pcm +diff ../dataqa350/i60_172tone_cisco_long.pcm ../dataqa351/i60_172tone_cisco_long.pcm +diff ../dataqa350/i30_173tone_cisco_long.pcm ../dataqa351/i30_173tone_cisco_long.pcm +diff ../dataqa350/i60_173tone_cisco_long.pcm ../dataqa351/i60_173tone_cisco_long.pcm +diff ../dataqa350/i30_174tone_cisco_long.pcm ../dataqa351/i30_174tone_cisco_long.pcm +diff ../dataqa350/i60_174tone_cisco_long.pcm ../dataqa351/i60_174tone_cisco_long.pcm +diff ../dataqa350/a85tone_cisco_long.pcm ../dataqa351/a85tone_cisco_long.pcm +diff ../dataqa350/a86tone_cisco_long.pcm ../dataqa351/a86tone_cisco_long.pcm +diff ../dataqa350/a87tone_cisco_long.pcm ../dataqa351/a87tone_cisco_long.pcm +diff ../dataqa350/i30_175wb_contspeech.pcm ../dataqa351/i30_175wb_contspeech.pcm +diff ../dataqa350/i60_175wb_contspeech.pcm ../dataqa351/i60_175wb_contspeech.pcm +diff ../dataqa350/i30_176wb_contspeech.pcm ../dataqa351/i30_176wb_contspeech.pcm +diff ../dataqa350/i60_176wb_contspeech.pcm ../dataqa351/i60_176wb_contspeech.pcm +diff ../dataqa350/i30_177wb_contspeech.pcm ../dataqa351/i30_177wb_contspeech.pcm +diff ../dataqa350/i60_177wb_contspeech.pcm ../dataqa351/i60_177wb_contspeech.pcm +diff ../dataqa350/i30_178wb_contspeech.pcm ../dataqa351/i30_178wb_contspeech.pcm +diff ../dataqa350/i60_178wb_contspeech.pcm ../dataqa351/i60_178wb_contspeech.pcm +diff ../dataqa350/i30_179wb_contspeech.pcm ../dataqa351/i30_179wb_contspeech.pcm +diff ../dataqa350/i60_179wb_contspeech.pcm ../dataqa351/i60_179wb_contspeech.pcm +diff ../dataqa350/i30_180wb_contspeech.pcm ../dataqa351/i30_180wb_contspeech.pcm +diff ../dataqa350/i60_180wb_contspeech.pcm ../dataqa351/i60_180wb_contspeech.pcm +diff ../dataqa350/a88wb_contspeech.pcm ../dataqa351/a88wb_contspeech.pcm +diff ../dataqa350/a89wb_contspeech.pcm ../dataqa351/a89wb_contspeech.pcm +diff ../dataqa350/a90wb_contspeech.pcm ../dataqa351/a90wb_contspeech.pcm +diff ../dataqa350/i30_181wb_speech_office25db.pcm ../dataqa351/i30_181wb_speech_office25db.pcm +diff ../dataqa350/i60_181wb_speech_office25db.pcm ../dataqa351/i60_181wb_speech_office25db.pcm +diff ../dataqa350/i30_182wb_speech_office25db.pcm ../dataqa351/i30_182wb_speech_office25db.pcm +diff ../dataqa350/i60_182wb_speech_office25db.pcm ../dataqa351/i60_182wb_speech_office25db.pcm +diff ../dataqa350/i30_183wb_speech_office25db.pcm ../dataqa351/i30_183wb_speech_office25db.pcm +diff ../dataqa350/i60_183wb_speech_office25db.pcm ../dataqa351/i60_183wb_speech_office25db.pcm +diff ../dataqa350/i30_184wb_speech_office25db.pcm ../dataqa351/i30_184wb_speech_office25db.pcm +diff ../dataqa350/i60_184wb_speech_office25db.pcm ../dataqa351/i60_184wb_speech_office25db.pcm +diff ../dataqa350/i30_185wb_speech_office25db.pcm ../dataqa351/i30_185wb_speech_office25db.pcm +diff ../dataqa350/i60_185wb_speech_office25db.pcm ../dataqa351/i60_185wb_speech_office25db.pcm +diff ../dataqa350/i30_186wb_speech_office25db.pcm ../dataqa351/i30_186wb_speech_office25db.pcm +diff ../dataqa350/i60_186wb_speech_office25db.pcm ../dataqa351/i60_186wb_speech_office25db.pcm +diff ../dataqa350/a91wb_speech_office25db.pcm ../dataqa351/a91wb_speech_office25db.pcm +diff ../dataqa350/a92wb_speech_office25db.pcm ../dataqa351/a92wb_speech_office25db.pcm +diff ../dataqa350/a93wb_speech_office25db.pcm ../dataqa351/a93wb_speech_office25db.pcm +diff ../dataqa350/a30_1DTMF_16kHz_short.pcm ../dataqa351/a30_1DTMF_16kHz_short.pcm +diff ../dataqa350/a60_1DTMF_16kHz_short.pcm ../dataqa351/a60_1DTMF_16kHz_short.pcm +diff ../dataqa350/a30_2ltest_speech_noisy.pcm ../dataqa351/a30_2ltest_speech_noisy.pcm +diff ../dataqa350/a60_2ltest_speech_noisy.pcm ../dataqa351/a60_2ltest_speech_noisy.pcm +diff ../dataqa350/a30_3misc2.pcm ../dataqa351/a30_3misc2.pcm +diff ../dataqa350/a60_3misc2.pcm ../dataqa351/a60_3misc2.pcm +diff ../dataqa350/a30_4sinesweep.pcm ../dataqa351/a30_4sinesweep.pcm +diff ../dataqa350/a60_4sinesweep.pcm ../dataqa351/a60_4sinesweep.pcm +diff ../dataqa350/a30_5speechmusic.pcm ../dataqa351/a30_5speechmusic.pcm +diff ../dataqa350/a60_5speechmusic.pcm ../dataqa351/a60_5speechmusic.pcm +diff ../dataqa350/a30_6tone_cisco.pcm ../dataqa351/a30_6tone_cisco.pcm +diff ../dataqa350/a60_6tone_cisco.pcm ../dataqa351/a60_6tone_cisco.pcm +diff ../dataqa350/a60_7tone_cisco.pcm ../dataqa351/a60_7tone_cisco.pcm diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/diffiSACPLC.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/diffiSACPLC.txt new file mode 100644 index 0000000000..9e3629b2ca --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/diffiSACPLC.txt @@ -0,0 +1,20 @@ +#!/bin/bash +(set -o igncr) 2>/dev/null && set -o igncr; # force bash to ignore \r character + +LOGFILE=logplc.txt +echo "START PLC TEST" > $LOGFILE + +OUTDIR1=../dataqaplc_0 +OUTDIR2=../dataqaplc_1 + +diff $OUTDIR1/outplc1.pcm $OUTDIR2/outplc1.pcm +diff $OUTDIR1/outplc2.pcm $OUTDIR2/outplc2.pcm +diff $OUTDIR1/outplc3.pcm $OUTDIR2/outplc3.pcm +diff $OUTDIR1/outplc4.pcm $OUTDIR2/outplc4.pcm +diff $OUTDIR1/outplc5.pcm $OUTDIR2/outplc5.pcm +diff $OUTDIR1/outplc6.pcm $OUTDIR2/outplc6.pcm + +echo DONE! + + + diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACLongtest.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACLongtest.txt new file mode 100644 index 0000000000..eeffc0c955 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACLongtest.txt @@ -0,0 +1,61 @@ +#!/bin/bash +(set -o igncr) 2>/dev/null && set -o igncr; # force bash to ignore \r character + +LOGFILE=logNormal.txt +echo "START ISAC TEST" > $LOGFILE +echo >> $LOGFILE + +ISAC=../Release/kenny.exe +ISACFIXFLOAT=../Release/testFixFloat.exe + +INFILES=$(cat InputFiles.txt) +SUBSET=$(cat InputFilesFew.txt) +CHANNELFILES=$(cat ChannelFiles.txt) +CHANNELLIST=($(cat ChannelFiles.txt)) +INDIR=../data/orig +OUTDIR=../dataqa +mkdir -p $OUTDIR + +TARGETRATE=(10000 15000 20000 25000 30000 32000) +#echo ${CHANNELFILES[1]} + +index1=0 +index2=0 + +for file in $INFILES # loop over all input files + do + + for rate in ${TARGETRATE[*]} + do + let "index1=index1+1" + $ISAC -I $rate -FL 30 $INDIR/"$file" $OUTDIR/i30_$index1"$file" >> $LOGFILE + $ISAC -I $rate -FL 60 $INDIR/"$file" $OUTDIR/i60_$index1"$file" >> $LOGFILE + done + for channel in $CHANNELFILES + do + let "index2=index2+1" + $ISAC $INDIR/$channel $INDIR/"$file" $OUTDIR/a$index2"$file" >> $LOGFILE + done + +done + +index1=0 + +for file in $SUBSET # loop over the subset of input files + do + let "index1=index1+1" + $ISAC $INDIR/${CHANNELLIST[0]} -FL 30 -FIXED_FL $INDIR/"$file" $OUTDIR/a30_$index1"$file" >> $LOGFILE + $ISAC $INDIR/${CHANNELLIST[0]} -FL 60 -FIXED_FL $INDIR/"$file" $OUTDIR/a60_$index1"$file" >> $LOGFILE +done + +let "index1=index1+1" + $ISAC $INDIR/${CHANNELLIST[0]} -INITRATE 25000 -FL 30 $INDIR/"$file" $OUTDIR/a60_$index1"$file" >> $LOGFILE + +# Run fault test + +#./runiSACfault.txt + +echo DONE! + + + diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACNB.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACNB.txt new file mode 100644 index 0000000000..605595cc04 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACNB.txt @@ -0,0 +1,45 @@ +#!/bin/bash +(set -o igncr) 2>/dev/null && set -o igncr; # force bash to ignore \r character + +LOGFILE=logNB.txt +echo "START NARROWBAND TEST" > $LOGFILE +echo >> $LOGFILE + +ISAC=../Release/kenny.exe +ISACFIXFLOAT=../Release/testFixFloat.exe + +INFILES=$(cat InputFiles.txt) +SUBSET=$(cat InputFilesFew.txt) +CHANNELFILES=$(cat ChannelFiles.txt) +CHANNELLIST=($(cat ChannelFiles.txt)) +INDIR=../data/orig +OUTDIR=../dataqaNB +mkdir -p $OUTDIR + +TARGETRATE=(10000 15000 20000 25000 30000 32000) +#echo ${CHANNELFILES[1]} + +index1=0 +index2=0 + +# Narrowband Interfaces + +for file in $SUBSET # loop over all input files + do + for rate in ${TARGETRATE[*]} + do + let "index1=index1+1" + $ISAC $rate -FL 30 -NB 1 $INDIR/"$file" $OUTDIR/nb130_$index1"$file" >> $LOGFILE + $ISAC $rate -FL 60 -NB 1 $INDIR/"$file" $OUTDIR/nb160_$index1"$file" >> $LOGFILE + $ISAC $rate -FL 30 -NB 2 $INDIR/"$file" $OUTDIR/nb230_$index1"$file" >> $LOGFILE + $ISAC $rate -FL 60 -NB 2 $INDIR/"$file" $OUTDIR/nb260_$index1"$file" >> $LOGFILE + $ISAC $rate -FL 30 -NB 2 -PL 10 $INDIR/"$file" $OUTDIR/nb2plc30_$index1"$file" >> $LOGFILE + $ISAC $rate -FL 60 -NB 2 -PL 10 $INDIR/"$file" $OUTDIR/nb2plc60_$index1"$file" >> $LOGFILE + done + +done + +echo DONE! + + + diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACPLC.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACPLC.txt new file mode 100644 index 0000000000..6bee6f7c3f --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACPLC.txt @@ -0,0 +1,23 @@ +#!/bin/bash +(set -o igncr) 2>/dev/null && set -o igncr; # force bash to ignore \r character + +LOGFILE=logplc.txt +echo "START PLC TEST" > $LOGFILE + +ISAC=../Release/kenny.exe + +INDIR=../data/orig +OUTDIR=../dataqaplc_0 +mkdir -p $OUTDIR + +$ISAC 12000 -PL 15 $INDIR/speechmusic.pcm $OUTDIR/outplc1.pcm +$ISAC 20000 -PL 15 $INDIR/speechmusic.pcm $OUTDIR/outplc2.pcm +$ISAC 32000 -PL 15 $INDIR/speechmusic.pcm $OUTDIR/outplc3.pcm +$ISAC 12000 -PL 15 $INDIR/tone_cisco.pcm $OUTDIR/outplc4.pcm +$ISAC 20000 -PL 15 $INDIR/tone_cisco.pcm $OUTDIR/outplc5.pcm +$ISAC 32000 -PL 15 $INDIR/tone_cisco.pcm $OUTDIR/outplc6.pcm + +echo DONE! + + + diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACRate.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACRate.txt new file mode 100644 index 0000000000..d8403e099d --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACRate.txt @@ -0,0 +1,23 @@ +#!/bin/bash +(set -o igncr) 2>/dev/null && set -o igncr; # force bash to ignore \r character + +LOGG=loggRate.txt +OUTDIR=../dataqaRate +mkdir -p $OUTDIR + +../Release/kenny.exe 13000 -FIXED_FL -FL 30 -MAX 100 ../data/orig/sawsweep_380_60.pcm $OUTDIR/out_napi_1.pcm > $LOGG +../Release/kenny.exe ../data/orig/bottlenecks.txt -FIXED_FL -FL 30 -MAXRATE 32000 ../data/orig/sawsweep_380_60.pcm $OUTDIR/out_napi_2.pcm >> $LOGG +../Release/kenny.exe 13000 -FIXED_FL -FL 30 -MAX 100 ../data/orig/sawsweep_380_60.pcm $OUTDIR/out_napi_3.pcm >> $LOGG +../Release/kenny.exe ../data/orig/bottlenecks.txt -FIXED_FL -FL 30 -MAXRATE 32000 ../data/orig/sawsweep_380_60.pcm $OUTDIR/out_napi_4.pcm >> $LOGG +../Release/kenny.exe 13000 -FIXED_FL -FL 60 -MAX 100 ../data/orig/sawsweep_380_60.pcm $OUTDIR/out_napi_5.pcm >> $LOGG +../Release/kenny.exe ../data/orig/bottlenecks.txt -FIXED_FL -FL 60 -MAXRATE 32000 ../data/orig/sawsweep_380_60.pcm $OUTDIR/out_napi_6.pcm >> $LOGG +../Release/kenny.exe 13000 -INIT_RATE 32000 -FIXED_FL -FL 60 -MAX 100 ../data/orig/sawsweep_380_60.pcm $OUTDIR/out_napi_7.pcm >> $LOGG + +../Release/kenny.exe 13000 -FIXED_FL -FL 30 -MAX 100 ../data/orig/longspeech.pcm $OUTDIR/out_napi_11.pcm >> $LOGG +../Release/kenny.exe ../data/orig/bottlenecks.txt -FIXED_FL -FL 30 -MAXRATE 32000 ../data/orig/longspeech.pcm $OUTDIR/out_napi_12.pcm >> $LOGG +../Release/kenny.exe 13000 -FIXED_FL -FL 30 -MAX 100 ../data/orig/longspeech.pcm $OUTDIR/out_napi_13.pcm >> $LOGG +../Release/kenny.exe ../data/orig/bottlenecks.txt -FIXED_FL -FL 30 -MAXRATE 32000 ../data/orig/longspeech.pcm $OUTDIR/out_napi_14.pcm >> $LOGG +../Release/kenny.exe 13000 -FIXED_FL -FL 60 -MAX 100 ../data/orig/longspeech.pcm $OUTDIR/out_napi_15.pcm >> $LOGG +../Release/kenny.exe ../data/orig/bottlenecks.txt -FIXED_FL -FL 60 -MAXRATE 32000 ../data/orig/longspeech.pcm $OUTDIR/out_napi_16.pcm >> $LOGG +../Release/kenny.exe 13000 -INIT_RATE 32000 -FIXED_FL -FL 60 -MAX 100 ../data/orig/longspeech.pcm $OUTDIR/out_napi_17.pcm >> $LOGG + diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACfault.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACfault.txt new file mode 100644 index 0000000000..f4d9478fd4 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACfault.txt @@ -0,0 +1,40 @@ +#!/bin/bash +(set -o igncr) 2>/dev/null && set -o igncr; # force bash to ignore \r character + +LOGFILE=logfault.txt +echo "START FAULT TEST" > $LOGFILE + +ISAC=../Release/kenny.exe +ISACFIXFLOAT=../Release/testFixFloat.exe + +INFILES=$(cat InputFiles.txt) +SUBSET=$(cat InputFilesFew.txt) +CHANNELFILES=$(cat ChannelFiles.txt) +CHANNELLIST=($(cat ChannelFiles.txt)) +INDIR=../data/orig +OUTDIR=../dataqaft +mkdir -p $OUTDIR + +TARGETRATE=(10000 15000 20000 25000 30000 32000) +FAULTTEST=(1 2 3 4 5 6 7 9) + +index1=0 + +file=wb_contspeech.pcm + +# Fault test +for testnr in ${FAULTTEST[*]} + do + $ISAC 32000 -F $testnr $INDIR/"$file" $OUTDIR/ft$testnr"$file" >> $LOGFILE +done + +# Fault test number 10, error in bitstream + $ISAC 32000 -F 10 $INDIR/"$file" $OUTDIR/ft10_"$file" >> $LOGFILE + $ISAC 32000 -F 10 -PL 10 $INDIR/"$file" $OUTDIR/ft10plc_"$file" >> $LOGFILE + $ISAC 32000 -F 10 -NB 1 $INDIR/"$file" $OUTDIR/ft10nb1_"$file" >> $LOGFILE + $ISAC 32000 -F 10 -NB 2 -PL 10 $INDIR/"$file" $OUTDIR/ft10nb2_"$file" >> $LOGFILE + +echo DONE! + + + diff --git a/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACfixfloat.txt b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACfixfloat.txt new file mode 100644 index 0000000000..c9e02df2e9 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/QA/runiSACfixfloat.txt @@ -0,0 +1,47 @@ +#!/bin/bash +(set -o igncr) 2>/dev/null && set -o igncr; # force bash to ignore \r character + +LOGFILE=logfxfl.txt +echo "START FIX-FLOAT TEST" > $LOGFILE + + +ISACFIXFLOAT=../testFixFloat.exe + +INFILES=$(cat InputFiles.txt) +SUBSET=$(cat InputFilesFew.txt) +CHANNELFILES=$(cat ChannelFiles.txt) +CHANNELLIST=($(cat ChannelFiles.txt)) +INDIR=../data/orig +OUTDIR=../dataqafxfl +mkdir -p $OUTDIR + +index1=0 + +for file in $INFILES # loop over all input files + do + + for channel in $CHANNELFILES + do + let "index1=index1+1" + + $ISACFIXFLOAT $INDIR/$channel -m 1 -PLC $INDIR/"$file" $OUTDIR/flfx$index1"$file" >> $LOGFILE + $ISACFIXFLOAT $INDIR/$channel -m 2 -PLC $INDIR/"$file" $OUTDIR/fxfl$index1"$file" >> $LOGFILE + done + +done + +index1=0 + +for file in $SUBSET # loop over the subset of input files + do + let "index1=index1+1" + $ISACFIXFLOAT $INDIR/$channel -m 1 -NB 1 $INDIR/"$file" $OUTDIR/flfxnb1_$index1"$file" >> $LOGFILE + $ISACFIXFLOAT $INDIR/$channel -m 2 -NB 1 $INDIR/"$file" $OUTDIR/fxflnb1_$index1"$file" >> $LOGFILE + $ISACFIXFLOAT $INDIR/$channel -m 1 -NB 2 -PLC $INDIR/"$file" $OUTDIR/flfxnb2_$index1"$file" >> $LOGFILE + $ISACFIXFLOAT $INDIR/$channel -m 2 -NB 2 -PLC $INDIR/"$file" $OUTDIR/fxflnb2_$index1"$file" >> $LOGFILE +done + +echo DONE! + + + diff --git a/src/modules/audio_coding/codecs/isac/fix/test/isacfix_unittest.cc b/src/modules/audio_coding/codecs/isac/fix/test/isacfix_unittest.cc new file mode 100644 index 0000000000..bef71e96f4 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/isacfix_unittest.cc @@ -0,0 +1,96 @@ +/* + * 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. + */ +#include <typedefs.h> + +#include "gtest/gtest.h" +#include "modules/audio_coding/codecs/isac/fix/source/filterbank_internal.h" +#include "modules/audio_coding/codecs/isac/fix/source/filterbank_tables.h" +#include "modules/audio_coding/codecs/isac/fix/source/lpc_masking_model.h" +#include "system_wrappers/interface/cpu_features_wrapper.h" + +class IsacUnitTest : public testing::Test { + protected: + // Pass a function pointer to the Tester function. + void CalculateResidualEnergyTester(CalculateResidualEnergy + CalculateResidualEnergyFunction) { + const int kIntOrder = 10; + const int32_t kInt32QDomain = 5; + const int kIntShift = 11; + int16_t a[kIntOrder + 1] = {32760, 122, 7, 0, -32760, -3958, + -48, 18745, 498, 9, 23456}; + int32_t corr[kIntOrder + 1] = {11443647, -27495, 0, + 98745, -11443600, 1, 1, 498, 9, 888, 23456}; + int q_shift_residual = 0; + int32_t residual_energy = 0; + + // Test the code path where (residual_energy >= 0x10000). + residual_energy = CalculateResidualEnergyFunction(kIntOrder, + kInt32QDomain, kIntShift, a, corr, &q_shift_residual); + EXPECT_EQ(1789023310, residual_energy); + EXPECT_EQ(2, q_shift_residual); + + // Test the code path where (residual_energy < 0x10000) + // and ((energy & 0x8000) != 0). + for(int i = 0; i < kIntOrder + 1; i++) { + a[i] = 24575 >> i; + corr[i] = i; + } + residual_energy = CalculateResidualEnergyFunction(kIntOrder, + kInt32QDomain, kIntShift, a, corr, &q_shift_residual); + EXPECT_EQ(1595279092, residual_energy); + EXPECT_EQ(26, q_shift_residual); + + // Test the code path where (residual_energy <= 0x7fff). + for(int i = 0; i < kIntOrder + 1; i++) { + a[i] = 2457 >> i; + } + residual_energy = CalculateResidualEnergyFunction(kIntOrder, + kInt32QDomain, kIntShift, a, corr, &q_shift_residual); + EXPECT_EQ(2029266944, residual_energy); + EXPECT_EQ(33, q_shift_residual); + } +}; + +TEST_F(IsacUnitTest, CalculateResidualEnergyTest) { + CalculateResidualEnergyTester(WebRtcIsacfix_CalculateResidualEnergyC); +#ifdef WEBRTC_DETECT_ARM_NEON + if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { + CalculateResidualEnergyTester(WebRtcIsacfix_CalculateResidualEnergyNeon); + } +#elif defined(WEBRTC_ARCH_ARM_NEON) + CalculateResidualEnergyTester(WebRtcIsacfix_CalculateResidualEnergyNeon); +#endif +} + +TEST_F(IsacUnitTest, HighpassFilterFixDec32Test) { + const int kSamples = 20; + int16_t in[kSamples]; + int32_t state[2] = {12345, 987654}; +#ifdef WEBRTC_ARCH_ARM_V7 + int32_t out[kSamples] = {-1040, -1035, -22875, -1397, -27604, 20018, 7917, + -1279, -8552, -14494, -7558, -23537, -27258, -30554, -32768, -3432, -32768, + 25215, -27536, 22436}; +#else + int32_t out[kSamples] = {-1040, -1035, -22875, -1397, -27604, 20017, 7915, + -1280, -8554, -14496, -7561, -23541, -27263, -30560, -32768, -3441, -32768, + 25203, -27550, 22419}; +#endif + + for(int i = 0; i < kSamples; i++) { + in[i] = WEBRTC_SPL_WORD32_MAX / (i + 1); + } + + WebRtcIsacfix_HighpassFilterFixDec32(in, kSamples, + WebRtcIsacfix_kHPStCoeffOut1Q30, state); + + for(int i = 0; i < kSamples; i++) { + EXPECT_EQ(out[i], in[i]); + } +} diff --git a/src/modules/audio_coding/codecs/isac/fix/test/kenny.c b/src/modules/audio_coding/codecs/isac/fix/test/kenny.c new file mode 100644 index 0000000000..8b04c98ec5 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/kenny.c @@ -0,0 +1,853 @@ +/* + * 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. + */ + +/* kenny.c - Main function for the iSAC coder */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <ctype.h> + +#include "isacfix.h" + + +/* Defines */ +#define SEED_FILE "randseed.txt" /* Used when running decoder on garbage data */ +#define MAX_FRAMESAMPLES 960 /* max number of samples per frame (= 60 ms frame) */ +#define FRAMESAMPLES_10ms 160 /* number of samples per 10ms frame */ +#define FS 16000 /* sampling frequency (Hz) */ + +/* Function for reading audio data from PCM file */ +int readframe(WebRtc_Word16 *data, FILE *inp, int length) { + + short k, rlen, status = 0; + + rlen = fread(data, sizeof(WebRtc_Word16), length, inp); + if (rlen < length) { + for (k = rlen; k < length; k++) + data[k] = 0; + status = 1; + } + + return status; +} + +/* Struct for bottleneck model */ +typedef struct { + WebRtc_UWord32 send_time; /* samples */ + WebRtc_UWord32 arrival_time; /* samples */ + WebRtc_UWord32 sample_count; /* samples */ + WebRtc_UWord16 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); + BN_data->send_time += current_framesamples; + + if (BN_data->arrival_time < BN_data->sample_count) + BN_data->arrival_time = BN_data->sample_count; + + BN_data->rtp_number++; +} + +void get_arrival_time2(int current_framesamples, + int current_delay, + BottleNeckModel *BN_data) +{ + if (current_delay == -1) + //dropped packet + { + BN_data->arrival_time += current_framesamples; + } + else if (current_delay != -2) + { + // + BN_data->arrival_time += (current_framesamples + ((FS/1000) * current_delay)); + } + //else + //current packet has same timestamp as previous packet + + BN_data->rtp_number++; +} + +int main(int argc, char* argv[]) +{ + + char inname[100], outname[100], outbitsname[100], bottleneck_file[100]; + FILE *inp, *outp, *f_bn, *outbits; + int endfile; + + int i, errtype, h = 0, k, packetLossPercent = 0; + WebRtc_Word16 CodingMode; + WebRtc_Word16 bottleneck; + WebRtc_Word16 framesize = 30; /* ms */ + int cur_framesmpls, err = 0, lostPackets = 0; + + /* Runtime statistics */ + double starttime, runtime, length_file; + + WebRtc_Word16 stream_len = 0; + WebRtc_Word16 framecnt, declen = 0; + WebRtc_Word16 shortdata[FRAMESAMPLES_10ms]; + WebRtc_Word16 decoded[MAX_FRAMESAMPLES]; + WebRtc_UWord16 streamdata[500]; + WebRtc_Word16 speechType[1]; + WebRtc_Word16 prevFrameSize = 1; + WebRtc_Word16 rateBPS = 0; + WebRtc_Word16 fixedFL = 0; + WebRtc_Word16 payloadSize = 0; + WebRtc_Word32 payloadRate = 0; + int setControlBWE = 0; + int readLoss; + FILE *plFile = NULL; + + char version_number[20]; + char tmpBit[5] = ".bit"; + + double kbps; + int totalbits =0; + int totalsmpls =0; +#ifdef _DEBUG + FILE *fy; +#endif + WebRtc_Word16 testNum, testCE; + + FILE *fp_gns = NULL; + int gns = 0; + int cur_delay = 0; + char gns_file[100]; + + int nbTest = 0; + WebRtc_Word16 lostFrame; + float scale = (float)0.7; + /* only one structure used for ISAC encoder */ + ISACFIX_MainStruct *ISAC_main_inst; + + /* For fault test 10, garbage data */ + FILE *seedfile; + unsigned int random_seed = (unsigned int) time(NULL);//1196764538 + + BottleNeckModel BN_data; + f_bn = NULL; + +#ifdef _DEBUG + fy = fopen("bit_rate.dat", "w"); + fclose(fy); + fy = fopen("bytes_frames.dat", "w"); + fclose(fy); +#endif + + readLoss = 0; + packetLossPercent = 0; + + /* Handling wrong input arguments in the command line */ + if ((argc<3) || (argc>21)) { + printf("\n\nWrong number of arguments or flag values.\n\n"); + + printf("\n"); + WebRtcIsacfix_version(version_number); + printf("iSAC version %s \n\n", version_number); + + printf("Usage:\n\n"); + printf("./kenny.exe [-F num][-I] bottleneck_value infile outfile \n\n"); + printf("with:\n"); + printf("[-I] :if -I option is specified, the coder will use\n"); + printf(" an instantaneous Bottleneck value. If not, it\n"); + printf(" will be an adaptive Bottleneck value.\n\n"); + printf("bottleneck_value :the value of the bottleneck provided either\n"); + printf(" as a fixed value (e.g. 25000) or\n"); + printf(" read from a file (e.g. bottleneck.txt)\n\n"); + printf("[-INITRATE num] :Set a new value for initial rate. Note! Only used" + " in adaptive mode.\n\n"); + printf("[-FL num] :Set (initial) frame length in msec. Valid length" + " are 30 and 60 msec.\n\n"); + printf("[-FIXED_FL] :Frame length will be fixed to initial value.\n\n"); + printf("[-MAX num] :Set the limit for the payload size of iSAC" + " in bytes. \n"); + printf(" Minimum 100, maximum 400.\n\n"); + printf("[-MAXRATE num] :Set the maxrate for iSAC in bits per second. \n"); + printf(" Minimum 32000, maximum 53400.\n\n"); + printf("[-F num] :if -F option is specified, the test function\n"); + printf(" will run the iSAC API fault scenario specified" + " by the\n"); + printf(" supplied number.\n"); + printf(" F 1 - Call encoder prior to init encoder call\n"); + printf(" F 2 - Call decoder prior to init decoder call\n"); + printf(" F 3 - Call decoder prior to encoder call\n"); + printf(" F 4 - Call decoder with a too short coded" + " sequence\n"); + printf(" F 5 - Call decoder with a too long coded" + " sequence\n"); + printf(" F 6 - Call decoder with random bit stream\n"); + printf(" F 7 - Call init encoder/decoder at random" + " during a call\n"); + printf(" F 8 - Call encoder/decoder without having" + " allocated memory for \n"); + printf(" encoder/decoder instance\n"); + printf(" F 9 - Call decodeB without calling decodeA\n"); + printf(" F 10 - Call decodeB with garbage data\n"); + printf("[-PL num] : if -PL option is specified 0<num<100 will " + "specify the\n"); + printf(" percentage of packet loss\n\n"); + printf("[-G file] : if -G option is specified the file given is" + " a .gns file\n"); + printf(" that represents a network profile\n\n"); + printf("[-NB num] : if -NB option, use the narrowband interfaces\n"); + printf(" num=1 => encode with narrowband encoder" + " (infile is narrowband)\n"); + printf(" num=2 => decode with narrowband decoder" + " (outfile is narrowband)\n\n"); + printf("[-CE num] : Test of APIs used by Conference Engine.\n"); + printf(" CE 1 - createInternal, freeInternal," + " getNewBitstream \n"); + printf(" CE 2 - transcode, getBWE \n"); + printf(" CE 3 - getSendBWE, setSendBWE. \n\n"); + printf("[-RTP_INIT num] : if -RTP_INIT option is specified num will be" + " the initial\n"); + printf(" value of the rtp sequence number.\n\n"); + printf("infile : Normal speech input file\n\n"); + printf("outfile : Speech output file\n\n"); + printf("Example usage : \n\n"); + printf("./kenny.exe -I bottleneck.txt speechIn.pcm speechOut.pcm\n\n"); + exit(0); + + } + + /* Print version number */ + WebRtcIsacfix_version(version_number); + printf("iSAC version %s \n\n", version_number); + + /* Loop over all command line arguments */ + CodingMode = 0; + testNum = 0; + testCE = 0; + for (i = 1; i < argc-2;i++) { + /* Instantaneous mode */ + if (!strcmp ("-I", argv[i])) { + printf("\nInstantaneous BottleNeck\n"); + CodingMode = 1; + i++; + } + + /* Set (initial) bottleneck value */ + if (!strcmp ("-INITRATE", argv[i])) { + rateBPS = atoi(argv[i + 1]); + setControlBWE = 1; + if ((rateBPS < 10000) || (rateBPS > 32000)) { + printf("\n%d is not a initial rate. " + "Valid values are in the range 10000 to 32000.\n", rateBPS); + exit(0); + } + printf("\nNew initial rate: %d\n", rateBPS); + i++; + } + + /* Set (initial) framelength */ + if (!strcmp ("-FL", argv[i])) { + framesize = atoi(argv[i + 1]); + if ((framesize != 30) && (framesize != 60)) { + printf("\n%d is not a valid frame length. " + "Valid length are 30 and 60 msec.\n", framesize); + exit(0); + } + printf("\nFrame Length: %d\n", framesize); + i++; + } + + /* Fixed frame length */ + if (!strcmp ("-FIXED_FL", argv[i])) { + fixedFL = 1; + setControlBWE = 1; + } + + /* Set maximum allowed payload size in bytes */ + if (!strcmp ("-MAX", argv[i])) { + payloadSize = atoi(argv[i + 1]); + printf("Maximum Payload Size: %d\n", payloadSize); + i++; + } + + /* Set maximum rate in bytes */ + if (!strcmp ("-MAXRATE", argv[i])) { + payloadRate = atoi(argv[i + 1]); + printf("Maximum Rate in kbps: %d\n", payloadRate); + i++; + } + + /* Test of fault scenarious */ + if (!strcmp ("-F", argv[i])) { + testNum = atoi(argv[i + 1]); + printf("\nFault test: %d\n", testNum); + if (testNum < 1 || testNum > 10) { + printf("\n%d is not a valid Fault Scenario number." + " Valid Fault Scenarios are numbered 1-10.\n", testNum); + exit(0); + } + i++; + } + + /* Packet loss test */ + if (!strcmp ("-PL", argv[i])) { + if( isdigit( *argv[i+1] ) ) { + packetLossPercent = atoi( argv[i+1] ); + if( (packetLossPercent < 0) | (packetLossPercent > 100) ) { + printf( "\nInvalid packet loss perentage \n" ); + exit( 0 ); + } + if( packetLossPercent > 0 ) { + printf( "\nSimulating %d %% of independent packet loss\n", + packetLossPercent ); + } else { + printf( "\nNo Packet Loss Is Simulated \n" ); + } + readLoss = 0; + } else { + readLoss = 1; + plFile = fopen( argv[i+1], "rb" ); + if( plFile == NULL ) { + printf( "\n couldn't open the frameloss file: %s\n", argv[i+1] ); + exit( 0 ); + } + printf( "\nSimulating packet loss through the given " + "channel file: %s\n", argv[i+1] ); + } + i++; + } + + /* Random packetlosses */ + if (!strcmp ("-rnd", argv[i])) { + srand(time(NULL) ); + printf( "\n Random pattern in lossed packets \n" ); + } + + /* Use gns file */ + if (!strcmp ("-G", argv[i])) { + sscanf(argv[i + 1], "%s", gns_file); + fp_gns = fopen(gns_file, "rb"); + if (fp_gns == NULL) { + printf("Cannot read file %s.\n", gns_file); + exit(0); + } + gns = 1; + i++; + } + + /* Run Narrowband interfaces (either encoder or decoder) */ + if (!strcmp ("-NB", argv[i])) { + nbTest = atoi(argv[i + 1]); + i++; + } + + /* Run Conference Engine APIs */ + if (!strcmp ("-CE", argv[i])) { + testCE = atoi(argv[i + 1]); + if (testCE==1 || testCE==2) { + i++; + scale = (float)atof( argv[i+1] ); + } else if (testCE < 1 || testCE > 3) { + printf("\n%d is not a valid CE-test number, valid Fault " + "Scenarios are numbered 1-3\n", testCE); + exit(0); + } + i++; + } + + /* Set initial RTP number */ + if (!strcmp ("-RTP_INIT", argv[i])) { + i++; + } + } + + /* Get Bottleneck value */ + /* Gns files and bottleneck should not and can not be used simultaneously */ + bottleneck = atoi(argv[CodingMode+1]); + if (bottleneck == 0 && gns == 0) { + sscanf(argv[CodingMode+1], "%s", bottleneck_file); + f_bn = fopen(bottleneck_file, "rb"); + if (f_bn == NULL) { + printf("No value provided for BottleNeck and cannot read file %s\n", bottleneck_file); + exit(0); + } else { + int aux_var; + printf("reading bottleneck rates from file %s\n\n",bottleneck_file); + if (fscanf(f_bn, "%d", &aux_var) == EOF) { + /* Set pointer to beginning of file */ + fseek(f_bn, 0L, SEEK_SET); + if (fscanf(f_bn, "%d", &aux_var) == EOF) { + exit(0); + } + } + bottleneck = (WebRtc_Word16)aux_var; + /* Bottleneck is a cosine function + * Matlab code for writing the bottleneck file: + * BottleNeck_10ms = 20e3 + 10e3 * cos((0:5999)/5999*2*pi); + * fid = fopen('bottleneck.txt', 'wb'); + * fprintf(fid, '%d\n', BottleNeck_10ms); fclose(fid); + */ + } + } else { + f_bn = NULL; + printf("\nfixed bottleneck rate of %d bits/s\n\n", bottleneck); + } + + if (CodingMode == 0) { + printf("\nAdaptive BottleNeck\n"); + } + + /* Get Input and Output files */ + sscanf(argv[argc-2], "%s", inname); + sscanf(argv[argc-1], "%s", outname); + + /* Add '.bit' to output bitstream file */ + while ((int)outname[h] != 0) { + outbitsname[h] = outname[h]; + h++; + } + for (k=0; k<5; k++) { + outbitsname[h] = tmpBit[k]; + h++; + } + if ((inp = fopen(inname,"rb")) == NULL) { + printf(" iSAC: Cannot read file %s\n", inname); + exit(1); + } + if ((outp = fopen(outname,"wb")) == NULL) { + printf(" iSAC: Cannot write file %s\n", outname); + exit(1); + } + + if ((outbits = fopen(outbitsname,"wb")) == NULL) { + printf(" iSAC: Cannot write file %s\n", outbitsname); + exit(1); + } + printf("\nInput:%s\nOutput:%s\n\n", inname, outname); + + /* Error test number 10, garbage data */ + if (testNum == 10) { + /* Test to run decoder with garbage data */ + srand(random_seed); + + if ( (seedfile = fopen(SEED_FILE, "a+t") ) == NULL ) { + printf("Error: Could not open file %s\n", SEED_FILE); + } + else { + fprintf(seedfile, "%u\n", random_seed); + fclose(seedfile); + } + } + + /* Runtime statistics */ + starttime = clock()/(double)CLOCKS_PER_SEC; + + /* 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); + } + /* Error check */ + if (err < 0) { + printf("\n\n Error in create.\n\n"); + } + if (testCE == 1) { + err = WebRtcIsacfix_CreateInternal(ISAC_main_inst); + /* Error check */ + if (err < 0) { + printf("\n\n Error in createInternal.\n\n"); + } + } + } + + /* Init of bandwidth data */ + BN_data.send_time = 0; + BN_data.arrival_time = 0; + BN_data.sample_count = 0; + BN_data.rtp_number = 0; + + /* Initialize encoder and decoder */ + framecnt= 0; + endfile = 0; + if (testNum != 1) { + WebRtcIsacfix_EncoderInit(ISAC_main_inst, CodingMode); + } + if (testNum != 2) { + WebRtcIsacfix_DecoderInit(ISAC_main_inst); + } + + if (CodingMode == 1) { + err = WebRtcIsacfix_Control(ISAC_main_inst, bottleneck, framesize); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\n\n Error in control: %d.\n\n", errtype); + } + } else if(setControlBWE == 1) { + err = WebRtcIsacfix_ControlBwe(ISAC_main_inst, rateBPS, framesize, fixedFL); + } + + if (payloadSize != 0) { + err = WebRtcIsacfix_SetMaxPayloadSize(ISAC_main_inst, payloadSize); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\n\n Error in SetMaxPayloadSize: %d.\n\n", errtype); + exit(EXIT_FAILURE); + } + } + if (payloadRate != 0) { + err = WebRtcIsacfix_SetMaxRate(ISAC_main_inst, payloadRate); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\n\n Error in SetMaxRateInBytes: %d.\n\n", errtype); + exit(EXIT_FAILURE); + } + } + + *speechType = 1; + + + while (endfile == 0) { + + if(testNum == 7 && (rand()%2 == 0)) { + err = WebRtcIsacfix_EncoderInit(ISAC_main_inst, CodingMode); + /* Error check */ + if (err < 0) { + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\n\n Error in encoderinit: %d.\n\n", errtype); + } + + err = WebRtcIsacfix_DecoderInit(ISAC_main_inst); + /* Error check */ + if (err < 0) { + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\n\n Error in decoderinit: %d.\n\n", errtype); + } + } + + + cur_framesmpls = 0; + while (1) { + /* Read 10 ms speech block */ + if (nbTest != 1) { + endfile = readframe(shortdata, inp, FRAMESAMPLES_10ms); + } else { + endfile = readframe(shortdata, inp, (FRAMESAMPLES_10ms/2)); + } + + if (testNum == 7) { + srand(time(NULL)); + } + + /* iSAC encoding */ + if (!(testNum == 3 && framecnt == 0)) { + if (nbTest != 1) { + short bwe; + + /* Encode */ + stream_len = WebRtcIsacfix_Encode(ISAC_main_inst, + shortdata, + (WebRtc_Word16*)streamdata); + + /* If packet is ready, and CE testing, call the different API functions + from the internal API. */ + if (stream_len>0) { + if (testCE == 1) { + err = WebRtcIsacfix_ReadBwIndex((WebRtc_Word16*)streamdata, &bwe); + stream_len = WebRtcIsacfix_GetNewBitStream( + ISAC_main_inst, + bwe, + scale, + (WebRtc_Word16*)streamdata); + } else if (testCE == 2) { + /* transcode function not supported */ + } else if (testCE == 3) { + /* Only for Function testing. The functions should normally + not be used in this way */ + + err = WebRtcIsacfix_GetDownLinkBwIndex(ISAC_main_inst, &bwe); + /* Error Check */ + if (err < 0) { + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\nError in getSendBWE: %d.\n", errtype); + } + + err = WebRtcIsacfix_UpdateUplinkBw(ISAC_main_inst, bwe); + /* Error Check */ + if (err < 0) { + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\nError in setBWE: %d.\n", errtype); + } + + } + } + } else { +#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED + stream_len = WebRtcIsacfix_EncodeNb(ISAC_main_inst, + shortdata, + streamdata); +#else + stream_len = -1; +#endif + } + } + else + { + break; + } + + if (stream_len < 0 || err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\nError in encoder: %d.\n", errtype); + } else { + if (fwrite(streamdata, sizeof(char), + stream_len, outbits) != (size_t)stream_len) { + return -1; + } + } + + cur_framesmpls += FRAMESAMPLES_10ms; + + /* read next bottleneck rate */ + if (f_bn != NULL) { + int aux_var; + if (fscanf(f_bn, "%d", &aux_var) == EOF) { + /* Set pointer to beginning of file */ + fseek(f_bn, 0L, SEEK_SET); + if (fscanf(f_bn, "%d", &aux_var) == EOF) { + exit(0); + } + } + bottleneck = (WebRtc_Word16)aux_var; + if (CodingMode == 1) { + WebRtcIsacfix_Control(ISAC_main_inst, bottleneck, framesize); + } + } + + /* exit encoder loop if the encoder returned a bitstream */ + if (stream_len != 0) break; + } + + /* make coded sequence to short be inreasing */ + /* the length the decoder expects */ + if (testNum == 4) { + stream_len += 10; + } + + /* make coded sequence to long be decreasing */ + /* the length the decoder expects */ + if (testNum == 5) { + stream_len -= 10; + } + + if (testNum == 6) { + srand(time(NULL)); + for (i = 0; i < stream_len; i++ ) { + streamdata[i] = rand(); + } + } + + /* set pointer to beginning of file */ + if (fp_gns != NULL) { + if (fscanf(fp_gns, "%d", &cur_delay) == EOF) { + fseek(fp_gns, 0L, SEEK_SET); + if (fscanf(fp_gns, "%d", &cur_delay) == EOF) { + exit(0); + } + } + } + + /* simulate packet handling through NetEq and the modem */ + if (!(testNum == 3 && framecnt == 0)) { + if (gns == 0) { + get_arrival_time(cur_framesmpls, stream_len, bottleneck, + &BN_data); + } else { + get_arrival_time2(cur_framesmpls, cur_delay, &BN_data); + } + } + + /* packet not dropped */ + if (cur_delay != -1) { + + /* Error test number 10, garbage data */ + if (testNum == 10) { + for ( i = 0; i < stream_len; i++) { + streamdata[i] = (short) (streamdata[i] + (short) rand()); + } + } + + if (testNum != 9) { + err = WebRtcIsacfix_UpdateBwEstimate(ISAC_main_inst, + streamdata, + stream_len, + BN_data.rtp_number, + BN_data.send_time, + BN_data.arrival_time); + + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\nError in decoder: %d.\n", errtype); + } + } +#ifdef _DEBUG + fprintf(stderr," \rframe = %7d", framecnt); +#endif + + if( readLoss == 1 ) { + if( fread( &lostFrame, sizeof(WebRtc_Word16), 1, plFile ) != 1 ) { + rewind( plFile ); + } + lostFrame = !lostFrame; + } else { + lostFrame = (rand()%100 < packetLossPercent); + } + + + + /* iSAC decoding */ + if( lostFrame && framecnt > 0) { + if (nbTest !=2) { + declen = WebRtcIsacfix_DecodePlc(ISAC_main_inst, + decoded, prevFrameSize ); + } else { +#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED + declen = WebRtcIsacfix_DecodePlcNb(ISAC_main_inst, decoded, + prevFrameSize ); +#else + declen = -1; +#endif + } + lostPackets++; + } else { + if (nbTest !=2 ) { + short FL; + /* Call getFramelen, only used here for function test */ + err = WebRtcIsacfix_ReadFrameLen((WebRtc_Word16*)streamdata, &FL); + declen = WebRtcIsacfix_Decode( ISAC_main_inst, streamdata, stream_len, + decoded, speechType ); + /* Error check */ + if (err<0 || declen<0 || FL!=declen) { + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\nError in decode_B/or getFrameLen: %d.\n", errtype); + } + prevFrameSize = declen/480; + + } else { +#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED + declen = WebRtcIsacfix_DecodeNb( ISAC_main_inst, streamdata, + stream_len, decoded, speechType ); +#else + declen = -1; +#endif + prevFrameSize = declen/240; + } + } + + if (declen <= 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); + printf("\nError in decoder: %d.\n", errtype); + } + + /* Write decoded speech frame to file */ + if (fwrite(decoded, sizeof(WebRtc_Word16), + declen, outp) != (size_t)declen) { + return -1; + } + // fprintf( ratefile, "%f \n", stream_len / ( ((double)declen)/ + // ((double)FS) ) * 8 ); + } else { + lostPackets++; + } + framecnt++; + + totalsmpls += declen; + totalbits += 8 * stream_len; + kbps = ((double) FS) / ((double) cur_framesmpls) * 8.0 * + stream_len / 1000.0;// kbits/s + + /* Error test number 10, garbage data */ + if (testNum == 10) { + if ( (seedfile = fopen(SEED_FILE, "a+t") ) == NULL ) { + printf( "Error: Could not open file %s\n", SEED_FILE); + } + else { + fprintf(seedfile, "ok\n\n"); + fclose(seedfile); + } + } + +#ifdef _DEBUG + + fy = fopen("bit_rate.dat", "a"); + fprintf(fy, "Frame %i = %0.14f\n", framecnt, kbps); + fclose(fy); + +#endif /* _DEBUG */ + + } + printf("\nLost Frames %d ~ %4.1f%%\n", lostPackets, + (double)lostPackets/(double)framecnt*100.0 ); + printf("\n\ntotal bits = %d bits", totalbits); + printf("\nmeasured average bitrate = %0.3f kbits/s", + (double)totalbits *(FS/1000) / totalsmpls); + printf("\n"); + +#ifdef _DEBUG + /* fprintf(stderr,"\n\ntotal bits = %d bits", totalbits); + fprintf(stderr,"\nmeasured average bitrate = %0.3f kbits/s", + (double)totalbits *(FS/1000) / totalsmpls); + fprintf(stderr,"\n"); + */ +#endif /* _DEBUG */ + + /* Runtime statistics */ + + + runtime = (double)(((double)clock()/(double)CLOCKS_PER_SEC)-starttime); + length_file = ((double)framecnt*(double)declen/FS); + printf("\n\nLength of speech file: %.1f s\n", length_file); + printf("Time to run iSAC: %.2f s (%.2f %% of realtime)\n\n", + runtime, (100*runtime/length_file)); + printf("\n\n_______________________________________________\n"); + + fclose(inp); + fclose(outp); + fclose(outbits); + + if ( testCE == 1) { + WebRtcIsacfix_FreeInternal(ISAC_main_inst); + } + WebRtcIsacfix_Free(ISAC_main_inst); + return 0; +} diff --git a/src/modules/audio_coding/codecs/isac/fix/test/test_iSACfixfloat.c b/src/modules/audio_coding/codecs/isac/fix/test/test_iSACfixfloat.c new file mode 100644 index 0000000000..57c30cad96 --- /dev/null +++ b/src/modules/audio_coding/codecs/isac/fix/test/test_iSACfixfloat.c @@ -0,0 +1,693 @@ +/* + * 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. + */ + +/* + * test_iSACfixfloat.c + * + * Test compatibility and quality between floating- and fixed-point code + * */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* include API */ +#include "isac.h" +#include "isacfix.h" + + +/* max number of samples per frame (= 60 ms frame) */ +#define MAX_FRAMESAMPLES 960 +/* number of samples per 10ms frame */ +#define FRAMESAMPLES_10ms 160 +/* sampling frequency (Hz) */ +#define FS 16000 + + + +/* Runtime statistics */ +#include <time.h> +#define CLOCKS_PER_SEC 1000 + + + +// FILE *histfile, *ratefile; + + +/* function for reading audio data from PCM file */ +int readframe(WebRtc_Word16 *data, FILE *inp, int length) { + + short k, rlen, status = 0; + + rlen = fread(data, sizeof(WebRtc_Word16), length, inp); + if (rlen < length) { + for (k = rlen; k < length; k++) + data[k] = 0; + status = 1; + } + + return status; +} + +typedef struct { + WebRtc_UWord32 send_time; /* samples */ + WebRtc_UWord32 arrival_time; /* samples */ + WebRtc_UWord32 sample_count; /* samples */ + WebRtc_UWord16 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); + BN_data->send_time += current_framesamples; + + if (BN_data->arrival_time < BN_data->sample_count) + BN_data->arrival_time = BN_data->sample_count; + + BN_data->rtp_number++; +} + + + +int main(int argc, char* argv[]) +{ + + char inname[50], outname[50], bottleneck_file[50], bitfilename[60], bitending[10]="_bits.pcm"; + FILE *inp, *outp, *f_bn, *bitsp; + int framecnt, endfile; + + + int i,j,errtype, plc=0; + WebRtc_Word16 CodingMode; + WebRtc_Word16 bottleneck; + + WebRtc_Word16 framesize = 30; /* ms */ + //WebRtc_Word16 framesize = 60; /* To invoke cisco complexity case at frame 2252 */ + + int cur_framesmpls, err; + + /* Runtime statistics */ + double starttime; + double runtime; + double length_file; + + WebRtc_Word16 stream_len = 0; + WebRtc_Word16 declen; + + WebRtc_Word16 shortdata[FRAMESAMPLES_10ms]; + WebRtc_Word16 decoded[MAX_FRAMESAMPLES]; + WebRtc_UWord16 streamdata[600]; + WebRtc_Word16 speechType[1]; + +// WebRtc_Word16 *iSACstruct; + + char version_number[20]; + int mode=-1, tmp, nbTest=0; /*,sss;*/ + +#ifdef _DEBUG + FILE *fy; + double kbps; + int totalbits =0; + int totalsmpls =0; +#endif /* _DEBUG */ + + + + + /* only one structure used for ISAC encoder */ + ISAC_MainStruct *ISAC_main_inst; + ISACFIX_MainStruct *ISACFIX_main_inst; + + BottleNeckModel BN_data; + f_bn = NULL; + +#ifdef _DEBUG + fy = fopen("bit_rate.dat", "w"); + fclose(fy); + fy = fopen("bytes_frames.dat", "w"); + fclose(fy); +#endif /* _DEBUG */ + + +//histfile = fopen("histo.dat", "ab"); +//ratefile = fopen("rates.dat", "ab"); + + /* handling wrong input arguments in the command line */ + if ((argc<6) || (argc>10)) { + printf("\n\nWrong number of arguments or flag values.\n\n"); + + printf("\n"); + WebRtcIsacfix_version(version_number); + printf("iSAC version %s \n\n", version_number); + + printf("Usage:\n\n"); + printf("./kenny.exe [-I] bottleneck_value infile outfile \n\n"); + printf("with:\n"); + + printf("[-I] : if -I option is specified, the coder will use\n"); + printf(" an instantaneous Bottleneck value. If not, it\n"); + printf(" will be an adaptive Bottleneck value.\n\n"); + printf("bottleneck_value : the value of the bottleneck provided either\n"); + printf(" as a fixed value (e.g. 25000) or\n"); + printf(" read from a file (e.g. bottleneck.txt)\n\n"); + printf("[-m] mode : Mode (encoder - decoder):\n"); + printf(" : 0 - float - float \n"); + printf(" : 1 - float - fix \n"); + printf(" : 2 - fix - float \n"); + printf(" : 3 - fix - fix \n"); + printf("[-PLC] : Test PLC packetlosses\n"); + printf("[-NB] num : Test NB interfaces, num=1 encNB, num=2 decNB\n"); + printf("infile : Normal speech input file\n\n"); + printf("outfile : Speech output file\n\n"); + printf("Example usage:\n\n"); + printf("./kenny.exe -I bottleneck.txt -m 1 speechIn.pcm speechOut.pcm\n\n"); + exit(0); + + } + + + printf("--------------------START---------------------\n\n"); + WebRtcIsac_version(version_number); + printf("iSAC FLOAT version %s \n", version_number); + WebRtcIsacfix_version(version_number); + printf("iSAC FIX version %s \n\n", version_number); + + CodingMode = 0; + tmp=1; + for (i = 1; i < argc;i++) + { + if (!strcmp ("-I", argv[i])) + { + printf("\nInstantaneous BottleNeck\n"); + CodingMode = 1; + i++; + tmp=0; + } + + if (!strcmp ("-m", argv[i])) { + mode=atoi(argv[i+1]); + i++; + } + + if (!strcmp ("-PLC", argv[i])) + { + plc=1; + } + + if (!strcmp ("-NB", argv[i])) + { + nbTest = atoi(argv[i + 1]); + i++; + } + + } + + if(mode<0) { + printf("\nError! Mode must be set: -m 0 \n"); + exit(0); + } + + if (CodingMode == 0) + { + printf("\nAdaptive BottleNeck\n"); + } + + + + /* Get Bottleneck value */ + bottleneck = atoi(argv[2-tmp]); + if (bottleneck == 0) + { + sscanf(argv[2-tmp], "%s", bottleneck_file); + f_bn = fopen(bottleneck_file, "rb"); + if (f_bn == NULL) + { + printf("No value provided for BottleNeck and cannot read file %s.\n", bottleneck_file); + exit(0); + } + else { + printf("reading bottleneck rates from file %s\n\n",bottleneck_file); + if (fscanf(f_bn, "%d", &bottleneck) == EOF) { + /* Set pointer to beginning of file */ + fseek(f_bn, 0L, SEEK_SET); + fscanf(f_bn, "%d", &bottleneck); + } + + /* Bottleneck is a cosine function + * Matlab code for writing the bottleneck file: + * BottleNeck_10ms = 20e3 + 10e3 * cos((0:5999)/5999*2*pi); + * fid = fopen('bottleneck.txt', 'wb'); + * fprintf(fid, '%d\n', BottleNeck_10ms); fclose(fid); + */ + } + } + else + { + printf("\nfixed bottleneck rate of %d bits/s\n\n", bottleneck); + } + + + + /* Get Input and Output files */ + sscanf(argv[argc-2], "%s", inname); + sscanf(argv[argc-1], "%s", outname); + + if ((inp = fopen(inname,"rb")) == NULL) { + printf(" iSAC: Cannot read file %s.\n", inname); + exit(1); + } + if ((outp = fopen(outname,"wb")) == NULL) { + printf(" iSAC: Cannot write file %s.\n", outname); + exit(1); + } + printf("\nInput:%s\nOutput:%s\n", inname, outname); + + i=0; + while (outname[i]!='\0') { + bitfilename[i]=outname[i]; + i++; + } + i-=4; + for (j=0;j<9;j++, i++) + bitfilename[i]=bitending[j]; + bitfilename[i]='\0'; + if ((bitsp = fopen(bitfilename,"wb")) == NULL) { + printf(" iSAC: Cannot read file %s.\n", bitfilename); + exit(1); + } + printf("Bitstream:%s\n\n", bitfilename); + + + + starttime = clock()/(double)CLOCKS_PER_SEC; /* Runtime statistics */ + + + /* Initialize the ISAC and BN structs */ + WebRtcIsac_create(&ISAC_main_inst); +/* WebRtcIsacfix_AssignSize(&sss); + iSACstruct=malloc(sss); + WebRtcIsacfix_Assign(&ISACFIX_main_inst,iSACstruct);*/ + WebRtcIsacfix_Create(&ISACFIX_main_inst); + + BN_data.send_time = 0; + BN_data.arrival_time = 0; + BN_data.sample_count = 0; + BN_data.rtp_number = 0; + + /* Initialize encoder and decoder */ + framecnt= 0; + endfile = 0; + + if (mode==0) { /* Encode using FLOAT, decode using FLOAT */ + + printf("Coding mode: Encode using FLOAT, decode using FLOAT \n\n"); + + /* Init iSAC FLOAT */ + WebRtcIsac_EncoderInit(ISAC_main_inst, CodingMode); + WebRtcIsac_DecoderInit(ISAC_main_inst); + if (CodingMode == 1) { + err = WebRtcIsac_Control(ISAC_main_inst, bottleneck, framesize); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsac_GetErrorCode(ISAC_main_inst); + printf("\n\n Error in initialization: %d.\n\n", errtype); + // exit(EXIT_FAILURE); + } + } + + } else if (mode==1) { /* Encode using FLOAT, decode using FIX */ + + printf("Coding mode: Encode using FLOAT, decode using FIX \n\n"); + + /* Init iSAC FLOAT */ + WebRtcIsac_EncoderInit(ISAC_main_inst, CodingMode); + WebRtcIsac_DecoderInit(ISAC_main_inst); + if (CodingMode == 1) { + err = WebRtcIsac_Control(ISAC_main_inst, bottleneck, framesize); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsac_GetErrorCode(ISAC_main_inst); + printf("\n\n Error in initialization: %d.\n\n", errtype); + // exit(EXIT_FAILURE); + } + } + + /* Init iSAC FIX */ + WebRtcIsacfix_EncoderInit(ISACFIX_main_inst, CodingMode); + WebRtcIsacfix_DecoderInit(ISACFIX_main_inst); + if (CodingMode == 1) { + err = WebRtcIsacfix_Control(ISACFIX_main_inst, bottleneck, framesize); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\n Error in initialization: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + } + } else if (mode==2) { /* Encode using FIX, decode using FLOAT */ + + printf("Coding mode: Encode using FIX, decode using FLOAT \n\n"); + + /* Init iSAC FLOAT */ + WebRtcIsac_EncoderInit(ISAC_main_inst, CodingMode); + WebRtcIsac_DecoderInit(ISAC_main_inst); + if (CodingMode == 1) { + err = WebRtcIsac_Control(ISAC_main_inst, bottleneck, framesize); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsac_GetErrorCode(ISAC_main_inst); + printf("\n\n Error in initialization: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + } + + /* Init iSAC FIX */ + WebRtcIsacfix_EncoderInit(ISACFIX_main_inst, CodingMode); + WebRtcIsacfix_DecoderInit(ISACFIX_main_inst); + if (CodingMode == 1) { + err = WebRtcIsacfix_Control(ISACFIX_main_inst, bottleneck, framesize); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\n Error in initialization: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + } + } else if (mode==3) { + + printf("Coding mode: Encode using FIX, decode using FIX \n\n"); + + WebRtcIsacfix_EncoderInit(ISACFIX_main_inst, CodingMode); + WebRtcIsacfix_DecoderInit(ISACFIX_main_inst); + if (CodingMode == 1) { + err = WebRtcIsacfix_Control(ISACFIX_main_inst, bottleneck, framesize); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\n Error in initialization: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + } + + } else + printf("Mode must be value between 0 and 3\n"); + *speechType = 1; + +//#define BI_TEST 1 +#ifdef BI_TEST + err = WebRtcIsacfix_SetMaxPayloadSize(ISACFIX_main_inst, 300); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\n Error in setMaxPayloadSize: %d.\n\n", errtype); + fclose(inp); + fclose(outp); + fclose(bitsp); + return(EXIT_FAILURE); + } +#endif + + + while (endfile == 0) { + + cur_framesmpls = 0; + while (1) { + /* Read 10 ms speech block */ + if (nbTest != 1) + endfile = readframe(shortdata, inp, FRAMESAMPLES_10ms); + else + endfile = readframe(shortdata, inp, (FRAMESAMPLES_10ms/2)); + + /* iSAC encoding */ + + if (mode==0 || mode ==1) { + stream_len = WebRtcIsac_Encode(ISAC_main_inst, shortdata, streamdata); + if (stream_len < 0) { + /* exit if returned with error */ + errtype=WebRtcIsac_GetErrorCode(ISAC_main_inst); + printf("\n\nError in encoder: %d.\n\n", errtype); + // exit(EXIT_FAILURE); + } + } else if (mode==2 || mode==3) { + /* iSAC encoding */ + if (nbTest != 1) + stream_len = WebRtcIsacfix_Encode(ISACFIX_main_inst, shortdata, streamdata); + else + stream_len = WebRtcIsacfix_EncodeNb(ISACFIX_main_inst, shortdata, streamdata); + + if (stream_len < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\nError in encoder: %d.\n\n", errtype); + // exit(EXIT_FAILURE); + } + } + + cur_framesmpls += FRAMESAMPLES_10ms; + + /* read next bottleneck rate */ + if (f_bn != NULL) { + if (fscanf(f_bn, "%d", &bottleneck) == EOF) { + /* Set pointer to beginning of file */ + fseek(f_bn, 0L, SEEK_SET); + fscanf(f_bn, "%d", &bottleneck); + } + if (CodingMode == 1) { + if (mode==0 || mode==1) + WebRtcIsac_Control(ISAC_main_inst, bottleneck, framesize); + else if (mode==2 || mode==3) + WebRtcIsacfix_Control(ISACFIX_main_inst, bottleneck, framesize); + } + } + + /* exit encoder loop if the encoder returned a bitstream */ + if (stream_len != 0) break; + } + + fwrite(streamdata, 1, stream_len, bitsp); /* NOTE! Writes bytes to file */ + + /* simulate packet handling through NetEq and the modem */ + get_arrival_time(cur_framesmpls, stream_len, bottleneck, + &BN_data); +//***************************** + if (1){ + if (mode==0) { + err = WebRtcIsac_UpdateBwEstimate(ISAC_main_inst, + streamdata, + stream_len, + BN_data.rtp_number, + BN_data.arrival_time); + + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsac_GetErrorCode(ISAC_main_inst); + printf("\n\nError in decoder: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + /* iSAC decoding */ + declen = WebRtcIsac_Decode(ISAC_main_inst, + streamdata, + stream_len, + decoded, + speechType); + if (declen <= 0) { + /* exit if returned with error */ + errtype=WebRtcIsac_GetErrorCode(ISAC_main_inst); + printf("\n\nError in decoder: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + } else if (mode==1) { + + err = WebRtcIsac_UpdateBwEstimate(ISAC_main_inst, + streamdata, + stream_len, + BN_data.rtp_number, + BN_data.arrival_time); + err = WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_main_inst, + streamdata, + stream_len, + BN_data.rtp_number, + BN_data.arrival_time); + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\nError in decoder: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + + declen = WebRtcIsac_Decode(ISAC_main_inst, + streamdata, + stream_len, + decoded, + speechType); + + /* iSAC decoding */ + if (plc && (framecnt+1)%10 == 0) { + if (nbTest !=2 ) + declen = WebRtcIsacfix_DecodePlc( ISACFIX_main_inst, decoded, 1 ); + else + declen = WebRtcIsacfix_DecodePlcNb( ISACFIX_main_inst, decoded, 1 ); + } else { + if (nbTest !=2 ) + declen = WebRtcIsacfix_Decode(ISACFIX_main_inst, + streamdata, + stream_len, + decoded, + speechType); + else + declen = WebRtcIsacfix_DecodeNb(ISACFIX_main_inst, + streamdata, + stream_len, + decoded, + speechType); + } + + if (declen <= 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\nError in decoder: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + } else if (mode==2) { + err = WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_main_inst, + streamdata, + stream_len, + BN_data.rtp_number, + BN_data.arrival_time); + + err = WebRtcIsac_UpdateBwEstimate(ISAC_main_inst, + streamdata, + stream_len, + BN_data.rtp_number, + BN_data.arrival_time); + + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsac_GetErrorCode(ISAC_main_inst); + printf("\n\nError in decoder: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + /* iSAC decoding */ + declen = WebRtcIsac_Decode(ISAC_main_inst, + streamdata, + stream_len, + decoded, + speechType); + if (declen <= 0) { + /* exit if returned with error */ + errtype=WebRtcIsac_GetErrorCode(ISAC_main_inst); + printf("\n\nError in decoder: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + } else if (mode==3) { + err = WebRtcIsacfix_UpdateBwEstimate(ISACFIX_main_inst, + streamdata, + stream_len, + BN_data.rtp_number, + BN_data.send_time, + BN_data.arrival_time); + + if (err < 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\nError in decoder: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + /* iSAC decoding */ + + if (plc && (framecnt+1)%10 == 0) { + if (nbTest !=2 ) + declen = WebRtcIsacfix_DecodePlc( ISACFIX_main_inst, decoded, 1 ); + else + declen = WebRtcIsacfix_DecodePlcNb( ISACFIX_main_inst, decoded, 1 ); + } else { + if (nbTest !=2 ) + declen = WebRtcIsacfix_Decode(ISACFIX_main_inst, + streamdata, + stream_len, + decoded, + speechType); + else + declen = WebRtcIsacfix_DecodeNb(ISACFIX_main_inst, + streamdata, + stream_len, + decoded, + speechType); + } + if (declen <= 0) { + /* exit if returned with error */ + errtype=WebRtcIsacfix_GetErrorCode(ISACFIX_main_inst); + printf("\n\nError in decoder: %d.\n\n", errtype); + //exit(EXIT_FAILURE); + } + } + + /* Write decoded speech frame to file */ + fwrite(decoded, sizeof(WebRtc_Word16), declen, outp); + } + + fprintf(stderr," \rframe = %d", framecnt); + framecnt++; + + + +#ifdef _DEBUG + + totalsmpls += declen; + totalbits += 8 * stream_len; + kbps = ((double) FS) / ((double) cur_framesmpls) * 8.0 * stream_len / 1000.0;// kbits/s + fy = fopen("bit_rate.dat", "a"); + fprintf(fy, "Frame %i = %0.14f\n", framecnt, kbps); + fclose(fy); + +#endif /* _DEBUG */ + + } + +#ifdef _DEBUG + printf("\n\ntotal bits = %d bits", totalbits); + printf("\nmeasured average bitrate = %0.3f kbits/s", (double)totalbits *(FS/1000) / totalsmpls); + printf("\n"); +#endif /* _DEBUG */ + + /* Runtime statistics */ + runtime = (double)(clock()/(double)CLOCKS_PER_SEC-starttime); + length_file = ((double)framecnt*(double)declen/FS); + printf("\n\nLength of speech file: %.1f s\n", length_file); + printf("Time to run iSAC: %.2f s (%.2f %% of realtime)\n\n", runtime, (100*runtime/length_file)); + printf("---------------------END----------------------\n"); + + fclose(inp); + fclose(outp); + + WebRtcIsac_Free(ISAC_main_inst); + WebRtcIsacfix_Free(ISACFIX_main_inst); + + + +// fclose(histfile); +// fclose(ratefile); + + return 0; + +} + + |