/* encoderMultiChannelTest.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 encoder on multichannels */ /* Input: the reconstructed signal : each frame (80 16 bits PCM values) */ /* on a row of a text CSV file */ /* Output: 15 parameters on each row of a text CSV file. */ /* */ /* 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 "typedef.h" #include "codecParameters.h" #include "utils.h" #include "testUtils.h" #include "bcg729/encoder.h" #define MAX_CHANNEL_NBR 50 int main(int argc, char *argv[] ) { int i,j,k; /*** 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]; /*** input and output buffers ***/ int16_t inputBuffer[L_FRAME]; /* output buffer: the signal */ uint16_t outputBuffer[NB_PARAMETERS]; /* output buffer: an array containing the 15 parameters */ uint8_t bitStream[10]; /* binary output of the encoder */ bcg729EncoderChannelContextStruct *encoderChannelContext[MAX_CHANNEL_NBR]; /* context, one per channel */ uint16_t inputIsBinary[MAX_CHANNEL_NBR]; /* store the information on each input file format (CVS or binary PCM) */ /*** inits ***/ /* open the input file */ for (i=0; i