Commit 988cc904 authored by Shikha Shetgeri's avatar Shikha Shetgeri
Browse files

Added flag for bitrate 512kbps and FOA out config check

parent a2bcdd0a
Loading
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -589,14 +589,11 @@ void ivas_fb_mixer_update_prior_input(
)
{
    int16_t i;

    for ( i = 0; i <
#ifdef HODIRAC
                 nchan_fb_in;
    for ( i = 0; i < nchan_fb_in; i++ )
#else
                 hFbMixer->fb_cfg->num_in_chans;
    for ( i = 0; i < hFbMixer->fb_cfg->num_in_chans; i++ )
#endif
          i++ )
    {
        mvr2r( &hFbMixer->ppFilterbank_prior_input[i][length], hFbMixer->ppFilterbank_prior_input[i], hFbMixer->fb_cfg->prior_input_length - length );
        mvr2r( pcm_in[i], &hFbMixer->ppFilterbank_prior_input[i][hFbMixer->fb_cfg->prior_input_length - length], length );
+15 −0
Original line number Diff line number Diff line
@@ -3741,6 +3741,10 @@ ivas_error ivas_td_decorr_reconfig_dec(
    const int32_t output_Fs,                                    /* i  : output sampling rate                    */
    ivas_td_decorr_state_t **hTdDecorr,                         /* i/o: TD decorrelator handle                  */
    uint16_t *useTdDecorr                                       /* i/o: TD decorrelator flag                    */
#ifdef TD_DECORR_DIS
    , 
    int16_t td_decorr_flag                                        /* i  : Disable malloc for td_decorr structure flag */
#endif
);

/*! r: Configured reqularization factor value */
@@ -4359,6 +4363,10 @@ void ivas_spar_dec_close(
    SPAR_DEC_HANDLE *hSpar,                                     /* i/o: SPAR decoder handle                     */
    const int32_t output_Fs,                                    /* i  : output sampling rate                    */
    const int16_t spar_reconfig_flag                            /* i  : SPAR reconfiguration flag               */
#ifdef TD_DECORR_DIS
    ,
    const int16_t td_decorr_flag                                  /* i  : Disable malloc for td_decorr structure flag */
#endif
);

ivas_error ivas_spar_dec(
@@ -5814,6 +5822,13 @@ int16_t ivas_get_num_bands_from_bw_idx(
    const int16_t bwidth                                        /* i  : audio bandwidth                             */
);

#ifdef TD_DECORR_DIS
void ivas_td_decorr_bitrate_check(
    const int32_t ivas_total_brate,                               /* i  : IVAS total bitrate                         */
    AUDIO_CONFIG output_config,                                   /* i  : output config.                             */
    Decoder_Struct *st_ivas                                       /* i/o  : IVAS decoder structure                  */
);
#endif

/* clang-format on */

+39 −4
Original line number Diff line number Diff line
@@ -115,6 +115,10 @@ ivas_error ivas_td_decorr_reconfig_dec(
    const int32_t output_Fs,            /* i  : output sampling rate            */
    ivas_td_decorr_state_t **hTdDecorr, /* i/o: TD decorrelator handle          */
    uint16_t *useTdDecorr               /* i/o: TD decorrelator flag            */
#ifdef TD_DECORR_DIS
    ,
    int16_t td_decorr_flag /* i  : Disable malloc for td_decorr structure flag */
#endif
)
{
    uint16_t useTdDecorr_new;
@@ -151,6 +155,10 @@ ivas_error ivas_td_decorr_reconfig_dec(
        {
            if ( ivas_total_brate >= IVAS_13k2 && ivas_format == SBA_FORMAT )
            {
#ifdef TD_DECORR_DIS
                if ( !td_decorr_flag )
                {
#endif
                    if ( *hTdDecorr == NULL )
                    {
                        if ( ( error = ivas_td_decorr_dec_open( hTdDecorr, output_Fs, 3, 1 ) ) != IVAS_ERR_OK )
@@ -158,6 +166,9 @@ ivas_error ivas_td_decorr_reconfig_dec(
                            return error;
                        }
                    }
#ifdef TD_DECORR_DIS
                }
#endif

                if ( ivas_total_brate < IVAS_24k4 )
                {
@@ -215,7 +226,6 @@ ivas_error ivas_td_decorr_dec_open(
    num_out_chans = nchan_internal - 1;

    error = IVAS_ERR_OK;

    if ( ( hTdDecorr_loc = (ivas_td_decorr_state_t *) malloc( sizeof( ivas_td_decorr_state_t ) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV decoder" );
@@ -226,6 +236,7 @@ ivas_error ivas_td_decorr_dec_open(
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV decoder" );
    }
    set_f( hTdDecorr_loc->look_ahead_buf, 0, (int16_t) ( output_Fs * IVAS_DECORR_PARM_LOOKAHEAD_TAU ) );

#ifdef JBM_TSM_ON_TCS
    hTdDecorr_loc->offset = (int16_t) ( output_Fs * IVAS_DECORR_PARM_LOOKAHEAD_TAU );
#endif
@@ -539,3 +550,27 @@ void ivas_td_decorr_process(

    return;
}

/*-----------------------------------------------------------------------------------------*
 * Function ivas_td_decorr_bitrate_check()
 *
 * TD decorr bitrate and outfit_config check call
 *-----------------------------------------------------------------------------------------*/

#ifdef TD_DECORR_DIS
void ivas_td_decorr_bitrate_check(
    const int32_t ivas_total_brate, /* i  : IVAS total bitrate                         */
    AUDIO_CONFIG output_config,     /* i  : output config.                             */
    Decoder_Struct *st_ivas         /* i/o  : IVAS decoder structure                  */
)
{
    if ( ivas_total_brate == IVAS_512k && output_config == AUDIO_CONFIG_FOA )
    {
        st_ivas->td_decorr_flag = 1;
    }
    else
    {
        st_ivas->td_decorr_flag = 0;
    }
}
#endif
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -223,6 +223,8 @@

#define FIX_487_LOWRATE_SBA_TUNING_FIX                  /* Dlb: TUning fix for low bitrate cases to match theoretical longest SPAR MD bitstream */

#define TD_DECORR_DIS                                 /* Dlb : Issue 163 : Malloc of td_deccor structure at 512 kbps and output configuration FOA*/


/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+17 −2
Original line number Diff line number Diff line
@@ -695,6 +695,9 @@ ivas_error ivas_init_decoder(

    hDecoderConfig->last_ivas_total_brate = ivas_total_brate;
    st_ivas->last_active_ivas_total_brate = ivas_total_brate;
#ifdef TD_DECORR_DIS
    ivas_td_decorr_bitrate_check( ivas_total_brate, output_config, st_ivas );
#endif

    if ( output_config == AUDIO_CONFIG_EXTERNAL )
    {
@@ -1840,7 +1843,12 @@ void ivas_destroy_dec(
    }

    /* SPAR handle */
    ivas_spar_dec_close( &( st_ivas->hSpar ), st_ivas->hDecoderConfig->output_Fs, 0 );
    ivas_spar_dec_close( &( st_ivas->hSpar ), st_ivas->hDecoderConfig->output_Fs, 0
#ifdef TD_DECORR_DIS
                         ,
                         st_ivas->td_decorr_flag
#endif
    );

    /* HOA decoder matrix */
    if ( st_ivas->hoa_dec_mtx != NULL )
@@ -1863,7 +1871,14 @@ void ivas_destroy_dec(

#ifdef MC_PARAMUPMIX_MODE
    /* Param-Upmix MC handle */
#ifdef TD_DECORR_DIS
    if ( !st_ivas->td_decorr_flag )
    {
#endif
        ivas_mc_paramupmix_dec_close( &( st_ivas->hMCParamUpmix ) );
#ifdef TD_DECORR_DIS
    }
#endif
#endif

    /* Parametric MC handle */
Loading