Commit 73e44439 authored by vaclav's avatar vaclav
Browse files

Merge branch 'basop-2296-ivas_jbm_dec_tc-remove-unused-code' into 'main'

Resolve "ivas_jbm_dec_tc(): remove unused code"

See merge request !2472
parents ede5ad42 c7d46f4d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3567,8 +3567,11 @@ int16_t ivas_sba_remapTCs(
void ivas_sba_dirac_stereo_dec(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    float *output[CPE_CHANNELS],                                /* o  : output synthesis signal                 */
    const int16_t output_frame,                                 /* i  : output frame length per channel         */
    const int16_t output_frame                                  /* i  : output frame length per channel         */
#ifndef REMOVE_UNUSED_CODE_IVAS_DEC
    ,
    const int16_t mcmasa                                        /* i  : McMASA flag                             */
#endif
);

void ivas_sba_dirac_stereo_config(
+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@
#define FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING          /* FhG: fix oob indexing */
#define FIX_1494_SET_SPLITBFI_UNUSED                    /* Dolby: Fix issue 1494, remove unused function setting BFI flag in ISAR renderer */
#define FIX_1479_MSAN_SPAR_UNINITIALIZED_VALUE          /* Dolby: Fix for issue 1479, MSAN error due to uninitialized value in SPAR */
#define REMOVE_UNUSED_CODE_IVAS_DEC                     /* VA: remove unused code in ivas_jbm_dec_tc_fx() */

/* #################### End BE switches ################################## */

+16 −1
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ ivas_error ivas_dec(
     * Decoding + pre-rendering
     *----------------------------------------------------------------*/

#ifndef REMOVE_UNUSED_CODE_IVAS_DEC
    if ( st_ivas->bfi && st_ivas->ini_frame == 0 )
    {
        /* zero output when first frame(s) is lost */
@@ -121,7 +122,9 @@ ivas_error ivas_dec(
        st_ivas->hSCE[0] = NULL;
#endif
    }
    else if ( st_ivas->ivas_format == STEREO_FORMAT )
    else
#endif
        if ( st_ivas->ivas_format == STEREO_FORMAT )
    {
        st_ivas->hCPE[0]->element_brate = ivas_total_brate;
        if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, 0 ) ) != IVAS_ERR_OK )
@@ -267,7 +270,11 @@ ivas_error ivas_dec(
                ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate ) );
            }

#ifdef REMOVE_UNUSED_CODE_IVAS_DEC
            ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame );
#else
            ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame, st_ivas->ivas_format == MC_FORMAT );
#endif
        }
        else if ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ( ivas_total_brate > IVAS_SID_5k2 || ( ivas_total_brate <= IVAS_SID_5k2 && st_ivas->nCPE > 0 && st_ivas->hCPE[0]->nchan_out == 1 ) ) )
        {
@@ -469,7 +476,11 @@ ivas_error ivas_dec(

            ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) );

#ifdef REMOVE_UNUSED_CODE_IVAS_DEC
            ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame );
#else
            ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame, 0 );
#endif
        }

        /* HP filtering */
@@ -695,7 +706,11 @@ ivas_error ivas_dec(

            if ( st_ivas->sba_dirac_stereo_flag ) /* use the flag to trigger the DFT upmix */
            {
#ifdef REMOVE_UNUSED_CODE_IVAS_DEC
                ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame );
#else
                ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame, 1 );
#endif
            }

            /* HP filtering */
+22 −2
Original line number Diff line number Diff line
@@ -827,13 +827,19 @@ void ivas_sba_dirac_stereo_smooth_parameters(
void ivas_sba_dirac_stereo_dec(
    Decoder_Struct *st_ivas,     /* i/o: IVAS decoder structure              */
    float *output[CPE_CHANNELS], /* i/o: output synthesis signal             */
    const int16_t output_frame,  /* i  : output frame length per channel     */
    const int16_t output_frame   /* i  : output frame length per channel     */
#ifndef REMOVE_UNUSED_CODE_IVAS_DEC
    ,
    const int16_t mcmasa /* i  : McMASA flag                         */
#endif
)
{
    int16_t dtx_flag, fd_cng_flag;
    int16_t sba_mono_flag;
    int16_t memOffset;
#ifdef REMOVE_UNUSED_CODE_IVAS_DEC
    int32_t output_Fs;
#endif
    float tmp_buf[NS2SA( 48000, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS )];
    float tmp_synth[L_FRAME16k];
    float hb_gain[NB_DIV];
@@ -842,6 +848,11 @@ void ivas_sba_dirac_stereo_dec(
    SCE_DEC_HANDLE hSCE;
    CPE_DEC_HANDLE hCPE;
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft;
#ifdef REMOVE_UNUSED_CODE_IVAS_DEC
    int16_t mcmasa = st_ivas->ivas_format == MC_FORMAT;

    output_Fs = st_ivas->hDecoderConfig->output_Fs;
#endif

    hSCE = st_ivas->hSCE[0];
    hCPE = st_ivas->hCPE[0];
@@ -862,7 +873,11 @@ void ivas_sba_dirac_stereo_dec(
    memOffset = NS2SA( output_frame * FRAMES_PER_SEC, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS );

    ivas_sba_dirac_stereo_config( hStereoDft->hConfig );
#ifdef REMOVE_UNUSED_CODE_IVAS_DEC
    hStereoDft->nbands = ivas_sba_dirac_stereo_band_config( hStereoDft->band_limits, output_Fs, hStereoDft->NFFT, ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !mcmasa ) );
#else
    hStereoDft->nbands = ivas_sba_dirac_stereo_band_config( hStereoDft->band_limits, st_ivas->hDecoderConfig->output_Fs, hStereoDft->NFFT, ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !mcmasa ) );
#endif
    stereo_dft_dec_update( hStereoDft, output_frame, 1 /*st_ivas->sba_dirac_stereo_flag*/ );
    if ( st_ivas->nchan_transport > 1 )
    {
@@ -894,8 +909,13 @@ void ivas_sba_dirac_stereo_dec(
    }

    /* DFT Stereo upmix */
#ifdef REMOVE_UNUSED_CODE_IVAS_DEC
    stereo_dft_dec( hStereoDft, hCPE->hCoreCoder[0], DFT, NULL, NULL, 1 /*st_ivas->sba_dirac_stereo_flag*/, sba_mono_flag, ( st_ivas->hSpar != NULL && !mcmasa ) ? st_ivas->hSpar->hMdDec : NULL, ( st_ivas->hSpar != NULL && !mcmasa ) ? st_ivas->hSpar->hFbMixer->cross_fade_start_offset : 0,
                    output_Fs, st_ivas->nchan_transport, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) );
#else
    stereo_dft_dec( hStereoDft, hCPE->hCoreCoder[0], DFT, NULL, NULL, 1 /*st_ivas->sba_dirac_stereo_flag*/, sba_mono_flag, ( st_ivas->hSpar != NULL && !mcmasa ) ? st_ivas->hSpar->hMdDec : NULL, ( st_ivas->hSpar != NULL && !mcmasa ) ? st_ivas->hSpar->hFbMixer->cross_fade_start_offset : 0,
                    st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_transport, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) );
#endif

    /* DFT synthesis */
    stereo_dft_dec_synthesize( hCPE, DFT, 0, output[0], output_frame );