Loading apps/ambi_converter.c +19 −13 Original line number Diff line number Diff line Loading @@ -52,33 +52,34 @@ int main( int argc, char *argv[] ) uint32_t samplingRate; uint32_t samplesInFile; uint32_t numSamples = L_FRAME48k; uint32_t numSamples = AMBI_MAX_FRAME_LENGTH; uint32_t numSamplesRead32 = 0; uint32_t numSamplesClipped = 0; int16_t bps; int16_t samples[L_FRAME48k * AMBI_MAX_CHANNELS]; int16_t samples[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; int16_t order = 0; int16_t numChannels; const char *name_conventions[6] = { "ACN-SN3D", "ACN-N3D", "FuMa-MaxN", "FuMa-FuMa", "SID-SN3D", "SID-N3D" }; AMBI_FMT in_format, out_format; float samples_f_in[L_FRAME48k * AMBI_MAX_CHANNELS]; float samples_f_out[L_FRAME48k * AMBI_MAX_CHANNELS]; float samples_f_in[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; float samples_f_out[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; float *in[AMBI_MAX_CHANNELS], *out[AMBI_MAX_CHANNELS]; for ( int16_t j = 0; j < AMBI_MAX_CHANNELS; j++ ) { in[j] = &samples_f_in[j * L_FRAME48k]; out[j] = &samples_f_out[j * L_FRAME48k]; in[j] = &samples_f_in[j * AMBI_MAX_FRAME_LENGTH]; out[j] = &samples_f_out[j * AMBI_MAX_FRAME_LENGTH]; } printf( "Ambisonics converter program\n" ); if ( argc != 5 ) { printf( "Ambisonics converter program\n" ); printf( "----------------------------------------------------------------------------------\n" ); printf( "Usage:\n" ); printf( "./ambi_conveter input_file output_file input_convention output_convention\n" ); printf( "./ambi_converter input_file output_file input_convention output_convention\n" ); printf( "\n" ); printf( "input_convention and output convention must be an integer number in [0,5]\n" ); printf( "the following conventions are supported:\n" ); Loading @@ -97,8 +98,12 @@ int main( int argc, char *argv[] ) fileName_out = argv[2]; in_format = atoi( argv[3] ); out_format = atoi( argv[4] ); printf( "In %d, Out: %d\n", in_format, out_format ); if ( in_format < 0 || out_format < 0 || in_format > 5 || out_format > 5 ) { printf( "input_convention and output convention must be an integer number in [0,5]\n" ); return -1; } printf( "In: [%s], Out: [%s]\n", name_conventions[in_format], name_conventions[out_format] ); wavFile_in = OpenWav( fileName_in, &samplingRate, &numChannels, &samplesInFile, &bps ); if ( !wavFile_in ) Loading @@ -117,6 +122,7 @@ int main( int argc, char *argv[] ) order = (int16_t) sqrtf( numChannels ) - 1; assert( order > 0 && order <= 3 ); numSamples = ( samplingRate * 20 * numChannels ) / 1000; /* 20ms worth of samples */ while ( ReadWavShort( wavFile_in, samples, numSamples, &numSamplesRead32 ) == __TWI_SUCCESS ) { int32_t err = 0; Loading @@ -126,7 +132,7 @@ int main( int argc, char *argv[] ) break; } for ( uint16_t i = 0; i < numSamplesRead32; i++ ) for ( uint16_t i = 0; i < (uint16_t) numSamplesRead32 / numChannels; i++ ) { for ( int16_t j = 0; j < numChannels; j++ ) { Loading @@ -134,14 +140,14 @@ int main( int argc, char *argv[] ) } } if ( ( err = convert_ambi_format( in, out, order, in_format, out_format ) ) != 0 ) if ( ( err = convert_ambi_format( in, out, order, in_format, out_format, ( const uint16_t )( numSamples / numChannels ) ) ) != 0 ) { printf( "Error converting the input signal!\n" ); return err; } for ( uint16_t i = 0; i < numSamplesRead32; i++ ) for ( uint16_t i = 0; i < (uint16_t) numSamplesRead32 / numChannels; i++ ) { for ( int16_t j = 0; j < numChannels; j++ ) { Loading apps/decoder.c +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ typedef struct hrtfFileReader *hrtfReader; char *hrtfFileName; IVAS_DEC_HRTF_HANDLE *hHrtfTD; IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; Loading apps/renderer.c +10 −3 Original line number Diff line number Diff line Loading @@ -682,7 +682,7 @@ int main( IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; IsmPositionProvider *positionProvider = NULL; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; Loading Loading @@ -961,9 +961,9 @@ int main( if ( hrtfFileReader != NULL ) { if ( ( error = IVAS_REND_GetHrtfHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_GetHrtfTdHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_REND_GetHrtfHandle failed: %s\n\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nIVAS_REND_GetHrtfTdHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } Loading Loading @@ -2611,7 +2611,14 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; #ifdef FIX_HRTF_LEFTOVERS for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID; } #else args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; #endif for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) { Loading lib_com/common_api_types.h +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ typedef enum 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 ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_TD_HANDLE; typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtf_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtf_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; Loading lib_com/ivas_cnst.h +3 −0 Original line number Diff line number Diff line Loading @@ -229,6 +229,9 @@ typedef enum /* format signaling in SID frames */ #define SID_FORMAT_NBITS 3 /* Bit 0 | Bit 1 | Bit 2 */ /*-------|-------|------ */ #ifdef FIX_1384_MSAN_ivas_spar_dec_open #define SID_FORMAT_NONE (-0x1) /* n/a| n/a| n/a*/ #endif #define SID_DFT_STEREO 0x0 /* 0| 0| 0 */ #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ Loading Loading
apps/ambi_converter.c +19 −13 Original line number Diff line number Diff line Loading @@ -52,33 +52,34 @@ int main( int argc, char *argv[] ) uint32_t samplingRate; uint32_t samplesInFile; uint32_t numSamples = L_FRAME48k; uint32_t numSamples = AMBI_MAX_FRAME_LENGTH; uint32_t numSamplesRead32 = 0; uint32_t numSamplesClipped = 0; int16_t bps; int16_t samples[L_FRAME48k * AMBI_MAX_CHANNELS]; int16_t samples[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; int16_t order = 0; int16_t numChannels; const char *name_conventions[6] = { "ACN-SN3D", "ACN-N3D", "FuMa-MaxN", "FuMa-FuMa", "SID-SN3D", "SID-N3D" }; AMBI_FMT in_format, out_format; float samples_f_in[L_FRAME48k * AMBI_MAX_CHANNELS]; float samples_f_out[L_FRAME48k * AMBI_MAX_CHANNELS]; float samples_f_in[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; float samples_f_out[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; float *in[AMBI_MAX_CHANNELS], *out[AMBI_MAX_CHANNELS]; for ( int16_t j = 0; j < AMBI_MAX_CHANNELS; j++ ) { in[j] = &samples_f_in[j * L_FRAME48k]; out[j] = &samples_f_out[j * L_FRAME48k]; in[j] = &samples_f_in[j * AMBI_MAX_FRAME_LENGTH]; out[j] = &samples_f_out[j * AMBI_MAX_FRAME_LENGTH]; } printf( "Ambisonics converter program\n" ); if ( argc != 5 ) { printf( "Ambisonics converter program\n" ); printf( "----------------------------------------------------------------------------------\n" ); printf( "Usage:\n" ); printf( "./ambi_conveter input_file output_file input_convention output_convention\n" ); printf( "./ambi_converter input_file output_file input_convention output_convention\n" ); printf( "\n" ); printf( "input_convention and output convention must be an integer number in [0,5]\n" ); printf( "the following conventions are supported:\n" ); Loading @@ -97,8 +98,12 @@ int main( int argc, char *argv[] ) fileName_out = argv[2]; in_format = atoi( argv[3] ); out_format = atoi( argv[4] ); printf( "In %d, Out: %d\n", in_format, out_format ); if ( in_format < 0 || out_format < 0 || in_format > 5 || out_format > 5 ) { printf( "input_convention and output convention must be an integer number in [0,5]\n" ); return -1; } printf( "In: [%s], Out: [%s]\n", name_conventions[in_format], name_conventions[out_format] ); wavFile_in = OpenWav( fileName_in, &samplingRate, &numChannels, &samplesInFile, &bps ); if ( !wavFile_in ) Loading @@ -117,6 +122,7 @@ int main( int argc, char *argv[] ) order = (int16_t) sqrtf( numChannels ) - 1; assert( order > 0 && order <= 3 ); numSamples = ( samplingRate * 20 * numChannels ) / 1000; /* 20ms worth of samples */ while ( ReadWavShort( wavFile_in, samples, numSamples, &numSamplesRead32 ) == __TWI_SUCCESS ) { int32_t err = 0; Loading @@ -126,7 +132,7 @@ int main( int argc, char *argv[] ) break; } for ( uint16_t i = 0; i < numSamplesRead32; i++ ) for ( uint16_t i = 0; i < (uint16_t) numSamplesRead32 / numChannels; i++ ) { for ( int16_t j = 0; j < numChannels; j++ ) { Loading @@ -134,14 +140,14 @@ int main( int argc, char *argv[] ) } } if ( ( err = convert_ambi_format( in, out, order, in_format, out_format ) ) != 0 ) if ( ( err = convert_ambi_format( in, out, order, in_format, out_format, ( const uint16_t )( numSamples / numChannels ) ) ) != 0 ) { printf( "Error converting the input signal!\n" ); return err; } for ( uint16_t i = 0; i < numSamplesRead32; i++ ) for ( uint16_t i = 0; i < (uint16_t) numSamplesRead32 / numChannels; i++ ) { for ( int16_t j = 0; j < numChannels; j++ ) { Loading
apps/decoder.c +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ typedef struct hrtfFileReader *hrtfReader; char *hrtfFileName; IVAS_DEC_HRTF_HANDLE *hHrtfTD; IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; Loading
apps/renderer.c +10 −3 Original line number Diff line number Diff line Loading @@ -682,7 +682,7 @@ int main( IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; IsmPositionProvider *positionProvider = NULL; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; Loading Loading @@ -961,9 +961,9 @@ int main( if ( hrtfFileReader != NULL ) { if ( ( error = IVAS_REND_GetHrtfHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_GetHrtfTdHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_REND_GetHrtfHandle failed: %s\n\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nIVAS_REND_GetHrtfTdHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } Loading Loading @@ -2611,7 +2611,14 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; #ifdef FIX_HRTF_LEFTOVERS for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID; } #else args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; #endif for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) { Loading
lib_com/common_api_types.h +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ typedef enum 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 ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_TD_HANDLE; typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtf_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtf_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; Loading
lib_com/ivas_cnst.h +3 −0 Original line number Diff line number Diff line Loading @@ -229,6 +229,9 @@ typedef enum /* format signaling in SID frames */ #define SID_FORMAT_NBITS 3 /* Bit 0 | Bit 1 | Bit 2 */ /*-------|-------|------ */ #ifdef FIX_1384_MSAN_ivas_spar_dec_open #define SID_FORMAT_NONE (-0x1) /* n/a| n/a| n/a*/ #endif #define SID_DFT_STEREO 0x0 /* 0| 0| 0 */ #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ Loading