Commit 83a12be9 authored by Stephane Ragot's avatar Stephane Ragot
Browse files

FOA support at rates >= 256 kbit/s

parent f3b4ed31
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@

#define ISSUE_24_CLEANUP_MCT_LFE                        /* Issue 24: Cleanup LFE path withing MCT */ 

//#define PCA_ENH                                       /* Orange: Enhanced PCA */ 

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+12 −0
Original line number Diff line number Diff line
@@ -235,14 +235,22 @@ void ivas_pca_dec(
    /* @@@TODO: check how ivas_total_brate is set if bfi == 1 */ // VE: and what happens in DTX where "ivas_total_brate" can be close to zero?

    /* handle bit rate switching */
#ifdef PCA_ENH
    if ( ivas_total_brate < PCA_BRATE || ( ivas_total_brate >= PCA_BRATE && n_channels > FOA_CHANNELS ) )
#else
    if ( ivas_total_brate != PCA_BRATE || ( ivas_total_brate == PCA_BRATE && n_channels > FOA_CHANNELS ) )
#endif
    {
        /* set PCA by-pass mode in current frame and interpolate transform as previous frame used PCA */
        pca_dec_reset_dquat( ql, qr );

        // VE: todo - rather call PCA resets in the first PCA frame

#ifdef PCA_ENH
        if ( ( last_ivas_total_brate < PCA_BRATE ) || ( last_ivas_total_brate >= PCA_BRATE && hPCA->prev_pca_bypass > 1 ) )
#else
        if ( ( last_ivas_total_brate != PCA_BRATE ) || ( last_ivas_total_brate == PCA_BRATE && hPCA->prev_pca_bypass > 1 ) )
#endif
        {
            pca_dec_reset_mem_eigvec( hPCA );
        }
@@ -262,7 +270,11 @@ void ivas_pca_dec(
        return;
    }

#ifdef PCA_ENH
    assert( ivas_total_brate >= PCA_BRATE ); /* the remaining code is defined at >=256k where there are 4 dmx channel */
#else
    assert( ivas_total_brate == PCA_BRATE ); /* the remaining code is defined at 256k where there are 4 dmx channel */
#endif

    if ( !bfi )
    {
+4 −0
Original line number Diff line number Diff line
@@ -125,7 +125,11 @@ ivas_error ivas_spar_dec_open(

    /* PCA handle */
    hSpar->hPCA = NULL;
#ifdef PCA_ENH
    if ( st_ivas->hDecoderConfig->ivas_total_brate >= PCA_BRATE && sba_order_internal == 1 )
#else
    if ( st_ivas->hDecoderConfig->ivas_total_brate == PCA_BRATE && sba_order_internal == 1 )
#endif
    {
        if ( ( hSpar->hPCA = (PCA_DEC_STATE *) malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL )
        {
+14 −0
Original line number Diff line number Diff line
@@ -309,17 +309,27 @@ void ivas_pca_enc(


    /* handle bitrate switching */
#ifdef PCA_ENH
    if ( ivas_total_brate < PCA_BRATE )
#else
    if ( ivas_total_brate != PCA_BRATE )
#endif
    {
        pca_enc_reset( hPCA );

#ifdef PCA_ENH
        if ( hEncoderConfig->last_ivas_total_brate < PCA_BRATE )
#else
        if ( hEncoderConfig->last_ivas_total_brate != PCA_BRATE )
#endif
        {
            eye_matrix( hPCA->mem_eigVec_interp, FOA_CHANNELS, 1.0f );
#ifndef PCA_ENH
            /* copy input data into output directly as previous frame was already in by-pass mode */
            for ( k = 0; k < n_channels; k++ )
            {
            }
#endif
        }
        else
        {
@@ -334,7 +344,11 @@ void ivas_pca_enc(
        return;
    }

#ifdef PCA_ENH
	assert( ivas_total_brate >= PCA_BRATE ); /* the remaining code is defined at >=256k where there are 4 dmx channel */
#else
    assert( ivas_total_brate == PCA_BRATE ); /* the remaining code is defined at 256k where there are 4 dmx channel */
#endif

    /*-----------------------------------------------------------------*
     * Covariance
+4 −0
Original line number Diff line number Diff line
@@ -736,7 +736,11 @@ static ivas_error ivas_spar_enc_process(
    }
    else
    {
#ifdef PCA_ENH
        if ( ivas_total_brate >= PCA_BRATE && sba_order == SBA_FOA_ORDER )
#else
        if ( ivas_total_brate == PCA_BRATE && sba_order == SBA_FOA_ORDER )
#endif
        {
            /* write PCA bypass bit */
            push_next_indice( hMetaData, PCA_MODE_INACTIVE, 1 );
Loading