diff --git a/apps/decoder.c b/apps/decoder.c index a091cbe3080852ff80b106e4ebd6293fc6584366..ea31b85dfd8ba900ce970b52247be3693287d15f 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -465,7 +465,7 @@ int main( { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } @@ -630,6 +630,7 @@ int main( fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); goto cleanup; } + #ifdef CONF_DISTATT if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK ) { @@ -637,8 +638,8 @@ int main( goto cleanup; } #endif - if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || - arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + + 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 && ( renderConfig.split_rend_config.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE || @@ -688,6 +689,7 @@ int main( } renderConfig.roomAcoustics.override = true; } + /* 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; @@ -1436,7 +1438,7 @@ static bool parseCmdlIVAS_dec( arg->outputMdFilename = argv[i + 1]; if ( arg->outputMdFilename[0] == '\0' ) { - fprintf( stderr, "Error: output metadata file path not specified\n\n" ); + fprintf( stderr, "Error: Split rendering output metadata file path not specified\n\n" ); usage_dec(); return false; } @@ -1887,6 +1889,7 @@ static ivas_error initOnFirstGoodFrame( uint16_t *pNumObj, /* o : */ SplitFileReadWrite **splitRendWriter ) { + int16_t isSplitRend, isSplitCoded; ivas_error error = IVAS_ERR_UNKNOWN; /* Now delay, number of output channels and frame size are known */ @@ -1896,7 +1899,19 @@ static ivas_error initOnFirstGoodFrame( return error; } - if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) + if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); + return error; + } + + if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); + return error; + } + + if ( isSplitRend ) { pFullDelayNumSamples[0] = 0; } @@ -1921,7 +1936,7 @@ static ivas_error initOnFirstGoodFrame( return error; } - if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) + if ( isSplitRend ) { /* Open split rendering metadata writer */ int16_t delayNumSamples_temp[3]; @@ -1938,29 +1953,15 @@ static ivas_error initOnFirstGoodFrame( return error; } - if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, - &splitRendCodec, - &poseCorrection, - &splitRendIsarFrameSizeMs, - &splitRendCodecFrameSizeMs, - &lc3plusHighRes ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendIsarFrameSizeMs, &splitRendCodecFrameSizeMs, &lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get split renderer bitstream header: %s\n", ivas_error_to_string( error ) ); return error; } - if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) ) + if ( isSplitCoded ) { - if ( ( error = split_rend_writer_open( splitRendWriter, - arg.outputWavFilename, - delayNumSamples_temp[0], - delayTimeScale_temp, - splitRendCodec, - poseCorrection, - splitRendCodecFrameSizeMs, - splitRendIsarFrameSizeMs, - arg.output_Fs, - lc3plusHighRes ) ) != IVAS_ERR_OK ) + if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; @@ -1974,16 +1975,7 @@ static ivas_error initOnFirstGoodFrame( return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; } - if ( ( error = split_rend_writer_open( splitRendWriter, - arg.outputMdFilename, - delayNumSamples_temp[0], - delayTimeScale_temp, - splitRendCodec, - poseCorrection, - splitRendCodecFrameSizeMs, - splitRendIsarFrameSizeMs, - arg.output_Fs, - lc3plusHighRes ) ) != IVAS_ERR_OK ) + if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; @@ -1991,7 +1983,7 @@ static ivas_error initOnFirstGoodFrame( } } - if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) + if ( !isSplitCoded ) { /* Open audio writer and write all previously skipped bad frames now that frame size is known */ if ( ( error = AudioFileWriter_open( ppAfWriter, arg.outputWavFilename, arg.output_Fs, *pNumOutChannels ) ) != IVAS_ERR_OK ) @@ -2205,10 +2197,23 @@ static ivas_error decodeG192( IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }; int16_t vec_pos_update, vec_pos_len; SplitFileReadWrite *splitRendWriter = NULL; + int16_t isSplitRend, isSplitCoded; #ifdef FIX_1053_REVERB_RECONFIGURATION IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; + if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); + return error; + } + + if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); + return error; + } + if ( arg.renderConfigEnabled ) { if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) @@ -2230,6 +2235,7 @@ static ivas_error decodeG192( } } #endif + for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { ismWriters[i] = NULL; @@ -2238,7 +2244,6 @@ static ivas_error decodeG192( /* we always start with needing a new frame */ needNewFrame = true; - if ( !arg.quietModeEnabled ) { fprintf( stdout, "\n------ Running the decoder ------\n\n" ); @@ -2516,7 +2521,7 @@ static ivas_error decodeG192( } } - if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) + if ( isSplitRend ) { if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { @@ -2584,7 +2589,7 @@ static ivas_error decodeG192( /* Write current frame */ if ( decodedGoodFrame ) { - if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) + if ( isSplitRend ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) { @@ -2593,7 +2598,7 @@ static ivas_error decodeG192( } } - if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) + if ( !isSplitCoded ) { if ( delayNumSamples < nOutSamples ) { @@ -2654,11 +2659,13 @@ static ivas_error decodeG192( fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif + if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } + #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index d6960671d93ff44385f036494dab13a3c01ae0de..212af9fed37a1af2f252c66283398029f4b00dfa 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -274,7 +274,7 @@ typedef struct _ISAR_SPLIT_REND_CONFIG 2 - (2dof correction. By default YAW and PITCH correction) 3 - (3dof correction. By default YAW, PITCH and ROLL correction) */ - int16_t codec_delay_ms; /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ + int16_t codec_delay_ms; /* look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ int16_t isar_frame_size_ms; /* ISAR bit stream frame size in milliseconds */ int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index 2cd342fb3211be657adb4dd828ec85ecee2a6819..16c923a436cdbd45b6668e31d832a30142ebe777 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -51,11 +51,11 @@ /*! r: delay value in ns */ int32_t get_delay( - const int16_t enc_dec, /* i : encoder/decoder flag */ - const int32_t io_fs, /* i : input/output sampling frequency */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - HANDLE_CLDFB_FILTER_BANK hCldfb, /* i : Handle of Cldfb analysis */ - const AUDIO_CONFIG output_config /* i : decoder output config */ + const int16_t enc_dec, /* i : encoder/decoder flag */ + const int32_t io_fs, /* i : input/output sampling frequency */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + HANDLE_CLDFB_FILTER_BANK hCldfb, /* i : Handle of Cldfb analysis */ + const int16_t flag_binaural_split_coded /* i : split rendering on/off flag */ ) { int32_t delay = 0; @@ -98,7 +98,7 @@ int32_t get_delay( { delay = IVAS_DEC_DELAY_NS; - if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( !flag_binaural_split_coded ) { if ( hCldfb != NULL ) { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 641f87213395214c1b1f564f2eb329531c8cdc30..4507fdf0faa5602ca1df087653ae44104227cbab 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -312,6 +312,11 @@ ivas_error ivas_output_buff_dec( const int16_t nchan_out_buff /* i : number of output channels */ ); +/*! r: flag to indicate if split rendering is enabled */ +int16_t is_split_rendering_enabled( + const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */ + const IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* i : Render config data structure */ +); ivas_error get_channel_config( const AUDIO_CONFIG config, diff --git a/lib_com/prot.h b/lib_com/prot.h index 2ccfbbe683766d615111498392e2881a9599347c..5afa0a595afc24f35c4b32ae292b9c56093e87f2 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -688,12 +688,11 @@ int16_t lev_dur( /*! r: delay value in ns */ int32_t get_delay( - const int16_t enc_dec, /* i : encoder/decoder flag */ - const int32_t io_fs, /* i : input/output sampling frequency */ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - HANDLE_CLDFB_FILTER_BANK hCldfb /* i : Handle of Cldfb analysis */ - , - const AUDIO_CONFIG output_config /* i : decoder output config */ + const int16_t enc_dec, /* i : encoder/decoder flag */ + const int32_t io_fs, /* i : input/output sampling frequency */ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + HANDLE_CLDFB_FILTER_BANK hCldfb, /* i : Handle of Cldfb analysis */ + const int16_t flag_binaural_split_coded /* i : split rendering on/off flag */ ); void decision_matrix_enc( diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 56990605bb47e6b4d2dc5e2502fc3d30baaad687..678a2075bec0873f65c6c0ad59f6ec047c469d9c 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2338,11 +2338,8 @@ void ivas_dirac_dec_render_sf( } /* Perform binaural rendering */ - ivas_binRenderer( st_ivas->hBinRenderer, - ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, - - st_ivas->hCombinedOrientationData, - hSpatParamRendCom->subframe_nbslots[subframe_idx], + ivas_binRenderer( st_ivas->hBinRenderer, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, + st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 7011a09f958e0b0e1a9617c32ed6eaeb1458c9b6..55f08644bc8b70e2bba6bab1862cdb31e5c9af74 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -37,9 +37,6 @@ #include "ivas_rom_com.h" #include "ivas_stat_enc.h" #include "prot.h" -#include "lib_isar_pre_rend.h" -#include "isar_prot.h" -#include "isar_stat.h" #include #include #include @@ -65,185 +62,6 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord #endif #endif -static ivas_error ivas_dec_reconfig_split_rend( Decoder_Struct *st_ivas ); - - -/*-------------------------------------------------------------------* - * ivas_dec_reconfig_split_rend() - * - * IVAS decoder split rend reconfig - *-------------------------------------------------------------------*/ - -static ivas_error ivas_dec_reconfig_split_rend( - Decoder_Struct *st_ivas /* i : IVAS decoder structure */ -) -{ - ivas_error error; - int16_t cldfb_in_flag, num_ch, ch, isCldfbNeeded, i, pcm_out_flag; - SPLIT_REND_WRAPPER *hSplitRendWrapper; - - hSplitRendWrapper = &st_ivas->hSplitBinRend->splitrend; - pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; - cldfb_in_flag = 0; - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || - st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || - st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || - st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - cldfb_in_flag = 1; - } - - ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &hSplitRendWrapper->multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS ); - - isCldfbNeeded = 0; - - if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) || - ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) - { - cldfb_in_flag = 0; - } - - if ( st_ivas->renderer_type != RENDERER_DISABLE ) - { - if ( cldfb_in_flag == 0 ) - { - isCldfbNeeded = 1; - } - else if ( st_ivas->hRenderConfig->split_rend_config.codec == ISAR_SPLIT_REND_CODEC_LC3PLUS && cldfb_in_flag ) - { - isCldfbNeeded = 1; - } - else if ( pcm_out_flag && cldfb_in_flag ) - { - isCldfbNeeded = 1; - } - } - else if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) - { - isCldfbNeeded = 1; - } - - if ( isCldfbNeeded == 1 && hSplitRendWrapper->hCldfbHandles == NULL ) - { - if ( ( hSplitRendWrapper->hCldfbHandles = (CLDFB_HANDLES_WRAPPER_HANDLE) malloc( sizeof( CLDFB_HANDLES_WRAPPER ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB handles\n" ) ); - } - - num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; - for ( ch = 0; ch < num_ch; ch++ ) - { - hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL; - } - - num_ch = hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; - - for ( ch = 0; ch < num_ch; ch++ ) - { - if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not open CLDFB handles\n" ) ); - } - } - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] ), CLDFB_SYNTHESIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - else if ( isCldfbNeeded == 0 && hSplitRendWrapper->hCldfbHandles != NULL ) - { - num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; - for ( ch = 0; ch < num_ch; ch++ ) - { - if ( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] != NULL ) - { - deleteCldfb( &hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ); - hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL; - } - } - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - if ( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] != NULL ) - { - deleteCldfb( &hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] ); - hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] = NULL; - } - } - - free( hSplitRendWrapper->hCldfbHandles ); - hSplitRendWrapper->hCldfbHandles = NULL; - } - - if ( ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) && - ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV || st_ivas->ivas_format != SBA_ISM_FORMAT ) && - !( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) /* td-rend not needed? */ - { - for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) - { - if ( st_ivas->hTdRendHandles[i] != NULL ) - { - st_ivas->hTdRendHandles[i]->HrFiltSet_p = NULL; - ivas_td_binaural_close( &st_ivas->hTdRendHandles[i] ); - } - } - } - - return IVAS_ERR_OK; -} - - -/*-------------------------------------------------------------------* - * ivas_dec_init_split_rend() - * - * IVAS decoder split rend init - *-------------------------------------------------------------------*/ - -static ivas_error ivas_dec_init_split_rend( - Decoder_Struct *st_ivas /* i : IVAS decoder structure */ -) -{ - ivas_error error; - int16_t cldfb_in_flag, pcm_out_flag; - int16_t mixed_td_cldfb_flag; - - pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; - cldfb_in_flag = 0; - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || - st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || - st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || - st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - cldfb_in_flag = 1; - } - - ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS ); - - if ( cldfb_in_flag == 1 && ( st_ivas->hSplitBinRend->splitrend.multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ) - { - if ( ( st_ivas->hSplitBinRend->hCldfbDataOut = (ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for cldfb data out buffer\n" ) ); - } - } - - mixed_td_cldfb_flag = 0; - if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) || - ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) - { - mixed_td_cldfb_flag = 1; - } - - 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, (int16_t) st_ivas->hDecoderConfig->render_framesize, mixed_td_cldfb_flag ); - return error; -} - #ifdef NONBE_FIX_1052_SBA_EXT #ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER @@ -289,6 +107,7 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord } #endif + /*-------------------------------------------------------------------* * ivas_dec_setup() * @@ -742,18 +561,6 @@ ivas_error ivas_dec_setup( } } - /*-----------------------------------------------------------------* - * reconfig split rendering as renderer might change after bitrate switching - *-----------------------------------------------------------------*/ - - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - if ( ( error = ivas_dec_reconfig_split_rend( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - /*----------------------------------------------------------------* * Reset bitstream pointers *----------------------------------------------------------------*/ @@ -1350,19 +1157,6 @@ ivas_error ivas_init_decoder( } } - /*-----------------------------------------------------------------* - * Initialize binuaral split rendering - *-----------------------------------------------------------------*/ - - if ( st_ivas->hSplitBinRend != NULL && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || - ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) ) - { - if ( ( error = ivas_dec_init_split_rend( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 269dba63852dcfebe6e9c9eaf500c7e0b3d462cd..a115532990f3f3f180ecdf6ca9b027a707f549c5 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -397,15 +397,11 @@ ivas_error ivas_ism_dec_config( if ( st_ivas->ini_active_frame != 0 ) { /* ISM bit-rate switching */ + if ( ( st_ivas->ism_mode != last_ism_mode ) || ( st_ivas->hDecoderConfig->ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) ) { - if ( ( st_ivas->ism_mode != last_ism_mode ) || ( st_ivas->hDecoderConfig->ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) ) + if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) { - if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, - pcm_resolution, - data ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } } } @@ -425,9 +421,7 @@ ivas_error ivas_ism_dec_config( /* ISM mode switching */ if ( st_ivas->ism_mode != last_ism_mode ) { - if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, - pcm_resolution, - data ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 09117ace582dbd3eb574b776f7fa92313886f57f..9f1fa45143701c9d5a79f68896adcf108fe6abc5 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1346,10 +1346,8 @@ ivas_error ivas_jbm_dec_render( } else { - if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : p_tc, p_output, *nSamplesRendered, output_Fs, 0 ) ) != IVAS_ERR_OK ) - { return error; } @@ -1395,7 +1393,7 @@ ivas_error ivas_jbm_dec_render( /* Rendering */ if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && !st_ivas->hDecoderConfig->Opt_Headrotation ) { - /*handled in CLDFB domain already*/ + /* handled in CLDFB domain already */ if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output ); @@ -1495,7 +1493,7 @@ ivas_error ivas_jbm_dec_render( nchan_out_syn_output = nchan_out; } - if ( st_ivas->hDecoderConfig->Opt_Limiter ) + if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) { if ( st_ivas->ivas_format != MONO_FORMAT ) { @@ -1545,7 +1543,7 @@ ivas_error ivas_jbm_dec_flush_renderer( const ISM_MODE ism_mode_old, /* i : old ISM mode */ uint16_t *nSamplesRendered, /* o : number of samples flushed */ const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ + void *data /* o : output synthesis signal */ ) { ivas_error error; @@ -1768,7 +1766,7 @@ ivas_error ivas_jbm_dec_flush_renderer( *nSamplesRendered = n_samples_to_render; /* Only write out the valid data*/ - if ( st_ivas->hDecoderConfig->Opt_Limiter ) + if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) { if ( st_ivas->ivas_format != MONO_FORMAT ) { @@ -1784,9 +1782,7 @@ ivas_error ivas_jbm_dec_flush_renderer( #ifdef DEBUGGING st_ivas->noClipping += #endif - ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, - (int16_t *) - data ); + ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (int16_t *) data ); break; case PCM_FLOAT32: diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index bbcc1756817f27e6124baf93edd88de53a3be465..ce283a800e1ec8a16b217e7bb78c13ab2ae19a7d 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -40,7 +40,6 @@ #include "stat_dec.h" #include "ivas_stat_com.h" #include "ivas_stat_rend.h" -#include "isar_stat.h" /*----------------------------------------------------------------------------------* @@ -1001,7 +1000,6 @@ typedef struct decoder_config_structure int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ #endif int16_t Opt_tsm; /* indicates whether time scaling modification is activated */ - int16_t Opt_Limiter; IVAS_RENDER_FRAMESIZE render_framesize; int16_t Opt_delay_comp; /* flag indicating delay compensation active */ @@ -1108,7 +1106,7 @@ typedef struct Decoder_Struct int16_t flag_omasa_brate; ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend; /* ISAR split binaural rendering handle */ - BINAURAL_TD_OBJECT_RENDERER_HANDLE hTdRendHandles[MAX_HEAD_ROT_POSES - 1]; + BINAURAL_TD_OBJECT_RENDERER_HANDLE hTdRendHandles[MAX_HEAD_ROT_POSES - 1]; /* TD object renderer handles */ /* JBM module */ DECODER_TC_BUFFER_HANDLE hTcBuffer; /* JBM structure */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index b6e424853c2a89814a0ecc6958b795db8f0c21c0..ce88f638b400af22a3a58fd7df6ab1f66fd432d1 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -124,6 +124,8 @@ static void *pcm_buffer_offset( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, c static ivas_error set_pcm_buffer_to_zero( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, const int16_t nZeroSamples ); static ivas_error isar_set_split_rend_setup( ISAR_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, const ISAR_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); static ivas_error ivas_create_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); +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 void ivas_destroy_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE @@ -309,7 +311,6 @@ static void init_decoder_config( hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain = 0; hDecoderConfig->Opt_tsm = 0; - hDecoderConfig->Opt_Limiter = 1; hDecoderConfig->Opt_delay_comp = 0; hDecoderConfig->Opt_ExternalOrientation = 0; hDecoderConfig->Opt_dpid_on = 0; @@ -542,10 +543,6 @@ ivas_error IVAS_DEC_EnableSplitRendering( ) { DECODER_CONFIG_HANDLE hDecoderConfig; - ivas_error error; - - error = IVAS_ERR_OK; - if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { @@ -557,9 +554,7 @@ ivas_error IVAS_DEC_EnableSplitRendering( hDecoderConfig->Opt_Headrotation = 1; hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; - hDecoderConfig->Opt_Limiter = 0; - - return error; + return IVAS_ERR_OK; } @@ -1078,8 +1073,7 @@ ivas_error IVAS_DEC_GetSamples( * *---------------------------------------------------------------------*/ -ivas_error -IVAS_DEC_GetSplitBinauralBitstream( +ivas_error IVAS_DEC_GetSplitBinauralBitstream( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ void *pcmBuf_out, /* o : output synthesis signal for BINAURAL_SPLIT_PCM */ ISAR_SPLIT_REND_BITS_DATA *splitRendBits, /* o : output split rendering bits */ @@ -1131,7 +1125,7 @@ IVAS_DEC_GetSplitBinauralBitstream( numSamplesPerChannelToDecode *= (int16_t) st_ivas->hDecoderConfig->render_framesize; } - if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) == 0 ) + if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) { return IVAS_ERR_WRONG_PARAMS; } @@ -1153,7 +1147,6 @@ IVAS_DEC_GetSplitBinauralBitstream( } } - /* Decode and render */ if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) { @@ -1223,6 +1216,7 @@ IVAS_DEC_GetSplitBinauralBitstream( Quaternion.y = 0.0f; Quaternion.z = 0.0f; } + if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hSplitBinRend->splitrend, Quaternion, st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, @@ -1233,7 +1227,6 @@ IVAS_DEC_GetSplitBinauralBitstream( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, max_band, pOutput, 1, !td_input, pcm_out_flag, ro_md_flag ) ) != IVAS_ERR_OK ) - { return error; } @@ -1322,6 +1315,28 @@ static ivas_error IVAS_DEC_Setup( *nTransportChannels = (uint8_t) st_ivas->hTcBuffer->nchan_transport_jbm; *nTcBufferGranularity = (uint16_t) st_ivas->hTcBuffer->n_samples_granularity; *nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; + + /*-----------------------------------------------------------------* + * ISAR: + * - initialize ISAR handle at the first frame + * - reconfigure the ISAR handle in case of bitrate switching (renderer might change) + *-----------------------------------------------------------------*/ + + if ( st_ivas->ini_frame == 0 && ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) ) ) + { + if ( ( error = ivas_dec_init_split_rend( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + if ( ( error = ivas_dec_reconfig_split_rend( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } } return IVAS_ERR_OK; @@ -2098,18 +2113,8 @@ static ivas_error copyRendererConfigStruct( mvr2r( hRCin->roomAcoustics.pAcoustic_rt60, hRCout->roomAcoustics.pAcoustic_rt60, CLDFB_NO_CHANNELS_MAX ); mvr2r( hRCin->roomAcoustics.pAcoustic_dsr, hRCout->roomAcoustics.pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX ); mvr2r( hRCin->directivity, hRCout->directivity, 3 * MAX_NUM_OBJECTS ); - /* TODO: This seems wrong. Why set default instead of copying from hRCin? - * Currently seems to work because we only ever copy from a default-initialized handle anyway */ - hRCout->split_rend_config.splitRendBitRate = SPLIT_REND_768k; - hRCout->split_rend_config.dof = 3; - hRCout->split_rend_config.hq_mode = 0; - hRCout->split_rend_config.codec_delay_ms = 0; - hRCout->split_rend_config.isar_frame_size_ms = 20; - hRCout->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ - hRCout->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; - hRCout->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; - hRCout->split_rend_config.rendererSelection = hRCin->split_rend_config.rendererSelection; - hRCout->split_rend_config.lc3plus_highres = hRCin->split_rend_config.lc3plus_highres; + hRCout->split_rend_config = hRCin->split_rend_config; + hRCout->roomAcoustics.use_er = hRCin->roomAcoustics.use_er; hRCout->roomAcoustics.lowComplexity = hRCin->roomAcoustics.lowComplexity; @@ -2260,9 +2265,12 @@ ivas_error IVAS_DEC_FeedRenderConfig( hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; } - if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + if ( is_split_rendering_enabled( hIvasDec->st_ivas->hDecoderConfig, hRenderConfig ) ) { - return error; + if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } } return IVAS_ERR_OK; @@ -2298,7 +2306,7 @@ ivas_error IVAS_DEC_GetDelay( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT - nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbSynDec[0], hDecoderConfig->output_config ) ); + nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbSynDec[0], hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ); #else nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], hDecoderConfig->output_config ) ); #endif @@ -3682,8 +3690,7 @@ IVAS_DEC_GetSplitRendBitstreamHeader( ISAR_SPLIT_REND_CODEC *pCodec, /* o: pointer to codec setting */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o: pointer to pose correction mode */ int16_t *pIsar_frame_size_ms, /* o: pointer to isar frame size setting */ - int16_t *pCodec_frame_size_ms /* o: pointer to codec frame size setting */ - , + int16_t *pCodec_frame_size_ms, /* o: pointer to codec frame size setting */ int16_t *pLc3plusHighRes ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) @@ -3696,6 +3703,7 @@ IVAS_DEC_GetSplitRendBitstreamHeader( *poseCorrection = hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode; *pIsar_frame_size_ms = hIvasDec->st_ivas->hRenderConfig->split_rend_config.isar_frame_size_ms; *pLc3plusHighRes = hIvasDec->st_ivas->hRenderConfig->split_rend_config.lc3plus_highres; + return IVAS_ERR_OK; } @@ -3910,26 +3918,198 @@ static void ivas_destroy_handle_isar( *---------------------------------------------------------------------*/ int16_t IVAS_DEC_is_split_rendering_enabled( - IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + int16_t *isSplitRend /* o : flag to indicate if split rendering is enabled */ ) { Decoder_Struct *st_ivas; - int16_t isSplitRend; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } + st_ivas = hIvasDec->st_ivas; - isSplitRend = 0; + *isSplitRend = is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ); - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || - ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) + return IVAS_ERR_OK; +} + +/*-------------------------------------------------------------------* + * ivas_dec_reconfig_split_rend() + * + * IVAS decoder split rend reconfig + *-------------------------------------------------------------------*/ + +static ivas_error ivas_dec_reconfig_split_rend( + Decoder_Struct *st_ivas /* i : IVAS decoder structure */ +) +{ + ivas_error error; + int16_t cldfb_in_flag, num_ch, ch, isCldfbNeeded, i, pcm_out_flag; + SPLIT_REND_WRAPPER *hSplitRendWrapper; + + hSplitRendWrapper = &st_ivas->hSplitBinRend->splitrend; + pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + cldfb_in_flag = 0; + + if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || + st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || + st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || + st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) + { + cldfb_in_flag = 1; + } + + ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &hSplitRendWrapper->multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS ); + + isCldfbNeeded = 0; + + if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) || + ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + { + cldfb_in_flag = 0; + } + + if ( st_ivas->renderer_type != RENDERER_DISABLE ) + { + if ( cldfb_in_flag == 0 ) + { + isCldfbNeeded = 1; + } + else if ( st_ivas->hRenderConfig->split_rend_config.codec == ISAR_SPLIT_REND_CODEC_LC3PLUS && cldfb_in_flag ) + { + isCldfbNeeded = 1; + } + else if ( pcm_out_flag && cldfb_in_flag ) + { + isCldfbNeeded = 1; + } + } + else if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) + { + isCldfbNeeded = 1; + } + + if ( isCldfbNeeded == 1 && hSplitRendWrapper->hCldfbHandles == NULL ) + { + if ( ( hSplitRendWrapper->hCldfbHandles = (CLDFB_HANDLES_WRAPPER_HANDLE) malloc( sizeof( CLDFB_HANDLES_WRAPPER ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB handles\n" ) ); + } + + num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; + for ( ch = 0; ch < num_ch; ch++ ) + { + hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL; + } + + num_ch = hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; + + for ( ch = 0; ch < num_ch; ch++ ) + { + if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not open CLDFB handles\n" ) ); + } + } + + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] ), CLDFB_SYNTHESIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } + else if ( isCldfbNeeded == 0 && hSplitRendWrapper->hCldfbHandles != NULL ) { - isSplitRend = 1; + num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; + for ( ch = 0; ch < num_ch; ch++ ) + { + if ( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] != NULL ) + { + deleteCldfb( &hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ); + hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL; + } + } + + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + if ( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] != NULL ) + { + deleteCldfb( &hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] ); + hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] = NULL; + } + } + + free( hSplitRendWrapper->hCldfbHandles ); + hSplitRendWrapper->hCldfbHandles = NULL; } - return isSplitRend; + if ( ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) && + ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV || st_ivas->ivas_format != SBA_ISM_FORMAT ) && + !( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + { + for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + { + if ( st_ivas->hTdRendHandles[i] != NULL ) + { + st_ivas->hTdRendHandles[i]->HrFiltSet_p = NULL; + ivas_td_binaural_close( &st_ivas->hTdRendHandles[i] ); + } + } + } + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------* + * ivas_dec_init_split_rend() + * + * IVAS decoder split rend init + *-------------------------------------------------------------------*/ + +static ivas_error ivas_dec_init_split_rend( + Decoder_Struct *st_ivas /* i : IVAS decoder structure */ +) +{ + ivas_error error; + int16_t cldfb_in_flag, pcm_out_flag; + int16_t mixed_td_cldfb_flag; + + pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + cldfb_in_flag = 0; + + if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || + st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || + st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || + st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) + { + cldfb_in_flag = 1; + } + + ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS ); + + if ( cldfb_in_flag == 1 && ( st_ivas->hSplitBinRend->splitrend.multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ) + { + if ( ( st_ivas->hSplitBinRend->hCldfbDataOut = (ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for cldfb data out buffer\n" ) ); + } + } + + mixed_td_cldfb_flag = 0; + if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) || + ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + { + mixed_td_cldfb_flag = 1; + } + + 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, (int16_t) st_ivas->hDecoderConfig->render_framesize, mixed_td_cldfb_flag ); + + return error; } @@ -3940,24 +4120,26 @@ int16_t IVAS_DEC_is_split_rendering_enabled( *---------------------------------------------------------------------*/ int16_t IVAS_DEC_is_split_rendering_coded_out( - IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + int16_t *isSplitCoded /* o : flag to indicate if split rendering is enabled */ ) { Decoder_Struct *st_ivas; - int16_t isSplitCoded; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } + st_ivas = hIvasDec->st_ivas; - isSplitCoded = 0; + + *isSplitCoded = 0; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) { - isSplitCoded = 1; + *isSplitCoded = 1; } - return isSplitCoded; + return IVAS_ERR_OK; } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 9db87b64cebc71dd3952b9c38d9118fbbf431486..df01016278f65e14b692e7d5ef3ee211a966d0b6 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -172,12 +172,11 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( /*! r: decoder error code */ ivas_error IVAS_DEC_GetSplitRendBitstreamHeader( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - ISAR_SPLIT_REND_CODEC *pCodec, /* o: pointer to codec setting */ - ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o: pointer to pose correction mode */ - int16_t *pIsar_frame_size_ms, /* o: pointer to isar frame size setting */ - int16_t *pCodec_frame_size_ms /* o: pointer to codec frame size setting */ - , - int16_t *pLc3plusHighRes /* o: pointer to LC3plus High-Res setting */ + ISAR_SPLIT_REND_CODEC *pCodec, /* o : pointer to codec setting */ + ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o : pointer to pose correction mode */ + int16_t *pIsar_frame_size_ms, /* o : pointer to isar frame size setting */ + int16_t *pCodec_frame_size_ms, /* o : pointer to codec frame size setting */ + int16_t *pLc3plusHighRes /* o : pointer to LC3plus High-Res setting */ ); /*! r: decoder error code */ @@ -190,10 +189,13 @@ ivas_error IVAS_DEC_GetCldfbSamples( ); int16_t IVAS_DEC_is_split_rendering_enabled( - IVAS_DEC_HANDLE hIvasDec /* i: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ + int16_t *isSplitRend /* o : flag to indicate if split rendering is enabled */ ); + int16_t IVAS_DEC_is_split_rendering_coded_out( - IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + int16_t *isSplitCoded /* o : flag to indicate if split rendering is enabled */ ); /*! r: error code */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 2a044791b241af1f5fb5eb7ea6cd6134ea0f1ef6..1685ef7c8d10a65c5546a7983d219c10fbc42b49 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1057,7 +1057,7 @@ ivas_error IVAS_ENC_GetDelay( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, IVAS_AUDIO_CONFIG_INVALID ) ); + *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, 0 ) ); *delay *= hEncoderConfig->nchan_inp; diff --git a/lib_isar/isar_PredDecoder.c b/lib_isar/isar_PredDecoder.c index d107f6dab812edf046b68f0cb2d4aae8db773b09..f547e3cb08d97c41fd43b9ea318a5962794778bc 100644 --- a/lib_isar/isar_PredDecoder.c +++ b/lib_isar/isar_PredDecoder.c @@ -246,7 +246,7 @@ void DeletePredictionDecoder( * *-------------------------------------------------------------------*/ -int32_t ReadPredictors( +int16_t ReadPredictors( PredictionDecoder *psPredictionDecoder, ISAR_SPLIT_REND_BITS_HANDLE pBits ) { @@ -336,8 +336,10 @@ int32_t ReadPredictors( return iBitsRead; } + /* PLC_IMPROVEMENT */ -void SetDecodingPassed( PredictionDecoder *psPredictionDecoder ) +void SetDecodingPassed( + PredictionDecoder *psPredictionDecoder ) { int32_t n, ch; for ( ch = 0; ch < psPredictionDecoder->iChannels; ch++ ) @@ -347,8 +349,13 @@ void SetDecodingPassed( PredictionDecoder *psPredictionDecoder ) psPredictionDecoder->ppiDecodingFailed[ch][n] = 0; } } + + return; } -int32_t AnyDecodingUnresolved( PredictionDecoder *psPredictionDecoder ) + + +int32_t AnyDecodingUnresolved( + PredictionDecoder *psPredictionDecoder ) { int32_t n, ch; for ( ch = 0; ch < psPredictionDecoder->iChannels; ch++ ) @@ -361,10 +368,13 @@ int32_t AnyDecodingUnresolved( PredictionDecoder *psPredictionDecoder ) } } } + return 0; } -void UpdateDecodingFailedStatus( PredictionDecoder *psPredictionDecoder ) + +void UpdateDecodingFailedStatus( + PredictionDecoder *psPredictionDecoder ) { int32_t n, ch; for ( ch = 0; ch < psPredictionDecoder->iChannels; ch++ ) @@ -374,8 +384,11 @@ void UpdateDecodingFailedStatus( PredictionDecoder *psPredictionDecoder ) psPredictionDecoder->ppiDecodingFailedPrev[ch][n] = psPredictionDecoder->ppiDecodingFailed[ch][n]; } } + + return; } + void UpdateDecodingUnresolved( PredictionDecoder *psPredictionDecoder ) { int32_t n, ch; @@ -397,8 +410,11 @@ void UpdateDecodingUnresolved( PredictionDecoder *psPredictionDecoder ) } } } + + return; } + /*-------------------------------------------------------------------* * Function ApplyInversePredictors() * diff --git a/lib_isar/isar_PredEncoder.c b/lib_isar/isar_PredEncoder.c index 378540d940b8938bbc711397b302802f9a267ef2..1a8426b94049857b19c57ec775a82f008db040be 100644 --- a/lib_isar/isar_PredEncoder.c +++ b/lib_isar/isar_PredEncoder.c @@ -45,11 +45,14 @@ * * *-------------------------------------------------------------------*/ + static void activate_bit( int32_t *state, const int32_t bit_id ) { ( *state ) |= ( 1 << bit_id ); + + return; } /*-------------------------------------------------------------------* @@ -63,14 +66,19 @@ static void deactivate_bit( const int32_t bit_id ) { ( *state ) &= ( ~( 1 << bit_id ) ); + + return; } -void UpdatePredictionSubSetId( PredictionEncoder *psPredictionEncoder ) +void UpdatePredictionSubSetId( + PredictionEncoder *psPredictionEncoder ) { if ( ++psPredictionEncoder->iSubSetId == psPredictionEncoder->iNumSubSets ) { psPredictionEncoder->iSubSetId = 0; } + + return; } /*-------------------------------------------------------------------* diff --git a/lib_isar/isar_lc3plus_common.c b/lib_isar/isar_lc3plus_common.c index 5c56c0b437aff18d7f88ab7711c814c466764780..7f11ad384778273b34b9c73719be6af751557154 100644 --- a/lib_isar/isar_lc3plus_common.c +++ b/lib_isar/isar_lc3plus_common.c @@ -56,7 +56,9 @@ ivas_error ISAR_LC3PLUS_LC3plusErrToIvasErr( return IVAS_ERR_INTERNAL; } -ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( const LC3PLUS_RTP_ERR lc3PlusRtpError ) + +ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( + const LC3PLUS_RTP_ERR lc3PlusRtpError ) { switch ( lc3PlusRtpError ) { diff --git a/lib_isar/isar_lc3plus_enc.c b/lib_isar/isar_lc3plus_enc.c index 2912a1e514c3e487214a2707cf449d2e7b5ea791..725a01d2974a1b352accd35b32afa141c55d912e 100644 --- a/lib_isar/isar_lc3plus_enc.c +++ b/lib_isar/isar_lc3plus_enc.c @@ -251,6 +251,7 @@ ivas_error IVAS_LC3PLUS_ENC_SetBitrate( int32_t availableOctetsPerIsarFrame; int32_t actualOctetsPerFrame; LC3PLUS_Error err; + ivas_error ivas_err; int32_t iFtd; int32_t fdrLength; int32_t lc3plusPacketRate; @@ -318,15 +319,16 @@ ivas_error IVAS_LC3PLUS_ENC_SetBitrate( } } - // TODO: remove sanity checks? - if ( ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( handle, &actualOctetsPerFrame ) != IVAS_ERR_OK ) + if ( ( ivas_err = ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( handle, &actualOctetsPerFrame ) ) != IVAS_ERR_OK ) { - return IVAS_ERROR( IVAS_ERR_INTERNAL, "ISAR_LC3PLUS_ENC_GetOutputBitstreamSize failed\n" ); + return ivas_err; } + if ( actualOctetsPerFrame > availableOctetsPerIsarFrame ) { return IVAS_ERROR( IVAS_ERR_INTERNAL, "Bitrate reduction logic failed\n" ); } + return IVAS_ERR_OK; } @@ -535,6 +537,7 @@ ivas_error ISAR_LC3PLUS_ENC_Encode( { return IVAS_ERROR( IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( rtpErr ), "LC3PLUS_RTP_payload_serialize failed\n" ); } + for ( uint32_t iEnc = 0; iEnc < handle->num_encs; iEnc++ ) { for ( uint32_t iMediaTime = 0; iMediaTime < num_media_times; iMediaTime++ ) diff --git a/lib_isar/isar_lcld_decoder.c b/lib_isar/isar_lcld_decoder.c index 9d136ebb9515cd0f7e62aa0db739ced212218127..deca0167a1a7c0be7f2051f92859e2b8ebe12bd2 100644 --- a/lib_isar/isar_lcld_decoder.c +++ b/lib_isar/isar_lcld_decoder.c @@ -112,7 +112,9 @@ static TableNode *GetNextTable( const int32_t iIndex, TableList *table_list, Tab static void AddcodeTableList( TableList *ptable_list, const int32_t iLength, const int32_t iCode, const int32_t iCodeIndex, const int32_t iReadLength, uint32_t *iTables ); static void CompleteTables( LCLDDecoder *psLCLDDecoder, const int32_t n, TableList *ptable_list, const int32_t iReadLength, const int32_t iTablesCreated ); -static TableNode *CreateTableList( const int32_t iReadLength ) + +static TableNode *CreateTableList( + const int32_t iReadLength ) { int32_t n; int32_t iMaxTables; @@ -134,7 +136,11 @@ static TableNode *CreateTableList( const int32_t iReadLength ) return ptable_top; } -static void DeleteTableList( TableList *ptable_list, int32_t iTables ) + + +static void DeleteTableList( + TableList *ptable_list, + int32_t iTables ) { TableNode *node; @@ -167,12 +173,22 @@ static void DeleteTableList( TableList *ptable_list, int32_t iTables ) } iTables--; } + if ( ptable_list != NULL ) { free( ptable_list ); } + + return; } -static TableNode *GetNextTable( const int32_t iIndex, TableList *table_list, TableNode *poParent, const int32_t iReadLength, uint32_t *iTablesCreated ) + + +static TableNode *GetNextTable( + const int32_t iIndex, + TableList *table_list, + TableNode *poParent, + const int32_t iReadLength, + uint32_t *iTablesCreated ) { TableNode *poNextNode; @@ -193,7 +209,14 @@ static TableNode *GetNextTable( const int32_t iIndex, TableList *table_list, Tab return poNextNode; } -static void CompleteTables( LCLDDecoder *psLCLDDecoder, const int32_t n, TableList *ptable_list, const int32_t iReadLength, const int32_t iTablesCreated ) + + +static void CompleteTables( + LCLDDecoder *psLCLDDecoder, + const int32_t n, + TableList *ptable_list, + const int32_t iReadLength, + const int32_t iTablesCreated ) { int32_t iMaxTables; @@ -221,8 +244,18 @@ static void CompleteTables( LCLDDecoder *psLCLDDecoder, const int32_t n, TableLi } poNode = poNode->poOrderedNext; } + + return; } -static void AddcodeTableList( TableList *ptable_list, const int32_t iLength, const int32_t iCode, const int32_t iCodeIndex, const int32_t iReadLength, uint32_t *iTables ) + + +static void AddcodeTableList( + TableList *ptable_list, + const int32_t iLength, + const int32_t iCode, + const int32_t iCodeIndex, + const int32_t iReadLength, + uint32_t *iTables ) { int32_t iDifference; int32_t iMask; @@ -255,9 +288,18 @@ static void AddcodeTableList( TableList *ptable_list, const int32_t iLength, con poNode->piDifference[iIndex] = iDifference; poNode->piLength[iIndex] = iLength; } + + return; } -static void CreateDecodeTable( LCLDDecoder *psLCLDDecoder, const int32_t num, const uint16_t ( *ppuiEncTable )[2], const int32_t iSize, const int32_t iReadLength, uint32_t *iTables ) + +static void CreateDecodeTable( + LCLDDecoder *psLCLDDecoder, + const int32_t num, + const uint16_t ( *ppuiEncTable )[2], + const int32_t iSize, + const int32_t iReadLength, + uint32_t *iTables ) { int32_t n; uint32_t **ppsort_enc_table; @@ -321,8 +363,7 @@ static void CreateDecodeTable( LCLDDecoder *psLCLDDecoder, const int32_t num, co iLength = ppsort_enc_table[n][0]; iCode = ppsort_enc_table[n][1]; iCodeIndex = ppsort_enc_table[n][2]; - AddcodeTableList( ptable_list, iLength, iCode, iCodeIndex, iReadLength, - iTables ); + AddcodeTableList( ptable_list, iLength, iCode, iCodeIndex, iReadLength, iTables ); } CompleteTables( psLCLDDecoder, num, ptable_list, iReadLength, *iTables ); @@ -331,7 +372,10 @@ static void CreateDecodeTable( LCLDDecoder *psLCLDDecoder, const int32_t num, co { free( ppsort_enc_table[n] ); } + free( ppsort_enc_table ); + + return; } @@ -539,7 +583,8 @@ ivas_error CreateLCLDDecoder( * *------------------------------------------------------------------------------------------*/ -void DeleteLCLDDecoder( LCLDDecoder *psLCLDDecoder ) +void DeleteLCLDDecoder( + LCLDDecoder *psLCLDDecoder ) { int32_t k, n; @@ -694,6 +739,8 @@ void DeleteLCLDDecoder( LCLDDecoder *psLCLDDecoder ) free( psLCLDDecoder ); } + + return; } /*------------------------------------------------------------------------------------------* @@ -721,11 +768,12 @@ static int32_t ReadHuff( const uint32_t ( *pauiHuffDecTable )[HUFF_DEC_TABLE_SIZ static int32_t ReadRMSEnvelope( const int32_t iChannels, const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiRMSEnvelope, ISAR_SPLIT_REND_BITS_HANDLE pBits ); static int32_t ReadAllocInformation( int32_t *piAllocOffset, ISAR_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t -ReadLCLDData( const int32_t *piNumGroups, int32_t **ppiGroupLengths, const int32_t iNumBands, const int32_t iNumChannels, int32_t **ppiDecodingUnresolved, int32_t **ppiPredEnable, const int32_t iNumSubSets, const int32_t iSubSetId, int32_t ***pppiAlloc, int32_t ***pppiSignReal, int32_t ***pppiSignImag, int32_t ***pppiQReal, int32_t ***pppiQImag, int32_t **ppiDecodingFailed, ISAR_SPLIT_REND_BITS_HANDLE pBits, uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE] ); +static int32_t ReadLCLDData( const int32_t *piNumGroups, int32_t **ppiGroupLengths, const int32_t iNumBands, const int32_t iNumChannels, int32_t **ppiDecodingUnresolved, int32_t **ppiPredEnable, const int32_t iNumSubSets, const int32_t iSubSetId, int32_t ***pppiAlloc, int32_t ***pppiSignReal, int32_t ***pppiSignImag, int32_t ***pppiQReal, int32_t ***pppiQImag, int32_t **ppiDecodingFailed, ISAR_SPLIT_REND_BITS_HANDLE pBits, uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE] ); static void ComputeAllocation( const int32_t iChannels, const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiSMR, const int32_t iAllocOffset, int32_t ***pppiAlloc ); -void SetDecodingUnresolved( LCLDDecoder *psLCLDDecoder ) + +void SetDecodingUnresolved( + LCLDDecoder *psLCLDDecoder ) { int32_t n, ch; PredictionDecoder *psPredictionDecoder = psLCLDDecoder->psPredictionDecoder; @@ -738,9 +786,13 @@ void SetDecodingUnresolved( LCLDDecoder *psLCLDDecoder ) psPredictionDecoder->ppiDecodingFailedPrev[ch][n] = 1; } } + + return; } -int32_t AnyDecodingFailedPrev( LCLDDecoder *psLCLDDecoder ) + +int16_t AnyDecodingFailedPrev( + LCLDDecoder *psLCLDDecoder ) { int32_t n, ch; PredictionDecoder *psPredictionDecoder = psLCLDDecoder->psPredictionDecoder; @@ -757,7 +809,7 @@ int32_t AnyDecodingFailedPrev( LCLDDecoder *psLCLDDecoder ) return 0; } -int32_t AnyDecodingFailed( LCLDDecoder *psLCLDDecoder ) +int16_t AnyDecodingFailed( LCLDDecoder *psLCLDDecoder ) { int32_t n, ch; PredictionDecoder *psPredictionDecoder = psLCLDDecoder->psPredictionDecoder; @@ -771,24 +823,31 @@ int32_t AnyDecodingFailed( LCLDDecoder *psLCLDDecoder ) } } } + return 0; } -int32_t **GetDecodingFailedStatus( LCLDDecoder *psLCLDDecoder ) + +int32_t **GetDecodingFailedStatus( + LCLDDecoder *psLCLDDecoder ) { return psLCLDDecoder->psPredictionDecoder->ppiDecodingFailed; } int16_t GetNumSubSets( LCLDDecoder *psLCLDDecoder ) { - return (int16_t) psLCLDDecoder->psPredictionDecoder->iNumSubSets; + return (int16_t) + psLCLDDecoder->psPredictionDecoder->iNumSubSets; } -int32_t **GetDecodingFailedPrevStatus( LCLDDecoder *psLCLDDecoder ) + +int32_t **GetDecodingFailedPrevStatus( + LCLDDecoder *psLCLDDecoder ) { return psLCLDDecoder->psPredictionDecoder->ppiDecodingFailedPrev; } + static void UnpackReal( const int32_t iChannels, const int32_t iNumBlocks, @@ -796,6 +855,7 @@ static void UnpackReal( float ***pppfImag ) { int32_t ch, b, n; + for ( ch = 0; ch < iChannels; ch++ ) { for ( b = 0; b < LCLD_BANDS; b++ ) diff --git a/lib_isar/isar_lcld_encoder.c b/lib_isar/isar_lcld_encoder.c index 5b980559be0587ebf62a53c2b86aa32d15162278..b4710f0a40eadccf9ba95b570aee1e490a355990 100644 --- a/lib_isar/isar_lcld_encoder.c +++ b/lib_isar/isar_lcld_encoder.c @@ -538,7 +538,7 @@ static int32_t CountLCLDBits( const int32_t iNumGroups, const int32_t *piGroupLe static int32_t WriteHeaderInformation( const int32_t iNumBands, ISAR_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t WriteMSInformation( const int32_t iNumBands, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiffs, const int32_t *piMSPredCoefs, int32_t iNumMSPredBands, ISAR_SPLIT_REND_BITS_HANDLE pBits ); +static int32_t WriteMSInformation( const int32_t iNumBands, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiffs, const int32_t *piMSPredCoefs, const int32_t iNumMSPredBands, ISAR_SPLIT_REND_BITS_HANDLE pBits ); static int32_t WriteGroupInformation( const int32_t iChannels, const int32_t iCommonGrouping, const int32_t *piNumGroups, int32_t **ppiGroupLengths, ISAR_SPLIT_REND_BITS_HANDLE pBits ); @@ -730,8 +730,8 @@ int32_t EncodeLCLDFrame( psLCLDEncoder->pppiLCLDSignImag, psLCLDEncoder->psPredictionEncoder ); - iBitsWritten += WriteAllocInformation( psLCLDEncoder->iAllocOffset, - pBits ); + iBitsWritten += WriteAllocInformation( psLCLDEncoder->iAllocOffset, pBits ); + iAudioBitsWritten = iBitsWritten; iBitsWritten += WriteLCLDData( psLCLDEncoder->piNumGroups, psLCLDEncoder->ppiGroupLengths, @@ -1263,6 +1263,8 @@ static void QuantizeSpectrumDPCM_Opt( iFBOffset++; } /* bandwidth */ } /* bands */ + + return; } static int32_t CountLCLDBits( @@ -1377,7 +1379,7 @@ static int32_t WriteMSInformation( const int32_t *piMSFlags, const int32_t *piLRPhaseDiff, const int32_t *piMSPredCoef, - int32_t iNumMSPredBands, + const int32_t iNumMSPredBands, ISAR_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsWritten; diff --git a/lib_isar/isar_lcld_prot.h b/lib_isar/isar_lcld_prot.h index a5664ab0328368a7ad1164ab11584982598745df..114a8fb82fd2d2282b1b3d71e53e37fd1e10cadc 100644 --- a/lib_isar/isar_lcld_prot.h +++ b/lib_isar/isar_lcld_prot.h @@ -313,7 +313,7 @@ void DeletePredictionDecoder( PredictionDecoder *psPredictionDecoder ); -int32_t ReadPredictors( +int16_t ReadPredictors( PredictionDecoder *psPredictionDecoder, ISAR_SPLIT_REND_BITS_HANDLE pBits ); @@ -325,10 +325,10 @@ void UpdatePredictionSubSetId( void SetDecodingUnresolved( LCLDDecoder *psLCLDDecoder); -int32_t AnyDecodingFailedPrev( +int16_t AnyDecodingFailedPrev( LCLDDecoder *psLCLDDecoder); -int32_t AnyDecodingFailed( +int16_t AnyDecodingFailed( LCLDDecoder *psLCLDDecoder); int32_t **GetDecodingFailedStatus( diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index c69f4305cdcb3b0947ad4327d798983c0ac962b4..442c2806dfb7d5894ba895a382e587191b651e3b 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -330,15 +330,6 @@ void ISAR_SPLIT_REND_BITStream_init( const int32_t buf_len_bytes, uint8_t *pbuf ); -void isar_split_rend_huffman_dec_init_min_max_len( - isar_split_rend_huffman_cfg_t *p_huff_cfg ); - -int16_t wrap_a( - int16_t val, - const int16_t min_val, - const int16_t max_val ); - - void isar_renderSplitUpdateNoCorrectionPoseData( const ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ); diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index 0e214e79e61f234767d77c0325c6accb7739ef1a..520fba4c46a214f686cee432fd25070a68a6b9a9 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -1716,7 +1716,7 @@ void isar_init_split_rend_handles( ivas_error split_renderer_open_lc3plus( SPLIT_REND_WRAPPER *hSplitRendWrapper, const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, - const int32_t OutSampleRate, + const int32_t output_Fs, const IVAS_RENDER_FRAMESIZE isar_frame_size ) { ivas_error error; @@ -1736,7 +1736,7 @@ ivas_error split_renderer_open_lc3plus( } config.lc3plus_frame_duration_us = pSplitRendConfig->codec_frame_size_ms * 1000; - config.samplerate = OutSampleRate; + config.samplerate = output_Fs; config.isar_frame_duration_us = isar_frame_size_ms * 1000; @@ -1763,7 +1763,7 @@ ivas_error split_renderer_open_lc3plus( /* Alocate buffers for delay compensation */ if ( pSplitRendConfig->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) { - delayBufferLength = (int16_t) ( OutSampleRate / (int32_t) FRAMES_PER_SECOND + hSplitRendWrapper->lc3plusDelaySamples ); + delayBufferLength = (int16_t) ( output_Fs / (int32_t) FRAMES_PER_SECOND + hSplitRendWrapper->lc3plusDelaySamples ); for ( i = 0; i < hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++i ) { if ( ( hSplitRendWrapper->lc3plusDelayBuffers[i] = malloc( delayBufferLength * sizeof( float ) ) ) == NULL ) @@ -1777,8 +1777,8 @@ ivas_error split_renderer_open_lc3plus( else { /* Delay is always expected to be exactly 2 CLDFB columns */ - assert( hSplitRendWrapper->lc3plusDelaySamples % ( OutSampleRate / FRAMES_PER_SEC / CLDFB_NO_COL_MAX ) == 0 ); - assert( hSplitRendWrapper->lc3plusDelaySamples / ( OutSampleRate / FRAMES_PER_SEC / CLDFB_NO_COL_MAX ) == 2 ); + assert( hSplitRendWrapper->lc3plusDelaySamples % ( output_Fs / FRAMES_PER_SEC / CLDFB_NO_COL_MAX ) == 0 ); + assert( hSplitRendWrapper->lc3plusDelaySamples / ( output_Fs / FRAMES_PER_SEC / CLDFB_NO_COL_MAX ) == 2 ); delayBufferLength = 2 /* Columns */ * 2 /* real and imag */ * CLDFB_NO_CHANNELS_MAX; for ( i = 0; i < hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++i ) diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index 09e8ca8909ad43a8d5a672d64c95fa60d5ae18be..dbd0b11cb2911e66868bde3dfc3e1526eb672272 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -104,7 +104,7 @@ void ISAR_SPLIT_REND_BITStream_init( * *------------------------------------------------------------------------*/ -void isar_split_rend_huffman_dec_init_min_max_len( +static void isar_split_rend_huffman_dec_init_min_max_len( isar_split_rend_huffman_cfg_t *p_huff_cfg ) { int16_t i, code_len; @@ -316,7 +316,7 @@ void set_pose_types( * *------------------------------------------------------------------------*/ -int16_t wrap_a( +static int16_t wrap_a( int16_t val, const int16_t min_val, const int16_t max_val ) diff --git a/lib_isar/isar_stat.h b/lib_isar/isar_stat.h index fde90e33fdd0e7f1bd447c156c00d6523e640549..acdddd83938c685c31aec5211e335030916cc9d2 100644 --- a/lib_isar/isar_stat.h +++ b/lib_isar/isar_stat.h @@ -57,6 +57,103 @@ * ISAR post rend structs *-------------------------------------------------------------------*/ +/* binaural split rendering head rotation data structure */ +typedef struct ivas_binaural_head_rot_split_rendering_md_struct +{ + float pred_mat_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float pred_mat_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float gd; + float gd2; + int16_t pred_mat_re_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + int16_t pred_mat_im_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + int16_t gd_idx; + int16_t gd2_idx; + +} BIN_HR_SPLIT_REND_MD, *BIN_HR_SPLIT_REND_MD_HANDLE; + +typedef struct ivas_split_rend_huffman_cfg_t +{ + const int32_t *codebook; + int16_t min_len; + int16_t max_len; + int16_t sym_len; + +} ivas_split_rend_huffman_cfg_t; + +typedef struct ivas_binaural_head_rot_split_rendering_huff_struct +{ + ivas_split_rend_huffman_cfg_t pred[2]; + int16_t pred_idx_trav[2][ISAR_SPLIT_REND_PRED_63QUANT_PNTS]; + int16_t pred_base2_code_len[2]; + ivas_split_rend_huffman_cfg_t pred_roll; + int16_t pred_roll_idx_trav[ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS]; + int16_t pred_roll_base2_code_len; + ivas_split_rend_huffman_cfg_t gd; + int16_t gd_base2_code_len; + int16_t gd_idx_trav[ISAR_SPLIT_REND_D_QUANT_PNTS]; + ivas_split_rend_huffman_cfg_t p_gd; + int16_t p_gd_base2_code_len; + int16_t p_gd_idx_trav[ISAR_SPLIT_REND_D_QUANT_PNTS]; + ivas_split_rend_huffman_cfg_t p_gd_diff; + int16_t p_gd_diff_base2_code_len; + int16_t p_gd_diff_idx_trav[ISAR_SPLIT_REND_D_QUANT_PNTS]; + +} BIN_HR_SPLIT_REND_HUFF, *BIN_HR_SPLIT_REND_HUFF_HANDLE; + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +typedef struct ivas_binaural_head_rot_split_post_rendering_struct +{ + BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES][MAX_SPLIT_MD_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS]; + IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES]; + int16_t low_Res; + + float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + ISAR_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1]; + BIN_HR_SPLIT_REND_HUFF huff_cfg; + float mixer_mat_re[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mixer_mat_im[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float gd_mem[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS]; + int16_t cf_flag; + HANDLE_CLDFB_FILTER_BANK cldfbAna[BINAURAL_CHANNELS]; + HANDLE_CLDFB_FILTER_BANK cldfbSyn[BINAURAL_CHANNELS]; + HANDLE_CLDFB_FILTER_BANK cldfbSynReconsBinDec[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS]; + +} BIN_HR_SPLIT_POST_REND, *BIN_HR_SPLIT_POST_REND_HANDLE; +#endif + +typedef struct ivas_binaural_head_rot_split_pre_rendering_struct +{ + BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES - 1][MAX_SPLIT_MD_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS]; + float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + ISAR_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1]; + BIN_HR_SPLIT_REND_HUFF huff_cfg; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + HANDLE_CLDFB_FILTER_BANK cldfbSynRotBinDec[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS]; +#endif + +#ifdef SPLIT_POSE_CORRECTION_DEBUG + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend; +#endif + +} BIN_HR_SPLIT_PRE_REND, *BIN_HR_SPLIT_PRE_REND_HANDLE; + +typedef struct +{ + float Cldfb_Prev_BinReal[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX + CLDFB_PLC_XF][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_Prev_BinImag[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX + CLDFB_PLC_XF][CLDFB_NO_CHANNELS_MAX]; + float xf_bet[2][CLDFB_NO_CHANNELS_MAX][CLDFB_PLC_XF]; + +} CLDFB_PLC, *CLDFB_PLC_HANDLE; + +typedef struct +{ + CLDFB_PLC CldfbPLC_state; + int16_t prev_bfi; + int16_t bf_count; + int16_t iNumSubSets; + +} SPLIT_REND_PLC_STRUCT, *SPLIT_REND_PLC_HANDLE; + typedef struct { int8_t headRotEnabled; @@ -138,10 +235,6 @@ typedef struct isar_binaural_head_rot_split_pre_rendering_struct } ISAR_BIN_HR_SPLIT_PRE_REND, *ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE; -/*----------------------------------------------------------------------------------* - * Output configuration for renderer (e.g. DirAC, MASA, Binaural Renderer...) - *----------------------------------------------------------------------------------*/ - typedef struct isar_binaural_head_rot_split_rendering_lcld_enc_struct { void *pLcld_enc; diff --git a/lib_isar/lib_isar_post_rend.c b/lib_isar/lib_isar_post_rend.c index ab1693640abe006fc95582d899138793088a6c50..f80645259928f9fe7125c1f7860a00173980d85b 100644 --- a/lib_isar/lib_isar_post_rend.c +++ b/lib_isar/lib_isar_post_rend.c @@ -121,7 +121,7 @@ struct ISAR_POST_REND }; /*-------------------------------------------------------------------* - * getAudioConfigType() + * isar_getAudioConfigType() * * *-------------------------------------------------------------------*/ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 6a7482ee36efb0904da7821f1e3bff7b5cb8878c..4a10e4bd3439641d4b8be45d348ed2a0c6e64ad7 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1940,150 +1940,6 @@ ivas_error ivas_rend_crendProcessSubframe( } -/*-----------------------------------------------------------------------------------------* - * Function ivas_rend_crend_ProcessSplitBin() - * - * Process call for IVAS Crend renderer - *-----------------------------------------------------------------------------------------*/ - -ivas_error -ivas_rend_crendProcessSplitBin( - const CREND_WRAPPER *pCrend, - const AUDIO_CONFIG inConfig, - const AUDIO_CONFIG outConfig, - const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, - const DECODER_CONFIG_HANDLE hDecoderConfig, - const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, - const IVAS_OUTPUT_SETUP_HANDLE hIntSetup, - EFAP_HANDLE hEFAPdata, - float *output[], - const int32_t output_Fs ) -{ - int16_t i, j; - int16_t sf; - int16_t pos_idx, output_frame; - ivas_error error; - float gain_lfe; - float tmpLfeBuffer[L_FRAME48k]; - float tmpInputBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - float *p_tmpInputBuffer[MAX_OUTPUT_CHANNELS]; - float tmpSplitBinBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - COMBINED_ORIENTATION_DATA combinedOrientationDataLocal; - COMBINED_ORIENTATION_HANDLE pCombinedOrientationDataLocal; - - output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); - - /* copy input */ - for ( i = 0; i < hIntSetup->nchan_out_woLFE; ++i ) - { - mvr2r( output[i], tmpInputBuffer[i], output_frame ); - } - - for ( i = 0; i < MAX_OUTPUT_CHANNELS; ++i ) - { - p_tmpInputBuffer[i] = tmpInputBuffer[i]; - } - - /* save current head positions */ - pCombinedOrientationDataLocal = hCombinedOrientationData; - combinedOrientationDataLocal = *pCombinedOrientationDataLocal; - if ( pMultiBinPoseData->poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) - { - for ( sf = 1; sf < hCombinedOrientationData->num_subframes; ++sf ) - { - combinedOrientationDataLocal.Quaternions[sf] = combinedOrientationDataLocal.Quaternions[0]; - for ( i = 0; i < 3; i++ ) - { - for ( j = 0; j < 3; j++ ) - { - combinedOrientationDataLocal.Rmat[sf][i][j] = combinedOrientationDataLocal.Rmat[0][i][j]; - } - } - } - } - - /* copy LFE to tmpLfeBuffer and apply gain only once */ - if ( hIntSetup->num_lfe > 0 && hIntSetup->index_lfe[0] != -1 ) - { - mvr2r( output[hIntSetup->index_lfe[0]], tmpLfeBuffer, output_frame ); - gain_lfe = ( ( pCrend != NULL ) && ( pCrend->hHrtfCrend != NULL ) ) ? pCrend->hHrtfCrend->gain_lfe : GAIN_LFE; - v_multc( tmpLfeBuffer, gain_lfe, tmpLfeBuffer, output_frame ); - } - else - { - set_zero( tmpLfeBuffer, output_frame ); - } - - for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses; ++pos_idx ) - { - /* Update head positions */ - - IVAS_QUATERNION Quaternions_orig[MAX_PARAM_SPATIAL_SUBFRAMES], Quaternions_abs; - for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ ) - { - Quaternions_orig[i] = combinedOrientationDataLocal.Quaternions[i]; - Quaternions_abs.w = -3.0f; - Quat2EulerDegree( combinedOrientationDataLocal.Quaternions[i], &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ - - Quaternions_abs.x += pMultiBinPoseData->relative_head_poses[pos_idx][0]; - Quaternions_abs.y += pMultiBinPoseData->relative_head_poses[pos_idx][1]; - Quaternions_abs.z += pMultiBinPoseData->relative_head_poses[pos_idx][2]; - combinedOrientationDataLocal.Quaternions[i] = Quaternions_abs; - QuatToRotMat( combinedOrientationDataLocal.Quaternions[i], combinedOrientationDataLocal.Rmat[i] ); - } - - - /* render inplace to first two channels of tmpInputBuffer */ - pCombinedOrientationDataLocal = &combinedOrientationDataLocal; - - for ( i = 0; i < 3; i++ ) - { - mvr2r( hCombinedOrientationData->Rmat_prev[pos_idx][i], pCombinedOrientationDataLocal->Rmat_prev[0][i], 3 ); - } - - if ( ( error = ivas_rend_crendProcessSubframe( pCrend, inConfig, outConfig, hDecoderConfig, pCombinedOrientationDataLocal, hIntSetup, hEFAPdata, - NULL, p_tmpInputBuffer, p_tmpInputBuffer, output_frame, output_Fs, pos_idx ) ) != IVAS_ERR_OK ) - { - return error; - } - - for ( i = 0; i < 3; i++ ) - { - mvr2r( pCombinedOrientationDataLocal->Rmat_prev[0][i], hCombinedOrientationData->Rmat_prev[pos_idx][i], 3 ); - } - - for ( i = 0; i < BINAURAL_CHANNELS; ++i ) - { - /* accumulate LFE to output */ - v_add( tmpInputBuffer[i], tmpLfeBuffer, tmpInputBuffer[i], output_frame ); - - /* move to split bin output buffer */ - mvr2r( tmpInputBuffer[i], tmpSplitBinBuffer[pos_idx * BINAURAL_CHANNELS + i], output_frame ); - } - - /* overwrite rendered channels with input again for next iteration */ - for ( i = 0; i < hIntSetup->nchan_out_woLFE; ++i ) - { - mvr2r( output[i], tmpInputBuffer[i], output_frame ); - } - - /* restore original headrotation data */ - for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ ) - { - combinedOrientationDataLocal.Quaternions[i] = Quaternions_orig[i]; - } - } - - /* copy split binaural rendered signals to final output */ - for ( i = 0; i < BINAURAL_CHANNELS * pMultiBinPoseData->num_poses; ++i ) - { - mvr2r( tmpSplitBinBuffer[i], output[i], output_frame ); - } - - return IVAS_ERR_OK; -} - - /*-----------------------------------------------------------------------------------------* * Function ivas_rend_crend_ProcessSubframesSplitBin() * diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 479e0488b58130174fdbc55ac55b10b323aaa974..351ac4264dfe9c921157cc23468847f69c67f228 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -472,6 +472,30 @@ ivas_error ivas_output_buff_dec( } +/*---------------------------------------------------------------------* + * is_split_rendering_enabled() + * + * + *---------------------------------------------------------------------*/ + +/*! r: flag to indicate if split rendering is enabled */ +int16_t is_split_rendering_enabled( + const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */ + const IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* i : Render config data structure */ +) +{ + if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || + ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && hDecoderConfig->Opt_non_diegetic_pan && hRenderConfig->split_rend_config.dof == 0 ) ) + { + return 1; + } + else + { + return 0; + } +} + + /*---------------------------------------------------------------------* * get_channel_config() * diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index a4d5bfca70f8b59b3380c137c4746d8d8708e9a3..eacab49ee9d94135a94130302d032a11367fe2a7 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1348,146 +1348,6 @@ typedef struct ivas_hrtfs_statistics_struct int16_t fromROM; /* Flag that indicates that the pointers point to tables in ROM (controls init/dealloc).*/ } HRTFS_STATISTICS, *HRTFS_STATISTICS_HANDLE; -/*----------------------------------------------------------------------------------* - * Binaural split rendering structures - *----------------------------------------------------------------------------------*/ - -/* binaural split rendering head rotation data structure */ -typedef struct ivas_binaural_head_rot_split_rendering_md_struct -{ - float pred_mat_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float pred_mat_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float gd; - float gd2; - int16_t pred_mat_re_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - int16_t pred_mat_im_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - int16_t gd_idx; - int16_t gd2_idx; - -} BIN_HR_SPLIT_REND_MD, *BIN_HR_SPLIT_REND_MD_HANDLE; - -typedef struct ivas_split_rend_huffman_cfg_t -{ - const int32_t *codebook; - int16_t min_len; - int16_t max_len; - int16_t sym_len; - -} ivas_split_rend_huffman_cfg_t; - -typedef struct ivas_binaural_head_rot_split_rendering_huff_struct -{ - ivas_split_rend_huffman_cfg_t pred[2]; - int16_t pred_idx_trav[2][ISAR_SPLIT_REND_PRED_63QUANT_PNTS]; - int16_t pred_base2_code_len[2]; - ivas_split_rend_huffman_cfg_t pred_roll; - int16_t pred_roll_idx_trav[ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS]; - int16_t pred_roll_base2_code_len; - ivas_split_rend_huffman_cfg_t gd; - int16_t gd_base2_code_len; - int16_t gd_idx_trav[ISAR_SPLIT_REND_D_QUANT_PNTS]; - ivas_split_rend_huffman_cfg_t p_gd; - int16_t p_gd_base2_code_len; - int16_t p_gd_idx_trav[ISAR_SPLIT_REND_D_QUANT_PNTS]; - ivas_split_rend_huffman_cfg_t p_gd_diff; - int16_t p_gd_diff_base2_code_len; - int16_t p_gd_diff_idx_trav[ISAR_SPLIT_REND_D_QUANT_PNTS]; - -} BIN_HR_SPLIT_REND_HUFF, *BIN_HR_SPLIT_REND_HUFF_HANDLE; - - -typedef struct ivas_binaural_head_rot_split_post_rendering_struct -{ - BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES][MAX_SPLIT_MD_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS]; - IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES]; - int16_t low_Res; - - float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - ISAR_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1]; - BIN_HR_SPLIT_REND_HUFF huff_cfg; -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - float mixer_mat_re[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float mixer_mat_im[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float gd_mem[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS]; -#else - float mixer_mat_re[1][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float mixer_mat_im[1][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float gd_mem[1][MAX_SPLIT_REND_MD_BANDS]; -#endif - int16_t cf_flag; - HANDLE_CLDFB_FILTER_BANK cldfbAna[BINAURAL_CHANNELS]; - HANDLE_CLDFB_FILTER_BANK cldfbSyn[BINAURAL_CHANNELS]; -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - HANDLE_CLDFB_FILTER_BANK cldfbSynReconsBinDec[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS]; -#endif - -} BIN_HR_SPLIT_POST_REND, *BIN_HR_SPLIT_POST_REND_HANDLE; - -typedef struct ivas_binaural_head_rot_split_pre_rendering_struct -{ - BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES - 1][MAX_SPLIT_MD_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS]; - float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - ISAR_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1]; - BIN_HR_SPLIT_REND_HUFF huff_cfg; -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - HANDLE_CLDFB_FILTER_BANK cldfbSynRotBinDec[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS]; -#endif - -#ifdef SPLIT_POSE_CORRECTION_DEBUG - BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend; -#endif - -} BIN_HR_SPLIT_PRE_REND, *BIN_HR_SPLIT_PRE_REND_HANDLE; - -typedef struct ivas_binaural_head_rot_split_rendering_lcld_enc_struct -{ - void *pLcld_enc; - int16_t iChannels; - LCLDEncoder *psLCLDEncoder; - float ***pppfLCLDReal; - float ***pppfLCLDImag; -#ifdef CLDFB_DEBUG - FILE *cldfbIn; - int16_t numFrame; -#endif - int16_t iNumIterations; - int16_t iNumBlocks; - -} BIN_HR_SPLIT_LCLD_ENC, *BIN_HR_SPLIT_LCLD_ENC_HANDLE; - -typedef struct -{ - float Cldfb_Prev_BinReal[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX + CLDFB_PLC_XF][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_Prev_BinImag[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX + CLDFB_PLC_XF][CLDFB_NO_CHANNELS_MAX]; - float xf_bet[2][CLDFB_NO_CHANNELS_MAX][CLDFB_PLC_XF]; -} CLDFB_PLC, *CLDFB_PLC_HANDLE; - -typedef struct -{ - CLDFB_PLC CldfbPLC_state; - int16_t prev_bfi; - int16_t bf_count; - int16_t iNumSubSets; - -} SPLIT_REND_PLC_STRUCT, *SPLIT_REND_PLC_HANDLE; - -typedef struct ivas_binaural_head_rot_split_rendering_lcld_dec_struct -{ - void *pLcld_dec; - int32_t iChannels; - LCLDDecoder *psLCLDDecoder; - float ***pppfDecLCLDReal; - float ***pppfDecLCLDImag; -#ifdef CLDFB_DEBUG - FILE *cldfbOut; - int16_t numFrame; -#endif - SPLIT_REND_PLC_HANDLE hSplitRendPLC; - int16_t iNumBlocks; - int16_t iNumIterations; - -} BIN_HR_SPLIT_LCLD_DEC, *BIN_HR_SPLIT_LCLD_DEC_HANDLE; - /*----------------------------------------------------------------------------------* * Limiter structure @@ -1562,6 +1422,15 @@ typedef struct ivas_LS_setup_custom } LSSETUP_CUSTOM_STRUCT, *LSSETUP_CUSTOM_HANDLE; +/* Channel types in a channel-based config */ +typedef enum +{ + CHANNEL_TYPE_UNUSED = 0, + CHANNEL_TYPE_SPEAKER, + CHANNEL_TYPE_LFE + +} ChannelType; + /*----------------------------------------------------------------------------------* * CLDFB renderer wrapper @@ -1576,15 +1445,6 @@ typedef struct } CLDFB_REND_WRAPPER; -/* Channel types in a channel-based config */ -typedef enum -{ - CHANNEL_TYPE_UNUSED = 0, - CHANNEL_TYPE_SPEAKER, - CHANNEL_TYPE_LFE - -} ChannelType; - /*----------------------------------------------------------------------------------* * MASA external renderer structure *----------------------------------------------------------------------------------*/ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e5f94fc2f0e72cf8ec17e577ece61502a5796bb7..d6e301c6d77e16f47efa0de673710109cb337ad1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -36,7 +36,6 @@ #include "ivas_prot.h" #include "ivas_prot_rend.h" #include "isar_prot.h" -#include "isar_stat.h" #include "lib_isar_pre_rend.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" @@ -205,7 +204,7 @@ struct IVAS_REND AUDIO_CONFIG outputConfig; EFAP_WRAPPER efapOutWrapper; IVAS_LSSETUP_CUSTOM_STRUCT customLsOut; - SPLIT_REND_WRAPPER splitRendWrapper; + SPLIT_REND_WRAPPER *splitRendWrapper; IVAS_REND_AudioBuffer splitRendEncBuffer; IVAS_REND_HeadRotData headRotData; @@ -228,18 +227,8 @@ struct IVAS_REND static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, const RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hHrtfs ); static void freeMasaExtRenderer( MASA_EXT_REND_HANDLE *hMasaExtRendOut ); - -static ivas_error renderSbaToMultiBinauralCldfb( - input_sba *sbaInput, - float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t low_res_pre_rend_rot, - const int16_t num_subframes ); - -static ivas_error renderSbaToMultiBinaural( - input_sba *sbaInput, - const AUDIO_CONFIG outConfig, - float out[][L_FRAME48k] ); +static void renderSbaToMultiBinauralCldfb( input_sba *sbaInput, float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t low_res_pre_rend_rot, const int16_t num_subframes ); +static ivas_error renderSbaToMultiBinaural( input_sba *sbaInput, const AUDIO_CONFIG outConfig, float out[][L_FRAME48k] ); /*-------------------------------------------------------------------* * Local functions @@ -437,12 +426,13 @@ static void accumulate2dArrayToBuffer( writePtr = buffer->data; for ( chnlIdx = 0; chnlIdx < buffer->config.numChannels; ++chnlIdx ) - { - for ( smplIdx = 0; smplIdx < buffer->config.numSamplesPerChannel; ++smplIdx ) + for ( chnlIdx = 0; chnlIdx < buffer->config.numChannels; ++chnlIdx ) { - *writePtr++ += array[chnlIdx][smplIdx]; + for ( smplIdx = 0; smplIdx < buffer->config.numSamplesPerChannel; ++smplIdx ) + { + *writePtr++ += array[chnlIdx][smplIdx]; + } } - } return; } @@ -615,7 +605,6 @@ static ivas_error validateOutputSampleRate( /* Otherwise rendering to binaural, support the same set as IVAS decoder */ switch ( sampleRate ) { - case 8000: case 16000: case 32000: case 48000: @@ -1228,7 +1217,7 @@ static rendering_context getRendCtx( ctx.pHeadRotData = &hIvasRend->headRotData; ctx.hhRendererConfig = &hIvasRend->hRendererConfig; ctx.pSplitRendBFI = &hIvasRend->splitRendBFI; - ctx.pSplitRendWrapper = &hIvasRend->splitRendWrapper; + ctx.pSplitRendWrapper = hIvasRend->splitRendWrapper; ctx.pCombinedOrientationData = &hIvasRend->hCombinedOrientationData; return ctx; @@ -1274,7 +1263,7 @@ static ivas_error initIsmMasaRendering( ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); } - ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); + ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper != NULL ? inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); ivas_reverb_close( &inputIsm->hReverb ); @@ -1377,7 +1366,7 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) { return error; } @@ -1400,7 +1389,7 @@ static void clearInputIsm( initRendInputBase( &inputIsm->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ - ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); + ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper != NULL ? inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); ivas_reverb_close( &inputIsm->hReverb ); @@ -2098,7 +2087,7 @@ static ivas_error initMcBinauralRendering( /* if we need to use TD renderer and CREND was open, close it */ if ( useTDRend ) { - ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); + ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); } if ( !reconfigureFlag || ( !useTDRend && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && inputMc->hReverb != NULL ) ) @@ -2190,7 +2179,7 @@ static ivas_error initMcMasaRendering( ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); } - ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); + ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); ivas_reverb_close( &inputMc->hReverb ); @@ -2374,7 +2363,7 @@ static void clearInputMc( efap_free_data( &inputMc->efapInWrapper.hEfap ); } - ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); + ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); ivas_reverb_close( &inputMc->hReverb ); @@ -2548,7 +2537,7 @@ static ivas_error updateSbaPanGains( } else { - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) { return error; } @@ -2561,7 +2550,7 @@ static ivas_error updateSbaPanGains( { return error; } - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) { return error; } @@ -2593,7 +2582,7 @@ static ivas_error initSbaMasaRendering( { ivas_error error; - ivas_rend_closeCrend( &inputSba->crendWrapper, inputSba->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); + ivas_rend_closeCrend( &inputSba->crendWrapper, inputSba->base.ctx.pSplitRendWrapper != NULL ? inputSba->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); if ( ( error = ivas_dirac_ana_open( &inputSba->hDirAC, inSampleRate ) ) != IVAS_ERR_OK ) { @@ -2673,7 +2662,7 @@ static void clearInputSba( initRendInputBase( &inputSba->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ - ivas_rend_closeCrend( &inputSba->crendWrapper, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ); + ivas_rend_closeCrend( &inputSba->crendWrapper, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); if ( inputSba->cldfbRendWrapper.hCldfbRend != NULL ) { @@ -2850,8 +2839,16 @@ ivas_error IVAS_REND_Open( } /* Initialize inputs */ - isar_init_split_rend_handles( &hIvasRend->splitRendWrapper ); - hIvasRend->splitRendEncBuffer.data = NULL; + hIvasRend->splitRendWrapper = NULL; + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + if ( ( hIvasRend->splitRendWrapper = (SPLIT_REND_WRAPPER *) malloc( sizeof( SPLIT_REND_WRAPPER ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS renderer handle" ); + } + + isar_init_split_rend_handles( hIvasRend->splitRendWrapper ); + } for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { @@ -3450,7 +3447,7 @@ ivas_error IVAS_REND_AddInput( int16_t cldfb_in_flag; cldfb_in_flag = getCldfbRendFlag( hIvasRend, getAudioConfigType( inConfig ) ); - if ( ( error = ivas_pre_rend_init( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_pre_rend_init( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) { return error; } @@ -3869,7 +3866,7 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { - if ( hIvasRend->splitRendWrapper.hBinHrSplitPreRend != NULL ) + if ( hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) { if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { @@ -4144,7 +4141,7 @@ ivas_error IVAS_REND_InitConfig( *-------------------------------------------------------------------*/ int16_t IVAS_REND_GetRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ ) { @@ -4205,7 +4202,7 @@ int16_t IVAS_REND_GetRenderConfig( *-------------------------------------------------------------------*/ int16_t IVAS_REND_FeedRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ) { @@ -4359,9 +4356,12 @@ int16_t IVAS_REND_FeedRenderConfig( hRenderConfig->split_rend_config.codec = renderConfig.split_rend_config.codec; - if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { - return error; + if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } } /* Must re-initialize split rendering config in case renderer config is updated after adding renderer inputs */ @@ -4370,9 +4370,14 @@ int16_t IVAS_REND_FeedRenderConfig( { int16_t cldfb_in_flag; cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN ); - ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + if ( hIvasRend->splitRendWrapper != NULL ) + { + ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + free( hIvasRend->splitRendWrapper ); + hIvasRend->splitRendWrapper = NULL; + } - if ( ( error = ivas_pre_rend_init( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_pre_rend_init( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK ) { return error; } @@ -5897,8 +5902,7 @@ static ivas_error renderMcToBinauralRoom( set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, - mcInput->rot_gains_prev[0], - mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) + mcInput->rot_gains_prev[0], mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -5978,8 +5982,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, - mcInput->rot_gains_prev[0], - mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) + mcInput->rot_gains_prev[0], mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -6479,7 +6482,7 @@ static ivas_error renderSbaToMultiBinaural( } -static ivas_error renderSbaToMultiBinauralCldfb( +static void renderSbaToMultiBinauralCldfb( input_sba *sbaInput, float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -6494,7 +6497,7 @@ static ivas_error renderSbaToMultiBinauralCldfb( ivas_rend_CldfbMultiBinRendProcess( sbaInput->cldfbRendWrapper.hCldfbRend, sbaInput->base.ctx.pCombinedOrientationData, &sbaInput->base.ctx.pSplitRendWrapper->multiBinPoseData, Cldfb_RealBuffer, Cldfb_ImagBuffer, Cldfb_Out_Real, Cldfb_Out_Imag, low_res_pre_rend_rot, num_subframes ); - return IVAS_ERR_OK; + return; } @@ -6516,11 +6519,8 @@ static ivas_error renderSbaToSplitBinaural( if ( sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { - if ( ( renderSbaToMultiBinauralCldfb( sbaInput, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, low_res_pre_rend_rot, - getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK ) - { - return error; - } + renderSbaToMultiBinauralCldfb( sbaInput, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, low_res_pre_rend_rot, + getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) ); accumulateCLDFBArrayToBuffer( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, &outAudio ); } @@ -6558,11 +6558,8 @@ static ivas_error renderSbaToBinaural( float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - if ( ( error = renderSbaToMultiBinauralCldfb( sbaInput, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, 0, - getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK ) - { - return error; - } + renderSbaToMultiBinauralCldfb( sbaInput, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, 0, + getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) ); accumulateCLDFBArrayToBuffer( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, &outAudio ); } @@ -7395,10 +7392,10 @@ static ivas_error getSamplesInternal( ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { int16_t num_poses_orig; - num_poses_orig = hIvasRend->splitRendWrapper.multiBinPoseData.num_poses; + num_poses_orig = hIvasRend->splitRendWrapper->multiBinPoseData.num_poses; outAudio = hIvasRend->splitRendEncBuffer; - ISAR_PRE_REND_GetMultiBinPoseData( &hIvasRend->hRendererConfig->split_rend_config, &hIvasRend->splitRendWrapper.multiBinPoseData, hIvasRend->headRotData.sr_pose_pred_axis ); - assert( num_poses_orig == hIvasRend->splitRendWrapper.multiBinPoseData.num_poses && "number of poses should not change dynamically" ); + ISAR_PRE_REND_GetMultiBinPoseData( &hIvasRend->hRendererConfig->split_rend_config, &hIvasRend->splitRendWrapper->multiBinPoseData, hIvasRend->headRotData.sr_pose_pred_axis ); + assert( num_poses_orig == hIvasRend->splitRendWrapper->multiBinPoseData.num_poses && "number of poses should not change dynamically" ); /* Clear output buffer for split rendering bitstream */ set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel ); @@ -7463,7 +7460,7 @@ static ivas_error getSamplesInternal( } } - if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, + if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, @@ -7628,7 +7625,12 @@ void IVAS_REND_Close( ivas_limiter_close( &hIvasRend->hLimiter ); /* Split binaural rendering */ - ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + if ( hIvasRend->splitRendWrapper != NULL ) + { + ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + free( hIvasRend->splitRendWrapper ); + hIvasRend->splitRendWrapper = NULL; + } closeHeadRotation( hIvasRend ); @@ -7803,7 +7805,7 @@ int32_t IVAS_REND_GetCntFramesLimited( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ ) { @@ -7825,7 +7827,7 @@ ivas_error IVAS_REND_GetHrtfHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfCRendHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ ) { @@ -7847,7 +7849,7 @@ ivas_error IVAS_REND_GetHrtfCRendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfFastConvHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ ) { @@ -7869,7 +7871,7 @@ ivas_error IVAS_REND_GetHrtfFastConvHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfParamBinHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ) { @@ -7891,7 +7893,7 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfStatisticsHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ) { @@ -8281,6 +8283,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( int32_t output_Fs; RENDERER_TYPE renderer_type; int16_t j, k, bin; + int16_t num_poses; float binCenterFreq, tmpFloat; ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; @@ -8299,7 +8302,13 @@ static ivas_error ivas_masa_ext_rend_parambin_init( nBins = inputMasa->hMasaExtRend->hSpatParamRendCom->num_freq_bands; renderer_type = inputMasa->hMasaExtRend->renderer_type; - for ( pos_idx = 0; pos_idx < inputMasa->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses; pos_idx++ ) + num_poses = 1; + if ( inputMasa->base.ctx.pSplitRendWrapper != NULL ) + { + num_poses = inputMasa->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses; + } + + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { hDiracDecBin = inputMasa->hMasaExtRend->hDiracDecBin[pos_idx]; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 21c7df9bb478ad04944a701ca5453b5275963803..ea35e99934640692b2502780a48d4e5569ec4e66 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -109,8 +109,8 @@ typedef enum _IVAS_REND_COMPLEXITY_LEVEL ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t outputSampleRate, /* i : output sampling rate */ - const IVAS_AUDIO_CONFIG outConfig, /* i : output audio config */ - const bool asHrtfBinary, /* i : load hrtf binary file */ + const IVAS_AUDIO_CONFIG outConfig, /* i : output audio config */ + const bool asHrtfBinary, /* i : load hrtf binary file */ const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain, /* i : non-diegetic panning gain */ const int16_t num_subframes /* i : number of subframes */ @@ -183,28 +183,28 @@ ivas_error IVAS_REND_GetDelay( /*! r: error code */ ivas_error IVAS_REND_GetHrtfHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS render handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ ); /*! r: error code */ ivas_error IVAS_REND_GetHrtfCRendHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ + IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ ); ivas_error IVAS_REND_GetHrtfFastConvHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ + IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ ); ivas_error IVAS_REND_GetHrtfParamBinHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ + IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ); ivas_error IVAS_REND_GetHrtfStatisticsHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ + IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ); /* Functions to be called during rendering */ @@ -239,12 +239,12 @@ ivas_error IVAS_REND_InitConfig( ); int16_t IVAS_REND_GetRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ ); int16_t IVAS_REND_FeedRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ); @@ -267,12 +267,11 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( ); ivas_error IVAS_REND_GetSplitRendBitstreamHeader( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - ISAR_SPLIT_REND_CODEC *pCodec, /* o: pointer to codec setting */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + ISAR_SPLIT_REND_CODEC *pCodec, /* o : pointer to codec setting */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o: pointer to pose correction mode */ - int16_t *pCodec_frame_size_ms /* o: pointer to codec frame size setting */ - , - int16_t *pIsar_frame_size_ms /* o: pointer to isar frame size setting */ + int16_t *pCodec_frame_size_ms, /* o : pointer to codec frame size setting */ + int16_t *pIsar_frame_size_ms /* o : pointer to isar frame size setting */ ); ivas_error IVAS_REND_SetHeadRotation( @@ -338,16 +337,16 @@ ivas_error IVAS_REND_GetCombinedOrientation( ); ivas_error IVAS_REND_GetMasaMetadata( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_MASA_DECODER_EXT_OUT_META_HANDLE *hMasaExtOutMeta, /* o : pointer to handle, which will be set to point to analyzed MASA metadata */ - const IVAS_REND_AudioConfigType inputType /* i : Input type */ + const IVAS_REND_AudioConfigType inputType /* i : Input type */ ); ivas_error IVAS_REND_MergeMasaMetadata( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_MASA_DECODER_EXT_OUT_META_HANDLE *hMasaExtOutMeta, /* o : pointer to handle, which will be set to point to merged metadata */ - const IVAS_REND_AudioConfigType inputType1, /* i : Input type 1 */ - const IVAS_REND_AudioConfigType inputType2 /* i : Input type 2 */ + const IVAS_REND_AudioConfigType inputType1, /* i : Input type 1 */ + const IVAS_REND_AudioConfigType inputType2 /* i : Input type 2 */ ); ivas_error IVAS_REND_SetTotalNumberOfObjects( diff --git a/lib_util/split_rend_bfi_file_reader.c b/lib_util/split_rend_bfi_file_reader.c index 91cb44d422a2ee8e8b433d89f10b49713a660112..1573db5a9504c0ffe1ba4735f53f34e3e2fd7d34 100644 --- a/lib_util/split_rend_bfi_file_reader.c +++ b/lib_util/split_rend_bfi_file_reader.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include -#include "options.h" #include "split_rend_bfi_file_reader.h" #include #include "prot.h" diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 0c3e23edd6edf91e631c8f0b88384a7cb0ba7e2e..f57721edba64bdfcfcce82dc8cd4f4a0c80c7c0a 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include -#include "options.h" #include "split_render_file_read_write.h" #include #include "prot.h"