Commit 5101e0c8 authored by vaclav's avatar vaclav
Browse files

accept NONBE_FIX_826_JBM_MASA_CNA_CNG

parent 391642fb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -159,7 +159,6 @@
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_826_JBM_MASA_CNA_CNG                        /* FhG: issue #826:  Resolve "JBM MASA: CNA and CNG not in sync with non-JBM decoding" */
#define NONBE_FIX_835_JBM_PARAMUPMIX_HEADROT                  /* FhG: issue #835: Resolve "JBM: ParamUpmix head rotation broken" */
#define NONBE_FIX_838_CRASH_24_4_WB                           /* FhG: Issue 838: fix encoder crashes for Unified Stereo and MASA 2 TC at 24.4 kbps WB due to missing IGF (re-) allocation */
#define NONBE_FIX_839_MC_RS_CHANNEL_ALLOC                     /* FhG: Issues #839: problems with reallocation of the channels on the heap in case of MC RS */
+3 −18
Original line number Diff line number Diff line
@@ -624,11 +624,8 @@ ivas_error ivas_masa_dec_open(
    /* allocate transport channels*/
    if ( st_ivas->hDecoderConfig->Opt_5ms && st_ivas->hTcBuffer == NULL && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC )
    {
        int16_t nchan_to_allocate;
        int16_t nchan_to_allocate, nchan_transport;
        TC_BUFFER_MODE buffer_mode;
#ifdef NONBE_FIX_826_JBM_MASA_CNA_CNG
        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 ) )
@@ -640,32 +637,21 @@ ivas_error ivas_masa_dec_open(
            buffer_mode = TC_BUFFER_MODE_BUFFER;
        }

#ifdef NONBE_FIX_826_JBM_MASA_CNA_CNG
        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 NONBE_FIX_826_JBM_MASA_CNA_CNG
            nchan_transport = 1;
#endif
            nchan_to_allocate = 1;
        }
#ifdef NONBE_FIX_826_JBM_MASA_CNA_CNG
        else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC ) )
        {
            /* addtl channel for CNG */
            nchan_to_allocate++;
        }
#endif

#ifdef NONBE_FIX_826_JBM_MASA_CNA_CNG
        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;
        }
@@ -1514,13 +1500,12 @@ ivas_error ivas_masa_dec_reconfigure(
                }
            }
        }
#ifdef NONBE_FIX_826_JBM_MASA_CNA_CNG
        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

        if ( tc_nchan_transport != st_ivas->hTcBuffer->nchan_transport_jbm || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || buffer_mode_new != st_ivas->hTcBuffer->tc_buffer_mode )
        {
            if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, buffer_mode_new, tc_nchan_transport, tc_nchan_to_allocate, tc_nchan_to_allocate, n_samples_granularity ) ) != IVAS_ERR_OK )
+2 −8
Original line number Diff line number Diff line
@@ -715,10 +715,7 @@ void ivas_sba_dec_digest_tc(
    const int16_t nSamplesForRendering /* i  : number of samples provided   */
)
{
    int16_t ch_idx;
#ifdef NONBE_FIX_826_JBM_MASA_CNA_CNG
    int16_t nchan_transport;
#endif
    int16_t ch_idx, nchan_transport;

    /* set the md map */
    if ( st_ivas->hDirAC )
@@ -777,17 +774,14 @@ void ivas_sba_dec_digest_tc(
    }

    /* if we have a late CNG generation, do it here */
#ifdef NONBE_FIX_826_JBM_MASA_CNA_CNG
    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->ivas_format != SBA_ISM_FORMAT ) && st_ivas->nchan_transport == 1 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag ) ||
         ( ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) && ( 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 );