Commit 94b0164c authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3GPP issue 1786: Metadata output result of MASA prerend with muted...

Fix for 3GPP issue 1786: Metadata output result of MASA prerend with muted MASA signal and ISM3 is quite differing

Link #1786
parent 5d9ebfb5
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -978,7 +978,7 @@ static Word16 quantize_phi_masa_fx(
    Word32 tmp32;
    Word16 tmp_e, delta_phi_e;

    delta_phi_fx = L_deposit_h( BASOP_Util_Divide1616_Scale( 360, n, &delta_phi_e ) );
    delta_phi_fx = BASOP_Util_Divide3232_Scale_newton( 360, n, &delta_phi_e );
    delta_phi_fx = L_shr( delta_phi_fx, sub( sub( 31, delta_phi_e ), 22 ) ); // Q22

    IF( EQ_16( n, 1 ) )
@@ -1000,8 +1000,8 @@ static Word16 quantize_phi_masa_fx(
    }

    tmp32 = L_add( L_sub( phi_fx, dd_fx ), L_shr( delta_phi_fx, 1 ) );
    id_phi = BASOP_Util_Divide3232_Scale( tmp32, delta_phi_fx, &tmp_e );
    id_phi = shr( id_phi, sub( 15, tmp_e ) ); // Q0
    tmp32 = BASOP_Util_Divide3232_Scale_newton( tmp32, delta_phi_fx, &tmp_e );
    id_phi = extract_l( L_shr( tmp32, sub( 31, tmp_e ) ) ); // Q0

    if ( EQ_16( id_phi, n ) )
    {
@@ -1014,7 +1014,10 @@ static Word16 quantize_phi_masa_fx(
        id_phi = sub( n, 1 );
    }

    *phi_hat_fx = L_add( L_shl( Mpy_32_16_1( delta_phi_fx, id_phi ), 15 ), dd_fx ); // q22 + q0 - 15 = q7 -> q7 + 15 = q22
    delta_phi_fx = BASOP_Util_Divide3232_Scale_newton( L_mult0( 360, id_phi ), n, &delta_phi_e );
    delta_phi_fx = L_shr( delta_phi_fx, sub( sub( 31, delta_phi_e ), 22 ) ); // Q22

    *phi_hat_fx = L_add( delta_phi_fx, dd_fx ); // Q22
    move32();

    return id_phi; // Q0
+2 −2
Original line number Diff line number Diff line
@@ -194,9 +194,9 @@ void diffuse_meta_merge_1x1_fx(
            scale = add( scale, sub( total_diff_nrg_e, total_nrg_e ) );
            IF( L_tmp1 == 0 )
            {
                scale = 31;
                scale = 0;
                move16();
                L_tmp2 = 1;
                L_tmp2 = MAX_32;
                move32();
            }
            ELSE