Commit eb8674f1 authored by Jan Brouwer's avatar Jan Brouwer
Browse files

Merge branch 'philips/contribution-38-control-metadata-reverb-draft' into...

Merge branch 'philips/contribution-38-control-metadata-reverb-draft' into 'philips/contribution-38-control-metadata-reverb'

[ref-using-main] Contribution 38 update: support for multiple acoustic environments plus early reflections in text configuration

See merge request !848
parents b30f4e5f 9d54d59b
Loading
Loading
Loading
Loading
Loading
+30 −15
Original line number Diff line number Diff line
@@ -92,10 +92,6 @@ static
#define IVAS_PUBLIC_ORIENT_TRK_REF_VEC     ( 3 )
#define IVAS_PUBLIC_ORIENT_TRK_REF_VEC_LEV ( 4 )

#ifdef CONTROL_METADATA_REVERB
#define ACOUSTIC_ENVIRONMENT_ID ( 0 )
#endif

#ifdef VARIABLE_SPEED_DECODING
#define VARIABLE_SPEED_FETCH_FRAMESIZE_MS 20
#endif
@@ -161,6 +157,10 @@ typedef struct
#endif
#endif

#ifdef CONTROL_METADATA_REVERB
    uint16_t acousticEnvironmentId;
#endif

} DecArguments;


@@ -617,7 +617,9 @@ int main(
        }

#ifdef CONTROL_METADATA_REVERB
        if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, ACOUSTIC_ENVIRONMENT_ID, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK )
        if ( arg.outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB )
        {
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK )
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
@@ -627,12 +629,12 @@ int main(
            }
            else if ( error != IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING )
            {
            fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID );
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
                goto cleanup;
            }
#endif
            renderConfig.room_acoustics.override = true;

        }
#endif
        if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -988,6 +990,10 @@ static bool parseCmdlIVAS_dec(
#endif
#endif

#ifdef CONTROL_METADATA_REVERB
    arg->acousticEnvironmentId = 0;
#endif

    /*-----------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/
@@ -1348,7 +1354,13 @@ static bool parseCmdlIVAS_dec(
                fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" );
            }
        }

#ifdef CONTROL_METADATA_REVERB
        else if ( strcmp( argv_to_upper, "-AEID" ) == 0 )
        {
            ++i;
            arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
        }
#endif
        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/
@@ -1533,6 +1545,9 @@ static void usage_dec( void )
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
#endif
    fprintf( stdout, "-exof File          : External orientation file for external orientation trajectory\n" );
#ifdef CONTROL_METADATA_REVERB
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
#endif
#ifdef DEBUG_MODE_INFO
#ifdef DEBUG_MODE_INFO_TWEAK
    fprintf( stdout, "-info <folder>      : specify subfolder name for debug output\n" );
+38 −4
Original line number Diff line number Diff line
@@ -65,9 +65,6 @@
#define RENDERER_MAX_METADATA_LENGTH      8192
#define RENDERER_MAX_METADATA_LINE_LENGTH 1024

#ifdef CONTROL_METADATA_REVERB
#define ACOUSTIC_ENVIRONMENT_ID 0
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) SPLIT_REND_MAX_BRATE / FRAMES_PER_SEC ) + 7 ) >> 3 ) + SPLIT_REND_ADDITIONAL_BYTES_TO_READ )
#endif
@@ -178,6 +175,9 @@ typedef struct
    float lfeConfigElevation;
    bool lfeCustomRoutingEnabled;
    char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH];
#ifdef CONTROL_METADATA_REVERB
    uint16_t acousticEnvironmentId;
#endif
#ifdef FIX_488_SYNC_DELAY
    float syncMdDelay;
#endif
@@ -209,6 +209,9 @@ typedef enum
#endif
    CmdLnOptionId_referenceVectorFile,
    CmdLnOptionId_exteriorOrientationFile,
#ifdef CONTROL_METADATA_REVERB
    CmdLnOptionId_acousticEnvironmentId,
#endif
#ifdef FIX_488_SYNC_DELAY
    CmdLnOptionId_syncMdDelay,
#endif
@@ -351,6 +354,14 @@ static const CmdLnParser_Option cliOptions[] = {
        .matchShort = "exof",
        .description = "External orientation trajectory file for simulation of external orientations",
    },
#ifdef CONTROL_METADATA_REVERB
    {
        .id = CmdLnOptionId_acousticEnvironmentId,
        .match = "acoustic_environment_id",
        .matchShort = "aeid",
        .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration",
    },
#endif
#ifdef FIX_488_SYNC_DELAY
    {
        .id = CmdLnOptionId_syncMdDelay,
@@ -1084,6 +1095,21 @@ int main(

        if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef CONTROL_METADATA_REVERB
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK )
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Invalid room acoustics configuration parameters\n\n" );
                    exit( -1 );
                }
            }
            else
            {
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId );
                exit( -1 );
            }
#endif
            renderConfig.room_acoustics.override = TRUE;
        }

@@ -2516,7 +2542,9 @@ static CmdlnArgs defaultArgs(

    args.lfeCustomRoutingEnabled = false;
    clearString( args.inLfePanningMatrixFile );

#ifdef CONTROL_METADATA_REVERB
    args.acousticEnvironmentId = 0;
#endif
#ifdef FIX_488_SYNC_DELAY
    args.syncMdDelay = 0;
#endif
@@ -2659,6 +2687,12 @@ static void parseOption(
                exit( -1 );
            }
            break;
#ifdef CONTROL_METADATA_REVERB
        case CmdLnOptionId_acousticEnvironmentId:
            assert( numOptionValues == 1 );
            args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 );
            break;
#endif
#ifdef FIX_488_SYNC_DELAY
        case CmdLnOptionId_syncMdDelay:
            assert( numOptionValues == 1 );
+849 −154

File changed.

Preview size limit exceeded, changes collapsed.

+5 −2
Original line number Diff line number Diff line
@@ -68,8 +68,11 @@ ivas_error RenderConfigReader_checkValues(
ivas_error RenderConfigReader_read(
#ifdef CONTROL_METADATA_REVERB
    RenderConfigReader *pRenderConfigReader, /* i  : RenderConfigReader handle              */
    const char *pRenderConfigPath,           /* i  : Renderer configuration file path       */
    const char *pRenderConfigPath            /* i  : Renderer configuration file path       */
#if ( defined SPLIT_REND_WITH_HEAD_ROT ) || ( defined DEBUGGING )
    ,
    IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o  : Renderer configuration handle          */
#endif
#else
    RenderConfigReader *pRenderConfigReader, /* i  : RenderConfigReader handle              */
    IVAS_RENDER_CONFIG_HANDLE hRenderConfig  /* o  : Renderer configuration handle          */
+11 −7
Original line number Diff line number Diff line
[roomAcoustics]
frequencyGridCount = 1;
acousticEnvironmentCount = 1;

[frequencyGrid:0]
method = individualFrequencies
method = individualFrequencies;
frequencies = [
        20.0, 25.0, 31.5, 40.0, 
        50.0, 63.0, 80.0, 100.0, 
@@ -8,21 +12,21 @@ frequencies = [
        800.0, 1000.0, 1250.0, 1600.0, 
        2000.0, 2500.0, 3150.0, 4000.0, 
        5000.0, 6300.0, 8000.0, 10000.0, 
        12500.0, 16000.0, 20000.0]
        12500.0, 16000.0, 20000.0];

[acousticEnvironment:0]
id = 0
frequencyGridIndex = 0
predelay = 0.08163
id = 0;
frequencyGridIndex = 0;
predelay = 0.08163;
rt60 = [
        0.81275, 0.61888, 0.45111, 0.34672, 0.46683, 0.53987, 0.61874, 0.70291, 0.66657, 0.73037,
        0.75090, 0.72470, 0.75486, 0.75857, 0.76844, 0.74999, 0.77622, 0.78227, 0.77441, 0.74688, 
        0.73521, 0.73782, 0.71928, 0.71708, 0.71465, 0.60592, 0.52031, 0.51768, 0.52102, 0.37956,
        0.30786]
        0.30786];

dsr = [
        0.00019952621, 0.00019952621, 7.9432844e-05, 5.0118702e-05, 7.943284e-06, 6.3095763e-06, 6.3095763e-06, 7.943284e-06, 1e-05, 1e-05,
        7.943284e-06, 1e-05, 1e-05, 1e-05, 7.943284e-06, 1e-05, 1e-05, 7.943284e-06, 7.943284e-06, 6.3095763e-06,
        6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 3.1622776e-06, 3.1622776e-06, 3.1622776e-06, 6.3095763e-07, 3.1622776e-07,
        3.1622776e-07]
        3.1622776e-07];
Loading