Commit c1a7b6bf authored by vaclav's avatar vaclav
Browse files

formatting in PCA

parent 0863e11b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -260,8 +260,9 @@ void ivas_pca_dec(
        return;
    }

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

#endif
    if ( !bfi )
    {
        /* set PCA by-pass mode indicator */
@@ -312,6 +313,5 @@ void ivas_pca_dec(
    pca_dec_update_dquat( hPCA, ql, qr );
    hPCA->prev_pca_bypass = 0;


    return;
}
+14 −7
Original line number Diff line number Diff line
@@ -139,19 +139,17 @@ static void pca_enc_transform(

    quat_shortestpath( hPCA->prev_ql, ql, hPCA->prev_qr, qr );


    pca_interp_preproc( hPCA->prev_ql, hPCA->prev_qr, ql, qr, IVAS_PCA_N_SLOTS, ql_interp, qr_interp );

    slot_len = (int16_t) ( input_frame / IVAS_PCA_N_SLOTS );

    for ( time_slot = 0; time_slot < IVAS_PCA_N_SLOTS; time_slot++ )
    {
        /* convert from double quaternion to 4D matrix */
        dquat2mat( &ql_interp[IVAS_PCA_INTERP * time_slot], &qr_interp[IVAS_PCA_INTERP * time_slot],
                   eigVec_interp );
        dquat2mat( &ql_interp[IVAS_PCA_INTERP * time_slot], &qr_interp[IVAS_PCA_INTERP * time_slot], eigVec_interp );
        pca_transform_sub( eigVec_interp, transformed_data, slot_len * time_slot, slot_len, n_channels );
    }


    return;
}

@@ -307,7 +305,6 @@ void ivas_pca_enc(
        return;
    }


    /* handle bitrate switching */
    if ( ivas_total_brate != PCA_BRATE )
    {
@@ -319,6 +316,7 @@ void ivas_pca_enc(
            /* copy input data into output directly as previous frame was already in by-pass mode */
            for ( k = 0; k < n_channels; k++ )
            {
                // ToDo: TBV
            }
        }
        else
@@ -334,8 +332,9 @@ void ivas_pca_enc(
        return;
    }

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

#endif
    /*-----------------------------------------------------------------*
     * Covariance
     *-----------------------------------------------------------------*/
@@ -510,14 +509,22 @@ void ivas_pca_enc(
    dotl = dotp( hPCA->prev_ql, ql, 4 );
    dotr = dotp( hPCA->prev_qr, qr, 4 );
    if ( dotl < dotr )
    {
        min_dot = dotl;
    }
    else
    {
        min_dot = dotr;
    }

    if ( ql[0] < qr[0] )
    {
        min_dot2 = ql[0];
    }
    else
    {
        min_dot2 = qr[0];
    }

    bypass_decision = PCA_MODE_ACTIVE;
    if ( dist_alt < IVAS_PCA_THRES_DIST_ALT )
@@ -556,6 +563,7 @@ void ivas_pca_enc(

        pca_update_state( hPCA, ql, qr, eigVec, n_channels );
        hPCA->prev_bypass_decision = PCA_MODE_INACTIVE;

        return;
    }

@@ -589,6 +597,5 @@ void ivas_pca_enc(
    hPCA->prev_bypass_decision = bypass_decision;
    pca_update_state( hPCA, ql, qr, eigVec, n_channels );


    return;
}