Commit bd01c3e2 authored by vaclav's avatar vaclav
Browse files

resolve conflicts

parent e5ab4419
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -160,8 +160,7 @@


#define CORECODER_BITRATE_SWITCHING                     /* Issue 133: support bitrate switching in core-coder */
#define SBA_BITRATE_SWITCHING                           /* Issue 114: suppport bitrate switching in SBA */
#define IMPR_TC_SWITCHING_MEMORY                        /* reuse core-coder memory when switching between different number of transport channels */
#define SBA_BITRATE_SWITCHING                           /* Issue 114: suppport bitrate switching in SBA - CORECODER_BITRATE_SWITCHING must be defined */


/* ################## End DEVELOPMENT switches ######################### */
+58 −30
Original line number Diff line number Diff line
@@ -607,8 +607,7 @@ ivas_error ivas_sba_dec_reconfigure(
            }
        }
    }
    else
    if ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC &&
    else if ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC &&
#ifdef ALIGN_SID_SIZE
              ( last_ivas_total_brate > IVAS_SID_5k2 || st_ivas->nchan_transport != nchan_transport_old ) )
#else
@@ -655,6 +654,16 @@ ivas_error ivas_sba_dec_reconfigure(
     * Allocate, initalize, and configure SCE/CPE/MCT handles
     *-----------------------------------------------------------------*/

#ifdef CORECODER_BITRATE_SWITCHING
    ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, nCPE_old, nchan_transport_old, sba_dirac_stereo_flag_old );

    /*-----------------------------------------------------------------*
     * HP20 memories
     *-----------------------------------------------------------------*/

    ivas_hp20_dec_reconfig( st_ivas, nchan_hp20_old );
#else

    /* remove dummy CPE element for DFT stereo-like upmix */
    if ( sba_dirac_stereo_flag_old && !st_ivas->sba_dirac_stereo_flag )
    {
@@ -956,6 +965,7 @@ ivas_error ivas_sba_dec_reconfigure(
        count_free( old_mem_hp20_out );
        old_mem_hp20_out = NULL;
    }
#endif

    /*-----------------------------------------------------------------*
     * CLDFB instances
@@ -1033,19 +1043,21 @@ ivas_error ivas_sba_dec_reconfigure(

    return error;
#else
    int16_t i, n;
    int16_t sce_id, cpe_id;
#ifdef CORECODER_BITRATE_SWITCHING
    int16_t i;
    int16_t nchan_transport, nchan_transport_old;
    int16_t nSCE_old, nCPE_old, nchan_hp20_old;
#else
    int16_t i, n, sce_id, cpe_id;
    int16_t nchan_transport, nchan_transport_old;
    int32_t sba_total_brate;
    int16_t nSCE_old, nCPE_old;
#endif
    AUDIO_CONFIG intern_config_old;
    int16_t numCldfbAnalyses_old, numCldfbAnalyses, numCldfbSyntheses_old, numCldfbSyntheses;
    int16_t numCldfbAnalyses_old, numCldfbAnalyses, numCldfbSyntheses, numCldfbSyntheses_old;
    int16_t sba_dirac_stereo_flag_old;
    int32_t ivas_total_brate, last_ivas_total_brate;
    DECODER_CONFIG_HANDLE hDecoderConfig;
    ivas_error error;

    hDecoderConfig = st_ivas->hDecoderConfig;
    error = IVAS_ERR_OK;

    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
@@ -1057,7 +1069,10 @@ ivas_error ivas_sba_dec_reconfigure(

    ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
    numCldfbAnalyses = 0;
    sba_total_brate = ivas_total_brate;

#ifdef CORECODER_BITRATE_SWITCHING
    nchan_hp20_old = getNumChanSynthesis( st_ivas );
#endif

    nSCE_old = st_ivas->nSCE;
    nCPE_old = st_ivas->nCPE;
@@ -1066,7 +1081,7 @@ ivas_error ivas_sba_dec_reconfigure(

    st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order );

    ivas_sba_config( sba_total_brate, st_ivas->sba_analysis_order, -1, &nchan_transport, st_ivas->sba_planar, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, st_ivas->sba_mode );
    ivas_sba_config( ivas_total_brate, st_ivas->sba_analysis_order, -1, &nchan_transport, st_ivas->sba_planar, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, st_ivas->sba_mode );
    st_ivas->nchan_transport = nchan_transport;

    /* renderer might have changed */
@@ -1081,8 +1096,7 @@ ivas_error ivas_sba_dec_reconfigure(

    if ( st_ivas->sba_mode != SBA_MODE_SPAR )
    {
        st_ivas->sba_dirac_stereo_flag = ( st_ivas->nchan_transport == 1 && hDecoderConfig->output_config == AUDIO_CONFIG_STEREO );

        st_ivas->sba_dirac_stereo_flag = ( st_ivas->nchan_transport == 1 && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO );
        if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_planar, st_ivas->sba_mode, -1 ) ) != IVAS_ERR_OK )
        {
            return error;
@@ -1091,10 +1105,11 @@ ivas_error ivas_sba_dec_reconfigure(
    else
    {
        int16_t sba_order_internal;

        sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER );
        ivas_spar_config( ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->hSpar->core_nominal_brate, st_ivas->sid_format );
        ivas_spar_config( st_ivas->hDecoderConfig->ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->hSpar->core_nominal_brate, st_ivas->sid_format );

        if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_planar,
        if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_planar,
                                              st_ivas->sba_mode, IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) != IVAS_ERR_OK )
        {
            return error;
@@ -1140,6 +1155,16 @@ ivas_error ivas_sba_dec_reconfigure(
     * Allocate, initalize, and configure SCE/CPE/MCT handles
     *-----------------------------------------------------------------*/

#ifdef CORECODER_BITRATE_SWITCHING
    ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, nCPE_old, nchan_transport_old, sba_dirac_stereo_flag_old );

    /*-----------------------------------------------------------------*
     * HP20 memories
     *-----------------------------------------------------------------*/

    ivas_hp20_dec_reconfig( st_ivas, nchan_hp20_old );
#else

    if ( nchan_transport == nchan_transport_old )
    {
        for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ )
@@ -1367,11 +1392,11 @@ ivas_error ivas_sba_dec_reconfigure(
            }

            for ( i = 0; i < n; i++ )

            {
                st_ivas->mem_hp20_out[i] = old_mem_hp20_out[i];
                old_mem_hp20_out[i] = NULL;
            }

            for ( ; i < nchan_transport_old; i++ )
            {
                count_free( old_mem_hp20_out[i] );
@@ -1382,6 +1407,7 @@ ivas_error ivas_sba_dec_reconfigure(
            old_mem_hp20_out = NULL;
        }
    }
#endif

    /*-----------------------------------------------------------------*
     * CLDFB instances
@@ -1413,7 +1439,7 @@ ivas_error ivas_sba_dec_reconfigure(
        /* create additional CLDFB synthesis instances */
        for ( i = numCldfbAnalyses_old; i < numCldfbAnalyses; i++ )
        {
            if ( ( error = openCldfb( &( st_ivas->cldfbAnaDec[i] ), CLDFB_ANALYSIS, hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            if ( ( error = openCldfb( &( st_ivas->cldfbAnaDec[i] ), CLDFB_ANALYSIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            {
                return error;
            }
@@ -1435,13 +1461,14 @@ ivas_error ivas_sba_dec_reconfigure(
        /* create additional CLDFB synthesis instances */
        for ( i = numCldfbSyntheses_old; i < numCldfbSyntheses; i++ )
        {
            if ( ( error = openCldfb( &( st_ivas->cldfbSynDec[i] ), CLDFB_SYNTHESIS, hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            if ( ( error = openCldfb( &( st_ivas->cldfbSynDec[i] ), CLDFB_SYNTHESIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
    }

#ifndef CORECODER_BITRATE_SWITCHING
    /*-----------------------------------------------------------------*
     * Set CNA/CNG flags
     *-----------------------------------------------------------------*/
@@ -1487,6 +1514,7 @@ ivas_error ivas_sba_dec_reconfigure(
            return error;
        }
    }
#endif

    /*-------------------------------------------------------------------*
     * Reallocate and initialize binaural rendering handles
+4 −5
Original line number Diff line number Diff line
@@ -187,11 +187,10 @@ ivas_error ivas_core_enc(
         * Pre-processing, incl. Decision matrix
         *---------------------------------------------------------------------*/

        if ( ( error = pre_proc_ivas( st, last_element_mode, element_brate, 
#ifdef SBA_BITRATE_SWITCHING // VE2EF: dirty patch - review needed
                                     ivas_format == SBA_FORMAT ? last_element_brate : element_brate,
#endif                                     
                                     input_frame, old_inp_12k8[n], old_inp_16k[n], &inp[n], &ener[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], new_inp_resamp16k[n], &Voicing_flag[n], old_wsp[n], loc_harm[n], cor_map_sum[n], vad_flag_dtx[n], enerBuffer[n], fft_buff[n], is_MCT, vad_hover_flag[n], flag_16k_smc ) ) != IVAS_ERR_OK )
#ifdef SBA_BITRATE_SWITCHING
        if ( ( error = pre_proc_ivas( st, last_element_mode, element_brate, ivas_format == SBA_FORMAT ? last_element_brate : element_brate, input_frame, old_inp_12k8[n], old_inp_16k[n], &inp[n], &ener[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], new_inp_resamp16k[n], &Voicing_flag[n], old_wsp[n], loc_harm[n], cor_map_sum[n], vad_flag_dtx[n], enerBuffer[n], fft_buff[n], is_MCT, vad_hover_flag[n], flag_16k_smc ) ) != IVAS_ERR_OK )
#else
        if ( ( error = pre_proc_ivas( st, last_element_mode, element_brate, input_frame, old_inp_12k8[n], old_inp_16k[n], &inp[n], &ener[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], new_inp_resamp16k[n], &Voicing_flag[n], old_wsp[n], loc_harm[n], cor_map_sum[n], vad_flag_dtx[n], enerBuffer[n], fft_buff[n], is_MCT, vad_hover_flag[n], flag_16k_smc ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
+0 −3
Original line number Diff line number Diff line
@@ -57,9 +57,6 @@ ivas_error pre_proc_ivas(
    const int32_t element_brate,     /* i  : element bitrate                         */
#ifdef CORECODER_BITRATE_SWITCHING
    const int32_t last_element_brate, /* i  : last element bitrate                    */
#endif
#ifdef SBA_BITRATE_SWITCHING
    const int32_t last_element_brate,              /* i  : last element bitrate                    */
#endif
    const int16_t input_frame,                     /* i  : frame length                            */
    float old_inp_12k8[],                          /* i/o: buffer of old input signal              */
+5 −35
Original line number Diff line number Diff line
@@ -497,36 +497,6 @@ void ivas_dirac_enc_spar_delay_synchro(
    }
#endif


    for ( ch_idx = 0; ch_idx < st_ivas->hEncoderConfig->nchan_inp; ch_idx++ )
    {
        Encoder_State *sts[MCT_MAX_BLOCKS];
        int16_t i_chan = 0;

        /* initializations */
        for ( int16_t sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ )
        {
            sts[sce_id] = st_ivas->hSCE[sce_id]->hCoreCoder[0];
            i_chan++;
        }

        for ( int16_t cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
        {
            for ( int16_t ch = 0; ch < CPE_CHANNELS; ch++ )
            {
                sts[i_chan] = st_ivas->hCPE[cpe_id]->hCoreCoder[ch];
                i_chan++;
            }
        }

        for ( ch_idx = 0; ch_idx < i_chan; ch_idx++ )
        {
            mvr2r( sts[ch_idx]->input, st_ivas->hDirAC->sba_synchro_buffer[ch_idx], st_ivas->hDirAC->num_samples_synchro_delay );
        }
    }
#endif

    {
    for ( ch_idx = 0; ch_idx < st_ivas->hEncoderConfig->nchan_inp; ch_idx++ )
    {
        mvr2r( data_f[ch_idx], tmp_buffer, input_frame );
@@ -534,7 +504,7 @@ void ivas_dirac_enc_spar_delay_synchro(
        mvr2r( tmp_buffer, &data_f[ch_idx][st_ivas->hDirAC->num_samples_synchro_delay], input_frame - st_ivas->hDirAC->num_samples_synchro_delay );
        mvr2r( &tmp_buffer[input_frame - st_ivas->hDirAC->num_samples_synchro_delay], st_ivas->hDirAC->sba_synchro_buffer[ch_idx], st_ivas->hDirAC->num_samples_synchro_delay );
    }
    }

    return;
}

Loading