diff --git a/lib_com/options.h b/lib_com/options.h old mode 100644 new mode 100755 index 04d59401cf871701677c9666785f4eb75b675e3f..e284d917ab6ee1d0f46a05dafb73fceaea7b3e8e --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,7 @@ #define FIX_712_713_SPLIT_REND_MASA_MC /*Dlb : Fix for issue 712 and 713*/ #endif +#define IGF_MEMORY_ALLOC_OPT /* FhG: Issue 157: allocate IGF encoder structure only when needed */ #define FIX_732_PLANAR_SBA_OSBA /* Dlb : issue 732: fix for crash in planar mode in OSBA format*/ #define FIX_708_DPID_COMMAND_LINE /* issue 708: sanity checks for '-dpid' command-line */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 47469062253eeb20a07cbf44418886540b91302a..8f2a8f8e135a1f6748a0ea82f808b503a7cddada 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2272,6 +2272,10 @@ ivas_error init_encoder( const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ const ISM_MODE ism_mode /* i : ISM mode */ +#ifdef IGF_MEMORY_ALLOC_OPT + , + const int32_t element_brate +#endif ); void LPDmem_enc_init( @@ -9869,6 +9873,18 @@ void IGFEncResetTCX10BitCounter( const IGF_ENC_INSTANCE_HANDLE hIGFEnc /* i : instance handle of IGF Encoder */ ); +#ifdef IGF_MEMORY_ALLOC_OPT +ivas_error IGF_Reconfig( + IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder */ + const int16_t igf, /* i : IGF on/off */ + const int16_t reset, /* i : reset flag */ + const int32_t brate, /* i : bitrate for configuration */ + const int16_t bwidth, /* i : signal bandwidth */ + const int16_t element_mode, /* i : IVAS element mode */ + const int16_t rf_mode /* i : flag to signal the RF mode */ +); +#endif + void IGFEncSetMode( const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ const int32_t total_brate, /* i : encoder total bitrate */ diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c old mode 100644 new mode 100755 index ac24d74bf2bf792fe34af0619f0c5fbd5186a946..9fb184e24743adb99bf926d9a00c0cb1ce45e8ec --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -1197,16 +1197,35 @@ void QuantizeTCXSpectrum( { noiseFillingBorder = st->hIGFEnc->infoStartLine; } +#ifndef IGF_MEMORY_ALLOC_OPT else { st->hIGFEnc->infoStopLine = noiseFillingBorder; } +#endif *pnoiseFillingBorder = noiseFillingBorder; +#ifdef IGF_MEMORY_ALLOC_OPT + if ( st->igf ) + { + for ( i = st->hIGFEnc->infoStopLine; i < max( L_frame, L_frameTCX ); i++ ) + { + spectrum[i] = 0.0f; + } + } + else + { + for ( i = noiseFillingBorder; i < max( L_frame, L_frameTCX ); i++ ) + { + spectrum[i] = 0.0f; + } + } +#else for ( i = st->hIGFEnc->infoStopLine; i < max( L_frame, L_frameTCX ); i++ ) { spectrum[i] = 0.0f; } +#endif /*-----------------------------------------------------------* * Quantization * diff --git a/lib_enc/core_enc_init.c b/lib_enc/core_enc_init.c old mode 100644 new mode 100755 diff --git a/lib_enc/core_enc_switch.c b/lib_enc/core_enc_switch.c old mode 100644 new mode 100755 diff --git a/lib_enc/ext_sig_ana.c b/lib_enc/ext_sig_ana.c old mode 100644 new mode 100755 index e76457e61c941f689e42359149bc27bfb3702a39..6fc061fa1b21023fbd44401c506bf49071506cf1 --- a/lib_enc/ext_sig_ana.c +++ b/lib_enc/ext_sig_ana.c @@ -200,7 +200,11 @@ void core_signal_analysis_high_bitrate( overlap_mode[2] = curr_overlap; /* Overlap between the current and the next frame */ } +#ifdef IGF_MEMORY_ALLOC_OPT + if ( st->igf && transform_type[0] != TCX_20 ) +#else if ( transform_type[0] != TCX_20 ) +#endif { IGFEncResetTCX10BitCounter( st->hIGFEnc ); } diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index 05faa0fac49dca4dd4c6f1e592818eefad4b4dd3..2b2e3d83565270df469449bb63a0d4276eb8b79e 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -2005,3 +2005,41 @@ void IGFSaveSpectrumForITF( return; } + + +#ifdef IGF_MEMORY_ALLOC_OPT +ivas_error IGF_Reconfig( + IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder */ + const int16_t igf, /* i : IGF on/off */ + const int16_t reset, /* i : reset flag */ + const int32_t brate, /* i : bitrate for configuration */ + const int16_t bwidth, /* i : signal bandwidth */ + const int16_t element_mode, /* i : IVAS element mode */ + const int16_t rf_mode /* i : flag to signal the RF mode */ +) +{ + ivas_error error; + + error = IVAS_ERR_OK; + + if ( igf && *hIGFEnc == NULL ) + { + if ( ( *hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hIGFEnc\n" ) ); + } + IGFEncSetMode( *hIGFEnc, brate, bwidth, element_mode, rf_mode ); + } + else if ( igf && reset ) + { + IGFEncSetMode( *hIGFEnc, brate, bwidth, element_mode, rf_mode ); + } + else if ( !igf && *hIGFEnc != NULL ) + { + free( *hIGFEnc ); + *hIGFEnc = NULL; + } + + return error; +} +#endif diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 3eb363324efe52396c1ab6ba7d2219ea19d6cc6a..c7b8ab3190c17c165afb04a90d12b0847911d13d 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -61,10 +61,17 @@ ivas_error init_encoder( const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ const ISM_MODE ism_mode /* i : ISM mode */ +#ifdef IGF_MEMORY_ALLOC_OPT + , + const int32_t element_brate +#endif ) { int16_t i; ivas_error error; +#ifdef IGF_MEMORY_ALLOC_OPT + int32_t igf_brate; +#endif error = IVAS_ERR_OK; @@ -742,7 +749,55 @@ ivas_error init_encoder( * IGF *-----------------------------------------------------------------*/ +#ifdef IGF_MEMORY_ALLOC_OPT + igf_brate = st->total_brate; + if ( st->element_mode == IVAS_SCE && ( st_ivas->hEncoderConfig->ivas_format == ISM_FORMAT || st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) ) + { + igf_brate = st->total_brate - ISM_NB_BITS_METADATA_NOMINAL * FRAMES_PER_SEC; + } + else if ( st->element_mode == IVAS_CPE_DFT || ( st->element_mode == IVAS_SCE && ( st_ivas->hEncoderConfig->ivas_format == SBA_FORMAT || + st_ivas->hEncoderConfig->ivas_format == SBA_ISM_FORMAT || + st_ivas->hEncoderConfig->ivas_format == MC_FORMAT || + st_ivas->hEncoderConfig->ivas_format == MASA_FORMAT ) ) ) + { + /* use nominal bitrates for DFT Stereo and (O)SBA, same as in stereo_dft_config()/ivas_spar_config() */ + if ( element_brate == IVAS_13k2 ) + { + igf_brate = ACELP_9k60; + } + else if ( element_brate == IVAS_16k4 ) + { + igf_brate = ACELP_13k20; + } + else if ( element_brate == IVAS_24k4 ) + { + igf_brate = ACELP_16k40; + } + else if ( element_brate == IVAS_32k ) + { + igf_brate = ACELP_24k40; + } + } + else if ( st->element_mode == IVAS_CPE_MDCT ) + { + igf_brate = element_brate; + } + + if ( st->codec_mode == MODE2 || st->element_mode > EVS_MONO ) + { + st->igf = getIgfPresent( st->element_mode, igf_brate, st->max_bwidth, st->rf_mode ); + } + else + { + st->igf = 0; + } +#endif + +#ifdef IGF_MEMORY_ALLOC_OPT + if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) && ( st->igf || st->element_mode == EVS_MONO ) ) +#else if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) ) +#endif { if ( ( st->hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) { @@ -760,6 +815,7 @@ ivas_error init_encoder( st->last_sr_core = st->last_L_frame * FRAMES_PER_SEC; +#ifndef IGF_MEMORY_ALLOC_OPT if ( st->codec_mode == MODE2 || st->element_mode > EVS_MONO ) { st->igf = getIgfPresent( st->element_mode, st->total_brate, st->bwidth, st->rf_mode ); @@ -768,6 +824,7 @@ ivas_error init_encoder( { st->igf = 0; } +#endif /* PLC encoder */ if ( st->element_mode == EVS_MONO ) diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 9a962855c748842d2b22ff8ff9807dac8fe10f83..d6424bf9597fb78a37cf7f12783927f6050e4009 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -448,6 +448,18 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[0]->hCoreCoder[n]->bwidth, st_ivas->hCPE[0]->hCoreCoder[n]->rf_mode ); +#ifdef IGF_MEMORY_ALLOC_OPT + if ( ( error = IGF_Reconfig( &st_ivas->hCPE[0]->hCoreCoder[n]->hIGFEnc, + st_ivas->hCPE[0]->hCoreCoder[n]->igf, + 1, + st_ivas->hCPE[0]->element_brate, + st_ivas->hCPE[0]->hCoreCoder[n]->bwidth, + st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, + st_ivas->hCPE[0]->hCoreCoder[n]->rf_mode ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( st_ivas->hCPE[0]->hCoreCoder[n]->igf ) { IGFEncSetMode( st_ivas->hCPE[0]->hCoreCoder[n]->hIGFEnc, @@ -456,6 +468,7 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->rf_mode ); } +#endif } } @@ -521,6 +534,18 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[0]->hCoreCoder[n]->bwidth, st_ivas->hCPE[0]->hCoreCoder[n]->rf_mode ); +#ifdef IGF_MEMORY_ALLOC_OPT + if ( ( error = IGF_Reconfig( &st_ivas->hCPE[0]->hCoreCoder[n]->hIGFEnc, + st_ivas->hCPE[0]->hCoreCoder[n]->igf, + 1, + st_ivas->hCPE[0]->element_brate, + st_ivas->hCPE[0]->hCoreCoder[n]->bwidth, + st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, + st_ivas->hCPE[0]->hCoreCoder[n]->rf_mode ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( st_ivas->hCPE[0]->hCoreCoder[n]->igf ) { IGFEncSetMode( st_ivas->hCPE[0]->hCoreCoder[n]->hIGFEnc, @@ -529,6 +554,7 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[0]->hCoreCoder[n]->element_mode, st_ivas->hCPE[0]->hCoreCoder[n]->rf_mode ); } +#endif /* reset mct_chan_mode */ st_ivas->hCPE[0]->hCoreCoder[n]->mct_chan_mode = MCT_CHAN_MODE_REGULAR; diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index cae911900082b45a6e3e4bf815fbf92f15311b04..e3362d816af3f9c8c014f4c14d41b9d91718ec99 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -520,6 +520,22 @@ ivas_error ivas_cpe_enc( * Core codec configuration *----------------------------------------------------------------*/ +#ifdef IGF_MEMORY_ALLOC_OPT + /* IGF reconfiguration */ + for ( n = 0; n < n_CoreChannels; n++ ) + { + if ( ( hCPE->last_element_brate != hCPE->element_brate || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) ) + { + int16_t igf; + igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->rf_mode ); + if ( ( error = IGF_Reconfig( &sts[n]->hIGFEnc, igf, 0, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } +#endif + if ( hCPE->element_mode == IVAS_CPE_MDCT && st_ivas->hMCT == NULL ) { /* set coded BW for MDCT stereo */ @@ -901,7 +917,11 @@ ivas_error create_cpe_enc( st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; if ( ( error = init_encoder( st, st_ivas, n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, +#ifdef IGF_MEMORY_ALLOC_OPT + ISM_MODE_NONE, hCPE->element_brate ) ) != IVAS_ERR_OK ) +#else ISM_MODE_NONE ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 35878e58489cfecc09fa579ff602f333e7f0abce..eeb7689868e063ccb9b511a38990a1a05d5cdd38 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -308,6 +308,18 @@ ivas_error ivas_ism_enc( /*----------------------------------------------------------------* * Core codec configuration *----------------------------------------------------------------*/ +#ifdef IGF_MEMORY_ALLOC_OPT + /* IGF reconfiguration */ + if ( hSCE->last_element_brate != hSCE->element_brate || st->last_bwidth != st->bwidth ) + { + int16_t igf; + igf = getIgfPresent( st->element_mode, st->bits_frame_nominal * FRAMES_PER_SEC, st->max_bwidth, st->rf_mode ); + if ( ( error = IGF_Reconfig( &st->hIGFEnc, igf, 0, st->bits_frame_nominal * FRAMES_PER_SEC, st->max_bwidth, st->element_mode, st->rf_mode ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif /* set ACELP@12k8 / ACELP@16k flag for flexible ACELP core */ if ( st->core_brate == SID_2k40 || st->core_brate == FRAME_NO_DATA ) @@ -345,6 +357,10 @@ ivas_error ivas_ism_enc( /* update input samples buffer */ mvr2r( st->input, st->old_input_signal, input_frame ); +#ifdef IGF_MEMORY_ALLOC_OPT + hSCE->last_element_brate = hSCE->element_brate; +#endif + /* Store previous attack detection flag */ st->hTranDet->transientDetector.prev_bIsAttackPresent = st->hTranDet->transientDetector.bIsAttackPresent; diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c old mode 100644 new mode 100755 index a328833a88ed1937e7fc3c102c536e2892b47a05..46c2382e428b7f5464807c98aec13e8c739d1a43 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -231,7 +231,11 @@ ivas_error ivas_mct_enc( for ( n = 0; n < (int16_t) ( hMCT->nchan_out_woLFE * 0.5 ); n++ ) { +#ifdef IGF_MEMORY_ALLOC_OPT + initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->igf ? st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid : NULL, 0 ); +#else initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid, 0 ); +#endif } } @@ -394,7 +398,11 @@ ivas_error create_mct_enc( #ifdef DEBUGGING hMCT->hBlockData[n]->hStereoMdct->mdct_stereo_mode_cmdl = SMDCT_MS_DECISION; #endif +#ifdef IGF_MEMORY_ALLOC_OPT + initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, st_ivas->hEncoderConfig->max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->igf ? st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid : NULL, 1 ); +#else initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, st_ivas->hEncoderConfig->max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid, 1 ); +#endif } for ( ; n < MCT_MAX_BLOCKS; n++ ) @@ -430,6 +438,11 @@ ivas_error mct_enc_reconfigure( int16_t n, cpe_id, max_blocks; int32_t ivas_total_brate, cp_bitrate; IVAS_FORMAT ivas_format; +#ifdef IGF_MEMORY_ALLOC_OPT + ivas_error error; + + error = IVAS_ERR_OK; +#endif hMCT = st_ivas->hMCT; ivas_format = st_ivas->hEncoderConfig->ivas_format; @@ -509,10 +522,18 @@ ivas_error mct_enc_reconfigure( { st->bits_frame_nominal = (int16_t) ( st_ivas->hCPE[cpe_id]->element_brate / FRAMES_PER_SEC ); st->igf = getIgfPresent( st->element_mode, st->bits_frame_nominal * FRAMES_PER_SEC, st->bwidth, st->rf_mode ); + +#ifdef IGF_MEMORY_ALLOC_OPT + if ( ( error = IGF_Reconfig( &st->hIGFEnc, st->igf, 1, st_ivas->hCPE[cpe_id]->element_brate, st->bwidth, st->element_mode, st->rf_mode ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( st->igf ) { IGFEncSetMode( st->hIGFEnc, st_ivas->hCPE[cpe_id]->element_brate, st->bwidth, st->element_mode, st->rf_mode ); } +#endif } } } @@ -555,7 +576,11 @@ ivas_error mct_enc_reconfigure( #ifdef DEBUGGING hMCT->hBlockData[n]->hStereoMdct->mdct_stereo_mode_cmdl = SMDCT_MS_DECISION; #endif +#ifdef IGF_MEMORY_ALLOC_OPT + initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, st_ivas->hEncoderConfig->max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->igf ? st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid : NULL, mem_init ); +#else initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, st_ivas->hEncoderConfig->max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid, mem_init ); +#endif } for ( ; n < MCT_MAX_BLOCKS; n++ ) @@ -579,7 +604,12 @@ ivas_error mct_enc_reconfigure( *-----------------------------------------------------------------*/ set_mct_enc_params( hMCT, ivas_total_brate, ivas_format, b_nchan_change ); + +#ifdef IGF_MEMORY_ALLOC_OPT + return error; +#else return IVAS_ERR_OK; +#endif } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index f8c7afa6caefbe5817a45680512c9818088db526..e297d747a8397eebcd1067ba263a8d2c62aa880a 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -230,6 +230,19 @@ ivas_error ivas_sce_enc( * Core codec configuration *----------------------------------------------------------------*/ +#ifdef IGF_MEMORY_ALLOC_OPT + /* IGF reconfiguration */ + if ( hSCE->last_element_brate != hSCE->element_brate || st->last_bwidth != st->bwidth ) + { + int16_t igf; + igf = getIgfPresent( st->element_mode, st->bits_frame_nominal * FRAMES_PER_SEC, st->max_bwidth, st->rf_mode ); + if ( ( error = IGF_Reconfig( &st->hIGFEnc, igf, 0, st->bits_frame_nominal * FRAMES_PER_SEC, st->max_bwidth, st->element_mode, st->rf_mode ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif + /* set ACELP@12k8 / ACELP@16k flag for flexible ACELP core */ if ( st->core_brate == SID_2k40 || st->core_brate == FRAME_NO_DATA ) { @@ -358,7 +371,12 @@ ivas_error create_sce_enc( st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; - if ( ( error = init_encoder( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode +#ifdef IGF_MEMORY_ALLOC_OPT + , + hSCE->element_brate +#endif + ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 476a1f39c36c226f5e9e7ccf22e0a70460afc44f..4b229f64460f29c8a4acf24e3a57406c42d799f8 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -224,7 +224,12 @@ ivas_error ivas_spar_enc_open( hSpar->hCoreCoderVAD->total_brate = hEncoderConfig->ivas_total_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ hSpar->hCoreCoderVAD->mct_chan_mode = MCT_CHAN_MODE_IGNORE; - if ( ( error = init_encoder( hSpar->hCoreCoderVAD, st_ivas, 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( hSpar->hCoreCoderVAD, st_ivas, 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode +#ifdef IGF_MEMORY_ALLOC_OPT + , + hSpar->hCoreCoderVAD->total_brate +#endif + ) ) != IVAS_ERR_OK ) { return error; }