Commit 477a5852 authored by vaclav's avatar vaclav
Browse files

address issues reported in #543; under BINAURAL_AUDIO_CMDLINE

parent a24d3b7e
Loading
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -1225,16 +1225,6 @@ static bool parseCmdlIVAS_enc(
         * IVAS Formats
         *-----------------------------------------------------------------*/

#ifdef BINAURAL_AUDIO_CMDLINE
        else if ( strcmp( argv_to_upper, "-BINAURAL" ) == 0 )
        {
            i++;
            if ( strcmp( argv_to_upper, "-BINAURAL" ) == 0 )
            {
                arg->is_binaural = true;
            }
        }
#endif
        else if ( strcmp( argv_to_upper, "-STEREO" ) == 0 )
        {
            i++;
@@ -1312,6 +1302,13 @@ 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;
@@ -1703,9 +1700,6 @@ static void usage_enc( void )
    fprintf( stdout, "Options:\n" );
    fprintf( stdout, "--------\n" );
    fprintf( stdout, "EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba, -masa, -mc\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, "-stereo             : Stereo format \n" );
    fprintf( stdout, "-ism (+)Ch Files    : ISM format \n" );
    fprintf( stdout, "                      where Ch specifies the number of ISMs (1-4)\n" );
@@ -1737,6 +1731,9 @@ 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" );
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@
#define FIX_TODO_FD_CNG_SBA_CLEANUP                     /* FhG: BE, address TODO comment in fd_cng_enc */
#define ENHANCED_STEREO_DMX                             /* Orange : Contribution 48 - Enhanced stereo downmix. */

#define BINAURAL_AUDIO_CMDLINE
#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. */
+1 −1
Original line number Diff line number Diff line
@@ -1084,7 +1084,7 @@ typedef struct encoder_config_structure
    int16_t max_bwidth;                             /* maximum encoded bandwidth */
    IVAS_FORMAT ivas_format;                        /* IVAS format */
#ifdef BINAURAL_AUDIO_CMDLINE
	bool is_binaural;                               /* flag indicating if input is binaural audio */
    int16_t is_binaural;                            /* flag indicating if input is binaural audio */
#endif

    int16_t element_mode_init;                      /* element mode used at initialization */
+16 −14
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ ivas_error IVAS_ENC_ConfigureForMono(

    hIvasEnc->st_ivas->hEncoderConfig->ivas_format = MONO_FORMAT;
#ifdef BINAURAL_AUDIO_CMDLINE
    hIvasEnc->st_ivas->hEncoderConfig->is_binaural = is_binaural;
    hIvasEnc->st_ivas->hEncoderConfig->is_binaural = (int16_t) is_binaural;
#endif

    if ( downmixFromStereo )
@@ -337,7 +337,7 @@ ivas_error IVAS_ENC_ConfigureForStereo(
    hEncoderConfig->nchan_inp = 2;
    hEncoderConfig->ivas_format = STEREO_FORMAT;
#ifdef BINAURAL_AUDIO_CMDLINE
    hEncoderConfig->is_binaural = is_binaural;
    hEncoderConfig->is_binaural = (int16_t) is_binaural;
#endif

#ifdef DEBUGGING
@@ -933,6 +933,13 @@ static ivas_error configureEncoder(
        return error;
    }

#ifdef BINAURAL_AUDIO_CMDLINE
    if ( hEncoderConfig->is_binaural && !( ( hEncoderConfig->ivas_format == MONO_FORMAT && hEncoderConfig->stereo_dmx_evs ) || hEncoderConfig->ivas_format == STEREO_FORMAT ) )
    {
        return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "'-binaural' option is supported only with '-stereo' or '-stereo_dmx_evs'" );
    }
#endif

    /*-----------------------------------------------------------------*
     * Finalize initialization
     *-----------------------------------------------------------------*/
@@ -1540,12 +1547,6 @@ static ivas_error printConfigInfo_enc(
        if ( hEncoderConfig->stereo_dmx_evs )
        {
            fprintf( stdout, "IVAS format:            stereo downmix to bit-exact EVS mono\n" );
#ifdef BINAURAL_AUDIO_CMDLINE
            if ( hEncoderConfig->is_binaural )
            {
                fprintf( stdout, "Optional indication:    binaural audio\n" );
            }
#endif
        }
        else
        {
@@ -1580,12 +1581,6 @@ static ivas_error printConfigInfo_enc(
        {
            fprintf( stdout, "IVAS format:            stereo - MDCT stereo\n" );
        }
#endif
#ifdef BINAURAL_AUDIO_CMDLINE
        if ( hEncoderConfig->is_binaural )
        {
            fprintf( stdout, "Optional indication:    binaural audio\n" );
        }
#endif
    }
    else if ( hEncoderConfig->ivas_format == ISM_FORMAT )
@@ -1654,6 +1649,13 @@ static ivas_error printConfigInfo_enc(
        }
    }

#ifdef BINAURAL_AUDIO_CMDLINE
    if ( hEncoderConfig->is_binaural )
    {
        fprintf( stdout, "Optional indication:    binaural audio\n" );
    }
#endif

    /*-----------------------------------------------------------------*
     * Print CNG update interval, if DTX is activated
     *-----------------------------------------------------------------*/