Commit ed7a2417 authored by multrus's avatar multrus
Browse files

Merge branch 'main' into 1662_basop_portFlpMr1683

parents 3dc8deea 40a7d9f4
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -215,7 +215,9 @@ typedef enum

typedef enum
{
#ifndef FIX_1101_CLEANING_JBM_CALL
    TC_BUFFER_MODE_NONE = 0,
#endif
    TC_BUFFER_MODE_RENDERER,
    TC_BUFFER_MODE_BUFFER
} TC_BUFFER_MODE;
+1 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@
#define NONBE_SVD_OPTIMIZATION 
#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR       /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_1131_ACELP_OOB                            /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */
#define FIX_1101_CLEANING_JBM_CALL                      /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */


/* #################### End BASOP porting switches ############################ */
+2 −1
Original line number Diff line number Diff line
@@ -2708,6 +2708,7 @@ ivas_error ivas_init_decoder_fx(
        }
    }

#ifndef FIX_1101_CLEANING_JBM_CALL
    IF( st_ivas->hTcBuffer == NULL )
    {
        /* we need the handle anyway, but without the buffer*/
@@ -2716,7 +2717,7 @@ ivas_error ivas_init_decoder_fx(
            return error;
        }
    }

#endif
    test();
#ifdef FIX_1099_JBM_MD_HANDLE_ALLOC
    test();
+31 −7
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ ivas_error ivas_jbm_dec_tc_fx(
    Word32 *data_fx          /*Q11*/
)
{
    Word16 n, output_frame, nchan_out, i, ii;
    Word16 ch, n, output_frame, nchan_out, i, ii;
    Decoder_State *st;                           /* used for bitstream handling */
    Word32 *p_output_fx[MAX_TRANSPORT_CHANNELS]; /* buffer for output synthesis */
    Word16 nchan_remapped;
@@ -122,6 +122,7 @@ ivas_error ivas_jbm_dec_tc_fx(
        }
    }

#ifndef FIX_1101_CLEANING_JBM_CALL
    IF( st_ivas->hDecoderConfig->Opt_tsm == 0 )
    {
        FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
@@ -132,10 +133,7 @@ ivas_error ivas_jbm_dec_tc_fx(
        st_ivas->hTcBuffer->no_channels = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
        move16();
    }

    Word16 ch;


#endif
    /*----------------------------------------------------------------*
     * Decoding + pre-rendering
     *----------------------------------------------------------------*/
@@ -1592,6 +1590,16 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx(
        p_data_f_fx[n] = &data_f_fx[n][0];
    }

#ifdef FIX_1101_CLEANING_JBM_CALL
    IF( st_ivas->hDecoderConfig->Opt_tsm == 0 )
    {
        FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
        {
            st_ivas->hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; /* note: buffers needed in the TD decorellator */
        }
    }

#endif
    IF( st_ivas->hDecoderConfig->Opt_tsm )
    {
        ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data_fx, p_data_f_fx, 11 );
@@ -3611,6 +3619,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx(
    set16_fx( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS );
    set16_fx( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES );

#ifndef FIX_1101_CLEANING_JBM_CALL
    IF( EQ_16( hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_NONE ) )
    {
        hTcBuffer->tc_buffer_fx = NULL;
@@ -3621,6 +3630,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx(
        }
    }
    ELSE
#endif
    {
        Word16 n_samp_full, n_samp_residual;
        Word32 offset;
@@ -4092,7 +4102,9 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
)
{
    Word16 Q_tc;
#ifndef FIX_1101_CLEANING_JBM_CALL
    Word16 n_ch_full_copy;
#endif
    Word16 n_ch_cldfb;
    Word16 ch_idx;
    DECODER_TC_BUFFER_HANDLE hTcBuffer;
@@ -4102,11 +4114,19 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
    hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered;
    move16();
    move16();
#ifndef FIX_1101_CLEANING_JBM_CALL
    n_ch_full_copy = s_min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full );
#endif
    n_ch_cldfb = sub( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full );

    Q_tc = 11; /*tc buffer is at Q11*/
    move16();

#ifdef FIX_1101_CLEANING_JBM_CALL
#ifdef DEBUGGING
    assert( st_ivas->hDecoderConfig->Opt_tsm == 0 );
#endif
#else
    /* copy full tcs*/
    IF( st_ivas->hDecoderConfig->Opt_tsm )
    {
@@ -4117,7 +4137,7 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
    }
    ch_idx = 0;
    move16();

#endif
    /* CLDFB ana for ParamMC/ParamISM */
    IF( n_ch_cldfb > 0 )
    {
@@ -4148,9 +4168,13 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
            num_freq_bands = st_ivas->hParamMC->num_freq_bands;
            move16();
        }
        /* CLDFB Analysis*/

        /* CLDFB Analysis*/
#ifdef FIX_1101_CLEANING_JBM_CALL
        FOR( ( ch_idx = 0, cldfb_ch = 0 ); cldfb_ch < n_ch_cldfb; ( cldfb_ch++, ch_idx++ ) )
#else
        FOR( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; ( cldfb_ch++, ch_idx++ ) )
#endif
        {
            FOR( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ )
            {