Commit ff513693 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into 1923-basop-PortFlpMr1928

parents 0a3753f6 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;
+4 −0
Original line number Diff line number Diff line
@@ -3422,7 +3422,11 @@ void mctStereoIGF_enc_fx(
    Encoder_State **sts,                                 /* i/o: encoder state structure                    */
    Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2],       /* i  : MDCT spectrum for ITF                      */
    Word16 q_origSpec,                                   /* i  : Q for MDCT spectrum                        */
#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC
    Word32 *powerSpec[MCT_MAX_CHANNELS],                 /* i/o: MDCT^2 + MDST^2 spectrum,or estimate       */
#else
    Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k],   /* i/o: MDCT^2 + MDST^2 spectrum,or estimate       */
#endif
    Word16 q_powerSpec[MCT_MAX_CHANNELS],                /* i  : Q for powSpec_fx                           */
    Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i  : same as powerSpec_fx but for inverse spect.*/
    Word16 *q_powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV],  /* i  : Q for powSpecMsInv_fx                      */
+3 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@
#define FIX_1138_SBA_EXT_ERROR_PRINTOUT                 /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */
#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART             /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC      /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/
#define NONBE_FIX_1052_SBA_EXT_FIX                      /* VA: SBA external output support fix - do not overwrite "output_config" parameter */
#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING       /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */
#define FIX_1099_JBM_MD_HANDLE_ALLOC                    /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */
@@ -126,8 +127,10 @@
#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() */
#define FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX          /* VA: issue 1249: remove obsolete code around ALLRAD decoder matrix */


/* #################### End BASOP porting switches ############################ */

#endif
+2 −1
Original line number Diff line number Diff line
@@ -2710,6 +2710,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*/
@@ -2718,7 +2719,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++ )
            {
Loading