Commit 38df9e18 authored by kinuthia's avatar kinuthia
Browse files

Merge branch '708-dpid-and-aeid-command-line-options-robustness' into...

Merge branch '708-dpid-and-aeid-command-line-options-robustness' into 730-directivity-pattern-id-not-set-correctly
parents 93521388 a5a68bcd
Loading
Loading
Loading
Loading
+55 −5
Original line number Diff line number Diff line
@@ -155,6 +155,9 @@ typedef struct
#endif
#endif
    uint16_t acousticEnvironmentId;
#ifdef FIX_708_DPID_COMMAND_LINE
    int16_t Opt_dpid_on;
#endif
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
} DecArguments;

@@ -484,9 +487,6 @@ int main(
     * Configure the decoder
     *------------------------------------------------------------------------------------------*/

/*------------------------------------------------------------------------------------------*
 * Configure the decoder
 *------------------------------------------------------------------------------------------*/
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
@@ -511,7 +511,11 @@ int main(
#ifdef API_5MS_BASELINE
                                       arg.tsmEnabled, arg.enable5ms,
#endif
                                       arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
                                       arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
#ifdef FIX_708_DPID_COMMAND_LINE
                                       arg.Opt_dpid_on,
#endif
                                       arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -519,7 +523,7 @@ int main(


    /*------------------------------------------------------------------------------------------*
     * Configure VoIP mode
     * Configure split rendering
     *------------------------------------------------------------------------------------------*/

#ifdef API_5MS
@@ -1084,6 +1088,9 @@ static bool parseCmdlIVAS_dec(

    arg->renderConfigEnabled = false;
    arg->renderConfigFilename = NULL;
#ifdef FIX_708_DPID_COMMAND_LINE
    arg->Opt_dpid_on = 0;
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
    arg->outputMdFilename = NULL;
@@ -1501,14 +1508,52 @@ static bool parseCmdlIVAS_dec(
        }
        else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
        {
#ifdef FIX_708_DPID_COMMAND_LINE
            int16_t id;

            arg->Opt_dpid_on = 1;
#endif
            ++i;
            int16_t tmp;
            tmp = 0;
            while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS )
            {
#ifdef FIX_708_DPID_COMMAND_LINE
                id = (int16_t) atoi( argv[i + tmp] );

                if ( !is_digits_only( argv[i + tmp] ) || id < 0 )
                {
                    fprintf( stdout, "Error: Invalid directivity pattern ID specified: %s\n\n", argv[i + tmp] );
                    usage_dec();
                    return false;
                }

                arg->directivityPatternId[tmp] = id;
#else
                arg->directivityPatternId[tmp] = (int16_t) atoi( argv[i + tmp] );
#endif
                ++tmp;
            }

#ifdef FIX_708_DPID_COMMAND_LINE
            if ( tmp == 0 )
            {
                if ( argc - i <= 4 || argv[i][0] == '-' )
                {
                    fprintf( stderr, "Error: Directivity pattern ID not specified!\n\n" );
                    usage_dec();
                    return false;
                }

                if ( !is_number( argv[i + tmp] ) )
                {
                    fprintf( stdout, "Error: Invalid directivity pattern ID specified: %s\n\n", argv[i + tmp] );
                    usage_dec();
                    return false;
                }
            }
#endif

            i += tmp;
        }

@@ -1699,7 +1744,12 @@ static void usage_dec( void )
    fprintf( stdout, "-force R            : Force specific binaural rendering mode, R = (TDREND, CLDFBREND),\n" );
#endif
    fprintf( stdout, "-exof File          : External orientation File for external orientation trajectory\n" );
#ifdef FIX_708_DPID_COMMAND_LINE
    fprintf( stdout, "-dpid ID            : Directivity pattern ID(s) = (1,2,3,4) (space-separated list of up\n" );
    fprintf( stdout, "                      to 4 numbers can be specified) for binaural output configuration\n" );
#else
    fprintf( stdout, "-dpid ID            : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration\n" );
#endif
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
+7 −0
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ typedef enum
    IVAS_ERR_INVALID_OUTPUT_FORMAT,
    IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED,
    IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED,
#ifdef FIX_708_DPID_COMMAND_LINE
    IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED,
#endif
    IVAS_ERR_INVALID_HRTF,
    IVAS_ERR_INVALID_INPUT_FORMAT,
    IVAS_ERR_INVALID_INDEX, /* ToDo: should be merged with IVAS_ERR_INDEX_OUT_OF_BOUNDS */
@@ -253,6 +256,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
#endif
        case IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED:
            return "External orientation not supported";
#ifdef FIX_708_DPID_COMMAND_LINE
        case IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED:
            return "Directivity not supported";
#endif
        case IVAS_ERR_INVALID_HRTF:
            return "Unsupported HRTF filter set";
        case IVAS_ERR_INVALID_INPUT_FORMAT:
+2 −0
Original line number Diff line number Diff line
@@ -167,6 +167,8 @@

#define FIX_718_JBM_MD_UDPATE                           /* Fhg: fix issue #718, wrong setting of the update flag in the TD obj renderer in the JBM path */
#define FIX_719_CRASH_IN_CLEANUP                        /* VA: issue 719: fix Decoder crash after call to goto to cleanup */
#define FIX_708_DPID_COMMAND_LINE                       /* issue 708: sanity checks for '-dpid' command-line */



/* ################## End BE DEVELOPMENT switches ######################### */
+10 −0
Original line number Diff line number Diff line
@@ -3109,6 +3109,16 @@ static ivas_error doSanityChecks_IVAS(
        }
    }

#ifdef FIX_708_DPID_COMMAND_LINE
    if ( st_ivas->hDecoderConfig->Opt_dpid_on )
    {
        if ( !( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
        {
            return IVAS_ERROR( IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, "Wrong set-up: Directivity is not supported in this output configuration." );
        }
    }
#endif

    if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
    {
        if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == AUDIO_CONFIG_EXTERNAL )
+3 −0
Original line number Diff line number Diff line
@@ -903,6 +903,9 @@ typedef struct decoder_config_structure
    float non_diegetic_pan_gain;            /* non diegetic panning gain*/
    int16_t Opt_AMR_WB;                     /* flag indicating AMR-WB IO mode */
    int16_t Opt_ExternalOrientation;        /* indiates whether external orientations are used */
#ifdef FIX_708_DPID_COMMAND_LINE
    int16_t Opt_dpid_on; /* indicates whether Directivity pattern option is used */
#endif

    /* temp. development parameters */
#ifdef DEBUGGING
Loading