Commit 1260397e authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_fix_685' into 'main'

Fix for issue 685: High frequency difference between BASOP fixed point and PC...

See merge request !370
parents 4630e350 85416718
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5264,7 +5264,8 @@ void ivas_sba_mix_matrix_determiner_fx(
    const Word16 bfi,                                          /* i  : BFI flag                                */
    const Word16 nchan_remapped,                               /* i  : num channels after remapping of TCs     */
    const Word16 output_frame,                                 /* i  : output frame length                     */
    const Word16 num_md_sub_frames                             /* i  : number of subframes in mixing matrix    */
    const Word16 num_md_sub_frames,                             /* i  : number of subframes in mixing matrix    */
    const Word16 Q_p_Output                             /* i  : number of subframes in mixing matrix    */
);
#endif // IVAS_FLOAT_FIXED

+15 −4
Original line number Diff line number Diff line
@@ -576,7 +576,7 @@ ivas_error ivas_jbm_dec_tc_fx(
                num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate );

                SPAR_DEC_HANDLE hSpar = st_ivas->hSpar;
                Word16 Q_p_output = 14;
                Word16 Q_p_output = MAX_16, temp_min;
                move16();
                Word16 nchan_transport;

@@ -586,13 +586,24 @@ ivas_error ivas_jbm_dec_tc_fx(
                move16();
                FOR( ch = 0; ch < nchan_transport; ch++ )
                {
                    Scale_sig32( p_output_fx[ch], output_frame, sub( Q_p_output, Q11 ) );
                    temp_min = getScaleFactor32( p_output_fx[ch], output_frame );
                    Q_p_output = s_min( Q_p_output, temp_min );
                }
                Q_p_output = sub( Q_p_output, 2 );
                IF( GT_16( Q_p_output, 20 ) )
                {
                    Q_p_output = 20;
                    move16();
                }
                FOR( ch = 0; ch < nchan_transport; ch++ )
                {
                    Scale_sig32( p_output_fx[ch], output_frame, Q_p_output );
                }

                hSpar->hMdDec->Q_mixer_mat = 31;
                move16();

                ivas_sba_mix_matrix_determiner_fx( st_ivas->hSpar, p_output_fx, st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames );
                ivas_sba_mix_matrix_determiner_fx( st_ivas->hSpar, p_output_fx, st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames, Q_p_output );
                FOR( Word16 c = 0; c < nchan_transport; c++ )
                {
                    Scale_sig32( p_output_fx[c], output_frame, 11 );
@@ -978,7 +989,7 @@ ivas_error ivas_jbm_dec_tc_fx(
            }
            hSpar->hMdDec->Q_mixer_mat = 31;

            ivas_sba_mix_matrix_determiner_fx( st_ivas->hSpar, &p_output_fx[sba_ch_idx], st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames );
            ivas_sba_mix_matrix_determiner_fx( st_ivas->hSpar, &p_output_fx[sba_ch_idx], st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames, sub( Q_p_output, Q11 ) );
            FOR( Word16 c = 0; c < nchan_transport; c++ )
            {
                Scale_sig32( p_output_fx[sba_ch_idx + c], output_frame, Q11 );
+9 −8
Original line number Diff line number Diff line
@@ -841,12 +841,13 @@ void ivas_sba_mix_matrix_determiner_fx(
    const Word16 bfi,               /* i  : BFI flag                            */
    const Word16 nchan_remapped,    /* i  : num channels after remapping of TCs */
    const Word16 output_frame,      /* i  : output frame length                 */
    const Word16 num_md_sub_frames /* i  : number of subframes in mixing matrix*/
    const Word16 num_md_sub_frames, /* i  : number of subframes in mixing matrix*/
    const Word16 Q_output           /* i  : number of subframes in mixing matrix*/
)
{
    Word16 i, ch;
    Word16 num_bands_out, nchan_transport, nchan_out;
    Word16 Q_p_output = 14;
    Word16 Q_p_output = add( 11, Q_output );
    move16();
    Word32 temp_fx;
    /* Convert numeric range */
@@ -888,7 +889,7 @@ void ivas_sba_mix_matrix_determiner_fx(
    {
        FOR( i = 0; i < output_frame; i++ )
        {
            output_fx[ch][i] = Mult_32_32( L_shl_sat( output_fx[ch][i], 4 ), L_shl_sat( PCM16_TO_FLT_FAC_FX, 16 ) ); /*Q-0*/
            output_fx[ch][i] = Mult_32_32( L_shl_sat( output_fx[ch][i], sub( 18, Q_p_output ) ), L_shl_sat( PCM16_TO_FLT_FAC_FX, 16 ) ); /*Q-0*/
        }
    }