Commit f89c7e4d authored by bayers's avatar bayers
Browse files

fix problems with 0dof split rendering init by moving the call to the setup...

fix problems with 0dof split rendering init by moving the call to the setup function to API level. Added some comments
parent 0945d392
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ ivas_error ivas_dec(

    push_wmops( "ivas_dec" );

#ifndef API_5MS_BASELINE
    /*----------------------------------------------------------------*
     * IVAS decoder setup
     * - read IVAS format signaling
@@ -130,6 +131,7 @@ ivas_error ivas_dec(
            return error;
        }
    }
#endif

    /*----------------------------------------------------------------*
     * Initialization of local vars after struct has been set
+2 −0
Original line number Diff line number Diff line
@@ -1602,7 +1602,9 @@ void ivas_dirac_dec_set_md_map(

    ivas_jbm_dec_get_adapted_subframes( nCldfbTs, hSpatParamRendCom->subframe_nbslots, &hSpatParamRendCom->nb_subframes );
#ifdef API_5MS
    /* copy also to tc buffer */
#ifdef MASA_AND_OBJECTS
    /* only for non-combined formats and combinded formats w/o discrete objects */
    if ( st_ivas->ivas_format != MASA_ISM_FORMAT || st_ivas->ism_mode != ISM_MASA_MODE_DISC )
#endif
    {
+110 −74
Original line number Diff line number Diff line
@@ -1088,6 +1088,13 @@ ivas_error IVAS_DEC_GetSamples(
    nSamplesRendered = 0;
    nOutChannels = 0;

#ifdef API_5MS_BASELINE
    nSamplesRendered_loop = 0;
    l_ts = 0;
    nTransportChannels = 0;
#endif


    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
@@ -1117,8 +1124,31 @@ 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
    {
        /* check if we need to run the setup function */
        if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame )
        {
            /* setup */
            if ( ( error = IVAS_DEC_Setup( hIvasDec, &l_ts, &nTransportChannels, &nOutChannels, &nSamplesRendered_loop,
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
                                           pcmType,
                                           pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels )
#else
                                           pcmBuf + nSamplesRendered * nOutChannels
#endif

                                               ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
            /* :TODO: change nSamplesAsked also if we are in 5ms 0dof split rendering... */
#endif
        }
        if ( !hIvasDec->st_ivas->hDecoderConfig->Opt_5ms )
        {
            if ( ( error = _GetSamples( hIvasDec,
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
@@ -1135,6 +1165,7 @@ ivas_error IVAS_DEC_GetSamples(
            hIvasDec->nSamplesRendered = *nOutSamples;
            nSamplesRendered = *nOutSamples;
            hIvasDec->needNewFrame = true;
            hIvasDec->hasBeenFedFrame = false;
            *needNewFrame = true;
        }
#endif
@@ -1144,6 +1175,7 @@ ivas_error IVAS_DEC_GetSamples(
            if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame )
            {
                int16_t nResidualSamples, nSamplesTcsScaled;
#ifndef API_5MS_BASELINE
                /* setup */
                if ( ( error = IVAS_DEC_Setup( hIvasDec, &l_ts, &nTransportChannels, &nOutChannels, &nSamplesRendered_loop,
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
@@ -1157,6 +1189,7 @@ ivas_error IVAS_DEC_GetSamples(
                {
                    return error;
                }
#endif
                nSamplesRendered += nSamplesRendered_loop;
                if ( nTransportChannels != hIvasDec->nTransportChannelsOld )
                {
@@ -1231,6 +1264,9 @@ ivas_error IVAS_DEC_GetSamples(
                *needNewFrame = false;
            }
        }
#ifdef API_5MS_BASELINE
    }
#endif

    *nOutSamples = nSamplesRendered;