Commit 8d2db8e9 authored by Vidhya V P's avatar Vidhya V P
Browse files

Address review comments:set 2

parent 6e184823
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -891,7 +891,8 @@ ivas_error ivas_sba_dec_reconfigure(
    }
#ifdef SBA_BR_SWITCHING_RECONFIG
#ifdef SBA_BR_SWITCHING_CLEAN_UP
    if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( sba_mode_old != st_ivas->sba_mode ) || ( st_ivas->sba_mode == SBA_MODE_SPAR ) )
    if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( sba_mode_old != st_ivas->sba_mode ) || ( st_ivas->sba_mode == SBA_MODE_SPAR ) ) 
        && (( (hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) ) )
    {
        DIRAC_CONFIG_FLAG flag_config;
        flag_config = DIRAC_OPEN;
@@ -908,6 +909,29 @@ ivas_error ivas_sba_dec_reconfigure(
            return error;
        }
    }
    if ( ( ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) )  && ( ( sba_mode_old != st_ivas->sba_mode ) && ( st_ivas->sba_mode == SBA_MODE_SPAR ) ) )
    {
       /* if ( st_ivas->hDirAC != NULL && st_ivas->sba_mode == SBA_MODE_SPAR )
        {
            mvs2s( st_ivas->hDirAC->dirac_to_spar_md_bands, st_ivas->hSpar->dirac_to_spar_md_bands, DIRAC_MAX_NBANDS );
            st_ivas->hSpar->enc_param_start_band = st_ivas->hDirAC->hConfig->enc_param_start_band;
        }*/
        if ( st_ivas->hDirAC != NULL )
        {
            ivas_dirac_dec_close( st_ivas->hDirAC );
            st_ivas->hDirAC = NULL;
        }
         if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK )
        {
            return error;
        }
        int16_t band_grouping[IVAS_MAX_NUM_BANDS + 1];

        st_ivas->hSpar->enc_param_start_band = min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND );

        ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, ( int16_t )( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ),
                                 st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 );
    }
#else
    if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( sba_mode_old != st_ivas->sba_mode ) )
    {
@@ -951,6 +975,7 @@ ivas_error ivas_sba_dec_reconfigure(
#endif
#endif
#ifdef SBA_BR_SWITCHING

    else if ( st_ivas->renderer_type == RENDERER_DISABLE || ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->sba_mode != SBA_MODE_SPAR ) )
    {
        if ( st_ivas->hDirAC != NULL )