Commit 9788022b authored by vaclav's avatar vaclav
Browse files

unify *p_tc[] pointers; under UNIFIED_DECODING_PATHS_LEFTOVERS

parent 844963d5
Loading
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ ivas_error ivas_jbm_dec_tc(
            ivas_masa_prerender( st_ivas, p_output, output_frame, nchan_remapped );

            /* external output */
            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT )
            if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT )
            {
                for ( n = 0; n < st_ivas->nchan_ism; n++ )
                {
@@ -991,23 +991,30 @@ ivas_error ivas_jbm_dec_render(

    if ( !st_ivas->hDecoderConfig->Opt_tsm )
    {
#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS
        for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ )
        {
            p_tc[n] = &p_output[n][st_ivas->hTcBuffer->n_samples_rendered];
        }

#endif
        for ( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ )
        {
            st_ivas->hTcBuffer->tc[n] = p_output[n];
        }
    }
#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS
    else
    {
#endif

        for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ )
        {
            p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered];
        }
#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS
    }
#endif

    /*----------------------------------------------------------------*
     * Update combined orientation access index
@@ -1083,7 +1090,11 @@ ivas_error ivas_jbm_dec_render(
#endif
            {
                /* Convert to Ambisonics */
#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
                ivas_ism2sba_sf( p_tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, 0, st_ivas->hIntSetup.ambisonics_order );
#else
                ivas_ism2sba_sf( st_ivas->hTcBuffer->tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order );
#endif
            }

            /* Binaural rendering */
@@ -1212,7 +1223,7 @@ ivas_error ivas_jbm_dec_render(
                    return error;
                }
            }
            else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/
            else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/
            {
                if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, &p_output[st_ivas->nchan_ism] ) ) != IVAS_ERR_OK )
                {
@@ -1221,7 +1232,11 @@ ivas_error ivas_jbm_dec_render(

                for ( n = 0; n < st_ivas->nchan_ism; n++ )
                {
#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
                    mvr2r( p_tc[n], p_output[n], *nSamplesRendered );
#else
                    mvr2r( st_ivas->hTcBuffer->tc[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output[n], *nSamplesRendered );
#endif
                }
            }
            else
@@ -1243,7 +1258,7 @@ ivas_error ivas_jbm_dec_render(
                return error;
            }

            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
            if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
            {
#ifdef DEBUGGING
                assert( st_ivas->ism_mode == ISM_MODE_NONE );
@@ -1261,10 +1276,12 @@ ivas_error ivas_jbm_dec_render(
    }
    else if ( st_ivas->ivas_format == MC_FORMAT )
    {
#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS
        for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ )
        {
            p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered];
        }
#endif
        if ( st_ivas->mc_mode == MC_MODE_MCT )
        {
            int16_t crendInPlaceRotation = FALSE;
@@ -1293,7 +1310,6 @@ ivas_error ivas_jbm_dec_render(
                {
                    if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                                                                   &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : p_tc, p_output, *nSamplesRendered, output_Fs, 0 ) ) != IVAS_ERR_OK )

                    {
                        return error;
                    }