Commit 723654a6 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

improve prediction formula for HO-DirAC case

parent b33ef432
Loading
Loading
Loading
Loading
+47 −42
Original line number Diff line number Diff line
@@ -1915,9 +1915,22 @@ void ivas_get_spar_md_from_dirac(
            {
                w1 = ratio[band] * ratio[band];
                w2 = ( 1.0f - ratio[band] ) * ( 1.0f - ratio[band] );

                for ( i = 0; i < num_ch; i++ )
                {
                    for ( j = 0; j < num_ch; j++ )
                    {
                        cov_real_dirac[i][j][band] = en_ratio_fac * ( w1 * response_avg[i] * response_avg[j] + w2 * response_avg2[i] * response_avg2[j] );
                        if ( i == j )
                        {
                            cov_real_dirac[i][j][band] += diffuseness[band];
                        }
                    }
                }
            }
            else
#endif

            {
                for ( i = 0; i < num_ch; i++ )
                {
                    for ( j = 0; j < num_ch; j++ )
@@ -1975,14 +1988,6 @@ void ivas_get_spar_md_from_dirac(
                        }
                        else
                        {
#ifdef HODIRAC_PRED
                        if ( hodirac )
                        {
                            cov_real_dirac[i][j][band] = en_ratio_fac * ( w1 * response_avg[i] * response_avg[j] + w2 * response_avg2[i] * response_avg2[j] );
                        }
                        else
#endif
                        {
                            cov_real_dirac[i][j][band] = en_ratio_fac * response_avg[i] * response_avg[j];
                        }
                    }