Commit 06b01735 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

MLD improvement changes for MASA format

[x] Q update in ivas_dirac_dec_render_sf_fx
[x] Fixed values updated in ivas_masa_stereotype_detection_fx
parent b6f90083
Loading
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -4998,6 +4998,19 @@ void ivas_dirac_dec_render_sf_fx(
                                                                    hDirAC->hConfig->enc_param_start_band,
                                                                    &q_Cldfb );

        Word16 sh = hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q;
        move16();
        hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q = 31;
        move16();
        FOR( i = 0; i < proto_power_smooth_len; i++ )
        {
            IF( hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_fx[i] != 0 )
            {
                hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q = sh;
                move16();
            }
        }

        FOR( ch = 0; ch < hDirACRend->hOutSetup.nchan_out_woLFE; ch++ )
        {
            FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ )
+4 −4
Original line number Diff line number Diff line
@@ -4695,7 +4695,7 @@ void ivas_masa_stereotype_detection_fx(
    {
        /* subtract_temp = ( -subtract_target_ratio_db - 3.0f ) / 3.0f; */
        temp = L_sub( L_shr( -subtract_target_ratio_db_fx, 1 ), L_shr( THREE_Q21, 1 ) );
        subtract_temp_fx = Mpy_32_32( temp, 708669604 /* 1 / 3.0f in Q31 */ );
        subtract_temp_fx = Mpy_32_32( temp, 715827883 /* 1 / 3.0f in Q31 */ );
        subtract_temp_fx = L_shl( subtract_temp_fx, 1 ); /* Q21 */

        /* min_sum_temp = max( -min_sum_total_ratio_db / 6.0f, 0.0f ); */
@@ -4720,7 +4720,7 @@ void ivas_masa_stereotype_detection_fx(
    IF( subtract_target_ratio_db_fx > 0 )
    {
        /* subtract_temp = subtract_target_ratio_db / 3.0f; */
        subtract_temp_fx = Mpy_32_32( subtract_target_ratio_db_fx, 708669604 /* 1 / 3.0f in Q31 */ ); /* Q21 */
        subtract_temp_fx = Mpy_32_32( subtract_target_ratio_db_fx, 715827883 /* 1 / 3.0f in Q31 */ ); /* Q21 */

        /* min_sum_temp = ( min_sum_total_ratio_db + 1.0f ) / 6.0f; */
        min_sum_temp_fx = Mpy_32_32_r( L_add( min_sum_total_ratio_db_fx, ONE_IN_Q21 ), 357913941 /* 1 / 6.0f in Q31 */ ); /* Q21 */
@@ -4741,13 +4741,13 @@ void ivas_masa_stereotype_detection_fx(
    IF( LT_32( lr_total_hi_ratio_db_fx, -25165824 ) ) // 25165824 = 12.0 in Q21
    {
        /* subtract_temp = ( subtract_target_ratio_db + 4.0f ) / 3.0f; */
        subtract_temp_fx = Mpy_32_32( L_add( subtract_target_ratio_db_fx, 8388608 /* 4.0 in Q21 */ ), 708669604 /* 1 / 3.0f in Q31 */ );
        subtract_temp_fx = Mpy_32_32( L_add( subtract_target_ratio_db_fx, 8388608 /* 4.0 in Q21 */ ), 715827883 /* 1 / 3.0f in Q31 */ );

        /* min_sum_temp = min_sum_total_ratio_db / 6.0f; */
        min_sum_temp_fx = Mpy_32_32_r( min_sum_total_ratio_db_fx, 357913941 /* 1 / 6.0f in Q31 */ );

        /* lr_total_hi_temp = ( -lr_total_hi_ratio_db - 12.0f ) / 3.0f; */
        lr_total_hi_temp_fx = Mpy_32_32( L_sub( -lr_total_hi_ratio_db_fx, 25165824 /* 12.0 in Q21 */ ), 708669604 /* 1 / 3.0f in Q31 */ );
        lr_total_hi_temp_fx = Mpy_32_32( L_sub( -lr_total_hi_ratio_db_fx, 25165824 /* 12.0 in Q21 */ ), 715827883 /* 1 / 3.0f in Q31 */ );

        change_to_downmix2_fx = L_add( L_add( subtract_temp_fx, min_sum_temp_fx ), lr_total_hi_temp_fx ); // Q21