Commit 11891d40 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

fix direct-gain calculation

parent 7432a9fa
Loading
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -835,18 +835,15 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd(
                     &h_dirac_output_synthesis_state.cy_cross_dir_smooth[ch_idx * num_freq_bands],
                     num_freq_bands );
            v_multc( &h_dirac_output_synthesis_state.cy_cross_dir_smooth[ch_idx * num_freq_bands],
                     h_dirac_output_synthesis_params.diffuse_compensation_factor_decorr - 1.f,
                     &h_dirac_output_synthesis_state.cy_cross_dir_smooth[ch_idx * num_freq_bands],
                     num_freq_bands_diff );
            v_multc( &h_dirac_output_synthesis_state.cy_cross_dir_smooth[ch_idx * num_freq_bands + num_freq_bands_diff],
                     h_dirac_output_synthesis_params.diffuse_compensation_factor - 1.f,
                     &h_dirac_output_synthesis_state.cy_cross_dir_smooth[ch_idx * num_freq_bands + num_freq_bands_diff],
                     num_freq_bands - num_freq_bands_diff );
                     &h_dirac_output_synthesis_state.cy_cross_dir_smooth[ch_idx * num_freq_bands],
                     num_freq_bands );

            for ( l = 0; l < num_freq_bands; l++ )
            {
                h_dirac_output_synthesis_state.cy_cross_dir_smooth[ch_idx * num_freq_bands + l] = sqrtf( 1.f + h_dirac_output_synthesis_state.cy_cross_dir_smooth[ch_idx * num_freq_bands + l] );
            }

        }

        /*Directional gain*/
@@ -937,8 +934,8 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd(
            g1 = 0.3679f + onset_filter[l] * ( 0.1175f - 0.3679f );
            g2 = ( 1.f - g1 ) * *( p_gains_dir );
            g2 += g1 * ( *( p_cy_cross_dir_smooth++ ) );
            g2 = max( g2, 0.85f );
            g2 = min( g2, 1.15f );
            g2 = max( g2, 0.99f );
            g2 = min( g2, 2.0f );
            *( p_gains_dir++ ) = g2;
        }
    }