From 4ecd879a667bdace2dadf2e13538401f96f7a972 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 9 Dec 2024 11:06:40 +0100 Subject: [PATCH] issue 1153: Replace debugging constant FRAMES_PER_SECOND by FRAMES_PER_SEC + define constants in library instead of in API; under FIX_1153_ISAR_CONSTS --- lib_com/common_api_types.h | 2 ++ lib_com/ivas_cnst.h | 6 ++++++ lib_com/options.h | 2 +- lib_isar/isar_splitRendererPre.c | 8 ++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 16614a929a..55d3450c3d 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -57,11 +57,13 @@ #define IVAS_MAX_PARAM_SPATIAL_SUBFRAMES 4 #define IVAS_ROOM_ABS_COEFF 6 +#ifndef FIX_1153_ISAR_CONSTS /* Maximum buffer length (per channel) in samples */ #define MAX_BUFFER_LENGTH_PER_CHANNEL ( L_FRAME48k ) /* Frame size required when rendering to binaural */ #define BINAURAL_RENDERING_FRAME_SIZE_MS 5 +#endif /*----------------------------------------------------------------------------------* * Common API enum for output audio configurations diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 786a6d436b..c6a3ff8a6a 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -177,6 +177,12 @@ typedef enum #define MAX_SPAR_INTERNAL_CHANNELS IVAS_SPAR_MAX_CH #define MAX_CLDFB_DIGEST_CHANNELS (FOA_CHANNELS + MAX_NUM_OBJECTS) +#ifdef FIX_1153_ISAR_CONSTS +#define MAX_BUFFER_LENGTH_PER_CHANNEL L_FRAME48k /* Maximum buffer length (per channel) in samples */ + +#define BINAURAL_RENDERING_FRAME_SIZE_MS 5 /* Frame size required when rendering to binaural */ +#endif + typedef enum { TC_BUFFER_MODE_RENDERER, diff --git a/lib_com/options.h b/lib_com/options.h index 484de232aa..48e0c33c49 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,7 @@ #define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* VA: issue 1226: for FastConv binaural renderer in decoder, load only HTRT coefficient set that is needed */ #define FIX_1227_Crend_HRTF_LOADING_OPTIM /* VA: issue 1227: for Crend binaural renderer in decoder, load only HTRT coefficient set that is needed */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ - +#define FIX_1153_ISAR_CONSTS /* VA: issue 1153: Replace debugging constant FRAMES_PER_SECOND by FRAMES_PER_SEC + define constants in library instead of in API */ /* #################### End BE switches ################################## */ diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index 4cd4855ecc..b81123e17c 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -1776,7 +1776,11 @@ ivas_error split_renderer_open_lc3plus( /* Alocate buffers for delay compensation */ if ( pSplitRendConfig->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) { +#ifdef FIX_1153_ISAR_CONSTS + delayBufferLength = (int16_t) ( output_Fs / (int32_t) FRAMES_PER_SEC + hSplitRendWrapper->lc3plusDelaySamples ); +#else delayBufferLength = (int16_t) ( output_Fs / (int32_t) FRAMES_PER_SECOND + hSplitRendWrapper->lc3plusDelaySamples ); +#endif for ( i = 0; i < hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++i ) { if ( ( hSplitRendWrapper->lc3plusDelayBuffers[i] = malloc( delayBufferLength * sizeof( float ) ) ) == NULL ) @@ -1905,7 +1909,11 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( if ( useLc3plus ) { /*this should always have the time resolution of pose correction MD. Note that this does not change frame size of LC3plus*/ +#ifdef FIX_1153_ISAR_CONSTS + int16_t frame_size = (int16_t) ( hSplitBin->hLc3plusEnc->config.samplerate / (int32_t) FRAMES_PER_SEC ); +#else int16_t frame_size = (int16_t) ( hSplitBin->hLc3plusEnc->config.samplerate / (int32_t) FRAMES_PER_SECOND ); +#endif for ( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i ) { -- GitLab