Commit 8b71eed6 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge commit '07f95b5e' into main-pc-update-step3

parents 3e14047a 07f95b5e
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
#define OPT_SBA_REND_V1_BE
#define OPT_HEAD_ROT_REND_V1_BE
#define OPT_SBA_DEC_V2_BE
#define OPT_SBA_ENC_V1_BE
#define OPT_BIN_RENDERER_V1
#define OPT_BIN_RENDERER_V2
+21 −0
Original line number Diff line number Diff line
@@ -2634,9 +2634,16 @@ void IMDCT_ivas_fx(
        Word32 fac;
        // fac = shl_sat( mult_r( extract_h( L_shr_sat( hTcxDec->conceal_eof_gain32, sub( 1, hTcxDec->conceal_eof_gain_e ) ) ), st->last_concealed_gain_syn_deemph ), 1 );
        fac = Mpy_32_16_1( hTcxDec->conceal_eof_gain32, st->last_concealed_gain_syn_deemph ); // q = 31 - hTcxDec->conceal_eof_gain_e - last_concealed_gain_syn_deemph_e
#ifdef OPT_SBA_DEC_V2_BE
        Word16 eff_e = add( hTcxDec->conceal_eof_gain_e, st->last_concealed_gain_syn_deemph_e );
#endif /* OPT_SBA_DEC_V2_BE */
        FOR( Word16 ind = 0; ind < overlap; ind++ )
        {
#ifdef OPT_SBA_DEC_V2_BE
            old_syn_overl_fx[ind] = extract_h( L_shl_sat( Mpy_32_16_1( fac, old_syn_overl_fx[ind] ), eff_e ) ); // Q(-2)
#else                                                                                                           /* OPT_SBA_DEC_V2_BE */
            old_syn_overl_fx[ind] = extract_h( L_shl_sat( Mpy_32_16_1( fac, old_syn_overl_fx[ind] ), add( hTcxDec->conceal_eof_gain_e, st->last_concealed_gain_syn_deemph_e ) ) ); // Q(-2)
#endif                                                                                                          /* OPT_SBA_DEC_V2_BE */
            move16();
        }
    }
@@ -4713,9 +4720,16 @@ void decoder_tcx_noiseshaping_igf_fx(
        {
            /* If the exponent on the spec side (i>L_frame) is lesser, then shift all the values in the
            spec side by the difference to make both sides have the same exponent. */
#ifdef OPT_SBA_DEC_V2_BE
            Word16 diff_e = sub( frame_side_x_e, spec_side_x_e );
#endif /* OPT_SBA_DEC_V2_BE */
            FOR( i = L_frame; i < L_spec; i++ )
            {
#ifdef OPT_SBA_DEC_V2_BE
                x_fx[i] = L_shr( x_fx[i], diff_e );
#else  /* OPT_SBA_DEC_V2_BE */
                x_fx[i] = L_shr( x_fx[i], sub( frame_side_x_e, spec_side_x_e ) );
#endif /* OPT_SBA_DEC_V2_BE */
                move32();
            }
        }
@@ -4723,9 +4737,16 @@ void decoder_tcx_noiseshaping_igf_fx(
        {
            /* If the exponent on the spec side (i>L_frame) is greater, then shift all the values in the
            frame side (i<L_frame) by the difference to make both sides have the same exponent. */
#ifdef OPT_SBA_DEC_V2_BE
            Word16 diff_e = sub( spec_side_x_e, frame_side_x_e );
#endif /* OPT_SBA_DEC_V2_BE */
            FOR( i = 0; i < L_frame; i++ )
            {
#ifdef OPT_SBA_DEC_V2_BE
                x_fx[i] = L_shr( x_fx[i], diff_e );
#else  /* OPT_SBA_DEC_V2_BE */
                x_fx[i] = L_shr( x_fx[i], sub( spec_side_x_e, frame_side_x_e ) );
#endif /* OPT_SBA_DEC_V2_BE */
                move32();
            }
        }
+15 −1
Original line number Diff line number Diff line
@@ -1851,7 +1851,6 @@ void ivas_binRenderer_fx(

    /* Compute Convolution */
    /* memory reset for the binaural output */

    FOR( pos_idx = 0; pos_idx < num_poses; pos_idx++ )
    {
        FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
@@ -1864,6 +1863,7 @@ void ivas_binRenderer_fx(
        }
    }

#ifndef OPT_SBA_DEC_V2_BE
#ifndef OPT_BIN_RENDERER_V2
    FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
    {
@@ -1883,6 +1883,7 @@ void ivas_binRenderer_fx(
            Copy32( ImagBuffer_fx[chIdx][k], ImagBuffer_local[chIdx][k], CLDFB_NO_CHANNELS_MAX );
        }
    }
#endif /* OPT_SBA_DEC_V2_BE */

    /* Head rotation in HOA3 or CICPx */
    test();
@@ -2105,6 +2106,19 @@ void ivas_binRenderer_fx(
            }
        }
    }

#ifdef OPT_SBA_DEC_V2_BE
    Word16 len = sub( CLDFB_NO_CHANNELS_MAX, hBinRenderer->conv_band );

    FOR( k = 0; k < numTimeSlots; k++ )
    {
        set32_fx( &Cldfb_RealBuffer_Binaural_fx[0][k][hBinRenderer->conv_band], 0, len );
        set32_fx( &Cldfb_RealBuffer_Binaural_fx[1][k][hBinRenderer->conv_band], 0, len );
        set32_fx( &Cldfb_ImagBuffer_Binaural_fx[0][k][hBinRenderer->conv_band], 0, len );
        set32_fx( &Cldfb_ImagBuffer_Binaural_fx[1][k][hBinRenderer->conv_band], 0, len );
    }
#endif /* OPT_SBA_DEC_V2_BE */

    pop_wmops();
    return;
}
+9 −1
Original line number Diff line number Diff line
@@ -605,8 +605,11 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx(
#ifdef MERGE_REQUEST_1564_SPEEDUP_ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx_NONBE
                {
                    Word16 shifter;

#ifdef OPT_SBA_DEC_V2_BE
                    shifter = sub( mixing_matrix_res_smooth_e, 31 );
#else  /* OPT_SBA_DEC_V2_BE */
                    shifter = 31 - mixing_matrix_res_smooth_e;
#endif /* OPT_SBA_DEC_V2_BE */
                    FOR( ch_idx = 0; ch_idx < nY; ch_idx++ )
                    {
                        int i;
@@ -625,8 +628,13 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx(
                            temp_imag = W_add( temp_imag, W_mult0_32_32( mixing_matrix_res_smooth_fx[idx], diff_f_imag_fx[i] ) );
                            idx += nY;
                        }
#ifdef OPT_SBA_DEC_V2_BE
                        Cldfb_RealBuffer_fx[ch_idx][slot_idx_sfr][band] = W_shl_sat_l( temp_real, shifter );
                        Cldfb_ImagBuffer_fx[ch_idx][slot_idx_sfr][band] = W_shl_sat_l( temp_imag, shifter );
#else  /* OPT_SBA_DEC_V2_BE */
                        Cldfb_RealBuffer_fx[ch_idx][slot_idx_sfr][band] = W_extract_l( W_shr( temp_real, shifter ) );
                        Cldfb_ImagBuffer_fx[ch_idx][slot_idx_sfr][band] = W_extract_l( W_shr( temp_imag, shifter ) );
#endif /* OPT_SBA_DEC_V2_BE */
                    }
                }

+64 −1
Original line number Diff line number Diff line
@@ -1163,6 +1163,69 @@ void ivas_spar_get_parameters_fx(
    move16();
    Word16 add_weight_fx = sub( MAX_WORD16, weight_fx );
    Word16 add_weight_20ms_fx = sub( MAX_WORD16, weight_20ms_fx );
#ifdef OPT_SBA_DEC_V2_BE
    Word16 out_flag[IVAS_MAX_FB_MIXER_OUT_CH];

    Word32 band_bool = LT_16( split_band, IVAS_MAX_NUM_BANDS );

    FOR( out_ch = 0; out_ch < num_ch_out; out_ch++ )
    {
        /* 20ms cross-fade for Transport channels in all frequency bands */
        /* sub-frame processing for missing channels in all frequency bands*/
        out_flag[out_ch] = band_bool && ( 0 == ivas_is_res_channel( out_ch, hSpar->hMdDec->spar_md_cfg.nchan_transport ) );
        move16();
    }
    Word32 frame_bool = GT_16( hSpar->i_subframe, 3 );

    FOR( out_ch = 0; out_ch < num_ch_out; out_ch++ )
    {
        IF( out_flag[out_ch] )
        {
            IF( frame_bool )
            {
                FOR( spar_band = 0; spar_band < num_spar_bands; spar_band++ )
                {
                    FOR( in_ch = 0; in_ch < num_ch_in; in_ch++ )
                    {
                        par_mat_fx[out_ch][in_ch][spar_band] = Madd_32_16( Mpy_32_16_1( hSpar->hMdDec->mixer_mat_prev_fx[ts1][out_ch][in_ch][spar_band], weight_fx ),
                                                                           hSpar->hMdDec->mixer_mat_prev_fx[ts0][out_ch][in_ch][spar_band], add_weight_fx );
                        move32();
                    }
                }
            }
            ELSE
            {


                FOR( spar_band = 0; spar_band < num_spar_bands; spar_band++ )
                {
                    FOR( in_ch = 0; in_ch < num_ch_in; in_ch++ )
                    {
                        {
                            par_mat_fx[out_ch][in_ch][spar_band] = hSpar->hMdDec->mixer_mat_fx[out_ch][in_ch][spar_band]; /*hSpar->hMdDec->Q_mixer_mat*/
                            move32();
                        }
                    }
                }
            }
        }
        ELSE
        {
            FOR( spar_band = 0; spar_band < num_spar_bands; spar_band++ )
            {
                FOR( in_ch = 0; in_ch < num_ch_in; in_ch++ )
                {
                    /* 20ms Transport channel reconstruction with matching encoder/decoder processing */
                    Word16 prev_idx = SPAR_DIRAC_SPLIT_START_BAND < IVAS_MAX_NUM_BANDS ? 1 : 0; /* if SPAR_DIRAC_SPLIT_START_BAND == IVAS_MAX_NUM_BANDS, then the sub-frame mixer_mat delay line is not active */
                    move16();
                    par_mat_fx[out_ch][in_ch][spar_band] = Madd_32_16( Mpy_32_16_1( hSpar->hMdDec->mixer_mat_prev_fx[prev_idx][out_ch][in_ch][spar_band], add_weight_20ms_fx ),
                                                                       hSpar->hMdDec->mixer_mat_fx[out_ch][in_ch][spar_band], weight_20ms_fx ); /*hSpar->hMdDec->Q_mixer_mat*/
                    move32();
                }
            }
        }
    }
#else  /* OPT_SBA_DEC_V2_BE */
    FOR( spar_band = 0; spar_band < num_spar_bands; spar_band++ )
    {
        FOR( out_ch = 0; out_ch < num_ch_out; out_ch++ )
@@ -1202,7 +1265,7 @@ void ivas_spar_get_parameters_fx(
            }
        }
    }

#endif /* OPT_SBA_DEC_V2_BE */
    return;
}

Loading