Commit de4f5e2f authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_841_fix' into 'main'

Fix for 3gpp issue 841: Bigger differences in MDCT-Stereo to Mono output with short block frames

See merge request !537
parents 756d0f67 0c1b5971
Loading
Loading
Loading
Loading
+27 −6
Original line number Diff line number Diff line
@@ -775,10 +775,31 @@ static void apply_dmx_weights_fx(
                    dot_prod_imag = W_add( dot_prod_imag, W_sub( W_mult_32_32( mdst[0][k][i], sig[1][k][i] ), W_mult_32_32( sig[0][k][i], mdst[1][k][i] ) ) );
                }

                Word16 norm_sum_nrg_L = W_norm( sum_nrg_L );
                Word16 norm_sum_nrg_R = W_norm( sum_nrg_R );
                Word16 norm_dot_prod_real = W_norm( dot_prod_real );
                Word16 norm_dot_prod_imag = W_norm( dot_prod_imag );
                Word16 norm_sum_nrg_L = Q31;
                move16();
                Word16 norm_sum_nrg_R = Q31;
                move16();
                Word16 norm_dot_prod_real = Q31;
                move16();
                Word16 norm_dot_prod_imag = Q31;
                move16();
                IF( sum_nrg_L )
                {
                    norm_sum_nrg_L = W_norm( sum_nrg_L );
                }
                IF( sum_nrg_R )
                {
                    norm_sum_nrg_R = W_norm( sum_nrg_R );
                }
                IF( dot_prod_real )
                {
                    norm_dot_prod_real = W_norm( dot_prod_real );
                }
                IF( dot_prod_imag )
                {
                    norm_dot_prod_imag = W_norm( dot_prod_imag );
                }


                Word16 guard_bit = find_guarded_bits_fx( 4 );
                Word16 min_norm = sub( s_min( s_min( s_min( norm_sum_nrg_L, norm_sum_nrg_R ), norm_dot_prod_real ), norm_dot_prod_imag ), guard_bit );
@@ -851,12 +872,12 @@ static void apply_dmx_weights_fx(
                test();
                IF( sum_nrg_Mid_sqrt == 0 && sum_abs == 0 )
                {
                    full_w_down = 6364;
                    full_w_down = 16384;
                    move16();
                }
                ELSE IF( sum_nrg_Mid_sqrt == 0 && sum_abs != 0 )
                {
                    full_w_down = 5793;
                    full_w_down = 0;
                    move16();
                }
                ELSE