/* decoderMultiChannelTest.c Copyright (C) 2011 Belledonne Communications, Grenoble, France Author : Johan Pascal This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*****************************************************************************/ /* */ /* Test Program for decoder on multichannels */ /* Input: 15 parameters and the frame erasure flag on each row of a */ /* a text CSV file in variable number of files */ /* Ouput: the reconstructed signal : each frame (80 16 bits PCM values) */ /* on a row of a text CSV file in same amount of files */ /* */ /* All arguments shall be filenames for input file */ /* output file keep the prefix and change the file extension to .out.multi*/ /* */ /*****************************************************************************/ #include #include #include #include #include #include "typedef.h" #include "codecParameters.h" #include "utils.h" #include "testUtils.h" #include "bcg729/decoder.h" #define MAX_CHANNEL_NBR 50 int main(int argc, char *argv[] ) { int i; /*** get calling argument ***/ char *filePrefix[MAX_CHANNEL_NBR]; getArgumentsMultiChannel(argc, argv, filePrefix); /* check argument and set filePrefix if needed */ /*** input and output file pointers ***/ FILE *fpInput[MAX_CHANNEL_NBR]; FILE *fpOutput[MAX_CHANNEL_NBR]; FILE *fpBinOutput[MAX_CHANNEL_NBR]; /*** input and output buffers ***/ uint16_t inputBuffer[NB_PARAMETERS+1]; /* input buffer: an array containing the 15 parameters and the frame erasure flag */ int16_t outputBuffer[L_FRAME]; /* output buffer: the reconstructed signal */ uint8_t bitStream[10]; /* binary input for the decoder */ bcg729DecoderChannelContextStruct *decoderChannelContext[MAX_CHANNEL_NBR]; /* context array, one per channel */ /*** inits ***/ for (i=0; i