Loading apps/decoder.c +69 −1 Original line number Diff line number Diff line Loading @@ -55,6 +55,9 @@ #ifdef IVAS_RTPDUMP #include "ivas_rtp_file.h" #endif #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT #include "ivas_cnst.h" #endif #ifdef FIXED_RTP_SEQUENCE_NUM #define RANDOM_INITSEED_DEC ( 0xFEEDFADE ) Loading Loading @@ -225,7 +228,10 @@ int main( IVAS_RENDER_FRAMESIZE asked_frame_size; IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; ObjectEditFileReader *objectEditFileReader = NULL; #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT IVAS_ROOM_ACOUSTICS_CONFIG_DATA **pAE = NULL; uint32_t aeCount = 0; #endif #ifdef WMOPS reset_wmops(); reset_mem( USE_BYTES ); Loading Loading @@ -436,7 +442,11 @@ int main( *------------------------------------------------------------------------------------------*/ asked_frame_size = arg.renderFramesize; #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : IVAS_DEFAULT_AEID; #else uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; #endif #ifdef IVAS_RTPDUMP arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; Loading Loading @@ -548,7 +558,47 @@ int main( fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; } #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT aeCount = RenderConfigReader_getAcousticEnvironmentCount( renderConfigReader ); if ( aeCount > 0 ) { uint32_t n; pAE = malloc( aeCount * sizeof( IVAS_ROOM_ACOUSTICS_CONFIG_DATA * ) ); if ( pAE == NULL ) { fprintf( stderr, "\nError: cannot allocate memory for acoustic environment array\n\n" ); goto cleanup; } for ( n = 0; n < aeCount; n++ ) { pAE[n] = NULL; if ( NULL == ( pAE[n] = malloc( sizeof( IVAS_ROOM_ACOUSTICS_CONFIG_DATA ) ) ) ) { fprintf( stderr, "\nError: cannot allocate memory for acoustic environment\n\n" ); goto cleanup; } } if ( ( error = RenderConfigReader_getAcousticEnvironments( renderConfigReader, pAE ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while getting acoustic environments\n\n" ); goto cleanup; } for ( n = 0; n < aeCount; n++ ) { if ( ( error = IVAS_DEC_AddAcousticEnvironment( hIvasDec, *pAE[n] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to add acoustic environments\n\n" ); goto cleanup; } } } #endif if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity_fx ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); Loading Loading @@ -587,7 +637,11 @@ int main( if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) #else if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) #endif { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { Loading Loading @@ -723,6 +777,20 @@ cleanup: free( pcmBuf ); #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT if ( pAE != NULL ) { uint16_t n; for ( n = 0; n < aeCount; n++ ) { free( pAE[n] ); } free( pAE ); } #endif if ( arg.aeSequence.count > 0 ) { free( arg.aeSequence.pID ); Loading lib_com/common_api_types.h +3 −0 Original line number Diff line number Diff line Loading @@ -340,6 +340,9 @@ typedef enum #endif typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG { #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT UWord16 aeID; /* Acoustic environment ID */ #endif Word16 nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ Word32 pFc_input_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q16 Center frequencies for which following values are provided: */ Word32 pAcoustic_rt60_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q26 - The room's T60 per center frequency */ Loading lib_com/ivas_cnst.h +3 −0 Original line number Diff line number Diff line Loading @@ -1668,6 +1668,9 @@ typedef enum #else #define IVAS_REVERB_DEFAULT_N_BANDS 31 #endif #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT #define IVAS_DEFAULT_AEID ( 65535 ) #endif #define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) #define LR_IAC_LENGTH_NR_FC_16KHZ ( RV_LENGTH_NR_FC_16KHZ ) Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ #define RTP_S4_251135_CR26253_0016_REV1 /* RTP Pack/Unpack API corresponding to CR 26253 */ #define IVAS_RTPDUMP /* RTPDUMP writing and reading for IVAS payloads */ #define FIXED_RTP_SEQUENCE_NUM /* Remove random sequence number initialization */ #define IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /* RTPDUMP acoustic environment */ #define ISM_PI_DATA /* Add reading and packing/unpacking of ISM PI data */ #define REVERSE_ISM_PI_DATA /* Add reading and packing/unpacking of reverse ISM PI data */ #define PI_LATENCY /* Support for PI latency */ Loading lib_dec/ivas_init_dec_fx.c +15 −0 Original line number Diff line number Diff line Loading @@ -3473,6 +3473,11 @@ void ivas_initialize_handles_dec( st_ivas->hRenderConfig = NULL; st_ivas->hExtOrientationData = NULL; st_ivas->hCombinedOrientationData = NULL; #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT st_ivas->acousticEnvironmentsCount = 0; move16(); st_ivas->pAcousticEnvironments = NULL; #endif st_ivas->hSplitBinRend = NULL; for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) Loading Loading @@ -3727,6 +3732,16 @@ void ivas_destroy_dec_fx( #endif } #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /* Acoustic environments */ IF( st_ivas->pAcousticEnvironments != NULL ) { free( st_ivas->pAcousticEnvironments ); st_ivas->pAcousticEnvironments = NULL; } #endif /* main IVAS handle */ free( st_ivas ); Loading Loading
apps/decoder.c +69 −1 Original line number Diff line number Diff line Loading @@ -55,6 +55,9 @@ #ifdef IVAS_RTPDUMP #include "ivas_rtp_file.h" #endif #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT #include "ivas_cnst.h" #endif #ifdef FIXED_RTP_SEQUENCE_NUM #define RANDOM_INITSEED_DEC ( 0xFEEDFADE ) Loading Loading @@ -225,7 +228,10 @@ int main( IVAS_RENDER_FRAMESIZE asked_frame_size; IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; ObjectEditFileReader *objectEditFileReader = NULL; #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT IVAS_ROOM_ACOUSTICS_CONFIG_DATA **pAE = NULL; uint32_t aeCount = 0; #endif #ifdef WMOPS reset_wmops(); reset_mem( USE_BYTES ); Loading Loading @@ -436,7 +442,11 @@ int main( *------------------------------------------------------------------------------------------*/ asked_frame_size = arg.renderFramesize; #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : IVAS_DEFAULT_AEID; #else uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; #endif #ifdef IVAS_RTPDUMP arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; Loading Loading @@ -548,7 +558,47 @@ int main( fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; } #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT aeCount = RenderConfigReader_getAcousticEnvironmentCount( renderConfigReader ); if ( aeCount > 0 ) { uint32_t n; pAE = malloc( aeCount * sizeof( IVAS_ROOM_ACOUSTICS_CONFIG_DATA * ) ); if ( pAE == NULL ) { fprintf( stderr, "\nError: cannot allocate memory for acoustic environment array\n\n" ); goto cleanup; } for ( n = 0; n < aeCount; n++ ) { pAE[n] = NULL; if ( NULL == ( pAE[n] = malloc( sizeof( IVAS_ROOM_ACOUSTICS_CONFIG_DATA ) ) ) ) { fprintf( stderr, "\nError: cannot allocate memory for acoustic environment\n\n" ); goto cleanup; } } if ( ( error = RenderConfigReader_getAcousticEnvironments( renderConfigReader, pAE ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while getting acoustic environments\n\n" ); goto cleanup; } for ( n = 0; n < aeCount; n++ ) { if ( ( error = IVAS_DEC_AddAcousticEnvironment( hIvasDec, *pAE[n] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to add acoustic environments\n\n" ); goto cleanup; } } } #endif if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity_fx ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); Loading Loading @@ -587,7 +637,11 @@ int main( if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) #else if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) #endif { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { Loading Loading @@ -723,6 +777,20 @@ cleanup: free( pcmBuf ); #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT if ( pAE != NULL ) { uint16_t n; for ( n = 0; n < aeCount; n++ ) { free( pAE[n] ); } free( pAE ); } #endif if ( arg.aeSequence.count > 0 ) { free( arg.aeSequence.pID ); Loading
lib_com/common_api_types.h +3 −0 Original line number Diff line number Diff line Loading @@ -340,6 +340,9 @@ typedef enum #endif typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG { #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT UWord16 aeID; /* Acoustic environment ID */ #endif Word16 nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ Word32 pFc_input_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q16 Center frequencies for which following values are provided: */ Word32 pAcoustic_rt60_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q26 - The room's T60 per center frequency */ Loading
lib_com/ivas_cnst.h +3 −0 Original line number Diff line number Diff line Loading @@ -1668,6 +1668,9 @@ typedef enum #else #define IVAS_REVERB_DEFAULT_N_BANDS 31 #endif #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT #define IVAS_DEFAULT_AEID ( 65535 ) #endif #define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) #define LR_IAC_LENGTH_NR_FC_16KHZ ( RV_LENGTH_NR_FC_16KHZ ) Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ #define RTP_S4_251135_CR26253_0016_REV1 /* RTP Pack/Unpack API corresponding to CR 26253 */ #define IVAS_RTPDUMP /* RTPDUMP writing and reading for IVAS payloads */ #define FIXED_RTP_SEQUENCE_NUM /* Remove random sequence number initialization */ #define IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /* RTPDUMP acoustic environment */ #define ISM_PI_DATA /* Add reading and packing/unpacking of ISM PI data */ #define REVERSE_ISM_PI_DATA /* Add reading and packing/unpacking of reverse ISM PI data */ #define PI_LATENCY /* Support for PI latency */ Loading
lib_dec/ivas_init_dec_fx.c +15 −0 Original line number Diff line number Diff line Loading @@ -3473,6 +3473,11 @@ void ivas_initialize_handles_dec( st_ivas->hRenderConfig = NULL; st_ivas->hExtOrientationData = NULL; st_ivas->hCombinedOrientationData = NULL; #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT st_ivas->acousticEnvironmentsCount = 0; move16(); st_ivas->pAcousticEnvironments = NULL; #endif st_ivas->hSplitBinRend = NULL; for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) Loading Loading @@ -3727,6 +3732,16 @@ void ivas_destroy_dec_fx( #endif } #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /* Acoustic environments */ IF( st_ivas->pAcousticEnvironments != NULL ) { free( st_ivas->pAcousticEnvironments ); st_ivas->pAcousticEnvironments = NULL; } #endif /* main IVAS handle */ free( st_ivas ); Loading