Commit 807246f5 authored by bayers's avatar bayers
Browse files

adress remaining ToDo comments, mainly invalid, last valid one done

parent 7b1e13d5
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1732,7 +1732,6 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode(
    TC_BUFFER_MODE buffer_mode;
    buffer_mode = TC_BUFFER_MODE_BUFFER;

    /*:TODO: wrap this maybe nicer without directly accessing the st_ivas struct...*/
    switch ( st_ivas->renderer_type )
    {
            /* all renderers where we are done after TC decoding (might include DMX to mono/stereo */
+28 −5
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, uint16_t *nTcBufferG
static ivas_error IVAS_DEC_GetTcSamples( IVAS_DEC_HANDLE hIvasDec, float *pcmBuf, int16_t *nOutSamples );
static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesForRendering, int16_t *nSamplesResidual, float *pcmBuf );
static ivas_error IVAS_DEC_GetRenderedSamples( IVAS_DEC_HANDLE hIvasDec, const uint16_t nSamplesForRendering, uint16_t *nSamplesRendered, uint16_t *nSamplesAvailableNext, int16_t *pcmBuf );
static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( IVAS_DEC_HANDLE hIvasDec, int16_t *nSamplesBuffered );
#endif

/*---------------------------------------------------------------------*
@@ -669,10 +670,8 @@ ivas_error IVAS_DEC_EnableVoIP(
#endif

#ifdef JBM_TSM_ON_TCS
    /* postpone init of time scaler until we know the real number of TCs */
    /* postpone init of time scaler and output FIFO until we know the real number of TCs */
    hIvasDec->hVoIP->hTimeScaler = NULL;
    /* create output pcm fifo*/
    /* :TODO: also provide CLDFB output FIFO if things work out */
#ifdef VARIABLE_SPEED_DECODING
    if ( hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED )
    {
@@ -1043,6 +1042,25 @@ ivas_error IVAS_DEC_GetRenderedSamples(
    }


    return error;
}

ivas_error IVAS_DEC_GetBufferedNumberOfSamples(
    IVAS_DEC_HANDLE hIvasDec, /* i/o : IVAS decoder handle                                                     */
    int16_t *nSamplesBuffered /* o   : number of samples still buffered */
)
{
    ivas_error error;
    error = IVAS_ERR_OK;

    *nSamplesBuffered = 0;
    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    *nSamplesBuffered = hIvasDec->st_ivas->hTcBuffer->n_samples_buffered - hIvasDec->st_ivas->hTcBuffer->n_samples_rendered;

    return error;
}
#endif
@@ -1862,7 +1880,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples(
    maxScaling = hVoIP->speedFac;
#endif

    /* TODO(mcjbm): ringbuffer capacity should be configurable by user */
#ifdef JBM_TSM_ON_TCS
    if ( ( hVoIP->hFifoOut != NULL && nSamplesPerChannel > hVoIP->hFifoOut->capacity ) || nSamplesPerChannel == 0 )
#else
@@ -1900,7 +1917,13 @@ ivas_error IVAS_DEC_VoIP_GetSamples(
            }
            else
            {
                extBufferedSamples = nSamplesRendered; /* TODO: JBM use renderer residual samples here */
                int16_t nSamplesBuffered;
                nSamplesBuffered = 0;
                if ( hIvasDec->hasBeenFedFirstGoodFrame )
                {
                    IVAS_DEC_GetBufferedNumberOfSamples( hIvasDec, &nSamplesBuffered );
                }
                extBufferedSamples = nSamplesRendered + nSamplesBuffered;
            }
#else
        extBufferedSamples = pcmdsp_fifo_nReadableSamplesPerChannel( hVoIP->hFifoAfterTimeScaler );