Loading lib_dec/ivas_jbm_dec.c +16 −17 Original line number Diff line number Diff line Loading @@ -2383,9 +2383,8 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( ) { #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP float tc_buffer_mem[CPE_CHANNELS * MAX_JBM_L_FRAME48k]; int16_t num_tc_buffer_mem; AUDIO_CONFIG output_config; int16_t ch_idx, num_tc_buffer_mem, len_tc_buffer_mem; float tc_buffer_mem[MAX_INTERN_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES - 1]; #endif #ifdef JBM_MEMORY_OPT ivas_error error; Loading @@ -2396,15 +2395,15 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP output_config = st_ivas->hDecoderConfig->output_config; /* save channels of the TC buffer from the previous frame */ num_tc_buffer_mem = min( hTcBuffer->nchan_transport_internal, nchan_transport_internal ); len_tc_buffer_mem = min( hTcBuffer->n_samples_granularity - 1, n_samples_granularity - 1 ); num_tc_buffer_mem = 0; if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) for ( ch_idx = 0; ch_idx < num_tc_buffer_mem; ch_idx++ ) { /* keep CPE_CHANNELS channels of the TC buffer for smooth transition for swithing within 1 CPE and TD decorr. on and off */ num_tc_buffer_mem = min( hTcBuffer->nchan_buffer_full, CPE_CHANNELS ); mvr2r( hTcBuffer->tc_buffer, tc_buffer_mem, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); mvr2r( hTcBuffer->tc_buffer_old[ch_idx] + hTcBuffer->n_samples_granularity - 1 - len_tc_buffer_mem, tc_buffer_mem[ch_idx], len_tc_buffer_mem ); } #endif Loading Loading @@ -2464,6 +2463,14 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { return error; } #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* propagate channels of the TC buffer from the previous frame */ for ( ch_idx = 0; ch_idx < num_tc_buffer_mem; ch_idx++ ) { mvr2r( tc_buffer_mem[ch_idx], hTcBuffer->tc_buffer_old[ch_idx] + hTcBuffer->n_samples_granularity - 1 - len_tc_buffer_mem, len_tc_buffer_mem ); } #endif #else /* realloc buffers */ if ( hTcBuffer->tc_buffer != NULL ) Loading Loading @@ -2526,14 +2533,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( } #endif #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP if ( num_tc_buffer_mem > 0 ) { /* propagate CPE_CHANNELS channels of the TC buffer */ mvr2r( tc_buffer_mem, hTcBuffer->tc_buffer, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); } #endif return IVAS_ERR_OK; } Loading Loading
lib_dec/ivas_jbm_dec.c +16 −17 Original line number Diff line number Diff line Loading @@ -2383,9 +2383,8 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( ) { #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP float tc_buffer_mem[CPE_CHANNELS * MAX_JBM_L_FRAME48k]; int16_t num_tc_buffer_mem; AUDIO_CONFIG output_config; int16_t ch_idx, num_tc_buffer_mem, len_tc_buffer_mem; float tc_buffer_mem[MAX_INTERN_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES - 1]; #endif #ifdef JBM_MEMORY_OPT ivas_error error; Loading @@ -2396,15 +2395,15 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP output_config = st_ivas->hDecoderConfig->output_config; /* save channels of the TC buffer from the previous frame */ num_tc_buffer_mem = min( hTcBuffer->nchan_transport_internal, nchan_transport_internal ); len_tc_buffer_mem = min( hTcBuffer->n_samples_granularity - 1, n_samples_granularity - 1 ); num_tc_buffer_mem = 0; if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) for ( ch_idx = 0; ch_idx < num_tc_buffer_mem; ch_idx++ ) { /* keep CPE_CHANNELS channels of the TC buffer for smooth transition for swithing within 1 CPE and TD decorr. on and off */ num_tc_buffer_mem = min( hTcBuffer->nchan_buffer_full, CPE_CHANNELS ); mvr2r( hTcBuffer->tc_buffer, tc_buffer_mem, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); mvr2r( hTcBuffer->tc_buffer_old[ch_idx] + hTcBuffer->n_samples_granularity - 1 - len_tc_buffer_mem, tc_buffer_mem[ch_idx], len_tc_buffer_mem ); } #endif Loading Loading @@ -2464,6 +2463,14 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { return error; } #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* propagate channels of the TC buffer from the previous frame */ for ( ch_idx = 0; ch_idx < num_tc_buffer_mem; ch_idx++ ) { mvr2r( tc_buffer_mem[ch_idx], hTcBuffer->tc_buffer_old[ch_idx] + hTcBuffer->n_samples_granularity - 1 - len_tc_buffer_mem, len_tc_buffer_mem ); } #endif #else /* realloc buffers */ if ( hTcBuffer->tc_buffer != NULL ) Loading Loading @@ -2526,14 +2533,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( } #endif #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP if ( num_tc_buffer_mem > 0 ) { /* propagate CPE_CHANNELS channels of the TC buffer */ mvr2r( tc_buffer_mem, hTcBuffer->tc_buffer, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); } #endif return IVAS_ERR_OK; } Loading