Loading apps/decoder.c +5 −44 Original line number Diff line number Diff line Loading @@ -161,12 +161,8 @@ typedef struct #endif #endif #ifdef CONTROL_METADATA_REVERB uint16_t acousticEnvironmentId; #ifdef CONTROL_METADATA_DIRECTIVITY uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; #endif #endif } DecArguments; Loading Loading @@ -613,24 +609,17 @@ int main( goto cleanup; } #ifdef CONTROL_METADATA_REVERB if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) #else if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; } #ifdef CONTROL_METADATA_DIRECTIVITY if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity for objects: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); goto cleanup; } #endif #ifdef CONTROL_METADATA_REVERB if ( arg.outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB ) { if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK ) Loading @@ -648,7 +637,6 @@ int main( } renderConfig.room_acoustics.override = true; } #endif if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading Loading @@ -1008,15 +996,11 @@ static bool parseCmdlIVAS_dec( #endif #endif #ifdef CONTROL_METADATA_REVERB arg->acousticEnvironmentId = 0; #ifdef CONTROL_METADATA_DIRECTIVITY for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { arg->directivityPatternId[i] = 0; } #endif #endif /*-----------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ Loading Loading @@ -1377,13 +1361,11 @@ static bool parseCmdlIVAS_dec( fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" ); } } #ifdef CONTROL_METADATA_REVERB else if ( strcmp( argv_to_upper, "-AEID" ) == 0 ) { ++i; arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] ); } #ifdef CONTROL_METADATA_DIRECTIVITY else if ( strcmp( argv_to_upper, "-DPID" ) == 0 ) { ++i; Loading @@ -1396,8 +1378,6 @@ static bool parseCmdlIVAS_dec( } i += tmp; } #endif #endif /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading Loading @@ -1582,12 +1562,8 @@ static void usage_dec( void ) fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); #endif fprintf( stdout, "-exof File : External orientation file for external orientation trajectory\n" ); #ifdef CONTROL_METADATA_DIRECTIVITY fprintf( stdout, "-dpid ID : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration\n" ); #endif #ifdef CONTROL_METADATA_REVERB fprintf( stdout, "-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" ); #endif #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK fprintf( stdout, "-info <folder> : specify subfolder name for debug output\n" ); Loading Loading @@ -1828,11 +1804,7 @@ static ivas_error initOnFirstGoodFrame( #endif /* Duplicate good first frame metadata to fill the beginning of stream. */ MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); return error; Loading Loading @@ -2222,11 +2194,7 @@ static ivas_error decodeG192( #endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -2818,11 +2786,7 @@ static ivas_error decodeVoIP( #endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -2891,6 +2855,11 @@ cleanup: #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriter_close( &jbmTraceWriter ); #endif MasaFileWriter_close( &masaWriter ); for ( int16_t i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) { IsmFileWriter_close( &ismWriters[i] ); } if ( decodingFailed && error == IVAS_ERR_OK ) { Loading Loading @@ -3256,11 +3225,7 @@ static ivas_error decodeVariableSpeed( #endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -3444,11 +3409,7 @@ static ivas_error decodeVariableSpeed( #endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading apps/renderer.c +0 −40 Original line number Diff line number Diff line Loading @@ -175,15 +175,9 @@ typedef struct float lfeConfigElevation; bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; #ifdef FIX_488_SYNC_DELAY float syncMdDelay; #endif #ifdef CONTROL_METADATA_DIRECTIVITY uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; #endif #ifdef CONTROL_METADATA_REVERB uint16_t acousticEnvironmentId; #endif } CmdlnArgs; typedef enum Loading Loading @@ -212,15 +206,9 @@ typedef enum #endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, #ifdef FIX_488_SYNC_DELAY CmdLnOptionId_syncMdDelay, #endif #ifdef CONTROL_METADATA_DIRECTIVITY CmdLnOptionId_directivityPatternId, #endif #ifdef CONTROL_METADATA_REVERB CmdLnOptionId_acousticEnvironmentId #endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { Loading Loading @@ -360,30 +348,24 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, #ifdef FIX_488_SYNC_DELAY { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", .matchShort = "smd", .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)", }, #endif #ifdef CONTROL_METADATA_DIRECTIVITY { .id = CmdLnOptionId_directivityPatternId, .match = "ism_directivity_pattern_id", .matchShort = "dpid", .description = "Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration", }, #endif #ifdef CONTROL_METADATA_REVERB { .id = CmdLnOptionId_acousticEnvironmentId, .match = "acoustic_environment_id", .matchShort = "aeid", .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration", }, #endif }; Loading Loading @@ -1095,11 +1077,7 @@ int main( exit( -1 ); } #ifdef CONTROL_METADATA_REVERB if ( RenderConfigReader_read( renderConfigReader, args.renderConfigFilePath, &renderConfig ) != IVAS_ERR_OK ) #else if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n", args.renderConfigFilePath ); exit( -1 ); Loading @@ -1107,7 +1085,6 @@ int main( if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef CONTROL_METADATA_REVERB if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK ) { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) Loading @@ -1121,7 +1098,6 @@ int main( fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId ); exit( -1 ); } #endif renderConfig.room_acoustics.override = TRUE; } Loading Loading @@ -1172,9 +1148,7 @@ int main( if ( args.inConfig.numAudioObjects > 0 ) { IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ); #ifdef FIX_488_SYNC_DELAY IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ); #endif } IVAS_REND_LfePanMtx lfePanMatrix; Loading Loading @@ -1961,12 +1935,10 @@ int main( } #endif #ifdef FIX_488_SYNC_DELAY if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); } #endif if ( !args.quietModeEnabled && args.delayCompensationEnabled ) { Loading Loading @@ -2555,20 +2527,14 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); #ifdef FIX_488_SYNC_DELAY args.syncMdDelay = 0; #endif #ifdef CONTROL_METADATA_DIRECTIVITY for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { args.directivityPatternId[i] = 0; } #endif #ifdef CONTROL_METADATA_REVERB args.acousticEnvironmentId = 0; #endif return args; } Loading Loading @@ -2709,7 +2675,6 @@ static void parseOption( } break; #ifdef CONTROL_METADATA_DIRECTIVITY case CmdLnOptionId_directivityPatternId: assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS ); for ( int16_t i = 0; i < numOptionValues; ++i ) Loading @@ -2717,21 +2682,16 @@ static void parseOption( args->directivityPatternId[i] = (int16_t) strtol( optionValues[i], NULL, 10 ); } break; #endif #ifdef CONTROL_METADATA_REVERB case CmdLnOptionId_acousticEnvironmentId: assert( numOptionValues == 1 ); args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 ); break; #endif #ifdef FIX_488_SYNC_DELAY case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); /* Metadata Delay to sync with audio delay in ms */ args->syncMdDelay = strtof( optionValues[0], NULL ); break; #endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; Loading lib_com/bits_alloc.c +32 −20 Original line number Diff line number Diff line Loading @@ -394,6 +394,7 @@ static ivas_error acelp_FCB_allocator( int16_t nBits_tmp; int16_t *p_fixed_cdk_index; ivas_error error; int16_t max_n; error = IVAS_ERR_OK; Loading Loading @@ -424,13 +425,22 @@ static ivas_error acelp_FCB_allocator( } /* distribute the bit-budget equally between subframes */ cdbk = 0; while ( fcb_table( cdbk, L_subfr ) * nb_subfr <= *nBits ) if ( L_subfr > L_SUBFR ) /* access fast_FCB_bits_2sfr */ { cdbk++; max_n = 6; } else { max_n = ACELP_FIXED_CDK_NB; } for ( cdbk = 0; cdbk < max_n; cdbk++ ) { if ( fcb_table( cdbk, L_subfr ) * nb_subfr > *nBits ) { break; } } cdbk--; #ifdef DEBUGGING if ( cdbk < 0 && coder_type != TRANSITION ) { Loading @@ -455,6 +465,8 @@ static ivas_error acelp_FCB_allocator( *nBits -= nBits_tmp * nb_subfr; /* try to increase the FCB bit-budget of the first subframe(s) */ if ( cdbk < ACELP_FIXED_CDK_NB - 1 ) { step = fcb_table( cdbk + 1, L_subfr ) - nBits_tmp; while ( *nBits >= step ) { Loading @@ -477,7 +489,7 @@ static ivas_error acelp_FCB_allocator( *nBits -= step; } } } /* TRANSITION coding: allocate highest FCBQ bit-budget to the subframe with the glottal-shape codebook */ if ( tc_subfr >= L_SUBFR ) { Loading lib_com/bitstream.c +0 −60 Original line number Diff line number Diff line Loading @@ -169,7 +169,6 @@ Word16 rate2EVSmode( * Re-allocate the list of indices *-------------------------------------------------------------------*/ #ifdef FIX_MEM_REALLOC_IND_LIST ivas_error ind_list_realloc( INDICE_HANDLE old_ind_list, /* i : pointer to the beginning of the old buffer of indices */ const int16_t max_num_indices, /* i : new maximum number of allowed indices in the list */ Loading Loading @@ -292,57 +291,6 @@ ivas_error ind_list_realloc( return IVAS_ERR_OK; } #else ivas_error ind_list_realloc( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ ) { int16_t i, ind_list_pos; INDICE_HANDLE new_ind_list; /* allocate new buffer of indices */ if ( ( new_ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); } /* move indices from the old list to the new list */ for ( i = 0; i < min( max_num_indices, *( hBstr->ivas_max_num_indices ) ); i++ ) { if ( ( *hBstr->ivas_ind_list_zero )[i].nb_bits > -1 ) { new_ind_list[i].id = ( *hBstr->ivas_ind_list_zero )[i].id; new_ind_list[i].value = ( *hBstr->ivas_ind_list_zero )[i].value; } new_ind_list[i].nb_bits = ( *hBstr->ivas_ind_list_zero )[i].nb_bits; } /* reset nb_bits of all other indices to -1 */ for ( ; i < max_num_indices; i++ ) { new_ind_list[i].nb_bits = -1; } /* get the current position inside the old list */ ind_list_pos = (int16_t) ( hBstr->ind_list - ( *hBstr->ivas_ind_list_zero ) ); /* free the old list */ free( ( *hBstr->ivas_ind_list_zero ) ); /* set pointers in the new list */ hBstr->ind_list = &new_ind_list[ind_list_pos]; *( hBstr->ivas_ind_list_zero ) = new_ind_list; /* set the new maximum number of indices */ *( hBstr->ivas_max_num_indices ) = max_num_indices; return IVAS_ERR_OK; } #endif /*-----------------------------------------------------------------------* * get_ivas_max_num_indices() Loading Loading @@ -1088,11 +1036,7 @@ ivas_error check_ind_list_limits( #endif /* reallocate the buffer of indices with increased limit */ #ifdef FIX_MEM_REALLOC_IND_LIST if ( ( error = ind_list_realloc( *hBstr->ivas_ind_list_zero, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES, hBstr->st_ivas ) ) != IVAS_ERR_OK ) #else if ( ( error = ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -1120,11 +1064,7 @@ ivas_error check_ind_list_limits( #endif /* no available empty slot -> need to re-allocate the buffer */ #ifdef FIX_MEM_REALLOC_IND_LIST if ( ( error = ind_list_realloc( *hBstr->ivas_ind_list_zero, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES, hBstr->st_ivas ) ) != IVAS_ERR_OK ) #else if ( ( error = ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ) ) != IVAS_ERR_OK ) #endif { return error; } Loading lib_com/cnst.h +0 −7 Original line number Diff line number Diff line Loading @@ -2243,13 +2243,6 @@ enum VOIP_RTPDUMP }; #ifndef JBM_PARAMUPMIX typedef enum _COV_SMOOTHING_TYPE { COV_SMOOTH_SPAR, COV_SMOOTH_MC } COV_SMOOTHING_TYPE; #endif /* clang-format on */ #endif /* CNST_H */ Loading
apps/decoder.c +5 −44 Original line number Diff line number Diff line Loading @@ -161,12 +161,8 @@ typedef struct #endif #endif #ifdef CONTROL_METADATA_REVERB uint16_t acousticEnvironmentId; #ifdef CONTROL_METADATA_DIRECTIVITY uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; #endif #endif } DecArguments; Loading Loading @@ -613,24 +609,17 @@ int main( goto cleanup; } #ifdef CONTROL_METADATA_REVERB if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) #else if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; } #ifdef CONTROL_METADATA_DIRECTIVITY if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity for objects: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); goto cleanup; } #endif #ifdef CONTROL_METADATA_REVERB if ( arg.outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB ) { if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK ) Loading @@ -648,7 +637,6 @@ int main( } renderConfig.room_acoustics.override = true; } #endif if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading Loading @@ -1008,15 +996,11 @@ static bool parseCmdlIVAS_dec( #endif #endif #ifdef CONTROL_METADATA_REVERB arg->acousticEnvironmentId = 0; #ifdef CONTROL_METADATA_DIRECTIVITY for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { arg->directivityPatternId[i] = 0; } #endif #endif /*-----------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ Loading Loading @@ -1377,13 +1361,11 @@ static bool parseCmdlIVAS_dec( fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" ); } } #ifdef CONTROL_METADATA_REVERB else if ( strcmp( argv_to_upper, "-AEID" ) == 0 ) { ++i; arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] ); } #ifdef CONTROL_METADATA_DIRECTIVITY else if ( strcmp( argv_to_upper, "-DPID" ) == 0 ) { ++i; Loading @@ -1396,8 +1378,6 @@ static bool parseCmdlIVAS_dec( } i += tmp; } #endif #endif /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading Loading @@ -1582,12 +1562,8 @@ static void usage_dec( void ) fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); #endif fprintf( stdout, "-exof File : External orientation file for external orientation trajectory\n" ); #ifdef CONTROL_METADATA_DIRECTIVITY fprintf( stdout, "-dpid ID : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration\n" ); #endif #ifdef CONTROL_METADATA_REVERB fprintf( stdout, "-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" ); #endif #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK fprintf( stdout, "-info <folder> : specify subfolder name for debug output\n" ); Loading Loading @@ -1828,11 +1804,7 @@ static ivas_error initOnFirstGoodFrame( #endif /* Duplicate good first frame metadata to fill the beginning of stream. */ MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); return error; Loading Loading @@ -2222,11 +2194,7 @@ static ivas_error decodeG192( #endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -2818,11 +2786,7 @@ static ivas_error decodeVoIP( #endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -2891,6 +2855,11 @@ cleanup: #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriter_close( &jbmTraceWriter ); #endif MasaFileWriter_close( &masaWriter ); for ( int16_t i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) { IsmFileWriter_close( &ismWriters[i] ); } if ( decodingFailed && error == IVAS_ERR_OK ) { Loading Loading @@ -3256,11 +3225,7 @@ static ivas_error decodeVariableSpeed( #endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -3444,11 +3409,7 @@ static ivas_error decodeVariableSpeed( #endif { MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef FIX_470_MASA_JBM_EXT if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading
apps/renderer.c +0 −40 Original line number Diff line number Diff line Loading @@ -175,15 +175,9 @@ typedef struct float lfeConfigElevation; bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; #ifdef FIX_488_SYNC_DELAY float syncMdDelay; #endif #ifdef CONTROL_METADATA_DIRECTIVITY uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; #endif #ifdef CONTROL_METADATA_REVERB uint16_t acousticEnvironmentId; #endif } CmdlnArgs; typedef enum Loading Loading @@ -212,15 +206,9 @@ typedef enum #endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, #ifdef FIX_488_SYNC_DELAY CmdLnOptionId_syncMdDelay, #endif #ifdef CONTROL_METADATA_DIRECTIVITY CmdLnOptionId_directivityPatternId, #endif #ifdef CONTROL_METADATA_REVERB CmdLnOptionId_acousticEnvironmentId #endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { Loading Loading @@ -360,30 +348,24 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, #ifdef FIX_488_SYNC_DELAY { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", .matchShort = "smd", .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)", }, #endif #ifdef CONTROL_METADATA_DIRECTIVITY { .id = CmdLnOptionId_directivityPatternId, .match = "ism_directivity_pattern_id", .matchShort = "dpid", .description = "Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration", }, #endif #ifdef CONTROL_METADATA_REVERB { .id = CmdLnOptionId_acousticEnvironmentId, .match = "acoustic_environment_id", .matchShort = "aeid", .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration", }, #endif }; Loading Loading @@ -1095,11 +1077,7 @@ int main( exit( -1 ); } #ifdef CONTROL_METADATA_REVERB if ( RenderConfigReader_read( renderConfigReader, args.renderConfigFilePath, &renderConfig ) != IVAS_ERR_OK ) #else if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n", args.renderConfigFilePath ); exit( -1 ); Loading @@ -1107,7 +1085,6 @@ int main( if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef CONTROL_METADATA_REVERB if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK ) { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) Loading @@ -1121,7 +1098,6 @@ int main( fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId ); exit( -1 ); } #endif renderConfig.room_acoustics.override = TRUE; } Loading Loading @@ -1172,9 +1148,7 @@ int main( if ( args.inConfig.numAudioObjects > 0 ) { IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ); #ifdef FIX_488_SYNC_DELAY IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ); #endif } IVAS_REND_LfePanMtx lfePanMatrix; Loading Loading @@ -1961,12 +1935,10 @@ int main( } #endif #ifdef FIX_488_SYNC_DELAY if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); } #endif if ( !args.quietModeEnabled && args.delayCompensationEnabled ) { Loading Loading @@ -2555,20 +2527,14 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); #ifdef FIX_488_SYNC_DELAY args.syncMdDelay = 0; #endif #ifdef CONTROL_METADATA_DIRECTIVITY for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { args.directivityPatternId[i] = 0; } #endif #ifdef CONTROL_METADATA_REVERB args.acousticEnvironmentId = 0; #endif return args; } Loading Loading @@ -2709,7 +2675,6 @@ static void parseOption( } break; #ifdef CONTROL_METADATA_DIRECTIVITY case CmdLnOptionId_directivityPatternId: assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS ); for ( int16_t i = 0; i < numOptionValues; ++i ) Loading @@ -2717,21 +2682,16 @@ static void parseOption( args->directivityPatternId[i] = (int16_t) strtol( optionValues[i], NULL, 10 ); } break; #endif #ifdef CONTROL_METADATA_REVERB case CmdLnOptionId_acousticEnvironmentId: assert( numOptionValues == 1 ); args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 ); break; #endif #ifdef FIX_488_SYNC_DELAY case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); /* Metadata Delay to sync with audio delay in ms */ args->syncMdDelay = strtof( optionValues[0], NULL ); break; #endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; Loading
lib_com/bits_alloc.c +32 −20 Original line number Diff line number Diff line Loading @@ -394,6 +394,7 @@ static ivas_error acelp_FCB_allocator( int16_t nBits_tmp; int16_t *p_fixed_cdk_index; ivas_error error; int16_t max_n; error = IVAS_ERR_OK; Loading Loading @@ -424,13 +425,22 @@ static ivas_error acelp_FCB_allocator( } /* distribute the bit-budget equally between subframes */ cdbk = 0; while ( fcb_table( cdbk, L_subfr ) * nb_subfr <= *nBits ) if ( L_subfr > L_SUBFR ) /* access fast_FCB_bits_2sfr */ { cdbk++; max_n = 6; } else { max_n = ACELP_FIXED_CDK_NB; } for ( cdbk = 0; cdbk < max_n; cdbk++ ) { if ( fcb_table( cdbk, L_subfr ) * nb_subfr > *nBits ) { break; } } cdbk--; #ifdef DEBUGGING if ( cdbk < 0 && coder_type != TRANSITION ) { Loading @@ -455,6 +465,8 @@ static ivas_error acelp_FCB_allocator( *nBits -= nBits_tmp * nb_subfr; /* try to increase the FCB bit-budget of the first subframe(s) */ if ( cdbk < ACELP_FIXED_CDK_NB - 1 ) { step = fcb_table( cdbk + 1, L_subfr ) - nBits_tmp; while ( *nBits >= step ) { Loading @@ -477,7 +489,7 @@ static ivas_error acelp_FCB_allocator( *nBits -= step; } } } /* TRANSITION coding: allocate highest FCBQ bit-budget to the subframe with the glottal-shape codebook */ if ( tc_subfr >= L_SUBFR ) { Loading
lib_com/bitstream.c +0 −60 Original line number Diff line number Diff line Loading @@ -169,7 +169,6 @@ Word16 rate2EVSmode( * Re-allocate the list of indices *-------------------------------------------------------------------*/ #ifdef FIX_MEM_REALLOC_IND_LIST ivas_error ind_list_realloc( INDICE_HANDLE old_ind_list, /* i : pointer to the beginning of the old buffer of indices */ const int16_t max_num_indices, /* i : new maximum number of allowed indices in the list */ Loading Loading @@ -292,57 +291,6 @@ ivas_error ind_list_realloc( return IVAS_ERR_OK; } #else ivas_error ind_list_realloc( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const int16_t max_num_indices /* i : new maximum number of allowed indices in the list */ ) { int16_t i, ind_list_pos; INDICE_HANDLE new_ind_list; /* allocate new buffer of indices */ if ( ( new_ind_list = (INDICE_HANDLE) malloc( max_num_indices * sizeof( Indice ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); } /* move indices from the old list to the new list */ for ( i = 0; i < min( max_num_indices, *( hBstr->ivas_max_num_indices ) ); i++ ) { if ( ( *hBstr->ivas_ind_list_zero )[i].nb_bits > -1 ) { new_ind_list[i].id = ( *hBstr->ivas_ind_list_zero )[i].id; new_ind_list[i].value = ( *hBstr->ivas_ind_list_zero )[i].value; } new_ind_list[i].nb_bits = ( *hBstr->ivas_ind_list_zero )[i].nb_bits; } /* reset nb_bits of all other indices to -1 */ for ( ; i < max_num_indices; i++ ) { new_ind_list[i].nb_bits = -1; } /* get the current position inside the old list */ ind_list_pos = (int16_t) ( hBstr->ind_list - ( *hBstr->ivas_ind_list_zero ) ); /* free the old list */ free( ( *hBstr->ivas_ind_list_zero ) ); /* set pointers in the new list */ hBstr->ind_list = &new_ind_list[ind_list_pos]; *( hBstr->ivas_ind_list_zero ) = new_ind_list; /* set the new maximum number of indices */ *( hBstr->ivas_max_num_indices ) = max_num_indices; return IVAS_ERR_OK; } #endif /*-----------------------------------------------------------------------* * get_ivas_max_num_indices() Loading Loading @@ -1088,11 +1036,7 @@ ivas_error check_ind_list_limits( #endif /* reallocate the buffer of indices with increased limit */ #ifdef FIX_MEM_REALLOC_IND_LIST if ( ( error = ind_list_realloc( *hBstr->ivas_ind_list_zero, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES, hBstr->st_ivas ) ) != IVAS_ERR_OK ) #else if ( ( error = ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -1120,11 +1064,7 @@ ivas_error check_ind_list_limits( #endif /* no available empty slot -> need to re-allocate the buffer */ #ifdef FIX_MEM_REALLOC_IND_LIST if ( ( error = ind_list_realloc( *hBstr->ivas_ind_list_zero, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES, hBstr->st_ivas ) ) != IVAS_ERR_OK ) #else if ( ( error = ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ) ) != IVAS_ERR_OK ) #endif { return error; } Loading
lib_com/cnst.h +0 −7 Original line number Diff line number Diff line Loading @@ -2243,13 +2243,6 @@ enum VOIP_RTPDUMP }; #ifndef JBM_PARAMUPMIX typedef enum _COV_SMOOTHING_TYPE { COV_SMOOTH_SPAR, COV_SMOOTH_MC } COV_SMOOTHING_TYPE; #endif /* clang-format on */ #endif /* CNST_H */