diff --git a/apps/decoder.c b/apps/decoder.c index 4db62d0f1e8517f266aa0fb8f3de33bab0295c74..e0d4ab22c6dfcaae7c682ded13abd5e16135fcd8 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -160,9 +160,6 @@ typedef struct char *hrtfFileName; IVAS_DEC_HRTF_HANDLE *hHrtfTD; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF; -#endif IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; @@ -171,12 +168,7 @@ typedef struct IVAS_BIN_RENDERER_TYPE binaural_renderer_sec; IVAS_BIN_RENDERER_TYPE binaural_renderer_sec_old; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG hrtf_set_audio_cfg; -#else - IVAS_AUDIO_CONFIG intern_audio_config; - int16_t room_reverb_flag; -#endif } IVAS_DEC_HRTF_BINARY_WRAPPER; @@ -189,11 +181,7 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); -#else -static ivas_error IVAS_DEC_LoadHrtfFromFile( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const int32_t output_Fs ); -#endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); static int16_t app_own_random( int16_t *seed ); @@ -247,10 +235,7 @@ int main( reset_mem( USE_BYTES ); #endif - hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - hHrtfBinary.hSetOfHRTF = NULL; /* just to avoid compilation warning */ -#endif + hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ splitRendBits.bits_buf = splitRendBitsBuf; @@ -734,12 +719,7 @@ int main( hHrtfBinary.hrtfFileName = arg.hrtfFileName; hHrtfBinary.binaural_renderer = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; -#else - hHrtfBinary.room_reverb_flag = 0; - hHrtfBinary.intern_audio_config = IVAS_AUDIO_CONFIG_INVALID; -#endif } /*------------------------------------------------------------------------------------------* @@ -818,9 +798,6 @@ cleanup: if ( arg.hrtfReaderEnabled ) { destroy_td_hrtf( hHrtfBinary.hHrtfTD ); -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - destroy_SetOfHRTF( hHrtfBinary.hSetOfHRTF ); -#endif destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics ); } @@ -2372,11 +2349,7 @@ static ivas_error decodeG192( /* Read main parameters from the bitstream to set-up the decoder */ hHrtfBinary->binaural_renderer_old = hHrtfBinary->binaural_renderer; hHrtfBinary->binaural_renderer_sec_old = hHrtfBinary->binaural_renderer_sec; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->room_reverb_flag, &hHrtfBinary->intern_audio_config ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2387,11 +2360,7 @@ static ivas_error decodeG192( /* Load HRTF binary file data */ if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_hrtf_from_file( hHrtfBinary, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtfBinary, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3287,11 +3256,7 @@ static ivas_error decodeVoIP( /* Read main parameters from the bitstream to set-up the decoder */ hHrtf->binaural_renderer_old = hHrtf->binaural_renderer; hHrtf->binaural_renderer_sec_old = hHrtf->binaural_renderer_sec; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->room_reverb_flag, &hHrtf->intern_audio_config ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3302,11 +3267,7 @@ static ivas_error decodeVoIP( /* Load HRTF binary file data */ if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_hrtf_from_file( hHrtf, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtf, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3697,7 +3658,6 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( #endif -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * load_hrtf_from_file() * @@ -3710,18 +3670,6 @@ static ivas_error load_hrtf_from_file( const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ const int32_t output_Fs /* i : output sampling rate */ ) -#else -/*---------------------------------------------------------------------* - * IVAS_DEC_LoadHrtfFromFile() - * - * - *---------------------------------------------------------------------*/ - -static ivas_error IVAS_DEC_LoadHrtfFromFile( - IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, - IVAS_DEC_HANDLE hIvasDec, - const int32_t output_Fs ) -#endif { ivas_error error; IVAS_BIN_RENDERER_TYPE binaural_renderer, binaural_renderer_sec; @@ -3747,13 +3695,6 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( destroy_td_hrtf( hHrtfBinary->hHrtfTD ); } -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - if ( !( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && hHrtfBinary->hSetOfHRTF != NULL ) - { - destroy_SetOfHRTF( hHrtfBinary->hSetOfHRTF ); - } - -#endif if ( ( error = IVAS_DEC_HRTF_binary_close( hIvasDec, hHrtfBinary->binaural_renderer_old ) ) != IVAS_ERR_OK ) { return error; @@ -3801,22 +3742,14 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( if ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hHrtfCrend ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hHrtfBinary->hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hHrtfBinary->hrtfReader, OutputConfig, hHrtfBinary->hrtf_set_audio_cfg, output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = create_SetOfHRTF_from_binary( *hHrtfBinary->hSetOfHRTF, hHrtfBinary->hrtfReader, output_Fs ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -3825,11 +3758,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM destroy_crend_hrtf( hHrtfCrend ); -#else - destroy_SetOfHRTF( hHrtfBinary->hSetOfHRTF ); -#endif } } } @@ -3843,11 +3772,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, OutputConfig, hHrtfBinary->hrtf_set_audio_cfg, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hHrtfBinary->room_reverb_flag, hHrtfBinary->intern_audio_config, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { diff --git a/apps/renderer.c b/apps/renderer.c index 22ffa4838dbae98e8a31691f9d806c2d1b8ab20f..f0f472a07af6fe4703a2afa9cff96e7bfdb15329 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -158,7 +158,7 @@ typedef struct int32_t sampleRate; InputConfig inConfig; OutputConfig outConfig; - char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; + char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; int16_t numInMetadataFiles; char outMetadataFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; @@ -238,7 +238,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_inputMetadata, .match = "input_metadata", .matchShort = "im", - .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode", + .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode. For OMASA, ISM files must be specified first.", }, { .id = CmdLnOptionId_outputFile, @@ -397,6 +397,8 @@ static IVAS_AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order ); static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs ); +static void parseCombinedFormatInput( InputConfig *inConfig, char **configString ); + static ivas_error parseCustomLayoutFile( const char *filePath, IVAS_CUSTOM_LS_DATA *pLsSetupCustom ); static CmdlnArgs parseCmdlnArgs( const int argc, char **argv ); @@ -555,25 +557,7 @@ static void setupWithSingleFormatInput( strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 ); /* Depending on input format, prepare metadata reading for ISM or MASA */ - if ( args.inConfig.numMasaBuses != 0 ) - { - if ( args.inConfig.numMasaBuses != args.numInMetadataFiles ) - { - fprintf( stderr, "Error: all MASA inputs must have a corresponding metadata file" ); - exit( -1 ); - } - - for ( int16_t i = 0; i < args.numInMetadataFiles; ++i ) - { - masaReaders[i] = MasaFileReader_open( args.inMetadataFilePaths[i] ); - if ( masaReaders[i] == NULL ) - { - fprintf( stderr, "Could not open MASA metadata file %s\n", args.inMetadataFilePaths[i] ); - exit( -1 ); - } - } - } - else if ( args.inConfig.numAudioObjects != 0 ) + if ( args.inConfig.numAudioObjects != 0 ) { positionProvider->numObjects = args.inConfig.numAudioObjects; for ( int16_t i = 0; i < positionProvider->numObjects; ++i ) @@ -596,6 +580,26 @@ static void setupWithSingleFormatInput( } } } + if ( args.inConfig.numMasaBuses != 0 ) + { + if ( args.inConfig.numMasaBuses != ( args.numInMetadataFiles - args.inConfig.numAudioObjects ) ) + { + fprintf( stderr, "Error: all MASA inputs must have a corresponding metadata file" ); + exit( -1 ); + } + + int16_t reader_idx = 0; + for ( int16_t i = args.inConfig.numAudioObjects; i < args.numInMetadataFiles; ++i ) + { + reader_idx = i - args.inConfig.numAudioObjects; + masaReaders[reader_idx] = MasaFileReader_open( args.inMetadataFilePaths[i] ); + if ( masaReaders[reader_idx] == NULL ) + { + fprintf( stderr, "Could not open MASA metadata file %s\n", args.inMetadataFilePaths[i] ); + exit( -1 ); + } + } + } return; } @@ -665,11 +669,7 @@ int main( SplitRendBFIFileReader *splitRendBFIReader = NULL; Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; -#endif IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; @@ -737,6 +737,10 @@ int main( lfeRoutingConfigs[i] = NULL; } +#ifdef FIX_1225_DISCLAIMER + IVAS_REND_PrintDisclaimer(); + +#endif CmdlnArgs args = parseCmdlnArgs( argc, argv ); if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) || @@ -894,6 +898,49 @@ int main( exit( -1 ); } +#ifdef FIX_1225_DISCLAIMER + fprintf( stdout, "Input audio file: %s\n", args.inputFilePath ); + fprintf( stdout, "Output audio file: %s\n\n", args.outputFilePath ); + + if ( args.inConfig.numAudioObjects > 0 ) + { + if ( args.inConfig.numAudioObjects == 1 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM1 ); + } + else if ( args.inConfig.numAudioObjects == 2 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM2 ); + } + else if ( args.inConfig.numAudioObjects == 3 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM3 ); + } + else if ( args.inConfig.numAudioObjects == 4 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM4 ); + } + } + for ( i = 0; i < args.inConfig.numMultiChannelBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.multiChannelBuses[i].audioConfig ); + } + for ( i = 0; i < args.inConfig.numMasaBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.masaBuses[i].audioConfig ); + } + for ( i = 0; i < args.inConfig.numAmbisonicsBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.ambisonicsBuses[i].audioConfig ); + } + + if ( ( error = IVAS_REND_PrintConfig( hIvasRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\n IVAS_REND_PrintConfig failed: %s\n\n", ivas_error_to_string( error ) ); + goto cleanup; + } + +#endif if ( !isEmptyString( args.customHrtfFilePath ) ) { if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) @@ -928,17 +975,12 @@ int main( } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hHrtfCrend ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_7_1_4; if ( args.inConfig.ambisonicsBuses->audioConfig != IVAS_AUDIO_CONFIG_INVALID && args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { @@ -946,9 +988,6 @@ int main( } if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hrtfFileReader, args.outConfig.audioConfig, hrtf_set_audio_cfg, args.sampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -957,11 +996,7 @@ int main( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM destroy_crend_hrtf( hHrtfCrend ); -#else - destroy_SetOfHRTF( hSetOfHRTF ); -#endif } } @@ -971,11 +1006,7 @@ int main( goto cleanup; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, args.outConfig.audioConfig, args.inConfig.ambisonicsBuses->audioConfig, hrtfFileReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, 0, IVAS_AUDIO_CONFIG_INVALID, hrtfFileReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -1982,9 +2013,6 @@ cleanup: Vector3PairFileReader_close( &referenceVectorReader ); destroy_td_hrtf( hHrtfTD ); -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - destroy_SetOfHRTF( hSetOfHRTF ); -#endif destroy_hrtf_statistics( hHrtfStatistics ); IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); @@ -2093,16 +2121,11 @@ static bool parseInConfig( inConfig->masaBuses[0].gain_dB = 0.0f; break; case IVAS_AUDIO_CONFIG_OBA: - /* If input format is objects, parse the characters after "ISM" to get number of objects */ + /* If input format is objects, parse the characters after "ISM" to get + * number of objects and check for combined formats. */ { char *ptr = NULL; inConfig->numAudioObjects = (uint16_t) strtol( inFormatStr + 3, &ptr, 10 ); - if ( ptr == NULL || *ptr != '\0' ) - { - /* Failed to parse string as a number */ - fprintf( stderr, "Cannot parse string \"%s\" as a valid input format", inFormatStr ); - return false; - } if ( inConfig->numAudioObjects > RENDERER_MAX_ISM_INPUTS ) { fprintf( stderr, "Too many objects at input. Max %d supported.", RENDERER_MAX_ISM_INPUTS ); @@ -2114,6 +2137,17 @@ static bool parseInConfig( inConfig->audioObjects[i].inputChannelIndex = i; inConfig->audioObjects[i].gain_dB = 0.0f; } + if ( *ptr != '\0' ) + { + /* Try to parse combined format */ + parseCombinedFormatInput( inConfig, &ptr ); + } + if ( ptr == NULL || *ptr != '\0' ) + { + /* Failed to parse string as a number */ + fprintf( stderr, "Cannot parse string \"%s\" as a valid input format", inFormatStr ); + return false; + } } break; case IVAS_AUDIO_CONFIG_INVALID: @@ -2527,9 +2561,7 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; -#endif for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { @@ -2608,7 +2640,7 @@ static void parseOption( } break; case CmdLnOptionId_inputMetadata: - assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS ); + assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS ); for ( int16_t i = 0; i < numOptionValues; ++i ) { strncpy( args->inMetadataFilePaths[i], optionValues[i], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); @@ -3436,6 +3468,41 @@ static void parseMasa( return; } +static void parseCombinedFormatInput( + InputConfig *inConfig, + char **configString ) +{ + IVAS_AUDIO_CONFIG audioConfig; + audioConfig = parseAudioConfig( *configString ); + + if ( audioConfig == IVAS_AUDIO_CONFIG_FOA || audioConfig == IVAS_AUDIO_CONFIG_HOA2 || audioConfig == IVAS_AUDIO_CONFIG_HOA3 ) + { + /* OSBA */ + inConfig->numAmbisonicsBuses = 1; + inConfig->ambisonicsBuses[0].audioConfig = audioConfig; + inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects; + inConfig->ambisonicsBuses[0].gain_dB = -6.f; + *configString += 4; + + /* Modify input gain for objects too */ + for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i ) + { + inConfig->audioObjects[i].gain_dB = -6.f; + } + } + else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) + { + /* OMASA */ + inConfig->numMasaBuses = 1; + inConfig->masaBuses[0].audioConfig = audioConfig; + inConfig->masaBuses[0].inputChannelIndex = inConfig->numAudioObjects; + inConfig->masaBuses[0].gain_dB = 0.0f; + *configString += 5; + } + + return; +} + static ivas_error parseCustomLayoutFile( const char *filePath, IVAS_CUSTOM_LS_DATA *pLsSetupCustom ) @@ -3652,6 +3719,8 @@ static void printSupportedAudioConfigs( void ) "HOA2", "HOA3", "ISMx (input only)", + "ISMxSBAy (OSBA, input only)", + "ISMxMASAy (OMASA, input only)", "MASAx", "BINAURAL (output only)", "BINAURAL_SPLIT_PCM", @@ -3691,7 +3760,7 @@ static ivas_error parseLfePanMtxFile( } /* set default panning matrix to all zeros - any subsequent issue in file reading will gracefully exit the function */ + any subsequent issue in file reading will gracefully exit the function */ for ( lfe_in = 0; lfe_in < RENDERER_MAX_INPUT_LFE_CHANNELS; lfe_in++ ) { for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 16614a929aac45f348d23167a627eadb570bf3d7..aeeb3dda6a6cc18b6025d44aecdf3caa2252b597 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -175,11 +175,7 @@ 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; typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; -#else -typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; -#endif typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; typedef struct ivas_hrtfs_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE; diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 5d23ba1549f6aa7f2e7d2c1b6444f0c95255a2b1..f49f043ca6628caa3147ec2e6d412d5df3448ba1 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -47,7 +47,11 @@ int16_t print_disclaimer( FILE *fPtr ) { fprintf( fPtr, "\n==================================================================================================\n" ); +#ifdef FIX_1225_DISCLAIMER + fprintf( fPtr, " \n IVAS Codec Version IVAS-FL-2.0\n" ); +#else fprintf( fPtr, " IVAS Codec Baseline\n" ); +#endif fprintf( fPtr, " \n" ); fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" ); fprintf( fPtr, " Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0\n" ); diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 786a6d436b0665309802221619a0be173a179bb9..f12ee0330adffd7ebfd290ff5bbeb913e5680c52 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1495,19 +1495,6 @@ typedef enum #define BINAURAL_COHERENCE_DIFFERENCE_BINS 9 /* Number of bins for direction-dependent diffuse-field binaural coherence */ -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM -typedef enum -{ - BINAURAL_INPUT_AUDIO_CONFIG_INVALID, - BINAURAL_INPUT_AUDIO_CONFIG_COMBINED, /* 5_1, 5_1_2, 5_1_4, 7_1, 7_1_4 */ - BINAURAL_INPUT_AUDIO_CONFIG_HOA3, /* HOA3 */ - BINAURAL_INPUT_AUDIO_CONFIG_HOA2, /* HOA2 */ - BINAURAL_INPUT_AUDIO_CONFIG_FOA, /* FOA */ - BINAURAL_INPUT_AUDIO_CONFIG_UNDEFINED /* Not used */ - -} BINAURAL_INPUT_AUDIO_CONFIG; - -#endif #define HEADROT_ORDER 3 #define HEADROT_SHMAT_DIM ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) ) #define HEADROT_SHMAT_DIM2 ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM ) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3513df00a49118ac63ae8764156448142edb4ce6..8820a10b5ffa5e7a6169258aff34bc7c61552ff7 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -202,7 +202,10 @@ ivas_error pre_proc_front_ivas( const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision*/ const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ + const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ +#ifdef NONBE_1211_DTX_BR_SWITCHING + const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ +#endif const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); @@ -5136,13 +5139,7 @@ void ivas_init_binaural_hrtf( ivas_error ivas_allocate_binaural_hrtf( HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM const int16_t n_channels, /* i : number of input channels */ -#else - const AUDIO_CONFIG input_config, /* i : input audio configuration */ - const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */ - const RENDERER_TYPE renderer_type, /* i : renderer type */ -#endif const int16_t allocate_init_flag /* i : Memory allocation flag */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 059877b9b26b50818d4ccfbb5e5bb63a4bfdcd37..8b22dc430b84cf629e28cebd799f8d538207ae4a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,11 +160,8 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* VA: issue 1226: for FastConv binaural renderer in decoder, load only HTRT coefficient set that is needed */ -#define FIX_1227_Crend_HRTF_LOADING_OPTIM /* VA: issue 1227: for Crend binaural renderer in decoder, load only HTRT coefficient set that is needed */ -#define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE /* VA: issue 1228: Exit the processing when a HRTF binary file with wrong sampling rate is provided */ - +#define FIX_1225_DISCLAIMER /* VA: issue 1225: Add disclaimer for external renderer + Add info about IVAS reference version */ /* #################### End BE switches ################################## */ @@ -174,10 +171,10 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ -#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ -#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ -#define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ -#define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ +#define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ +#define NONBE_1246_INF_COHERENCE_IN_HIGH_LEVEL_DTX /* Ericsson: Issue 1246: High level input which triggers DTX can lead to numerical overflow in coherence calculation */ +#define NONBE_1211_DTX_BR_SWITCHING /* VA: issue 1211: fix crash in MASA DTX bitrate switching */ +#define NONBE_1217_INIT_OBJ_EDIT /* VA: issue 1217: do object editing only when objects metadata is available */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 1df0eb7838c43f12e504e570a71dbc1474407f8c..f5cdd2a0399c77c65b261300b48d9954b5f76f70 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -3918,8 +3918,11 @@ void td_cng_enc_init( ); void dtx( - Encoder_State *st, /* i/o: encoder state structure */ - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + Encoder_State *st, /* i/o: encoder state structure */ +#ifdef NONBE_1211_DTX_BR_SWITCHING + const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ +#endif + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t vad, /* i : VAD flag for DTX */ const float speech[] /* i : Pointer to the speech frame */ ); diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index a9075b1f0dcb257079e210f1ed52266eb3642695..0f195330a0ffa239c1af88159281c65e92d55f85 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -165,16 +165,10 @@ static ivas_error ivas_binRenderer_convModuleOpen( hBinRenderer->nInChannels = ( audioCfg2channels( input_config ) - isLoudspeaker ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hBinRenConvModule->numTaps = hHrtf->ntaps; -#endif if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - hBinRenConvModule->numTaps = hHrtf->ntaps_brir; - -#endif /* Use variable order filtering */ bandIdx = 0; for ( ; bandIdx < 5; bandIdx++ ) @@ -200,32 +194,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } else { -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - if ( hBinRenderer->ivas_format == SBA_FORMAT ) - { - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_hoa3; - } - else if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_hoa2; - } - else if ( input_config == IVAS_AUDIO_CONFIG_FOA ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_foa; - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - else - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir; - } - -#endif /* Use fixed order filtering */ bandIdx = 0; for ( ; bandIdx < hBinRenderer->conv_band; bandIdx++ ) @@ -334,9 +302,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( { int16_t tmp = 0; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM tmp = chIdx; -#endif if ( isLoudspeaker ) { if ( input_config == IVAS_AUDIO_CONFIG_5_1 ) @@ -367,72 +333,10 @@ static ivas_error ivas_binRenderer_convModuleOpen( #endif } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftReal[bandIdx][tmp]; hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftImag[bandIdx][tmp]; hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightReal[bandIdx][tmp]; hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightImag[bandIdx][tmp]; -#else - if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) - { - - if ( isLoudspeaker ) - { - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftBRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftBRIRImag[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightBRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightBRIRImag[bandIdx][tmp]; - } -#ifdef DEBUGGING - else - { - /* HOA3 filter coefficients */ - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: The tables corresponding to HOA3 for BRIR are missing \n\n" ); - } -#endif - } - else - { - if ( isLoudspeaker ) - { - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag[bandIdx][tmp]; - } - else - { - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - /* HOA3 filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_HOA3[bandIdx][chIdx]; - } - else if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) - { - /* HOA2 filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_HOA2[bandIdx][chIdx]; - } - else if ( input_config == IVAS_AUDIO_CONFIG_FOA ) - { - /* FOA filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_FOA[bandIdx][chIdx]; - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - } -#endif } } @@ -467,7 +371,6 @@ void ivas_init_binaural_hrtf( { int16_t i; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal = NULL; HrtfFastConv->leftImag = NULL; HrtfFastConv->rightReal = NULL; @@ -477,44 +380,6 @@ void ivas_init_binaural_hrtf( HrtfFastConv->n_channels = 0; HrtfFastConv->allocate_init_flag = 0x00; HrtfFastConv->ntaps = 0; -#else - HrtfFastConv->leftHRIRReal_HOA3 = NULL; - HrtfFastConv->leftHRIRImag_HOA3 = NULL; - HrtfFastConv->rightHRIRReal_HOA3 = NULL; - HrtfFastConv->rightHRIRImag_HOA3 = NULL; - HrtfFastConv->FASTCONV_HOA3_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal = NULL; - HrtfFastConv->leftHRIRImag = NULL; - HrtfFastConv->rightHRIRReal = NULL; - HrtfFastConv->rightHRIRImag = NULL; - HrtfFastConv->FASTCONV_HRIR_latency_s = 0x00; - - HrtfFastConv->leftBRIRReal = NULL; - HrtfFastConv->leftBRIRImag = NULL; - HrtfFastConv->rightBRIRReal = NULL; - HrtfFastConv->rightBRIRImag = NULL; - HrtfFastConv->FASTCONV_BRIR_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal_HOA2 = NULL; - HrtfFastConv->leftHRIRImag_HOA2 = NULL; - HrtfFastConv->rightHRIRReal_HOA2 = NULL; - HrtfFastConv->rightHRIRImag_HOA2 = NULL; - HrtfFastConv->FASTCONV_HOA2_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal_FOA = NULL; - HrtfFastConv->leftHRIRImag_FOA = NULL; - HrtfFastConv->rightHRIRReal_FOA = NULL; - HrtfFastConv->rightHRIRImag_FOA = NULL; - HrtfFastConv->FASTCONV_FOA_latency_s = 0x00; - - HrtfFastConv->allocate_init_flag = 0x00; - HrtfFastConv->ntaps_hrir = BINAURAL_NTAPS; - HrtfFastConv->ntaps_hrir_foa = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_hrir_hoa2 = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_hrir_hoa3 = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_brir = BINAURAL_NTAPS_MAX; -#endif for ( i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) { @@ -578,18 +443,11 @@ static ivas_error ivas_alloc_pppMem( *-------------------------------------------------------------------------*/ ivas_error ivas_allocate_binaural_hrtf( - HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - const int16_t n_channels, /* i : number of input channels */ -#else - const AUDIO_CONFIG input_config, /* i : input audio configuration */ - const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */ - const RENDERER_TYPE renderer_type, /* i : renderer type */ -#endif + HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ + const int16_t n_channels, /* i : number of input channels */ const int16_t allocate_init_flag /* i : Memory allocation flag */ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->n_channels = n_channels; if ( ( HrtfFastConv->leftReal != NULL ) && ( HrtfFastConv->leftImag != NULL ) && ( HrtfFastConv->rightReal != NULL ) && ( HrtfFastConv->rightImag != NULL ) ) @@ -615,134 +473,6 @@ ivas_error ivas_allocate_binaural_hrtf( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HrtfFastConv->rightImag" ); } } -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - if ( ( HrtfFastConv->leftHRIRReal_HOA3 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA3 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA3 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA3 != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_HOA3" ); - } - } - } - - if ( input_config == IVAS_AUDIO_CONFIG_HOA2 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - if ( ( HrtfFastConv->leftHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA2 != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_HOA2" ); - } - } - } - - if ( input_config == IVAS_AUDIO_CONFIG_FOA || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - if ( ( HrtfFastConv->leftHRIRReal_FOA != NULL ) && ( HrtfFastConv->leftHRIRImag_FOA != NULL ) && ( HrtfFastConv->rightHRIRReal_FOA != NULL ) && ( HrtfFastConv->rightHRIRImag_FOA != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_FOA" ); - } - } - } - - else if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV && bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) || ( renderer_type == RENDERER_BINAURAL_FASTCONV && input_config != IVAS_AUDIO_CONFIG_INVALID ) ) - { - if ( ( HrtfFastConv->leftHRIRReal == NULL ) && ( HrtfFastConv->leftHRIRImag == NULL ) && ( HrtfFastConv->rightHRIRReal == NULL ) && ( HrtfFastConv->rightHRIRImag == NULL ) ) - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag" ); - } - } - } - - else if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) || ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && input_config != IVAS_AUDIO_CONFIG_INVALID ) ) - { - if ( ( HrtfFastConv->leftBRIRReal == NULL ) && ( HrtfFastConv->leftBRIRImag == NULL ) && ( HrtfFastConv->rightBRIRReal == NULL ) && ( HrtfFastConv->rightBRIRImag == NULL ) ) - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftBRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftBRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftBRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftBRIRImag" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightBRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightBRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightBRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightBRIRImag" ); - } - } - } -#endif return IVAS_ERR_OK; } @@ -762,9 +492,7 @@ static ivas_error ivas_binaural_hrtf_open( { int16_t i, j; ivas_error error; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM int16_t n_channels; -#endif if ( hHrtfFastConv != NULL && *hHrtfFastConv != NULL ) { @@ -785,53 +513,32 @@ static ivas_error ivas_binaural_hrtf_open( if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HRIR_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS; -#else - HrtfFastConv->FASTCONV_HRIR_latency_s = FASTCONV_HRIR_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HOA2_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_HOA2_latency_s = FASTCONV_HOA2_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HOA3_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_HOA3_latency_s = FASTCONV_HOA3_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_FOA ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_FOA_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_FOA_latency_s = FASTCONV_FOA_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_BRIR_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_MAX; -#else - HrtfFastConv->FASTCONV_BRIR_latency_s = FASTCONV_BRIR_latency_s; -#endif } HrtfFastConv->allocate_init_flag = 1; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM n_channels = 0; if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV || renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && input_config != IVAS_AUDIO_CONFIG_INVALID ) { @@ -855,125 +562,65 @@ static ivas_error ivas_binaural_hrtf_open( } if ( ( error = ivas_allocate_binaural_hrtf( HrtfFastConv, n_channels, HrtfFastConv->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( HrtfFastConv, input_config, BINAURAL_INPUT_AUDIO_CONFIG_INVALID, renderer_type, HrtfFastConv->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( renderer_type == RENDERER_BINAURAL_FASTCONV && HrtfFastConv->n_channels == HRTF_LS_CHANNELS ) -#else - if ( renderer_type == RENDERER_BINAURAL_FASTCONV ) -#endif { for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag[i][j]; -#else - HrtfFastConv->leftHRIRReal[i][j] = leftHRIRReal[i][j]; - HrtfFastConv->leftHRIRImag[i][j] = leftHRIRImag[i][j]; - HrtfFastConv->rightHRIRReal[i][j] = rightHRIRReal[i][j]; - HrtfFastConv->rightHRIRImag[i][j] = rightHRIRImag[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && HrtfFastConv->n_channels == HRTF_LS_CHANNELS ) -#else - else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) -#endif { for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftBRIRReal[i][j]; HrtfFastConv->leftImag[i][j] = leftBRIRImag[i][j]; HrtfFastConv->rightReal[i][j] = rightBRIRReal[i][j]; HrtfFastConv->rightImag[i][j] = rightBRIRImag[i][j]; -#else - HrtfFastConv->leftBRIRReal[i][j] = leftBRIRReal[i][j]; - HrtfFastConv->leftBRIRImag[i][j] = leftBRIRImag[i][j]; - HrtfFastConv->rightBRIRReal[i][j] = rightBRIRReal[i][j]; - HrtfFastConv->rightBRIRImag[i][j] = rightBRIRImag[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_HOA3 && HrtfFastConv->n_channels == HOA3_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) -#endif { for ( j = 0; j < HOA3_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_HOA3[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_HOA3[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_HOA3[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_HOA3[i][j]; -#else - HrtfFastConv->leftHRIRReal_HOA3[i][j] = leftHRIRReal_HOA3[i][j]; - HrtfFastConv->leftHRIRImag_HOA3[i][j] = leftHRIRImag_HOA3[i][j]; - HrtfFastConv->rightHRIRReal_HOA3[i][j] = rightHRIRReal_HOA3[i][j]; - HrtfFastConv->rightHRIRImag_HOA3[i][j] = rightHRIRImag_HOA3[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* Note: IVAS_AUDIO_CONFIG_HOA2 and IVAS_AUDIO_CONFIG_FOA input configs. are not relevant in internal renderer as SBA to binaural always synthesizes HOA3 output for binauralization. However, the external renderer can use them. */ -#endif -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_HOA2 && HrtfFastConv->n_channels == HOA2_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) -#endif { for ( j = 0; j < HOA2_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_HOA2[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_HOA2[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_HOA2[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_HOA2[i][j]; -#else - HrtfFastConv->leftHRIRReal_HOA2[i][j] = leftHRIRReal_HOA2[i][j]; - HrtfFastConv->leftHRIRImag_HOA2[i][j] = leftHRIRImag_HOA2[i][j]; - HrtfFastConv->rightHRIRReal_HOA2[i][j] = rightHRIRReal_HOA2[i][j]; - HrtfFastConv->rightHRIRImag_HOA2[i][j] = rightHRIRImag_HOA2[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_FOA && HrtfFastConv->n_channels == FOA_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_FOA ) -#endif { for ( j = 0; j < FOA_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_FOA[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_FOA[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_FOA[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_FOA[i][j]; -#else - HrtfFastConv->leftHRIRReal_FOA[i][j] = leftHRIRReal_FOA[i][j]; - HrtfFastConv->leftHRIRImag_FOA[i][j] = leftHRIRImag_FOA[i][j]; - HrtfFastConv->rightHRIRReal_FOA[i][j] = rightHRIRReal_FOA[i][j]; - HrtfFastConv->rightHRIRImag_FOA[i][j] = rightHRIRImag_FOA[i][j]; -#endif } } } @@ -1212,27 +859,7 @@ ivas_error ivas_rend_openCldfbRend( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_HOA2_latency_s * 1000000000.f ); - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f ); - } - else - { - /* should never happen for SBA */ - return IVAS_ERR_INVALID_OUTPUT_FORMAT; - } -#endif hBinRenderer->hReverb = NULL; hBinRenderer->hEFAPdata = NULL; @@ -1355,11 +982,7 @@ ivas_error ivas_binRenderer_open( } hBinRenderer->hoa_dec_mtx = st_ivas->hoa_dec_mtx; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_BRIR_latency_s * 1000000000.f ); -#endif } else { @@ -1369,41 +992,7 @@ ivas_error ivas_binRenderer_open( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - if ( hBinRenderer->ivas_format == MC_FORMAT ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HRIR_latency_s * 1000000000.f ); - } - else - { - if ( hBinRenderer->nInChannels == HOA3_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f ); - } - else if ( hBinRenderer->nInChannels == HOA2_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA2_latency_s * 1000000000.f ); - } - else if ( hBinRenderer->nInChannels == FOA_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - } - else - { - /* same value for MC or HOA both use MC BRIR*/ - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_BRIR_latency_s * 1000000000.f ); - } -#endif } /* Allocate memories needed for reverb module */ @@ -1625,9 +1214,7 @@ void ivas_binaural_hrtf_close( ) { int16_t allocate_init_flag; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM int16_t n_channels; -#endif if ( hHrtfFastConv == NULL || *hHrtfFastConv == NULL ) { @@ -1635,40 +1222,12 @@ void ivas_binaural_hrtf_close( } allocate_init_flag = ( *hHrtfFastConv )->allocate_init_flag; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM n_channels = ( *hHrtfFastConv )->n_channels; ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftReal, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftImag, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightReal, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightImag, n_channels, allocate_init_flag ); -#else - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftBRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftBRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightBRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightBRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_HOA3, HOA3_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_HOA2, HOA2_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_FOA, FOA_CHANNELS, allocate_init_flag ); -#endif return; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index fff019e028ece9d4b1f923a759a0bdcc8ffd1835..cb5dfc379a5312005ecb5c92d8ad6534b4750f07 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2175,13 +2175,8 @@ ivas_error ivas_init_decoder( } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2661,11 +2656,7 @@ void ivas_initialize_handles_dec( st_ivas->hMonoDmxRenderer = NULL; st_ivas->hCrendWrapper = NULL; st_ivas->hReverb = NULL; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM st_ivas->hHrtfCrend = NULL; -#else - st_ivas->hSetOfHRTF = NULL; -#endif st_ivas->hHrtfFastConv = NULL; st_ivas->hHrtfParambin = NULL; st_ivas->hHrtfStatistics = NULL; @@ -2883,11 +2874,7 @@ void ivas_destroy_dec( } /* CRend binaural renderer handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_HRTF_CRend_binary_close( &st_ivas->hHrtfCrend ); -#else - ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF ); -#endif /* Fastconv HRTF memories */ ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv ); diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index cf215d34c7376fb26903e2344dfc7d0ffbd6a8af..73730532c7eb817381e9f9e80e9e68fe58d71b77 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -199,11 +199,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_omasa_data_close( &st_ivas->hMasaIsmData ); /* Open Crend Binaural renderer */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 462ee2ad329431b6d67b3c0f6c18a8b8b53d7343..3fd629a6853fa337568ac029270ecfbf079e496c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1517,11 +1517,7 @@ ivas_error ivas_jbm_dec_flush_renderer( { if ( ism_mode_old == ISM_MASA_MODE_DISC ) { -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *tc_local[MAX_NUM_OBJECTS]; -#else - float *tc_local[MAX_TRANSPORT_CHANNELS]; -#endif for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { @@ -1529,29 +1525,10 @@ ivas_error ivas_jbm_dec_flush_renderer( mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); } -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( st_ivas->nchan_ism > 0 ) - { - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - for ( ch_idx = 0; ch_idx < st_ivas->hDecoderConfig->nchan_out; ch_idx++ ) - { - set_zero( p_output[ch_idx], (int16_t) ( *nSamplesRendered ) ); - } - st_ivas->hTcBuffer->slots_rendered += 1; - st_ivas->hTcBuffer->subframes_rendered += 1; - } -#endif } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index e0b12fd9627a9ef72629e19b9de36c24a6d158c5..f0cb1b4563b173d574924494f6a502a395149fb7 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1483,11 +1483,7 @@ ivas_error ivas_masa_dec_reconfigure( { if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } else { diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index b7c539301398e9a4e1e21131ffdf4ad7d7740f00..1479ba3c25bfb5b333ce319b1aa84f8282c51949 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1241,11 +1241,7 @@ static ivas_error ivas_mc_dec_reconfig( } else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 4dc1732dbed7622402cdb584fa0234d66adbdd1b..9d19ab44f6b7184aa8144f8923fa19f2cadf7298 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -99,11 +99,7 @@ ivas_error ivas_td_binaural_renderer_sf( int16_t nchan_ism_internal, nchan_ism, ch_offset; /* Set the number of ISMs */ -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { nchan_ism_internal = st_ivas->nchan_ism; nchan_ism = st_ivas->nchan_ism; @@ -235,11 +231,7 @@ ivas_error ivas_td_binaural_renderer_sf( /* Render subframe */ /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index c6731720441adb72f2597e93e0a97d7c8c4b806e..27ce47fbba167a2b5c40842d45cdb7279802e49b 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -748,26 +748,14 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( ) { int16_t n; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float data_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; -#else - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#endif ivas_error error; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *p_sepobj[BINAURAL_CHANNELS]; -#else - float *p_sepobj[MAX_NUM_OBJECTS]; -#endif int16_t slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH for ( n = 0; n < BINAURAL_CHANNELS; n++ ) -#else - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) -#endif { p_sepobj[n] = &data_separated_objects[n][0]; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 4dce5c64ce35288219a5a063eb16572bb1ae5607..ae68c9abca9a1017abd7bb9b34cb40b8fafa4322 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1100,11 +1100,7 @@ typedef struct Decoder_Struct MONO_DOWNMIX_RENDERER_HANDLE hMonoDmxRenderer; /* Mono downmix structure */ CREND_WRAPPER_HANDLE hCrendWrapper; /* Crend handle */ REVERB_HANDLE hReverb; /* Reverb handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend; /* HRTF tables for CRend binaural renderer */ -#else - HRTFS_CREND_HANDLE hSetOfHRTF; /* Set of HRTFs handle (CRend) */ -#endif HRTFS_FASTCONV_HANDLE hHrtfFastConv; /* FASTCONV HRTF tables for binaural rendering */ HRTFS_PARAMBIN_HANDLE hHrtfParambin; /* HRTF tables for parametric binauralizer */ HRTFS_STATISTICS_HANDLE hHrtfStatistics; /* HRTF statistics handle */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 8ac62b87c37a3df1b59dccb66380e8af88c048c2..a9abea31159f3c9e7c28207d9304e14c92003255 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -43,7 +43,9 @@ #include "jbm_pcmdsp_fifo.h" #include #include +#ifndef FIX_1225_DISCLAIMER #include +#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -909,12 +911,7 @@ ivas_error IVAS_DEC_ReadFormat( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec, /* o : secondary binaural renderer type */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ -#else - int16_t *room_reverb_flag, /* o : room reverb flag */ - IVAS_AUDIO_CONFIG *intern_audio_config /* o : internal audio configuration */ -#endif + IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ ) { ivas_error error; @@ -923,11 +920,7 @@ ivas_error IVAS_DEC_ReadFormat( ISM_MODE ism_mode_old; MC_MODE mc_mode_old; int16_t nchan_transport_old; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM AUDIO_CONFIG intern_config_old, transport_config_old, output_config; -#else - AUDIO_CONFIG intern_config_old, transport_config_old; -#endif RENDERER_TYPE renderer_type_old; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) @@ -944,10 +937,8 @@ ivas_error IVAS_DEC_ReadFormat( transport_config_old = st_ivas->transport_config; renderer_type_old = st_ivas->renderer_type; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM output_config = st_ivas->hDecoderConfig->output_config; -#endif if ( st_ivas->ivas_format == MONO_FORMAT ) { @@ -979,18 +970,9 @@ ivas_error IVAS_DEC_ReadFormat( break; case RENDERER_BINAURAL_FASTCONV: *binaural_renderer = IVAS_BIN_RENDERER_TYPE_FASTCONV; -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - *room_reverb_flag = 1; - } -#endif break; case RENDERER_BINAURAL_FASTCONV_ROOM: *binaural_renderer = IVAS_BIN_RENDERER_TYPE_FASTCONV; -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - *room_reverb_flag = 1; -#endif break; case RENDERER_BINAURAL_PARAMETRIC: case RENDERER_BINAURAL_PARAMETRIC_ROOM: @@ -1002,16 +984,11 @@ ivas_error IVAS_DEC_ReadFormat( } *binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_BINAURAL ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL ) -#endif { *binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_TDREND; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM *hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV ) { @@ -1039,7 +1016,6 @@ ivas_error IVAS_DEC_ReadFormat( } } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM else if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) { if ( st_ivas->ivas_format == ISM_FORMAT ) @@ -1059,10 +1035,6 @@ ivas_error IVAS_DEC_ReadFormat( } } } -#endif -#else - *intern_audio_config = st_ivas->intern_config; -#endif if ( ( renderer_type_old != st_ivas->renderer_type && renderer_type_old != RENDERER_DISABLE ) || ( st_ivas->ini_active_frame > 0 && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) ) @@ -1243,12 +1215,132 @@ ivas_error IVAS_DEC_GetEditableParameters( ) { int16_t dirac_read_idx, obj; +#ifdef NONBE_1217_INIT_OBJ_EDIT + Decoder_Struct *st_ivas; + ISM_MODE ism_mode; +#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasEditableParameters == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifdef NONBE_1217_INIT_OBJ_EDIT + st_ivas = hIvasDec->st_ivas; + ism_mode = st_ivas->ism_mode; + + if ( !( st_ivas->ivas_format == ISM_FORMAT || + st_ivas->ivas_format == SBA_ISM_FORMAT || + st_ivas->ivas_format == MASA_ISM_FORMAT || + ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) ) + { + return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing is not supported in this operation mode." ); + } + + hIvasEditableParameters->gain_bed = 1.0f; + hIvasEditableParameters->num_obj = st_ivas->nchan_ism; + if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) + { + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) + { + for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) + { + hIvasEditableParameters->ism_metadata[obj].azimuth = st_ivas->hIsmMetaData[obj]->azimuth; + hIvasEditableParameters->ism_metadata[obj].elevation = st_ivas->hIsmMetaData[obj]->elevation; + hIvasEditableParameters->ism_metadata[obj].yaw = st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = st_ivas->hIsmMetaData[obj]->radius; + hIvasEditableParameters->ism_metadata[obj].gain = st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + } + + if ( ism_mode == ISM_SBA_MODE_DISC ) + { + hIvasEditableParameters->gain_bed = 1.0f; + } + } + else if ( ism_mode == ISM_MODE_PARAM ) + { + for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) + { + hIvasEditableParameters->ism_metadata[obj].azimuth = st_ivas->hParamIsmDec->azimuth_values[obj]; + hIvasEditableParameters->ism_metadata[obj].elevation = st_ivas->hParamIsmDec->elevation_values[obj]; + hIvasEditableParameters->ism_metadata[obj].yaw = 0.0f; + hIvasEditableParameters->ism_metadata[obj].pitch = 0.0f; + hIvasEditableParameters->ism_metadata[obj].radius = 0.0f; + hIvasEditableParameters->ism_metadata[obj].gain = 1.0f; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = 0; + } + } + else if ( ism_mode == ISM_MODE_NONE ) + { + hIvasEditableParameters->num_obj = 0; + } +#ifdef DEBUGGING + else + { + assert( 0 && "This should never happen!" ); + } +#endif + } + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) + { + /* object editing possible only in two highest OMASA modes */ + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) + { + hIvasEditableParameters->ism_metadata[obj].azimuth = st_ivas->hIsmMetaData[obj]->azimuth; + hIvasEditableParameters->ism_metadata[obj].elevation = st_ivas->hIsmMetaData[obj]->elevation; + hIvasEditableParameters->ism_metadata[obj].yaw = st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = st_ivas->hIsmMetaData[obj]->radius; + + /* reset the otherwise unused "gain" field for the object */ + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = 1.0f; + hIvasEditableParameters->ism_metadata[obj].gain = st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + } + } + else if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + /* Handle MONO output */ + if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) + { + dirac_read_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->subframes_rendered]; + } + else + { + dirac_read_idx = 0; + } + + for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) + { + hIvasEditableParameters->ism_metadata[obj].azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx]; + hIvasEditableParameters->ism_metadata[obj].elevation = st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx]; + + hIvasEditableParameters->ism_metadata[obj].yaw = st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = st_ivas->hIsmMetaData[obj]->radius; + + /* reset the otherwise unused "gain" field for the object */ + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = 1.0f; + hIvasEditableParameters->ism_metadata[obj].gain = st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + } + } + else if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_MODE_NONE ) + { + hIvasEditableParameters->num_obj = 0; + } +#ifdef DEBUGGING + else + { + assert( 0 && "This should never happen!" ); + } +#endif + } +#else if ( !( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || @@ -1355,6 +1447,7 @@ ivas_error IVAS_DEC_GetEditableParameters( } } } +#endif return IVAS_ERR_OK; } @@ -1372,12 +1465,228 @@ ivas_error IVAS_DEC_SetEditableParameters( ) { int16_t dirac_read_idx, obj; +#ifdef NONBE_1217_INIT_OBJ_EDIT + Decoder_Struct *st_ivas; + ISM_MODE ism_mode; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } + st_ivas = hIvasDec->st_ivas; + ism_mode = st_ivas->ism_mode; + + if ( !( st_ivas->ivas_format == ISM_FORMAT || + st_ivas->ivas_format == SBA_ISM_FORMAT || + st_ivas->ivas_format == MASA_ISM_FORMAT || + ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) ) + { + return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing no supported in this operation mode." ); + } + + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + +#ifdef DEBUGGING + assert( hIvasEditableParameters.num_obj == st_ivas->nchan_ism ); +#endif + + if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) + { + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) + { + for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) + { + st_ivas->hIsmMetaData[obj]->edited_azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; + st_ivas->hIsmMetaData[obj]->edited_elevation = hIvasEditableParameters.ism_metadata[obj].elevation; + st_ivas->hIsmMetaData[obj]->edited_radius = hIvasEditableParameters.ism_metadata[obj].radius; + + st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; + + st_ivas->hIsmMetaData[obj]->edited_yaw = hIvasEditableParameters.ism_metadata[obj].yaw; + st_ivas->hIsmMetaData[obj]->edited_pitch = hIvasEditableParameters.ism_metadata[obj].pitch; + + st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; + } + + if ( ism_mode == ISM_SBA_MODE_DISC ) + { + st_ivas->hSbaIsmData->gain_bed = hIvasEditableParameters.gain_bed; + } + } + else if ( ism_mode == ISM_MODE_PARAM ) + { + for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) + { + st_ivas->hParamIsmDec->edited_azimuth_values[obj] = hIvasEditableParameters.ism_metadata[obj].azimuth; + st_ivas->hParamIsmDec->edited_elevation_values[obj] = hIvasEditableParameters.ism_metadata[obj].elevation; + st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; + + /* Detect direction editing in Param-ISM mode */ + if ( fabsf( st_ivas->hParamIsmDec->azimuth_values[obj] - hIvasEditableParameters.ism_metadata[obj].azimuth ) > OMASA_AZI_EDIT_THR || + fabsf( st_ivas->hParamIsmDec->elevation_values[obj] - hIvasEditableParameters.ism_metadata[obj].elevation ) > OMASA_ELE_EDIT_THR ) + { + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + } + else + { + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + } + + /* Detect gain editing in Param-ISM mode */ + if ( fabsf( 1.0f - hIvasEditableParameters.ism_metadata[obj].gain ) > OMASA_GAIN_EDIT_THR ) + { + st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1u; + } + else + { + st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; + } + } + + /* MASA is not present with the ISM format */ + st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; + } + else if ( ism_mode == ISM_MODE_NONE ) + { + if ( hIvasEditableParameters.num_obj != 0 ) + { + return IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED; + } + } +#ifdef DEBUGGING + else + { + assert( 0 && "This should never happen!" ); + } +#endif + } + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) + { + int16_t id_th; + float threshold_azi, threshold_ele; + + for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) + { + if ( st_ivas->hMasaIsmData != NULL ) + { + /* copy relevant fields also to OMASA structs, but only if the value has been changed. original values are in st_ivas->hIsmMetaData */ + /* first, need to convert float values to ints used internally */ + int16_t new_azi, new_ele; + if ( hIvasEditableParameters.ism_metadata[obj].azimuth > 0.0f ) + { + new_azi = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].azimuth + 0.5f ); + } + else + { + new_azi = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].azimuth - 0.5f ); + } + + if ( hIvasEditableParameters.ism_metadata[obj].elevation > 0.0f ) + { + new_ele = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].elevation + 0.5f ); + } + else + { + new_ele = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].elevation - 0.5f ); + } + + if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + /* Handle MONO output */ + if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) + { + dirac_read_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->subframes_rendered]; + } + else + { + dirac_read_idx = 0; + } + + /* determine thresholds for detecting object metadata edit for direction based on quantization resolution of the spatial direction parameters. + * these depend from the number of bits used to transmit the directions, + * which in turn depends from the object priority and importance: + * importance -> priority -> number of bits -> elevation resolution -> elevation ring index -> azimuth resolution. + * leading to elevation_resolution -> elevation threshold and azimuth resolution -> azimuth threshold */ + id_th = (int16_t) ( fabsf( (float) st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx] ) / delta_theta_masa[st_ivas->hMasaIsmData->bits_ism[obj] - 3] + 0.5f ); + threshold_azi = 360.0f / (float) no_phi_masa[st_ivas->hMasaIsmData->bits_ism[obj] - 1][id_th]; + threshold_ele = delta_theta_masa[st_ivas->hMasaIsmData->bits_ism[obj] - 3]; + + if ( ( (float) abs( new_azi - st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx] ) > threshold_azi ) || + ( (float) abs( new_ele - st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx] ) > threshold_ele ) ) + { + /* at least one of the threshold is exceeded, so use new direction value and set editing detection flag */ + st_ivas->hMasaIsmData->azimuth_ism_edited[obj] = new_azi; + st_ivas->hMasaIsmData->elevation_ism_edited[obj] = new_ele; + + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + } + else + { + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + } + } + else + { + /* detect editing in ISM_MASA_MODE_DISC. optionally, add quantization-resolution -based thresholds */ + if ( fabsf( st_ivas->hIsmMetaData[obj]->azimuth - hIvasEditableParameters.ism_metadata[obj].azimuth ) > OMASA_AZI_EDIT_THR || + fabsf( st_ivas->hIsmMetaData[obj]->elevation - hIvasEditableParameters.ism_metadata[obj].elevation ) > OMASA_ELE_EDIT_THR ) + { + st_ivas->hMasaIsmData->azimuth_ism_edited[obj] = new_azi; + st_ivas->hMasaIsmData->elevation_ism_edited[obj] = new_ele; + + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + } + else + { + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + } + } + + /* compare pre-edit gain and the edited one to detect editing */ + if ( fabsf( st_ivas->hIsmMetaData[obj]->edited_gain - hIvasEditableParameters.ism_metadata[obj].gain ) > OMASA_GAIN_EDIT_THR ) + { + st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1u; + st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; + } + else + { + st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; + } + } + + /* Copy edited values to hIsmMetaData struct */ + if ( st_ivas->hIsmMetaData[obj] != NULL ) + { + st_ivas->hIsmMetaData[obj]->azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; + st_ivas->hIsmMetaData[obj]->elevation = hIvasEditableParameters.ism_metadata[obj].elevation; + st_ivas->hIsmMetaData[obj]->yaw = hIvasEditableParameters.ism_metadata[obj].yaw; + st_ivas->hIsmMetaData[obj]->pitch = hIvasEditableParameters.ism_metadata[obj].pitch; + st_ivas->hIsmMetaData[obj]->radius = hIvasEditableParameters.ism_metadata[obj].radius; + st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; + st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; + } + } + + if ( fabsf( hIvasEditableParameters.gain_bed - 1.0f ) > OMASA_GAIN_EDIT_THR ) + { + st_ivas->hMasaIsmData->gain_masa_edited = hIvasEditableParameters.gain_bed; + st_ivas->hMasaIsmData->masa_gain_is_edited = 1u; + } + else + { + st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; + } + } +#else + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + if ( !( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || @@ -1580,6 +1889,7 @@ ivas_error IVAS_DEC_SetEditableParameters( hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; } } +#endif return IVAS_ERR_OK; } @@ -2707,29 +3017,16 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfCRendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#endif ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfCrend == NULL ) { return IVAS_ERR_WRONG_PARAMS; } *hHrtfCrend = &hIvasDec->st_ivas->hHrtfCrend; -#else - if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hSetOfHRTF == NULL ) - { - return IVAS_ERR_WRONG_PARAMS; - } - - *hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF; -#endif return IVAS_ERR_OK; } @@ -2833,17 +3130,9 @@ ivas_error IVAS_DEC_HRTF_binary_open( } /* Crend binaural renderer */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hHrtfCrend == NULL ) -#else - if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hSetOfHRTF == NULL ) -#endif { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open( &( st_ivas->hHrtfCrend ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open( &( st_ivas->hSetOfHRTF ) ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2916,11 +3205,7 @@ ivas_error IVAS_DEC_HRTF_binary_close( if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) { /* CRend binaural renderer handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_HRTF_CRend_binary_close( &st_ivas->hHrtfCrend ); -#else - ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF ); -#endif } if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) @@ -3938,7 +4223,7 @@ const char *IVAS_DEC_GetErrorMessage( return ivas_error_to_string( error ); } - +#ifndef FIX_1225_DISCLAIMER /*---------------------------------------------------------------------* * get_channel_config() * @@ -4024,7 +4309,7 @@ static ivas_error get_channel_config( return IVAS_ERR_OK; } - +#endif /*---------------------------------------------------------------------* * printConfigInfo_dec( ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 43dcfb33ba6b4df0207022722164ca489050c1b7..0fa179768a962a09f3ff17231e58956c5203d5a1 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -157,12 +157,7 @@ ivas_error IVAS_DEC_ReadFormat( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec,/* o: secondary binaural renderer type */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ -#else - int16_t *room_reverb_flag, /* o : room reverb flag */ - IVAS_AUDIO_CONFIG *intern_audio_config /* o : internal audio configuration */ -#endif ); /*! r: decoder error code */ @@ -444,11 +439,7 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( /*! r: error code */ ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfFastConvHandle( diff --git a/lib_enc/amr_wb_enc.c b/lib_enc/amr_wb_enc.c index 07f6cb221faced462e45fa1dc9abbbe3795288e8..1791daf85176ba3c166326373e148588772ba623 100644 --- a/lib_enc/amr_wb_enc.c +++ b/lib_enc/amr_wb_enc.c @@ -310,7 +310,13 @@ void amr_wb_enc( { st->fd_cng_reset_flag = 0; } + +#ifdef NONBE_1211_DTX_BR_SWITCHING + dtx( st, -1, -1, vad_flag_dtx, inp ); +#else dtx( st, -1, vad_flag_dtx, inp ); +#endif + /*----------------------------------------------------------------* * Noise energy down-ward update and total noise energy estimation * Long-term energies and relative frame energy updates diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 721cec90c35127434610685fc7a28100cbc458d9..676fb47647290cd8b9812ee96e909fd6bfa4a8b8 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -78,7 +78,10 @@ static void update_SID_cnt( DTX_ENC_HANDLE hDtxEnc, const int32_t core_brate, co *-------------------------------------------------------------------*/ void dtx( - Encoder_State *st, /* i/o: encoder state structure */ + Encoder_State *st, /* i/o: encoder state structure */ +#ifdef NONBE_1211_DTX_BR_SWITCHING + const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ +#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t vad, /* i : VAD flag for DTX */ const float speech[] /* i : Pointer to the speech frame */ @@ -87,17 +90,31 @@ void dtx( float alpha; DTX_ENC_HANDLE hDtxEnc = st->hDtxEnc; int16_t last_br_cng_flag, last_br_flag, br_dtx_flag; +#ifdef NONBE_1211_DTX_BR_SWITCHING + int32_t total_brate_ref; + + total_brate_ref = st->total_brate; +#endif + if ( st->dtx_sce_sba != 0 ) { last_br_cng_flag = 1; last_br_flag = 1; +#ifndef NONBE_1211_DTX_BR_SWITCHING br_dtx_flag = 1; +#endif } else { last_br_cng_flag = st->last_total_brate_cng <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate_cng <= MAX_BRATE_DTX_IVAS ); +#ifdef NONBE_1211_DTX_BR_SWITCHING + last_br_flag = ( st->element_mode == EVS_MONO && st->last_total_brate <= MAX_BRATE_DTX_EVS ) || + ( st->element_mode != EVS_MONO && last_ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || + st->lp_noise < 15; +#else last_br_flag = st->last_total_brate <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate <= MAX_BRATE_DTX_IVAS ); br_dtx_flag = 0; +#endif } /* Initialization */ @@ -142,6 +159,7 @@ void dtx( last_br_flag ) { st->total_brate = st->last_total_brate; + if ( !( st->total_brate == ACELP_7k20 && st->Opt_SC_VBR ) ) { st->Opt_SC_VBR = 0; @@ -170,6 +188,9 @@ void dtx( * Select SID or FRAME_NO_DATA frame if DTX is enabled *------------------------------------------------------------------------*/ +#ifdef NONBE_1211_DTX_BR_SWITCHING + br_dtx_flag = 1; +#endif if ( st->dtx_sce_sba == 0 ) { br_dtx_flag = ( st->element_mode == EVS_MONO && st->total_brate <= MAX_BRATE_DTX_EVS ) || @@ -258,6 +279,12 @@ void dtx( reset_indices_enc( st->hBstr, st->hBstr->nb_ind_tot ); } } +#ifdef NONBE_1211_DTX_BR_SWITCHING + else if ( st->element_mode != EVS_MONO ) + { + st->total_brate = total_brate_ref; + } +#endif /*------------------------------------------------------------------------* * Reset counters when in active frame (neither SID nor FRAME_NO_DATA frame) diff --git a/lib_enc/hq_classifier_enc.c b/lib_enc/hq_classifier_enc.c index b0ef15969b11166728597de7441b65613882d699..d895cbc707b062cc07ffcab156565f4e08e37ea3 100644 --- a/lib_enc/hq_classifier_enc.c +++ b/lib_enc/hq_classifier_enc.c @@ -573,7 +573,6 @@ static int16_t hf_spectrum_sparseness( inv_rms = 0.0f; crest_mod = 0.0f; maximum( A, L_SPEC_HB, &Amax ); -#ifdef NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO if ( Amax == 0 ) { /* For all-zero input the crest is 1.0 */ @@ -626,50 +625,6 @@ static int16_t hf_spectrum_sparseness( crest = Amax * inv_rms; crest_mod = crest_mod * inv_rms; } -#else - thr = Amax * PEAK_THRESHOLD; - movmean = 0.0f; /* avoid uninitialized warning */ - p_num = &inv_tbl[HALF_WIN_LENGTH + 1]; /* Table for division 1./(11:21) */ - for ( i = 0; i < L_SPEC_HB; i++ ) - { - inv_rms += A[i] * A[i]; - if ( A[i] < thr ) - { - low_count += 1; - } - if ( i <= HALF_WIN_LENGTH ) - { - if ( i == 0 ) - { - movmean = sum_f( &A[0], i + HALF_WIN_LENGTH + 1 ) * ( *p_num ); - } - else - { - p_num++; - movmean = movmean + ( A[i + HALF_WIN_LENGTH] - movmean ) * ( *p_num ); - } - } - else - { - if ( L_SPEC_HB <= i + HALF_WIN_LENGTH ) - { - p_num--; - movmean = movmean + ( movmean - A[i - HALF_WIN_LENGTH - 1] ) * ( *p_num ); - } - else - { - movmean = movmean + ( A[i + HALF_WIN_LENGTH] - A[i - HALF_WIN_LENGTH - 1] ) * ( *p_num ); - } - } - if ( crest_mod < movmean ) - { - crest_mod = movmean; - } - } - inv_rms = 1.0f / (float) sqrtf( inv_rms / L_SPEC_HB ); - crest = Amax * inv_rms; - crest_mod = crest_mod * inv_rms; -#endif *crest_lp = HQ_CREST_FAC_SM * ( *crest_lp ) + ( 1.0f - HQ_CREST_FAC_SM ) * crest; *crest_mod_lp = HQ_CREST_FAC_SM * ( *crest_mod_lp ) + ( 1.0f - HQ_CREST_FAC_SM ) * crest_mod; diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 2703c79fe70bac087ac3e423639c5c688edb61d0..39e0cb110b6e8745d79131286ff8a7e3dfa00557 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -108,8 +108,11 @@ ivas_error pre_proc_front_ivas( const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision*/ const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ - const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ + const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ +#ifdef NONBE_1211_DTX_BR_SWITCHING + const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ +#endif + const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ ) { float *inp_12k8, *new_inp_12k8; /* pointers to current frame and new data */ @@ -544,7 +547,11 @@ ivas_error pre_proc_front_ivas( st->cng_type = LP_CNG; } +#ifdef NONBE_1211_DTX_BR_SWITCHING + dtx( st, last_ivas_total_brate, ivas_total_brate, *vad_flag_dtx, inp_12k8 ); +#else dtx( st, ivas_total_brate, *vad_flag_dtx, inp_12k8 ); +#endif if ( hCPE != NULL && hCPE->hStereoDft != NULL && st->core_brate == SID_2k40 ) { diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 292cbd6a5fc4d2738e8d0b94c3c76600dffb7fd9..f1e0cebd28c4dac049f6259e1fec871f91f59692 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -478,7 +478,11 @@ ivas_error ivas_cpe_enc( error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n], +#ifdef NONBE_1211_DTX_BR_SWITCHING + fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, st_ivas->hEncoderConfig->last_ivas_total_brate, ivas_total_brate ); +#else fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate ); +#endif if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 306aaf74b6581a0f503e399273a457fc05cb709e..2b0f688226d355786fc0a075400f56f6c3c39715 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -172,7 +172,12 @@ void ivas_decision_matrix_enc( st->core = ACELP_CORE; } +#ifdef NONBE_1240_FIX_CORE_SELECTION_ISM_SW + /* sanity check: highest bitrates in ISM */ + if ( st->is_ism_format && st->tcxonly && st->total_brate > MAX_ACELP_BRATE_ISM ) +#else if ( st->is_ism_format && st->tcxonly ) +#endif { st->core = TCX_20_CORE; } diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index e19211f19a7bfeaef0d71d6bb0cd9e41a74fb3b0..02e767d7d973f20bcb4ee849bf970ecf706422bb 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -423,7 +423,12 @@ ivas_error front_vad_spar( noise_est_down( fr_bands[0], hFrontVad->hNoiseEst->bckr, tmpN, tmpE, st->min_band, st->max_band, &hFrontVad->hNoiseEst->totalNoise, Etot[0], &hFrontVad->hNoiseEst->Etot_last, &hFrontVad->hNoiseEst->Etot_v_h2 ); corr_shift = correlation_shift( hFrontVad->hNoiseEst->totalNoise ); +#ifdef NONBE_1211_DTX_BR_SWITCHING + dtx( st, hEncoderConfig->last_ivas_total_brate, hEncoderConfig->ivas_total_brate, vad_flag_dtx[0], inp_12k8 ); +#else dtx( st, hEncoderConfig->ivas_total_brate, vad_flag_dtx[0], inp_12k8 ); +#endif + /* linear prediction analysis */ alw_pitch_lag_12k8[0] = st->old_pitch_la; alw_pitch_lag_12k8[1] = st->old_pitch_la; diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index c72431bd0bbba983877532e2df681f8215524060..da0fe388ddcdfcbb266384cc7205de9da014e1e2 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -179,7 +179,11 @@ ivas_error ivas_ism_enc( error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0], &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0], +#ifdef NONBE_1211_DTX_BR_SWITCHING + fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->last_ivas_total_brate, st_ivas->hEncoderConfig->ivas_total_brate ); +#else fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate ); +#endif if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 257e8061953cd4b5d4e58d9cca2c7f6aac579660..df1d804f34d12fcb08ed7e9f2724d5d67fe2f940 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -188,7 +188,11 @@ ivas_error ivas_sce_enc( &ener[0], &relE[0], A[0], Aw[0], epsP[0], lsp_new[0], lsp_mid[0], &vad_hover_flag[0], &attack_flag[0], realBuffer[0], imagBuffer[0], old_wsp[0], pitch_fr[0], voicing_fr[0], &loc_harm[0], &cor_map_sum[0], &vad_flag_dtx[0], enerBuffer[0], fft_buff[0], A[0], lsp_new[0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, flag_16k_smc, +#ifdef NONBE_1211_DTX_BR_SWITCHING + st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->last_ivas_total_brate, st_ivas->hEncoderConfig->ivas_total_brate ); +#else st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->ivas_total_brate ); +#endif if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_stereo_cng_enc.c b/lib_enc/ivas_stereo_cng_enc.c index ac938f02edc15faaa3dd2d4ba3e5f87bee5cf3d2..49430f2d1fb8a4740eb1d9dee00326084c5f8a80 100644 --- a/lib_enc/ivas_stereo_cng_enc.c +++ b/lib_enc/ivas_stereo_cng_enc.c @@ -95,7 +95,11 @@ void stereo_dft_enc_sid_calc_coh( for ( k = hStereoDft->band_limits[b]; k < hStereoDft->band_limits[b + 1]; k++ ) { coh_weight = hStereoDft->DFT[0][2 * k] * hStereoDft->DFT[0][2 * k] + hStereoDft->DFT[0][2 * k + 1] * hStereoDft->DFT[0][2 * k + 1]; +#ifdef NONBE_1246_INF_COHERENCE_IN_HIGH_LEVEL_DTX + cohBand[b] += coh_weight * ( ( hStereoDft->xspec_smooth[2 * k] * hStereoDft->xspec_smooth[2 * k] + hStereoDft->xspec_smooth[2 * k + 1] * hStereoDft->xspec_smooth[2 * k + 1] ) / ( hStereoDft->Spd_L_smooth[k] * hStereoDft->Spd_R_smooth[k] + EPSILON ) ); +#else cohBand[b] += coh_weight * ( hStereoDft->xspec_smooth[2 * k] * hStereoDft->xspec_smooth[2 * k] + hStereoDft->xspec_smooth[2 * k + 1] * hStereoDft->xspec_smooth[2 * k + 1] ) / ( hStereoDft->Spd_L_smooth[k] * hStereoDft->Spd_R_smooth[k] + EPSILON ); +#endif coh_weight_sum += coh_weight; } if ( coh_weight_sum > 0 ) diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index d4f280fb84d9cdbe86fc55aba3ecde88d7df6e4c..36d477fbe95c89c0fcba6ca829b89b98b6ff350f 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -605,11 +605,11 @@ static void calc_poc( /* Channel selection based on ILD */ if ( hPHA->trns_aux_energy[0] > hPHA->trns_aux_energy[1] * hPHA->pha_ipd_ild_thresh ) { - pha_ipd_ild_chan2rephase = 0; + pha_ipd_ild_chan2rephase = 1; } else if ( hPHA->trns_aux_energy[1] > hPHA->trns_aux_energy[0] * hPHA->pha_ipd_ild_thresh ) { - pha_ipd_ild_chan2rephase = 1; + pha_ipd_ild_chan2rephase = 0; } else { diff --git a/lib_enc/pre_proc.c b/lib_enc/pre_proc.c index 513a94b627633f132b2b9f71d5937b3d704edeb0..7db0c9c43392989cd3008eb556b1cfe37391b480 100644 --- a/lib_enc/pre_proc.c +++ b/lib_enc/pre_proc.c @@ -252,7 +252,13 @@ void pre_proc( /*-----------------------------------------------------------------* * Select SID or FRAME_NO_DATA frame if DTX enabled *-----------------------------------------------------------------*/ + +#ifdef NONBE_1211_DTX_BR_SWITCHING + dtx( st, -1, -1, vad_flag_dtx, inp_12k8 ); +#else dtx( st, -1, vad_flag_dtx, inp_12k8 ); +#endif + /*----------------------------------------------------------------* * Adjust FD-CNG Noise Estimator *----------------------------------------------------------------*/ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 555351a985fb79475d7be91e4a82245bcd15cbe0..6ff135bbd3369d46dfa019c5bb733d12cce589d0 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -53,15 +53,9 @@ * Initialize hHrtf handle *------------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_Crend_hrtf_init( HRTFS_CREND_DATA *hHrtf /* i/o: HRTF handle */ ) -#else -ivas_error ivas_hrtf_init( - HRTFS_DATA *hHrtf /* i/o: HRTF handle */ -) -#endif { int16_t i, j; @@ -123,11 +117,7 @@ static ivas_error ivas_hrtf_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend HRTFS Handle\n" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_Crend_hrtf_init( hHrtf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_hrtf_init( hHrtf ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -175,19 +165,11 @@ static ivas_error ivas_rend_initCrend( CREND_WRAPPER *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, const int16_t ext_rend_flag, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif const int32_t output_Fs ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM int16_t i, j, tmp, tmp2; -#else - int16_t i, j, tmp; -#endif int16_t nchan_in; IVAS_REND_AudioConfigType inConfigType; HRTFS_HANDLE hHrtf; @@ -209,7 +191,6 @@ static ivas_error ivas_rend_initCrend( if ( hHrtf == NULL ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtfCrend != NULL && ext_rend_flag == 0 ) { /* HRTF set loaded from binary file */ @@ -230,13 +211,6 @@ static ivas_error ivas_rend_initCrend( hHrtf->init_from_rom = 0; } } -#else - if ( ivas_hrtf_open( &hHrtf ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for HRTF handle" ); - } - -#endif } if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK ) @@ -250,21 +224,8 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERR_INTERNAL_FATAL; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtf->init_from_rom ) -#else - if ( ( hSetOfHRTF == NULL ) || - ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || - ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL ) ) || - ( ( hSetOfHRTF->hHRTF_brir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) || - ( ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_FOA ) ) || - ( ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) ) || - ( ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#endif { -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - hHrtf->init_from_rom = 1; -#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -740,7 +701,6 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -848,195 +808,6 @@ static ivas_error ivas_rend_initCrend( } } } -#else - hHrtf->init_from_rom = 0; - if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) - { - hHrtf->max_num_ir -= 1; /* subtract LFE */ - hHrtf->gain_lfe = GAIN_LFE; - - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - if ( hSetOfHRTF->hHRTF_brir_combined == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_brir_combined->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_brir_combined->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_brir_combined->index_frequency_max_diffuse; - } - else - { - if ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_combined->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_combined->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_combined->index_frequency_max_diffuse; - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_diffuse_im[j]; - } - else - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_combined->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_combined->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_diffuse_im[j]; - } - } - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - if ( inConfig == IVAS_AUDIO_CONFIG_5_1 ) - { - tmp = channelIndex_CICP6[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_7_1 ) - { - tmp = channelIndex_CICP12[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_2 ) - { - tmp = channelIndex_CICP14[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_4 ) - { - tmp = channelIndex_CICP16[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_7_1_4 ) - { - tmp = channelIndex_CICP19[i]; - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[j][tmp]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_re[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_im[tmp][j]; - } - else - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight[j][tmp]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_combined->num_iterations[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pIndex_frequency_max[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_re[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_im[tmp][j]; - } - } - } - } - else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) - { - if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) - { - if ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa3->index_frequency_max_diffuse; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa3->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_diffuse_im[j]; - } - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) - { - if ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa2->index_frequency_max_diffuse; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa2->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_diffuse_im[j]; - } - } - else if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) - { - if ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_foa->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_foa->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_foa->index_frequency_max_diffuse; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_foa->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_foa->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_foa->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_diffuse_im[j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL, "Unsupported renderer type in Crend" ); - } - } -#endif } hHrtf->same_inv_diffuse_weight = 1; @@ -1359,11 +1130,7 @@ ivas_error ivas_rend_openMultiBinCrend( const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM return ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, 0, pMultiBinPoseData->num_poses ); -#else - return ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ); -#endif } @@ -1378,16 +1145,10 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM const int16_t ext_rend_flag, -#endif const int16_t num_poses ) { int16_t i, subframe_length; @@ -1408,11 +1169,7 @@ ivas_error ivas_rend_openCrend( if ( ( *pCrend )->hHrtfCrend == NULL ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_initCrend( *pCrend, inConfig, outConfig, hHrtfCrend, ext_rend_flag, output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_initCrend( *pCrend, inConfig, outConfig, hSetOfHRTF, output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1595,11 +1352,7 @@ void ivas_rend_closeCrend( return; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( *pCrend )->hHrtfCrend != NULL && ( *pCrend )->hHrtfCrend->init_from_rom ) -#else - if ( ( *pCrend )->hHrtfCrend != NULL && ( *pCrend )->hHrtfCrend->init_from_rom ) -#endif { ivas_hrtf_close( &( *pCrend )->hHrtfCrend ); } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index dc617485458ca9ba557a92de19fb10cc13f4efe0..cad8923ce2602e22a4bfd7bdb8c62ebdf8935c2f 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -321,11 +321,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( nchan_to_allocate = 2 * BINAURAL_CHANNELS; if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } n_samples_granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 815ff89ea4702ffa24a4c8d6170baf51373a86ee..58fdf3dc10e9935300472095c0b9b2f4e4423c62 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -88,7 +88,6 @@ void ivas_HRTF_binary_close( * Allocate HRTF binary handle for Crend renderer *-----------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_HRTF_CRend_binary_open( HRTFS_CREND_DATA **hHrtfCrend ) { @@ -106,28 +105,7 @@ ivas_error ivas_HRTF_CRend_binary_open( return IVAS_ERR_OK; } -#else -ivas_error ivas_HRTF_CRend_binary_open( - HRTFS_CREND **hSetOfHRTF ) -{ - /* Allocate HR filter set for headphones configuration */ - *hSetOfHRTF = (HRTFS_CREND *) malloc( sizeof( HRTFS_CREND ) ); - if ( *hSetOfHRTF == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for set of HRTF binary!" ); - } - - ( *hSetOfHRTF )->hHRTF_hrir_combined = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_hoa3 = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_hoa2 = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_foa = NULL; - ( *hSetOfHRTF )->hHRTF_brir_combined = NULL; - - return IVAS_ERR_OK; -} -#endif -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*-----------------------------------------------------------------------* * ivas_HRTF_CRend_binary_open_buffers_uint16() @@ -172,7 +150,6 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * ivas_HRTF_CRend_binary_close() @@ -180,7 +157,6 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( * Close HRTF CRend binary handle for Crend renderer *-------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM void ivas_HRTF_CRend_binary_close( HRTFS_CREND_DATA **hHrtfCrend ) { @@ -230,21 +206,6 @@ void ivas_HRTF_CRend_binary_close( return; } -#else -void ivas_HRTF_CRend_binary_close( - HRTFS_CREND **hSetOfHRTF ) -{ - if ( hSetOfHRTF == NULL || *hSetOfHRTF == NULL ) - { - return; - } - - free( *hSetOfHRTF ); - *hSetOfHRTF = NULL; - - return; -} -#endif /*-----------------------------------------------------------------------* diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 0a44305f064ee7257d0548044fb98c840a7d2d9c..fcbdee32a345168622cc994ffc9272b43c690109 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -384,11 +384,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( } /* Render subframe */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx, ism_md_subframe_update ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -429,12 +425,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ -#endif + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ) { int16_t i; @@ -446,11 +437,6 @@ ivas_error TDREND_GetMix( float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; -#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - int16_t subframe_update_flag; - - subframe_update_flag = subframe_idx == ism_md_subframe_update; -#endif error = IVAS_ERR_OK; @@ -474,13 +460,8 @@ ivas_error TDREND_GetMix( /* Update rendering params if needed */ if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) { -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p ); -#else - TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, - Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_update_flag ); -#endif } /* Render source if needed */ diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 0307a058eb2f4dc7b50de9705ba9822be0faf336..27f594ce9bcf5fc6018a67ca52236bf2b2a89f3b 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -305,13 +305,8 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - TDREND_SRC_t *Src_p /* i/o: Source pointer */ + TDREND_SRC_t *Src_p /* i/o: Source pointer */ ) -#else - TDREND_SRC_t *Src_p, /* i/o: Source pointer */ - const int16_t subframe_update_flag ) -#endif { TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; @@ -402,11 +397,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */ } -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( *intp_count > 0 ) ) -#else - if ( ( *intp_count > 0 ) && subframe_update_flag ) -#endif { /* Set deltas for interpolation */ v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 46025d48293fd8a3303a54677715ce9fc556189f..cd2330bf095a07816df6ab9415675e0d92612134 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -37,6 +37,9 @@ #include "ivas_prot_rend.h" #include "ivas_rom_com.h" #include "ivas_prot.h" +#ifdef FIX_1225_DISCLAIMER +#include +#endif #ifdef DEBUGGING #include "debug.h" #include @@ -344,11 +347,7 @@ int16_t ivas_get_nchan_buffers_dec( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS nchan_out_buff = max( nchan_out_buff, BINAURAL_CHANNELS + st_ivas->nchan_ism ); -#else - nchan_out_buff = max( nchan_out_buff, 2 * BINAURAL_CHANNELS + 2 ); -#endif } else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -480,3 +479,116 @@ int16_t is_split_rendering_enabled( return 0; } } + +#ifdef FIX_1225_DISCLAIMER + +/*---------------------------------------------------------------------* + * get_channel_config() + * + * Gets a str related to input config + *---------------------------------------------------------------------*/ + +ivas_error get_channel_config( + const AUDIO_CONFIG config, + char *str ) +{ + if ( config == IVAS_AUDIO_CONFIG_MONO ) + { + strcpy( str, "Mono" ); + } + else if ( config == IVAS_AUDIO_CONFIG_STEREO ) + { + strcpy( str, "Stereo" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM1 ) + { + strcpy( str, "Object-based audio (1 object)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM2 ) + { + strcpy( str, "Object-based audio (2 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM3 ) + { + strcpy( str, "Object-based audio (3 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM4 ) + { + strcpy( str, "Object-based audio (4 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1 ) + { + strcpy( str, "Multichannel 5.1 (CICP6)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_7_1 ) + { + strcpy( str, "Multichannel 7.1 (CICP12)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1_2 ) + { + strcpy( str, "Multichannel 5.1+2 (CICP14)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1_4 ) + { + strcpy( str, "Multichannel 5.1+4 (CICP16)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_7_1_4 ) + { + strcpy( str, "Multichannel 7.1+4 (CICP19)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + { + strcpy( str, "Multichannel (custom loudspeaker layout)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_MASA1 ) + { + strcpy( str, "Metadata-Assisted Spatial Audio mono (MASA1)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_MASA2 ) + { + strcpy( str, "Metadata-Assisted Spatial Audio stereo (MASA2)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_FOA ) + { + strcpy( str, "Ambisonics: First Order (FOA)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_HOA2 ) + { + strcpy( str, "Ambisonics: Second Order (HOA2)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_HOA3 ) + { + strcpy( str, "Ambisonics: Third Order (HOA3)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL ) + { + strcpy( str, "Binaural: no room" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + { + strcpy( str, "Binaural: room with impulse responses" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + strcpy( str, "Binaural: room with reverb" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + { + strcpy( str, "BINAURAL_SPLIT_CODED" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + strcpy( str, "Binaural_Split_PCM" ); + } + else if ( config == IVAS_AUDIO_CONFIG_EXTERNAL ) + { + strcpy( str, "External renderer" ); + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Incorrect Input/Output Configuration" ); + } + + return IVAS_ERR_OK; +} +#endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index d4a75254a3ddc384f840cf01933ba5e99b4626eb..5d88fab6369174f12b7b473913a20755fbdfaf00 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -83,6 +83,12 @@ int16_t is_split_rendering_enabled( const IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* i : Render config data structure */ ); +#ifdef FIX_1225_DISCLAIMER +ivas_error get_channel_config( + const AUDIO_CONFIG config, + char *str +); +#endif /*----------------------------------------------------------------------------------* * TD decorr. function prototypes @@ -576,14 +582,9 @@ void ivas_HRTF_parambin_binary_close( ); ivas_error ivas_HRTF_CRend_binary_open( -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ -#else - HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ -#endif ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_HRTF_CRend_binary_open_buffers_uint16( uint16_t **buffer, /* o : buffer to allocate */ const uint32_t mem_size /* i : size of buffer */ @@ -594,13 +595,8 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( const uint32_t mem_size /* i : size of buffer */ ); -#endif void ivas_HRTF_CRend_binary_close( -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ -#else - HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ -#endif ); ivas_error ivas_HRTF_statistics_init( @@ -678,12 +674,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth/rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay metadata to sync with audio */ -#endif ); ivas_error TDREND_Update_listener_orientation( @@ -784,12 +775,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_t *Src_p /* i/o: Source pointer */ -#else - TDREND_SRC_t *Src_p, - const int16_t subframe_update_flag /* i : Flag to determine update subframe idx */ -#endif ); ivas_error TDREND_SRC_Alloc( @@ -912,16 +898,10 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM const int16_t ext_rend_flag, -#endif const int16_t num_poses ); @@ -930,15 +910,9 @@ void ivas_rend_closeCrend( const int16_t num_poses ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_Crend_hrtf_init( HRTFS_CREND_DATA *hHrtf /* i/o: Crend HRTF handle */ ); -#else -ivas_error ivas_hrtf_init( - HRTFS_DATA *hHrtf /* i/o: HRTF handle */ -); -#endif ivas_error ivas_rend_initCrendWrapper( CREND_WRAPPER_HANDLE *pCrend, diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index eaa1dcad36c0fe3d611bf91b85fe657afa4b34df..e737d4a7e2668179a91f7d589149dda47b57e9a7 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1157,11 +1157,7 @@ typedef struct * Crend structures *------------------------------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM typedef struct ivas_hrtf_crend_structure -#else -typedef struct ivas_hrtfs_structure -#endif { const float *pOut_to_bin_re[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; const float *pOut_to_bin_im[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; @@ -1186,11 +1182,7 @@ typedef struct ivas_hrtfs_structure uint16_t *pIndex_frequency_max_dyn[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; uint16_t *pIndex_frequency_max_diffuse_dyn[BINAURAL_CHANNELS]; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM } HRTFS_DATA, *HRTFS_HANDLE, HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; // VE: all instance of HRTFS_DATAand *HRTFS_HANDLE should be renamed to HRTFS_CREND_DATA and *HRTFS_CREND_HANDLE -#else -} HRTFS_DATA, *HRTFS_HANDLE; -#endif /* Main Crend structure */ typedef struct ivas_crend_state_t @@ -1252,70 +1244,18 @@ typedef struct ivas_binaural_rendering_struct * HRTF structures - hrtfs from binary files *------------------------------------------------------------------------------------------*/ -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM -typedef struct ivas_hrtfs_crend_structure -{ - HRTFS_DATA *hHRTF_hrir_combined; - HRTFS_DATA *hHRTF_hrir_hoa3; - HRTFS_DATA *hHRTF_hrir_hoa2; - HRTFS_DATA *hHRTF_hrir_foa; - HRTFS_DATA *hHRTF_brir_combined; - -} HRTFS_CREND, *HRTFS_CREND_HANDLE; - -#endif /* Fastconv binaural data structure */ typedef struct ivas_hrtfs_fastconv_struct { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM float FASTCONV_latency_s; float ***leftReal; float ***leftImag; float ***rightReal; float ***rightImag; int16_t n_channels; -#else - float FASTCONV_HOA3_latency_s; - float ***leftHRIRReal_HOA3; - float ***leftHRIRImag_HOA3; - float ***rightHRIRReal_HOA3; - float ***rightHRIRImag_HOA3; - - float FASTCONV_HRIR_latency_s; - float ***leftHRIRReal; - float ***leftHRIRImag; - float ***rightHRIRReal; - float ***rightHRIRImag; - - float ***leftBRIRReal; - float ***leftBRIRImag; - float ***rightBRIRReal; - float ***rightBRIRImag; - float FASTCONV_BRIR_latency_s; - - float ***leftHRIRReal_HOA2; - float ***leftHRIRImag_HOA2; - float ***rightHRIRReal_HOA2; - float ***rightHRIRImag_HOA2; - float FASTCONV_HOA2_latency_s; - - float ***leftHRIRReal_FOA; - float ***leftHRIRImag_FOA; - float ***rightHRIRReal_FOA; - float ***rightHRIRImag_FOA; - float FASTCONV_FOA_latency_s; -#endif int16_t allocate_init_flag; /*Memory allocation flag 0: if the hrtf pointers are allocated at application level , 1: of allocated at ivas_binaural_hrtf_open() */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM uint16_t ntaps; -#else - uint16_t ntaps_hrir; - uint16_t ntaps_hrir_hoa3; - uint16_t ntaps_hrir_hoa2; - uint16_t ntaps_hrir_foa; - uint16_t ntaps_brir; -#endif float fastconvReverberationTimes[CLDFB_NO_CHANNELS_MAX]; float fastconvReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e9a13a9aa0e7ab41ea4ab7c24812823b34bba373..7c9b9c0037a05a32618b84b3135c610ef314fe1a 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1367,11 +1367,7 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2143,13 +2139,8 @@ static ivas_error initMcBinauralRendering( else if ( !useTDRend && inputMc->crendWrapper == NULL ) { /* open CREND */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, 1, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, - outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2547,11 +2538,7 @@ static ivas_error updateSbaPanGains( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2563,11 +2550,7 @@ static ivas_error updateSbaPanGains( return error; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -7669,9 +7652,7 @@ void IVAS_REND_Close( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { clearInputSba( &hIvasRend->inputsSba[i] ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hIvasRend->hHrtfs.hHrtfFastConv = NULL; -#endif } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { @@ -8723,3 +8704,99 @@ static void freeMasaExtRenderer( return; } + + +#ifdef FIX_1225_DISCLAIMER +static ivas_error printConfigInfo_rend( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +) +{ + ivas_error error; + char config_str[50]; + + /*-----------------------------------------------------------------* + * Print output audio configuration + *-----------------------------------------------------------------*/ + + if ( ( error = get_channel_config( hIvasRend->outputConfig, &config_str[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + + fprintf( stdout, "Output configuration: %s\n", config_str ); + + /*-----------------------------------------------------------------* + * Print renderer configurations + *-----------------------------------------------------------------*/ + + fprintf( stdout, "Output sampling rate: %d Hz\n", hIvasRend->sampleRateOut ); + + if ( hIvasRend->headRotData.headRotEnabled == 1 ) + { + fprintf( stdout, "Head-tracking: ON\n" ); + } + + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + fprintf( stdout, "Render framesize: %dms\n", hIvasRend->num_subframes * 5 ); + } + + return IVAS_ERR_OK; +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintInputConfig() + * + * + *---------------------------------------------------------------------*/ + +void IVAS_REND_PrintInputConfig( + const IVAS_AUDIO_CONFIG inputConfig /* i : input audio configuration */ +) +{ + char config_str[50]; + + get_channel_config( inputConfig, &config_str[0] ); + fprintf( stdout, "Input configuration: %s\n", config_str ); + + return; +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintConfig() + * + * + *---------------------------------------------------------------------*/ + +ivas_error IVAS_REND_PrintConfig( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +) +{ + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + return printConfigInfo_rend( hIvasRend ); +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintDisclaimer() + * + * Print IVAS disclaimer to console + *---------------------------------------------------------------------*/ + +void IVAS_REND_PrintDisclaimer( void ) +{ + print_disclaimer( stderr ); + + return; +} +#endif diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 5886ad769c74bbcc70ef9953b4105db705ae53d0..ee4aa681d439acc5461e9bfb34808f680a4001f2 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -35,7 +35,10 @@ #include "common_api_types.h" #include +#ifndef FIX_1225_DISCLAIMER #include "ivas_stat_rend.h" +#endif + /*---------------------------------------------------------------------* * Renderer constants @@ -420,6 +423,22 @@ int32_t IVAS_REND_GetCntFramesLimited( ); #endif + +#ifdef FIX_1225_DISCLAIMER +/* Disclaimer and info printing */ + +void IVAS_REND_PrintInputConfig( + const IVAS_AUDIO_CONFIG inputConfig /* i : input audio configuration */ +); + +ivas_error IVAS_REND_PrintConfig( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +); + +void IVAS_REND_PrintDisclaimer( + void +); +#endif /* clang-format on */ #endif diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index f3517edd3091ce3f1babb7d8b03c8dcd5893b2f6..6b0f36c49c092ee34659642ed9988928aaae0bc2 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -242,7 +242,6 @@ static ivas_error read_hrtf_binary_header( return IVAS_ERR_END_OF_FILE; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /*-------------------------------------------------------------------* * audio_cfg_2_binaural_cfg() @@ -278,7 +277,6 @@ static BINAURAL_INPUT_AUDIO_CONFIG audio_cfg_2_binaural_cfg( return hrtf_set_binaural_cfg; } -#endif /*-------------------------------------------------------------------* * TDREND_LoadBSplineBinaryITD() @@ -1120,11 +1118,7 @@ void destroy_td_hrtf( * Create HRTF from the raw data (to the HRTF CRend handle) *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM static ivas_error create_Crend_HRTF_from_rawdata( -#else -static ivas_error create_HRTF_from_rawdata( -#endif HRTFS_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ char *hrtf_data /* i : pointer to binary file */ ) @@ -1132,34 +1126,12 @@ static ivas_error create_HRTF_from_rawdata( int16_t i, j, k; int16_t max_num_iterations_diffuse; uint32_t max_total_num_fsamp_per_iteration, max_total_num_fsamp_per_iteration_diff; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM uint32_t mem_size, mem_size_buf, l; -#else - uint32_t mem_size, l; -#endif char *hrtf_data_rptr; float *pOut_to_bin_wptr; ivas_error error; Word16 factorQ; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - if ( *hHRTF == NULL ) - { - if ( ( ( *hHRTF ) = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" ); - } - - if ( ( error = ivas_hrtf_init( *hHRTF ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - return IVAS_ERR_INTERNAL; - } -#endif if ( hrtf_data == NULL ) { @@ -1202,28 +1174,17 @@ static ivas_error create_HRTF_from_rawdata( } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size = ( *hHRTF )->max_num_iterations * sizeof( uint16_t ); -#endif /* pIndex_frequency_max */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_dyn[i][j], mem_size ) ) != IVAS_ERR_OK ) { return error; } -#else - mem_size = ( *hHRTF )->max_num_iterations * sizeof( uint16_t ); - ( *hHRTF )->pIndex_frequency_max_dyn[i][j] = (uint16_t *) malloc( mem_size ); - if ( ( *hHRTF )->pIndex_frequency_max_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pIndex_frequency_max" ); - } -#endif memcpy( ( *hHRTF )->pIndex_frequency_max_dyn[i][j], hrtf_data_rptr, mem_size ); ( *hHRTF )->pIndex_frequency_max[i][j] = ( *hHRTF )->pIndex_frequency_max_dyn[i][j]; hrtf_data_rptr += mem_size; @@ -1247,18 +1208,10 @@ static ivas_error create_HRTF_from_rawdata( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { mem_size = ( *hHRTF )->num_iterations_diffuse[j] * sizeof( uint16_t ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j], mem_size ) ) != IVAS_ERR_OK ) { return error; } -#else - ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] = (uint16_t *) malloc( mem_size ); - if ( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pIndex_frequency_max_diffuse" ); - } -#endif memcpy( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j], hrtf_data_rptr, mem_size ); ( *hHRTF )->pIndex_frequency_max_diffuse[j] = ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j]; hrtf_data_rptr += mem_size; @@ -1292,30 +1245,18 @@ static ivas_error create_HRTF_from_rawdata( factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( Word16 ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size_buf = max_total_num_fsamp_per_iteration * sizeof( float ); -#endif /* coeff_re (the size depends on pIndex_frequency_max) */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_re_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_re_dyn[i][j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration * sizeof( float ); - ( *hHRTF )->pOut_to_bin_re_dyn[i][j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_re_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for Out_to_bin_re" ); - } - memset( ( *hHRTF )->pOut_to_bin_re_dyn[i][j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_re[i][j] = ( *hHRTF )->pOut_to_bin_re_dyn[i][j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_re_dyn[i][j]; @@ -1339,21 +1280,11 @@ static ivas_error create_HRTF_from_rawdata( { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_im_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_im_dyn[i][j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration * sizeof( float ); - ( *hHRTF )->pOut_to_bin_im_dyn[i][j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_im_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for Out_to_bin_im" ); - } - memset( ( *hHRTF )->pOut_to_bin_im_dyn[i][j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_im[i][j] = ( *hHRTF )->pOut_to_bin_im_dyn[i][j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_im_dyn[i][j]; @@ -1375,10 +1306,8 @@ static ivas_error create_HRTF_from_rawdata( max_total_num_fsamp_per_iteration_diff = *( (uint32_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint32_t ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size_buf = max_total_num_fsamp_per_iteration_diff * sizeof( float ); -#endif if ( max_total_num_fsamp_per_iteration_diff != 0 ) { /* factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); */ @@ -1386,21 +1315,11 @@ static ivas_error create_HRTF_from_rawdata( /* coeff_diffuse_re : The size depends on pIndex_frequency_max_diffuse */ for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration_diff * sizeof( float ); - ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pOut_to_bin_diffuse_re" ); - } - memset( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_diffuse_re[j] = ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j]; @@ -1421,21 +1340,11 @@ static ivas_error create_HRTF_from_rawdata( /* coeff_diffuse_im : The size depends on pIndex_frequency_max_diffuse */ for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration_diff * sizeof( float ); - ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pOut_to_bin_diffuse_im" ); - } - memset( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_diffuse_im[j] = ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j]; @@ -1509,12 +1418,10 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ntaps = *( (uint16_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint16_t ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM ( *hHRTF )->ntaps = ntaps; ( *hHRTF )->FASTCONV_latency_s = latency_s; ( *hHRTF )->n_channels = nbchan; -#endif if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1522,10 +1429,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_LS_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir = ntaps; - ( *hHRTF )->FASTCONV_HRIR_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) { @@ -1533,10 +1436,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HOA3_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_hoa3 = ntaps; - ( *hHRTF )->FASTCONV_HOA3_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) { @@ -1544,10 +1443,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HOA2_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_hoa2 = ntaps; - ( *hHRTF )->FASTCONV_HOA2_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) { @@ -1555,10 +1450,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (FOA_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_foa = ntaps; - ( *hHRTF )->FASTCONV_FOA_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1566,10 +1457,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_LS_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_brir = ntaps; - ( *hHRTF )->FASTCONV_BRIR_latency_s = latency_s; -#endif } else { @@ -1578,22 +1465,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, nbchan, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, IVAS_AUDIO_CONFIG_INVALID, input_cfg, RENDERER_BINAURAL_FASTCONV, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, nbchan, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, IVAS_AUDIO_CONFIG_INVALID, input_cfg, RENDERER_BINAURAL_FASTCONV_ROOM, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1603,7 +1482,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "renderer type not compliant" ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* HRIR/BRIR Q factor*/ factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( Word16 ); @@ -1661,294 +1539,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( /* BRIR */ if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { -#else - /* HRIR */ - if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->leftHRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->leftHRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->rightHRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->rightHRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->leftHRIRReal_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->leftHRIRImag_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->rightHRIRReal_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->rightHRIRImag_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->leftHRIRReal_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->leftHRIRImag_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->rightHRIRReal_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->rightHRIRImag_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->leftHRIRReal_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->leftHRIRImag_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->rightHRIRReal_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->rightHRIRImag_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - } - /* BRIR */ - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - - /* BRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->leftBRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->leftBRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->rightBRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->rightBRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } -#endif /* Reverb Parameters */ if ( CLDFB_NO_CHANNELS_MAX != *( (uint16_t *) ( hrtf_data_rptr ) ) ) @@ -2112,14 +1702,9 @@ static ivas_error create_parambin_HRTF_from_rawdata( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ - const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ -#else - const int16_t room_reverb_flag, /* i : room reverb flag */ - const IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ -#endif - const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ + const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ + const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ + const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) { FILE *f_hrtf; @@ -2130,13 +1715,11 @@ ivas_error load_fastconv_HRTF_from_binary( ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; int16_t asFastconv = 0; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM bool load = false; BINAURAL_INPUT_AUDIO_CONFIG hrtf_set_binaural_cfg; /* convert audio config. to HRTF binaural config */ hrtf_set_binaural_cfg = audio_cfg_2_binaural_cfg( hrtf_set_audio_cfg ); -#endif if ( hrtfReader == NULL || hrtfReader->file == NULL ) { @@ -2174,7 +1757,6 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && /* HRIRs */ ( OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL || OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && /* BRIRs */ @@ -2185,15 +1767,6 @@ ivas_error load_fastconv_HRTF_from_binary( } if ( load ) -#else - if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && - ( ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 && intern_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 && intern_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA && intern_audio_config == IVAS_AUDIO_CONFIG_FOA ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) ) ) || - ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && room_reverb_flag == 1 ) || - ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && intern_audio_config == IVAS_AUDIO_CONFIG_INVALID ) ) -#endif { #ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */ @@ -2214,9 +1787,7 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create FastConv HRTF from binary file" ); } asFastconv = 1; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM break; /* read just one set */ -#endif } else { @@ -2341,7 +1912,6 @@ ivas_error load_parambin_HRTF_from_binary( * Create the Crend HRTF data set from the binary file *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error load_Crend_HRTF_from_binary( IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend, /* i/o: HRTF CRend handle */ const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ @@ -2349,31 +1919,19 @@ ivas_error load_Crend_HRTF_from_binary( const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ const int32_t sampleRate /* i : sample rate */ ) -#else -ivas_error create_SetOfHRTF_from_binary( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF, /* i/o: HRTF CRend handle */ - const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ - const int32_t output_Fs /* i : Output sampling frequency */ -) -#endif { FILE *f_hrtf; int32_t hrtf_data_size_max; char *hrtf_data; ivas_hrtfs_header_t hrtf_header; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - HRTFS_DATA **hHRTF; -#endif ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM bool load = false; BINAURAL_INPUT_AUDIO_CONFIG hrtf_set_binaural_cfg; /* convert audio config. to HRTF binaural config */ hrtf_set_binaural_cfg = audio_cfg_2_binaural_cfg( hrtf_set_audio_cfg ); -#endif if ( hrtfReader == NULL || hrtfReader->file == NULL ) { @@ -2404,14 +1962,10 @@ ivas_error create_SetOfHRTF_from_binary( /* Read & load */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtfCrend == NULL ) { return IVAS_ERROR( IVAS_ERR_INTERNAL, "Crend HRTF binary handle not allocated!\n" ); } -#else - memset( hSetOfHRTF, 0x00, sizeof( HRTFS_CREND ) ); -#endif for ( hrtf_id = 0; hrtf_id < hrtfs_file_header.nb_hrtf; hrtf_id++ ) { @@ -2421,7 +1975,6 @@ ivas_error create_SetOfHRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV && /* HRIRs */ ( OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL || OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM && /* BRIRs */ @@ -2433,39 +1986,6 @@ ivas_error create_SetOfHRTF_from_binary( if ( load ) { -#else - hHRTF = NULL; - - if ( hrtf_header.frequency == output_Fs ) - { - if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) - { - if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_combined ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_hoa3 ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_hoa2 ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_foa ); - } - } - else if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_brir_combined ); - } - } - } -#endif #ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != sampleRate ) { @@ -2479,7 +1999,6 @@ ivas_error create_SetOfHRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM #ifndef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != output_Fs ) { @@ -2499,16 +2018,6 @@ ivas_error create_SetOfHRTF_from_binary( { fseek( f_hrtf, hrtf_header.data_size, SEEK_CUR ); } -#else - if ( hHRTF != NULL ) - { - if ( ( create_HRTF_from_rawdata( hHRTF, hrtf_data ) ) != IVAS_ERR_OK ) - { - free( hrtf_data ); - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); - } - } -#endif } free( hrtf_data ); @@ -2517,7 +2026,6 @@ ivas_error create_SetOfHRTF_from_binary( } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * destroy_crend_hrtf() * @@ -2572,87 +2080,6 @@ void destroy_crend_hrtf( return; } -#else -/*---------------------------------------------------------------------* - * destroy_HRTF() - * - * Destroy the HRTF CRend handle - *---------------------------------------------------------------------*/ - -static void destroy_HRTF( - HRTFS_HANDLE *hHRTF /* i/o: HRTF CRend handle */ -) -{ - uint16_t i, j; - - if ( *hHRTF != NULL && hHRTF != NULL && ( *hHRTF )->init_from_rom == 0 ) - { - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( ( *hHRTF )->pIndex_frequency_max[i][j] != NULL ) - { - free( ( *hHRTF )->pIndex_frequency_max_dyn[i][j] ); - } - if ( ( *hHRTF )->pOut_to_bin_re[i][j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_re_dyn[i][j] ); - } - if ( ( *hHRTF )->pOut_to_bin_im[i][j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_im_dyn[i][j] ); - } - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( ( *hHRTF )->pIndex_frequency_max_diffuse[j] != NULL ) - { - free( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] ); - } - if ( ( *hHRTF )->pOut_to_bin_diffuse_re[j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] ); - } - if ( ( *hHRTF )->pOut_to_bin_diffuse_im[j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] ); - } - } - - free( *hHRTF ); - *hHRTF = NULL; - } - - return; -} - - -/*---------------------------------------------------------------------* - * destroy_SetOfHRTF() - * - * Destroy the HRTF data set for Crend renderer - *---------------------------------------------------------------------*/ - -void destroy_SetOfHRTF( - HRTFS_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -) -{ - if ( ( hSetOfHRTF != NULL ) && ( *hSetOfHRTF != NULL ) ) - { - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_combined ) ); - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_hoa3 ) ); - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_hoa2 ) ); - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_foa ) ); - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_brir_combined ) ); - } - - ivas_HRTF_CRend_binary_close( hSetOfHRTF ); - - return; -} -#endif /*---------------------------------------------------------------------* diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index b27a42cf9f4e088fac4ebfb3264a2f3c05c85791..5a8680638018c28ecd0e6b3611e85f21eabd5b0e 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -51,7 +51,6 @@ typedef enum } HRTF_READER_RENDERER_TYPE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM typedef enum { BINAURAL_INPUT_AUDIO_CONFIG_INVALID, @@ -63,7 +62,6 @@ typedef enum } BINAURAL_INPUT_AUDIO_CONFIG; -#endif typedef struct ivas_hrtfs_header_t { int32_t rend_type; @@ -130,7 +128,6 @@ ivas_error load_reverb_binary( * Create the Crend HRTF data set from the binary file *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error load_Crend_HRTF_from_binary( IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend, /* i/o: HRTF CRend handle */ const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ @@ -138,15 +135,7 @@ ivas_error load_Crend_HRTF_from_binary( const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ const int32_t sampleRate /* i : sample rate */ ); -#else -ivas_error create_SetOfHRTF_from_binary( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF, /* i/o: Set of HRTF CRend handle */ - const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ - const int32_t output_Fs /* i : Output sampling frequency */ -); -#endif -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * destroy_crend_hrtf() * @@ -156,17 +145,6 @@ ivas_error create_SetOfHRTF_from_binary( void destroy_crend_hrtf( IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend /* i/o: Crend HRTF handle */ ); -#else -/*---------------------------------------------------------------------* - * destroy_SetOfHRTF() - * - * Destroy the HRTF data set. - *---------------------------------------------------------------------*/ - -void destroy_SetOfHRTF( - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -); -#endif /*---------------------------------------------------------------------* * load_fastconv_HRTF_from_binary() @@ -176,14 +154,9 @@ void destroy_SetOfHRTF( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ - const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ -#else - const int16_t room_reverb_flag, /* i : room reverb flag */ - IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ -#endif - const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ + const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ + const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ + const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); /*---------------------------------------------------------------------* diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 2e8b426ca6297a8a3885418c239dd9ee598073ee..14ec980eeea62017122c12d6e89b414967e24de4 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -3034,11 +3034,7 @@ ivas_error RenderConfigReader_getDirectivity( } } /* case when -dpid is not specified, select first directivity pattern from config file */ -#ifdef NONBE_1229_FIX_ISM1_DPID if ( last_specified_id == 65535 ) -#else - if ( n == 0 ) -#endif { last_specified_id = (uint16_t) pRenderConfigReader->pDP[0].id; } diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index ca4ee1880fd1a843f90c3883b6493eace6875f85..d901810c95a9aecded21751ef8378b169d9c7015 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -302,6 +302,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stvST48c.wav_stereo_sw_48-48_DTX_EXT.tst + // 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, EXT out ../IVAS_cod -ism 1 testv/stvISM1.csv 13200 48 testv/stv1ISM48s.wav bit ../IVAS_dec EXT 48 bit testv/stv1ISM48s.wav_13200_48-48_EXT.tst @@ -949,6 +950,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -render_config testv/rend_config_recreation.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv3OA48c.wav_BINAURAL_ROOM_REVERB_96000_48-48_custom_configuration.tst + // MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -masa 1 testv/stv1MASA1TC48c.met 13200 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv1MASA1TC48c.wav_13200_48-48_BINAURAL.tst @@ -1087,7 +1089,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom_Subframe.tst +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom.tst // MASA 2dir 2TC at 512 kbps, 48kHz in, 48kHz out, 5_1 out ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 512000 48 testv/stv2MASA2TC48c.wav bit @@ -1228,6 +1230,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -render_config testv/rend_config_combined.cfg -t testv/headrot.csv BINAURAL_ROOM_REVERB 48 bit testv/stv1MASA1TC48c.wav_BINAURAL_ROOM_REVERB_256000_48-48_Headrot_custom_config.tst + // Multi-channel 5_1 at 13.2 kbps, 48kHz in, 48kHz out ../IVAS_cod -mc 5_1 13200 48 testv/stv51MC48c.wav bit ../IVAS_dec 5_1 48 bit testv/stv51MC48c.wav_MC51_13200_48-48_5_1.tst @@ -1550,6 +1553,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stv714MC48c.wav_sw_48-48_EXT.tst + // Stereo downmix to bit-exact EVS at 13200 kbps, 32kHz in, 32kHz out ../IVAS_cod -stereo_dmx_evs 13200 32 testv/stvST32c.wav bit ../IVAS_dec 32 bit testv/stvST32c.wav_StereoDmxEVS_13200_32-32.tst @@ -1560,6 +1564,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 +// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod 64000 48 testv/stv48c.wav bit +../IVAS_dec -non_diegetic_pan -50 48 bit testv/stv48c.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst + +// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod -ism 1 testv/stvISM1.csv 32000 48 testv/stv1ISM48s.wav bit +../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst + + + // stereo at 48 kbps, 16 kHz in, 16 kHz out, DTX on, JBM Prof 5 ../IVAS_cod -stereo -dtx 48000 16 testv/stvST16n.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 @@ -1615,15 +1629,15 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP MONO 32 netsimoutput testv/stv1MASA2TC48n.wav_sw_48-32_MONO_JBM5.tst -// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL out, JBM Prof 5 +// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, EXT out, JBM Prof 5 ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stv2MASA2TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 -../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 16 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-16_BINAURAL_JBM5.tst +../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-48_EXT_JBM5.tst -// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, EXT out, JBM Prof 5 +// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL out, JBM Prof 5 ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stv2MASA2TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 -../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-48_EXT_JBM5.tst +../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 16 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-16_BINAURAL_JBM5.tst // OMASA 2Dir2TC 1ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_IR out, JBM Prof 5 ../IVAS_cod -ism_masa 1 2 testv/stvISM1.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_1ism.bin 48 testv/stvOMASA_1ISM_2MASA2TC48c.wav bit @@ -1673,15 +1687,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met 48000 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst -// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod 64000 48 testv/stv48c.wav bit -../IVAS_dec -non_diegetic_pan -50 48 bit testv/stv48c.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst - -// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod -ism 1 testv/stvISM1.csv 32000 48 testv/stv1ISM48s.wav bit -../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst - - // OMASA 2Dir2TC 1ISM at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -ism_masa 1 2 NULL testv/stv2MASA2TC48c.met 13200 48 testv/stvOMASA_1ISM_2MASA2TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvOMASA_1ISM_2MASA2TC48c.wav_BINAURAL_13200_48-48.tst @@ -1695,7 +1700,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 7_1_4 48 bit_error testv/stvOMASA_1ISM_2MASA1TC32c.wav_7_1_4_512000_32-48_FER5.tst - // OMASA 1Dir1TC 2ISM at 16.4 kbps, 16kHz in, 48kHz out, 5.1 out ../IVAS_cod -ism_masa 2 1 testv/stvISM1.csv testv/stvISM2.csv testv/stv1MASA1TC48c.met 16400 16 testv/stvOMASA_2ISM_1MASA1TC16c.wav bit ../IVAS_dec 5_1 48 bit testv/stvOMASA_2ISM_1MASA1TC16c.wav_5_1_16400_16-48.tst @@ -1709,7 +1713,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 2 2 testv/stvISM1.csv NULL testv/stv1MASA2TC48c.met 256000 48 testv/stvOMASA_2ISM_1MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/stvOMASA_2ISM_1MASA2TC48c.wav_BINAURAL_ROOM_IR_256000_48-32.tst - // OMASA 2Dir1TC 3ISM at 24.4 kbps, 48kHz in, 16kHz out, FOA out, FER at 10% ../IVAS_cod -ism_masa 3 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA1TC48c.met 24400 48 testv/stvOMASA_3ISM_2MASA1TC48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error @@ -1743,7 +1746,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv1MASA2TC48c.met 160000 16 testv/stvOMASA_3ISM_1MASA2TC16c.wav bit ../IVAS_dec HOA3 32 bit testv/stvOMASA_3ISM_1MASA2TC16c.wav_HOA3_160000_16-32.tst - // OMASA 2Dir2TC 4ISM at 13.2 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met 13200 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec MONO 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_MONO_13200_48-48.tst @@ -1777,7 +1779,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met 384000 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec EXT 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_EXT_384000_48-48.tst - // OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/stvOMASA_3ISM_2MASA2TC48c.wav bit ../IVAS_dec MONO 48 bit testv/stvOMASA_3ISM_2MASA2TC48c.wav_MONO_sw_48-48.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 9b4df023635caefffe0ad9566b16e6458fe9ee9e..c9ca9cd783c45ee59b391d504297e8a47671f620 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -249,6 +249,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // stereo at 48 kbps, 32kHz in, 32kHz out, MONO out ../IVAS_cod -stereo 48000 32 testv/ltv32_STEREO.wav bit ../IVAS_dec MONO 32 bit testv/ltv32_STEREO.wav_stereo_48000_32-32_MONO.tst + // stereo at 13.2 kbps, 48kHz in, 48kHz out ../IVAS_cod -stereo 13200 48 testv/ltv48_STEREO.wav bit ../IVAS_dec STEREO 48 bit testv/ltv48_STEREO.wav_stereo_13200_48-48.tst @@ -301,6 +302,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/ltv48_STEREO.wav_stereo_sw_48-48_DTX_EXT.tst + // 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, EXT out ../IVAS_cod -ism 1 testv/ltvISM1.csv 13200 48 testv/ltv48_1ISM.wav bit ../IVAS_dec EXT 48 bit testv/ltv48_1ISM.wav_13200_48-48_EXT.tst @@ -550,16 +552,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, directivity configuration, random FER at 5% ../IVAS_cod -ism +4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec -render_config testv/config_directivity_txt.cfg -t testv/headrot_case04_3000_q.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_DirConfig_FER5.tst +../IVAS_dec -render_config testv/config_directivity_txt.cfg -t testv/headrot_case04_3000_q.csv BINAURAL 48 bit_error testv/ltv48+4ISM.wav_256000_48-48_binaural_file_TDHR_DirConfig_FER5.tst // 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, exo, directivity configuration, random FER at 5% ../IVAS_cod -ism +4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec -render_config testv/config_directivity.cfg -t testv/headrot_case04_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF_DirConfig_FER5.tst +../IVAS_dec -render_config testv/config_directivity.cfg -t testv/headrot_case04_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit_error testv/ltv48+4ISM.wav_256000_48-48_binaural_file_TDHR_EXOF_DirConfig_FER5.tst // 4 ISM with and without extended metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, EXT out ../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_4ISM.wav bit -../IVAS_dec EXT 48 bit testv/stv+4ISM48s.wav_brate_sw_48-48_DTX_EXT.tst +../IVAS_dec EXT 48 bit testv/ltv48+4ISM.wav_brate_sw_48-48_DTX_EXT.tst // 4 ISM with extended metadata and non diegetic pan object switching bitrate 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out ../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit @@ -574,6 +576,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_4ISM.wav_BINAURAL_ROOM_REVERB_128000-48-48.tst + // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -sba 3 13200 32 testv/ltv32_HOA3.wav bit ../IVAS_dec HOA3 32 bit testv/ltv32_HOA3.wav_SBA_13200_32-32_HOA3.tst @@ -672,27 +675,27 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrAvg.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrAvg.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPos.tst +../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPos.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPos.tst +../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPos.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking in level mode ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPosLev.tst +../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPosLev.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking in level mode, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst +../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst // SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, random FER at 5% ../IVAS_cod -sba 3 -dtx 48000 32 testv/ltv32_HOA3.wav bit @@ -767,11 +770,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_128000_32-32_Binaural_room_Headrot_OtrAvg.tst // SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_EXOF_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_128000_32-32_Binaural_room_Headrot_EXOF_OtrAvg.tst // SBA at 192 kbps, 48kHz in, 48kHz out, HOA2 out, random FER at 5% ../IVAS_cod -sba 3 192000 48 testv/ltv48_HOA3.wav bit @@ -946,6 +949,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 96000 48 testv/ltv48_HOA3.wav bit ../IVAS_dec -render_config testv/rend_config_recreation.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_HOA3.wav_BINAURAL_ROOM_REVERB_96000_48-48_custom_configuration.tst + + // MASA 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -masa 1 testv/ltv48_MASA1TC.met 13200 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_MASA1TC.wav_13200_48-48_BINAURAL.tst @@ -1024,11 +1029,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // MASA 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.pcm_32000_48-48_BinauralRoom_Headrot_OtrAvg.tst // MASA 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_EXOF_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.pcm_32000_48-48_BinauralRoom_Headrot_EXOF_OtrAvg.tst // MASA 2TC at 48 kbps, 48kHz in, 48kHz out, 7_1_4 out, random FER at 5% ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 48000 48 testv/ltv48_MASA2TC.wav bit @@ -1078,17 +1083,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 5_1_4 48 bit_error testv/ltv48_MASA2TC.wav_192000_48-48_5_1_4_FER5.tst -// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out -../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom.tst - -// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching -../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom_Subframe.tst - // MASA 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom_Subframe.tst +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom.tst // MASA 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit @@ -1198,13 +1195,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec 7_1 48 bit testv/ltv48_MASA2TC.wav_sw_48-48_7_1.tst -// MASA 1TC at 256kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out default configuration -../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit -../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MASA1TC.wav_BINAURAL_ROOM_REVERB_256000_48-48.tst - -// MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out custom configuration -../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit -../IVAS_dec -render_config testv/rend_config_combined.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MASA1TC.wav_BINAURAL_ROOM_REVERB_256000_48-48_custom_config.tst +// MASA 1TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, 7_1 out +../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA1TC.wav bit +../IVAS_dec 7_1 48 bit testv/ltv48_MASA1TC.wav_sw_48-48_7_1.tst // MASA 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA2TC.wav bit @@ -1215,6 +1208,13 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/ltv48_MASA2TC.wav_sw_48-48_DTX_BINAURAL_FER5.tst +// MASA 1TC at 256kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out default configuration +../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit +../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MASA1TC.wav_BINAURAL_ROOM_REVERB_256000_48-48.tst + +// MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out custom configuration +../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MASA1TC.wav_BINAURAL_ROOM_REVERB_256000_48-48_custom_config.tst // MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out default configuration, random FER at 5% ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit @@ -1317,11 +1317,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit -../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_Headrot_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.pcm_MC51_256000_48-48_BinauralRoom_Headrot_OtrAvg.tst // Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_EXOF_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.pcm_MC51_256000_48-48_BinauralRoom_EXOF_OtrAvg.tst // Multi-channel 5_1 at 384 kbps, 48kHz in, 48kHz out ../IVAS_cod -mc 5_1 384000 48 testv/ltv48_MC51.wav bit @@ -1363,8 +1363,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 512000 48 testv/ltv48_MC714.wav bit ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC714.wav_BINAURAL_ROOM_REVERB_512000_48-48.tst - - // Multi-channel 7_1_4 at 48 kbps, 48kHz in, 48kHz out, MONO out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -mc 7_1_4 48000 48 testv/ltv48_MC714.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_MC714.wav_MC714_48000_48-48_Mono_bwsw.tst @@ -1485,8 +1483,12 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 7_1_4 48 bit testv/ltv48_MC51.wav_sw_48-48_7_1_4.tst // Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM_REVERB out -../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/stv51MC48c.wav bit -../IVAS_dec BINAURAL_ROOM_REVERB 16 bit testv/stv51MC48c.wav_sw_48-16_Binaural_room.tst +../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/ltv48_MC51.wav bit +../IVAS_dec BINAURAL_ROOM_REVERB 16 bit testv/ltv48_MC51.wav_sw_48-16_Binaural_room.tst + +// Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_IR out +../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 32 testv/ltv32_MC51.wav bit +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv32_MC51.wav_sw_32-48_Binaural_room.tst // Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_MC51.wav bit @@ -1499,7 +1501,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // Multi-channel 7_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, BINAURAL out (model from file), head rotation ../IVAS_cod -mc 7_1 ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MC71.wav bit -../IVAS_dec -t testv/headrot.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv71C48c.wav_sw_48-48_Binaural_model_file_headrot.tst +../IVAS_dec -t testv/headrot.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/ltv48_MC71.wav_sw_48-48_Binaural_model_file_headrot.tst // Multi-channel 7_1_4 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, HOA3 out ../IVAS_cod -mc 7_1_4 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/ltv48_MC714.wav bit @@ -1551,6 +1553,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/ltv48_MC714.wav_sw_48-48_EXT.tst + // Stereo downmix to bit-exact EVS at 13200 kbps, 32kHz in, 32kHz out ../IVAS_cod -stereo_dmx_evs 13200 32 testv/ltv32_STEREO.wav bit ../IVAS_dec 32 bit testv/ltv32_STEREO.wav_StereoDmxEVS_13200_32-32.tst @@ -1561,6 +1564,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 +// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod 64000 48 testv/ltv48_MONO.wav bit +../IVAS_dec -non_diegetic_pan -50 48 bit testv/ltv48_MONO.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst + +// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod -ism 1 testv/ltvISM1.csv 32000 48 testv/ltv48_1ISM.wav bit +../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst + + + // stereo at 48 kbps, 16 kHz in, 16 kHz out, DTX on, JBM Prof 5 ../IVAS_cod -stereo -dtx 48000 16 testv/ltv16_STEREO.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 @@ -1621,6 +1634,11 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/ltv48_MASA2TC.wav_sw_48-48_EXT_JBM5.tst +// MASA 1TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL out, JBM Prof 5 +../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA1TC.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 16 netsimoutput testv/ltv48_MASA1TC.wav_sw_48-16_BINAURAL_JBM5.tst + // OMASA 2Dir2TC 1ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_IR out, JBM Prof 5 ../IVAS_cod -ism_masa 1 2 testv/ltv48_OMASA_1ISM_2TC_ISM1.csv testv/ltv48_OMASA_1ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_1ism.bin 48 testv/ltv48_OMASA_1ISM_2TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 @@ -1661,7 +1679,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/ltv48_OMASA_4ISM_2TC.wav_EXT_256000_48-48_JBM5.tst - // OMASA 1Dir1TC 4ISM 48 kbps 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out custom configuration ../IVAS_cod -ism_masa 4 1 testv/ltv48_OMASA_4ISM_1TC_ISM1.csv testv/ltv48_OMASA_4ISM_1TC_ISM2.csv testv/ltv48_OMASA_4ISM_1TC_ISM3.csv testv/ltv48_OMASA_4ISM_1TC_ISM4.csv testv/ltv48_OMASA_4ISM_1TC.met 48000 48 testv/ltv48_OMASA_4ISM_1TC.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_1TC.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst @@ -1670,16 +1687,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 48000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst -// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod 64000 48 testv/ltv48_MONO.wav bit -../IVAS_dec -non_diegetic_pan -50 48 bit testv/ltv48_MONO.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst - -// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod -ism 1 testv/ltvISM1.csv 32000 48 testv/ltv48_1ISM.wav bit -../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst - - - // OMASA 2Dir2TC 1ISM at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -ism_masa 1 2 NULL testv/ltv48_OMASA_1ISM_2TC.met 13200 48 testv/ltv48_OMASA_1ISM_2TC.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_OMASA_1ISM_2TC.wav_BINAURAL_13200_48-48.tst @@ -1693,7 +1700,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 7_1_4 48 bit_error testv/ltv32_OMASA_1ISM_1TC.wav_7_1_4_512000_32-48.tst - // OMASA 1Dir1TC 2ISM at 16.4 kbps, 16kHz in, 48kHz out, 5.1 out ../IVAS_cod -ism_masa 2 1 testv/ltv48_OMASA_2ISM_1TC_ISM1.csv testv/ltv48_OMASA_2ISM_1TC_ISM2.csv testv/ltv48_OMASA_2ISM_1TC.met 16400 16 testv/ltv16_OMASA_2ISM_1TC.wav bit ../IVAS_dec 5_1 48 bit testv/ltv16_OMASA_2ISM_1TC.wav_5_1_16400_16-48.tst @@ -1707,7 +1713,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 2 2 testv/ltv48_OMASA_2ISM_2TC_ISM1.csv NULL testv/ltv48_OMASA_2ISM_2TC.met 256000 48 testv/ltv48_OMASA_2ISM_2TC.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/ltv48_OMASA_2ISM_2TC.wav_BINAURAL_ROOM_IR_256000_48-32.tst - // OMASA 2Dir1TC 3ISM at 24.4 kbps, 48kHz in, 16kHz out, FOA out, FER at 10% ../IVAS_cod -ism_masa 3 1 testv/ltv48_OMASA_3ISM_1TC_ISM1.csv testv/ltv48_OMASA_3ISM_1TC_ISM2.csv testv/ltv48_OMASA_3ISM_1TC_ISM3.csv testv/ltv48_OMASA_3ISM_1TC.met 24400 48 testv/ltv48_OMASA_3ISM_1TC.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error @@ -1741,7 +1746,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met 160000 16 testv/ltv16_OMASA_3ISM_2TC.wav bit ../IVAS_dec HOA3 32 bit testv/ltv16_OMASA_3ISM_2TC.wav_HOA3_160000_16-32.tst - // OMASA 2Dir2TC 4ISM at 13.2 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 13200 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_MONO_13200_48-48.tst @@ -1751,9 +1755,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_dec STEREO 48 bit testv/ltv48_OMASA_4ISM_1TC.wav_STEREO_24400_48-48.tst // OMASA 1Dir2TC 4ISM at 32 kbps, 48kHz in, 48kHz out, FOA out, FER at 5% -../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/stv1MASA2TC48c.met 32000 48 testv/stvOMASA_4ISM_1MASA2TC48c.wav bit +../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 32000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec FOA 48 bit_error testv/stvOMASA_4ISM_1MASA2TC48c.wav_FOA_32000_48-48_FER5.tst +../IVAS_dec FOA 48 bit_error testv/ltv48_OMASA_4ISM_2TC.wav_FOA_32000_48-48_FER5.tst // OMASA 1Dir1TC 4ISM at 48 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out ../IVAS_cod -ism_masa 4 1 testv/ltv48_OMASA_4ISM_1TC_ISM1.csv testv/ltv48_OMASA_4ISM_1TC_ISM2.csv testv/ltv48_OMASA_4ISM_1TC_ISM3.csv testv/ltv48_OMASA_4ISM_1TC_ISM4.csv testv/ltv48_OMASA_4ISM_1TC.met 48000 48 testv/ltv48_OMASA_4ISM_1TC.wav bit @@ -1764,8 +1768,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec HOA2 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_HOA2_64000_48-48.tst // OMASA 1Dir2TC 4ISM at 80 kbps, 48kHz in, 48kHz out, MONO out -../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/stv1MASA2TC48c.met 80000 48 testv/stvOMASA_4ISM_1MASA2TC48c.wav bit -../IVAS_dec MONO 48 bit testv/stvOMASA_4ISM_1MASA2TC48c.wav_MONO_80000_48-48.tst +../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 80000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit +../IVAS_dec MONO 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_MONO_80000_48-48.tst // OMASA 2Dir2TC 4ISM at 192 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 192000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit @@ -1775,7 +1779,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 384000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec EXT 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_EXT_384000_48-48.tst - // OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/ltv48_OMASA_3ISM_2TC.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_OMASA_3ISM_2TC.wav_MONO_sw_48-48.tst @@ -1817,7 +1820,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_1ISM_FOA.wav_BINAURAL_32000_48-48.tst // OSBA FOA 1ISM at 48 kbps, 16kHz in, 16kHz out, BINAURAL_ROOM_REVERB (Model from file) out -../IVAS_cod -ism_sba 1 1 testv/stvISM1.csv 32000 16 testv/ltv16_OSBA_1ISM_FOA.wav bit +../IVAS_cod -ism_sba 1 1 testv/ltvISM1.csv 32000 16 testv/ltv16_OSBA_1ISM_FOA.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL_ROOM_REVERB 16 bit testv/ltv16_OSBA_1ISM_FOA.wav_BINAURAL_ROOM_REVERB_32000_16-16.tst // OSBA FOA 2ISM at 64 kbps, 48kHz in, 48kHz out, HOA3 out, bandwidth switching @@ -1923,7 +1926,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_4ISM_pFOA.wav_BINAURAL_256000_48-48.tst // OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism_sba 2 -1 testv/ltvISM1.csv testv/ltvISM2.csv 512000 48 testv/stvOSBA_2ISM_FOA48c.wav bit +../IVAS_cod -ism_sba 2 -1 testv/ltvISM1.csv testv/ltvISM2.csv 512000 48 testv/ltv48_OSBA_2ISM_FOA.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_4ISM_pHOA2.wav_BINAURAL_512000_48-48.tst // OSBA planar 3OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out diff --git a/scripts/create_mode_force.py b/scripts/create_mode_force.py index 39ec6773eab33ff3ba39f068b8d9ebdb2c1b1ad9..fe87f7fdce821ecc0806938b771b666289247471 100644 --- a/scripts/create_mode_force.py +++ b/scripts/create_mode_force.py @@ -36,6 +36,7 @@ import struct MODES = { 0: "1 ACELP\n", 1: "1 TCX\n", + 2: "1 TCX\n", # Current -force option does not distinguish between TCX10 and TCX20 3: "1 HQ\n", } SR = [16, 32, 48] diff --git a/tests/conftest.py b/tests/conftest.py index bb9e8ca3871c6e252fcb2bdcdd0c7392fc1df5ee..e7f591f4d4944254e20a6da3f56a70f44f911c6f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -749,6 +749,9 @@ class DecoderFrontend: cwd = Path(tmp_dir).absolute() else: cwd = Path(run_dir).absolute() + + eid_command_str = " ".join(eid_command) + log_dbg_msg(f"eid-xor command:\n {eid_command_str}") result = run(eid_command, check=True, cwd=cwd) except Exception as e: pytest.fail(f"eid-xor operation failed! - {e}") @@ -778,11 +781,11 @@ class DecoderFrontend: tracefile_path = input_bitstream_path.with_suffix(".netsimtrace") # TODO: need to check if the "1" works with every profile netsim_command = [ - netsim_path, - netsim_profile, - input_bitstream_path, - netsim_bitstream_path, - tracefile_path, + str(netsim_path), + str(netsim_profile), + str(input_bitstream_path), + str(netsim_bitstream_path), + str(tracefile_path), "1", ] print(netsim_command) @@ -793,6 +796,9 @@ class DecoderFrontend: else: cwd = Path(run_dir).absolute() run(netsim_command, check=True, cwd=cwd) + + netsim_command_str = " ".join(netsim_command) + log_dbg_msg(f"netsim command:\n {netsim_command_str}") except Exception as e: pytest.fail(f"netsim operation failed! - {e}")