Loading lib_com/options.h +0 −3 Original line number Diff line number Diff line Loading @@ -163,11 +163,8 @@ #define LIB_DEC_REVISION /* VA: cleaning and simplification of lib_dec.c */ #if 1 #define JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ #define OPT_TC // separate heap memory from hTcBuffer->tcBuffer[] //#define FIX_OSBA_BR_SW_FLUSH // this is non-BE bugfix #define REMOVE_APA_BUFFER // remove hIvasDec->apaExecBuffer[] #define MY_DEBUG #endif /* #################### End BE switches ################################## */ Loading lib_dec/ivas_jbm_dec.c +1 −29 Original line number Diff line number Diff line Loading @@ -1481,7 +1481,7 @@ ivas_error ivas_jbm_dec_flush_renderer( { int16_t ch_idx; #ifdef OPT_TC #ifdef REMOVE_APA_BUFFER /* render available full slots (with new lower granularity) */ #ifdef FIX_OSBA_BR_SW_FLUSH for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) Loading Loading @@ -2133,11 +2133,7 @@ static void ivas_jbm_dec_copy_tc( for ( ch = 0; ch < n_ch_full_copy; ch++ ) { set_zero( hTcBuffer->tc[ch], hTcBuffer->n_samples_discard ); #ifdef OPT_TC mvr2r( st_ivas->hTcBuffer->tc_buffer_old[ch], st_ivas->hTcBuffer->tc[ch] + st_ivas->hTcBuffer->n_samples_discard, n_samples_still_available ); #else mvr2r( hTcBuffer->tc[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc[ch] + hTcBuffer->n_samples_discard, n_samples_still_available ); #endif for ( m = 0; m < nSamplesForRendering; m++ ) { hTcBuffer->tc[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * st_ivas->hTcBuffer->nchan_transport_jbm + ch]; Loading @@ -2148,20 +2144,12 @@ static void ivas_jbm_dec_copy_tc( { for ( ; ch < hTcBuffer->nchan_transport_jbm; ch++ ) { #ifdef OPT_TC mvr2r( st_ivas->hTcBuffer->tc_buffer_old[ch], tc_digest_f[ch], n_samples_still_available ); #else mvr2r( hTcBuffer->tc[ch], tc_digest_f[ch], n_samples_still_available ); #endif for ( m = 0; m < nSamplesForRendering; m++ ) { tc_digest_f[ch][n_samples_still_available + m] = data[m * st_ivas->hTcBuffer->nchan_transport_jbm + ch]; } #ifdef OPT_TC mvr2r( tc_digest_f[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc_buffer_old[ch], *nSamplesResidual ); #else mvr2r( tc_digest_f[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc[ch], *nSamplesResidual ); #endif } } Loading Loading @@ -2614,22 +2602,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { hTcBuffer->tc[ch_idx] = NULL; } #ifdef OPT_TC /* memory buffer for TC audio samples not rendered in the previous frame */ for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) { if ( ( hTcBuffer->tc_buffer_old[ch_idx] = (float *) malloc( n_samp_residual * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); } set_zero( hTcBuffer->tc_buffer_old[ch_idx], n_samp_residual ); } for ( ; ch_idx < MAX_TRANSPORT_CHANNELS; ch_idx++ ) { hTcBuffer->tc_buffer_old[ch_idx] = NULL; } #endif } else { Loading lib_dec/ivas_stat_dec.h +2 −2 Original line number Diff line number Diff line Loading @@ -944,11 +944,11 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { #ifdef OPT_TC #ifdef REMOVE_APA_BUFFER float *tc_buffer_old[MAX_TRANSPORT_CHANNELS]; /* TC audio samples not rendered in the previous frame */ #endif float *tc_buffer; /* the buffer itself */ #ifdef OPT_TC #ifdef REMOVE_APA_BUFFER float *tc[MAX_TRANSPORT_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ #else float *tc[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc */ // VE2SB: TBV Loading lib_dec/lib_dec.c +0 −13 Original line number Diff line number Diff line Loading @@ -1196,13 +1196,7 @@ ivas_error IVAS_DEC_ReadFormat( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } #ifdef MY_DEBUG for ( int16_t ch = 0; ch < min( hIvasDec->st_ivas->hTcBuffer->nchan_transport_jbm, hIvasDec->st_ivas->hTcBuffer->nchan_buffer_full ); ch++ ) { set_f( hIvasDec->st_ivas->hTcBuffer->tc[ch], 0, hIvasDec->nSamplesFrame + hIvasDec->nSamplesFrame / 2 ); } #endif /* when granularity goes down, render what still fits in the new granularity */ if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { Loading Loading @@ -1366,13 +1360,6 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } #endif #ifdef MY_DEBUG for ( int16_t ch = 0; ch < min( hIvasDec->st_ivas->hTcBuffer->nchan_transport_jbm, hIvasDec->st_ivas->hTcBuffer->nchan_buffer_full ); ch++ ) { set_f( st_ivas->hTcBuffer->tc[ch], 0, hIvasDec->nSamplesFrame + hIvasDec->nSamplesFrame / 2 ); } #endif /*-----------------------------------------------------------------* * JBM *-----------------------------------------------------------------*/ Loading Loading
lib_com/options.h +0 −3 Original line number Diff line number Diff line Loading @@ -163,11 +163,8 @@ #define LIB_DEC_REVISION /* VA: cleaning and simplification of lib_dec.c */ #if 1 #define JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ #define OPT_TC // separate heap memory from hTcBuffer->tcBuffer[] //#define FIX_OSBA_BR_SW_FLUSH // this is non-BE bugfix #define REMOVE_APA_BUFFER // remove hIvasDec->apaExecBuffer[] #define MY_DEBUG #endif /* #################### End BE switches ################################## */ Loading
lib_dec/ivas_jbm_dec.c +1 −29 Original line number Diff line number Diff line Loading @@ -1481,7 +1481,7 @@ ivas_error ivas_jbm_dec_flush_renderer( { int16_t ch_idx; #ifdef OPT_TC #ifdef REMOVE_APA_BUFFER /* render available full slots (with new lower granularity) */ #ifdef FIX_OSBA_BR_SW_FLUSH for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) Loading Loading @@ -2133,11 +2133,7 @@ static void ivas_jbm_dec_copy_tc( for ( ch = 0; ch < n_ch_full_copy; ch++ ) { set_zero( hTcBuffer->tc[ch], hTcBuffer->n_samples_discard ); #ifdef OPT_TC mvr2r( st_ivas->hTcBuffer->tc_buffer_old[ch], st_ivas->hTcBuffer->tc[ch] + st_ivas->hTcBuffer->n_samples_discard, n_samples_still_available ); #else mvr2r( hTcBuffer->tc[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc[ch] + hTcBuffer->n_samples_discard, n_samples_still_available ); #endif for ( m = 0; m < nSamplesForRendering; m++ ) { hTcBuffer->tc[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * st_ivas->hTcBuffer->nchan_transport_jbm + ch]; Loading @@ -2148,20 +2144,12 @@ static void ivas_jbm_dec_copy_tc( { for ( ; ch < hTcBuffer->nchan_transport_jbm; ch++ ) { #ifdef OPT_TC mvr2r( st_ivas->hTcBuffer->tc_buffer_old[ch], tc_digest_f[ch], n_samples_still_available ); #else mvr2r( hTcBuffer->tc[ch], tc_digest_f[ch], n_samples_still_available ); #endif for ( m = 0; m < nSamplesForRendering; m++ ) { tc_digest_f[ch][n_samples_still_available + m] = data[m * st_ivas->hTcBuffer->nchan_transport_jbm + ch]; } #ifdef OPT_TC mvr2r( tc_digest_f[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc_buffer_old[ch], *nSamplesResidual ); #else mvr2r( tc_digest_f[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc[ch], *nSamplesResidual ); #endif } } Loading Loading @@ -2614,22 +2602,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { hTcBuffer->tc[ch_idx] = NULL; } #ifdef OPT_TC /* memory buffer for TC audio samples not rendered in the previous frame */ for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) { if ( ( hTcBuffer->tc_buffer_old[ch_idx] = (float *) malloc( n_samp_residual * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); } set_zero( hTcBuffer->tc_buffer_old[ch_idx], n_samp_residual ); } for ( ; ch_idx < MAX_TRANSPORT_CHANNELS; ch_idx++ ) { hTcBuffer->tc_buffer_old[ch_idx] = NULL; } #endif } else { Loading
lib_dec/ivas_stat_dec.h +2 −2 Original line number Diff line number Diff line Loading @@ -944,11 +944,11 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { #ifdef OPT_TC #ifdef REMOVE_APA_BUFFER float *tc_buffer_old[MAX_TRANSPORT_CHANNELS]; /* TC audio samples not rendered in the previous frame */ #endif float *tc_buffer; /* the buffer itself */ #ifdef OPT_TC #ifdef REMOVE_APA_BUFFER float *tc[MAX_TRANSPORT_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ #else float *tc[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc */ // VE2SB: TBV Loading
lib_dec/lib_dec.c +0 −13 Original line number Diff line number Diff line Loading @@ -1196,13 +1196,7 @@ ivas_error IVAS_DEC_ReadFormat( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } #ifdef MY_DEBUG for ( int16_t ch = 0; ch < min( hIvasDec->st_ivas->hTcBuffer->nchan_transport_jbm, hIvasDec->st_ivas->hTcBuffer->nchan_buffer_full ); ch++ ) { set_f( hIvasDec->st_ivas->hTcBuffer->tc[ch], 0, hIvasDec->nSamplesFrame + hIvasDec->nSamplesFrame / 2 ); } #endif /* when granularity goes down, render what still fits in the new granularity */ if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { Loading Loading @@ -1366,13 +1360,6 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } #endif #ifdef MY_DEBUG for ( int16_t ch = 0; ch < min( hIvasDec->st_ivas->hTcBuffer->nchan_transport_jbm, hIvasDec->st_ivas->hTcBuffer->nchan_buffer_full ); ch++ ) { set_f( st_ivas->hTcBuffer->tc[ch], 0, hIvasDec->nSamplesFrame + hIvasDec->nSamplesFrame / 2 ); } #endif /*-----------------------------------------------------------------* * JBM *-----------------------------------------------------------------*/ Loading