Commit 74bc4cb0 authored by bayers's avatar bayers
Browse files

several temp fixes for differences between JBM and non-JBM paths (will be...

several temp fixes for differences between JBM and non-JBM paths (will be removed later, issues #825, #826, #827 and MRs !1111, #1112. !1115 are already existing for those)
parent 16553585
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -204,7 +204,10 @@
#ifdef NONBE_UNIFIED_DECODING_PATHS
#define REMOVE_5MS_FLAG
#define FIX_XXX_JBM_PARAMUPMIX_RS
#define FIX_XXX_JBM_SBA
#define FIX_XXX_MASA_CNA
/*#define UNIFY_CHANNEL_MEM_HEAP*/
#define FIX_XXX_CREND_ER
#endif
#define NONBE_FIX_722_MEMORY_LEAK_IN_PARAMUPMIX               /* Dlb : issue 722: memory leak fix in MC param upmix mode with BR switching*/
#define NONBE_FIX_780_ISM_STARTS_WITH_SID                     /* VA: issue 780: fix Crash in ISM decoding when bitstream starts with an SID and output_config is not EXT */
+5 −0
Original line number Diff line number Diff line
@@ -315,7 +315,12 @@ ivas_error ivas_jbm_dec_tc(
                num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate );
                ivas_sba_mix_matrix_determiner( st_ivas->hSpar, p_output, st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames );
            }

#ifdef FIX_XXX_JBM_SBA
            else if ( st_ivas->renderer_type != RENDERER_DISABLE )
#else
            else
#endif
            {
                ivas_spar_dec_agc_pca( st_ivas, p_output, output_frame );
            }
+30 −0
Original line number Diff line number Diff line
@@ -631,6 +631,9 @@ ivas_error ivas_masa_dec_open(
    {
        int16_t nchan_to_allocate;
        TC_BUFFER_MODE buffer_mode;
#ifdef FIX_XXX_MASA_CNA
        int16_t nchan_transport;
#endif

        buffer_mode = TC_BUFFER_MODE_RENDERER;
        if ( st_ivas->mc_mode == MC_MODE_MCMASA && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) )
@@ -642,13 +645,32 @@ ivas_error ivas_masa_dec_open(
            buffer_mode = TC_BUFFER_MODE_BUFFER;
        }

#ifdef FIX_XXX_MASA_CNA
        nchan_transport = ivas_jbm_dec_get_num_tc_channels( st_ivas );
        nchan_to_allocate = nchan_transport;
#else
        nchan_to_allocate = ivas_jbm_dec_get_num_tc_channels( st_ivas );
#endif
        if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_MONO_DOWNMIX )
        {
#ifdef FIX_XXX_MASA_CNA
            nchan_transport = 1;
#endif
            nchan_to_allocate = 1;
        }
#ifdef FIX_XXX_MASA_CNA
        else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC ) )
        {
            /* addtl channel for CNG */
            nchan_to_allocate++;
        }
#endif

#ifdef FIX_XXX_MASA_CNA
        if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_transport, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_to_allocate, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -1510,6 +1532,14 @@ ivas_error ivas_masa_dec_reconfigure(
                }
            }
        }
#ifdef FIX_XXX_MASA_CNA
        else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) )
        {
            /* addtl channel for CNG */
            tc_nchan_to_allocate++;
        }
#endif


#ifdef UNIFY_CHANNEL_MEM_HEAP
        if ( st_ivas->ivas_format != MASA_ISM_FORMAT )
+14 −1
Original line number Diff line number Diff line
@@ -649,6 +649,9 @@ ivas_error ivas_sba_dec_digest_tc(
{
    int16_t ch_idx;
    ivas_error error;
#ifdef FIX_XXX_MASA_CNA
    int16_t nchan_transport;
#endif

    error = IVAS_ERR_OK;

@@ -709,7 +712,17 @@ ivas_error ivas_sba_dec_digest_tc(
    }

    /* if we have a late CNG generation, do it here */
#ifdef FIX_XXX_MASA_CNA
    nchan_transport = st_ivas->nchan_transport;
    if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && ( st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 || ( st_ivas->hDecoderConfig->ivas_total_brate <= IVAS_SID_5k2 && st_ivas->nCPE > 0 && st_ivas->hCPE[0]->nchan_out == 1 ) ) )
    {
        nchan_transport = 1; /* Only one channel transported */
    }
    if ( ( st_ivas->ivas_format != SBA_FORMAT && st_ivas->nchan_transport == 1 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag ) ||
         ( nchan_transport == 1 && st_ivas->nchan_transport != 2 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) )
#else
    if ( st_ivas->nchan_transport == 1 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->ivas_format == SBA_FORMAT )
#endif
    {
        Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0];
        generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[1], nCldfbSlots, st->cna_dirac_flag && st->flag_cna );
+4 −0
Original line number Diff line number Diff line
@@ -1972,7 +1972,11 @@ ivas_error ivas_rend_crendProcessSubframe(
        {
            if ( hCrend->reflections->use_er == 1 && hCrend->reflections->is_ready == 1 )
            {
#ifdef FIX_XXX_CREND_ER
                if ( ( error = ivas_er_process( hCrend->reflections, subframe_len, 0, tc_local, inConfig ) ) != IVAS_ERR_OK )
#else
                if ( ( error = ivas_er_process( hCrend->reflections, subframe_len, subframe_idx, output, inConfig ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }