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

Merge branch '3gpp_issue_821_fix' into 'main'

Fix for 3GPP issue 821 Synthesis quality issues for multi channels at low bit rate [13.2 to 32 kbps]

See merge request !484
parents 96c285ba e94ed014
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -4591,7 +4591,7 @@ void ivas_dirac_dec_render_sf_fx(
        test();
        test();
        IF( L_and( h_dirac_output_synthesis_params->use_onset_filters, L_and( NE_16( hDirAC->hConfig->dec_param_estim, TRUE ), NE_16( hDirACRend->synthesisConf, DIRAC_SYNTHESIS_GAIN_SHD ) ) ) )
        IF( L_and( h_dirac_output_synthesis_params->use_onset_filters, L_and( NE_16( hDirAC->hConfig->dec_param_estim, TRUE ), NE_16( hDirACRend->synthesisConf, DIRAC_SYNTHESIS_GAIN_SHD ) ) ) )
        {
        {
            Scale_sig32( h_dirac_output_synthesis_state->diffuse_power_factor_fx, h_dirac_output_synthesis_params->max_band_decorr, sub( Q31, h_dirac_output_synthesis_state->diffuse_power_factor_q ) );
            Scale_sig32( h_dirac_output_synthesis_state->diffuse_power_factor_fx, h_dirac_output_synthesis_state->diff_dir_power_factor_len, sub( Q31, h_dirac_output_synthesis_state->diffuse_power_factor_q ) );
            h_dirac_output_synthesis_state->diffuse_power_factor_q = Q31;
            h_dirac_output_synthesis_state->diffuse_power_factor_q = Q31;
            move16();
            move16();


@@ -4603,11 +4603,11 @@ void ivas_dirac_dec_render_sf_fx(
        test();
        test();
        IF( L_and( EQ_16( hDirAC->hConfig->dec_param_estim, TRUE ), NE_16( hDirACRend->synthesisConf, DIRAC_SYNTHESIS_GAIN_SHD ) ) )
        IF( L_and( EQ_16( hDirAC->hConfig->dec_param_estim, TRUE ), NE_16( hDirACRend->synthesisConf, DIRAC_SYNTHESIS_GAIN_SHD ) ) )
        {
        {
            scale_sig32( h_dirac_output_synthesis_state->direct_power_factor_fx, hSpatParamRendCom->num_freq_bands, sub( Q31, h_dirac_output_synthesis_state->direct_power_factor_q ) );
            scale_sig32( h_dirac_output_synthesis_state->direct_power_factor_fx, h_dirac_output_synthesis_state->diff_dir_power_factor_len, sub( Q31, h_dirac_output_synthesis_state->direct_power_factor_q ) );
            h_dirac_output_synthesis_state->direct_power_factor_q = Q31;
            h_dirac_output_synthesis_state->direct_power_factor_q = Q31;
            move16();
            move16();


            scale_sig32( h_dirac_output_synthesis_state->diffuse_power_factor_fx, hSpatParamRendCom->num_freq_bands, sub( Q31, h_dirac_output_synthesis_state->diffuse_power_factor_q ) );
            scale_sig32( h_dirac_output_synthesis_state->diffuse_power_factor_fx, h_dirac_output_synthesis_state->diff_dir_power_factor_len, sub( Q31, h_dirac_output_synthesis_state->diffuse_power_factor_q ) );
            h_dirac_output_synthesis_state->diffuse_power_factor_q = Q31;
            h_dirac_output_synthesis_state->diffuse_power_factor_q = Q31;
            move16();
            move16();


@@ -4801,7 +4801,7 @@ void ivas_dirac_dec_render_sf_fx(
        }
        }
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q, Q31 ) )
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q, Q31 ) )
        {
        {
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx, ( size_ho / hDirACRend->num_outputs_dir ), sub( Q31, hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q ) );
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx, h_dirac_output_synthesis_state->diff_dir_power_factor_len, sub( Q31, hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q ) );
        }
        }
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.direct_responses_q, Q31 ) )
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.direct_responses_q, Q31 ) )
        {
        {
@@ -4809,7 +4809,7 @@ void ivas_dirac_dec_render_sf_fx(
        }
        }
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_q, Q31 ) )
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_q, Q31 ) )
        {
        {
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_fx, hDirACRend->h_output_synthesis_psd_params.max_band_decorr, sub( Q31, hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_q ) );
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_fx, h_dirac_output_synthesis_state->diff_dir_power_factor_len, sub( Q31, hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_q ) );
        }
        }
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.q_cy_auto_diff_smooth, Q26 ) )
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.q_cy_auto_diff_smooth, Q26 ) )
        {
        {
@@ -4884,7 +4884,7 @@ void ivas_dirac_dec_render_sf_fx(


        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q, Q31 ) )
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q, Q31 ) )
        {
        {
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx, hSpatParamRendCom->num_freq_bands, sub( Q31, hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q ) );
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx, h_dirac_output_synthesis_state->diff_dir_power_factor_len, sub( Q31, hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q ) );
        }
        }
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.direct_responses_q, Q31 ) )
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.direct_responses_q, Q31 ) )
        {
        {
@@ -4892,7 +4892,7 @@ void ivas_dirac_dec_render_sf_fx(
        }
        }
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_q, Q31 ) )
        IF( NE_16( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_q, Q31 ) )
        {
        {
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_fx, hSpatParamRendCom->num_freq_bands, sub( Q31, hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_q ) );
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_fx, h_dirac_output_synthesis_state->diff_dir_power_factor_len, sub( Q31, hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_q ) );
        }
        }
        IF( NE_16( q_diffuseness_vector, Q31 ) )
        IF( NE_16( q_diffuseness_vector, Q31 ) )
        {
        {
+1 −0
Original line number Original line Diff line number Diff line
@@ -1471,6 +1471,7 @@ ivas_error ivas_dirac_alloc_mem_fx(


    hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx = hDirAC_mem->direct_power_factor_fx;
    hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx = hDirAC_mem->direct_power_factor_fx;
    hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_fx = hDirAC_mem->diffuse_power_factor_fx;
    hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_fx = hDirAC_mem->diffuse_power_factor_fx;
    hDirACRend->h_output_synthesis_psd_state.diff_dir_power_factor_len = size_pf;
    set_zero_fx( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx, size_pf );
    set_zero_fx( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx, size_pf );
    set_zero_fx( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_fx, size_pf );
    set_zero_fx( hDirACRend->h_output_synthesis_psd_state.diffuse_power_factor_fx, size_pf );
    hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q = Q31;
    hDirACRend->h_output_synthesis_psd_state.direct_power_factor_q = Q31;
+1 −0
Original line number Original line Diff line number Diff line
@@ -451,6 +451,7 @@ typedef struct dirac_output_synthesis_state_structure


    Word16 direct_power_factor_q;
    Word16 direct_power_factor_q;
    Word16 diffuse_power_factor_q;
    Word16 diffuse_power_factor_q;
    Word16 diff_dir_power_factor_len;


    Word32 *proto_power_smooth_fx; /* Smoothed power of the prototype signals. Size: num_freq_bands*num_channels. */
    Word32 *proto_power_smooth_fx; /* Smoothed power of the prototype signals. Size: num_freq_bands*num_channels. */
    Word16 proto_power_smooth_q;
    Word16 proto_power_smooth_q;