From 7886e443b56d6306a9be5bf05ac873e986d6c8b2 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 23 Apr 2024 14:56:24 +0200 Subject: [PATCH 1/6] ISAR formal improvements --- apps/decoder.c | 10 +- apps/isar_post_rend.c | 2 +- apps/renderer.c | 2 +- lib_dec/ivas_binRenderer_internal.c | 4 - lib_dec/ivas_init_dec.c | 4 +- lib_dec/ivas_objectRenderer_internal.c | 8 +- lib_dec/ivas_output_config.c | 3 - lib_dec/ivas_stat_dec.h | 2 +- lib_dec/lib_dec.c | 26 +++-- lib_dec/lib_dec.h | 4 +- lib_isar/isar_MSPred.c | 10 +- lib_isar/isar_PerceptualModel.c | 1 - lib_isar/isar_cnst.h | 6 +- lib_isar/isar_lc3plus_common.c | 4 +- lib_isar/isar_lc3plus_common.h | 2 +- lib_isar/isar_lc3plus_dec.c | 114 +++++++++---------- lib_isar/isar_lc3plus_dec.h | 29 +++-- lib_isar/isar_lc3plus_enc.c | 42 +++---- lib_isar/isar_lc3plus_enc.h | 12 +- lib_isar/isar_lcld_decoder.c | 22 ++-- lib_isar/isar_lcld_encoder.c | 14 +-- lib_isar/isar_lcld_prot.h | 6 +- lib_isar/isar_prot.h | 10 +- lib_isar/isar_rom_post_rend.c | 8 +- lib_isar/isar_rom_post_rend.h | 9 +- lib_isar/isar_splitRendererPLC.c | 2 +- lib_isar/isar_splitRendererPost.c | 4 +- lib_isar/isar_splitRendererPre.c | 42 +++---- lib_isar/isar_splitRenderer_utils.c | 40 +++---- lib_isar/isar_stat.h | 6 +- lib_isar/lib_isar_post_rend.c | 43 ++++--- lib_isar/lib_isar_post_rend.h | 5 +- lib_isar/lib_isar_pre_rend.c | 14 +-- lib_rend/ivas_crend.c | 7 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 13 ++- lib_rend/ivas_objectRenderer.c | 3 - lib_rend/ivas_prot_rend.h | 15 +-- lib_rend/ivas_rom_rend.h | 8 -- lib_rend/ivas_stat_rend.h | 8 +- lib_rend/lib_rend.c | 4 +- lib_util/split_rend_bfi_file_reader.c | 4 +- lib_util/split_render_file_read_write.c | 10 +- 42 files changed, 286 insertions(+), 296 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index e3026f93e7..793e8c58cf 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -185,10 +185,6 @@ int main( uint8_t splitRendBitsBuf[ISAR_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES]; #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT - splitRendBits.bits_buf = splitRendBitsBuf; -#endif - /* Any handles that require cleanup must be declared here and initialized to NULL */ IVAS_DEC_HANDLE hIvasDec = NULL; BS_READER_HANDLE hBsReader = NULL; @@ -220,6 +216,10 @@ int main( reset_mem( USE_BYTES ); #endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + splitRendBits.bits_buf = splitRendBitsBuf; +#endif + /*------------------------------------------------------------------------------------------* * Parse command-line arguments *------------------------------------------------------------------------------------------*/ @@ -456,11 +456,11 @@ int main( fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for decoding to EXT!\n" ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------------------------* * Configure Split rendering *------------------------------------------------------------------------------------------*/ -#ifdef SPLIT_REND_WITH_HEAD_ROT asked_frame_size = arg.renderFramesize; if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { diff --git a/apps/isar_post_rend.c b/apps/isar_post_rend.c index 2710c3db5e..01bd2a09bf 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -947,7 +947,7 @@ int main( if ( args.inConfig.numBinBuses > 0 ) { - if ( ( error = IVAS_REND_SetSplitRendBitstreamHeader( hIsarPostRend, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, + if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) ); diff --git a/apps/renderer.c b/apps/renderer.c index 0e0ec58e56..09915969e2 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -617,7 +617,7 @@ static float dBToLin( #ifdef SPLIT_REND_WITH_HEAD_ROT static int16_t get_cldfb_in_flag( const IVAS_AUDIO_CONFIG audioConfig, - IVAS_RENDER_CONFIG_DATA *renderConfig ) + const IVAS_RENDER_CONFIG_DATA *renderConfig ) { int16_t cldfb_in_flag; diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index d936470f75..99850e71d3 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -42,10 +42,6 @@ #include "ivas_rom_dec.h" #include "ivas_rom_com.h" #include "ivas_rom_binauralRenderer.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_rom_dec.h" -#include "lib_rend.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 84f99d81b3..1b83a06596 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -34,13 +34,13 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "ivas_prot_rend.h" -#include "isar_prot.h" #include "ivas_rom_com.h" #include "ivas_stat_enc.h" -#include "isar_stat.h" #include "prot.h" #ifdef SPLIT_REND_WITH_HEAD_ROT #include "lib_isar_pre_rend.h" +#include "isar_prot.h" +#include "isar_stat.h" #endif #include #include diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 1034ffe538..174aac81da 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -238,9 +238,9 @@ ivas_error ivas_td_binaural_renderer_sf( *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* i/o: SCE channels / Binaural synthesis */ - int16_t nSamplesRendered /* i : number of samples to render */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float *output[], /* i/o: SCE channels / Binaural synthesis */ + const int16_t nSamplesRendered /* i : number of samples to render */ ) { int16_t i; @@ -252,7 +252,7 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( int16_t original_subframes_rendered; int16_t original_slots_rendered; float *p_bin_output[BINAURAL_CHANNELS]; - float output_local[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // VE2SB: TBV + float output_local[MAX_OUTPUT_CHANNELS][L_FRAME48k]; push_wmops( "ivas_td_binaural_renderer_sf_splitBinaural" ); pMultiBinPoseData = &st_ivas->hSplitBinRend.splitrend.multiBinPoseData; diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 1be9e61829..84672f3583 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -34,9 +34,6 @@ #include "options.h" #include "ivas_cnst.h" #include "ivas_prot.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_prot_rend.h" -#endif #include "ivas_stat_dec.h" #ifdef DEBUGGING #include "debug.h" diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index a12945bca9..38efc50126 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1139,7 +1139,7 @@ typedef struct Decoder_Struct int16_t flag_omasa_brate; #ifdef SPLIT_REND_WITH_HEAD_ROT - ISAR_DEC_SPLIT_REND_WRAPPER hSplitBinRend; /* split binuaral rendering handle */ + ISAR_DEC_SPLIT_REND_WRAPPER hSplitBinRend; /* ISAR split binaural rendering handle */ BINAURAL_TD_OBJECT_RENDERER_HANDLE hTdRendHandles[MAX_HEAD_ROT_POSES - 1]; #endif diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index f8f042dada..678848a618 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -127,7 +127,7 @@ static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( IVAS_DEC_HANDLE hIvasDec, static PCM_RESOLUTION pcm_type_API_to_internal( const IVAS_DEC_PCM_TYPE pcmType ); static void *pcm_buffer_offset( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, const int32_t offset ); 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, ISAR_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); +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 ); #endif static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesRendered ); @@ -260,8 +260,8 @@ ivas_error IVAS_DEC_Open( static ivas_error isar_set_split_rend_setup( ISAR_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, - ISAR_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, + const ISAR_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, + const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ ) { @@ -1431,7 +1431,7 @@ static ivas_error IVAS_DEC_GetRenderedSamples( uint16_t *nSamplesRendered, /* o : number of samples rendered */ uint16_t *nSamplesAvailableNext, /* o : number of samples still available in the renerer pipeline */ #ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_DEC_PCM_TYPE pcmType, + const IVAS_DEC_PCM_TYPE pcmType, void *pcmBuf #else int16_t *pcmBuf @@ -2545,7 +2545,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ uint16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ #ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_DEC_PCM_TYPE pcmType, + const IVAS_DEC_PCM_TYPE pcmType, void *pcmBuf, #else int16_t *pcmBuf, /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels */ @@ -3804,10 +3804,8 @@ ivas_error IVAS_DEC_GetCldfbSamples( return IVAS_ERR_OK; } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT /*---------------------------------------------------------------------* * pcm_buffer_offset() * @@ -3896,6 +3894,13 @@ PCM_RESOLUTION pcm_type_API_to_internal( return pcm_resolution; } + +/*---------------------------------------------------------------------* + * IVAS_DEC_is_split_rendering_enabled() + * + * + *---------------------------------------------------------------------*/ + int16_t IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ ) @@ -3919,6 +3924,13 @@ int16_t IVAS_DEC_is_split_rendering_enabled( return isSplitRend; } + +/*---------------------------------------------------------------------* + * IVAS_DEC_is_split_rendering_coded_out() + * + * + *---------------------------------------------------------------------*/ + int16_t IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index d4e12f8c71..9a2b6d4b16 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -224,7 +224,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( IVAS_VECTOR3 Pos, /* i : listener position */ #ifdef SPLIT_REND_WITH_HEAD_ROT const int16_t subframe_idx, /* i : subframe index */ - ISAR_SPLIT_REND_ROT_AXIS rot_axis /* i : external control for rotation axis for split rendering */ + const ISAR_SPLIT_REND_ROT_AXIS rot_axis /* i : external control for rotation axis for split rendering */ #else const int16_t subframe_idx /* i : subframe index */ #endif @@ -281,7 +281,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ uint16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ #ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_DEC_PCM_TYPE pcmType, + const IVAS_DEC_PCM_TYPE pcmType, void *pcmBuf, #else int16_t *pcmBuf, /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels */ diff --git a/lib_isar/isar_MSPred.c b/lib_isar/isar_MSPred.c index 602e0b2178..0f67d2196f 100644 --- a/lib_isar/isar_MSPred.c +++ b/lib_isar/isar_MSPred.c @@ -33,7 +33,7 @@ #include "options.h" #include #ifdef SPLIT_REND_WITH_HEAD_ROT -#include "isar_rom_lcld_tables.h" +//#include "isar_rom_lcld_tables.h" #include "isar_lcld_prot.h" #include "isar_prot.h" #include "wmc_auto.h" @@ -73,16 +73,16 @@ int32_t quantPhase( /*-------------------------------------------------------------------* - * Function cplxmult() + * Function cplxmult_isar() * * *-------------------------------------------------------------------*/ -void cplxmult( +void cplxmult_isar( float *pr1, float *pi1, - float r2, - float i2 ) + const float r2, + const float i2 ) { float r1 = *pr1, i1 = *pi1; diff --git a/lib_isar/isar_PerceptualModel.c b/lib_isar/isar_PerceptualModel.c index 53b5998d0b..4b963ab75a 100644 --- a/lib_isar/isar_PerceptualModel.c +++ b/lib_isar/isar_PerceptualModel.c @@ -45,7 +45,6 @@ *------------------------------------------------------------------------------------------*/ #define PERCEPTUAL_MODEL_SCALE ( 64 ) -#define PERCEPTUAL_MODEL_SCALE_SHIFT ( 6 ) #define PERCEPTUAL_MODEL_ALPHA_SCALE ( 614 ) #define PERCEPTUAL_MODEL_ALPHA_INV_SCALE ( 6827 ) #define PERCEPTUAL_MODEL_ALPHA_SHIFT ( 11 ) diff --git a/lib_isar/isar_cnst.h b/lib_isar/isar_cnst.h index 9412b2f2aa..a5492b638e 100644 --- a/lib_isar/isar_cnst.h +++ b/lib_isar/isar_cnst.h @@ -80,7 +80,7 @@ typedef enum #define ISAR_SPLIT_REND_NUM_QUANT_STRATS 4 #define ISAR_SPLIT_REND_PRED_63QUANT_PNTS 63 -#define IVAS_SPLIT_REND_PRED_31QUANT_PNTS 31 +#define ISAS_SPLIT_REND_PRED_31QUANT_PNTS 31 #define ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS 31 #define ISAR_SPLIT_REND_D_QUANT_PNTS 15 #define ISAR_SPLIT_REND_PRED_MIN_VAL -1.4f @@ -94,8 +94,8 @@ typedef enum #define ISAR_SPLIT_REND_PRED_ROLL_Q_STEP ( ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) / ( ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS - 1 ) ) #define ISAR_SPLIT_REND_PRED_ROLL_1BYQ_STEP ( ( ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS - 1 ) / ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) ) -#define ISAR_SPLIT_REND_PRED31_Q_STEP ( ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) / ( IVAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) ) -#define ISAR_SPLIT_REND_PRED31_1BYQ_STEP ( ( IVAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) / ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) ) +#define ISAR_SPLIT_REND_PRED31_Q_STEP ( ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) / ( ISAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) ) +#define ISAR_SPLIT_REND_PRED31_1BYQ_STEP ( ( ISAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) / ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) ) #define ISAR_SPLIT_REND_PRED63_Q_STEP ( ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) / ( ISAR_SPLIT_REND_PRED_63QUANT_PNTS - 1 ) ) #define ISAR_SPLIT_REND_PRED63_1BYQ_STEP ( ( ISAR_SPLIT_REND_PRED_63QUANT_PNTS - 1 ) / ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) ) diff --git a/lib_isar/isar_lc3plus_common.c b/lib_isar/isar_lc3plus_common.c index 1f16239bb4..e878b890cf 100644 --- a/lib_isar/isar_lc3plus_common.c +++ b/lib_isar/isar_lc3plus_common.c @@ -37,12 +37,12 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT /*-----------------------------------------------------------------------------------------* - * Function IVAS_LC3PLUS_LC3plusErrToIvasErr() + * Function ISAR_LC3PLUS_LC3plusErrToIvasErr() * * *-----------------------------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_LC3plusErrToIvasErr( +ivas_error ISAR_LC3PLUS_LC3plusErrToIvasErr( const LC3PLUS_Error lc3PlusError ) { switch ( lc3PlusError ) diff --git a/lib_isar/isar_lc3plus_common.h b/lib_isar/isar_lc3plus_common.h index e8c313d105..e350129499 100644 --- a/lib_isar/isar_lc3plus_common.h +++ b/lib_isar/isar_lc3plus_common.h @@ -53,7 +53,7 @@ typedef struct LC3PLUS_CONFIG } LC3PLUS_CONFIG; /*! utility function to convert LC3PLUS_Errors to the suitable ivas_error */ -ivas_error IVAS_LC3PLUS_LC3plusErrToIvasErr( const LC3PLUS_Error lc3PlusError ); +ivas_error ISAR_LC3PLUS_LC3plusErrToIvasErr( const LC3PLUS_Error lc3PlusError ); #endif #endif /* IVAS_LC3PLUS_COM_H */ diff --git a/lib_isar/isar_lc3plus_dec.c b/lib_isar/isar_lc3plus_dec.c index 6af5549a2d..8a890915eb 100644 --- a/lib_isar/isar_lc3plus_dec.c +++ b/lib_isar/isar_lc3plus_dec.c @@ -43,12 +43,32 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_Open() + * isar_LC3PLUS_AllocateSubframeDecodingMatrix() * * *------------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_DEC_Open( +static void isar_LC3PLUS_DEC_FreeSubframeDecodingMatrix( + int16_t **subframeChannelMatrix ) +{ + for ( int16_t i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + free( subframeChannelMatrix[i] ); + } + + free( subframeChannelMatrix ); + + return; +} + + +/*------------------------------------------------------------------------- + * ISAR_LC3PLUS_DEC_Open() + * + * + *------------------------------------------------------------------------*/ + +ivas_error ISAR_LC3PLUS_DEC_Open( const LC3PLUS_CONFIG config, /* i : LC3plus decoder configuration */ ISAR_LC3PLUS_DEC_HANDLE *handle /* o : decoder handle */ ) @@ -79,13 +99,13 @@ ivas_error IVAS_LC3PLUS_DEC_Open( if ( ( ( *handle )->handles = malloc( config.channels * sizeof( ISAR_LC3PLUS_DEC_HANDLE ) ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); } - if ( ( ( *handle )->selective_decoding_states = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE * ) ) ) == NULL ) + if ( ( ( *handle )->selective_decoding_states = malloc( config.channels * sizeof( ISAR_LC3PLUS_DEC_SELECTIVE_DECODING_STATE * ) ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); } @@ -95,9 +115,9 @@ ivas_error IVAS_LC3PLUS_DEC_Open( ( *handle )->selective_decoding_states[i] = NULL; } - if ( ( ( *handle )->bitstream_caches = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_BITSTREAM_CACHE * ) ) ) == NULL ) + if ( ( ( *handle )->bitstream_caches = malloc( config.channels * sizeof( ISAR_LC3PLUS_DEC_BITSTREAM_CACHE * ) ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); } for ( i = 0; i < config.channels; ++i ) @@ -117,40 +137,40 @@ ivas_error IVAS_LC3PLUS_DEC_Open( decoder_size = lc3plus_dec_get_size( config.samplerate, 1 ); if ( 0 == decoder_size ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_INTERNAL, "lc3plus_dec_get_size failed\n" ); } if ( ( ( *handle )->handles[iCh] = malloc( decoder_size ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } err = lc3plus_dec_init( ( *handle )->handles[iCh], config.samplerate, 1, LC3PLUS_PLC_ADVANCED, 0 ); if ( LC3PLUS_OK != err ) { - IVAS_LC3PLUS_DEC_Close( handle ); - return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec_init failed\n" ); + ISAR_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec_init failed\n" ); } err = lc3plus_dec_set_frame_dms( ( *handle )->handles[iCh], config.lc3plus_frame_duration_us / 100 ); if ( LC3PLUS_OK != err ) { - IVAS_LC3PLUS_DEC_Close( handle ); - return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec_set_frame_dms failed\n" ); + ISAR_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec_set_frame_dms failed\n" ); } /* allocate and configure per LC3plus decoder skip state */ - if ( ( ( *handle )->selective_decoding_states[iCh] = malloc( sizeof( IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE ) ) ) == NULL ) + if ( ( ( *handle )->selective_decoding_states[iCh] = malloc( sizeof( ISAR_LC3PLUS_DEC_SELECTIVE_DECODING_STATE ) ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } if ( ( ( *handle )->selective_decoding_states[iCh]->frame_actions = malloc( numLC3plusFramesPerIvasFrame * sizeof( SelectiveDecAction ) ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } @@ -162,15 +182,15 @@ ivas_error IVAS_LC3PLUS_DEC_Open( } /* allocate and configure per LC3plus decoder bitstream cache */ - if ( ( ( *handle )->bitstream_caches[iCh] = malloc( sizeof( IVAS_LC3PLUS_DEC_BITSTREAM_CACHE ) ) ) == NULL ) + if ( ( ( *handle )->bitstream_caches[iCh] = malloc( sizeof( ISAR_LC3PLUS_DEC_BITSTREAM_CACHE ) ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } ( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity = 400 /*LC3plus max non-HR octet count*/ * numLC3plusFramesPerIvasFrame; if ( ( ( *handle )->bitstream_caches[iCh]->bitstream_cache = malloc( ( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } ( *handle )->bitstream_caches[iCh]->bitstream_cache_size = 0; @@ -179,13 +199,13 @@ ivas_error IVAS_LC3PLUS_DEC_Open( ( *handle )->config = config; if ( config.ivas_frame_duration_us < config.lc3plus_frame_duration_us || config.ivas_frame_duration_us % config.lc3plus_frame_duration_us != 0 ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Current pcm_conversion_buffer sizing requires that lc3plus uses a shorter or equal frame duration than ivas\n" ); } if ( ( ( *handle )->pcm_conversion_buffer = malloc( sizeof( int16_t ) * config.samplerate * config.lc3plus_frame_duration_us / 1000000 ) ) == NULL ) { - IVAS_LC3PLUS_DEC_Close( handle ); + ISAR_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder wrapper pcm_conversion_buffer\n" ); } @@ -194,12 +214,12 @@ ivas_error IVAS_LC3PLUS_DEC_Open( /*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix() + * ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix() * * *------------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( +ivas_error ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( int16_t ***subframeChannelMatrix, const uint32_t num_decs ) { @@ -219,7 +239,7 @@ ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( { if ( ( ( *subframeChannelMatrix )[i] = malloc( num_decs * sizeof( int16_t ) ) ) == NULL ) { - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( *subframeChannelMatrix ); + isar_LC3PLUS_DEC_FreeSubframeDecodingMatrix( *subframeChannelMatrix ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "subframeChannelMatrix allocation failed\n" ); } } @@ -228,26 +248,6 @@ ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( } -/*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix() - * - * - *------------------------------------------------------------------------*/ - -void IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( - int16_t **subframeChannelMatrix ) -{ - for ( int16_t i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) - { - free( subframeChannelMatrix[i] ); - } - - free( subframeChannelMatrix ); - - return; -} - - /*------------------------------------------------------------------------- * IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix() * @@ -363,12 +363,12 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( /*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_GetDelay() + * ISAR_LC3PLUS_DEC_GetDelay() * * *------------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_DEC_GetDelay( +ivas_error ISAR_LC3PLUS_DEC_GetDelay( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : LC3plus decoder handle */ int32_t *delayInSamples /* o : decoder delay in number of samples per channel */ ) @@ -407,12 +407,12 @@ ivas_error IVAS_LC3PLUS_DEC_GetDelay( /*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_Close() + * ISAR_LC3PLUS_DEC_Close() * * *------------------------------------------------------------------------*/ -void IVAS_LC3PLUS_DEC_Close( +void ISAR_LC3PLUS_DEC_Close( ISAR_LC3PLUS_DEC_HANDLE *handle /* i/o: Pointer to LC3plus decoder handle */ ) { @@ -487,7 +487,7 @@ static ivas_error decode_or_conceal_one_lc3plus_frame( if ( err != LC3PLUS_OK ) { - return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec16 failed\n" ); + return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec16 failed\n" ); } return IVAS_ERR_OK; @@ -495,12 +495,12 @@ static ivas_error decode_or_conceal_one_lc3plus_frame( /*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal() + * isar_LC3PLUS_DEC_Decode_or_Conceal_internal() * * *------------------------------------------------------------------------*/ -static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( +static ivas_error isar_LC3PLUS_DEC_Decode_or_Conceal_internal( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : LC3plus decoder configuration */ uint8_t *bitstream_in, /* i : pointer to input bitstream */ int32_t bitstream_in_size, /* i : size of bitstream_in */ @@ -639,12 +639,12 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( /*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_Decode() + * ISAR_LC3PLUS_DEC_Decode() * * *------------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_DEC_Decode( +ivas_error ISAR_LC3PLUS_DEC_Decode( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : LC3plus decoder configuration */ uint8_t *bitstream_in, /* i : pointer to input bitstream */ const int32_t bitstream_in_size, /* i : size of bitstream_in */ @@ -667,17 +667,17 @@ ivas_error IVAS_LC3PLUS_DEC_Decode( } badFrameIndicator = 0; - return IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( handle, bitstream_in, bitstream_in_size, badFrameIndicator, pcm_out ); + return isar_LC3PLUS_DEC_Decode_or_Conceal_internal( handle, bitstream_in, bitstream_in_size, badFrameIndicator, pcm_out ); } /*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_Conceal() + * ISAR_LC3PLUS_DEC_Conceal() * * *------------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_DEC_Conceal( +ivas_error ISAR_LC3PLUS_DEC_Conceal( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : LC3plus decoder handle */ float **pcm_out /* o : concealed samples */ ) @@ -698,6 +698,6 @@ ivas_error IVAS_LC3PLUS_DEC_Conceal( /* LC3plus API requires a non-NULL bitstream pointer, even when triggering concealment */ badFrameIndicator = 1; - return IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( handle, bitstream_in, 0, badFrameIndicator, pcm_out ); + return isar_LC3PLUS_DEC_Decode_or_Conceal_internal( handle, bitstream_in, 0, badFrameIndicator, pcm_out ); } #endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/lib_isar/isar_lc3plus_dec.h b/lib_isar/isar_lc3plus_dec.h index 74737841c9..ed0960a811 100644 --- a/lib_isar/isar_lc3plus_dec.h +++ b/lib_isar/isar_lc3plus_dec.h @@ -39,7 +39,7 @@ #include "lc3.h" #include "ivas_error.h" #include "isar_lc3plus_common.h" -#include "ivas_cnst.h" +//#include "ivas_cnst.h" typedef enum { @@ -51,7 +51,7 @@ typedef enum } SelectiveDecAction; -typedef struct IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE +typedef struct ISAR_LC3PLUS_DEC_SELECTIVE_DECODING_STATE { /*! indicates that the decoder has skipped one or more frames. This means it must decode two frames to flush algorithmic delay when re-activated */ int16_t has_skipped_a_frame; @@ -59,63 +59,62 @@ typedef struct IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE SelectiveDecAction *frame_actions; /*! if set to 1, decoder will decode the cache before decoding any of current frames */ int16_t shall_decode_cached_frame; -} IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE; +} ISAR_LC3PLUS_DEC_SELECTIVE_DECODING_STATE; -typedef struct IVAS_LC3PLUS_DEC_BITSTREAM_CACHE +typedef struct ISAR_LC3PLUS_DEC_BITSTREAM_CACHE { uint8_t *bitstream_cache; int32_t bitstream_cache_capacity; int32_t bitstream_cache_size; -} IVAS_LC3PLUS_DEC_BITSTREAM_CACHE; +} ISAR_LC3PLUS_DEC_BITSTREAM_CACHE; /* decoder wrapper */ typedef struct ISAR_LC3PLUS_DEC_HANDLE { LC3PLUS_Dec **handles; - IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE **selective_decoding_states; - IVAS_LC3PLUS_DEC_BITSTREAM_CACHE **bitstream_caches; + ISAR_LC3PLUS_DEC_SELECTIVE_DECODING_STATE **selective_decoding_states; + ISAR_LC3PLUS_DEC_BITSTREAM_CACHE **bitstream_caches; uint32_t num_decs; int16_t *pcm_conversion_buffer; LC3PLUS_CONFIG config; } * ISAR_LC3PLUS_DEC_HANDLE; -ivas_error IVAS_LC3PLUS_DEC_Open( +ivas_error ISAR_LC3PLUS_DEC_Open( const LC3PLUS_CONFIG config, /* i : decoder configuration */ ISAR_LC3PLUS_DEC_HANDLE *handle /* o : decoder handle */ ); -ivas_error IVAS_LC3PLUS_DEC_GetDelay( +ivas_error ISAR_LC3PLUS_DEC_GetDelay( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : decoder handle */ int32_t *delayInSamples /* o : algorithmic delay of encoding and decoding in number of samples per channel */ ); -void IVAS_LC3PLUS_DEC_Close( +void ISAR_LC3PLUS_DEC_Close( ISAR_LC3PLUS_DEC_HANDLE *handle /* i/o: pointer to decoder handle */ ); /*! Sets a matrix[MAX_PARAM_SPATIAL_SUBFRAMES][numLC3plusDecoders] where all require subframes must be flagged with 1, frames that are not required with 0 */ -ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( +ivas_error ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : decoder handle */ int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] /* i : */ ); -ivas_error IVAS_LC3PLUS_DEC_Decode( +ivas_error ISAR_LC3PLUS_DEC_Decode( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : decoder handle */ uint8_t *bitstream_in, /* i : pointer to input bitstream */ const int32_t bitstream_in_size, /* i : size of bitstream_in */ float **pcm_out /* o : decoded samples */ ); -ivas_error IVAS_LC3PLUS_DEC_Conceal( +ivas_error ISAR_LC3PLUS_DEC_Conceal( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : decoder handle */ float **pcm_out /* o : concealed samples */ ); -ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( +ivas_error ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( int16_t ***subframeChannelMatrix, const uint32_t num_decs ); -void IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( int16_t **subframeChannelMatrix ); #endif #endif /* IVAS_LC3PLUS_DEC_H */ diff --git a/lib_isar/isar_lc3plus_enc.c b/lib_isar/isar_lc3plus_enc.c index ea3081be87..4de75cc526 100644 --- a/lib_isar/isar_lc3plus_enc.c +++ b/lib_isar/isar_lc3plus_enc.c @@ -39,12 +39,12 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT /*-------------------------------------------------------------------* - * Function IVAS_LC3PLUS_ENC_Open() + * Function ISAR_LC3PLUS_ENC_Open() * * *-------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_ENC_Open( +ivas_error ISAR_LC3PLUS_ENC_Open( const LC3PLUS_CONFIG config, /* i : LC3plus encoder configuration */ const uint32_t bitsPerSecond, /* i : bit rate */ ISAR_LC3PLUS_ENC_HANDLE *handle /* o : encoder handle */ @@ -79,7 +79,7 @@ ivas_error IVAS_LC3PLUS_ENC_Open( ( *handle )->num_encs = 0; if ( ( ( *handle )->handles = malloc( config.channels * sizeof( ISAR_LC3PLUS_ENC_HANDLE ) ) ) == NULL ) { - IVAS_LC3PLUS_ENC_Close( handle ); + ISAR_LC3PLUS_ENC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); } @@ -93,35 +93,35 @@ ivas_error IVAS_LC3PLUS_ENC_Open( { if ( ( ( *handle )->handles[iCh] = malloc( encoder_size ) ) == NULL ) { - IVAS_LC3PLUS_ENC_Close( handle ); + ISAR_LC3PLUS_ENC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus encoder\n" ); } err = lc3plus_enc_init( ( *handle )->handles[iCh], config.samplerate, 1, 0, lfeChans ); if ( err != LC3PLUS_OK ) { - IVAS_LC3PLUS_ENC_Close( handle ); - return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_init failed\n" ); + ISAR_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_init failed\n" ); } err = lc3plus_enc_set_frame_dms( ( *handle )->handles[iCh], config.lc3plus_frame_duration_us / 100 ); if ( err != LC3PLUS_OK ) { - IVAS_LC3PLUS_ENC_Close( handle ); - return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_set_frame_dms failed\n" ); + ISAR_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_set_frame_dms failed\n" ); } err = lc3plus_enc_set_bitrate( ( *handle )->handles[iCh], bitsPerSecondPerChannel ); if ( err != LC3PLUS_OK ) { - IVAS_LC3PLUS_ENC_Close( handle ); - return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_set_bitrate failed\n" ); + ISAR_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_set_bitrate failed\n" ); } } if ( config.ivas_frame_duration_us < config.lc3plus_frame_duration_us || config.ivas_frame_duration_us % config.lc3plus_frame_duration_us != 0 ) { - IVAS_LC3PLUS_ENC_Close( handle ); + ISAR_LC3PLUS_ENC_Close( handle ); return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Current pcm_conversion_buffer sizing requires that lc3plus uses a shorter or equal frame duration than ivas\n" ); } @@ -129,7 +129,7 @@ ivas_error IVAS_LC3PLUS_ENC_Open( ( *handle )->pcm_conversion_buffer = malloc( sizeof( int16_t ) * config.samplerate * config.lc3plus_frame_duration_us / 1000000 ); if ( NULL == ( *handle )->pcm_conversion_buffer ) { - IVAS_LC3PLUS_ENC_Close( handle ); + ISAR_LC3PLUS_ENC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus encoder wrapper pcm_conversion_buffer\n" ); } @@ -138,12 +138,12 @@ ivas_error IVAS_LC3PLUS_ENC_Open( /*-------------------------------------------------------------------* - * Function IVAS_LC3PLUS_ENC_GetDelay() + * Function ISAR_LC3PLUS_ENC_GetDelay() * * *-------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_ENC_GetDelay( +ivas_error ISAR_LC3PLUS_ENC_GetDelay( ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ int32_t *delayInSamples /* o : encoder delay in number of samples per channel */ ) @@ -181,12 +181,12 @@ ivas_error IVAS_LC3PLUS_ENC_GetDelay( /*-------------------------------------------------------------------* - * Function IVAS_LC3PLUS_ENC_GetOutputBitstreamSize() + * Function ISAR_LC3PLUS_ENC_GetOutputBitstreamSize() * * *-------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( +ivas_error ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ int32_t *bsSize /* o : size of each bitstream frame in bytes */ ) @@ -224,12 +224,12 @@ ivas_error IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( /*-------------------------------------------------------------------* - * Function IVAS_LC3PLUS_ENC_Close() + * Function ISAR_LC3PLUS_ENC_Close() * * *-------------------------------------------------------------------*/ -void IVAS_LC3PLUS_ENC_Close( +void ISAR_LC3PLUS_ENC_Close( ISAR_LC3PLUS_ENC_HANDLE *handle /* i/o: pointer to LC3plus encoder handle */ ) { @@ -260,12 +260,12 @@ void IVAS_LC3PLUS_ENC_Close( /*-------------------------------------------------------------------* - * Function IVAS_LC3PLUS_ENC_Encode() + * Function ISAR_LC3PLUS_ENC_Encode() * * *-------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_ENC_Encode( +ivas_error ISAR_LC3PLUS_ENC_Encode( ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ float **pcm_in, /* i : pointer input samples */ void *bitstream_out /* o : pointer to bitstream frame */ @@ -316,7 +316,7 @@ ivas_error IVAS_LC3PLUS_ENC_Encode( pop_wmops(); if ( err != LC3PLUS_OK ) { - return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc16 failed\n" ); + return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc16 failed\n" ); } if ( 0 == num_bytes ) { diff --git a/lib_isar/isar_lc3plus_enc.h b/lib_isar/isar_lc3plus_enc.h index 82437bc083..1a9f467b5f 100644 --- a/lib_isar/isar_lc3plus_enc.h +++ b/lib_isar/isar_lc3plus_enc.h @@ -48,31 +48,31 @@ typedef struct ISAR_LC3PLUS_ENC_HANDLE int16_t *pcm_conversion_buffer; } * ISAR_LC3PLUS_ENC_HANDLE; -ivas_error IVAS_LC3PLUS_ENC_Open( +ivas_error ISAR_LC3PLUS_ENC_Open( const LC3PLUS_CONFIG config, /* i : encoder configuration */ const uint32_t bitsPerSecond, /* i : bit rate */ ISAR_LC3PLUS_ENC_HANDLE *handle /* o : LC3plus encoder handle */ ); -ivas_error IVAS_LC3PLUS_ENC_GetDelay( +ivas_error ISAR_LC3PLUS_ENC_GetDelay( ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ int32_t *delayInSamples /* o : algorithmic delay of encoding and decoding in number of samples per channel */ ); -ivas_error IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( +ivas_error ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ int32_t *bsSize /* o : size of each bitstream frame in bytes */ ); -void IVAS_LC3PLUS_ENC_Close( +void ISAR_LC3PLUS_ENC_Close( ISAR_LC3PLUS_ENC_HANDLE *handle /* i/o: pointer to LC3plus encoder handle */ ); -ivas_error IVAS_LC3PLUS_ENC_Encode( +ivas_error ISAR_LC3PLUS_ENC_Encode( ISAR_LC3PLUS_ENC_HANDLE handle, /* i : LC3plus encoder handle */ float **pcm_in, /* i : pointer input samples */ void *bitstream_out /* o : pointer to bitstream frame */ ); #endif -#endif /* IVAS_LC3PLUS_ENC_H */ +#endif /* ISAR_LC3PLUS_ENC_H */ diff --git a/lib_isar/isar_lcld_decoder.c b/lib_isar/isar_lcld_decoder.c index 151d3b2f4b..826e711c55 100644 --- a/lib_isar/isar_lcld_decoder.c +++ b/lib_isar/isar_lcld_decoder.c @@ -106,14 +106,14 @@ struct LCLD_DECODER NoiseGen *psNoiseGen; }; -static void CreateDecodeTable( LCLDDecoder *psLCLDDecoder, int32_t num, const uint16_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ); -static TableNode *CreateTableList( int32_t iReadLength ); +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 TableNode *CreateTableList( const int32_t iReadLength ); static void DeleteTableList( TableList *ptable_list, int32_t iTables ); -static TableNode *GetNextTable( int32_t iIndex, TableList *table_list, TableNode *poParent, int32_t iReadLength, uint32_t *iTablesCreated ); -static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t iCode, int32_t iCodeIndex, int32_t iReadLength, uint32_t *iTables ); -static void CompleteTables( LCLDDecoder *psLCLDDecoder, int32_t n, TableList *ptable_list, int32_t iReadLength, int32_t iTablesCreated ); +static TableNode *GetNextTable( const int32_t iIndex, TableList *table_list, TableNode *poParent, const int32_t iReadLength, uint32_t *iTablesCreated ); +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( int32_t iReadLength ) +static TableNode *CreateTableList( const int32_t iReadLength ) { int32_t n; int32_t iMaxTables; @@ -173,7 +173,7 @@ static void DeleteTableList( TableList *ptable_list, int32_t iTables ) free( ptable_list ); } } -static TableNode *GetNextTable( int32_t iIndex, TableList *table_list, TableNode *poParent, 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; @@ -194,7 +194,7 @@ static TableNode *GetNextTable( int32_t iIndex, TableList *table_list, TableNode return poNextNode; } -static void CompleteTables( LCLDDecoder *psLCLDDecoder, int32_t n, TableList *ptable_list, int32_t iReadLength, 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; @@ -223,7 +223,7 @@ static void CompleteTables( LCLDDecoder *psLCLDDecoder, int32_t n, TableList *pt poNode = poNode->poOrderedNext; } } -static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t iCode, int32_t iCodeIndex, 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; @@ -258,7 +258,7 @@ static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t i } } -static void CreateDecodeTable( LCLDDecoder *psLCLDDecoder, int32_t num, const uint16_t ( *ppuiEncTable )[2], int32_t iSize, 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; @@ -1158,7 +1158,7 @@ static void InvMSCoding( if ( iMSMode == 3 ) { - cplxmult( &fRightReal, &fRightImag, c_afRotRealImag[phaseIdx][0], -c_afRotRealImag[phaseIdx][1] ); + cplxmult_isar( &fRightReal, &fRightImag, c_afRotRealImag[phaseIdx][0], -c_afRotRealImag[phaseIdx][1] ); } pppfReal[0][k][iFBOffset] = fLeftReal; diff --git a/lib_isar/isar_lcld_encoder.c b/lib_isar/isar_lcld_encoder.c index 1e638b91ee..fa8570551d 100644 --- a/lib_isar/isar_lcld_encoder.c +++ b/lib_isar/isar_lcld_encoder.c @@ -35,8 +35,8 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #include #include -#include "isar_lcld_prot.h" -#include "isar_rom_lcld_tables.h" +//#include "isar_lcld_prot.h" +//#include "isar_rom_lcld_tables.h" #include "prot.h" #include "isar_prot.h" #include "wmc_auto.h" @@ -919,7 +919,7 @@ static int32_t MSModeCalculation( /* adjust covariance */ tabIdx = iPhase - PHASE_MIN_VAL; - cplxmult( &fLRCovReal, &fLRCovImag, c_afRotRealImag[tabIdx][0], -c_afRotRealImag[tabIdx][1] ); + cplxmult_isar( &fLRCovReal, &fLRCovImag, c_afRotRealImag[tabIdx][0], -c_afRotRealImag[tabIdx][1] ); /* compute MS prediction coefficient based on adjusted covariance */ fMidEnergyPred = 0.25f * ( fLeftEnergy + fRightEnergy + 2.0f * fLRCovReal ); @@ -1059,7 +1059,7 @@ static int32_t MSModeCalculation( if ( *piMSMode == MS_PRED ) { - cplxmult( &pppfReal[1][k][iFBOffset], &pppfImag[1][k][iFBOffset], c_afRotRealImag[phaseIdx][0], c_afRotRealImag[phaseIdx][1] ); + cplxmult_isar( &pppfReal[1][k][iFBOffset], &pppfImag[1][k][iFBOffset], c_afRotRealImag[phaseIdx][0], c_afRotRealImag[phaseIdx][1] ); } fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); @@ -1166,9 +1166,9 @@ static void QuantizeSpectrumDPCM_Opt( int32_t **ppiQImag, int32_t **ppiSignReal, int32_t **ppiSignImag, - int32_t iNumSubSets, - int32_t iSubSetId, - int32_t *piPredEnable, + const int32_t iNumSubSets, + const int32_t iSubSetId, + const int32_t *piPredEnable, float *pfA1Real, float *pfA1Imag, float *pfPredStateReal, diff --git a/lib_isar/isar_lcld_prot.h b/lib_isar/isar_lcld_prot.h index fefe054798..36075637bd 100644 --- a/lib_isar/isar_lcld_prot.h +++ b/lib_isar/isar_lcld_prot.h @@ -99,11 +99,11 @@ int32_t quantPhase( float phase ); -void cplxmult( +void cplxmult_isar( float *pr1, float *pi1, - float r2, - float i2 + const float r2, + const float i2 ); diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index b183b19f45..3ff35ff73e 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -58,7 +58,7 @@ ivas_error split_renderer_open_lc3plus( const int32_t OutSampleRate, const int16_t num_subframes ); -void ivas_splitBinPreRendClose( +void isar_splitBinPreRendClose( ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend ); void lc3plusTimeAlignCldfbPoseCorr( @@ -91,7 +91,7 @@ ivas_error isar_splitBinLCLDEncOpen( ivas_error isar_splitBinRendPLCOpen( ISAR_SPLIT_REND_PLC_HANDLE *phSplitRendPLC, - int16_t iNumSubSets ); + const int16_t iNumSubSets ); void isar_splitBinRendPLCClose( ISAR_SPLIT_REND_PLC_HANDLE *phSplitRendPLC ); @@ -221,7 +221,7 @@ void Quat2EulerDegree( float *roll /* o : roll */ ); -void ivas_mat_mult_2by2_complex( +void isar_mat_mult_2by2_complex( float in_re1[2][2], float in_im1[2][2], float in_re2[2][2], @@ -249,7 +249,7 @@ void isar_rend_CldfbSplitPreRendProcess( const int16_t low_res_pre_rend_rot, const int16_t ro_md_flag ); -ivas_error ivas_renderMultiTDBinToSplitBinaural( +ivas_error isar_renderMultiTDBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, const IVAS_QUATERNION headPosition, const int32_t SplitRendBitRate, @@ -341,4 +341,4 @@ void isar_init_split_rend_handles( /* clang-format on */ -#endif /* IVAS_PROT_REND_H */ +#endif /* ISAR_PROT_H */ diff --git a/lib_isar/isar_rom_post_rend.c b/lib_isar/isar_rom_post_rend.c index a7ea2eaef5..c8a58b2dc6 100644 --- a/lib_isar/isar_rom_post_rend.c +++ b/lib_isar/isar_rom_post_rend.c @@ -35,10 +35,10 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "cnst.h" -#include "ivas_cnst.h" +//#include "cnst.h" +//#include "ivas_cnst.h" #include "isar_cnst.h" -#include +//#include #include "wmc_auto.h" /* clang-format off */ @@ -155,7 +155,7 @@ const int32_t ivas_split_rend_huff_pred63_consts[ISAR_SPLIT_REND_PRED_63QUANT_PN {31,11,2047}, }; -const int32_t ivas_split_rend_huff_pred31_consts[IVAS_SPLIT_REND_PRED_31QUANT_PNTS][3] = +const int32_t ivas_split_rend_huff_pred31_consts[ISAS_SPLIT_REND_PRED_31QUANT_PNTS][3] = { {-15,10,1020},{-14,10,1021},{-13,9,506},{-12,9,507}, {-11,8,250},{-10,8,251},{-9,7,120},{-8,7,121}, diff --git a/lib_isar/isar_rom_post_rend.h b/lib_isar/isar_rom_post_rend.h index 290539a8d0..03f2141d56 100644 --- a/lib_isar/isar_rom_post_rend.h +++ b/lib_isar/isar_rom_post_rend.h @@ -38,8 +38,8 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "cnst.h" -#include "ivas_cnst.h" +//#include "cnst.h" +#include "isar_cnst.h" #ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------* @@ -59,12 +59,11 @@ extern const float ivas_split_rend_relative_roll_pos_angles_hq[SPLIT_REND_MAX_PI extern const float ivas_split_rend_relative_pos_angles[MAX_HEAD_ROT_POSES][3]; extern const int16_t ivas_split_rend_band_grouping[MAX_SPLIT_REND_MD_BANDS + 1]; extern const int32_t ivas_split_rend_huff_d_consts[ISAR_SPLIT_REND_D_QUANT_PNTS][3]; -extern const int32_t ivas_split_rend_huff_pred63_consts[IVAS_SPLIT_REND_PRED_31QUANT_PNTS][3]; -extern const int32_t ivas_split_rend_huff_pred31_consts[IVAS_SPLIT_REND_PRED_31QUANT_PNTS][3]; +extern const int32_t ivas_split_rend_huff_pred63_consts[ISAS_SPLIT_REND_PRED_31QUANT_PNTS][3]; +extern const int32_t ivas_split_rend_huff_pred31_consts[ISAS_SPLIT_REND_PRED_31QUANT_PNTS][3]; extern const int32_t ivas_split_rend_huff_roll_pred_consts[ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS][3]; extern const int32_t ivas_split_rend_huff_p_d_consts[ISAR_SPLIT_REND_D_QUANT_PNTS][3]; extern const int32_t ivas_split_rend_huff_p_d_diff_consts[ISAR_SPLIT_REND_D_QUANT_PNTS][3]; -extern const int32_t split_rend_brate_tbl[]; #endif #endif diff --git a/lib_isar/isar_splitRendererPLC.c b/lib_isar/isar_splitRendererPLC.c index d2ba0ab591..dd2efc2791 100644 --- a/lib_isar/isar_splitRendererPLC.c +++ b/lib_isar/isar_splitRendererPLC.c @@ -347,7 +347,7 @@ static void adaptive_polar_ext_plc( ivas_error isar_splitBinRendPLCOpen( ISAR_SPLIT_REND_PLC_HANDLE *phSplitRendPLC, - int16_t iNumSubSets ) + const int16_t iNumSubSets ) { ivas_error error; ISAR_SPLIT_REND_PLC_HANDLE hSplitRendPLC; diff --git a/lib_isar/isar_splitRendererPost.c b/lib_isar/isar_splitRendererPost.c index 82fd5f2b31..db3b7b8077 100644 --- a/lib_isar/isar_splitRendererPost.c +++ b/lib_isar/isar_splitRendererPost.c @@ -230,7 +230,7 @@ static int16_t ivas_split_rend_huffman_decode_opt( static void ivas_split_rend_unquant_md( ISAR_BIN_HR_SPLIT_REND_MD_HANDLE hMd, ISAR_SPLIT_REND_POSE_TYPE pose_type, - int16_t real_only, + const int16_t real_only, float fix_pos_rot_mat[][BINAURAL_CHANNELS], const float pred_quant_step ) { @@ -1322,7 +1322,7 @@ static void interpolate_rend_md( { interpolate_pred_matrix( rot_md, sf_idx, band_idx, interp_roll_pose_idx, interp_roll_fact, mix_mat_re3, mix_mat_im3 ); - ivas_mat_mult_2by2_complex( mix_mat_re, mix_mat_im, mix_mat_re3, mix_mat_im3, mix_mat_re1, mix_mat_im1 ); + isar_mat_mult_2by2_complex( mix_mat_re, mix_mat_im, mix_mat_re3, mix_mat_im3, mix_mat_re1, mix_mat_im1 ); for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) { diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index d0918073b9..e22cd8cbc4 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -39,7 +39,7 @@ #endif #include "ivas_prot.h" #include "prot.h" -#include "ivas_cnst.h" +//#include "ivas_cnst.h" #include "isar_rom_post_rend.h" #include "lib_isar_pre_rend.h" #include "isar_prot.h" @@ -152,8 +152,8 @@ static void ComputePredMat( float cov_io_im[][BINAURAL_CHANNELS], float pred_mat_re[][BINAURAL_CHANNELS], float pred_mat_im[][BINAURAL_CHANNELS], - int16_t num_chs, - int16_t real_only ) + const int16_t num_chs, + const int16_t real_only ) { float cov_ii_local_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; float cov_ii_inv_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; @@ -193,7 +193,7 @@ static void ComputePredMat( if ( ivas_is_mat_inv_2by2_complex( cov_ii_local_re, cov_ii_im ) ) { ivas_calc_mat_inv_2by2_complex( cov_ii_local_re, cov_ii_im, cov_ii_inv_re, cov_ii_inv_im ); - ivas_mat_mult_2by2_complex( cov_ii_inv_re, cov_ii_inv_im, cov_io_re, cov_io_im, pred_mat_re, pred_mat_im ); + isar_mat_mult_2by2_complex( cov_ii_inv_re, cov_ii_inv_im, cov_io_re, cov_io_im, pred_mat_re, pred_mat_im ); } else { @@ -238,7 +238,7 @@ static void ComputePostPredCov( float pred_mat_re[][BINAURAL_CHANNELS], float pred_mat_im[][BINAURAL_CHANNELS], float postpred_cov_re[][BINAURAL_CHANNELS], - int16_t num_chs ) + const int16_t num_chs ) { int16_t i, j; float dmx_mat_conj_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; @@ -262,8 +262,8 @@ static void ComputePostPredCov( } /* 2x2 mult */ - ivas_mat_mult_2by2_complex( dmx_mat_conj_re, dmx_mat_conj_im, cov_ii_re, cov_ii_im, temp_mat_re, temp_mat_im ); - ivas_mat_mult_2by2_complex( temp_mat_re, temp_mat_im, pred_mat_re, pred_mat_im, postpred_cov_re, postpred_cov_im ); + isar_mat_mult_2by2_complex( dmx_mat_conj_re, dmx_mat_conj_im, cov_ii_re, cov_ii_im, temp_mat_re, temp_mat_im ); + isar_mat_mult_2by2_complex( temp_mat_re, temp_mat_im, pred_mat_re, pred_mat_im, postpred_cov_re, postpred_cov_im ); for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { @@ -457,7 +457,7 @@ static float GetNormFact( static void ivas_split_rend_huffman_encode( isar_split_rend_huffman_cfg_t *huff_cfg, - int16_t in, + const int16_t in, int32_t *hcode, int32_t *hlen ) { @@ -476,8 +476,8 @@ static void ivas_split_rend_huffman_encode( static void ivas_split_rend_quant_md( ISAR_BIN_HR_SPLIT_REND_MD_HANDLE hMd, - ISAR_SPLIT_REND_POSE_TYPE pose_type, - int16_t real_only, + const ISAR_SPLIT_REND_POSE_TYPE pose_type, + const int16_t real_only, float fix_pos_rot_mat[][BINAURAL_CHANNELS], const float pred_1byquantstep ) { @@ -755,7 +755,7 @@ static void get_base2_bits( } -static void ivas_SplitRenderer_code_md_base2( +static void isar_SplitRenderer_code_md_base2( const ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int16_t num_subframes, @@ -1197,7 +1197,7 @@ static void ivas_SplitRenderer_quant_code( ISAR_SPLIT_REND_BITStream_write_int32( pBits, 0, 1 ); ISAR_SPLIT_REND_BITStream_write_int32( pBits, q, quant_strat_bits ); - ivas_SplitRenderer_code_md_base2( hBinHrSplitPreRend, pMultiBinPoseData, num_subframes, pred_real_bands_yaw[q], pred_imag_bands_yaw[q], + isar_SplitRenderer_code_md_base2( hBinHrSplitPreRend, pMultiBinPoseData, num_subframes, pred_real_bands_yaw[q], pred_imag_bands_yaw[q], pred_quant_pnts_yaw[q], d_bands_yaw[q], bands_pitch[q], pred_real_bands_roll[q], pred_imag_bands_roll[q], pBits ); } @@ -1571,12 +1571,12 @@ ivas_error isar_splitBinPreRendOpen( /*------------------------------------------------------------------------- - * Function ivas_splitBinPreRendClose() + * Function isar_splitBinPreRendClose() * * *------------------------------------------------------------------------*/ -void ivas_splitBinPreRendClose( +void isar_splitBinPreRendClose( ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend ) { if ( ( *hBinHrSplitPreRend ) != NULL ) @@ -1690,13 +1690,13 @@ ivas_error split_renderer_open_lc3plus( config.channels = BINAURAL_CHANNELS; - if ( ( error = IVAS_LC3PLUS_ENC_Open( config, isar_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode, (int16_t) ( config.ivas_frame_duration_us / 1000 ) ), &hSplitRendWrapper->hLc3plusEnc ) ) != IVAS_ERR_OK ) + if ( ( error = ISAR_LC3PLUS_ENC_Open( config, isar_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode, (int16_t) ( config.ivas_frame_duration_us / 1000 ) ), &hSplitRendWrapper->hLc3plusEnc ) ) != IVAS_ERR_OK ) { return error; } /* This returns delay of entire LC3plus chain (enc + dec) */ - if ( ( error = IVAS_LC3PLUS_ENC_GetDelay( hSplitRendWrapper->hLc3plusEnc, &hSplitRendWrapper->lc3plusDelaySamples ) ) != IVAS_ERR_OK ) + if ( ( error = ISAR_LC3PLUS_ENC_GetDelay( hSplitRendWrapper->hLc3plusEnc, &hSplitRendWrapper->lc3plusDelaySamples ) ) != IVAS_ERR_OK ) { return error; } @@ -1766,7 +1766,7 @@ ivas_error splitRendLc3plusEncodeAndWrite( channel_ptrs[i] = in[i]; } - if ( ( error = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( hSplitBin->hLc3plusEnc, &lc3plusBitstreamSize ) ) != IVAS_ERR_OK ) + if ( ( error = ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( hSplitBin->hLc3plusEnc, &lc3plusBitstreamSize ) ) != IVAS_ERR_OK ) { return error; } @@ -1774,7 +1774,7 @@ ivas_error splitRendLc3plusEncodeAndWrite( ISAR_SPLIT_REND_BITStream_write_int32( pBits, isar_get_lc3plus_bitrate_id( SplitRendBitRate ), 8 ); /* Write bitstream */ - if ( ( error = IVAS_LC3PLUS_ENC_Encode( hSplitBin->hLc3plusEnc, channel_ptrs, &pBits->bits_buf[pBits->bits_written / 8] ) ) != IVAS_ERR_OK ) + if ( ( error = ISAR_LC3PLUS_ENC_Encode( hSplitBin->hLc3plusEnc, channel_ptrs, &pBits->bits_buf[pBits->bits_written / 8] ) ) != IVAS_ERR_OK ) { return error; } @@ -1788,12 +1788,12 @@ ivas_error splitRendLc3plusEncodeAndWrite( /*------------------------------------------------------------------------- - * Function ivas_renderMultiTDBinToSplitBinaural() + * Function isar_renderMultiTDBinToSplitBinaural() * * *------------------------------------------------------------------------*/ -ivas_error ivas_renderMultiTDBinToSplitBinaural( +ivas_error isar_renderMultiTDBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, const IVAS_QUATERNION headPosition, const int32_t SplitRendBitRate, @@ -1815,7 +1815,7 @@ ivas_error ivas_renderMultiTDBinToSplitBinaural( int16_t i; int32_t num_slots; - push_wmops( "ivas_renderMultiTDBinToSplitBinaural" ); + push_wmops( "isar_renderMultiTDBinToSplitBinaural" ); error = IVAS_ERR_OK; num_poses = hSplitBin->multiBinPoseData.num_poses; diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index f0eed91999..3bc0c1c526 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -35,13 +35,13 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "ivas_prot.h" -#include "prot.h" -#include "cnst.h" -#include "ivas_cnst.h" -#include "ivas_rom_rend.h" -#include "ivas_rom_com.h" +//#include "prot.h" +//#include "cnst.h" +//#include "ivas_cnst.h" +//#include "ivas_rom_rend.h" +//#include "ivas_rom_com.h" #include "isar_rom_post_rend.h" -#include "ivas_rom_binauralRenderer.h" +//#include "ivas_rom_binauralRenderer.h" #include "lib_isar_post_rend.h" #include "isar_prot.h" #ifdef DEBUGGING @@ -51,12 +51,12 @@ /*------------------------------------------------------------------------- - * Function ivas_mat_mult_2by2_complex() + * Function isar_mat_mult_2by2_complex() * * *------------------------------------------------------------------------*/ -void ivas_mat_mult_2by2_complex( +void isar_mat_mult_2by2_complex( float in_re1[2][2], float in_im1[2][2], float in_re2[2][2], @@ -166,12 +166,12 @@ static int16_t is_idx_present( /*------------------------------------------------------------------------- - * Function ivas_split_huff_get_idx_trav_list() + * Function isar_split_huff_get_idx_trav_list() * * *------------------------------------------------------------------------*/ -static void ivas_split_huff_get_idx_trav_list( +static void isar_split_huff_get_idx_trav_list( int16_t *idx_list, isar_split_rend_huffman_cfg_t *p_huff_cfg ) { @@ -215,40 +215,40 @@ void isar_split_rend_init_huff_cfg( ISAR_BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg ) { pHuff_cfg->pred[0].codebook = &ivas_split_rend_huff_pred31_consts[0][0]; - pHuff_cfg->pred[0].sym_len = IVAS_SPLIT_REND_PRED_31QUANT_PNTS; + pHuff_cfg->pred[0].sym_len = ISAS_SPLIT_REND_PRED_31QUANT_PNTS; isar_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->pred[0] ); - ivas_split_huff_get_idx_trav_list( pHuff_cfg->pred_idx_trav[0], &pHuff_cfg->pred[0] ); + isar_split_huff_get_idx_trav_list( pHuff_cfg->pred_idx_trav[0], &pHuff_cfg->pred[0] ); pHuff_cfg->pred_base2_code_len[0] = (int16_t) ceilf( log2f( pHuff_cfg->pred[0].sym_len ) ); pHuff_cfg->pred[1].codebook = &ivas_split_rend_huff_pred63_consts[0][0]; pHuff_cfg->pred[1].sym_len = ISAR_SPLIT_REND_PRED_63QUANT_PNTS; isar_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->pred[1] ); - ivas_split_huff_get_idx_trav_list( pHuff_cfg->pred_idx_trav[1], &pHuff_cfg->pred[1] ); + isar_split_huff_get_idx_trav_list( pHuff_cfg->pred_idx_trav[1], &pHuff_cfg->pred[1] ); pHuff_cfg->pred_base2_code_len[1] = (int16_t) ceilf( log2f( pHuff_cfg->pred[1].sym_len ) ); pHuff_cfg->pred_roll.codebook = &ivas_split_rend_huff_roll_pred_consts[0][0]; pHuff_cfg->pred_roll.sym_len = ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS; isar_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->pred_roll ); - ivas_split_huff_get_idx_trav_list( pHuff_cfg->pred_roll_idx_trav, &pHuff_cfg->pred_roll ); + isar_split_huff_get_idx_trav_list( pHuff_cfg->pred_roll_idx_trav, &pHuff_cfg->pred_roll ); pHuff_cfg->pred_roll_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->pred_roll.sym_len ) ); pHuff_cfg->gd.codebook = &ivas_split_rend_huff_d_consts[0][0]; pHuff_cfg->gd.sym_len = ISAR_SPLIT_REND_D_QUANT_PNTS; isar_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->gd ); - ivas_split_huff_get_idx_trav_list( pHuff_cfg->gd_idx_trav, &pHuff_cfg->gd ); + isar_split_huff_get_idx_trav_list( pHuff_cfg->gd_idx_trav, &pHuff_cfg->gd ); pHuff_cfg->gd_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->gd.sym_len ) ); pHuff_cfg->p_gd.codebook = &ivas_split_rend_huff_p_d_consts[0][0]; pHuff_cfg->p_gd.sym_len = ISAR_SPLIT_REND_D_QUANT_PNTS; isar_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->p_gd ); - ivas_split_huff_get_idx_trav_list( pHuff_cfg->p_gd_idx_trav, &pHuff_cfg->p_gd ); + isar_split_huff_get_idx_trav_list( pHuff_cfg->p_gd_idx_trav, &pHuff_cfg->p_gd ); pHuff_cfg->p_gd_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->p_gd.sym_len ) ); pHuff_cfg->p_gd_diff.codebook = &ivas_split_rend_huff_p_d_diff_consts[0][0]; pHuff_cfg->p_gd_diff.sym_len = ISAR_SPLIT_REND_D_QUANT_PNTS; isar_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->p_gd_diff ); - ivas_split_huff_get_idx_trav_list( pHuff_cfg->p_gd_diff_idx_trav, &pHuff_cfg->p_gd_diff ); + isar_split_huff_get_idx_trav_list( pHuff_cfg->p_gd_diff_idx_trav, &pHuff_cfg->p_gd_diff ); pHuff_cfg->p_gd_diff_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->p_gd_diff.sym_len ) ); return; @@ -439,7 +439,7 @@ void ISAR_SPLIT_REND_BITStream_write_int32( #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG /*------------------------------------------------------------------------- - * ivas_mat_mult_2by2_complex() + * isar_log_cldfb2wav_data() * * *------------------------------------------------------------------------*/ @@ -640,7 +640,7 @@ int8_t isar_get_lc3plus_bitrate_id( /*------------------------------------------------------------------------- - * Function ivas_mat_mult_2by2_complex() + * Function isar_get_lc3plus_size_from_id() * * *------------------------------------------------------------------------*/ @@ -827,7 +827,7 @@ void isar_split_rend_get_quant_params( pred_1byquantstep_yaw[0] = ISAR_SPLIT_REND_PRED63_1BYQ_STEP; for ( q = 1; q < *num_quant_strats; q++ ) { - pred_quant_pnts_yaw[q] = IVAS_SPLIT_REND_PRED_31QUANT_PNTS; + pred_quant_pnts_yaw[q] = ISAS_SPLIT_REND_PRED_31QUANT_PNTS; pred_quantstep_yaw[q] = ISAR_SPLIT_REND_PRED31_Q_STEP; pred_1byquantstep_yaw[q] = ISAR_SPLIT_REND_PRED31_1BYQ_STEP; } diff --git a/lib_isar/isar_stat.h b/lib_isar/isar_stat.h index ea63379b05..d09f7e909a 100644 --- a/lib_isar/isar_stat.h +++ b/lib_isar/isar_stat.h @@ -38,7 +38,7 @@ #include "options.h" #include "stat_com.h" #include "ivas_stat_com.h" -#include "common_api_types.h" +//#include "common_api_types.h" #ifdef SPLIT_REND_WITH_HEAD_ROT #include "isar_lcld_prot.h" #include "isar_lc3plus_enc.h" @@ -66,7 +66,7 @@ typedef struct float crossfade[L_FRAME48k / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; ISAR_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; -} IVAS_POST_REND_HeadRotData; +} ISAR_POST_REND_HeadRotData; typedef struct { @@ -253,4 +253,4 @@ typedef struct } SPLIT_REND_WRAPPER; #endif -#endif /* IVAS_STAT_REND_H */ +#endif /* ISAR_STAT_H */ diff --git a/lib_isar/lib_isar_post_rend.c b/lib_isar/lib_isar_post_rend.c index 68db053298..25a462a518 100644 --- a/lib_isar/lib_isar_post_rend.c +++ b/lib_isar/lib_isar_post_rend.c @@ -48,12 +48,12 @@ int32_t ISAR_POST_REND_void_func( void ) #else #include "ivas_prot_rend.h" -#include "ivas_cnst.h" -#include "ivas_rom_com.h" -#include "ivas_rom_rend.h" +//#include "ivas_cnst.h" +//#include "ivas_rom_com.h" +//#include "ivas_rom_rend.h" #include #include -#include +//#include #include "wmc_auto.h" @@ -86,7 +86,7 @@ typedef struct const AUDIO_CONFIG *pOutConfig; const LSSETUP_CUSTOM_STRUCT *pCustomLsOut; const EFAP_WRAPPER *pEfapOutWrapper; - const IVAS_POST_REND_HeadRotData *pHeadRotData; + const ISAR_POST_REND_HeadRotData *pHeadRotData; const RENDER_CONFIG_HANDLE *hhRendererConfig; const int16_t *pSplitRendBFI; } rendering_context; @@ -125,7 +125,7 @@ struct ISAR_POST_REND AUDIO_CONFIG inputConfig; AUDIO_CONFIG outputConfig; - IVAS_POST_REND_HeadRotData headRotData; + ISAR_POST_REND_HeadRotData headRotData; int16_t splitRendBFI; int8_t rendererConfigEnabled; @@ -536,7 +536,7 @@ static ivas_error updateSplitPostRendPanGains( } else if ( hRendCfg->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) { - if ( ( error = IVAS_LC3PLUS_DEC_Open( config, + if ( ( error = ISAR_LC3PLUS_DEC_Open( config, &inputSplitPostRend->splitPostRendWrapper.hLc3plusDec ) ) != IVAS_ERR_OK ) { return error; @@ -557,7 +557,7 @@ static ivas_error setRendInputActiveSplitPostRend( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, ISAR_SPLIT_REND_CONFIG_DATA *hRendCfg, - int16_t num_subframes ) + const int16_t num_subframes ) { ivas_error error; rendering_context rendCtx; @@ -608,7 +608,7 @@ static void clearInputSplitRend( if ( inputSplitRend->splitPostRendWrapper.hLc3plusDec != NULL ) { - IVAS_LC3PLUS_DEC_Close( &inputSplitRend->splitPostRendWrapper.hLc3plusDec ); + ISAR_LC3PLUS_DEC_Close( &inputSplitRend->splitPostRendWrapper.hLc3plusDec ); } return; @@ -616,7 +616,7 @@ static void clearInputSplitRend( /*------------------------------------------------------------------------- - * ISAR_POST_REND_Open() + * ISAR_POST_REND_open() * * *------------------------------------------------------------------------*/ @@ -734,7 +734,7 @@ static IVAS_REND_InputId makeInputId( static ivas_error getInputById( ISAR_POST_REND_HANDLE hIvasRend, - IVAS_REND_InputId inputId, + const IVAS_REND_InputId inputId, void **ppInput ) { int32_t inputIndex; @@ -776,7 +776,7 @@ static ivas_error getInputById( } /*-------------------------------------------------------------------* - * IVAS_REND_SetInputGain() + * ISAR_POST_REND_SetInputGain() * * *-------------------------------------------------------------------*/ @@ -1016,7 +1016,7 @@ ivas_error ISAR_POST_REND_GetDelay( if ( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec != NULL ) { int32_t lc3plusDelaySamples; - IVAS_LC3PLUS_DEC_GetDelay( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec, &lc3plusDelaySamples ); + ISAR_LC3PLUS_DEC_GetDelay( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec, &lc3plusDelaySamples ); latency_ns = (int32_t) roundf( lc3plusDelaySamples * 1000000000.f / *timeScale ); } if ( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) @@ -1349,14 +1349,14 @@ static ivas_error splitBinLc3plusDecode( lc3plusBitrateId = ISAR_SPLIT_REND_BITStream_read_int32( bits, 8 ); lc3plusBitstreamSize = isar_get_lc3plus_size_from_id( (int8_t) lc3plusBitrateId, pose_correction, (int16_t) ( hSplitBin->hLc3plusDec->config.ivas_frame_duration_us / 1000 ) ); - if ( ( error = IVAS_LC3PLUS_DEC_Decode( hSplitBin->hLc3plusDec, &bits->bits_buf[bits->bits_read / 8], lc3plusBitstreamSize, channel_ptrs ) ) != IVAS_ERR_OK ) + if ( ( error = ISAR_LC3PLUS_DEC_Decode( hSplitBin->hLc3plusDec, &bits->bits_buf[bits->bits_read / 8], lc3plusBitstreamSize, channel_ptrs ) ) != IVAS_ERR_OK ) { return error; } } else { - if ( ( error = IVAS_LC3PLUS_DEC_Conceal( hSplitBin->hLc3plusDec, channel_ptrs ) ) != IVAS_ERR_OK ) + if ( ( error = ISAR_LC3PLUS_DEC_Conceal( hSplitBin->hLc3plusDec, channel_ptrs ) ) != IVAS_ERR_OK ) { return error; } @@ -1392,7 +1392,7 @@ static ivas_error renderSplitBinauralWithPostRot( float *readPtr, *writePtr; uint32_t ivas_frame_duration_us; int16_t iNumBlocksPerFrame, iNumLCLDIterationsPerFrame; - const IVAS_POST_REND_HeadRotData *pHeadRotData; + const ISAR_POST_REND_HeadRotData *pHeadRotData; isPostRendInputCldfb = 0; push_wmops( "renderSplitBinauralWithPostRot" ); @@ -1678,7 +1678,7 @@ static ivas_error renderActiveInputsSplitBin( /*-------------------------------------------------------------------* - * getSamplesInternal() + * ISAR_POST_REND_getSamples() * * *-------------------------------------------------------------------*/ @@ -1918,7 +1918,14 @@ void ISAR_POST_REND_cldfbSynthesis_wrapper( return; } -ivas_error IVAS_REND_SetSplitRendBitstreamHeader( + +/*-------------------------------------------------------------------* + * ISAR_REND_SetSplitRendBitstreamHeader() + * + * + *-------------------------------------------------------------------*/ + +ivas_error ISAR_REND_SetSplitRendBitstreamHeader( ISAR_POST_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const ISAR_SPLIT_REND_CODEC codec, /* o: codec setting */ const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection, /* o: pose correction mode */ diff --git a/lib_isar/lib_isar_post_rend.h b/lib_isar/lib_isar_post_rend.h index e6952f79f9..b9dce8e02d 100644 --- a/lib_isar/lib_isar_post_rend.h +++ b/lib_isar/lib_isar_post_rend.h @@ -34,7 +34,8 @@ #define LIB_ISAR_POST_REND_H #include -#include "isar_stat.h" +#include "common_api_types.h" +//#include "isar_stat.h" #ifndef SPLIT_REND_WITH_HEAD_ROT @@ -240,7 +241,7 @@ void ISAR_POST_REND_Close( ISAR_POST_REND_HANDLE* phIvasRend /* i/o: Pointer to renderer handle */ ); -ivas_error IVAS_REND_SetSplitRendBitstreamHeader( +ivas_error ISAR_REND_SetSplitRendBitstreamHeader( ISAR_POST_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const ISAR_SPLIT_REND_CODEC codec, /* o: codec setting */ const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection, /* o: pose correction mode */ diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index 1e4e143a83..16ed7e6524 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -71,7 +71,7 @@ int32_t ISAR_PRE_REND_void_func( void ) *-------------------------------------------------------------------*/ /*------------------------------------------------------------------------- - * Function isar_pre_rend_open() + * Function ISAR_PRE_REND_open() * * *------------------------------------------------------------------------*/ @@ -196,7 +196,7 @@ ivas_error ISAR_PRE_REND_open( } /*------------------------------------------------------------------------- - * Function isar_pre_rend_close() + * Function ISAR_PRE_REND_close() * * *------------------------------------------------------------------------*/ @@ -209,7 +209,7 @@ void ISAR_PRE_REND_close( if ( hSplitBinRend->hBinHrSplitPreRend != NULL ) { - ivas_splitBinPreRendClose( &hSplitBinRend->hBinHrSplitPreRend ); + isar_splitBinPreRendClose( &hSplitBinRend->hBinHrSplitPreRend ); } if ( hSplitBinRend->hSplitBinLCLDEnc != NULL ) @@ -245,7 +245,7 @@ void ISAR_PRE_REND_close( if ( hSplitBinRend->hLc3plusEnc != NULL ) { - IVAS_LC3PLUS_ENC_Close( &hSplitBinRend->hLc3plusEnc ); + ISAR_LC3PLUS_ENC_Close( &hSplitBinRend->hLc3plusEnc ); } for ( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ++i ) @@ -274,7 +274,7 @@ void ISAR_PRE_REND_close( } /*-------------------------------------------------------------------------* - * isar_pre_rend_GetMultiBinPoseData() + * ISAR_PRE_REND_GetMultiBinPoseData() * * *-------------------------------------------------------------------------*/ @@ -288,7 +288,7 @@ void ISAR_PRE_REND_GetMultiBinPoseData( } /*------------------------------------------------------------------------- - * Function isar_pre_rend_MultiBinToSplitBinaural() + * Function ISAR_PRE_REND_MultiBinToSplitBinaural() * * *------------------------------------------------------------------------*/ @@ -325,7 +325,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( { /*TD input*/ /*if CLDFB handles have been allocated then assume valid multi binaural input in out[][] buffer and perform CLDFB analysis*/ - error = ivas_renderMultiTDBinToSplitBinaural( hSplitBin, headPosition, SplitRendBitRate, codec_frame_size_ms, pBits, max_bands, output, low_res_pre_rend_rot, pcm_out_flag, ro_md_flag ); + error = isar_renderMultiTDBinToSplitBinaural( hSplitBin, headPosition, SplitRendBitRate, codec_frame_size_ms, pBits, max_bands, output, low_res_pre_rend_rot, pcm_out_flag, ro_md_flag ); pop_wmops(); return error; diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index e2e189060f..0363ea645b 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -2036,8 +2036,8 @@ ivas_error ivas_rend_crendProcessSplitBin( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, - DECODER_CONFIG_HANDLE hDecoderConfig, - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, + const DECODER_CONFIG_HANDLE hDecoderConfig, + const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, const IVAS_OUTPUT_SETUP_HANDLE hIntSetup, EFAP_HANDLE hEFAPdata, float *output[], @@ -2166,9 +2166,8 @@ ivas_error ivas_rend_crendProcessSplitBin( return IVAS_ERR_OK; } -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT + /*-----------------------------------------------------------------------------------------* * Function ivas_rend_crend_ProcessSubframesSplitBin() * diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index a15654155a..b1d682f344 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -99,8 +99,9 @@ static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ static void ivas_dirac_dec_decorrelate_slot( DIRAC_DEC_BIN_HANDLE hDiracDecBin, const int16_t num_freq_bands, const int16_t slot, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decRe[][CLDFB_NO_CHANNELS_MAX], float decIm[][CLDFB_NO_CHANNELS_MAX] ); #ifdef SPLIT_REND_WITH_HEAD_ROT -static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t subframe, float *subFrameTotalEne, float *IIReneLimiter ); -static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked, const float *subFrameTotalEne, const float *IIReneLimiter, const MASA_ISM_DATA_HANDLE hMasaIsmData ); +static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, const SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, const PARAMBIN_REND_CONFIG_HANDLE hConfig, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t subframe, float *subFrameTotalEne, float *IIReneLimiter ); + +static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, const SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, const PARAMBIN_REND_CONFIG_HANDLE hConfig, float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked, const float *subFrameTotalEne, const float *IIReneLimiter, const MASA_ISM_DATA_HANDLE hMasaIsmData ); #else static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, PARAMBIN_REND_CONFIG_HANDLE hConfig, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked, const MASA_ISM_DATA_HANDLE hMasaIsmData ); #endif @@ -984,8 +985,8 @@ static void ivas_dirac_dec_decorrelate_slot( #ifdef SPLIT_REND_WITH_HEAD_ROT static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, - PARAMBIN_REND_CONFIG_HANDLE hConfig, + const SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, + const PARAMBIN_REND_CONFIG_HANDLE hConfig, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t subframe, @@ -1148,8 +1149,8 @@ static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices( static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( DIRAC_DEC_BIN_HANDLE hDiracDecBin, - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, - PARAMBIN_REND_CONFIG_HANDLE hConfig, + const SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, + const PARAMBIN_REND_CONFIG_HANDLE hConfig, float Rmat[3][3], const int16_t subframe, const int16_t isHeadtracked, diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 1b2cfbacdb..cb002c19ba 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -36,9 +36,6 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_prot_rend.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_prot.h" -#endif #include #include "ivas_rom_com.h" #ifdef DEBUGGING diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 6d4d98162f..c9331ff778 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1518,7 +1518,7 @@ ivas_error ObjRenderIvasFrame_splitBinaural( ivas_error ivas_td_binaural_renderer_sf_splitBinaural( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[], /* i/o: SCE channels / Binaural synthesis */ - int16_t nSamplesRendered /* i : number of samples to render */ + const int16_t nSamplesRendered /* i : number of samples to render */ ); ivas_error ivas_rend_crendProcessSubframesSplitBin( @@ -1542,8 +1542,8 @@ ivas_error ivas_rend_crendProcessSplitBin( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, - DECODER_CONFIG_HANDLE hDecoderConfig, - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, + const DECODER_CONFIG_HANDLE hDecoderConfig, + const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, const IVAS_OUTPUT_SETUP_HANDLE hIntSetup, EFAP_HANDLE hEFAPdata, float *output[], @@ -1584,15 +1584,6 @@ ivas_error ivas_rend_openCldfbRend( const int32_t output_Fs ); -void ivas_mat_mult_2by2_complex( - float in_re1[2][2], - float in_im1[2][2], - float in_re2[2][2], - float in_im2[2][2], - float out_re2[2][2], - float out_im2[2][2] -); - void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend ); diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index e39c438137..9988962dbe 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -137,12 +137,4 @@ extern const float ls_conversion_cicpX_stereo[12][2]; extern const LS_CONVERSION_MAPPING ls_conversion_mapping[]; -#ifdef SPLIT_REND_WITH_HEAD_ROT -/*----------------------------------------------------------------------------------* - * Split binaural rendering ROM tables - *----------------------------------------------------------------------------------*/ - -extern const int32_t split_rend_brate_tbl[]; -#endif - #endif /* IVAS_ROM_REND_H */ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index e3560d11fc..da34f618bd 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -41,10 +41,10 @@ #include "common_api_types.h" #include "isar_stat.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -#include "stat_com.h" -#include "isar_lcld_prot.h" -#include "isar_lc3plus_enc.h" -#include "isar_lc3plus_dec.h" +//#include "stat_com.h" +//#include "isar_lcld_prot.h" +//#include "isar_lc3plus_enc.h" +//#include "isar_lc3plus_dec.h" #endif diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 4690235a31..ef3428e3f9 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7520,7 +7520,7 @@ ivas_error IVAS_REND_SetIsmMetadataDelay( static ivas_error getSamplesInternal( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ #ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */, + IVAS_REND_AudioBuffer outAudio, /* i/o: buffer for output audio */ IVAS_REND_BitstreamBuffer *hBits /*i/o: buffer for input/output bitstream. Needed in split rendering mode*/ #else IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ @@ -7704,7 +7704,7 @@ static ivas_error getSamplesInternal( } if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, - &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag ) ) != IVAS_ERR_OK ) + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_util/split_rend_bfi_file_reader.c b/lib_util/split_rend_bfi_file_reader.c index 25fade1878..011071221b 100644 --- a/lib_util/split_rend_bfi_file_reader.c +++ b/lib_util/split_rend_bfi_file_reader.c @@ -34,8 +34,8 @@ #include "options.h" #include "split_rend_bfi_file_reader.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -#include -#include +//#include +//#include #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 4e980012a5..23af81161e 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -34,13 +34,13 @@ #include "options.h" #include "split_render_file_read_write.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -#include +//#include #include -#include -#include -#include "cmdl_tools.h" +//#include +//#include +//#include "cmdl_tools.h" #include "prot.h" -#include "ivas_cnst.h" +//#include "ivas_cnst.h" /*------------------------------------------------------------------------------------------* -- GitLab From b1dbfa216ef37045e1acf0be89a3ba73f5c1c58f Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 23 Apr 2024 15:09:18 +0200 Subject: [PATCH 2/6] cleaning of unused includes --- lib_isar/isar_MSPred.c | 1 - lib_isar/isar_lc3plus_dec.c | 4 ++-- lib_isar/isar_lc3plus_dec.h | 2 +- lib_isar/isar_lcld_encoder.c | 2 -- lib_isar/isar_rom_post_rend.c | 3 --- lib_isar/isar_rom_post_rend.h | 2 +- lib_isar/isar_splitRendererPre.c | 1 - lib_isar/isar_splitRenderer_utils.c | 6 ------ lib_isar/isar_stat.h | 2 +- lib_isar/lib_isar_post_rend.c | 4 ---- lib_isar/lib_isar_post_rend.h | 2 +- lib_rend/ivas_stat_rend.h | 6 ------ lib_rend/lib_rend.c | 2 +- lib_util/split_rend_bfi_file_reader.c | 2 -- lib_util/split_render_file_read_write.c | 5 ----- 15 files changed, 7 insertions(+), 37 deletions(-) diff --git a/lib_isar/isar_MSPred.c b/lib_isar/isar_MSPred.c index 0f67d2196f..81c2ef9e95 100644 --- a/lib_isar/isar_MSPred.c +++ b/lib_isar/isar_MSPred.c @@ -33,7 +33,6 @@ #include "options.h" #include #ifdef SPLIT_REND_WITH_HEAD_ROT -//#include "isar_rom_lcld_tables.h" #include "isar_lcld_prot.h" #include "isar_prot.h" #include "wmc_auto.h" diff --git a/lib_isar/isar_lc3plus_dec.c b/lib_isar/isar_lc3plus_dec.c index 8a890915eb..7ca5dda48e 100644 --- a/lib_isar/isar_lc3plus_dec.c +++ b/lib_isar/isar_lc3plus_dec.c @@ -249,12 +249,12 @@ ivas_error ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( /*------------------------------------------------------------------------- - * IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix() + * ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix() * * *------------------------------------------------------------------------*/ -ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( +ivas_error ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( ISAR_LC3PLUS_DEC_HANDLE handle, /* i : LC3plus decoder handle */ int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] ) { diff --git a/lib_isar/isar_lc3plus_dec.h b/lib_isar/isar_lc3plus_dec.h index ed0960a811..6435a8e747 100644 --- a/lib_isar/isar_lc3plus_dec.h +++ b/lib_isar/isar_lc3plus_dec.h @@ -39,7 +39,7 @@ #include "lc3.h" #include "ivas_error.h" #include "isar_lc3plus_common.h" -//#include "ivas_cnst.h" + typedef enum { diff --git a/lib_isar/isar_lcld_encoder.c b/lib_isar/isar_lcld_encoder.c index fa8570551d..4a036643c9 100644 --- a/lib_isar/isar_lcld_encoder.c +++ b/lib_isar/isar_lcld_encoder.c @@ -35,8 +35,6 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #include #include -//#include "isar_lcld_prot.h" -//#include "isar_rom_lcld_tables.h" #include "prot.h" #include "isar_prot.h" #include "wmc_auto.h" diff --git a/lib_isar/isar_rom_post_rend.c b/lib_isar/isar_rom_post_rend.c index c8a58b2dc6..4f64e66dd3 100644 --- a/lib_isar/isar_rom_post_rend.c +++ b/lib_isar/isar_rom_post_rend.c @@ -35,10 +35,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -//#include "cnst.h" -//#include "ivas_cnst.h" #include "isar_cnst.h" -//#include #include "wmc_auto.h" /* clang-format off */ diff --git a/lib_isar/isar_rom_post_rend.h b/lib_isar/isar_rom_post_rend.h index 03f2141d56..40cac13cb9 100644 --- a/lib_isar/isar_rom_post_rend.h +++ b/lib_isar/isar_rom_post_rend.h @@ -38,9 +38,9 @@ #ifdef DEBUGGING #include "debug.h" #endif -//#include "cnst.h" #include "isar_cnst.h" + #ifdef SPLIT_REND_WITH_HEAD_ROT /*----------------------------------------------------------------------* * Binuaral split rendering ROM tables diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index e22cd8cbc4..87631de01b 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -39,7 +39,6 @@ #endif #include "ivas_prot.h" #include "prot.h" -//#include "ivas_cnst.h" #include "isar_rom_post_rend.h" #include "lib_isar_pre_rend.h" #include "isar_prot.h" diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index 3bc0c1c526..f7b8d43fd9 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -35,13 +35,7 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #include #include "ivas_prot.h" -//#include "prot.h" -//#include "cnst.h" -//#include "ivas_cnst.h" -//#include "ivas_rom_rend.h" -//#include "ivas_rom_com.h" #include "isar_rom_post_rend.h" -//#include "ivas_rom_binauralRenderer.h" #include "lib_isar_post_rend.h" #include "isar_prot.h" #ifdef DEBUGGING diff --git a/lib_isar/isar_stat.h b/lib_isar/isar_stat.h index d09f7e909a..e43ac88cce 100644 --- a/lib_isar/isar_stat.h +++ b/lib_isar/isar_stat.h @@ -38,13 +38,13 @@ #include "options.h" #include "stat_com.h" #include "ivas_stat_com.h" -//#include "common_api_types.h" #ifdef SPLIT_REND_WITH_HEAD_ROT #include "isar_lcld_prot.h" #include "isar_lc3plus_enc.h" #include "isar_lc3plus_dec.h" #include "isar_cnst.h" + /*-------------------------------------------------------------------* * ISAR post rend constants *-------------------------------------------------------------------*/ diff --git a/lib_isar/lib_isar_post_rend.c b/lib_isar/lib_isar_post_rend.c index 25a462a518..5815f5b251 100644 --- a/lib_isar/lib_isar_post_rend.c +++ b/lib_isar/lib_isar_post_rend.c @@ -48,12 +48,8 @@ int32_t ISAR_POST_REND_void_func( void ) #else #include "ivas_prot_rend.h" -//#include "ivas_cnst.h" -//#include "ivas_rom_com.h" -//#include "ivas_rom_rend.h" #include #include -//#include #include "wmc_auto.h" diff --git a/lib_isar/lib_isar_post_rend.h b/lib_isar/lib_isar_post_rend.h index b9dce8e02d..d53ae0c7d3 100644 --- a/lib_isar/lib_isar_post_rend.h +++ b/lib_isar/lib_isar_post_rend.h @@ -35,7 +35,7 @@ #include #include "common_api_types.h" -//#include "isar_stat.h" + #ifndef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index da34f618bd..00238a2035 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -40,12 +40,6 @@ #include "stat_com.h" /* Note: Currently needed for CLDFB. */ #include "common_api_types.h" #include "isar_stat.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT -//#include "stat_com.h" -//#include "isar_lcld_prot.h" -//#include "isar_lc3plus_enc.h" -//#include "isar_lc3plus_dec.h" -#endif /*----------------------------------------------------------------------------------* diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index ef3428e3f9..50cb3cc001 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7704,7 +7704,7 @@ static ivas_error getSamplesInternal( } if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, - &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag ) ) != IVAS_ERR_OK ) + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_util/split_rend_bfi_file_reader.c b/lib_util/split_rend_bfi_file_reader.c index 011071221b..9ca1000770 100644 --- a/lib_util/split_rend_bfi_file_reader.c +++ b/lib_util/split_rend_bfi_file_reader.c @@ -34,8 +34,6 @@ #include "options.h" #include "split_rend_bfi_file_reader.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -//#include -//#include #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 23af81161e..714467b118 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -34,13 +34,8 @@ #include "options.h" #include "split_render_file_read_write.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -//#include #include -//#include -//#include -//#include "cmdl_tools.h" #include "prot.h" -//#include "ivas_cnst.h" /*------------------------------------------------------------------------------------------* -- GitLab From 3514191ea67c8a42469e87b809056235874c6507 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 23 Apr 2024 15:15:29 +0200 Subject: [PATCH 3/6] fix typo in constant name --- lib_isar/isar_cnst.h | 6 +++--- lib_isar/isar_rom_post_rend.c | 2 +- lib_isar/isar_rom_post_rend.h | 4 ++-- lib_isar/isar_splitRenderer_utils.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib_isar/isar_cnst.h b/lib_isar/isar_cnst.h index a5492b638e..c9391e37bb 100644 --- a/lib_isar/isar_cnst.h +++ b/lib_isar/isar_cnst.h @@ -80,7 +80,7 @@ typedef enum #define ISAR_SPLIT_REND_NUM_QUANT_STRATS 4 #define ISAR_SPLIT_REND_PRED_63QUANT_PNTS 63 -#define ISAS_SPLIT_REND_PRED_31QUANT_PNTS 31 +#define ISAR_SPLIT_REND_PRED_31QUANT_PNTS 31 #define ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS 31 #define ISAR_SPLIT_REND_D_QUANT_PNTS 15 #define ISAR_SPLIT_REND_PRED_MIN_VAL -1.4f @@ -94,8 +94,8 @@ typedef enum #define ISAR_SPLIT_REND_PRED_ROLL_Q_STEP ( ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) / ( ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS - 1 ) ) #define ISAR_SPLIT_REND_PRED_ROLL_1BYQ_STEP ( ( ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS - 1 ) / ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) ) -#define ISAR_SPLIT_REND_PRED31_Q_STEP ( ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) / ( ISAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) ) -#define ISAR_SPLIT_REND_PRED31_1BYQ_STEP ( ( ISAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) / ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) ) +#define ISAR_SPLIT_REND_PRED31_Q_STEP ( ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) / ( ISAR_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) ) +#define ISAR_SPLIT_REND_PRED31_1BYQ_STEP ( ( ISAR_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) / ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) ) #define ISAR_SPLIT_REND_PRED63_Q_STEP ( ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) / ( ISAR_SPLIT_REND_PRED_63QUANT_PNTS - 1 ) ) #define ISAR_SPLIT_REND_PRED63_1BYQ_STEP ( ( ISAR_SPLIT_REND_PRED_63QUANT_PNTS - 1 ) / ( ISAR_SPLIT_REND_PRED_MAX_VAL - ISAR_SPLIT_REND_PRED_MIN_VAL ) ) diff --git a/lib_isar/isar_rom_post_rend.c b/lib_isar/isar_rom_post_rend.c index 4f64e66dd3..51a0252bc3 100644 --- a/lib_isar/isar_rom_post_rend.c +++ b/lib_isar/isar_rom_post_rend.c @@ -152,7 +152,7 @@ const int32_t ivas_split_rend_huff_pred63_consts[ISAR_SPLIT_REND_PRED_63QUANT_PN {31,11,2047}, }; -const int32_t ivas_split_rend_huff_pred31_consts[ISAS_SPLIT_REND_PRED_31QUANT_PNTS][3] = +const int32_t ivas_split_rend_huff_pred31_consts[ISAR_SPLIT_REND_PRED_31QUANT_PNTS][3] = { {-15,10,1020},{-14,10,1021},{-13,9,506},{-12,9,507}, {-11,8,250},{-10,8,251},{-9,7,120},{-8,7,121}, diff --git a/lib_isar/isar_rom_post_rend.h b/lib_isar/isar_rom_post_rend.h index 40cac13cb9..9f570d4789 100644 --- a/lib_isar/isar_rom_post_rend.h +++ b/lib_isar/isar_rom_post_rend.h @@ -59,8 +59,8 @@ extern const float ivas_split_rend_relative_roll_pos_angles_hq[SPLIT_REND_MAX_PI extern const float ivas_split_rend_relative_pos_angles[MAX_HEAD_ROT_POSES][3]; extern const int16_t ivas_split_rend_band_grouping[MAX_SPLIT_REND_MD_BANDS + 1]; extern const int32_t ivas_split_rend_huff_d_consts[ISAR_SPLIT_REND_D_QUANT_PNTS][3]; -extern const int32_t ivas_split_rend_huff_pred63_consts[ISAS_SPLIT_REND_PRED_31QUANT_PNTS][3]; -extern const int32_t ivas_split_rend_huff_pred31_consts[ISAS_SPLIT_REND_PRED_31QUANT_PNTS][3]; +extern const int32_t ivas_split_rend_huff_pred63_consts[ISAR_SPLIT_REND_PRED_31QUANT_PNTS][3]; +extern const int32_t ivas_split_rend_huff_pred31_consts[ISAR_SPLIT_REND_PRED_31QUANT_PNTS][3]; extern const int32_t ivas_split_rend_huff_roll_pred_consts[ISAR_SPLIT_REND_ROLL_PRED_QUANT_PNTS][3]; extern const int32_t ivas_split_rend_huff_p_d_consts[ISAR_SPLIT_REND_D_QUANT_PNTS][3]; extern const int32_t ivas_split_rend_huff_p_d_diff_consts[ISAR_SPLIT_REND_D_QUANT_PNTS][3]; diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index f7b8d43fd9..7b4a766df1 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -209,7 +209,7 @@ void isar_split_rend_init_huff_cfg( ISAR_BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg ) { pHuff_cfg->pred[0].codebook = &ivas_split_rend_huff_pred31_consts[0][0]; - pHuff_cfg->pred[0].sym_len = ISAS_SPLIT_REND_PRED_31QUANT_PNTS; + pHuff_cfg->pred[0].sym_len = ISAR_SPLIT_REND_PRED_31QUANT_PNTS; isar_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->pred[0] ); isar_split_huff_get_idx_trav_list( pHuff_cfg->pred_idx_trav[0], &pHuff_cfg->pred[0] ); pHuff_cfg->pred_base2_code_len[0] = (int16_t) ceilf( log2f( pHuff_cfg->pred[0].sym_len ) ); @@ -821,7 +821,7 @@ void isar_split_rend_get_quant_params( pred_1byquantstep_yaw[0] = ISAR_SPLIT_REND_PRED63_1BYQ_STEP; for ( q = 1; q < *num_quant_strats; q++ ) { - pred_quant_pnts_yaw[q] = ISAS_SPLIT_REND_PRED_31QUANT_PNTS; + pred_quant_pnts_yaw[q] = ISAR_SPLIT_REND_PRED_31QUANT_PNTS; pred_quantstep_yaw[q] = ISAR_SPLIT_REND_PRED31_Q_STEP; pred_1byquantstep_yaw[q] = ISAR_SPLIT_REND_PRED31_1BYQ_STEP; } -- GitLab From 549a18dc68dd5794991b042f0757a604105aab6d Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 23 Apr 2024 15:35:11 +0200 Subject: [PATCH 4/6] build fixes --- lib_isar/isar_lc3plus_dec.h | 1 + lib_isar/isar_rom_lcld_tables.h | 6 +- .../lc3plus/ivas_lc3plus_unit_test.c | 82 +++++++++---------- 3 files changed, 45 insertions(+), 44 deletions(-) diff --git a/lib_isar/isar_lc3plus_dec.h b/lib_isar/isar_lc3plus_dec.h index 6435a8e747..576c576959 100644 --- a/lib_isar/isar_lc3plus_dec.h +++ b/lib_isar/isar_lc3plus_dec.h @@ -38,6 +38,7 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #include "lc3.h" #include "ivas_error.h" +#include "ivas_cnst.h" #include "isar_lc3plus_common.h" diff --git a/lib_isar/isar_rom_lcld_tables.h b/lib_isar/isar_rom_lcld_tables.h index f2918fac01..cfad1b7fc3 100644 --- a/lib_isar/isar_rom_lcld_tables.h +++ b/lib_isar/isar_rom_lcld_tables.h @@ -30,8 +30,8 @@ *******************************************************************************************************/ -#ifndef _ISAR_ROM_LCLD_TABLES_H_ -#define _ISAR_ROM_LCLD_TABLES_H_ +#ifndef ISAR_ROM_LCLD_TABLES_H +#define ISAR_ROM_LCLD_TABLES_H #include #include "options.h" @@ -194,4 +194,4 @@ extern const uint32_t c_aaiRMSEnvHuffEnc[64][2]; extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; #endif /*SPLIT_REND_WITH_HEAD_ROT*/ -#endif /* _TABLES_H_ */ +#endif /* ISAR_ROM_LCLD_TABLES_H_ */ diff --git a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c index 678e7e1ef5..30f6754863 100644 --- a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c +++ b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c @@ -50,13 +50,13 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config ) int32_t decDelay = -1; ISAR_LC3PLUS_ENC_HANDLE encHandle; - err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, bps, &encHandle ); if ( IVAS_ERR_OK != err ) { return err; } - err = IVAS_LC3PLUS_ENC_GetDelay( encHandle, &encDelay ); + err = ISAR_LC3PLUS_ENC_GetDelay( encHandle, &encDelay ); if ( IVAS_ERR_OK != err ) { return err; @@ -77,21 +77,21 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config ) pcm_in[1] = pcm_in_ch2; int32_t bitstreamSizePerIvasFrame = 0; - err = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); + err = ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); if ( IVAS_ERR_OK != err ) return err; uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); - err = IVAS_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); + err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); if ( IVAS_ERR_OK != err ) return err; - IVAS_LC3PLUS_ENC_Close( &encHandle ); + ISAR_LC3PLUS_ENC_Close( &encHandle ); /* decode one frame */ ISAR_LC3PLUS_DEC_HANDLE decHandle; - err = IVAS_LC3PLUS_DEC_Open( config, + err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING 1 /*caching enabled*/, #endif @@ -101,7 +101,7 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config ) return err; } - err = IVAS_LC3PLUS_DEC_GetDelay( decHandle, &decDelay ); + err = ISAR_LC3PLUS_DEC_GetDelay( decHandle, &decDelay ); if ( IVAS_ERR_OK != err ) { return err; @@ -121,25 +121,25 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config ) pcm_out[0] = pcm_out_ch1; pcm_out[1] = pcm_out_ch2; - err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + err = ISAR_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; } - err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + err = ISAR_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; } - IVAS_LC3PLUS_DEC_Close( &decHandle ); + ISAR_LC3PLUS_DEC_Close( &decHandle ); free( bitstream_out ); return 0; @@ -153,13 +153,13 @@ static int openCloseEncoder( void ) uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; - err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, bps, &encHandle ); if ( IVAS_ERR_OK != err ) { return err; } - IVAS_LC3PLUS_ENC_Close( &encHandle ); + ISAR_LC3PLUS_ENC_Close( &encHandle ); return 0; } @@ -172,7 +172,7 @@ static int tryOpenEncoderWithInvalidBitrate( void ) uint32_t invalid_low_bps = 8; ISAR_LC3PLUS_ENC_HANDLE encHandle; - err = IVAS_LC3PLUS_ENC_Open( config, invalid_high_bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, invalid_high_bps, &encHandle ); /* setting an invalid bitrate should trigger an error - which is what we expect */ if ( IVAS_ERR_LC3PLUS_INVALID_BITRATE != err ) { @@ -195,7 +195,7 @@ static int tryOpenEncoderWithInvalidFrameDuration( void ) uint32_t bps = 320000; ISAR_LC3PLUS_ENC_HANDLE encHandle; - err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, bps, &encHandle ); /* setting an invalid fame duration should trigger an error - which is what we expect */ if ( IVAS_ERR_OK == err ) { @@ -212,7 +212,7 @@ static int tryOpenEncoderWithInvalidSampleRate( void ) uint32_t bps = 320000; ISAR_LC3PLUS_ENC_HANDLE encHandle; - err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, bps, &encHandle ); /* setting an invalid sample rate should trigger an error - which is what we expect */ if ( IVAS_ERR_OK == err ) { @@ -238,11 +238,11 @@ static int tryCallEncoderApiWithInvalidParams( void ) pcm_in[0] = pcm_in_ch1; uint8_t bitstream_out[1200]; - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_GetDelay( invalidEncHandle, invalidDelayInSamples ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_GetDelay( invalidEncHandle, &delayInSamples ) ) + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_GetDelay( invalidEncHandle, invalidDelayInSamples ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_GetDelay( invalidEncHandle, &delayInSamples ) ) { return 1; } - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( invalidEncHandle, invalidBsSize ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( invalidEncHandle, &bsSize ) ) + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( invalidEncHandle, invalidBsSize ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( invalidEncHandle, &bsSize ) ) { return 1; } @@ -251,7 +251,7 @@ static int tryCallEncoderApiWithInvalidParams( void ) { return 1; } - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out ) ) + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out ) ) { return 1; } @@ -277,17 +277,17 @@ static int tryCallDecoderApiWithInvalidParams( void ) pcm_out[0] = pcm_out_ch1; uint8_t bitstream_in[1200]; - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_GetDelay( invalidDecHandle, invalidDelayInSamples ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_GetDelay( invalidDecHandle, &delayInSamples ) ) + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_GetDelay( invalidDecHandle, invalidDelayInSamples ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_GetDelay( invalidDecHandle, &delayInSamples ) ) { return 1; } - IVAS_LC3PLUS_DEC_Close( &invalidDecHandle ); - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, invalidBitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, invalidBitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, bitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, bitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, invalidBitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, invalidBitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, bitstream_in_size, pcm_out ) ) + ISAR_LC3PLUS_DEC_Close( &invalidDecHandle ); + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, invalidBitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, invalidBitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, bitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, bitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, invalidBitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, invalidBitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, bitstream_in_size, pcm_out ) ) { return 1; } - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Conceal( invalidDecHandle, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Conceal( invalidDecHandle, pcm_out ) ) + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Conceal( invalidDecHandle, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_DEC_Conceal( invalidDecHandle, pcm_out ) ) { return 1; } @@ -300,7 +300,7 @@ static int openCloseDecoderWithCaching( void ) LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; ISAR_LC3PLUS_DEC_HANDLE decHandle; - err = IVAS_LC3PLUS_DEC_Open( config, + err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING 1 /*caching enabled*/, #endif @@ -310,7 +310,7 @@ static int openCloseDecoderWithCaching( void ) return err; } - IVAS_LC3PLUS_DEC_Close( &decHandle ); + ISAR_LC3PLUS_DEC_Close( &decHandle ); return 0; } @@ -320,7 +320,7 @@ static int openCloseDecoderWithoutCaching( void ) LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; ISAR_LC3PLUS_DEC_HANDLE decHandle; - err = IVAS_LC3PLUS_DEC_Open( config, + err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING 1 /*caching enabled*/, #endif @@ -330,7 +330,7 @@ static int openCloseDecoderWithoutCaching( void ) return err; } - IVAS_LC3PLUS_DEC_Close( &decHandle ); + ISAR_LC3PLUS_DEC_Close( &decHandle ); return 0; } @@ -342,7 +342,7 @@ static int tryOpenDecoderWithInvalidFrameDuration( void ) config.lc3plus_frame_duration_us = 1234; /*unsupported frame duration*/ ISAR_LC3PLUS_DEC_HANDLE decHandle; - err = IVAS_LC3PLUS_DEC_Open( config, + err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING 1 /*caching enabled*/, #endif @@ -362,7 +362,7 @@ static int tryOpenDecoderWithInvalidSampleRate( void ) config.samplerate = 1234; /*unsupported sample rate*/ ISAR_LC3PLUS_DEC_HANDLE decHandle; - err = IVAS_LC3PLUS_DEC_Open( config, + err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING 1 /*caching enabled*/, #endif @@ -382,7 +382,7 @@ static int encodeOneFrame( void ) uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; - err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, bps, &encHandle ); if ( IVAS_ERR_OK != err ) return err; @@ -394,17 +394,17 @@ static int encodeOneFrame( void ) pcm[0] = pcm_ch1; int32_t bitstreamSizePerIvasFrame = 0; - err = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); + err = ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); if ( IVAS_ERR_OK != err ) return err; uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); - err = IVAS_LC3PLUS_ENC_Encode( encHandle, pcm, bitstream_out ); + err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm, bitstream_out ); if ( IVAS_ERR_OK != err ) return err; - IVAS_LC3PLUS_ENC_Close( &encHandle ); + ISAR_LC3PLUS_ENC_Close( &encHandle ); free( bitstream_out ); return 0; } @@ -417,7 +417,7 @@ static int encodeAndDecodeOneMonoFrame( void ) uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; - err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, bps, &encHandle ); if ( IVAS_ERR_OK != err ) { return err; @@ -431,21 +431,21 @@ static int encodeAndDecodeOneMonoFrame( void ) pcm_in[0] = pcm_in_ch1; int32_t bitstreamSizePerIvasFrame = 0; - err = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); + err = ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); if ( IVAS_ERR_OK != err ) return err; uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); - err = IVAS_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); + err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); if ( IVAS_ERR_OK != err ) return err; - IVAS_LC3PLUS_ENC_Close( &encHandle ); + ISAR_LC3PLUS_ENC_Close( &encHandle ); /* decode one frame */ ISAR_LC3PLUS_DEC_HANDLE decHandle; - err = IVAS_LC3PLUS_DEC_Open( config, + err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING 1 /*caching enabled*/, #endif @@ -461,19 +461,19 @@ static int encodeAndDecodeOneMonoFrame( void ) float pcm_out_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; memset( pcm_out_ch1, 0, numSamplesPerChannels * sizeof( float ) ); pcm_out[0] = pcm_out_ch1; - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; } - err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + err = ISAR_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; } - IVAS_LC3PLUS_DEC_Close( &decHandle ); + ISAR_LC3PLUS_DEC_Close( &decHandle ); free( bitstream_out ); return 0; -- GitLab From 57fc86e2109ffcf3e13d21d1a4f847d74e3de409 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 23 Apr 2024 15:44:31 +0200 Subject: [PATCH 5/6] build fixes --- .../lc3plus/ivas_lc3plus_unit_test.c | 6 +- ...vas_lc3plus_unit_test_selective_decoding.c | 140 +++++++++--------- 2 files changed, 73 insertions(+), 73 deletions(-) diff --git a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c index 30f6754863..048b18eef3 100644 --- a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c +++ b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c @@ -178,7 +178,7 @@ static int tryOpenEncoderWithInvalidBitrate( void ) { return 1; } - err = IVAS_LC3PLUS_ENC_Open( config, invalid_low_bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, invalid_low_bps, &encHandle ); /* setting an invalid bitrate should trigger an error - which is what we expect */ if ( IVAS_ERR_LC3PLUS_INVALID_BITRATE != err ) { @@ -246,8 +246,8 @@ static int tryCallEncoderApiWithInvalidParams( void ) { return 1; } - IVAS_LC3PLUS_ENC_Close( &invalidEncHandle ); - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out ) ) + ISAR_LC3PLUS_ENC_Close( &invalidEncHandle ); + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out ) ) { return 1; } diff --git a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c index 44d3787c27..e0dd41058b 100644 --- a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c +++ b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c @@ -56,13 +56,13 @@ static int encodeAndDecodeOne6chFrameFixture( LC3PLUS_CONFIG config, const int16 int32_t decDelay = -1; ISAR_LC3PLUS_ENC_HANDLE encHandle; - err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + err = ISAR_LC3PLUS_ENC_Open( config, bps, &encHandle ); if ( IVAS_ERR_OK != err ) { return err; } - err = IVAS_LC3PLUS_ENC_GetDelay( encHandle, &encDelay ); + err = ISAR_LC3PLUS_ENC_GetDelay( encHandle, &encDelay ); if ( IVAS_ERR_OK != err ) { return err; @@ -95,21 +95,21 @@ static int encodeAndDecodeOne6chFrameFixture( LC3PLUS_CONFIG config, const int16 pcm_in[5] = pcm_in_ch6; int32_t bitstreamSizePerIvasFrame = 0; - err = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); + err = ISAR_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); if ( IVAS_ERR_OK != err ) return err; uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); - err = IVAS_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); + err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); if ( IVAS_ERR_OK != err ) return err; - IVAS_LC3PLUS_ENC_Close( &encHandle ); + ISAR_LC3PLUS_ENC_Close( &encHandle ); /* decode one frame */ ISAR_LC3PLUS_DEC_HANDLE decHandle; - err = IVAS_LC3PLUS_DEC_Open( config, + err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING enableCaching, #endif @@ -119,7 +119,7 @@ static int encodeAndDecodeOne6chFrameFixture( LC3PLUS_CONFIG config, const int16 return err; } - err = IVAS_LC3PLUS_DEC_GetDelay( decHandle, &decDelay ); + err = ISAR_LC3PLUS_DEC_GetDelay( decHandle, &decDelay ); if ( IVAS_ERR_OK != err ) { return err; @@ -151,13 +151,13 @@ static int encodeAndDecodeOne6chFrameFixture( LC3PLUS_CONFIG config, const int16 pcm_out[4] = pcm_out_ch5; pcm_out[5] = pcm_out_ch6; - err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + err = ISAR_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -172,19 +172,19 @@ static int encodeAndDecodeOne6chFrameFixture( LC3PLUS_CONFIG config, const int16 } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; } - err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + err = ISAR_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; } - IVAS_LC3PLUS_DEC_Close( &decHandle ); + ISAR_LC3PLUS_DEC_Close( &decHandle ); free( bitstream_out ); return 0; @@ -207,7 +207,7 @@ static int scenario_decode_all_subframes( const LC3PLUS_CONFIG config, int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -223,7 +223,7 @@ static int scenario_decode_all_subframes( const LC3PLUS_CONFIG config, } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -244,7 +244,7 @@ static int scenario_decode_all_subframes( const LC3PLUS_CONFIG config, } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -258,7 +258,7 @@ static int scenario_decode_all_subframes( const LC3PLUS_CONFIG config, assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -281,7 +281,7 @@ static int scenario_dont_decode_last_2_subframes( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -307,7 +307,7 @@ static int scenario_dont_decode_last_2_subframes( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -341,7 +341,7 @@ static int scenario_dont_decode_last_2_subframes( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -361,7 +361,7 @@ static int scenario_dont_decode_last_2_subframes( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -383,7 +383,7 @@ static int scenario_dont_decode_last_3_subframes( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -409,7 +409,7 @@ static int scenario_dont_decode_last_3_subframes( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -446,7 +446,7 @@ static int scenario_dont_decode_last_3_subframes( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -466,7 +466,7 @@ static int scenario_dont_decode_last_3_subframes( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -489,7 +489,7 @@ static int scenario_skip_first_subframe( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -514,7 +514,7 @@ static int scenario_skip_first_subframe( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -541,7 +541,7 @@ static int scenario_skip_first_subframe( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -561,7 +561,7 @@ static int scenario_skip_first_subframe( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -588,7 +588,7 @@ static int scenario_decode_cache( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -614,7 +614,7 @@ static int scenario_decode_cache( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -647,7 +647,7 @@ static int scenario_decode_cache( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -677,7 +677,7 @@ static int scenario_decode_cache( } } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -694,7 +694,7 @@ static int scenario_decode_cache( assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -713,7 +713,7 @@ static int scenario_decode_cache( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -740,7 +740,7 @@ static int scenario_get_active_dont_cache( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -766,7 +766,7 @@ static int scenario_get_active_dont_cache( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -804,7 +804,7 @@ static int scenario_get_active_dont_cache( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -834,7 +834,7 @@ static int scenario_get_active_dont_cache( } } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -852,7 +852,7 @@ static int scenario_get_active_dont_cache( assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -871,7 +871,7 @@ static int scenario_get_active_dont_cache( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -899,7 +899,7 @@ static int scenario_per_subframe_switches_skip_first( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -925,7 +925,7 @@ static int scenario_per_subframe_switches_skip_first( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -957,7 +957,7 @@ static int scenario_per_subframe_switches_skip_first( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1001,7 +1001,7 @@ static int scenario_per_subframe_switches_skip_first( } } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1032,7 +1032,7 @@ static int scenario_per_subframe_switches_skip_first( } } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1051,7 +1051,7 @@ static int scenario_per_subframe_switches_skip_first( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -1078,7 +1078,7 @@ static int scenario_per_subframe_switches_dec_first( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -1104,7 +1104,7 @@ static int scenario_per_subframe_switches_dec_first( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1136,7 +1136,7 @@ static int scenario_per_subframe_switches_dec_first( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1180,7 +1180,7 @@ static int scenario_per_subframe_switches_dec_first( } } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1219,7 +1219,7 @@ static int scenario_per_subframe_switches_dec_first( } } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1238,7 +1238,7 @@ static int scenario_per_subframe_switches_dec_first( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -1266,7 +1266,7 @@ static int scenario_per_subframe_switches_dec_first_no_caching( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -1292,7 +1292,7 @@ static int scenario_per_subframe_switches_dec_first_no_caching( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1324,7 +1324,7 @@ static int scenario_per_subframe_switches_dec_first_no_caching( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1368,7 +1368,7 @@ static int scenario_per_subframe_switches_dec_first_no_caching( } } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1407,7 +1407,7 @@ static int scenario_per_subframe_switches_dec_first_no_caching( } } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1426,7 +1426,7 @@ static int scenario_per_subframe_switches_dec_first_no_caching( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } #endif @@ -1454,7 +1454,7 @@ static int scenario_per_subframe_bundle_switches_dec_first( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -1480,7 +1480,7 @@ static int scenario_per_subframe_bundle_switches_dec_first( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1512,7 +1512,7 @@ static int scenario_per_subframe_bundle_switches_dec_first( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1556,7 +1556,7 @@ static int scenario_per_subframe_bundle_switches_dec_first( } } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1595,7 +1595,7 @@ static int scenario_per_subframe_bundle_switches_dec_first( } } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1614,7 +1614,7 @@ static int scenario_per_subframe_bundle_switches_dec_first( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } @@ -1641,7 +1641,7 @@ static int scenario_per_subframe_bundle_switches_skip_first( int iLc3plusFrame = 0; int lc3framesPerIvasFrame; int16_t **selective_decoding_matrix; - err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + err = ISAR_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); if ( IVAS_ERR_OK != err ) { return err; @@ -1667,7 +1667,7 @@ static int scenario_per_subframe_bundle_switches_skip_first( } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1699,7 +1699,7 @@ static int scenario_per_subframe_bundle_switches_skip_first( } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1743,7 +1743,7 @@ static int scenario_per_subframe_bundle_switches_skip_first( } } /* Apply selective decoding scenario */ - err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + err = ISAR_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); if ( IVAS_ERR_OK != err ) { return err; @@ -1782,7 +1782,7 @@ static int scenario_per_subframe_bundle_switches_skip_first( } } } - err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + err = ISAR_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); if ( IVAS_ERR_OK != err ) { return err; @@ -1801,7 +1801,7 @@ static int scenario_per_subframe_bundle_switches_skip_first( } } - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); return IVAS_ERR_OK; } -- GitLab From c1a03a719bb4ff7c92fb2efaba37a6924991764b Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 23 Apr 2024 15:53:58 +0200 Subject: [PATCH 6/6] build fixes --- .../ivas_lc3plus_unit_test_selective_decoding.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c index e0dd41058b..637ef6997b 100644 --- a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c +++ b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c @@ -49,6 +49,19 @@ typedef int ( *ScenarioFnPtr )( const LC3PLUS_CONFIG config, int32_t bitstream_in_size, float **pcm_out ); +static void ISAR_LC3PLUS_DEC_FreeSubframeDecodingMatrix( + int16_t **subframeChannelMatrix ) +{ + for ( int16_t i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + free( subframeChannelMatrix[i] ); + } + + free( subframeChannelMatrix ); + + return; +} + static int encodeAndDecodeOne6chFrameFixture( LC3PLUS_CONFIG config, const int16_t enableCaching, const int32_t bps, ScenarioFnPtr scenarioFn ) { ivas_error err; -- GitLab