diff --git a/apps/decoder.c b/apps/decoder.c index e3026f93e717a1bde15aab881112b77674f2ad41..793e8c58cf3cc6157ed1df7593967a8b20f3b66c 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 2710c3db5e909ffb4996da9f07ee98d03528b205..01bd2a09bff050596a9c90b410471301cf55e64a 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 0e0ec58e56795b6b3075f0d6daf1c1e7ed6d90f4..09915969e2e2592da88374f129813bdc4e3d34be 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 d936470f75b19f406407b098a47aaf9501ecc124..99850e71d3c7b9403d6616f47d6aa00c7d11153e 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 84f99d81b3a49d5e302b54b27dca9ab3cea79250..1b83a06596c008991eebadea66e04fd0816534f9 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 1034ffe53880146b9ede7064635562454055d958..174aac81da364ec4f61bf63ffde754eb7162f00d 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 1be9e6182943ca9e7efcba741043e5094556c64f..84672f35832ff0ab11ad98b07f9cfc21e59edc06 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 a12945bca96cc0f0c447fba6fd238df3ddf7c319..38efc5012624139cd748882b0a54b38dacf4eecd 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 f8f042dada69658575505a830a94089bc8a2bc30..678848a618f7d5f8bf874ed85b14bec91d32d669 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 d4e12f8c7110ec4e8541560cc5ab08f5d9dce072..9a2b6d4b16929457cabad7a37dada51439003002 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 602e0b217845413447e3be7874d1c4f12165126f..81c2ef9e95f7e8083064cac663a8f9d19ae111c9 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" @@ -73,16 +72,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 53b5998d0b6bf8b8fff8c28803f627bcab9456e5..4b963ab75af3d2e6b365fc1b50e902fe8f71f29b 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 9412b2f2aa06f0fdb57b115b3804918471c73eae..c9391e37bb12e3e7a29ebaf296c4f92cf3ff6e2a 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 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 ) / ( 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 ) / ( 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_lc3plus_common.c b/lib_isar/isar_lc3plus_common.c index 1f16239bb44d83f77e0d0143754ba93d21df2175..e878b890cf2b683d617a8a40aee20cede88f69ca 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 e8c313d105095f13d1b49297099cd25d722ad162..e350129499e2016a974b469cc6f5977cb76ab84d 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 6af5549a2d8500b7260662f1e42de55e02d866d8..7ca5dda48eb0a08a0068b9a79d2db339c95fa34c 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" ); } } @@ -229,32 +249,12 @@ 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() + * 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] ) { @@ -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 74737841c943dee74d33669937e97beeff635471..576c576959328c36b2f1beede10fa350a8b7f8d4 100644 --- a/lib_isar/isar_lc3plus_dec.h +++ b/lib_isar/isar_lc3plus_dec.h @@ -38,8 +38,9 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #include "lc3.h" #include "ivas_error.h" -#include "isar_lc3plus_common.h" #include "ivas_cnst.h" +#include "isar_lc3plus_common.h" + typedef enum { @@ -51,7 +52,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 +60,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 ea3081be874d451b419671e8d850b8e1dfe4c8fd..4de75cc5265081fc2bf53a45c21df7f7c705556c 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 82437bc083272ca83d21d1380e97d93b185b7182..1a9f467b5f2f09fe8a83417ad0100dc55e3a1980 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 151d3b2f4b89ecdaf689cebf41dad0f04525b98f..826e711c5589b1ff8b48076a182267ea2a23f3ee 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 1e638b91ee1aaac3aa0c4d5c85766561b9667984..4a036643c952f7d375d720b68f572a6c7cfb1346 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" @@ -919,7 +917,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 +1057,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 +1164,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 fefe054798d6eaf7bd9d6e85c699f54fdd8992a4..36075637bd41d0395b87d23a68c8ad9a8c952aea 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 b183b19f4537ec2764a1dc448a77912b5eda07ec..3ff35ff73efa014d89ed957d8ec247fec4febd27 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_lcld_tables.h b/lib_isar/isar_rom_lcld_tables.h index f2918fac01e7a96022a548bde94add3a76cdcdbd..cfad1b7fc390ad3f7d366e0e8feea92c8f8f4d10 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/lib_isar/isar_rom_post_rend.c b/lib_isar/isar_rom_post_rend.c index a7ea2eaef5a688645f8ef1fa08e63d407fa556da..51a0252bc311cf464cb1a0b9d40428721023ff1e 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 */ @@ -155,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[IVAS_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 290539a8d0d6a99143979e0d9ea43e695e2cde3d..9f570d47894b50564ab8557f695033c909d69b4d 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 "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[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]; -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 d2ba0ab5912868b3f51e2296ca833a1f180a87ad..dd2efc2791e9c14a94d7e8320038d442b33aa770 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 82fd5f2b31ce523930040c4c216bf980fed86ab5..db3b7b80775bf8179cac8c981788792ebedae8a7 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 d0918073b9164536b21c54133ab74dd7c7aea5a6..87631de01bea30eba292d6c4244e40163a1e05e1 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" @@ -152,8 +151,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 +192,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 +237,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 +261,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 +456,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 +475,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 +754,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 +1196,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 +1570,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 +1689,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 +1765,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 +1773,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 +1787,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 +1814,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 f0eed91999ee122221a963f7811fb3dc6574c8fe..7b4a766df1c1ceb8079d251e533cf1ddc5fbf15b 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 @@ -51,12 +45,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 +160,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 +209,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 = ISAR_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 +433,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 +634,7 @@ int8_t isar_get_lc3plus_bitrate_id( /*------------------------------------------------------------------------- - * Function ivas_mat_mult_2by2_complex() + * Function isar_get_lc3plus_size_from_id() * * *------------------------------------------------------------------------*/ @@ -827,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] = IVAS_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; } diff --git a/lib_isar/isar_stat.h b/lib_isar/isar_stat.h index ea63379b0515c803a3fd4e50d5714332c7585032..e43ac88cceb905e8c249a648cc27c7f6a07697d3 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 *-------------------------------------------------------------------*/ @@ -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 68db0532985924ce8ae133c30b75fdfaad9bda51..5815f5b2510b15c3be399d020e9bbabac56e5661 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" @@ -86,7 +82,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 +121,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 +532,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 +553,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 +604,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 +612,7 @@ static void clearInputSplitRend( /*------------------------------------------------------------------------- - * ISAR_POST_REND_Open() + * ISAR_POST_REND_open() * * *------------------------------------------------------------------------*/ @@ -734,7 +730,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 +772,7 @@ static ivas_error getInputById( } /*-------------------------------------------------------------------* - * IVAS_REND_SetInputGain() + * ISAR_POST_REND_SetInputGain() * * *-------------------------------------------------------------------*/ @@ -1016,7 +1012,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 +1345,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 +1388,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 +1674,7 @@ static ivas_error renderActiveInputsSplitBin( /*-------------------------------------------------------------------* - * getSamplesInternal() + * ISAR_POST_REND_getSamples() * * *-------------------------------------------------------------------*/ @@ -1918,7 +1914,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 e6952f79f99f64a18330c1174b1f58eb2af4cd0b..d53ae0c7d3fc5316b0d26da7f80bc08b5d151e4c 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" + #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 1e4e143a837ee10ce03243f4699883dc8be5fc6b..16ed7e6524c0624e71fd9e44b0ad289b1b56f36f 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 e2e189060f1f5959e92d4008064a6b202744e76b..0363ea645ba9599abf9e7d3fa441e50114273c2c 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 a15654155a956c9e7ba23a5b93be8a2a6a620d99..b1d682f34434583019f5fbcafb15ee6dcebd491d 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 1b2cfbacdbb15fc4f47089971938a5f441c77900..cb002c19ba6452e0610399d9e4df8c9dfdbf5358 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 6d4d98162f93e4384eaf4207c7c61e64e3c3c59d..c9331ff7781bcacb141697a9d240005a0b59339c 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 e39c43813781e3fe9274c4f99a256e00f7c676bc..9988962dbe62b3e3b8f10d54b735357bcc328701 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 e3560d11fc1f7a3d9f7556e9236b092baab46c66..00238a20352974a2962cc689ad728925041c9ae3 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 4690235a31b70bb4fd4cd6e173eac4e0ef61a3c7..50cb3cc00145d95bc978ed6be278a027010d5573 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 */ diff --git a/lib_util/split_rend_bfi_file_reader.c b/lib_util/split_rend_bfi_file_reader.c index 25fade1878ff5a7e058fa392bb87b476b8aa4715..9ca1000770d09fdb4761905604af3cda20cb15fb 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 4e980012a5ffd572e73b63cf4f6c012b15d3c796..714467b1189e88ce38410a7e656b6623036f7f1e 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" /*------------------------------------------------------------------------------------------* diff --git a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c index 678e7e1ef550a92bb0054e98ae8e0be4026f8a41..048b18eef3b22893688c327e9ce3fcb540357784 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,13 +172,13 @@ 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 ) { 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 ) { @@ -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,20 +238,20 @@ 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; } - 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; } - 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; 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 44d3787c27684e0c9a8a23767022bdb7f1c45c3d..637ef6997b66f9ce40a91114978e6b12718a5970 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; @@ -56,13 +69,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 +108,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 +132,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 +164,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 +185,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 +220,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 +236,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 +257,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 +271,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 +294,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 +320,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 +354,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 +374,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 +396,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 +422,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 +459,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 +479,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 +502,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 +527,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 +554,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 +574,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 +601,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 +627,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 +660,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 +690,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 +707,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 +726,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 +753,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 +779,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 +817,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 +847,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 +865,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 +884,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 +912,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 +938,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 +970,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 +1014,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 +1045,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 +1064,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 +1091,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 +1117,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 +1149,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 +1193,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 +1232,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 +1251,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 +1279,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 +1305,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 +1337,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 +1381,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 +1420,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 +1439,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 +1467,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 +1493,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 +1525,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 +1569,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 +1608,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 +1627,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 +1654,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 +1680,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 +1712,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 +1756,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 +1795,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 +1814,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; }