diff --git a/apps/decoder.c b/apps/decoder.c index eaaf9b582da3f947316c400c695ff1b46ce5a694..889fde47983a552716d4a35e7122fa3eb452900e 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -162,6 +162,9 @@ typedef struct #ifdef FIX_1419_MONO_STEREO_UMX bool evsMode; #endif +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + IVAS_ROOM_SIZE_T roomSize; +#endif } DecArguments; @@ -497,9 +500,15 @@ int main( #ifdef IVAS_RTPDUMP arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; #endif +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, + arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.roomSize, arg.non_diegetic_pan_enabled, + arg.non_diegetic_pan_gain, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -1143,6 +1152,10 @@ static bool parseCmdlIVAS_dec( arg->objEditEnabled = false; arg->objEditFileName = NULL; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + arg->roomSize = IVAS_ROOM_SIZE_AUTO; +#endif + /*-----------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -1639,6 +1652,45 @@ static bool parseCmdlIVAS_dec( i++; } #endif +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + else if ( strcmp( argv_to_upper, "-ROOM_SIZE" ) == 0 ) + { + i++; + if ( argc - i <= 3 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Room size selector not specified!\n\n" ); + usage_dec(); + return false; + } + + if ( strlen( argv[i] ) != 1 ) + { + fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", argv[i] ); + usage_dec(); + return false; + } + switch ( argv[i][0] ) + { + case 'S': + case 's': + arg->roomSize = IVAS_ROOM_SIZE_SMALL; + break; + case 'M': + case 'm': + arg->roomSize = IVAS_ROOM_SIZE_MEDIUM; + break; + case 'L': + case 'l': + arg->roomSize = IVAS_ROOM_SIZE_LARGE; + break; + default: + fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", argv[i] ); + usage_dec(); + return false; + } + i++; + } +#endif /*-----------------------------------------------------------------* * Option not recognized @@ -1881,6 +1933,10 @@ static void usage_dec( void ) fprintf( stdout, "-obj_edit File : Object editing instructions file or NULL for built-in example\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" ); +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + fprintf( stdout, "-room_size (S|M|L) : Selects default reverb based on a room size (S - small | M - medium | L - large)\n" ); + fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration,\n" ); +#endif fprintf( stdout, "-q : Quiet mode, no frame counter\n" ); fprintf( stdout, " default is deactivated\n" ); #ifdef DEBUG_MODE_INFO @@ -4632,9 +4688,15 @@ ivas_error restartDecoder( uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : 65535; IVAS_AUDIO_CONFIG outputConfig = ( codec == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->renderFramesize, arg->customLsOutputEnabled, arg->hrtfReaderEnabled, + arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->roomSize, arg->non_diegetic_pan_enabled, + arg->non_diegetic_pan_gain, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->renderFramesize, arg->customLsOutputEnabled, arg->hrtfReaderEnabled, arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->non_diegetic_pan_enabled, arg->non_diegetic_pan_gain, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index e434c0ca2a2193c674c2919cf2737efab37db3ed..1be3fec6a9f8c009a46784c809d2146099ca6ce5 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -200,6 +200,9 @@ typedef struct IVAS_RENDER_FRAMESIZE render_framesize; uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; AcousticEnvironmentSequence aeSequence; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + IVAS_ROOM_SIZE_T reverbRoomSize; +#endif } CmdlnArgs; typedef enum @@ -230,7 +233,12 @@ typedef enum CmdLnOptionId_framing, CmdLnOptionId_syncMdDelay, CmdLnOptionId_directivityPatternId, +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + CmdLnOptionId_acousticEnvironmentId, + CmdLnOptionId_roomSize, +#else CmdLnOptionId_acousticEnvironmentId +#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -396,6 +404,14 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "aeid", .description = "Acoustic environment ID (number > 0) alternatively, it can be\na text file where each line contains \"ID duration\" for\nBINAURAL_ROOM_REVERB output.", }, +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + { + .id = CmdLnOptionId_roomSize, + .match = "room_size", + .matchShort = "rsz", + .description = "Selects default reverb based on a room size (S - small | M - medium | L - large)", + } +#endif }; @@ -1160,6 +1176,18 @@ int main( fprintf( stderr, "\nError in IVAS_REND_SetOrientationTrackingMode(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + + /* Set reverb room size if specified */ + if ( args.reverbRoomSize != IVAS_ROOM_SIZE_AUTO ) + { + if ( ( IVAS_REND_SetReverbRoomSize( hIvasRend, args.reverbRoomSize ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError setting reverb room size\n" ); + goto cleanup; + } + } +#endif /* Set up output custom layout configuration */ if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) @@ -2551,6 +2579,39 @@ static bool parseAcousticEnvironmentIds( return true; } +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + + +static bool parseReverbRoomSize( + char *value, + IVAS_ROOM_SIZE_T *reverbRoomSize ) +{ + if ( strlen( value ) != 1 ) + { + fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", value ); + return false; + } + + to_upper( value ); + switch ( value[0] ) + { + case 'S': + *reverbRoomSize = IVAS_ROOM_SIZE_SMALL; + break; + case 'M': + *reverbRoomSize = IVAS_ROOM_SIZE_MEDIUM; + break; + case 'L': + *reverbRoomSize = IVAS_ROOM_SIZE_LARGE; + break; + default: + fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", value ); + return false; + } + + return true; +} +#endif static bool checkRequiredArgs( @@ -2672,6 +2733,10 @@ static CmdlnArgs defaultArgs( args.aeSequence.pValidity = NULL; args.aeSequence.selected = 0; args.aeSequence.frameCounter = 0; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + + args.reverbRoomSize = IVAS_ROOM_SIZE_AUTO; +#endif return args; } @@ -2857,6 +2922,16 @@ static void parseOption( args->syncMdDelay = strtof( optionValues[0], NULL ); #endif break; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + case CmdLnOptionId_roomSize: + assert( numOptionValues == 1 ); + if ( !parseReverbRoomSize( optionValues[0], &args->reverbRoomSize ) ) + { + fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", optionValues[0] ); + exit( -1 ); + } + break; +#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 506b155ef52418a2bf062fc6b50c373243a27a48..7e91590225e449ef980c7d70d48ccd7ccb03a73f 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -173,6 +173,16 @@ typedef enum } IVAS_RENDER_FRAMESIZE; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +typedef enum +{ + IVAS_ROOM_SIZE_AUTO = -1, + IVAS_ROOM_SIZE_SMALL, + IVAS_ROOM_SIZE_MEDIUM, + IVAS_ROOM_SIZE_LARGE +} IVAS_ROOM_SIZE_T; +#endif + typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 7909d6959fdbe9d421c5627544359bb2cc96e544..0f49fd5a0b4d6ad055de1699f4324e5808c720a5 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1601,7 +1601,13 @@ typedef enum #define RV_FILTER_MAX_HISTORY ( 512 - 160 ) /* for longest history */ #define RV_LENGTH_NR_FC ( RV_FILTER_MAX_FFT_SIZE / 2 ) + 1 #define RV_LENGTH_NR_FC_16KHZ ( RV_FILTER_MAX_FFT_SIZE / 4 ) + 1 +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +#define IVAS_REVERB_DEFAULT_L_N_BANDS 31 +#define IVAS_REVERB_DEFAULT_M_N_BANDS 31 +#define IVAS_REVERB_DEFAULT_S_N_BANDS 60 +#else #define IVAS_REVERB_DEFAULT_N_BANDS 31 +#endif #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT #define IVAS_DEFAULT_AEID ( 65535 ) #endif @@ -1609,6 +1615,15 @@ typedef enum #define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) #define LR_IAC_LENGTH_NR_FC_16KHZ ( RV_LENGTH_NR_FC_16KHZ ) +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +typedef enum +{ + DEFAULT_REVERB_UNSET = -1, + DEFAULT_REVERB_SMALL, + DEFAULT_REVERB_MEDIUM, + DEFAULT_REVERB_LARGE, +} IVAS_DefaultReverbSize; +#endif /*----------------------------------------------------------------------------------* * FB mixer constants diff --git a/lib_com/options.h b/lib_com/options.h index 2eec2f3b95574b735588e8a6ebcf9246b5689774..a94a4f977508780b0bea0962a007ab4add7dbaaf 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,6 +179,7 @@ #define FIX_1427_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ #define FIX_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ +#define FIX_1318_ROOM_SIZE_CMD_LINE /* Philips/Nokia: Default room sizes support */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index b7b18ef2046b9508930d2f01dca4e3422f6b330a..f337611110d240d54c96db4fbc9d76de5398bbbc 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1542,16 +1542,72 @@ ivas_error ivas_init_decoder( } } +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + /*--------------------------------------------------------------------------* + * Allocate and initialize HRTF Statistics handle, get default reverb values + *--------------------------------------------------------------------------*/ +#else /*--------------------------------------------------------------------* * Allocate and initialize HRTF Statistics handle *--------------------------------------------------------------------*/ +#endif if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { + /* Init HRTF statistics */ if ( ( error = ivas_HRTF_statistics_init( &st_ivas->hHrtfStatistics, output_Fs ) ) != IVAS_ERR_OK ) { return error; } +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + /* Get default reverb values based on format, if custom values were not given */ + if ( st_ivas->hDecoderConfig->Opt_RendConfigCustom == 0 ) + { + IVAS_DefaultReverbSize defaultReverbSize; + switch ( st_ivas->hDecoderConfig->Opt_RoomSize ) + { + case IVAS_ROOM_SIZE_AUTO: + switch ( st_ivas->ivas_format ) + { + case ISM_FORMAT: + defaultReverbSize = DEFAULT_REVERB_LARGE; + break; + case SBA_FORMAT: + defaultReverbSize = DEFAULT_REVERB_SMALL; + break; + case MASA_FORMAT: + defaultReverbSize = DEFAULT_REVERB_SMALL; + break; + case MC_FORMAT: + defaultReverbSize = DEFAULT_REVERB_MEDIUM; + break; + case MASA_ISM_FORMAT: + defaultReverbSize = DEFAULT_REVERB_MEDIUM; + break; + case SBA_ISM_FORMAT: + defaultReverbSize = DEFAULT_REVERB_MEDIUM; + break; + default: + defaultReverbSize = DEFAULT_REVERB_LARGE; + } + break; + case IVAS_ROOM_SIZE_SMALL: + defaultReverbSize = DEFAULT_REVERB_SMALL; + break; + case IVAS_ROOM_SIZE_MEDIUM: + defaultReverbSize = DEFAULT_REVERB_MEDIUM; + break; + case IVAS_ROOM_SIZE_LARGE: + default: + defaultReverbSize = DEFAULT_REVERB_LARGE; + break; + } + if ( ( error = ivas_render_config_change_defaults( st_ivas->hRenderConfig, defaultReverbSize ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif } /*-----------------------------------------------------------------* diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 6d8e1856ae8b00d0889c5a3ce113ef851c662fdb..6a8fa5d72bfaa0e64005409ce44a46b25f595a02 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1007,15 +1007,18 @@ typedef struct jbm_metadata_structure typedef struct decoder_config_structure { - int32_t ivas_total_brate; /* IVAS total bitrate in bps */ - int32_t last_ivas_total_brate; /* last IVAS total bitrate in bps */ - int32_t output_Fs; /* output signal sampling frequency in Hz */ - int16_t nchan_out; /* number of output audio channels */ - AUDIO_CONFIG output_config; /* output audio configuration */ - int16_t Opt_LsCustom; /* indicates whether loudspeaker custom setup is used */ - int16_t Opt_HRTF_binary; /* indicates whether HRTF binary file is used */ - int16_t Opt_Headrotation; /* indicates whether head-rotation is used */ - int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ + int32_t ivas_total_brate; /* IVAS total bitrate in bps */ + int32_t last_ivas_total_brate; /* last IVAS total bitrate in bps */ + int32_t output_Fs; /* output signal sampling frequency in Hz */ + int16_t nchan_out; /* number of output audio channels */ + AUDIO_CONFIG output_config; /* output audio configuration */ + int16_t Opt_LsCustom; /* indicates whether loudspeaker custom setup is used */ + int16_t Opt_HRTF_binary; /* indicates whether HRTF binary file is used */ + int16_t Opt_Headrotation; /* indicates whether head-rotation is used */ + int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + IVAS_ROOM_SIZE_T Opt_RoomSize; /* Selected room size */ +#endif IVAS_HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */ int16_t Opt_non_diegetic_pan; /* indicates diegetic or not */ float non_diegetic_pan_gain; /* non diegetic panning gain*/ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index dba9cf23a27ec7c387255134e2eb990322794ab4..c4060993287a316dd074b2095a0395fdc56e6ba1 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -314,6 +314,9 @@ static void init_decoder_config( hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; hDecoderConfig->Opt_RendConfigCustom = 0; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + hDecoderConfig->Opt_RoomSize = IVAS_ROOM_SIZE_AUTO; +#endif hDecoderConfig->orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain = 0; @@ -456,12 +459,15 @@ ivas_error IVAS_DEC_Configure( const bool enableExternalOrientation, /* i : enable external orientations */ const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ const bool renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ - const bool non_diegetic_pan_enabled, /* i : enabled diegetic panning */ - const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ - const bool dpidEnabled, /* i : enable directivity pattern option */ - const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ - const bool objEditEnabled, /* i : enable object editing */ - const bool delayCompensationEnabled /* i : enable delay compensation */ +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + const IVAS_ROOM_SIZE_T roomSize, /* i : room size selector for reverb */ +#endif + const bool non_diegetic_pan_enabled, /* i : enabled diegetic panning */ + const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ + const bool dpidEnabled, /* i : enable directivity pattern option */ + const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ + const bool objEditEnabled, /* i : enable object editing */ + const bool delayCompensationEnabled /* i : enable delay compensation */ ) { Decoder_Struct *st_ivas; @@ -525,6 +531,9 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->orientation_tracking = orientation_tracking; hDecoderConfig->Opt_HRTF_binary = (int16_t) hrtfReaderEnabled; hDecoderConfig->Opt_RendConfigCustom = (int16_t) renderConfigEnabled; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + hDecoderConfig->Opt_RoomSize = roomSize; +#endif hDecoderConfig->Opt_non_diegetic_pan = (int16_t) non_diegetic_pan_enabled; hDecoderConfig->non_diegetic_pan_gain = non_diegetic_pan_gain; hDecoderConfig->Opt_delay_comp = (int16_t) delayCompensationEnabled; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 4a6c2c7a34e0a131d56e2fc7e43ffe5210787de9..51115744df462e366f549c4dcd8a0566aea354db 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -119,6 +119,9 @@ ivas_error IVAS_DEC_Configure( const bool enableExternalOrientation, /* i : enable external orientations */ const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ const bool renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + const IVAS_ROOM_SIZE_T roomSize, /* i : room size selector for reverb */ +#endif const bool non_diegetic_pan_enabled, /* i : enabled diegetic panning */ const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 112c6ac73ef0cecc89e9b23c51ff556ba8a60f6d..91bd0509907cc04df30fdbce056380aae98ac31b 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1343,6 +1343,13 @@ ivas_error ivas_render_config_init_from_rom( RENDER_CONFIG_HANDLE *hRenderConfig /* i/o: Renderer config handle */ ); +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +ivas_error ivas_render_config_change_defaults( + RENDER_CONFIG_HANDLE hRenderConfig, /* i/o: Renderer config handle */ + IVAS_DefaultReverbSize reverbDefault /* i: Reverb default size */ +); + +#endif /*----------------------------------------------------------------------------------* * Quaternion operations diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 63eaaf0227125765dd8f5889306083edd0050bb7..5cd5b18479700e67b02d4a8dbe9a2973ef43e351 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -45,8 +45,19 @@ * Local constants *-----------------------------------------------------------------------*/ +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +#define IVAS_REVERB_DEFAULT_L_PRE_DELAY 0.016f +#define IVAS_REVERB_DEFAULT_L_INPUT_DELAY 0.1f + +#define IVAS_REVERB_DEFAULT_S_PRE_DELAY 0.0125f +#define IVAS_REVERB_DEFAULT_S_INPUT_DELAY 0.0f + +#define IVAS_REVERB_DEFAULT_M_PRE_DELAY 0.0125f +#define IVAS_REVERB_DEFAULT_M_INPUT_DELAY 0.0f +#else #define IVAS_REVERB_DEFAULT_PRE_DELAY 0.016f #define IVAS_REVERB_DEFAULT_INPUT_DELAY 0.1f +#endif #define IVAS_REVERB_DEFAULT_USE_ER 0 @@ -116,17 +127,29 @@ ivas_error ivas_render_config_init_from_rom( #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT ( *hRenderConfig )->roomAcoustics.aeID = (uint16_t) IVAS_DEFAULT_AEID; #endif +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_L_N_BANDS; + ( *hRenderConfig )->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_L_PRE_DELAY; + ( *hRenderConfig )->roomAcoustics.inputPreDelay = IVAS_REVERB_DEFAULT_L_INPUT_DELAY; +#else ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS; ( *hRenderConfig )->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_PRE_DELAY; ( *hRenderConfig )->roomAcoustics.inputPreDelay = IVAS_REVERB_DEFAULT_INPUT_DELAY; +#endif ( *hRenderConfig )->roomAcoustics.use_er = IVAS_REVERB_DEFAULT_USE_ER; set_zero( &( *hRenderConfig )->roomAcoustics.pFc_input[0], CLDFB_NO_CHANNELS_MAX ); set_zero( &( *hRenderConfig )->roomAcoustics.pAcoustic_rt60[0], CLDFB_NO_CHANNELS_MAX ); set_zero( &( *hRenderConfig )->roomAcoustics.pAcoustic_dsr[0], CLDFB_NO_CHANNELS_MAX ); +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + mvr2r( ivas_reverb_default_large_fc, ( *hRenderConfig )->roomAcoustics.pFc_input, IVAS_REVERB_DEFAULT_L_N_BANDS ); + mvr2r( ivas_reverb_default_large_RT60, ( *hRenderConfig )->roomAcoustics.pAcoustic_rt60, IVAS_REVERB_DEFAULT_L_N_BANDS ); + mvr2r( ivas_reverb_default_large_DSR, ( *hRenderConfig )->roomAcoustics.pAcoustic_dsr, IVAS_REVERB_DEFAULT_L_N_BANDS ); +#else mvr2r( ivas_reverb_default_fc, ( *hRenderConfig )->roomAcoustics.pFc_input, IVAS_REVERB_DEFAULT_N_BANDS ); mvr2r( ivas_reverb_default_RT60, ( *hRenderConfig )->roomAcoustics.pAcoustic_rt60, IVAS_REVERB_DEFAULT_N_BANDS ); mvr2r( ivas_reverb_default_DSR, ( *hRenderConfig )->roomAcoustics.pAcoustic_dsr, IVAS_REVERB_DEFAULT_N_BANDS ); +#endif for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { @@ -153,3 +176,65 @@ ivas_error ivas_render_config_init_from_rom( return IVAS_ERR_OK; } + +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + +/*-------------------------------------------------------------------* + * ivas_render_config_change_defaults() + * + * Changes default values from ROM + *-------------------------------------------------------------------*/ + +ivas_error ivas_render_config_change_defaults( + RENDER_CONFIG_HANDLE hRenderConfig, /* i/o: Renderer config handle */ + IVAS_DefaultReverbSize defaultReverbSize /* i: Reverb default size */ +) +{ + switch ( defaultReverbSize ) + { + case DEFAULT_REVERB_SMALL: + hRenderConfig->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_S_N_BANDS; + hRenderConfig->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_S_PRE_DELAY; + hRenderConfig->roomAcoustics.inputPreDelay = IVAS_REVERB_DEFAULT_S_INPUT_DELAY; + hRenderConfig->roomAcoustics.use_er = IVAS_REVERB_DEFAULT_USE_ER; + set_zero( &hRenderConfig->roomAcoustics.pFc_input[0], CLDFB_NO_CHANNELS_MAX ); + set_zero( &hRenderConfig->roomAcoustics.pAcoustic_rt60[0], CLDFB_NO_CHANNELS_MAX ); + set_zero( &hRenderConfig->roomAcoustics.pAcoustic_dsr[0], CLDFB_NO_CHANNELS_MAX ); + + mvr2r( ivas_reverb_default_small_fc, hRenderConfig->roomAcoustics.pFc_input, IVAS_REVERB_DEFAULT_S_N_BANDS ); + mvr2r( ivas_reverb_default_small_RT60, hRenderConfig->roomAcoustics.pAcoustic_rt60, IVAS_REVERB_DEFAULT_S_N_BANDS ); + mvr2r( ivas_reverb_default_small_DSR, hRenderConfig->roomAcoustics.pAcoustic_dsr, IVAS_REVERB_DEFAULT_S_N_BANDS ); + break; + case DEFAULT_REVERB_MEDIUM: + hRenderConfig->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_M_N_BANDS; + hRenderConfig->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_M_PRE_DELAY; + hRenderConfig->roomAcoustics.inputPreDelay = IVAS_REVERB_DEFAULT_M_INPUT_DELAY; + hRenderConfig->roomAcoustics.use_er = IVAS_REVERB_DEFAULT_USE_ER; + set_zero( &hRenderConfig->roomAcoustics.pFc_input[0], CLDFB_NO_CHANNELS_MAX ); + set_zero( &hRenderConfig->roomAcoustics.pAcoustic_rt60[0], CLDFB_NO_CHANNELS_MAX ); + set_zero( &hRenderConfig->roomAcoustics.pAcoustic_dsr[0], CLDFB_NO_CHANNELS_MAX ); + + mvr2r( ivas_reverb_default_medium_fc, hRenderConfig->roomAcoustics.pFc_input, IVAS_REVERB_DEFAULT_M_N_BANDS ); + mvr2r( ivas_reverb_default_medium_RT60, hRenderConfig->roomAcoustics.pAcoustic_rt60, IVAS_REVERB_DEFAULT_M_N_BANDS ); + mvr2r( ivas_reverb_default_medium_DSR, hRenderConfig->roomAcoustics.pAcoustic_dsr, IVAS_REVERB_DEFAULT_M_N_BANDS ); + break; + case DEFAULT_REVERB_LARGE: + hRenderConfig->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_L_N_BANDS; + hRenderConfig->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_L_PRE_DELAY; + hRenderConfig->roomAcoustics.inputPreDelay = IVAS_REVERB_DEFAULT_L_INPUT_DELAY; + hRenderConfig->roomAcoustics.use_er = IVAS_REVERB_DEFAULT_USE_ER; + set_zero( &hRenderConfig->roomAcoustics.pFc_input[0], CLDFB_NO_CHANNELS_MAX ); + set_zero( &hRenderConfig->roomAcoustics.pAcoustic_rt60[0], CLDFB_NO_CHANNELS_MAX ); + set_zero( &hRenderConfig->roomAcoustics.pAcoustic_dsr[0], CLDFB_NO_CHANNELS_MAX ); + + mvr2r( ivas_reverb_default_large_fc, hRenderConfig->roomAcoustics.pFc_input, IVAS_REVERB_DEFAULT_L_N_BANDS ); + mvr2r( ivas_reverb_default_large_RT60, hRenderConfig->roomAcoustics.pAcoustic_rt60, IVAS_REVERB_DEFAULT_L_N_BANDS ); + mvr2r( ivas_reverb_default_large_DSR, hRenderConfig->roomAcoustics.pAcoustic_dsr, IVAS_REVERB_DEFAULT_L_N_BANDS ); + break; + default: + return IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING; + } + + return IVAS_ERR_OK; +} +#endif diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 0fad5fae2ff547b38342bc9b74216bda2a3f26d3..46f29eafa7c19e599d3db1562e265590ca286d7f 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -346,7 +346,79 @@ const float t_design_11_elevation[70] = * Reverberator ROM tables *-----------------------------------------------------------------------*/ -const float ivas_reverb_default_fc[IVAS_REVERB_DEFAULT_N_BANDS] = +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +const float ivas_reverb_default_small_fc[IVAS_REVERB_DEFAULT_S_N_BANDS] = +{ + 200.0f, 600.0f, 1000.0f, 1400.0f, 1800.0f, 2200.0f, 2600.0f, 3000.0f, 3400.0f, 3800.0f, + 4200.0f, 4600.0f, 5000.0f, 5400.0f, 5800.0f, 6200.0f, 6600.0f, 7000.0f, 7400.0f, 7800.0f, + 8200.0f, 8600.0f, 9000.0f, 9400.0f, 9800.0f, 10200.0f, 10600.0f, 11000.0f, 11400.0f, 11800.0f, + 12200.0f, 12600.0f, 13000.0f, 13400.0f, 13800.0f, 14200.0f, 14600.0f, 15000.0f, 15400.0f, 15800.0f, + 16200.0f, 16600.0f, 17000.0f, 17400.0f, 17800.0f, 18200.0f, 18600.0f, 19000.0f, 19400.0f, 19800.0f, + 20200.0f, 20600.0f, 21000.0f, 21400.0f, 21800.0f, 22200.0f, 22600.0f, 23000.0f, 23400.0f, 23800.0f +}; + +const float ivas_reverb_default_small_RT60[IVAS_REVERB_DEFAULT_S_N_BANDS] = +{ + 0.300000f, 0.273750f, 0.265941f, 0.263784f, 0.265572f, 0.261790f, 0.252988f, 0.245801f, 0.237429f, 0.228169f, + 0.219536f, 0.211116f, 0.203262f, 0.196144f, 0.189161f, 0.182436f, 0.176237f, 0.170114f, 0.164250f, 0.158791f, + 0.153349f, 0.148312f, 0.143266f, 0.138398f, 0.133929f, 0.129493f, 0.125309f, 0.121833f, 0.118321f, 0.115130f, + 0.112655f, 0.109958f, 0.107465f, 0.105311f, 0.103006f, 0.100783f, 0.098629f, 0.096469f, 0.094335f, 0.092217f, + 0.090115f, 0.088057f, 0.086034f, 0.084061f, 0.082327f, 0.080552f, 0.078876f, 0.077614f, 0.076203f, 0.074918f, + 0.074102f, 0.073068f, 0.072153f, 0.071659f, 0.070969f, 0.070686f, 0.070224f, 0.069878f, 0.069936f, 0.069820f +}; + +const float ivas_reverb_default_small_DSR[IVAS_REVERB_DEFAULT_S_N_BANDS] = +{ + 1.562141e-05f, 7.104127e-06f, 4.699859e-06f, 4.302786e-06f, 5.277136e-06f, 6.382504e-06f, 7.237492e-06f, 9.198124e-06f, 1.073813e-05f, 1.148954e-05f, + 1.063691e-05f, 9.580873e-06f, 8.187593e-06f, 7.045559e-06f, 5.871790e-06f, 4.857175e-06f, 4.194530e-06f, 3.594923e-06f, 3.377501e-06f, 4.063327e-06f, + 4.885563e-06f, 6.276646e-06f, 7.591577e-06f, 8.950862e-06f, 9.394771e-06f, 9.701081e-06f, 9.456415e-06f, 8.555601e-06f, 8.035221e-06f, 7.461511e-06f, + 6.976915e-06f, 6.454842e-06f, 5.885498e-06f, 5.657134e-06f, 5.205549e-06f, 4.791783e-06f, 4.635302e-06f, 4.326645e-06f, 4.245139e-06f, 4.107671e-06f, + 4.033808e-06f, 3.961318e-06f, 3.862554e-06f, 3.742024e-06f, 3.559007e-06f, 3.379882e-06f, 3.192690e-06f, 3.129763e-06f, 3.129763e-06f, 3.129763e-06f, + 3.129763e-06f, 3.129763e-06f, 3.129763e-06f, 3.129763e-06f, 3.129763e-06f, 3.129763e-06f, 3.129763e-06f, 3.129763e-06f, 3.129763e-06f, 3.129763e-06f +}; + +const float ivas_reverb_default_medium_fc[IVAS_REVERB_DEFAULT_M_N_BANDS] = +{ + 20.0f, 25.0f, 31.5f, 40.0f, + 50.0f, 63.0f, 80.0f, 100.0f, + 125.0f, 160.0f, 200.0f, 250.0f, + 315.0f, 400.0f, 500.0f, 630.0f, + 800.0f, 1000.0f, 1250.0f, 1600.0f, + 2000.0f, 2500.0f, 3150.0f, 4000.0f, + 5000.0f, 6300.0f, 8000.0f, 10000.0f, + 12500.0f, 16000.0f, 20000.0f +}; + +const float ivas_reverb_default_medium_RT60[IVAS_REVERB_DEFAULT_M_N_BANDS] = +{ + 0.22000000f, 0.22500000f, 0.23150000f, 0.24000000f, + 0.25000000f, 0.26300000f, 0.28000000f, 0.30000000f, + 0.32500000f, 0.36000000f, 0.40000000f, 0.39625000f, + 0.39137500f, 0.38500000f, 0.37750000f, 0.36933070f, + 0.36553800f, 0.36107600f, 0.35953475f, 0.35963200f, + 0.35849250f, 0.34878675f, 0.33447100f, 0.31297400f, + 0.28944200f, 0.26387000f, 0.23550800f, 0.20767000f, + 0.18357975f, 0.16133300f, 0.14229700f +}; + +const float ivas_reverb_default_medium_DSR[IVAS_REVERB_DEFAULT_M_N_BANDS] = +{ + 1.488034e-05f, 1.521853e-05f, 1.565818e-05f, 1.623310e-05f, + 1.690948e-05f, 1.778877e-05f, 1.893862e-05f, 2.029138e-05f, + 2.198233e-05f, 2.434965e-05f, 2.705517e-05f, 2.518051e-05f, + 2.274345e-05f, 1.955652e-05f, 1.580720e-05f, 1.174766e-05f, + 9.989742e-06f, 7.921604e-06f, 7.494128e-06f, 8.064566e-06f, + 9.803470e-06f, 1.171147e-05f, 1.607462e-05f, 1.776450e-05f, + 1.271521e-05f, 6.951610e-06f, 6.154952e-06f, 1.181682e-05f, + 7.084896e-06f, 3.571991e-06f, 2.210372e-06f +}; +#endif + +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +const float ivas_reverb_default_large_fc[IVAS_REVERB_DEFAULT_L_N_BANDS] = +#else +const float ivas_reverb_default_fc[IVAS_REVERB_DEFAULT_N_BANDS] = +#endif { 20.0f, 25.0f, 31.5f, 40.0f, 50.0f, 63.0f, 80.0f, 100.0f, @@ -358,7 +430,11 @@ const float ivas_reverb_default_fc[IVAS_REVERB_DEFAULT_N_BANDS] = 12500.0f, 16000.0f, 20000.0f }; -const float ivas_reverb_default_RT60[IVAS_REVERB_DEFAULT_N_BANDS] = +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +const float ivas_reverb_default_large_RT60[IVAS_REVERB_DEFAULT_L_N_BANDS] = +#else +const float ivas_reverb_default_RT60[IVAS_REVERB_DEFAULT_N_BANDS] = +#endif { 1.3622f, 1.4486f, 1.3168f, 1.5787f, 1.4766f, 1.3954f, 1.2889f, 1.3462f, @@ -370,7 +446,11 @@ const float ivas_reverb_default_RT60[IVAS_REVERB_DEFAULT_N_BANDS] = 0.71945f, 0.61682f, 0.60031f }; -const float ivas_reverb_default_DSR[IVAS_REVERB_DEFAULT_N_BANDS] = +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +const float ivas_reverb_default_large_DSR[IVAS_REVERB_DEFAULT_L_N_BANDS] = +#else +const float ivas_reverb_default_DSR[IVAS_REVERB_DEFAULT_N_BANDS] = +#endif { 1.8811e-08f, 2.1428e-08f, 1.3972e-08f, 1.51e-08f, 1.287e-08f, 1.8747e-08f, 2.413e-08f, 3.9927e-08f, diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index 927287ecd96a2b33cb061c32d40013623da77469..9d14bf325fb934af4353306e45edc23833a0752f 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -113,9 +113,24 @@ extern const float t_design_11_elevation[70]; * Reverberator ROM tables *-----------------------------------------------------------------------*/ +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +extern const float ivas_reverb_default_small_fc[]; +extern const float ivas_reverb_default_small_RT60[]; +extern const float ivas_reverb_default_small_DSR[]; + +extern const float ivas_reverb_default_medium_fc[]; +extern const float ivas_reverb_default_medium_RT60[]; +extern const float ivas_reverb_default_medium_DSR[]; + +extern const float ivas_reverb_default_large_fc[]; +extern const float ivas_reverb_default_large_RT60[]; +extern const float ivas_reverb_default_large_DSR[]; +#else extern const float ivas_reverb_default_fc[]; extern const float ivas_reverb_default_RT60[]; extern const float ivas_reverb_default_DSR[]; +#endif + /*----------------------------------------------------------------------------------* * Renderer SBA & MC enc/dec matrices diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index b18b949607284f58276ff215f5fe87210a80c130..ceff2a2fd06d01393202d45d7a06366bbae45154 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -93,6 +93,9 @@ typedef struct const int16_t *pSplitRendBFI; const SPLIT_REND_WRAPPER *pSplitRendWrapper; const COMBINED_ORIENTATION_HANDLE *pCombinedOrientationData; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + const IVAS_DefaultReverbSize *pSelectedRoomReverbSize; +#endif } rendering_context; /* Common base for input structs */ @@ -228,6 +231,9 @@ struct IVAS_REND int8_t rendererConfigEnabled; RENDER_CONFIG_DATA *hRendererConfig; /* Renderer config pointer */ +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + IVAS_DefaultReverbSize selectedRoomReverbSize; +#endif int16_t num_subframes; hrtf_handles hHrtfs; @@ -1242,6 +1248,9 @@ static rendering_context getRendCtx( ctx.pSplitRendBFI = &hIvasRend->splitRendBFI; ctx.pSplitRendWrapper = hIvasRend->splitRendWrapper; ctx.pCombinedOrientationData = &hIvasRend->hCombinedOrientationData; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + ctx.pSelectedRoomReverbSize = &hIvasRend->selectedRoomReverbSize; +#endif return ctx; } @@ -3120,6 +3129,9 @@ ivas_error IVAS_REND_Open( hIvasRend->hLimiter = NULL; hIvasRend->efapOutWrapper.hEfap = NULL; hIvasRend->efapOutWrapper.pCustomLsSetup = NULL; +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + hIvasRend->selectedRoomReverbSize = DEFAULT_REVERB_UNSET; +#endif #ifdef DEBUGGING hIvasRend->numClipping = 0; #endif @@ -3798,6 +3810,85 @@ static ivas_error isar_pre_rend_init( return IVAS_ERR_OK; } +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE +static IVAS_ROOM_SIZE_T getDefaultReverbSize( + input_ism *ismInputs, + input_masa *masaInputs, + input_mc *mcInputs, + input_sba *sbaInputs ) +{ + bool combinedFormat; + int16_t i; + int16_t nActiveInputsIsm, nActiveInputsMasa, nActiveInputsSba, nActiveInputsMc; + IVAS_ROOM_SIZE_T selectedReverb; + selectedReverb = IVAS_ROOM_SIZE_MEDIUM; + + combinedFormat = false; + nActiveInputsIsm = 0; + nActiveInputsMasa = 0; + nActiveInputsMc = 0; + nActiveInputsSba = 0; + + for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; i++ ) + { + if ( ismInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) + { + nActiveInputsIsm++; + } + } + for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) + { + if ( masaInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) + { + nActiveInputsMasa++; + } + } + for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ ) + { + if ( mcInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) + { + nActiveInputsMc++; + } + } + for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ ) + { + if ( sbaInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) + { + nActiveInputsSba++; + } + } + + /* ISM present with MASA/SBA inputs; treat as combined format */ + if ( nActiveInputsIsm && ( nActiveInputsMasa || nActiveInputsSba ) ) + { + combinedFormat = true; + } + + if ( combinedFormat ) + { + selectedReverb = IVAS_ROOM_SIZE_MEDIUM; + } + else + { + /* Only set large if ISM is present alone */ + if ( nActiveInputsIsm && !nActiveInputsMc ) + { + selectedReverb = IVAS_ROOM_SIZE_LARGE; + } + /* if only MC is present, set medium; Will not be overridden by the subsequent block */ + else if ( nActiveInputsMc ) + { + selectedReverb = IVAS_ROOM_SIZE_MEDIUM; + } + else if ( nActiveInputsMasa || nActiveInputsSba ) + { + selectedReverb = IVAS_ROOM_SIZE_SMALL; + } + } + + return selectedReverb; +} +#endif /*-------------------------------------------------------------------* @@ -3897,6 +3988,18 @@ ivas_error IVAS_REND_AddInput( /* set global maximum delay after adding an input */ setMaxGlobalDelayNs( hIvasRend ); +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + + /* select default reverb size after adding an input */ + if ( hIvasRend->selectedRoomReverbSize == DEFAULT_REVERB_UNSET ) + { + IVAS_REND_SetReverbRoomSize( hIvasRend, + getDefaultReverbSize( hIvasRend->inputsIsm, + hIvasRend->inputsMasa, + hIvasRend->inputsMc, + hIvasRend->inputsSba ) ); + } +#endif return IVAS_ERR_OK; } @@ -5130,6 +5233,83 @@ ivas_error IVAS_REND_GetCombinedOrientation( return IVAS_ERR_OK; } +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + +/*---------------------------------------------------------------------* + * IVAS_REND_GetCombinedOrientation() + * + * + *---------------------------------------------------------------------*/ +ivas_error IVAS_REND_GetReverbRoomSize( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_ROOM_SIZE_T *reverbRoomSize /* o : Reverb room size */ +) +{ + switch ( hIvasRend->selectedRoomReverbSize ) + { + case DEFAULT_REVERB_SMALL: + *reverbRoomSize = IVAS_ROOM_SIZE_SMALL; + break; + case DEFAULT_REVERB_MEDIUM: + *reverbRoomSize = IVAS_ROOM_SIZE_MEDIUM; + break; + case DEFAULT_REVERB_LARGE: + *reverbRoomSize = IVAS_ROOM_SIZE_LARGE; + break; + case DEFAULT_REVERB_UNSET: + default: + *reverbRoomSize = IVAS_ROOM_SIZE_AUTO; + break; + } + + return IVAS_ERR_OK; +} + +/*---------------------------------------------------------------------* + * IVAS_REND_GetCombinedOrientation() + * + * + *---------------------------------------------------------------------*/ +ivas_error IVAS_REND_SetReverbRoomSize( + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const IVAS_ROOM_SIZE_T reverbRoomSize /* i : Reverb room size */ +) +{ + ivas_error error; + + switch ( reverbRoomSize ) + { + case IVAS_ROOM_SIZE_SMALL: + hIvasRend->selectedRoomReverbSize = DEFAULT_REVERB_SMALL; + break; + case IVAS_ROOM_SIZE_MEDIUM: + hIvasRend->selectedRoomReverbSize = DEFAULT_REVERB_MEDIUM; + break; + case IVAS_ROOM_SIZE_LARGE: + hIvasRend->selectedRoomReverbSize = DEFAULT_REVERB_LARGE; + break; + case IVAS_ROOM_SIZE_AUTO: + default: + hIvasRend->selectedRoomReverbSize = DEFAULT_REVERB_UNSET; + break; /* will be setup in IVAS_REND_AddInput() */ + } + + if ( hIvasRend->hRendererConfig != NULL ) + { + if ( ( error = ivas_render_config_change_defaults( hIvasRend->hRendererConfig, hIvasRend->selectedRoomReverbSize ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + return IVAS_ERR_OK; +} + +#endif /*-------------------------------------------------------------------* diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 4d84f194f9ba18c7127b5e385a52e50de64fe3b7..dfed1573148a1366a87db8cfdd2a372dab54bf29 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -261,6 +261,18 @@ ivas_error IVAS_REND_FeedRenderConfig( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ); +#ifdef FIX_1318_ROOM_SIZE_CMD_LINE + +ivas_error IVAS_REND_GetReverbRoomSize( + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_ROOM_SIZE_T *reverbRoomSize /* o : Reverb room size */ +); + +ivas_error IVAS_REND_SetReverbRoomSize( + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + const IVAS_ROOM_SIZE_T reverbRoomSize /* i : Reverb room size */ +); +#endif ivas_error IVAS_REND_FeedSplitBinauralBitstream( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */