Commit 8bf6e8c9 authored by vaclav's avatar vaclav
Browse files

fix JBM

parent 23b80123
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -807,7 +807,7 @@ int main(
        }
    }

#ifdef MEM_ALLOC_APP
#ifdef MEM_ALLOC_APP_DEC
#if 0
    /*------------------------------------------------------------------------------------------*
     * Initialize (allocate memory for static variables) the decoder
@@ -2357,12 +2357,12 @@ static ivas_error decodeG192(
                }
            }

#ifdef MEM_ALLOC_APP
#ifdef MEM_ALLOC_APP_DEC
            /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( ( error = IVAS_DEC_Setup( hIvasDec, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, NULL ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
+13 −8
Original line number Diff line number Diff line
@@ -931,9 +931,9 @@ ivas_error IVAS_DEC_GetSamples(
            if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) // ToDo: TBD for JBM
            {
#ifdef SPLIT_REND_WITH_HEAD_ROT
                if ( ( error = IVAS_DEC_Setup( hIvasDec, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_Setup( hIvasDec, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
@@ -1243,6 +1243,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(

ivas_error IVAS_DEC_Setup(
    IVAS_DEC_HANDLE hIvasDec,   /* i/o: IVAS decoder handle                                */
    uint16_t *nSamplesRendered, /* o  : number of samples flushed from the last frame      */
#ifdef SPLIT_REND_WITH_HEAD_ROT
    const IVAS_DEC_PCM_TYPE pcmType, /* i  : type for the decoded PCM resolution                */
    void *data                       /* o  : output synthesis signal                            */
@@ -1252,7 +1253,7 @@ ivas_error IVAS_DEC_Setup(
)
{
    ivas_error error;
    uint16_t nSamplesRendered = 0;
    uint16_t nSamplesRendered_loc = 0;

    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
    {
@@ -1270,7 +1271,7 @@ ivas_error IVAS_DEC_Setup(
        /* EVS decoding, do nothing */
        return IVAS_ERR_OK;
    }
    else
    else if ( data != NULL ) // ToDo: TBD for JBM
    {
        Decoder_Struct *st_ivas;

@@ -1287,16 +1288,20 @@ ivas_error IVAS_DEC_Setup(
        if ( st_ivas->bfi == 0 )
        {
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( ( error = ivas_dec_setup( st_ivas, &nSamplesRendered, pcm_type_API_to_internal( pcmType ), data ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_dec_setup( st_ivas, &nSamplesRendered_loc, pcm_type_API_to_internal( pcmType ), data ) ) != IVAS_ERR_OK )
#else
            if ( ( error = ivas_dec_setup( st_ivas, &nSamplesRendered, data ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_dec_setup( st_ivas, &nSamplesRendered_loc, data ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
        }
    }

        if ( nSamplesRendered != NULL )
        {
            *nSamplesRendered = nSamplesRendered_loc;
        }
    }
    return IVAS_ERR_OK;
}

+1 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ void IVAS_DEC_Close(
/*! r: error code */
ivas_error IVAS_DEC_Setup(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    uint16_t *nSamplesRendered,                 /* o  : number of samples flushed from the last frame                           */
#ifdef SPLIT_REND_WITH_HEAD_ROT
    const IVAS_DEC_PCM_TYPE pcmType,            /* i  : type for the decoded PCM resolution                                     */
    void *data                                  /* o  : output synthesis signal                                                 */