Loading apps/decoder.c +2 −13 Original line number Diff line number Diff line Loading @@ -71,14 +71,7 @@ static int32_t frame = 0; /* Counter of frames */ #define MIN_NUM_BITS_ACTIVE_FRAME 56 #ifdef REMOVE_SID_HARM_LEFTOVERS #define NUM_BITS_SID_IVAS_5K2 104 #else #define NUM_BITS_SID_IVAS_4K4 88 #define NUM_BITS_SID_IVAS_7K8 156 #define NUM_BITS_SID_IVAS_9K3 186 #define NUM_BITS_SID_IVAS_10K2 204 #endif #define MAX_FRAME_SIZE ( 48000 / 50 ) #define MAX_NUM_OUTPUT_CHANNELS 16 #define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE ) Loading Loading @@ -353,11 +346,7 @@ int main( fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename ); goto cleanup; } #ifdef REMOVE_SID_HARM_LEFTOVERS } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 ); #else } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_4K4 || num_bits == NUM_BITS_SID_IVAS_7K8 || num_bits == NUM_BITS_SID_IVAS_9K3 || num_bits == NUM_BITS_SID_IVAS_10K2 ); #endif BS_Reader_Rewind( hBsReader ); Loading apps/renderer.c +2 −42 Original line number Diff line number Diff line Loading @@ -62,7 +62,6 @@ #include <stdio.h> #include <string.h> #ifdef EXT_RENDERER #ifndef count_malloc #ifdef RAM_COUNTING_TOOL #define count_malloc( n1 ) MALLOC_FCT_CALL( n1 ) Loading Loading @@ -426,12 +425,8 @@ static int16_t getTotalNumInChannels( IVAS_REND_HANDLE hIvasRend, IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS], IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS], IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] #ifdef NOKIA_MASA_EXTERNAL_RENDERER , IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] #endif ) IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS], IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] ) { int16_t totalNumInChannels = 0; int16_t i, numInputChannels; Loading Loading @@ -486,7 +481,6 @@ static int16_t getTotalNumInChannels( totalNumInChannels += numInputChannels; } #ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { if ( masaIds[i] == 0 ) Loading @@ -502,7 +496,6 @@ static int16_t getTotalNumInChannels( } totalNumInChannels += numInputChannels; } #endif return totalNumInChannels; } Loading Loading @@ -676,9 +669,7 @@ int main( IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 }; #ifdef NOKIA_MASA_EXTERNAL_RENDERER IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 }; #endif if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { Loading Loading @@ -787,7 +778,6 @@ int main( } } #ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < args.inConfig.numMasaBuses; ++i ) { if ( ( error = IVAS_REND_AddInput( hIvasRend, args.inConfig.masaBuses[i].audioConfig, &masaIds[i] ) ) != IVAS_ERR_OK ) Loading @@ -802,13 +792,8 @@ int main( exit( -1 ); } } #endif #ifdef NOKIA_MASA_EXTERNAL_RENDERER const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds ); #else const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds ); #endif if ( AudioFileReader_getNumChannels( audioReader ) != 0 /* If input file is raw PCM, audio reader has no info about number of channels */ && totalNumInChannels != AudioFileReader_getNumChannels( audioReader ) ) Loading Loading @@ -905,18 +890,6 @@ int main( } #endif #ifndef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { if ( masaReaders[i] != NULL ) { MasaFileReader_readNextFrame( masaReaders[i] ); /* TODO: Feed MASA metadata here once MASA inputs are supported. For now avoid unused var warning */ (void) hMasaMetadata; } } #endif ObjectPositionBuffer mtdBuffer; IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); Loading Loading @@ -982,7 +955,6 @@ int main( } } #ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < args.inConfig.numMasaBuses; ++i ) { if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, masaIds[i], &numChannels ) ) != IVAS_ERR_OK ) Loading Loading @@ -1010,7 +982,6 @@ int main( } } } #endif IVAS_REND_GetSamples( hIvasRend, outBuffer ); Loading Loading @@ -2476,14 +2447,3 @@ static void convertOutputBuffer( return; } #else int main( int argc, char **argv ) { (void) argc; (void) argv; fprintf( stderr, "Enable EXT_RENDERER in options.h to use the external renderer.\n" ); return 0; } #endif lib_com/common_api_types.h +4 −10 Original line number Diff line number Diff line Loading @@ -47,9 +47,7 @@ #define IVAS_MAX_NUM_OBJECTS 4 #define IVAS_MAX_OUTPUT_CHANNELS 16 #define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 ) #ifdef EXT_RENDERER #define IVAS_MAX_INPUT_LFE_CHANNELS 4 #endif /*----------------------------------------------------------------------------------* * Common API structures Loading Loading @@ -79,11 +77,7 @@ typedef struct _IVAS_ISM_METADATA float gainFactor; } IVAS_ISM_METADATA; #ifdef EXT_RENDERER typedef struct #else typedef struct _IVAS_QUATERNION #endif { float w, x, y, z; Loading lib_com/delay_comp.c +0 −8 Original line number Diff line number Diff line Loading @@ -50,11 +50,7 @@ *--------------------------------------------------------------------------*/ /*! r: delay value in ns */ #ifdef FIX_GET_DELAY_RETURN int32_t get_delay( #else float get_delay( #endif const int16_t enc_dec, /* i : encoder/decoder flag */ const int32_t io_fs, /* i : input/output sampling frequency */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ Loading @@ -63,11 +59,7 @@ float get_delay( const int32_t binaural_latency_ns /* i : binaural renderer HRTF delay in ns */ ) { #ifdef FIX_GET_DELAY_RETURN int32_t delay = 0; #else float delay = 0; #endif if ( enc_dec == ENC ) { Loading lib_com/ivas_cnst.h +0 −10 Original line number Diff line number Diff line Loading @@ -107,10 +107,8 @@ typedef enum AUDIO_CONFIG_ISM2, /* ISM2 */ AUDIO_CONFIG_ISM3, /* ISM3 */ AUDIO_CONFIG_ISM4, /* ISM4 */ #ifdef EXT_RENDERER /* TODO tmu : temporary, or use something like IVAS_ENC input format */ AUDIO_CONFIG_MASA1, /* MASA1 */ AUDIO_CONFIG_MASA2, /* MASA2 */ #endif AUDIO_CONFIG_EXTERNAL /* external renderer */ } AUDIO_CONFIG; Loading Loading @@ -193,10 +191,8 @@ typedef enum #define IVAS_MAX_SBA_ORDER 3 /* Maximum supported Ambisonics order */ #ifdef EXT_RENDERER #define IVAS_LIMITER_THRESHOLD 32729 /* -0.01 dBFS */ #define IVAS_LIMITER_ATTACK_SECONDS 0.005f #endif #define IVAS_NUM_SUPPORTED_FS 3 /* number of supported sampling-rates in IVAS */ /*----------------------------------------------------------------------------------* Loading Loading @@ -1374,21 +1370,15 @@ typedef enum #define BINAURAL_COHERENCE_DIFFERENCE_BINS 9 /* Number of bins for direction-dependent diffuse-field binaural coherence */ #ifdef EXT_RENDERER #define HEADROT_ORDER 3 #define HEADROT_SHMAT_DIM ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) ) #define HEADROT_SHMAT_DIM2 ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM ) #endif /*----------------------------------------------------------------------------------* * TD Binaural Object renderer *----------------------------------------------------------------------------------*/ #ifdef EXT_RENDERER #define MAX_NUM_TDREND_CHANNELS 16 /* max. number of channels in TD renderer (objects or loudspeaker channels) */ #else #define MAX_NUM_TDREND_CHANNELS 11 /* max. number of channels in TD renderer (objects or loudspeaker channels) */ #endif #define SFX_SPAT_BIN_MAX_NO_OF_OUTPUT_SAMPLES 288 /* 288 = 6 msec @ 48 kHz. */ #define HRTF_MODEL_N_SECTIONS 3 /* No. sections used in approximate evaluation of model */ Loading Loading
apps/decoder.c +2 −13 Original line number Diff line number Diff line Loading @@ -71,14 +71,7 @@ static int32_t frame = 0; /* Counter of frames */ #define MIN_NUM_BITS_ACTIVE_FRAME 56 #ifdef REMOVE_SID_HARM_LEFTOVERS #define NUM_BITS_SID_IVAS_5K2 104 #else #define NUM_BITS_SID_IVAS_4K4 88 #define NUM_BITS_SID_IVAS_7K8 156 #define NUM_BITS_SID_IVAS_9K3 186 #define NUM_BITS_SID_IVAS_10K2 204 #endif #define MAX_FRAME_SIZE ( 48000 / 50 ) #define MAX_NUM_OUTPUT_CHANNELS 16 #define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE ) Loading Loading @@ -353,11 +346,7 @@ int main( fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename ); goto cleanup; } #ifdef REMOVE_SID_HARM_LEFTOVERS } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 ); #else } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_4K4 || num_bits == NUM_BITS_SID_IVAS_7K8 || num_bits == NUM_BITS_SID_IVAS_9K3 || num_bits == NUM_BITS_SID_IVAS_10K2 ); #endif BS_Reader_Rewind( hBsReader ); Loading
apps/renderer.c +2 −42 Original line number Diff line number Diff line Loading @@ -62,7 +62,6 @@ #include <stdio.h> #include <string.h> #ifdef EXT_RENDERER #ifndef count_malloc #ifdef RAM_COUNTING_TOOL #define count_malloc( n1 ) MALLOC_FCT_CALL( n1 ) Loading Loading @@ -426,12 +425,8 @@ static int16_t getTotalNumInChannels( IVAS_REND_HANDLE hIvasRend, IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS], IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS], IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] #ifdef NOKIA_MASA_EXTERNAL_RENDERER , IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] #endif ) IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS], IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] ) { int16_t totalNumInChannels = 0; int16_t i, numInputChannels; Loading Loading @@ -486,7 +481,6 @@ static int16_t getTotalNumInChannels( totalNumInChannels += numInputChannels; } #ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { if ( masaIds[i] == 0 ) Loading @@ -502,7 +496,6 @@ static int16_t getTotalNumInChannels( } totalNumInChannels += numInputChannels; } #endif return totalNumInChannels; } Loading Loading @@ -676,9 +669,7 @@ int main( IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 }; #ifdef NOKIA_MASA_EXTERNAL_RENDERER IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 }; #endif if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { Loading Loading @@ -787,7 +778,6 @@ int main( } } #ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < args.inConfig.numMasaBuses; ++i ) { if ( ( error = IVAS_REND_AddInput( hIvasRend, args.inConfig.masaBuses[i].audioConfig, &masaIds[i] ) ) != IVAS_ERR_OK ) Loading @@ -802,13 +792,8 @@ int main( exit( -1 ); } } #endif #ifdef NOKIA_MASA_EXTERNAL_RENDERER const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds ); #else const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds ); #endif if ( AudioFileReader_getNumChannels( audioReader ) != 0 /* If input file is raw PCM, audio reader has no info about number of channels */ && totalNumInChannels != AudioFileReader_getNumChannels( audioReader ) ) Loading Loading @@ -905,18 +890,6 @@ int main( } #endif #ifndef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { if ( masaReaders[i] != NULL ) { MasaFileReader_readNextFrame( masaReaders[i] ); /* TODO: Feed MASA metadata here once MASA inputs are supported. For now avoid unused var warning */ (void) hMasaMetadata; } } #endif ObjectPositionBuffer mtdBuffer; IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); Loading Loading @@ -982,7 +955,6 @@ int main( } } #ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < args.inConfig.numMasaBuses; ++i ) { if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, masaIds[i], &numChannels ) ) != IVAS_ERR_OK ) Loading Loading @@ -1010,7 +982,6 @@ int main( } } } #endif IVAS_REND_GetSamples( hIvasRend, outBuffer ); Loading Loading @@ -2476,14 +2447,3 @@ static void convertOutputBuffer( return; } #else int main( int argc, char **argv ) { (void) argc; (void) argv; fprintf( stderr, "Enable EXT_RENDERER in options.h to use the external renderer.\n" ); return 0; } #endif
lib_com/common_api_types.h +4 −10 Original line number Diff line number Diff line Loading @@ -47,9 +47,7 @@ #define IVAS_MAX_NUM_OBJECTS 4 #define IVAS_MAX_OUTPUT_CHANNELS 16 #define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 ) #ifdef EXT_RENDERER #define IVAS_MAX_INPUT_LFE_CHANNELS 4 #endif /*----------------------------------------------------------------------------------* * Common API structures Loading Loading @@ -79,11 +77,7 @@ typedef struct _IVAS_ISM_METADATA float gainFactor; } IVAS_ISM_METADATA; #ifdef EXT_RENDERER typedef struct #else typedef struct _IVAS_QUATERNION #endif { float w, x, y, z; Loading
lib_com/delay_comp.c +0 −8 Original line number Diff line number Diff line Loading @@ -50,11 +50,7 @@ *--------------------------------------------------------------------------*/ /*! r: delay value in ns */ #ifdef FIX_GET_DELAY_RETURN int32_t get_delay( #else float get_delay( #endif const int16_t enc_dec, /* i : encoder/decoder flag */ const int32_t io_fs, /* i : input/output sampling frequency */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ Loading @@ -63,11 +59,7 @@ float get_delay( const int32_t binaural_latency_ns /* i : binaural renderer HRTF delay in ns */ ) { #ifdef FIX_GET_DELAY_RETURN int32_t delay = 0; #else float delay = 0; #endif if ( enc_dec == ENC ) { Loading
lib_com/ivas_cnst.h +0 −10 Original line number Diff line number Diff line Loading @@ -107,10 +107,8 @@ typedef enum AUDIO_CONFIG_ISM2, /* ISM2 */ AUDIO_CONFIG_ISM3, /* ISM3 */ AUDIO_CONFIG_ISM4, /* ISM4 */ #ifdef EXT_RENDERER /* TODO tmu : temporary, or use something like IVAS_ENC input format */ AUDIO_CONFIG_MASA1, /* MASA1 */ AUDIO_CONFIG_MASA2, /* MASA2 */ #endif AUDIO_CONFIG_EXTERNAL /* external renderer */ } AUDIO_CONFIG; Loading Loading @@ -193,10 +191,8 @@ typedef enum #define IVAS_MAX_SBA_ORDER 3 /* Maximum supported Ambisonics order */ #ifdef EXT_RENDERER #define IVAS_LIMITER_THRESHOLD 32729 /* -0.01 dBFS */ #define IVAS_LIMITER_ATTACK_SECONDS 0.005f #endif #define IVAS_NUM_SUPPORTED_FS 3 /* number of supported sampling-rates in IVAS */ /*----------------------------------------------------------------------------------* Loading Loading @@ -1374,21 +1370,15 @@ typedef enum #define BINAURAL_COHERENCE_DIFFERENCE_BINS 9 /* Number of bins for direction-dependent diffuse-field binaural coherence */ #ifdef EXT_RENDERER #define HEADROT_ORDER 3 #define HEADROT_SHMAT_DIM ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) ) #define HEADROT_SHMAT_DIM2 ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM ) #endif /*----------------------------------------------------------------------------------* * TD Binaural Object renderer *----------------------------------------------------------------------------------*/ #ifdef EXT_RENDERER #define MAX_NUM_TDREND_CHANNELS 16 /* max. number of channels in TD renderer (objects or loudspeaker channels) */ #else #define MAX_NUM_TDREND_CHANNELS 11 /* max. number of channels in TD renderer (objects or loudspeaker channels) */ #endif #define SFX_SPAT_BIN_MAX_NO_OF_OUTPUT_SAMPLES 288 /* 288 = 6 msec @ 48 kHz. */ #define HRTF_MODEL_N_SECTIONS 3 /* No. sections used in approximate evaluation of model */ Loading