From dd9359e4c3157f6d1766874679dbce4e2fa4cb6d Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 12 Jan 2026 12:11:51 +0100 Subject: [PATCH 1/7] port changes from FLP --- apps/decoder.c | 78 +++++++-------- apps/isar_post_rend.c | 24 ++--- apps/renderer.c | 26 ++--- lib_com/common_api_types.h | 11 ++- lib_dec/ivas_init_dec_fx.c | 4 +- lib_dec/ivas_stat_dec.h | 4 +- lib_dec/lib_dec.h | 17 ++-- lib_dec/lib_dec_fx.c | 141 ++++++++++++---------------- lib_isar/isar_prot.h | 4 +- lib_isar/isar_splitRendererPre.c | 11 ++- lib_isar/isar_splitRenderer_utils.c | 19 ++-- lib_isar/lib_isar_pre_rend.c | 33 +++---- lib_isar/lib_isar_pre_rend.h | 2 +- 13 files changed, 178 insertions(+), 196 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 494f76ccb..08cac8f21 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -124,7 +124,7 @@ typedef struct char *outputMdFilename; IVAS_DEC_COMPLEXITY_LEVEL complexityLevel; bool tsmEnabled; - IVAS_RENDER_FRAMESIZE renderFramesize; + IVAS_RENDER_NUM_SUBFR render_num_subframes; AcousticEnvironmentSequence aeSequence; bool dpidEnabled; uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; @@ -198,7 +198,7 @@ int main( Vector3PairFileReader *referenceVectorReader = NULL; RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; - IVAS_RENDER_FRAMESIZE asked_frame_size; + IVAS_RENDER_NUM_SUBFR asked_num_subframes; IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; ObjectEditFileReader *objectEditFileReader = NULL; IVAS_ROOM_ACOUSTICS_CONFIG_DATA **pAE = NULL; @@ -415,11 +415,11 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ - asked_frame_size = arg.renderFramesize; + asked_num_subframes = arg.render_num_subframes; uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : IVAS_DEFAULT_AEID; arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.render_num_subframes, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.roomSize, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) { @@ -427,13 +427,13 @@ int main( goto cleanup; } - if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg.renderFramesize ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg.render_num_subframes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } - if ( arg.renderFramesize != asked_frame_size ) + if ( arg.render_num_subframes != asked_num_subframes ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for decoding to EXT!\n" ); } @@ -442,7 +442,7 @@ int main( * Configure Split rendering *------------------------------------------------------------------------------------------*/ - asked_frame_size = arg.renderFramesize; + asked_num_subframes = arg.render_num_subframes; if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) @@ -451,14 +451,14 @@ int main( goto cleanup; } - if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg.renderFramesize ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg.render_num_subframes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR - if ( !arg.renderConfigEnabled && ( arg.renderFramesize != asked_frame_size ) ) + if ( !arg.renderConfigEnabled && ( arg.render_num_subframes != asked_num_subframes ) ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } @@ -574,24 +574,24 @@ int main( if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - if ( asked_frame_size != IVAS_RENDER_FRAMESIZE_20MS && + if ( asked_num_subframes != IVAS_RENDER_NUM_SUBFR_20MS && ( renderConfig.split_rend_config.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE || renderConfig.split_rend_config.dof == 0 ) ) { - arg.renderFramesize = asked_frame_size; + arg.render_num_subframes = asked_num_subframes; } else { - arg.renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; + arg.render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; } - if ( ( error = IVAS_DEC_SetRenderFramesize( hIvasDec, arg.renderFramesize ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_SetRenderNumSubfr( hIvasDec, arg.render_num_subframes ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_SetRenderFramesize failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nIVAS_DEC_SetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } - if ( arg.renderFramesize != asked_frame_size ) + if ( arg.render_num_subframes != asked_num_subframes ) { fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } @@ -616,7 +616,7 @@ int main( /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ - renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * 5; + renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.render_num_subframes * 5; if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { @@ -938,7 +938,7 @@ static bool parseCmdlIVAS_dec( arg->non_diegetic_pan_enabled = false; arg->non_diegetic_pan_gain = 0.f; arg->tsmEnabled = false; - arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; + arg->render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; arg->aeSequence.count = 0; arg->aeSequence.pID = NULL; arg->aeSequence.pValidity = NULL; @@ -1105,13 +1105,13 @@ static bool parseCmdlIVAS_dec( switch ( (int16_t) tmp ) { case 5: - arg->renderFramesize = IVAS_RENDER_FRAMESIZE_5MS; + arg->render_num_subframes = IVAS_RENDER_NUM_SUBFR_5MS; break; case 10: - arg->renderFramesize = IVAS_RENDER_FRAMESIZE_10MS; + arg->render_num_subframes = IVAS_RENDER_NUM_SUBFR_10MS; break; case 20: - arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; + arg->render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; break; default: fprintf( stderr, "Error: Invalid render frame size %d \n\n", tmp ); @@ -2161,10 +2161,10 @@ static ivas_error decodeG192( } } - int16_t num_subframes; - if ( ( error = IVAS_DEC_GetNumOrientationSubframes( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) + IVAS_RENDER_NUM_SUBFR num_subframes; + if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_GetNumOrientationSubframes failed: \n" ); + fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: \n" ); goto cleanup; } @@ -2175,7 +2175,7 @@ static ivas_error decodeG192( if ( headRotReader == NULL ) { - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { Quaternions[i].w_fx = -12582912; Quaternions[i].x_fx = 0; @@ -2190,7 +2190,7 @@ static ivas_error decodeG192( } else { - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) { @@ -2200,7 +2200,7 @@ static ivas_error decodeG192( } } - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) { @@ -2218,7 +2218,7 @@ static ivas_error decodeG192( int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) { @@ -2226,7 +2226,7 @@ static ivas_error decodeG192( goto cleanup; } } - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternions[i], enableHeadRotation[i], enableExternalOrientation[i], enableRotationInterpolation[i], numFramesToTargetOrientation[i], i ) ) != IVAS_ERR_OK ) { @@ -2992,10 +2992,10 @@ static ivas_error decodeVoIP( } } - int16_t num_subframes; - if ( ( error = IVAS_DEC_GetNumOrientationSubframes( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) + IVAS_RENDER_NUM_SUBFR num_subframes; + if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_GetNumOrientationSubframes failed: \n" ); + fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: \n" ); goto cleanup; } @@ -3006,7 +3006,7 @@ static ivas_error decodeVoIP( if ( headRotReader == NULL ) { - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { Quaternions[i].w_fx = -12582912; Quaternions[i].x_fx = 0; @@ -3021,7 +3021,7 @@ static ivas_error decodeVoIP( } else { - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) { @@ -3031,7 +3031,7 @@ static ivas_error decodeVoIP( } } - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) { @@ -3049,7 +3049,7 @@ static ivas_error decodeVoIP( int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) @@ -3059,7 +3059,7 @@ static ivas_error decodeVoIP( goto cleanup; } } - for ( i = 0; i < num_subframes; i++ ) + for ( i = 0; i < (int16_t) num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternions[i], enableHeadRotation[i], enableExternalOrientation[i], enableRotationInterpolation[i], numFramesToTargetOrientation[i], i ) ) != IVAS_ERR_OK ) { @@ -3988,7 +3988,7 @@ static ivas_error restartDecoder( IVAS_AUDIO_CONFIG outputConfig = ( decMode == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO; - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->renderFramesize, arg->customLsOutputEnabled, arg->hrtfReaderEnabled, + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->render_num_subframes, arg->customLsOutputEnabled, arg->hrtfReaderEnabled, arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->roomSize, arg->non_diegetic_pan_enabled, arg->non_diegetic_pan_gain_fx, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) { @@ -3996,7 +3996,7 @@ static ivas_error restartDecoder( goto cleanup; } - if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg->renderFramesize ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg->render_num_subframes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -4021,7 +4021,7 @@ static ivas_error restartDecoder( * This will be ignored if output format is not split rendering. */ if ( renderConfig != NULL ) { - renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->renderFramesize /* given in number of 5ms subframes */ * 5; + renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->render_num_subframes * 5; } if ( arg->renderConfigEnabled && renderConfig != NULL ) diff --git a/apps/isar_post_rend.c b/apps/isar_post_rend.c index 6ccf204ce..a7f695b11 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -114,7 +114,7 @@ typedef struct bool delayCompensationEnabled; bool quietModeEnabled; bool sceneDescriptionInput; - IVAS_RENDER_FRAMESIZE render_framesize; + IVAS_RENDER_NUM_SUBFR render_num_subframes; } CmdlnArgs; typedef enum @@ -342,11 +342,11 @@ static bool parseInConfig( static bool parseRenderFramesize( char *value, - IVAS_RENDER_FRAMESIZE *render_framesize ) + IVAS_RENDER_NUM_SUBFR *render_num_subframes ) { int32_t tmp; - *render_framesize = IVAS_RENDER_FRAMESIZE_UNKNOWN; + *render_num_subframes = IVAS_RENDER_NUM_SUBFR_UNKNOWN; if ( !is_digits_only( value ) ) { return false; @@ -355,13 +355,13 @@ static bool parseRenderFramesize( switch ( (int16_t) tmp ) { case 5: - *render_framesize = IVAS_RENDER_FRAMESIZE_5MS; + *render_num_subframes = IVAS_RENDER_NUM_SUBFR_5MS; break; case 10: - *render_framesize = IVAS_RENDER_FRAMESIZE_10MS; + *render_num_subframes = IVAS_RENDER_NUM_SUBFR_10MS; break; case 20: - *render_framesize = IVAS_RENDER_FRAMESIZE_20MS; + *render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; break; default: return false; @@ -476,7 +476,7 @@ static CmdlnArgs defaultArgs( args.quietModeEnabled = false; args.sceneDescriptionInput = false; - args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS; + args.render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; return args; } @@ -559,7 +559,7 @@ static void parseOption( break; case CmdLnOptionId_framing: assert( numOptionValues == 1 ); - if ( !parseRenderFramesize( optionValues[0], &args->render_framesize ) ) + if ( !parseRenderFramesize( optionValues[0], &args->render_num_subframes ) ) { fprintf( stderr, "Unknown or invalid option for frame size: %s\n", optionValues[0] ); exit( -1 ); @@ -951,7 +951,7 @@ int main( audioReader = NULL; /* Force owerwrite of command line provided rendersize to align with codec frame size */ - args.render_framesize = bitsBuffer.config.isar_frame_size_ms / 5; + args.render_num_subframes = bitsBuffer.config.isar_frame_size_ms / 5; } /*if split renderer is running in post renderer mode*/ else if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) @@ -1023,9 +1023,9 @@ int main( * Open ISAR handle *------------------------------------------------------------------------------------------*/ - const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); + const int16_t frameSize_smpls = (int16_t) ( ( args.render_num_subframes ) * args.sampleRate * 5 / ( 1000 ) ); args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_BINAURAL; - if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) + if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0, (int16_t) args.render_num_subframes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) ); goto cleanup; @@ -1243,7 +1243,7 @@ int main( convertInputBuffer( inpInt16Buffer, numSamplesRead, inBuffer.config.numSamplesPerChannel, num_in_channels, inFloatBuffer_fx ); *inBuffer.pq_fact = 0; int16_t num_subframes, sf_idx; - num_subframes = (int16_t) args.render_framesize; + num_subframes = (int16_t) args.render_num_subframes; /* Read from head rotation trajectory file if specified */ if ( headRotReader != NULL ) diff --git a/apps/renderer.c b/apps/renderer.c index 70e68c757..5639f773e 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -195,7 +195,7 @@ typedef struct bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; int16_t syncMdDelay; - IVAS_RENDER_FRAMESIZE render_framesize; + IVAS_RENDER_NUM_SUBFR render_num_subframes; uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; AcousticEnvironmentSequence aeSequence; IVAS_ROOM_SIZE_T reverbRoomSize; @@ -992,12 +992,12 @@ int main( goto cleanup; } - const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); + const int16_t frameSize_smpls = (int16_t) ( ( args.render_num_subframes ) * args.sampleRate * BINAURAL_RENDERING_FRAME_SIZE_MS / ( 1000 ) ); Word32 nonDiegeticPanGain_fx = ( args.nonDiegeticPanGain == 1.0f ) ? ONE_IN_Q31 : ( args.nonDiegeticPanGain == -1.0f ) ? L_negate( ONE_IN_Q31 ) : (Word32) ( args.nonDiegeticPanGain * ( 1LL << Q31 ) ); - IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) + IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_num_subframes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) ); goto cleanup; @@ -1225,7 +1225,7 @@ int main( /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ - renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_framesize /* given in number of 5ms subframes */ * 5; + renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_num_subframes * BINAURAL_RENDERING_FRAME_SIZE_MS; if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK ) { @@ -1653,7 +1653,7 @@ int main( { int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; - const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0; + const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_num_subframes ) == 0; if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL && args.aeSequence.count > 0 && args.aeSequence.pValidity[args.aeSequence.selected] != 0 ) @@ -1717,7 +1717,7 @@ int main( } int16_t num_subframes, sf_idx; - num_subframes = (int16_t) args.render_framesize; + num_subframes = (int16_t) args.render_num_subframes; if ( isCurrentFrameMultipleOf20ms && !flushRendererLastFrame ) { @@ -2426,11 +2426,11 @@ static bool parseDiegeticPan( static bool parseRenderFramesize( char *value, - IVAS_RENDER_FRAMESIZE *render_framesize ) + IVAS_RENDER_NUM_SUBFR *render_num_subframes ) { int32_t tmp; - *render_framesize = IVAS_RENDER_FRAMESIZE_UNKNOWN; + *render_num_subframes = IVAS_RENDER_NUM_SUBFR_UNKNOWN; if ( !is_digits_only( value ) ) { return false; @@ -2439,13 +2439,13 @@ static bool parseRenderFramesize( switch ( (int16_t) tmp ) { case 5: - *render_framesize = IVAS_RENDER_FRAMESIZE_5MS; + *render_num_subframes = IVAS_RENDER_NUM_SUBFR_5MS; break; case 10: - *render_framesize = IVAS_RENDER_FRAMESIZE_10MS; + *render_num_subframes = IVAS_RENDER_NUM_SUBFR_10MS; break; case 20: - *render_framesize = IVAS_RENDER_FRAMESIZE_20MS; + *render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; break; default: return false; @@ -2812,7 +2812,7 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); - args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS; + args.render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; args.syncMdDelay = 0; for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { @@ -2981,7 +2981,7 @@ static void parseOption( break; case CmdLnOptionId_framing: assert( numOptionValues == 1 ); - if ( !parseRenderFramesize( optionValues[0], &args->render_framesize ) ) + if ( !parseRenderFramesize( optionValues[0], &args->render_num_subframes ) ) { fprintf( stderr, "Unknown or invalid option for frame size: %s\n", optionValues[0] ); exit( -1 ); diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 34bc08d43..887d87119 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -173,12 +173,12 @@ typedef enum typedef enum { - IVAS_RENDER_FRAMESIZE_UNKNOWN = 0, - IVAS_RENDER_FRAMESIZE_5MS = 1, - IVAS_RENDER_FRAMESIZE_10MS = 2, - IVAS_RENDER_FRAMESIZE_20MS = 4 + IVAS_RENDER_NUM_SUBFR_UNKNOWN = 0, + IVAS_RENDER_NUM_SUBFR_5MS = 1, + IVAS_RENDER_NUM_SUBFR_10MS = 2, + IVAS_RENDER_NUM_SUBFR_20MS = 4 -} IVAS_RENDER_FRAMESIZE; +} IVAS_RENDER_NUM_SUBFR; typedef enum { @@ -186,6 +186,7 @@ typedef enum IVAS_ROOM_SIZE_SMALL, IVAS_ROOM_SIZE_MEDIUM, IVAS_ROOM_SIZE_LARGE + } IVAS_ROOM_SIZE_T; typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 00cab0233..939f1d8c5 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1557,7 +1557,7 @@ ivas_error ivas_init_decoder_front( IF( st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { - IF( NE_32( ( error = ivas_external_orientation_open_fx( &( st_ivas->hExtOrientationData ), st_ivas->hDecoderConfig->render_framesize ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_external_orientation_open_fx( &( st_ivas->hExtOrientationData ), st_ivas->hDecoderConfig->render_num_subframes ) ), IVAS_ERR_OK ) ) { return error; } @@ -1570,7 +1570,7 @@ ivas_error ivas_init_decoder_front( test(); IF( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { - IF( NE_32( ( error = ivas_combined_orientation_open_fx( &( st_ivas->hCombinedOrientationData ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->render_framesize ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_combined_orientation_open_fx( &( st_ivas->hCombinedOrientationData ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->render_num_subframes ) ), IVAS_ERR_OK ) ) { return error; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 34c07d1f1..47a74c60b 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1073,8 +1073,8 @@ typedef struct decoder_config_structure Word16 Opt_aeid_on; /* indicates whether Acoustic environment option is used */ Word16 Opt_ObjEdit_on; /* indicates whether object editing option is used */ Word16 Opt_tsm; /* indicates whether time scaling modification is activated */ - IVAS_RENDER_FRAMESIZE render_framesize; - Word16 Opt_delay_comp; /* flag indicating delay compensation active */ + IVAS_RENDER_NUM_SUBFR render_num_subframes; /* renderer number of subframes */ + Word16 Opt_delay_comp; /* flag indicating delay compensation active */ } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 58c33c92d..14f26b68a 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -112,7 +112,7 @@ ivas_error IVAS_DEC_Configure( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const UWord32 sampleRate, /* i : output sampling frequency */ const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ - const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes, /* i : rendering number of subframes */ const bool customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const bool hrtfReaderEnabled, /* i : enable HRTF binary file input */ const bool enableHeadRotation, /* i : enable head rotation for binaural output */ @@ -352,14 +352,14 @@ ivas_error IVAS_DEC_EnableSplitRendering( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ ); -ivas_error IVAS_DEC_SetRenderFramesize( +ivas_error IVAS_DEC_SetRenderNumSubfr( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const IVAS_RENDER_FRAMESIZE render_framesize /* i : render framesize */ + const IVAS_RENDER_NUM_SUBFR render_n_subfr /* i : rendering number of subframes */ ); -ivas_error IVAS_DEC_GetRenderFramesize( +ivas_error IVAS_DEC_GetRenderNumSubfr( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_RENDER_FRAMESIZE *render_framesize /* o : render framesize */ + IVAS_RENDER_NUM_SUBFR *render_n_subfr /* o : rendering number of subframes */ ); ivas_error IVAS_DEC_GetRenderFramesizeSamples( @@ -372,14 +372,9 @@ ivas_error IVAS_DEC_GetReferencesUpdateFrequency( Word16 *update_frequency /* o : update frequency Q0 */ ); -ivas_error IVAS_DEC_GetNumOrientationSubframes( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - Word16 *num_subframes /* o : render framesize */ -); - ivas_error IVAS_DEC_GetRenderFramesizeMs( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - UWord32 *render_framesize /* o : render framesize in samples Q0 */ + UWord32 *render_framesize_ms /* o : render framesize in ms Q0 */ ); diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index c20a69451..0f25a9f44 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -116,7 +116,7 @@ static ivas_error ivas_dec_reconfig_split_rend( Decoder_Struct *st_ivas ); static ivas_error ivas_dec_init_split_rend( Decoder_Struct *st_ivas ); static ivas_error ivas_create_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); static void ivas_destroy_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); -static Word16 get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); +static Word16 get_render_frame_size_ms( IVAS_RENDER_NUM_SUBFR render_num_subframes ); static Word16 get_render_frame_size_samples( const DECODER_CONFIG_HANDLE hDecoderConfig ); static Word16 ivas_dec_split_rend_cldfb_in( const RENDERER_TYPE renderer_type ); static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const Word16 nSamplesRendered ); @@ -502,23 +502,23 @@ static ivas_error create_flush_buffer_fx( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_Configure( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const UWord32 sampleRate, /* i : output sampling frequency */ - const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ - const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ - const bool customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ - const bool hrtfReaderEnabled, /* i : enable HRTF binary file input */ - const bool enableHeadRotation, /* i : enable head rotation for binaural output */ - const bool enableExternalOrientation, /* i : enable external orientations */ - const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ - const bool renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ - const IVAS_ROOM_SIZE_T roomSize, /* i : room size selector for reverb */ - const bool non_diegetic_pan_enabled, /* i : enabled diegetic panning */ - const Word16 non_diegetic_pan_gain_fx, /* i : non diegetic panning gain */ - const bool dpidEnabled, /* i : enable directivity pattern option */ - const UWord16 acousticEnvironmentId, /* i : Acoustic environment ID */ - const bool objEditEnabled, /* i : enable object editing */ - const bool delayCompensationEnabled /* i : enable delay compensation */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const UWord32 sampleRate, /* i : output sampling frequency */ + const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes, /* i : rendering number of subframes */ + const bool customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ + const bool hrtfReaderEnabled, /* i : enable HRTF binary file input */ + const bool enableHeadRotation, /* i : enable head rotation for binaural output */ + const bool enableExternalOrientation, /* i : enable external orientations */ + const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ + const bool renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ + const IVAS_ROOM_SIZE_T roomSize, /* i : room size selector for reverb */ + const bool non_diegetic_pan_enabled, /* i : enabled diegetic panning */ + const Word16 non_diegetic_pan_gain_fx, /* i : non diegetic panning gain */ + const bool dpidEnabled, /* i : enable directivity pattern option */ + const UWord16 acousticEnvironmentId, /* i : Acoustic environment ID */ + const bool objEditEnabled, /* i : enable object editing */ + const bool delayCompensationEnabled /* i : enable delay compensation */ ) { Decoder_Struct *st_ivas; @@ -622,18 +622,18 @@ ivas_error IVAS_DEC_Configure( move16(); move16(); - IF( EQ_16( renderFramesize, IVAS_RENDER_FRAMESIZE_UNKNOWN ) ) + IF( EQ_16( render_num_subframes, IVAS_RENDER_NUM_SUBFR_UNKNOWN ) ) { return IVAS_ERR_WRONG_PARAMS; } IF( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { - hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; + hDecoderConfig->render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; } ELSE { - hDecoderConfig->render_framesize = renderFramesize; + hDecoderConfig->render_num_subframes = render_num_subframes; } move16(); @@ -687,7 +687,7 @@ ivas_error IVAS_DEC_EnableSplitRendering( hDecoderConfig->Opt_Headrotation = 1; move16(); - hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; + hDecoderConfig->render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS; move32(); return IVAS_ERR_OK; @@ -700,18 +700,19 @@ ivas_error IVAS_DEC_EnableSplitRendering( * Get render framesize in ms *---------------------------------------------------------------------*/ +/*! r: render framesize in ms */ static Word16 get_render_frame_size_ms( - const IVAS_RENDER_FRAMESIZE render_framesize ) + IVAS_RENDER_NUM_SUBFR render_num_subframes ) { - IF( EQ_16( render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) + IF( EQ_16( render_num_subframes, IVAS_RENDER_NUM_SUBFR_5MS ) ) { - return ( 1000 / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ); + return ( 1000 / ( FRAMES_PER_SEC * IVAS_RENDER_NUM_SUBFR_5MS ) ); } - ELSE IF( EQ_16( render_framesize, IVAS_RENDER_FRAMESIZE_10MS ) ) + ELSE IF( EQ_16( render_num_subframes, IVAS_RENDER_NUM_SUBFR_10MS ) ) { - return ( ( 1000 / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) << 1 ); + return ( ( 1000 / ( FRAMES_PER_SEC * IVAS_RENDER_NUM_SUBFR_10MS ) ) << 1 ); } - ELSE IF( EQ_16( render_framesize, IVAS_RENDER_FRAMESIZE_20MS ) ) + ELSE IF( EQ_16( render_num_subframes, IVAS_RENDER_NUM_SUBFR_20MS ) ) { return ( ( 1000 / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) << 2 ); } @@ -721,14 +722,14 @@ static Word16 get_render_frame_size_ms( /*---------------------------------------------------------------------* - * IVAS_DEC_SetRenderFramesize( ) + * IVAS_DEC_SetRenderNumSubfr( ) * - * Set render framesize + * Set number of rendering subrames *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_SetRenderFramesize( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const IVAS_RENDER_FRAMESIZE render_framesize /* i : render framesize */ +ivas_error IVAS_DEC_SetRenderNumSubfr( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes /* i : renderer number of subframes */ ) { test(); @@ -738,18 +739,18 @@ ivas_error IVAS_DEC_SetRenderFramesize( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - hIvasDec->st_ivas->hDecoderConfig->render_framesize = render_framesize; + hIvasDec->st_ivas->hDecoderConfig->render_num_subframes = render_num_subframes; move16(); IF( hIvasDec->st_ivas->hExtOrientationData != NULL ) { - hIvasDec->st_ivas->hExtOrientationData->num_subframes = (Word16) render_framesize; + hIvasDec->st_ivas->hExtOrientationData->num_subframes = (Word16) render_num_subframes; move16(); } IF( hIvasDec->st_ivas->hCombinedOrientationData != NULL ) { - hIvasDec->st_ivas->hCombinedOrientationData->num_subframes = (Word16) render_framesize; + hIvasDec->st_ivas->hCombinedOrientationData->num_subframes = (Word16) render_num_subframes; move16(); } @@ -758,24 +759,24 @@ ivas_error IVAS_DEC_SetRenderFramesize( /*---------------------------------------------------------------------* - * IVAS_DEC_GetGetRenderFramesize( ) + * IVAS_DEC_GetRenderNumSubfr( ) * - * Get render framesize + * Get number of rendering subframes *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_GetRenderFramesize( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_RENDER_FRAMESIZE *render_framesize /* o : render framesize */ +ivas_error IVAS_DEC_GetRenderNumSubfr( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_RENDER_NUM_SUBFR *render_num_subframes /* o : rendering number of subframes */ ) { test(); test(); - IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL || render_framesize == NULL ) + IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL || render_num_subframes == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - *render_framesize = hIvasDec->st_ivas->hDecoderConfig->render_framesize; + *render_num_subframes = hIvasDec->st_ivas->hDecoderConfig->render_num_subframes; move16(); return IVAS_ERR_OK; @@ -796,15 +797,15 @@ static Word16 get_render_frame_size_samples( tmp = extract_l( Mpy_32_16_1( hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ) ); - IF( EQ_16( hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) + IF( EQ_16( hDecoderConfig->render_num_subframes, IVAS_RENDER_NUM_SUBFR_5MS ) ) { /* correct value already in tmp */ } - ELSE IF( EQ_16( hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_10MS ) ) + ELSE IF( EQ_16( hDecoderConfig->render_num_subframes, IVAS_RENDER_NUM_SUBFR_10MS ) ) { tmp = shl( tmp, 1 ); } - ELSE IF( EQ_16( hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_20MS ) ) + ELSE IF( EQ_16( hDecoderConfig->render_num_subframes, IVAS_RENDER_NUM_SUBFR_20MS ) ) { tmp = shl( tmp, 2 ); } @@ -860,7 +861,7 @@ ivas_error IVAS_DEC_GetRenderFramesizeMs( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - *render_framesize = get_render_frame_size_ms( hIvasDec->st_ivas->hDecoderConfig->render_framesize ); + *render_framesize = get_render_frame_size_ms( hIvasDec->st_ivas->hDecoderConfig->render_num_subframes ); move32(); return IVAS_ERR_OK; @@ -885,17 +886,17 @@ ivas_error IVAS_DEC_GetReferencesUpdateFrequency( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) + IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_num_subframes, IVAS_RENDER_NUM_SUBFR_5MS ) ) { *update_frequency = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; move16(); } - ELSE IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_10MS ) ) + ELSE IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_num_subframes, IVAS_RENDER_NUM_SUBFR_10MS ) ) { *update_frequency = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES >> 1; move16(); } - ELSE IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_20MS ) ) + ELSE IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_num_subframes, IVAS_RENDER_NUM_SUBFR_20MS ) ) { *update_frequency = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES >> 2; move16(); @@ -904,30 +905,6 @@ ivas_error IVAS_DEC_GetReferencesUpdateFrequency( return IVAS_ERR_OK; } -/*---------------------------------------------------------------------* - * IVAS_DEC_GetGetNumOrientationSubframes( ) - * - * Get the number of subframes for head/external orientation per render frame - *---------------------------------------------------------------------*/ - -ivas_error IVAS_DEC_GetNumOrientationSubframes( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - Word16 *num_subframes /* o : render framesize */ -) -{ - test(); - test(); - IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL || num_subframes == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - *num_subframes = (Word16) hIvasDec->st_ivas->hDecoderConfig->render_framesize; - move16(); - - return IVAS_ERR_OK; -} - /*---------------------------------------------------------------------* * IVAS_DEC_EnableVoIP( ) @@ -1158,12 +1135,12 @@ static Word16 isar_get_frame_size( test(); test(); - IF( NE_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_20MS ) && + IF( NE_32( st_ivas->hDecoderConfig->render_num_subframes, IVAS_RENDER_NUM_SUBFR_20MS ) && ( EQ_32( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) || EQ_32( st_ivas->hRenderConfig->split_rend_config.dof, 0 ) ) ) { nSamplesPerChannel = extract_l( Mpy_32_16_1( output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ) ); - nSamplesPerChannel = imult1616( nSamplesPerChannel, st_ivas->hDecoderConfig->render_framesize ); + nSamplesPerChannel = imult1616( nSamplesPerChannel, st_ivas->hDecoderConfig->render_num_subframes ); } ELSE { @@ -1638,7 +1615,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToOutput, st_ivas->BER_detect, Q11 ); #endif #else - IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) + IF( EQ_32( st_ivas->hDecoderConfig->render_num_subframes, IVAS_RENDER_FRAMESIZE_5MS ) ) { #ifndef DISABLE_LIMITER ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToOutput, st_ivas->BER_detect, Q11 ); @@ -5011,7 +4988,7 @@ IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); #endif #else - IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) + IF( EQ_32( st_ivas->hDecoderConfig->render_num_subframes, IVAS_RENDER_FRAMESIZE_5MS ) ) { #ifndef DISABLE_LIMITER ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); @@ -5556,7 +5533,7 @@ static ivas_error printConfigInfo_dec( test(); IF( ( EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( (Word16) output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) { - fprintf( stdout, "Render framesize: %dms\n", get_render_frame_size_ms( st_ivas->hDecoderConfig->render_framesize ) ); + fprintf( stdout, "Render framesize: %dms\n", get_render_frame_size_ms( st_ivas->hDecoderConfig->render_num_subframes ) ); } IF( st_ivas->hDecoderConfig->Opt_HRTF_binary ) { @@ -6395,7 +6372,7 @@ static ivas_error ivas_dec_init_split_rend( move16(); } - error = ISAR_PRE_REND_open( &st_ivas->hSplitBinRend->splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->render_framesize, mixed_td_cldfb_flag ); + error = ISAR_PRE_REND_open( &st_ivas->hSplitBinRend->splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->render_num_subframes, mixed_td_cldfb_flag ); move16(); return error; @@ -6469,7 +6446,7 @@ static ivas_error feedSinglePIorientation( { IF( !st_ivas->hExtOrientationData ) { - IF( NE_32( error = ivas_external_orientation_open_fx( &( st_ivas->hExtOrientationData ), st_ivas->hDecoderConfig->render_framesize ), IVAS_ERR_OK ) ) + IF( NE_32( error = ivas_external_orientation_open_fx( &( st_ivas->hExtOrientationData ), st_ivas->hDecoderConfig->render_num_subframes ), IVAS_ERR_OK ) ) { return error; } @@ -6477,7 +6454,7 @@ static ivas_error feedSinglePIorientation( IF( !st_ivas->hCombinedOrientationData ) { - IF( NE_32( error = ivas_combined_orientation_open_fx( &( st_ivas->hCombinedOrientationData ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->render_framesize ), IVAS_ERR_OK ) ) + IF( NE_32( error = ivas_combined_orientation_open_fx( &( st_ivas->hCombinedOrientationData ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->render_num_subframes ), IVAS_ERR_OK ) ) { return error; } diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index 10aaa6db5..80b736efe 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -58,7 +58,7 @@ ivas_error split_renderer_open_lc3plus( SPLIT_REND_WRAPPER *hSplitRendWrapper, /* i/o: Split renderer pre-renderer handle */ const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, /* i : Split renderer pre-renderer config */ const Word32 output_Fs, /* i : output sampling rate */ - const IVAS_RENDER_FRAMESIZE ivas_frame_size /* i : IVAS frame size */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes /* i : rendering number of subframes */ ); void isar_splitBinPreRendClose( @@ -371,7 +371,7 @@ Word32 isar_get_split_rend_md_target_brate( ); ivas_error isar_framesize_to_ms( - const IVAS_RENDER_FRAMESIZE frame_size, /* i : frame size enum */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes, /* i : rendering number of subframes */ Word16 *ms /* o : frame size in ms */ ); diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index 7255e7716..0288c5786 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -2705,17 +2705,18 @@ void isar_init_split_rend_handles( *------------------------------------------------------------------------*/ ivas_error split_renderer_open_lc3plus( - SPLIT_REND_WRAPPER *hSplitRendWrapper, - const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, - const Word32 OutSampleRate, - const IVAS_RENDER_FRAMESIZE isar_frame_size ) + SPLIT_REND_WRAPPER *hSplitRendWrapper, /* i/o: Split renderer pre-renderer handle */ + const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, /* i : Split renderer pre-renderer config */ + const Word32 OutSampleRate, /* i : output sampling rate */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes /* i : rendering number of subframes */ +) { ivas_error error; Word16 i, delayBufferLength; LC3PLUS_CONFIG config; Word16 isar_frame_size_ms; - IF( ( error = isar_framesize_to_ms( isar_frame_size, &isar_frame_size_ms ) ) != IVAS_ERR_OK ) + IF( ( error = isar_framesize_to_ms( render_num_subframes, &isar_frame_size_ms ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index 9aeda2289..2d9d14214 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -1278,20 +1278,27 @@ void isar_init_multi_bin_pose_data_fx_enc( return; } + +/*------------------------------------------------------------------------- + * Function isar_framesize_to_ms() + * + * + *------------------------------------------------------------------------*/ + ivas_error isar_framesize_to_ms( - const IVAS_RENDER_FRAMESIZE frame_size, /* i : frame size enum */ - Word16 *ms /* o : frame size in ms */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes, /* i : rendering number of subframes */ + Word16 *ms /* o : frame size in ms */ ) { - switch ( frame_size ) + switch ( render_num_subframes ) { - case IVAS_RENDER_FRAMESIZE_5MS: + case IVAS_RENDER_NUM_SUBFR_5MS: *ms = 5; break; - case IVAS_RENDER_FRAMESIZE_10MS: + case IVAS_RENDER_NUM_SUBFR_10MS: *ms = 10; break; - case IVAS_RENDER_FRAMESIZE_20MS: + case IVAS_RENDER_NUM_SUBFR_20MS: *ms = 20; break; default: diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index 61767c770..189f61c4d 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -51,13 +51,14 @@ *------------------------------------------------------------------------*/ ivas_error ISAR_PRE_REND_open( - SPLIT_REND_WRAPPER *hSplitRendWrapper, - ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, - const Word32 OutSampleRate, - const Word16 cldfb_in_flag, - const Word16 pcm_out_flag, - const IVAS_RENDER_FRAMESIZE ivas_frame_size, /* i: IVAS frame size */ - const Word16 mixed_td_cldfb_flag ) + SPLIT_REND_WRAPPER *hSplitRendWrapper, /* i/o: Split renderer pre-renerer handle */ + ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, /* i/o: Split renderer pre-renerer config */ + const Word32 OutSampleRate, /* i : output sampling rate */ + const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time doamin input */ + const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes, /* i : rendering number of subframes */ + const Word16 mixed_td_cldfb_flag /* i : Flag to indicate combined TD and CLDFB input */ +) { ivas_error error, ch, num_ch; UWord8 isCldfbNeeded = 0; @@ -67,7 +68,7 @@ ivas_error ISAR_PRE_REND_open( &pSplitRendConfig->isar_frame_size_ms, &pSplitRendConfig->codec_frame_size_ms, cldfb_in_flag_local, - pcm_out_flag, (Word16) ivas_frame_size ) ) != IVAS_ERR_OK ) + pcm_out_flag, (Word16) render_num_subframes ) ) != IVAS_ERR_OK ) { return error; } @@ -150,7 +151,7 @@ ivas_error ISAR_PRE_REND_open( { IF( EQ_16( pSplitRendConfig->codec, ISAR_SPLIT_REND_CODEC_LC3PLUS ) ) { - IF( ( error = split_renderer_open_lc3plus( hSplitRendWrapper, pSplitRendConfig, OutSampleRate, ivas_frame_size ) ) != IVAS_ERR_OK ) + IF( ( error = split_renderer_open_lc3plus( hSplitRendWrapper, pSplitRendConfig, OutSampleRate, render_num_subframes ) ) != IVAS_ERR_OK ) { return error; } @@ -276,13 +277,13 @@ void ISAR_PRE_REND_GetMultiBinPoseData( *------------------------------------------------------------------------*/ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( - SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renerer handle */ - const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ - const Word32 SplitRendBitRate, /* i : Split renderer bitrate */ - ISAR_SPLIT_REND_CODEC splitCodec, /* i/o: Split renderer codec */ - const Word16 isar_frame_size_ms, /* i : ISAR framesize */ - Word16 codec_frame_size_ms, /* i/o: ISAR transport codec framesize */ - ISAR_SPLIT_REND_BITS_HANDLE pBits, + SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renerer handle */ + const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ + const Word32 SplitRendBitRate, /* i : Split renderer bitrate */ + ISAR_SPLIT_REND_CODEC splitCodec, /* i/o: Split renderer codec */ + const Word16 isar_frame_size_ms, /* i : ISAR framesize */ + Word16 codec_frame_size_ms, /* i/o: ISAR transport codec framesize */ + ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: Split renderer bitstream handle */ Word32 *Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB real buffer */ Word32 *Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB imag buffer */ const Word16 max_bands, /* i : CLDFB bands */ diff --git a/lib_isar/lib_isar_pre_rend.h b/lib_isar/lib_isar_pre_rend.h index 0e1ca5672..e88336ee0 100644 --- a/lib_isar/lib_isar_pre_rend.h +++ b/lib_isar/lib_isar_pre_rend.h @@ -47,7 +47,7 @@ ivas_error ISAR_PRE_REND_open( const Word32 output_Fs, /* i : output sampling rate */ const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time doamin input */ const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ - const IVAS_RENDER_FRAMESIZE ivas_frame_size, /* i : IVAS frame size */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes, /* i : rendering number of subframes */ const Word16 mixed_td_cldfb_flag /* i : Flag to indicate combined TD and CLDFB input */ ); -- GitLab From 5b8d17cfe4ad2e6862d0b5202be3b5ebdd59eda2 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 12 Jan 2026 12:35:00 +0100 Subject: [PATCH 2/7] rename isar_framesize_to_ms() to isar_num_subfr_to_ms() --- lib_isar/isar_prot.h | 2 +- lib_isar/isar_splitRendererPre.c | 2 +- lib_isar/isar_splitRenderer_utils.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index 80b736efe..fb7bfc11b 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -370,7 +370,7 @@ Word32 isar_get_split_rend_md_target_brate( const Word16 pcm_out_flag /* i : flag to indicate PCM output */ ); -ivas_error isar_framesize_to_ms( +ivas_error isar_num_subfr_to_ms( const IVAS_RENDER_NUM_SUBFR render_num_subframes, /* i : rendering number of subframes */ Word16 *ms /* o : frame size in ms */ ); diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index 0288c5786..3b04f7673 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -2716,7 +2716,7 @@ ivas_error split_renderer_open_lc3plus( LC3PLUS_CONFIG config; Word16 isar_frame_size_ms; - IF( ( error = isar_framesize_to_ms( render_num_subframes, &isar_frame_size_ms ) ) != IVAS_ERR_OK ) + IF( ( error = isar_num_subfr_to_ms( render_num_subframes, &isar_frame_size_ms ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index 2d9d14214..fc0ecf0d5 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -1280,12 +1280,12 @@ void isar_init_multi_bin_pose_data_fx_enc( /*------------------------------------------------------------------------- - * Function isar_framesize_to_ms() + * Function isar_num_subfr_to_ms() * * *------------------------------------------------------------------------*/ -ivas_error isar_framesize_to_ms( +ivas_error isar_num_subfr_to_ms( const IVAS_RENDER_NUM_SUBFR render_num_subframes, /* i : rendering number of subframes */ Word16 *ms /* o : frame size in ms */ ) -- GitLab From c6ad9888377ed6d27e93eac437414c58a7e60ea4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 12 Jan 2026 12:55:17 +0100 Subject: [PATCH 3/7] address reviewer's comments --- apps/renderer.c | 2 +- lib_dec/lib_dec.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 5639f773e..47acbe332 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1653,7 +1653,7 @@ int main( { int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; - const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_num_subframes ) == 0; + const bool isCurrentFrameMultipleOf20ms = frame % ( IVAS_RENDER_NUM_SUBFR_20MS / args.render_num_subframes ) == 0; if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL && args.aeSequence.count > 0 && args.aeSequence.pValidity[args.aeSequence.selected] != 0 ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 14f26b68a..5bbfd604e 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -354,12 +354,12 @@ ivas_error IVAS_DEC_EnableSplitRendering( ivas_error IVAS_DEC_SetRenderNumSubfr( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const IVAS_RENDER_NUM_SUBFR render_n_subfr /* i : rendering number of subframes */ + const IVAS_RENDER_NUM_SUBFR render_num_subframes /* i : rendering number of subframes */ ); ivas_error IVAS_DEC_GetRenderNumSubfr( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_RENDER_NUM_SUBFR *render_n_subfr /* o : rendering number of subframes */ + IVAS_RENDER_NUM_SUBFR *render_num_subframes /* o : rendering number of subframes */ ); ivas_error IVAS_DEC_GetRenderFramesizeSamples( -- GitLab From 2598443ab36c1059fb7f169633fd32f81bf54540 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 12 Jan 2026 13:13:33 +0100 Subject: [PATCH 4/7] address reviewer's comments --- apps/isar_post_rend.c | 4 ++-- apps/renderer.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/isar_post_rend.c b/apps/isar_post_rend.c index a7f695b11..5c5d4ccc2 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -340,7 +340,7 @@ static bool parseInConfig( } -static bool parseRenderFramesize( +static bool parseRenderNumSubfr( char *value, IVAS_RENDER_NUM_SUBFR *render_num_subframes ) { @@ -559,7 +559,7 @@ static void parseOption( break; case CmdLnOptionId_framing: assert( numOptionValues == 1 ); - if ( !parseRenderFramesize( optionValues[0], &args->render_num_subframes ) ) + if ( !parseRenderNumSubfr( optionValues[0], &args->render_num_subframes ) ) { fprintf( stderr, "Unknown or invalid option for frame size: %s\n", optionValues[0] ); exit( -1 ); diff --git a/apps/renderer.c b/apps/renderer.c index 47acbe332..d803acb79 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2424,7 +2424,7 @@ static bool parseDiegeticPan( } -static bool parseRenderFramesize( +static bool parseRenderNumSubfr( char *value, IVAS_RENDER_NUM_SUBFR *render_num_subframes ) { @@ -2981,7 +2981,7 @@ static void parseOption( break; case CmdLnOptionId_framing: assert( numOptionValues == 1 ); - if ( !parseRenderFramesize( optionValues[0], &args->render_num_subframes ) ) + if ( !parseRenderNumSubfr( optionValues[0], &args->render_num_subframes ) ) { fprintf( stderr, "Unknown or invalid option for frame size: %s\n", optionValues[0] ); exit( -1 ); -- GitLab From f9a640fd71f8dbd14877fc7526da96f25187cf37 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 12 Jan 2026 15:22:20 +0100 Subject: [PATCH 5/7] fix get_render_frame_size_ms() --- lib_dec/lib_dec_fx.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 0f25a9f44..c37ef54c6 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -704,20 +704,7 @@ ivas_error IVAS_DEC_EnableSplitRendering( static Word16 get_render_frame_size_ms( IVAS_RENDER_NUM_SUBFR render_num_subframes ) { - IF( EQ_16( render_num_subframes, IVAS_RENDER_NUM_SUBFR_5MS ) ) - { - return ( 1000 / ( FRAMES_PER_SEC * IVAS_RENDER_NUM_SUBFR_5MS ) ); - } - ELSE IF( EQ_16( render_num_subframes, IVAS_RENDER_NUM_SUBFR_10MS ) ) - { - return ( ( 1000 / ( FRAMES_PER_SEC * IVAS_RENDER_NUM_SUBFR_10MS ) ) << 1 ); - } - ELSE IF( EQ_16( render_num_subframes, IVAS_RENDER_NUM_SUBFR_20MS ) ) - { - return ( ( 1000 / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) << 2 ); - } - - return 0; + return (int16_t) ( render_num_subframes * ( 1000 / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); } -- GitLab From ab5fb1cf9630a0f84ad6c39e83a6d35289a527d1 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jan 2026 15:16:48 +0100 Subject: [PATCH 6/7] address reviewer's comments --- apps/decoder.c | 10 ++++----- lib_dec/lib_dec_fx.c | 6 +++--- lib_isar/lib_isar_pre_rend.c | 17 +++++++-------- lib_isar/lib_isar_pre_rend.h | 40 ++++++++++++++++++------------------ lib_rend/lib_rend_fx.c | 2 +- 5 files changed, 38 insertions(+), 37 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 08cac8f21..cd811b7a3 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -429,7 +429,7 @@ int main( if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg.render_num_subframes ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } @@ -453,7 +453,7 @@ int main( if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg.render_num_subframes ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } @@ -2164,7 +2164,7 @@ static ivas_error decodeG192( IVAS_RENDER_NUM_SUBFR num_subframes; if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: \n" ); + fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } @@ -2995,7 +2995,7 @@ static ivas_error decodeVoIP( IVAS_RENDER_NUM_SUBFR num_subframes; if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &num_subframes ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: \n" ); + fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } @@ -3998,7 +3998,7 @@ static ivas_error restartDecoder( if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg->render_num_subframes ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index c37ef54c6..f7d12e5d2 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -116,7 +116,7 @@ static ivas_error ivas_dec_reconfig_split_rend( Decoder_Struct *st_ivas ); static ivas_error ivas_dec_init_split_rend( Decoder_Struct *st_ivas ); static ivas_error ivas_create_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); static void ivas_destroy_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); -static Word16 get_render_frame_size_ms( IVAS_RENDER_NUM_SUBFR render_num_subframes ); +static Word16 get_render_frame_size_ms( const IVAS_RENDER_NUM_SUBFR render_num_subframes ); static Word16 get_render_frame_size_samples( const DECODER_CONFIG_HANDLE hDecoderConfig ); static Word16 ivas_dec_split_rend_cldfb_in( const RENDERER_TYPE renderer_type ); static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const Word16 nSamplesRendered ); @@ -702,7 +702,7 @@ ivas_error IVAS_DEC_EnableSplitRendering( /*! r: render framesize in ms */ static Word16 get_render_frame_size_ms( - IVAS_RENDER_NUM_SUBFR render_num_subframes ) + const IVAS_RENDER_NUM_SUBFR render_num_subframes ) { return (int16_t) ( render_num_subframes * ( 1000 / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); } @@ -806,7 +806,7 @@ static Word16 get_render_frame_size_samples( /*---------------------------------------------------------------------* - * IVAS_DEC_GetGetRenderFramesizeSamples( ) + * IVAS_DEC_GetRenderFramesizeSamples( ) * * Get render framesize in samples *---------------------------------------------------------------------*/ diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index 189f61c4d..dc62fec03 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -51,8 +51,8 @@ *------------------------------------------------------------------------*/ ivas_error ISAR_PRE_REND_open( - SPLIT_REND_WRAPPER *hSplitRendWrapper, /* i/o: Split renderer pre-renerer handle */ - ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, /* i/o: Split renderer pre-renerer config */ + SPLIT_REND_WRAPPER *hSplitRendWrapper, /* i/o: Split renderer pre-renderer handle */ + ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, /* i/o: Split renderer pre-renderer config */ const Word32 OutSampleRate, /* i : output sampling rate */ const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time doamin input */ const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ @@ -179,7 +179,7 @@ ivas_error ISAR_PRE_REND_open( *------------------------------------------------------------------------*/ void ISAR_PRE_REND_close( - SPLIT_REND_WRAPPER *hSplitBinRend, /* i/o: Split renderer pre-renerer handle */ + SPLIT_REND_WRAPPER *hSplitBinRend, /* i/o: Split renderer pre-renderer handle */ IVAS_REND_AudioBuffer *pSplitRendEncBuffer /* i/o: Split renderer data buffer */ ) { @@ -259,7 +259,7 @@ void ISAR_PRE_REND_close( *-------------------------------------------------------------------------*/ void ISAR_PRE_REND_GetMultiBinPoseData( - const ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, /* i : Split renderer pre-renerer config */ + const ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, /* i : Split renderer pre-renderer config */ MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ const ISAR_SPLIT_REND_ROT_AXIS rot_axis /* i : Rotation axis */ ) @@ -277,13 +277,13 @@ void ISAR_PRE_REND_GetMultiBinPoseData( *------------------------------------------------------------------------*/ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( - SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renerer handle */ + SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renderer handle */ const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ const Word32 SplitRendBitRate, /* i : Split renderer bitrate */ ISAR_SPLIT_REND_CODEC splitCodec, /* i/o: Split renderer codec */ const Word16 isar_frame_size_ms, /* i : ISAR framesize */ Word16 codec_frame_size_ms, /* i/o: ISAR transport codec framesize */ - ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: Split renderer bitstream handle */ + ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ Word32 *Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB real buffer */ Word32 *Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB imag buffer */ const Word16 max_bands, /* i : CLDFB bands */ @@ -292,16 +292,17 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time domain input */ const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ const Word16 ro_md_flag, /* i : Flag to indicate real only metadata for yaw */ - Word16 Q_buff, + const Word16 Q_buff, Word16 *Q_out ) { ivas_error error; Word32 bit_len, target_md_bits, available_bits, tmp_32; Word16 q1 = 31, q2 = 31, q_final, Q_cldfb, tmp, tmp_e; Word16 i, j; - error = IVAS_ERR_OK; Word16 Q_buff_re, Q_buff_im; + error = IVAS_ERR_OK; + move16(); push_wmops( "ISAR_PRE_REND_MultiBinToSplitBinaural" ); Q_buff_re = Q_buff; diff --git a/lib_isar/lib_isar_pre_rend.h b/lib_isar/lib_isar_pre_rend.h index e88336ee0..e14f52805 100644 --- a/lib_isar/lib_isar_pre_rend.h +++ b/lib_isar/lib_isar_pre_rend.h @@ -42,8 +42,8 @@ *----------------------------------------------------------------------------------*/ ivas_error ISAR_PRE_REND_open( - SPLIT_REND_WRAPPER *hSplitBinRend, /* i/o: Split renderer pre-renerer handle */ - ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, /* i/o: Split renderer pre-renerer config */ + SPLIT_REND_WRAPPER *hSplitBinRend, /* i/o: Split renderer pre-renderer handle */ + ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, /* i/o: Split renderer pre-renderer config */ const Word32 output_Fs, /* i : output sampling rate */ const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time doamin input */ const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ @@ -52,33 +52,33 @@ ivas_error ISAR_PRE_REND_open( ); void ISAR_PRE_REND_close( - SPLIT_REND_WRAPPER *hSplitBinRend, /* i/o: Split renderer pre-renerer handle */ + SPLIT_REND_WRAPPER *hSplitBinRend, /* i/o: Split renderer pre-renderer handle */ IVAS_REND_AudioBuffer *pSplitRendEncBuffer /* i/o: Split renderer data buffer */ ); void ISAR_PRE_REND_GetMultiBinPoseData( - const ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, /* i : Split renderer pre-renerer config */ + const ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, /* i : Split renderer pre-renderer config */ MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ const ISAR_SPLIT_REND_ROT_AXIS rot_axis /* i : Rotation axis */ ); ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( - SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renerer handle */ - const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ - const Word32 SplitRendBitRate, /* i : Split renderer bitrate */ - ISAR_SPLIT_REND_CODEC splitCodec, /* i/o: Split renderer codec */ - const Word16 isar_frame_size_ms, /* i : ISAR framesize */ - Word16 codec_frame_size_ms, /* i/o: Split renderer codec framesize */ - ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: Split renderer bitstream handle */ - Word32* Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB real buffer */ - Word32* Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB imag buffer */ - const Word16 max_bands, /* i : CLDFB bands */ - Word32 *pOutput_fx[], /* i : low time resolution pre-renderer flag */ - const Word16 low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ - const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time doamin input */ - const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ - const Word16 ro_md_flag, /* i : Flag to indicate real only metadata for yaw */ - Word16 Q_buff, + SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renderer handle */ + const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ + const Word32 SplitRendBitRate, /* i : Split renderer bitrate */ + ISAR_SPLIT_REND_CODEC splitCodec, /* i/o: Split renderer codec */ + const Word16 isar_frame_size_ms, /* i : ISAR framesize */ + Word16 codec_frame_size_ms, /* i/o: Split renderer codec framesize */ + ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ + Word32* Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB real buffer */ + Word32* Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB imag buffer */ + const Word16 max_bands, /* i : CLDFB bands */ + Word32 *pOutput_fx[], /* i : low time resolution pre-renderer flag */ + const Word16 low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ + const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time doamin input */ + const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ + const Word16 ro_md_flag, /* i : Flag to indicate real only metadata for yaw */ + const Word16 Q_buff, Word16 *Q_out ); diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index eaed6ebf5..66d89d6f2 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -11404,7 +11404,7 @@ static ivas_error printConfigInfo_rend( EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - fprintf( stdout, "Render framesize: %dms\n", i_mult( hIvasRend->num_subframes, 5 ) ); + fprintf( stdout, "Render framesize: %dms\n", i_mult( hIvasRend->num_subframes, BINAURAL_RENDERING_FRAME_SIZE_MS ) ); } return IVAS_ERR_OK; -- GitLab From ebfffe748460200da50bfa6606cda25f2b5df4d6 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jan 2026 15:25:43 +0100 Subject: [PATCH 7/7] fix build --- lib_isar/lib_isar_pre_rend.c | 2 +- lib_isar/lib_isar_pre_rend.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index dc62fec03..05b98f6a4 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -292,7 +292,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time domain input */ const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ const Word16 ro_md_flag, /* i : Flag to indicate real only metadata for yaw */ - const Word16 Q_buff, + Word16 Q_buff, Word16 *Q_out ) { ivas_error error; diff --git a/lib_isar/lib_isar_pre_rend.h b/lib_isar/lib_isar_pre_rend.h index e14f52805..f06877bbe 100644 --- a/lib_isar/lib_isar_pre_rend.h +++ b/lib_isar/lib_isar_pre_rend.h @@ -78,7 +78,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time doamin input */ const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ const Word16 ro_md_flag, /* i : Flag to indicate real only metadata for yaw */ - const Word16 Q_buff, + Word16 Q_buff, Word16 *Q_out ); -- GitLab