Loading apps/decoder.c +7 −3 Original line number Diff line number Diff line Loading @@ -587,10 +587,14 @@ int main( } renderConfig.room_acoustics.override = true; } #else renderConfig.room_acoustics.override = true; #ifdef CONTROL_METADATA_DIRECTIVITY if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, renderConfig.directivity ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid directivity configuration parameters\n\n" ); goto cleanup; } #endif #endif if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ #define CONTROL_METADATA_REVERB /* Philips: reverb configuration change to binary format */ #ifdef CONTROL_METADATA_REVERB #define CONTROL_METADATA_EARLY_REFLECTIONS /* Philips/Qualcomm: early reflections extension to reverb configuration */ #define CONTROL_METADATA_DIRECTIVITY /* Ericsson: Directivity renderer configuration */ #endif #define FIX_563_PARAMMC_LIMITER /* FhG: issue 563: fix ILD limiter when coming from silence w/o transient set */ #define FIX_560_VAD_FLAG /* Eri: Issue 560 - VAD flag issue for unified stereo */ Loading lib_util/render_config_reader.c +109 −1 Original line number Diff line number Diff line Loading @@ -123,6 +123,9 @@ struct RenderConfigReader FrequencyGrid *pFG; /* Frequency grids */ uint32_t nAE; /* Number of acoustic environments */ AcousticEnv *pAE; /* Acoustic environments */ #ifdef CONTROL_METADATA_DIRECTIVITY float directivity[3]; /* Source directivity */ #endif #endif }; Loading Loading @@ -947,6 +950,59 @@ static ivas_error read_txt_bool( } return IVAS_ERR_INVALID_RENDER_CONFIG; } #ifdef CONTROL_METADATA_DIRECTIVITY /*-----------------------------------------------------------------------------------------* * Function get_bin_angle() * Gets an angle value in degrees [0,360] *-----------------------------------------------------------------------------------------*/ static ivas_error get_bin_angle( RenderConfigReader *this, /* i/o : Render config reader handle */ float *pResult /* o : Angle value */ ) { ivas_error error; uint32_t value; if ( ( error = read_bin_bits( this, &value, 5 ) ) != IVAS_ERR_OK ) { return error; } *pResult = usdequant( (int16_t) value, 0.0f, 20.0f ); return IVAS_ERR_OK; } /*-----------------------------------------------------------------------------------------* * Function get_bin_outer_attenuation () * Gets an outer attenuation value [3.1623e-05,1.0], or in dB: [-90,0] *-----------------------------------------------------------------------------------------*/ static ivas_error get_bin_outer_attenuation( RenderConfigReader *this, /* i/o : Render config reader handle */ float *pResult /* o : Attenuation value */ ) { ivas_error error; uint32_t value; float logval, att; if ( ( error = read_bin_bits( this, &value, 5 ) ) != IVAS_ERR_OK ) { return error; } logval = usdequant( (int16_t) value, -90.0f, 3.0f ); att = powf( 10, logval / 20.0f ); *pResult = att; return IVAS_ERR_OK; } #endif #else /*-----------------------------------------------------------------------------------------* * Function read_bool() Loading Loading @@ -1696,13 +1752,40 @@ static ivas_error RenderConfigReader_readBinReverb( return error; } } #endif #ifdef CONTROL_METADATA_DIRECTIVITY /* Has source directivity */ if ( ( error = read_bin_bool( pRenderConfigReader, &value ) ) != IVAS_ERR_OK ) { return error; } if ( value == true ) { if ( ( error = get_bin_angle( pRenderConfigReader, &pRenderConfigReader->directivity[0] ) ) != IVAS_ERR_OK ) { return error; } if ( ( error = get_bin_angle( pRenderConfigReader, &pRenderConfigReader->directivity[1] ) ) != IVAS_ERR_OK ) { return error; } if ( ( error = get_bin_outer_attenuation( pRenderConfigReader, &pRenderConfigReader->directivity[2] ) ) != IVAS_ERR_OK ) { return error; } } else { pRenderConfigReader->directivity[0] = 360.0f; pRenderConfigReader->directivity[1] = 360.0f; pRenderConfigReader->directivity[2] = 1.0f; } #endif } /* Cleanup */ free( pRenderConfigReader->pBitstream ); // TODO: Check the values, apply DSR epsilon return IVAS_ERR_OK; } Loading Loading @@ -2550,6 +2633,31 @@ ivas_error RenderConfigReader_getAcousticEnvironment( } return IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING; } #ifdef CONTROL_METADATA_DIRECTIVITY /*------------------------------------------------------------------------------------------* * RenderConfigReader_getDirectivity() * * Gets directivity data pointer *------------------------------------------------------------------------------------------*/ ivas_error RenderConfigReader_getDirectivity( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ float *directivity /* o : directivity */ ) { uint16_t n; if ( pRenderConfigReader == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } mvr2r( pRenderConfigReader->directivity, directivity, 3 ); return IVAS_ERR_OK; } #endif #endif /*------------------------------------------------------------------------------------------* Loading lib_util/render_config_reader.h +7 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,13 @@ ivas_error RenderConfigReader_getAcousticEnvironment( ivas_error RenderConfigReader_checkValues( IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ); #ifdef CONTROL_METADATA_DIRECTIVITY ivas_error RenderConfigReader_getDirectivity( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ uint16_t id, /* i : Acoustic environment ID */ float *directivity /* o : directivity */ ); #endif #endif /* Reads a configuration */ Loading scripts/reverb/acoustic_environment_renderer_directivity.cfg 0 → 100644 +34 −0 Original line number Diff line number Diff line [frequencyGrid:0] method = individualFrequencies frequencies = [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 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] [acousticEnvironment:0] id = 0 frequencyGridIndex = 0 predelay = 0.1 rt60 = [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, 0.60031] dsr = [ 1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, 1.2589251e-08, 1.9952632e-08, 2.511887e-08, 3.9810708e-08, 1e-07, 1.9952633e-07, 3.981071e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-07, 2.511887e-07, 1.2589251e-07, 1e-07, 6.309576e-08, 3.1622776e-08, 2.511887e-08] [directivity:0] directivity = [0.0, 360.0, 0.2512] Loading
apps/decoder.c +7 −3 Original line number Diff line number Diff line Loading @@ -587,10 +587,14 @@ int main( } renderConfig.room_acoustics.override = true; } #else renderConfig.room_acoustics.override = true; #ifdef CONTROL_METADATA_DIRECTIVITY if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, renderConfig.directivity ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid directivity configuration parameters\n\n" ); goto cleanup; } #endif #endif if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ #define CONTROL_METADATA_REVERB /* Philips: reverb configuration change to binary format */ #ifdef CONTROL_METADATA_REVERB #define CONTROL_METADATA_EARLY_REFLECTIONS /* Philips/Qualcomm: early reflections extension to reverb configuration */ #define CONTROL_METADATA_DIRECTIVITY /* Ericsson: Directivity renderer configuration */ #endif #define FIX_563_PARAMMC_LIMITER /* FhG: issue 563: fix ILD limiter when coming from silence w/o transient set */ #define FIX_560_VAD_FLAG /* Eri: Issue 560 - VAD flag issue for unified stereo */ Loading
lib_util/render_config_reader.c +109 −1 Original line number Diff line number Diff line Loading @@ -123,6 +123,9 @@ struct RenderConfigReader FrequencyGrid *pFG; /* Frequency grids */ uint32_t nAE; /* Number of acoustic environments */ AcousticEnv *pAE; /* Acoustic environments */ #ifdef CONTROL_METADATA_DIRECTIVITY float directivity[3]; /* Source directivity */ #endif #endif }; Loading Loading @@ -947,6 +950,59 @@ static ivas_error read_txt_bool( } return IVAS_ERR_INVALID_RENDER_CONFIG; } #ifdef CONTROL_METADATA_DIRECTIVITY /*-----------------------------------------------------------------------------------------* * Function get_bin_angle() * Gets an angle value in degrees [0,360] *-----------------------------------------------------------------------------------------*/ static ivas_error get_bin_angle( RenderConfigReader *this, /* i/o : Render config reader handle */ float *pResult /* o : Angle value */ ) { ivas_error error; uint32_t value; if ( ( error = read_bin_bits( this, &value, 5 ) ) != IVAS_ERR_OK ) { return error; } *pResult = usdequant( (int16_t) value, 0.0f, 20.0f ); return IVAS_ERR_OK; } /*-----------------------------------------------------------------------------------------* * Function get_bin_outer_attenuation () * Gets an outer attenuation value [3.1623e-05,1.0], or in dB: [-90,0] *-----------------------------------------------------------------------------------------*/ static ivas_error get_bin_outer_attenuation( RenderConfigReader *this, /* i/o : Render config reader handle */ float *pResult /* o : Attenuation value */ ) { ivas_error error; uint32_t value; float logval, att; if ( ( error = read_bin_bits( this, &value, 5 ) ) != IVAS_ERR_OK ) { return error; } logval = usdequant( (int16_t) value, -90.0f, 3.0f ); att = powf( 10, logval / 20.0f ); *pResult = att; return IVAS_ERR_OK; } #endif #else /*-----------------------------------------------------------------------------------------* * Function read_bool() Loading Loading @@ -1696,13 +1752,40 @@ static ivas_error RenderConfigReader_readBinReverb( return error; } } #endif #ifdef CONTROL_METADATA_DIRECTIVITY /* Has source directivity */ if ( ( error = read_bin_bool( pRenderConfigReader, &value ) ) != IVAS_ERR_OK ) { return error; } if ( value == true ) { if ( ( error = get_bin_angle( pRenderConfigReader, &pRenderConfigReader->directivity[0] ) ) != IVAS_ERR_OK ) { return error; } if ( ( error = get_bin_angle( pRenderConfigReader, &pRenderConfigReader->directivity[1] ) ) != IVAS_ERR_OK ) { return error; } if ( ( error = get_bin_outer_attenuation( pRenderConfigReader, &pRenderConfigReader->directivity[2] ) ) != IVAS_ERR_OK ) { return error; } } else { pRenderConfigReader->directivity[0] = 360.0f; pRenderConfigReader->directivity[1] = 360.0f; pRenderConfigReader->directivity[2] = 1.0f; } #endif } /* Cleanup */ free( pRenderConfigReader->pBitstream ); // TODO: Check the values, apply DSR epsilon return IVAS_ERR_OK; } Loading Loading @@ -2550,6 +2633,31 @@ ivas_error RenderConfigReader_getAcousticEnvironment( } return IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING; } #ifdef CONTROL_METADATA_DIRECTIVITY /*------------------------------------------------------------------------------------------* * RenderConfigReader_getDirectivity() * * Gets directivity data pointer *------------------------------------------------------------------------------------------*/ ivas_error RenderConfigReader_getDirectivity( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ float *directivity /* o : directivity */ ) { uint16_t n; if ( pRenderConfigReader == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } mvr2r( pRenderConfigReader->directivity, directivity, 3 ); return IVAS_ERR_OK; } #endif #endif /*------------------------------------------------------------------------------------------* Loading
lib_util/render_config_reader.h +7 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,13 @@ ivas_error RenderConfigReader_getAcousticEnvironment( ivas_error RenderConfigReader_checkValues( IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ); #ifdef CONTROL_METADATA_DIRECTIVITY ivas_error RenderConfigReader_getDirectivity( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ uint16_t id, /* i : Acoustic environment ID */ float *directivity /* o : directivity */ ); #endif #endif /* Reads a configuration */ Loading
scripts/reverb/acoustic_environment_renderer_directivity.cfg 0 → 100644 +34 −0 Original line number Diff line number Diff line [frequencyGrid:0] method = individualFrequencies frequencies = [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 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] [acousticEnvironment:0] id = 0 frequencyGridIndex = 0 predelay = 0.1 rt60 = [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, 0.60031] dsr = [ 1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, 1.2589251e-08, 1.9952632e-08, 2.511887e-08, 3.9810708e-08, 1e-07, 1.9952633e-07, 3.981071e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-07, 2.511887e-07, 1.2589251e-07, 1e-07, 6.309576e-08, 3.1622776e-08, 2.511887e-08] [directivity:0] directivity = [0.0, 360.0, 0.2512]