Commit b9e4089c authored by vaclav's avatar vaclav
Browse files

fix to SPAR decoder + comments

parent 250c17be
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -66,9 +66,7 @@ ivas_error ivas_spar_dec_open(
#endif

    error = IVAS_ERR_OK;

    sba_order_internal = min( st_ivas->sba_order, IVAS_MAX_SBA_ORDER );

    num_channels_internal = ivas_sba_get_nchan_metadata( sba_order_internal );

    /* SPAR decoder handle */
@@ -121,19 +119,25 @@ ivas_error ivas_spar_dec_open(
        return error;
    }

    /* AGC */
    /* AGC handle */
    if ( ( error = ivas_spar_agc_dec_open( &hSpar->hAgcDec, output_Fs ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    /* PCA */
    /* PCA handle */
#ifdef SBA_CLEANING
    hSpar->hPCA = NULL;
    if ( st_ivas->hDecoderConfig->ivas_total_brate == PCA_BRATE && sba_order_internal == 1 )
#endif
    {
        if ( ( hSpar->hPCA = (PCA_DEC_STATE *) count_malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL )
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for PCA decoder" );
        }

        ivas_pca_dec_init( hSpar->hPCA );
    }

    /* mixer_mat intitialization */
    for ( i = 0; i < num_channels_internal; i++ )
+4 −11
Original line number Diff line number Diff line
@@ -91,20 +91,13 @@ ivas_error ivas_spar_enc_open(
    // ivas_set_bitrate_config(&pState->hMdEnc->spar_md_cfg, table_idx);

    /* MD handle */
#ifndef FIX_SBA_CLEAN_UP_OPT
    if ( ( error = ivas_spar_foa_md_enc_open( &( hSpar->hMdEnc ), hEncoderConfig ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#else
    if ( ( error = ivas_spar_md_enc_open( &( hSpar->hMdEnc ), hEncoderConfig ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#endif

    /* set FB config. */
    active_w_mixing = ivas_spar_br_table_consts[table_idx].active_w; // VE: this parameter is different between enc and dec
    active_w_mixing = ivas_spar_br_table_consts[table_idx].active_w;
    ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, nchan_inp, nchan_transport, active_w_mixing, input_Fs );
    fb_cfg->remix_order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order];

@@ -126,13 +119,13 @@ ivas_error ivas_spar_enc_open(
        return error;
    }

    /* AGC */
    /* AGC handle */
    if ( ( error = ivas_spar_agc_enc_open( &hSpar->hAgcEnc, input_Fs, nchan_inp ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    /* PCA */
    /* PCA handle */
    hSpar->hPCA = NULL;
    if ( hEncoderConfig->Opt_PCA_ON )
    {
@@ -143,7 +136,7 @@ ivas_error ivas_spar_enc_open(
        ivas_pca_enc_init( hSpar->hPCA );
    }

    /* initializations */
    /* initialization */
    hSpar->hMdEnc->table_idx = -1;
#endif