Commit fb1a4375 authored by vaclav's avatar vaclav
Browse files

remove OPT_TC and MY_DEBUG

parent ef201687
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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 ################################## */
+1 −29
Original line number Diff line number Diff line
@@ -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++ )
@@ -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];
@@ -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
        }
    }

@@ -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
        {
+2 −2
Original line number Diff line number Diff line
@@ -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
+0 −13
Original line number Diff line number Diff line
@@ -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 )
            {
@@ -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
         *-----------------------------------------------------------------*/