Commit 417aecf3 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into OBJ_EDITING_formal_impr

parents bfb475dd b746a955
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -188,7 +188,9 @@
#define NONBE_FIX_1197_OMASA_META_BUFFER                /* Nokia: OMASA ISM_MASA_MODE_PARAM_ONE_OBJ history zero in rateswitching */

#define FIX_1139_REV_COLORATION_SHORT_T60               /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */
#define NONBE_FIX_1208_DFT_STEREO_PLC_BURST             /* Ericsson: Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */
#define FIX_1206_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE  /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */
#define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH             /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */

/* ##################### End NON-BE switches ########################### */

+12 −0
Original line number Diff line number Diff line
@@ -572,6 +572,9 @@ ivas_error ivas_dec_setup(
            }

            /* this should be non-zero if original input format was MASA_ISM_FORMAT */
#ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH
            st_ivas->ism_mode = ISM_MODE_NONE;
#endif
            st_ivas->nchan_ism = st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 3] + 2 * st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 2];

            if ( st_ivas->nchan_ism > 0 )
@@ -589,6 +592,7 @@ ivas_error ivas_dec_setup(
                {
                    st_ivas->nchan_ism = 1;
                }

                /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 and the corresponding bit is not used here*/
                st_ivas->nchan_transport = 2;
                element_mode_flag = 1;
@@ -832,6 +836,14 @@ ivas_error ivas_dec_setup(
            }
        }

#ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH
        if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == MASA_FORMAT )
        {
            st_ivas->nchan_ism = 0;
            st_ivas->ism_mode = ISM_MODE_NONE;
        }

#endif
        if ( st_ivas->ivas_format == ISM_FORMAT )
        {
            ISM_MODE last_ism_mode = st_ivas->ism_mode;
+3 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ ivas_error ivas_masa_decode(
    {
        if ( !( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) )
        {
#ifdef FIX_HRTF_LOAD
#if ( defined FIX_HRTF_LOAD || defined NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH )
            if ( ivas_format == MASA_FORMAT )
            {
                /* re-read the number of objects, needed in case of bad frame  */
@@ -1490,6 +1490,7 @@ ivas_error ivas_masa_dec_reconfigure(

    ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate );

#ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH
    if ( st_ivas->ivas_format == MASA_FORMAT )
    {
        if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
@@ -1501,6 +1502,7 @@ ivas_error ivas_masa_dec_reconfigure(
        st_ivas->ism_mode = ISM_MODE_NONE;
    }

#endif
    {
        int16_t tc_nchan_to_allocate;
        int16_t tc_nchan_transport;
+12 −0
Original line number Diff line number Diff line
@@ -80,6 +80,9 @@ void stereo_dft_res_ecu(
    float fac;
    float trigo_dec[STEREO_DFT32MS_N_8k / 2 + 1];
    int16_t trigo_step;
#ifdef NONBE_FIX_1208_DFT_STEREO_PLC_BURST
    int16_t time_offs;
#endif

    set_zero( pDFT_RES, L_FRAME8k );

@@ -106,7 +109,12 @@ void stereo_dft_res_ecu(
    if ( k == 0 )
    {
        mvr2r( pDFT_RES, res_buf, L_FRAME8k );
#ifdef NONBE_FIX_1208_DFT_STEREO_PLC_BURST
        time_offs = min( MAX16B, hStereoDft->time_offs + output_frame );
        stereo_dft_res_subst_spec( hStereoDft, res_buf, DFT_PRED_RES, time_offs, L_res, L_FRAME8k, k, num_plocs, plocs, plocsi, FALSE );
#else
        stereo_dft_res_subst_spec( hStereoDft, res_buf, DFT_PRED_RES, hStereoDft->time_offs + output_frame, L_res, L_FRAME8k, k, num_plocs, plocs, plocsi, FALSE );
#endif

        rfft( res_buf, trigo_dec, L_FRAME8k, +1 );

@@ -133,7 +141,11 @@ void stereo_dft_res_ecu(
        }

        /*in case of burst error*/
#ifdef NONBE_FIX_1208_DFT_STEREO_PLC_BURST
        hStereoDft->time_offs = min( MAX16B, hStereoDft->time_offs + L_FRAME8k );
#else
        hStereoDft->time_offs += L_FRAME8k;
#endif
    }

    set_zero( DFT_PRED_RES, 2 * L_res );
+2 −0
Original line number Diff line number Diff line
@@ -1046,11 +1046,13 @@ ivas_error IVAS_DEC_ReadFormat(

            // st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200

#ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH
            if ( st_ivas->ivas_format == MASA_FORMAT )
            {
                st_ivas->nchan_ism = 0; // ToDo: temporary hack to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1199
            }

#endif
            if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity )
            {
                if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &st_ivas->hIntSetup, mc_mode_old, ism_mode_old, &hIvasDec->nSamplesFlushed, pcm_type_API_to_internal( hIvasDec->pcmType ), hIvasDec->flushbuffer ) ) != IVAS_ERR_OK )
Loading