Loading apps/decoder.c +14 −20 Original line number Diff line number Diff line Loading @@ -807,19 +807,7 @@ int main( } } #ifdef MEM_ALLOC_APP_DEC #if 0 /*------------------------------------------------------------------------------------------* * Initialize (allocate memory for static variables) the decoder *------------------------------------------------------------------------------------------*/ if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*------------------------------------------------------------------------------------------* * Allocate output data buffer *------------------------------------------------------------------------------------------*/ Loading Loading @@ -2081,7 +2069,12 @@ static ivas_error decodeG192( IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; uint16_t nSamplesAvailableNext; bool needNewFrame; #ifdef MEM_ALLOC_APP_DEC uint16_t nSamplesRendered; int16_t nSamplesRendered_loop, nSamplesToRender; #else int16_t nSamplesRendered, nSamplesRendered_loop, nSamplesToRender; #endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING TsmScaleFileReader *tsmScaleFileReader = NULL; Loading Loading @@ -2362,7 +2355,7 @@ static ivas_error decodeG192( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, NULL ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading Loading @@ -3245,19 +3238,20 @@ static ivas_error decodeVoIP( #ifdef MEM_ALLOC_APP_DEC #if 0 // VE: TBC!!! //if () { hIvasDec->hasBeenFedFrame = true; } #ifndef MEM_ALLOC_APP_DEC_JBM uint16_t nSamplesRendered = 0; /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */ if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL ) ) != IVAS_ERR_OK ) #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) #else 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 ) ); goto cleanup; } #endif #endif #endif /* decode and get samples */ Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,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 /* #################### End BE switches ################################## */ Loading lib_dec/lib_dec.c +31 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,9 @@ struct IVAS_DEC bool updateOrientation; uint16_t nSamplesAvailableNext; int16_t nSamplesRendered; #ifdef MEM_ALLOC_APP_DEC int16_t nSamplesRendered_flush; #endif int16_t nTransportChannelsOld; int16_t amrwb_rfc4867_flag; /* MIME from rfc4867 is used */ int16_t sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ Loading Loading @@ -171,6 +174,9 @@ ivas_error IVAS_DEC_Open( hIvasDec->nTransportChannelsOld = 0; hIvasDec->nSamplesAvailableNext = 0; hIvasDec->nSamplesRendered = 0; #ifdef MEM_ALLOC_APP_DEC hIvasDec->nSamplesRendered_flush = 0; #endif hIvasDec->nSamplesFrame = 0; hIvasDec->hasBeenFedFrame = false; hIvasDec->hasBeenFedFirstGoodFrame = false; Loading Loading @@ -478,6 +484,9 @@ ivas_error IVAS_DEC_Configure( hIvasDec->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); hIvasDec->nSamplesAvailableNext = 0; hIvasDec->nSamplesRendered = 0; #ifdef MEM_ALLOC_APP_DEC hIvasDec->nSamplesRendered_flush = 0; #endif hIvasDec->tsm_scale = 100; hIvasDec->tsm_max_scaling = 0; hIvasDec->tsm_quality = 1.0f; Loading Loading @@ -825,6 +834,9 @@ ivas_error IVAS_DEC_FeedFrame_Serial( hIvasDec->needNewFrame = false; hIvasDec->hasBeenFedFrame = true; hIvasDec->nSamplesRendered = 0; #ifdef MEM_ALLOC_APP_DEC hIvasDec->nSamplesRendered_flush = 0; #endif hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; return IVAS_ERR_OK; Loading Loading @@ -928,6 +940,7 @@ ivas_error IVAS_DEC_GetSamples( if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { #ifdef MEM_ALLOC_APP_DEC #ifndef MEM_ALLOC_APP_DEC_JBM if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) // ToDo: TBD for JBM { #ifdef SPLIT_REND_WITH_HEAD_ROT Loading @@ -939,6 +952,7 @@ ivas_error IVAS_DEC_GetSamples( return error; } } #endif if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { Loading @@ -959,6 +973,7 @@ ivas_error IVAS_DEC_GetSamples( nTransportChannels = (uint8_t) st_ivas->hTcBuffer->nchan_transport_jbm; nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; nSamplesRendered_loop = hIvasDec->nSamplesRendered; nSamplesRendered = hIvasDec->nSamplesRendered_flush; } #else /* setup */ Loading Loading @@ -1301,7 +1316,9 @@ ivas_error IVAS_DEC_Setup( { *nSamplesRendered = nSamplesRendered_loc; } hIvasDec->nSamplesRendered_flush = nSamplesRendered_loc; } return IVAS_ERR_OK; } Loading Loading @@ -2695,6 +2712,20 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } } #ifdef MEM_ALLOC_APP_DEC_JBM uint16_t nSamplesRendered2 = 0; /* 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, &nSamplesRendered, IVAS_DEC_PCM_INT16, pcmBuf + 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 #ifdef SUPPORT_JBM_TRACEFILE /* jbmWriterFn and jbmWriter may be NULL if tracefile writing was not requested on CLI */ if ( jbmWriterFn != NULL && jbmWriter != NULL ) Loading Loading
apps/decoder.c +14 −20 Original line number Diff line number Diff line Loading @@ -807,19 +807,7 @@ int main( } } #ifdef MEM_ALLOC_APP_DEC #if 0 /*------------------------------------------------------------------------------------------* * Initialize (allocate memory for static variables) the decoder *------------------------------------------------------------------------------------------*/ if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*------------------------------------------------------------------------------------------* * Allocate output data buffer *------------------------------------------------------------------------------------------*/ Loading Loading @@ -2081,7 +2069,12 @@ static ivas_error decodeG192( IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; uint16_t nSamplesAvailableNext; bool needNewFrame; #ifdef MEM_ALLOC_APP_DEC uint16_t nSamplesRendered; int16_t nSamplesRendered_loop, nSamplesToRender; #else int16_t nSamplesRendered, nSamplesRendered_loop, nSamplesToRender; #endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING TsmScaleFileReader *tsmScaleFileReader = NULL; Loading Loading @@ -2362,7 +2355,7 @@ static ivas_error decodeG192( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, NULL ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading Loading @@ -3245,19 +3238,20 @@ static ivas_error decodeVoIP( #ifdef MEM_ALLOC_APP_DEC #if 0 // VE: TBC!!! //if () { hIvasDec->hasBeenFedFrame = true; } #ifndef MEM_ALLOC_APP_DEC_JBM uint16_t nSamplesRendered = 0; /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */ if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL ) ) != IVAS_ERR_OK ) #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) #else 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 ) ); goto cleanup; } #endif #endif #endif /* decode and get samples */ Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,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 /* #################### End BE switches ################################## */ Loading
lib_dec/lib_dec.c +31 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,9 @@ struct IVAS_DEC bool updateOrientation; uint16_t nSamplesAvailableNext; int16_t nSamplesRendered; #ifdef MEM_ALLOC_APP_DEC int16_t nSamplesRendered_flush; #endif int16_t nTransportChannelsOld; int16_t amrwb_rfc4867_flag; /* MIME from rfc4867 is used */ int16_t sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ Loading Loading @@ -171,6 +174,9 @@ ivas_error IVAS_DEC_Open( hIvasDec->nTransportChannelsOld = 0; hIvasDec->nSamplesAvailableNext = 0; hIvasDec->nSamplesRendered = 0; #ifdef MEM_ALLOC_APP_DEC hIvasDec->nSamplesRendered_flush = 0; #endif hIvasDec->nSamplesFrame = 0; hIvasDec->hasBeenFedFrame = false; hIvasDec->hasBeenFedFirstGoodFrame = false; Loading Loading @@ -478,6 +484,9 @@ ivas_error IVAS_DEC_Configure( hIvasDec->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); hIvasDec->nSamplesAvailableNext = 0; hIvasDec->nSamplesRendered = 0; #ifdef MEM_ALLOC_APP_DEC hIvasDec->nSamplesRendered_flush = 0; #endif hIvasDec->tsm_scale = 100; hIvasDec->tsm_max_scaling = 0; hIvasDec->tsm_quality = 1.0f; Loading Loading @@ -825,6 +834,9 @@ ivas_error IVAS_DEC_FeedFrame_Serial( hIvasDec->needNewFrame = false; hIvasDec->hasBeenFedFrame = true; hIvasDec->nSamplesRendered = 0; #ifdef MEM_ALLOC_APP_DEC hIvasDec->nSamplesRendered_flush = 0; #endif hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; return IVAS_ERR_OK; Loading Loading @@ -928,6 +940,7 @@ ivas_error IVAS_DEC_GetSamples( if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { #ifdef MEM_ALLOC_APP_DEC #ifndef MEM_ALLOC_APP_DEC_JBM if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) // ToDo: TBD for JBM { #ifdef SPLIT_REND_WITH_HEAD_ROT Loading @@ -939,6 +952,7 @@ ivas_error IVAS_DEC_GetSamples( return error; } } #endif if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { Loading @@ -959,6 +973,7 @@ ivas_error IVAS_DEC_GetSamples( nTransportChannels = (uint8_t) st_ivas->hTcBuffer->nchan_transport_jbm; nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; nSamplesRendered_loop = hIvasDec->nSamplesRendered; nSamplesRendered = hIvasDec->nSamplesRendered_flush; } #else /* setup */ Loading Loading @@ -1301,7 +1316,9 @@ ivas_error IVAS_DEC_Setup( { *nSamplesRendered = nSamplesRendered_loc; } hIvasDec->nSamplesRendered_flush = nSamplesRendered_loc; } return IVAS_ERR_OK; } Loading Loading @@ -2695,6 +2712,20 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } } #ifdef MEM_ALLOC_APP_DEC_JBM uint16_t nSamplesRendered2 = 0; /* 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, &nSamplesRendered, IVAS_DEC_PCM_INT16, pcmBuf + 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 #ifdef SUPPORT_JBM_TRACEFILE /* jbmWriterFn and jbmWriter may be NULL if tracefile writing was not requested on CLI */ if ( jbmWriterFn != NULL && jbmWriter != NULL ) Loading