Loading apps/decoder.c +7 −1 Original line number Diff line number Diff line Loading @@ -490,7 +490,13 @@ int main( fprintf( stderr, "\nError in reading Custom loudspeaker file %s: %s\n\n", arg.customLsSetupFilename, CustomLoudspeakerLayout_getError( lsCustomError ) ); goto cleanup; } #ifdef IVAS_FLOAT_FIXED for ( int i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) { hLsCustomData.azimuth_fx[i] = (Word32) ( hLsCustomData.azimuth[i] * ( 1u << 22 ) ); hLsCustomData.elevation_fx[i] = (Word32) ( hLsCustomData.elevation[i] * ( 1u << 22 ) ); } #endif if ( ( error = IVAS_DEC_FeedCustomLsData( hIvasDec, hLsCustomData ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedCustomLsData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); Loading apps/renderer.c +22 −2 Original line number Diff line number Diff line Loading @@ -442,8 +442,8 @@ static IVAS_REND_ReadOnlyAudioBuffer getReadOnlySubBuffer( subBuffer.config = buffer.config; subBuffer.config.numChannels = numChannels; subBuffer.data = buffer.data + subBuffer.config.numSamplesPerChannel * chBeginIdx; subBuffer.data_fx = buffer.data_fx + subBuffer.config.numSamplesPerChannel * chBeginIdx; move16(); subBuffer.data_fx = buffer.data_fx + imult1616( subBuffer.config.numSamplesPerChannel, chBeginIdx ); return subBuffer; } Loading Loading @@ -912,6 +912,10 @@ int main( /* Set up output custom layout configuration */ if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { #ifdef IVAS_FLOAT_FIXED floatToFixed_arrL( args.outConfig.outSetupCustom.azimuth, args.outConfig.outSetupCustom.azimuth_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS ); floatToFixed_arrL( args.outConfig.outSetupCustom.elevation, args.outConfig.outSetupCustom.elevation_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS ); #endif if ( ( error = IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( hIvasRend, args.outConfig.outSetupCustom ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) ); Loading Loading @@ -1022,6 +1026,10 @@ int main( if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { #ifdef IVAS_FLOAT_FIXED floatToFixed_arrL( args.inConfig.inSetupCustom.azimuth, args.inConfig.inSetupCustom.azimuth_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS ); floatToFixed_arrL( args.inConfig.inSetupCustom.elevation, args.inConfig.inSetupCustom.elevation_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS ); #endif if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in IVAS_REND_ConfigureCustomInputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) ); Loading Loading @@ -1265,11 +1273,15 @@ int main( inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; inBuffer.config.numChannels = (int16_t) totalNumInChannels; #ifndef IVAS_FLOAT_FIXED inBuffer.data = inFloatBuffer; #endif // IVAS_FLOAT_FIXED outBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; outBuffer.config.numChannels = (int16_t) numOutChannels; #ifndef IVAS_FLOAT_FIXED outBuffer.data = outFloatBuffer; #endif #ifdef IVAS_FLOAT_FIXED outBuffer.data_fx = outInt32Buffer; inBuffer.data_fx = inInt32Buffer; Loading Loading @@ -1523,11 +1535,19 @@ int main( } IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.masaBuses[i].inputChannelIndex, numChannels ); #ifdef IVAS_FLOAT_FIXED IF( ( error = IVAS_REND_FeedInputAudio_fx( hIvasRend, masaIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #else if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, masaIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #endif if ( isCurrentFrameMultipleOf20ms ) { Loading lib_com/cldfb.c +237 −69 Original line number Diff line number Diff line Loading @@ -1731,7 +1731,7 @@ ivas_error openCldfb_ivas_fx( // configureCldfb_ivas( hs, sampling_rate ); configureCldfb_ivas_fx( hs, sampling_rate ); hs->memory_flt = NULL; hs->memory32 = NULL; hs->FilterStates = NULL; hs->memory_length = 0; move16(); Loading Loading @@ -1770,62 +1770,6 @@ ivas_error openCldfb_ivas_fx( return IVAS_ERR_OK; } ivas_error openCldfb_ivas( HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: filter bank handle */ CLDFB_TYPE type, /* i : analysis or synthesis */ const int32_t sampling_rate, /* i : sampling rate */ CLDFB_PROTOTYPE prototype /* i : CLDFB version (1.25ms/5ms delay) */ ) { HANDLE_CLDFB_FILTER_BANK hs; int16_t buf_len; if ( ( hs = (HANDLE_CLDFB_FILTER_BANK) malloc( sizeof( CLDFB_FILTER_BANK ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); } hs->type = type; hs->prototype = prototype; configureCldfb_ivas( hs, sampling_rate ); hs->memory_flt = NULL; hs->memory_length = 0; if ( type == CLDFB_ANALYSIS ) { buf_len = hs->p_filter_length - hs->no_channels; } else { buf_len = hs->p_filter_length; } if ( ( hs->cldfb_state = (float *) malloc( buf_len * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); } set_f( hs->cldfb_state, 0.0f, buf_len ); #ifdef IVAS_FLOAT_FIXED if ( ( hs->cldfb_state_fx = (Word32 *) malloc( buf_len * sizeof( Word32 ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); } hs->cldfb_state_length = buf_len; // Temporarily added to store the length of buffer move16(); hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/ move16(); set32_fx( hs->cldfb_state_fx, 0, buf_len ); hs->Q_cldfb_state = Q11; move16(); #endif // IVAS_FLOAT_FIXED *h_cldfb = hs; return IVAS_ERR_OK; } #else ivas_error openCldfb_ivas( HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: filter bank handle */ Loading Loading @@ -2202,6 +2146,239 @@ void deleteCldfb_ivas_fx( * Initializes rom pointer *--------------------------------------------------------------------*/ #ifdef IVAS_FLOAT_FIXED static void cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */ ) { /*find appropriate set of rotVecs*/ SWITCH( hs->no_channels ) { case 10: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L10_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L10_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L10_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L10_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 10; hs->da = 10; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17036; hs->p_filter = CLDFB80_10_fx; hs->scale = CLDFB80_10_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 40; hs->da = -20; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15388; hs->p_filter = LDQMF_10_fx; hs->scale = LDQMF_10_SCALE_FX_Q8; } BREAK; case 16: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L16_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L16_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L16_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L16_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 20; hs->da = 20; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17051; hs->p_filter = CLDFB80_16_fx; hs->scale = CLDFB80_16_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 80; hs->da = -40; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15388; hs->p_filter = LDQMF_16_fx; hs->scale = LDQMF_16_SCALE_FX_Q8; } BREAK; case 20: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L20_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L20_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L20_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L20_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 20; hs->da = 20; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17050; hs->p_filter = CLDFB80_20_fx; hs->scale = CLDFB80_20_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 80; hs->da = -40; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15390; hs->p_filter = LDQMF_20_fx; hs->scale = LDQMF_20_SCALE_FX_Q8; } BREAK; case 30: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L30_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L30_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L30_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L30_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 30; hs->da = 30; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17051; hs->p_filter = CLDFB80_30_fx; hs->scale = CLDFB80_30_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 120; hs->da = -60; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15388; hs->p_filter = LDQMF_30_fx; hs->scale = LDQMF_30_SCALE_FX_Q8; } BREAK; case 32: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L32_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L32_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L32_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L32_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 32; hs->da = 32; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17050; hs->p_filter = CLDFB80_32_fx; hs->scale = CLDFB80_32_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 160; hs->da = -80; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15392; hs->p_filter = LDQMF_32_fx; hs->scale = LDQMF_32_SCALE_FX_Q8; } BREAK; case 40: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L40_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L40_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L40_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L40_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 40; hs->da = 40; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17051; hs->p_filter = CLDFB80_40_fx; hs->scale = CLDFB80_40_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 160; hs->da = -80; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15391; hs->p_filter = LDQMF_40_fx; hs->scale = LDQMF_40_SCALE_FX_Q8; } BREAK; case 60: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L60_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L60_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L60_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L60_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 60; hs->da = 60; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->p_filter_sf = (Word16) 17051; hs->p_filter = CLDFB80_60_fx; hs->scale = CLDFB80_60_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 240; hs->da = -120; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15391; hs->p_filter = LDQMF_60_fx; hs->scale = LDQMF_60_SCALE_FX_Q8; } BREAK; } move16(); move16(); move16(); move16(); return; } #else static void cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */ ) Loading Loading @@ -2583,6 +2760,7 @@ static void cldfb_init_proto_and_twiddles( return; } #endif // IVAS_FLOAT_FIXED static void cldfb_init_proto_and_twiddles_enc( HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */ Loading Loading @@ -3006,7 +3184,7 @@ ivas_error cldfb_save_memory_ivas_fx( { UWord16 offset = sub( hs->p_filter_length, hs->no_channels ); IF( hs->memory_flt != NULL || ( hs->memory_length != 0 ) ) IF( hs->memory32 != NULL || ( hs->memory_length != 0 ) ) { /* memory already stored; Free memory first */ return IVAS_ERR_OK; Loading @@ -3022,12 +3200,6 @@ ivas_error cldfb_save_memory_ivas_fx( hs->memory_length = hs->p_filter_length; move16(); } #if 1 /*Floating point memory allocation: To be removed later*/ IF( ( hs->memory_flt = (float *) malloc( hs->memory_length * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" ); } #endif IF( ( hs->memory32 = (Word32 *) malloc( hs->memory_length * sizeof( Word32 ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" ); Loading Loading @@ -3084,7 +3256,7 @@ void cldfb_restore_memory_ivas_fx( UWord16 offset = sub( hs->p_filter_length, hs->no_channels ); UWord16 size; test(); IF( hs->memory_flt == NULL || EQ_16( hs->memory_length, 0 ) ) IF( hs->memory32 == NULL || EQ_16( hs->memory_length, 0 ) ) { /* memory not allocated */ return; Loading Loading @@ -3113,10 +3285,6 @@ void cldfb_restore_memory_ivas_fx( move16(); hs->memory_length = 0; move16(); #if 1 // Remove later free( hs->memory_flt ); hs->memory_flt = NULL; #endif free( hs->memory32 ); hs->memory32 = NULL; Loading lib_com/common_api_types.h +6 −2 Original line number Diff line number Diff line Loading @@ -110,9 +110,9 @@ typedef enum _IVAS_ENC_FEC_INDICATOR typedef struct _IVAS_ENC_CHANNEL_AWARE_CONFIG { Word16 channelAwareModeEnabled; int16_t channelAwareModeEnabled; IVAS_ENC_FEC_INDICATOR fec_indicator; Word16 fec_offset; int16_t fec_offset; } IVAS_ENC_CHANNEL_AWARE_CONFIG; Loading Loading @@ -194,6 +194,10 @@ typedef struct _IVAS_LS_CUSTOM_LAYOUT int16_t num_spk; float azimuth[IVAS_MAX_OUTPUT_CHANNELS]; float elevation[IVAS_MAX_OUTPUT_CHANNELS]; #ifdef IVAS_FLOAT_FIXED Word32 azimuth_fx[IVAS_MAX_OUTPUT_CHANNELS]; Word32 elevation_fx[IVAS_MAX_OUTPUT_CHANNELS]; #endif int16_t num_lfe; int16_t lfe_idx[IVAS_MAX_OUTPUT_CHANNELS]; Loading lib_com/ivas_prot.h +4 −0 Original line number Diff line number Diff line Loading @@ -1475,12 +1475,14 @@ void ivas_param_ism_dec_digest_tc( ); #endif // IVAS_FLOAT_FIXED #ifndef IVAS_FLOAT_FIXED void ivas_ism_param_dec_tc_gain_ajust( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamples, /* i : number of samples to be compensate */ const uint16_t nFadeLength, /* i : length of the crossfade in samples */ float *transport_channels_f[] /* i : synthesized core-coder transport channels/DirAC output */ ); #endif void ivas_param_ism_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Loading Loading @@ -5398,6 +5400,7 @@ void ivas_dirac_dec_output_synthesis_cov_close( DIRAC_OUTPUT_SYNTHESIS_COV_STATE *h_dirac_output_synthesis_state /* i/o: handle for the covariance synthesis state */ ); #ifndef IVAS_FLOAT_FIXED void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part */ Loading @@ -5406,6 +5409,7 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ ); #endif void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot( float *Cldfb_RealBuffer_in, /* i : input channel filter bank samples (real part) */ Loading Loading
apps/decoder.c +7 −1 Original line number Diff line number Diff line Loading @@ -490,7 +490,13 @@ int main( fprintf( stderr, "\nError in reading Custom loudspeaker file %s: %s\n\n", arg.customLsSetupFilename, CustomLoudspeakerLayout_getError( lsCustomError ) ); goto cleanup; } #ifdef IVAS_FLOAT_FIXED for ( int i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) { hLsCustomData.azimuth_fx[i] = (Word32) ( hLsCustomData.azimuth[i] * ( 1u << 22 ) ); hLsCustomData.elevation_fx[i] = (Word32) ( hLsCustomData.elevation[i] * ( 1u << 22 ) ); } #endif if ( ( error = IVAS_DEC_FeedCustomLsData( hIvasDec, hLsCustomData ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedCustomLsData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); Loading
apps/renderer.c +22 −2 Original line number Diff line number Diff line Loading @@ -442,8 +442,8 @@ static IVAS_REND_ReadOnlyAudioBuffer getReadOnlySubBuffer( subBuffer.config = buffer.config; subBuffer.config.numChannels = numChannels; subBuffer.data = buffer.data + subBuffer.config.numSamplesPerChannel * chBeginIdx; subBuffer.data_fx = buffer.data_fx + subBuffer.config.numSamplesPerChannel * chBeginIdx; move16(); subBuffer.data_fx = buffer.data_fx + imult1616( subBuffer.config.numSamplesPerChannel, chBeginIdx ); return subBuffer; } Loading Loading @@ -912,6 +912,10 @@ int main( /* Set up output custom layout configuration */ if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { #ifdef IVAS_FLOAT_FIXED floatToFixed_arrL( args.outConfig.outSetupCustom.azimuth, args.outConfig.outSetupCustom.azimuth_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS ); floatToFixed_arrL( args.outConfig.outSetupCustom.elevation, args.outConfig.outSetupCustom.elevation_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS ); #endif if ( ( error = IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( hIvasRend, args.outConfig.outSetupCustom ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) ); Loading Loading @@ -1022,6 +1026,10 @@ int main( if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { #ifdef IVAS_FLOAT_FIXED floatToFixed_arrL( args.inConfig.inSetupCustom.azimuth, args.inConfig.inSetupCustom.azimuth_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS ); floatToFixed_arrL( args.inConfig.inSetupCustom.elevation, args.inConfig.inSetupCustom.elevation_fx, Q22, IVAS_MAX_OUTPUT_CHANNELS ); #endif if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in IVAS_REND_ConfigureCustomInputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) ); Loading Loading @@ -1265,11 +1273,15 @@ int main( inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; inBuffer.config.numChannels = (int16_t) totalNumInChannels; #ifndef IVAS_FLOAT_FIXED inBuffer.data = inFloatBuffer; #endif // IVAS_FLOAT_FIXED outBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; outBuffer.config.numChannels = (int16_t) numOutChannels; #ifndef IVAS_FLOAT_FIXED outBuffer.data = outFloatBuffer; #endif #ifdef IVAS_FLOAT_FIXED outBuffer.data_fx = outInt32Buffer; inBuffer.data_fx = inInt32Buffer; Loading Loading @@ -1523,11 +1535,19 @@ int main( } IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.masaBuses[i].inputChannelIndex, numChannels ); #ifdef IVAS_FLOAT_FIXED IF( ( error = IVAS_REND_FeedInputAudio_fx( hIvasRend, masaIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #else if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, masaIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #endif if ( isCurrentFrameMultipleOf20ms ) { Loading
lib_com/cldfb.c +237 −69 Original line number Diff line number Diff line Loading @@ -1731,7 +1731,7 @@ ivas_error openCldfb_ivas_fx( // configureCldfb_ivas( hs, sampling_rate ); configureCldfb_ivas_fx( hs, sampling_rate ); hs->memory_flt = NULL; hs->memory32 = NULL; hs->FilterStates = NULL; hs->memory_length = 0; move16(); Loading Loading @@ -1770,62 +1770,6 @@ ivas_error openCldfb_ivas_fx( return IVAS_ERR_OK; } ivas_error openCldfb_ivas( HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: filter bank handle */ CLDFB_TYPE type, /* i : analysis or synthesis */ const int32_t sampling_rate, /* i : sampling rate */ CLDFB_PROTOTYPE prototype /* i : CLDFB version (1.25ms/5ms delay) */ ) { HANDLE_CLDFB_FILTER_BANK hs; int16_t buf_len; if ( ( hs = (HANDLE_CLDFB_FILTER_BANK) malloc( sizeof( CLDFB_FILTER_BANK ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); } hs->type = type; hs->prototype = prototype; configureCldfb_ivas( hs, sampling_rate ); hs->memory_flt = NULL; hs->memory_length = 0; if ( type == CLDFB_ANALYSIS ) { buf_len = hs->p_filter_length - hs->no_channels; } else { buf_len = hs->p_filter_length; } if ( ( hs->cldfb_state = (float *) malloc( buf_len * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); } set_f( hs->cldfb_state, 0.0f, buf_len ); #ifdef IVAS_FLOAT_FIXED if ( ( hs->cldfb_state_fx = (Word32 *) malloc( buf_len * sizeof( Word32 ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); } hs->cldfb_state_length = buf_len; // Temporarily added to store the length of buffer move16(); hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/ move16(); set32_fx( hs->cldfb_state_fx, 0, buf_len ); hs->Q_cldfb_state = Q11; move16(); #endif // IVAS_FLOAT_FIXED *h_cldfb = hs; return IVAS_ERR_OK; } #else ivas_error openCldfb_ivas( HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: filter bank handle */ Loading Loading @@ -2202,6 +2146,239 @@ void deleteCldfb_ivas_fx( * Initializes rom pointer *--------------------------------------------------------------------*/ #ifdef IVAS_FLOAT_FIXED static void cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */ ) { /*find appropriate set of rotVecs*/ SWITCH( hs->no_channels ) { case 10: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L10_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L10_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L10_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L10_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 10; hs->da = 10; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17036; hs->p_filter = CLDFB80_10_fx; hs->scale = CLDFB80_10_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 40; hs->da = -20; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15388; hs->p_filter = LDQMF_10_fx; hs->scale = LDQMF_10_SCALE_FX_Q8; } BREAK; case 16: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L16_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L16_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L16_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L16_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 20; hs->da = 20; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17051; hs->p_filter = CLDFB80_16_fx; hs->scale = CLDFB80_16_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 80; hs->da = -40; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15388; hs->p_filter = LDQMF_16_fx; hs->scale = LDQMF_16_SCALE_FX_Q8; } BREAK; case 20: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L20_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L20_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L20_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L20_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 20; hs->da = 20; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17050; hs->p_filter = CLDFB80_20_fx; hs->scale = CLDFB80_20_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 80; hs->da = -40; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15390; hs->p_filter = LDQMF_20_fx; hs->scale = LDQMF_20_SCALE_FX_Q8; } BREAK; case 30: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L30_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L30_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L30_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L30_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 30; hs->da = 30; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17051; hs->p_filter = CLDFB80_30_fx; hs->scale = CLDFB80_30_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 120; hs->da = -60; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15388; hs->p_filter = LDQMF_30_fx; hs->scale = LDQMF_30_SCALE_FX_Q8; } BREAK; case 32: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L32_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L32_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L32_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L32_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 32; hs->da = 32; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17050; hs->p_filter = CLDFB80_32_fx; hs->scale = CLDFB80_32_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 160; hs->da = -80; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15392; hs->p_filter = LDQMF_32_fx; hs->scale = LDQMF_32_SCALE_FX_Q8; } BREAK; case 40: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L40_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L40_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L40_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L40_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 40; hs->da = 40; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->p_filter_sf = (Word16) 17051; hs->p_filter = CLDFB80_40_fx; hs->scale = CLDFB80_40_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 160; hs->da = -80; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15391; hs->p_filter = LDQMF_40_fx; hs->scale = LDQMF_40_SCALE_FX_Q8; } BREAK; case 60: hs->rot_vec_ana_re_fx = rot_vec_ana_re_L60_fx; hs->rot_vec_ana_im_fx = rot_vec_ana_im_L60_fx; hs->rot_vec_syn_re_fx = rot_vec_syn_re_L60_fx; hs->rot_vec_syn_im_fx = rot_vec_syn_im_L60_fx; IF( hs->prototype == CLDFB_PROTOTYPE_1_25MS ) { hs->ds = 60; hs->da = 60; hs->rot_vec_ana_delay_re_fx = NULL; hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->p_filter_sf = (Word16) 17051; hs->p_filter = CLDFB80_60_fx; hs->scale = CLDFB80_60_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { hs->ds = 240; hs->da = -120; hs->rot_vec_ana_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->p_filter_sf = (Word16) 15391; hs->p_filter = LDQMF_60_fx; hs->scale = LDQMF_60_SCALE_FX_Q8; } BREAK; } move16(); move16(); move16(); move16(); return; } #else static void cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */ ) Loading Loading @@ -2583,6 +2760,7 @@ static void cldfb_init_proto_and_twiddles( return; } #endif // IVAS_FLOAT_FIXED static void cldfb_init_proto_and_twiddles_enc( HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */ Loading Loading @@ -3006,7 +3184,7 @@ ivas_error cldfb_save_memory_ivas_fx( { UWord16 offset = sub( hs->p_filter_length, hs->no_channels ); IF( hs->memory_flt != NULL || ( hs->memory_length != 0 ) ) IF( hs->memory32 != NULL || ( hs->memory_length != 0 ) ) { /* memory already stored; Free memory first */ return IVAS_ERR_OK; Loading @@ -3022,12 +3200,6 @@ ivas_error cldfb_save_memory_ivas_fx( hs->memory_length = hs->p_filter_length; move16(); } #if 1 /*Floating point memory allocation: To be removed later*/ IF( ( hs->memory_flt = (float *) malloc( hs->memory_length * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" ); } #endif IF( ( hs->memory32 = (Word32 *) malloc( hs->memory_length * sizeof( Word32 ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" ); Loading Loading @@ -3084,7 +3256,7 @@ void cldfb_restore_memory_ivas_fx( UWord16 offset = sub( hs->p_filter_length, hs->no_channels ); UWord16 size; test(); IF( hs->memory_flt == NULL || EQ_16( hs->memory_length, 0 ) ) IF( hs->memory32 == NULL || EQ_16( hs->memory_length, 0 ) ) { /* memory not allocated */ return; Loading Loading @@ -3113,10 +3285,6 @@ void cldfb_restore_memory_ivas_fx( move16(); hs->memory_length = 0; move16(); #if 1 // Remove later free( hs->memory_flt ); hs->memory_flt = NULL; #endif free( hs->memory32 ); hs->memory32 = NULL; Loading
lib_com/common_api_types.h +6 −2 Original line number Diff line number Diff line Loading @@ -110,9 +110,9 @@ typedef enum _IVAS_ENC_FEC_INDICATOR typedef struct _IVAS_ENC_CHANNEL_AWARE_CONFIG { Word16 channelAwareModeEnabled; int16_t channelAwareModeEnabled; IVAS_ENC_FEC_INDICATOR fec_indicator; Word16 fec_offset; int16_t fec_offset; } IVAS_ENC_CHANNEL_AWARE_CONFIG; Loading Loading @@ -194,6 +194,10 @@ typedef struct _IVAS_LS_CUSTOM_LAYOUT int16_t num_spk; float azimuth[IVAS_MAX_OUTPUT_CHANNELS]; float elevation[IVAS_MAX_OUTPUT_CHANNELS]; #ifdef IVAS_FLOAT_FIXED Word32 azimuth_fx[IVAS_MAX_OUTPUT_CHANNELS]; Word32 elevation_fx[IVAS_MAX_OUTPUT_CHANNELS]; #endif int16_t num_lfe; int16_t lfe_idx[IVAS_MAX_OUTPUT_CHANNELS]; Loading
lib_com/ivas_prot.h +4 −0 Original line number Diff line number Diff line Loading @@ -1475,12 +1475,14 @@ void ivas_param_ism_dec_digest_tc( ); #endif // IVAS_FLOAT_FIXED #ifndef IVAS_FLOAT_FIXED void ivas_ism_param_dec_tc_gain_ajust( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamples, /* i : number of samples to be compensate */ const uint16_t nFadeLength, /* i : length of the crossfade in samples */ float *transport_channels_f[] /* i : synthesized core-coder transport channels/DirAC output */ ); #endif void ivas_param_ism_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Loading Loading @@ -5398,6 +5400,7 @@ void ivas_dirac_dec_output_synthesis_cov_close( DIRAC_OUTPUT_SYNTHESIS_COV_STATE *h_dirac_output_synthesis_state /* i/o: handle for the covariance synthesis state */ ); #ifndef IVAS_FLOAT_FIXED void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part */ Loading @@ -5406,6 +5409,7 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ ); #endif void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot( float *Cldfb_RealBuffer_in, /* i : input channel filter bank samples (real part) */ Loading