Commit ab70c281 authored by bayers's avatar bayers
Browse files

deactivate 5ms rendering mem optim (did not bring additional benefit), fix...

deactivate 5ms rendering mem optim (did not bring additional benefit), fix small 5ms issues with ParamMC and ParamISM, fix 20ms decoding path issue
parent e816e15f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@
#define NONBE_FIX_589_JBM_TC_OFFSETS
#define API_5MS
#ifdef API_5MS
#define JITTER_MEM_OPTIM_RENDERING
/*#define JITTER_MEM_OPTIM_RENDERING*/
#define API_5MS_BASELINE
#endif
#define LIB_REND_FIX_HRTFPARAMBIN_MEMLEAK
+11 −3
Original line number Diff line number Diff line
@@ -673,7 +673,7 @@ ivas_error ivas_param_ism_dec_open(
            }
        }
    }
#ifndef API_5MS
#if !defined( API_5MS ) || defined API_5MS_BASELINE
    else
    {
        hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc = NULL;
@@ -1270,7 +1270,11 @@ void ivas_param_ism_dec_digest_tc(
        }
    }
#ifdef API_5MS
    if ( st_ivas->hDecoderConfig->Opt_tsm )
    if ( st_ivas->hDecoderConfig->Opt_tsm
#ifdef API_5MS_BASELINE
         || !st_ivas->hDecoderConfig->Opt_5ms
#endif
    )
    {
        ivas_ism_param_dec_tc_gain_ajust( st_ivas, nCldfbSlots * hSpatParamRendCom->num_freq_bands, (int16_t) ( st_ivas->hDecoderConfig->output_Fs / ( 2 * FRAMES_PER_SEC ) ), transport_channels_f );
    }
@@ -1320,7 +1324,11 @@ void ivas_param_ism_dec_digest_tc(
        for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ )
        {
#ifdef API_5MS
            if ( st_ivas->hDecoderConfig->Opt_tsm )
            if ( st_ivas->hDecoderConfig->Opt_tsm
#ifdef API_5MS_BASELINE
                 || !st_ivas->hDecoderConfig->Opt_5ms
#endif
            )
            {
#endif

+18 −125
Original line number Diff line number Diff line
@@ -757,126 +757,6 @@ ivas_error ivas_jbm_dec_render(
        nSamplesAskedLocal = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered] * st_ivas->hTcBuffer->n_samples_granularity;
#endif

        /* tmu2bay : needs merge resolution */
        // <<<<<<< HEAD
        //             /* HP filtering */
        // #ifdef SPLIT_REND_WITH_HEAD_ROT
        //             /*no HPF when rendering is already done*/
        //             if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM )
        // #endif
        //             {
        //                 for ( n = 0; n < st_ivas->nchan_transport; n++ )
        //                 {
        //                     if ( n != LFE_CHANNEL )
        //                     {
        //                         hp20( p_output[n], *nSamplesRendered, st_ivas->mem_hp20_out[n], output_Fs );
        //                     }
        //                 }
        //             }

        //             if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) )
        //             {
        //                 ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, *nSamplesRendered, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE );
        //             }

        //             /* Rendering */
        //             if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
        //             {
        // #ifdef SPLIT_REND_WITH_HEAD_ROT
        //                 /*handled in CLDFB domain already*/
        //                 if ( ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) &&
        //                      ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        // #endif
        //                 {
        //                     ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output );
        //                 }
        //             }
        //             else if ( st_ivas->renderer_type == RENDERER_MC )
        //             {
        //                 ivas_ls_setup_conversion( st_ivas, MC_PARAMUPMIX_MAX_INPUT_CHANS, *nSamplesRendered, p_output, p_output );
        //             }
        //             else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
        //             {
        //                 ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f );
        //             }
        //             else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD )
        //             {
        //                 if ( ( ivas_td_binaural_renderer( st_ivas, p_output, *nSamplesRendered ) ) != IVAS_ERR_OK )
        //                 {
        //                     return error;
        //                 }

        //                 ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output );
        //             }
        //         }
        // #endif
        //         else if ( st_ivas->mc_mode == MC_MODE_PARAMMC )
        //         {
        //             ivas_param_mc_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output );
        //         }
        //         else if ( st_ivas->mc_mode == MC_MODE_MCMASA )
        //         {
        //             int16_t offset = hSpatParamRendCom->slots_rendered * hSpatParamRendCom->slot_size;
        //             nchan_remapped = st_ivas->nchan_transport;

        //             if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        //             {
        //                 ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output );
        //             }
        //             else if ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) /* rendering to CICPxx and Ambisonics */
        //             {
        //                 ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output );

        //                 if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
        //                 {
        //                     /* we still need to copy the separate channel if available  */
        //                     if ( st_ivas->hOutSetup.separateChannelEnabled )
        //                     {
        //                         mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered );
        //                     }

        //                     ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f );
        //                 }
        //                 else if ( st_ivas->intern_config == AUDIO_CONFIG_5_1 && ( output_config == AUDIO_CONFIG_5_1_2 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1 ) )
        //                 {
        //                     for ( n = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; n < st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; n++ )
        //                     {
        //                         set_zero( output[n], *nSamplesRendered );
        //                     }
        //                 }
        //             }

        //             /* copy discrete C and TD LFE from internal TC to output  */
        //             if ( st_ivas->hOutSetup.separateChannelEnabled )
        //             {
        //                 if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 ||
        //                      output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 ||
        //                      output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) )
        //                 {
        //                     mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL] + offset, output[LFE_CHANNEL], *nSamplesRendered );
        //                     mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered );
        //                 }
        //                 else if ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 )
        //                 {
        //                     /* Delay the separated channel to sync with the DirAC rendering */
        //                     mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered );
        //                 }
        //             }
        //         }
        //     }

        //     /*----------------------------------------------------------------*
        //      * Write IVAS output channels
        //      *   - compensation for saturation
        //      *   - float to integer conversion
        //      *----------------------------------------------------------------*/

        //     st_ivas->hTcBuffer->n_samples_available -= *nSamplesRendered;
        //     st_ivas->hTcBuffer->n_samples_rendered += *nSamplesRendered;

        //     if ( st_ivas->hTcBuffer->n_samples_discard > 0 )
        //     {
        // >>>>>>> 3702d9f6a3bba65a7309b2b7a67dbebc74e4c8e5
        for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ )
        {
            p_output[n] = &output[n][0];
@@ -1232,6 +1112,11 @@ ivas_error ivas_jbm_dec_render(
#endif

                /* HP filtering */
#ifdef SPLIT_REND_WITH_HEAD_ROT
                /*no HPF when rendering is already done*/
                if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM )
#endif
                {
                    for ( n = 0; n < st_ivas->nchan_transport; n++ )
                    {
                        if ( n != LFE_CHANNEL )
@@ -1239,6 +1124,7 @@ ivas_error ivas_jbm_dec_render(
                            hp20( p_output[n], *nSamplesRendered, st_ivas->mem_hp20_out[n], output_Fs );
                        }
                    }
                }

                if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) )
                {
@@ -1252,12 +1138,19 @@ ivas_error ivas_jbm_dec_render(
                /* Rendering */
                if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
                {
#ifdef SPLIT_REND_WITH_HEAD_ROT
                    /*handled in CLDFB domain already*/
                    if ( ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) &&
                         ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
#endif
                    {
#ifdef JITTER_MEM_OPTIM_RENDERING
                        ivas_binaural_add_LFE( st_ivas, nSamplesRenderedLocal, p_output, p_output );
#else
                        ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output );
#endif
                    }
                }
                else if ( st_ivas->renderer_type == RENDERER_MC )
                {
#ifdef JITTER_MEM_OPTIM_RENDERING
+5 −1
Original line number Diff line number Diff line
@@ -1496,7 +1496,11 @@ void ivas_param_mc_dec_digest_tc(
    for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ )
    {
#ifdef API_5MS
        if ( st_ivas->hDecoderConfig->Opt_tsm )
        if ( st_ivas->hDecoderConfig->Opt_tsm
#ifdef API_5MS_BASELINE
             || !st_ivas->hDecoderConfig->Opt_5ms
#endif
        )
        {
#endif
            float RealBuffer[CLDFB_NO_CHANNELS_MAX];
+1 −1
Original line number Diff line number Diff line
@@ -1015,7 +1015,7 @@ ivas_error IVAS_DEC_GetSamples(
    }
#ifdef API_5MS_BASELINE
    /* only for 1st step 5ms API, split rendering still needs to go through the old decoding function */
    else if ( hIvasDec->st_ivas->hDecoderConfig->Opt_5ms )
    else if ( !hIvasDec->st_ivas->hDecoderConfig->Opt_5ms )
    {
        if ( ( error = _GetSamples( hIvasDec, pcmBuf, nOutSamples ) ) != IVAS_ERR_OK )
        {