Commit ab094fd7 authored by multrus's avatar multrus
Browse files

[cleanup] accept BINAURAL_AUDIO_CMDLINE

parent 08558c6b
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -98,9 +98,7 @@ typedef struct
    char *outputBitstreamFilename;
    int32_t inputFs;
    IVAS_ENC_INPUT_FORMAT inputFormat;
#ifdef BINAURAL_AUDIO_CMDLINE
    bool is_binaural;
#endif
    EncInputFormatConfig inputFormatConfig;
    bool max_bwidth_user;
    IVAS_ENC_BANDWIDTH maxBandwidth;
@@ -365,29 +363,17 @@ int main(
    switch ( arg.inputFormat )
    {
        case IVAS_ENC_INPUT_MONO:
#ifdef BINAURAL_AUDIO_CMDLINE
            if ( ( error = IVAS_ENC_ConfigureForMono( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, caConfig, arg.inputFormatConfig.stereoToMonoDownmix, arg.is_binaural ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_ENC_ConfigureForMono( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, caConfig, arg.inputFormatConfig.stereoToMonoDownmix ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nIVAS_ENC_ConfigureForMono failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
                goto cleanup;
            }
            break;
        case IVAS_ENC_INPUT_STEREO:
#ifdef BINAURAL_AUDIO_CMDLINE
#ifdef DEBUGGING
            if ( ( error = IVAS_ENC_ConfigureForStereo( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.is_binaural, arg.inputFormatConfig.stereoMode ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_ENC_ConfigureForStereo( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.is_binaural ) ) != IVAS_ERR_OK )
#endif
#else
#ifdef DEBUGGING
            if ( ( error = IVAS_ENC_ConfigureForStereo( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.stereoMode ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_ENC_ConfigureForStereo( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig ) ) != IVAS_ERR_OK )
#endif
#endif
            {
                fprintf( stderr, "\nIVAS_ENC_ConfigureForStereo failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
@@ -880,9 +866,7 @@ static void initArgStruct( EncArguments *arg )
    arg->outputBitstreamFilename = NULL;
    arg->inputFs = 0;
    arg->inputFormat = IVAS_ENC_INPUT_MONO;
#ifdef BINAURAL_AUDIO_CMDLINE
    arg->is_binaural = false;
#endif
    arg->inputFormatConfig.stereoToMonoDownmix = false;
    arg->max_bwidth_user = false;
    arg->maxBandwidth = IVAS_ENC_BANDWIDTH_UNDEFINED;
@@ -1302,13 +1286,11 @@ static bool parseCmdlIVAS_enc(
            }
#endif /* DEBUGGING */
        }
#ifdef BINAURAL_AUDIO_CMDLINE
        else if ( strcmp( argv_to_upper, "-BINAURAL" ) == 0 )
        {
            arg->is_binaural = true;
            i++;
        }
#endif
        else if ( strcmp( argv_to_upper, "-ISM" ) == 0 )
        {
            arg->inputFormat = IVAS_ENC_INPUT_ISM;
@@ -1731,9 +1713,7 @@ static void usage_enc( void )
    fprintf( stdout, "                      alternatively, B can be a text file where each line contains \"nb_frames B\"\n" );
    fprintf( stdout, "-no_delay_cmp       : Turn off delay compensation\n" );
    fprintf( stdout, "-stereo_dmx_evs     : Activate stereo downmix function for EVS.\n" );
#ifdef BINAURAL_AUDIO_CMDLINE
    fprintf( stdout, "-binaural           : Optional indication that input is binaural audio (to be used with -stereo or -stereo_dmx_evs)\n" );
#endif
    fprintf( stdout, "-mime               : Mime output bitstream file format\n" );
    fprintf( stdout, "                      The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).\n" );
    fprintf( stdout, "                      default output bitstream file format is G.192\n" );
+0 −4
Original line number Diff line number Diff line
@@ -61,12 +61,8 @@ void stereo_dmx_evs_enc(
    STEREO_DMX_EVS_ENC_HANDLE hStereoDmxEVS,                    /* i/o: Stereo downmix for EVS encoder handle   */
    const int32_t input_Fs,                                     /* i  : input sampling rate                     */
    int16_t data[CPE_CHANNELS * L_FRAME48k],                    /* i/o: input signal                            */
#ifdef BINAURAL_AUDIO_CMDLINE
    const int16_t n_samples,                                    /* i  : number of input samples                 */
    const bool is_binaural                                      /* i  : indication that input is binaural audio */
#else
    const int16_t n_samples                                     /* i  : number of input samples                 */
#endif
);

/*! r: number of channels to be analysed */
+0 −1
Original line number Diff line number Diff line
@@ -153,7 +153,6 @@



#define BINAURAL_AUDIO_CMDLINE                          /* issue 491: Implement Commandline-Option for Binaural Audio */
#define FIX_570_TCX_LPC_WRITE                           /* FhG: fix issue 570: LPC bitstream writer in TCX */
#define FIX_506                                         /* FhG: Compiler warnings */
#define FIX_511_OPTIMIZE_PARAMBIN_GAIN_FETCH            /* Nokia: Issue 511, significant optimization of parametric binauralizer gain fetching. */
+0 −2
Original line number Diff line number Diff line
@@ -1081,9 +1081,7 @@ typedef struct encoder_config_structure
    int16_t nchan_inp;                              /* number of input audio channels */
    int16_t max_bwidth;                             /* maximum encoded bandwidth */
    IVAS_FORMAT ivas_format;                        /* IVAS format */
#ifdef BINAURAL_AUDIO_CMDLINE
    int16_t is_binaural;                            /* flag indicating if input is binaural audio */
#endif

    int16_t element_mode_init;                      /* element mode used at initialization */
    int16_t stereo_dmx_evs;                         /* flag to indicate that stereo downmix for EVS encoder */
+0 −6
Original line number Diff line number Diff line
@@ -1116,12 +1116,8 @@ void stereo_dmx_evs_enc(
    STEREO_DMX_EVS_ENC_HANDLE hStereoDmxEVS, /* i/o: Stereo downmix for EVS encoder handle  */
    const int32_t input_Fs,                  /* i  : input sampling rate                    */
    int16_t data[CPE_CHANNELS * L_FRAME48k], /* i/o: input signal                           */
#ifdef BINAURAL_AUDIO_CMDLINE
    const int16_t n_samples, /* i  : number of input samples                 */
    const bool is_binaural   /* i  : indication that input is binaural audio */
#else
    const int16_t n_samples /* i  : number of input samples                */
#endif
)
{
    int16_t n;
@@ -1138,12 +1134,10 @@ void stereo_dmx_evs_enc(

    int16_t input_frame;

#ifdef BINAURAL_AUDIO_CMDLINE
    if ( is_binaural )
    {
        /* use of is_binaural flag is to be considered */
    }
#endif

    input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC );

Loading