Loading apps/decoder.c +4 −0 Original line number Diff line number Diff line Loading @@ -2620,7 +2620,11 @@ static ivas_error decodeG192( { #endif #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef MEM_ALLOC_APP_DEC_JBM if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame, 1 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) #endif #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ #define MEM_ALLOC_APP /* VA: call memory allocate/reallocation from the application */ #define MEM_ALLOC_APP_DEC /* VA: call memory allocate/reallocation from the application, decoder part */ //#define MEM_ALLOC_APP_DEC_JBM #define MEM_ALLOC_APP_DEC_JBM /* #################### End BE switches ################################## */ Loading lib_dec/lib_dec.c +58 −16 Original line number Diff line number Diff line Loading @@ -931,6 +931,10 @@ ivas_error IVAS_DEC_GetSamples( #endif int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ bool *needNewFrame /* o :indication that the decoder needs a new frame */ #ifdef MEM_ALLOC_APP_DEC_JBM , const int16_t flag_decode #endif ) { ivas_error error; Loading Loading @@ -1009,6 +1013,15 @@ ivas_error IVAS_DEC_GetSamples( /* check if we need to run the setup function */ if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { #ifdef MEM_ALLOC_APP_DEC_JBM if ( flag_decode == 0 ) { *nOutSamples = -1; // TBD return IVAS_ERR_OK; } #endif #ifdef MEM_ALLOC_APP_DEC #ifndef MEM_ALLOC_APP_DEC_JBM if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) // ToDo: TBD for JBM Loading Loading @@ -1066,6 +1079,7 @@ ivas_error IVAS_DEC_GetSamples( if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { int16_t nResidualSamples, nSamplesTcsScaled; nSamplesRendered += nSamplesRendered_loop; if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm && nTransportChannels != hIvasDec->nTransportChannelsOld ) Loading Loading @@ -1239,7 +1253,11 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( /* Decode and render */ #ifdef MEM_ALLOC_APP_DEC_JBM if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame, 1 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -2935,19 +2953,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } } #ifdef MEM_ALLOC_APP_DEC_JBM uint16_t nSamplesRendered2 = 0; // VE: todo - verify use for EVS /* 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, &nSamplesRendered2, IVAS_DEC_PCM_INT16, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered2, pcmBuf + nSamplesRendered2 * nOutChannels ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } #endif /* decode */ if ( !hIvasDec->hasBeenFedFirstGoodFrame ) { Loading @@ -2971,20 +2976,57 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesToRender = nSamplesPerChannel - nSamplesRendered; /* render IVAS frames directly to the output buffer */ #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) #ifdef MEM_ALLOC_APP_DEC_JBM if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmBuf + nSamplesRendered * nOutChannels, &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) #endif { return error; } #ifdef MEM_ALLOC_APP_DEC_JBM if ( nSamplesRendered_loop == -1 ) { break; } #endif nSamplesRendered += nSamplesRendered_loop; update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } } #ifdef MEM_ALLOC_APP_DEC_JBM if ( hIvasDec->hasBeenFedFirstGoodFrame ) { if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { uint16_t nSamplesRendered2 = 0; // VE: todo - verify use for EVS /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */ if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered2, IVAS_DEC_PCM_INT16, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } } int16_t nSamplesToRender, nSamplesRendered_loop; bool tmp; nSamplesToRender = nSamplesPerChannel - nSamplesRendered; /* render IVAS frames directly to the output buffer */ if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp, 1 ) ) != IVAS_ERR_OK ) { return error; } nSamplesRendered += nSamplesRendered_loop; update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } #endif return IVAS_ERR_OK; } Loading lib_dec/lib_dec.h +3 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,9 @@ ivas_error IVAS_DEC_GetSamples( #endif int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ bool *needNewFrame /* o : indication that the decoder needs a new frame */ #ifdef MEM_ALLOC_APP_DEC_JBM ,const int16_t flag_decode #endif ); #ifdef SPLIT_REND_WITH_HEAD_ROT Loading Loading
apps/decoder.c +4 −0 Original line number Diff line number Diff line Loading @@ -2620,7 +2620,11 @@ static ivas_error decodeG192( { #endif #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef MEM_ALLOC_APP_DEC_JBM if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame, 1 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) #endif #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ #define MEM_ALLOC_APP /* VA: call memory allocate/reallocation from the application */ #define MEM_ALLOC_APP_DEC /* VA: call memory allocate/reallocation from the application, decoder part */ //#define MEM_ALLOC_APP_DEC_JBM #define MEM_ALLOC_APP_DEC_JBM /* #################### End BE switches ################################## */ Loading
lib_dec/lib_dec.c +58 −16 Original line number Diff line number Diff line Loading @@ -931,6 +931,10 @@ ivas_error IVAS_DEC_GetSamples( #endif int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ bool *needNewFrame /* o :indication that the decoder needs a new frame */ #ifdef MEM_ALLOC_APP_DEC_JBM , const int16_t flag_decode #endif ) { ivas_error error; Loading Loading @@ -1009,6 +1013,15 @@ ivas_error IVAS_DEC_GetSamples( /* check if we need to run the setup function */ if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { #ifdef MEM_ALLOC_APP_DEC_JBM if ( flag_decode == 0 ) { *nOutSamples = -1; // TBD return IVAS_ERR_OK; } #endif #ifdef MEM_ALLOC_APP_DEC #ifndef MEM_ALLOC_APP_DEC_JBM if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) // ToDo: TBD for JBM Loading Loading @@ -1066,6 +1079,7 @@ ivas_error IVAS_DEC_GetSamples( if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { int16_t nResidualSamples, nSamplesTcsScaled; nSamplesRendered += nSamplesRendered_loop; if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm && nTransportChannels != hIvasDec->nTransportChannelsOld ) Loading Loading @@ -1239,7 +1253,11 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( /* Decode and render */ #ifdef MEM_ALLOC_APP_DEC_JBM if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame, 1 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -2935,19 +2953,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } } #ifdef MEM_ALLOC_APP_DEC_JBM uint16_t nSamplesRendered2 = 0; // VE: todo - verify use for EVS /* 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, &nSamplesRendered2, IVAS_DEC_PCM_INT16, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered2, pcmBuf + nSamplesRendered2 * nOutChannels ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } #endif /* decode */ if ( !hIvasDec->hasBeenFedFirstGoodFrame ) { Loading @@ -2971,20 +2976,57 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesToRender = nSamplesPerChannel - nSamplesRendered; /* render IVAS frames directly to the output buffer */ #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) #ifdef MEM_ALLOC_APP_DEC_JBM if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp, 0 ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmBuf + nSamplesRendered * nOutChannels, &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) #endif { return error; } #ifdef MEM_ALLOC_APP_DEC_JBM if ( nSamplesRendered_loop == -1 ) { break; } #endif nSamplesRendered += nSamplesRendered_loop; update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } } #ifdef MEM_ALLOC_APP_DEC_JBM if ( hIvasDec->hasBeenFedFirstGoodFrame ) { if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { uint16_t nSamplesRendered2 = 0; // VE: todo - verify use for EVS /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */ if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered2, IVAS_DEC_PCM_INT16, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } } int16_t nSamplesToRender, nSamplesRendered_loop; bool tmp; nSamplesToRender = nSamplesPerChannel - nSamplesRendered; /* render IVAS frames directly to the output buffer */ if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp, 1 ) ) != IVAS_ERR_OK ) { return error; } nSamplesRendered += nSamplesRendered_loop; update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } #endif return IVAS_ERR_OK; } Loading
lib_dec/lib_dec.h +3 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,9 @@ ivas_error IVAS_DEC_GetSamples( #endif int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ bool *needNewFrame /* o : indication that the decoder needs a new frame */ #ifdef MEM_ALLOC_APP_DEC_JBM ,const int16_t flag_decode #endif ); #ifdef SPLIT_REND_WITH_HEAD_ROT Loading