Commit 7b879bdb authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

replace output to p_output in SBA_ISM branch in ivas_jbm_dec

parent 90b15a07
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -439,7 +439,7 @@ ivas_error ivas_jbm_dec_tc(
        if ( st_ivas->nSCE == 1 )
        {
            st = st_ivas->hSCE[0]->hCoreCoder[0];
            if ( ( error = ivas_sce_dec( st_ivas, 0, &output[0], output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_sce_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
            {
                return error;
            }
@@ -447,7 +447,7 @@ ivas_error ivas_jbm_dec_tc(
        else if ( st_ivas->nCPE == 1 )
        {
            st = st_ivas->hCPE[0]->hCoreCoder[0];
            if ( ( error = ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
            {
                return error;
            }
@@ -455,7 +455,7 @@ ivas_error ivas_jbm_dec_tc(
        else if ( st_ivas->nCPE > 1 )
        {
            st = st_ivas->hCPE[0]->hCoreCoder[0];
            if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_mct_dec( st_ivas, p_output, output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
            {
                return error;
            }
@@ -463,27 +463,27 @@ ivas_error ivas_jbm_dec_tc(

        if ( st_ivas->sba_dirac_stereo_flag )
        {
            ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, &output[sba_ch_idx], &output[sba_ch_idx], st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame );
            ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, &p_output[sba_ch_idx], &p_output[sba_ch_idx], st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame );

            if ( st_ivas->hSpar->hPCA != NULL )
            {
                ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, &output[sba_ch_idx] );
                ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, &p_output[sba_ch_idx] );
            }

            ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi,
                                       ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate,
                                                                           st_ivas->last_active_ivas_total_brate ) );

            ivas_sba_dirac_stereo_dec( st_ivas, &output[sba_ch_idx], output_frame, 0 );
            ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame, 0 );
        }

        /* HP filtering */
        for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ )
        {
            hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs );
            hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs );
        }

        nchan_remapped = ivas_sba_remapTCs( &output[sba_ch_idx], st_ivas, output_frame );
        nchan_remapped = ivas_sba_remapTCs( &p_output[sba_ch_idx], st_ivas, output_frame );

#ifdef DEBUG_OSBA
        if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
@@ -503,27 +503,27 @@ ivas_error ivas_jbm_dec_tc(
        {
            num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate );

            ivas_sba_mix_matrix_determiner( st_ivas->hSpar, &output[sba_ch_idx], st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames );
            ivas_sba_mix_matrix_determiner( st_ivas->hSpar, &p_output[sba_ch_idx], st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames );
        }
        else if ( st_ivas->renderer_type != RENDERER_DISABLE && !st_ivas->sba_dirac_stereo_flag )
        {
            ivas_spar_dec_agc_pca( st_ivas, &output[sba_ch_idx], output_frame );
            ivas_spar_dec_agc_pca( st_ivas, &p_output[sba_ch_idx], output_frame );
        }

        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
        {
            /* loudness correction */
            ivas_dirac_dec_binaural_sba_gain( &output[sba_ch_idx], nchan_remapped, output_frame );
            ivas_dirac_dec_binaural_sba_gain( &p_output[sba_ch_idx], nchan_remapped, output_frame );
        }
        else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {

            ivas_mono_downmix_render_passive( st_ivas, output, output_frame );
            ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame );

            /* add W */
            for ( n = 0; n < nchan_out; n++ )
            {
                v_add( output[n], output[n + max( nchan_out, nchan_ism )], output[n], output_frame );
                v_add( p_output[n], p_output[n + max( nchan_out, nchan_ism )], p_output[n], output_frame );
            }
        }
    }