diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 204f1a966189eab65738abf0aa52c0a200d8ada0..e0bcd06033b582e5b94cd8f35e3668f450b24971 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -150,7 +150,6 @@ - @@ -178,7 +177,7 @@ - + @@ -191,11 +190,10 @@ - + - diff --git a/Workspace_msvc/lib_rend.vcxproj.filters b/Workspace_msvc/lib_rend.vcxproj.filters index fd7b1620cec3d9166aaaabcc0ec924dcf5fe528c..406ba2c85ee9fc8f3adfb0910136e2f379fe553b 100644 --- a/Workspace_msvc/lib_rend.vcxproj.filters +++ b/Workspace_msvc/lib_rend.vcxproj.filters @@ -5,9 +5,6 @@ rend_c - - rend_c - rend_c @@ -206,9 +203,6 @@ rend_h - - rend_h - diff --git a/apps/renderer.c b/apps/renderer.c index 2c7d7c24018ce49e0d22c2aee1d40bd7727c3b99..9f0c242529853a40a8ca95a894deacb8c75c8fdd 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -67,7 +67,7 @@ #define RENDERER_MAX_METADATA_LINE_LENGTH 1024 #ifdef SPLIT_REND_WITH_HEAD_ROT -#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) SPLIT_REND_MAX_BRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) + SPLIT_REND_ADDITIONAL_BYTES_TO_READ ) +#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) IVAS_MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) + IVAS_SPLIT_REND_ADDITIONAL_BYTES_TO_READ ) #endif #define IVAS_MAX16B_FLT 32767.0f @@ -3292,6 +3292,7 @@ static void parseObjectPosition( int16_t read_values; float meta_prm[8] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f }; + readNextMetadataChunk( line, "," ); *positionDuration = (uint16_t) strtol( line, &endptr, 10 ); readNextMetadataChunk( line, "\n" ); diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 7e56c3ca326359d32ddf00c4d3f71b6ab015b90e..c841cc02c0d9c8d8ecd2e82eabde769d85544cf4 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -196,6 +196,7 @@ typedef struct _IVAS_JBM_TRACE_DATA #define IVAS_MAX_SPLIT_REND_BITRATE 768000 #define IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) IVAS_MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) +#define IVAS_SPLIT_REND_ADDITIONAL_BYTES_TO_READ 1 typedef enum { @@ -235,7 +236,7 @@ typedef enum } IVAS_SPLIT_REND_RENDERER_SELECTION; -typedef struct ivas_split_rend_bits_t +typedef struct _IVAS_SPLIT_REND_BITS_DATA { uint8_t *bits_buf; int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/ @@ -245,7 +246,7 @@ typedef struct ivas_split_rend_bits_t IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction; -} ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE; +} IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE; typedef struct _IVAS_SPLIT_REND_CONFIG { diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index e7f3bcaa2f87af1187f6ead402346ace1d8a4022..bbe15c722c75fb760a4186bd1ed0017376c1827f 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1826,7 +1826,7 @@ typedef enum #define SPLIT_REND_512k 512000 #define SPLIT_REND_768k 768000 #define SPLIT_REND_MAX_BRATE SPLIT_REND_768k -#define SPLIT_REND_ADDITIONAL_BYTES_TO_READ 1 + #endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/ivas_error_utils.h b/lib_com/ivas_error_utils.h index f08bd29d84932d12a49f1bf6e76efbf573d77d39..b9a6b3f872443e35368c4d802054d6f47eaafc42 100644 --- a/lib_com/ivas_error_utils.h +++ b/lib_com/ivas_error_utils.h @@ -30,13 +30,14 @@ *******************************************************************************************************/ -/* options.h needed for debugging/development features - * It should be stripped for delivery along with debugging switches */ #include "options.h" -#include "ivas_error.h" + #include #include #include + +#include "ivas_error.h" + #ifdef DEBUGGING #include #endif diff --git a/lib_rend/ivas_PredDecoder.c b/lib_rend/ivas_PredDecoder.c index a0642ff0ea80b989f003e1945b771b373c075ffe..914435e2fef984be8510b62fefe42d5d5109bd4c 100644 --- a/lib_rend/ivas_PredDecoder.c +++ b/lib_rend/ivas_PredDecoder.c @@ -38,7 +38,6 @@ #include "ivas_prot_rend.h" #include "ivas_lcld_prot.h" #include "ivas_lcld_rom_tables.h" -#include "ivas_cldfb_codec_bitstream.h" #include "wmc_auto.h" @@ -194,7 +193,7 @@ void DeletePredictionDecoder( int32_t ReadPredictors( PredictionDecoder *psPredictionDecoder, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int16_t iBitsRead = 0; int32_t c; diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index 280ea6de64759b063ce64ed578f83d61244b310b..804a00a6a1baac7da9b06d55efdb92b37d6ef181 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -38,7 +38,6 @@ #include "ivas_lcld_rom_tables.h" #include "prot.h" #include "ivas_prot_rend.h" -#include "ivas_cldfb_codec_bitstream.h" #include "wmc_auto.h" @@ -490,7 +489,7 @@ void ApplyForwardPredictors( int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsWritten = 0; int32_t c; diff --git a/lib_rend/ivas_cldfb_codec_bitstream.c b/lib_rend/ivas_cldfb_codec_bitstream.c deleted file mode 100644 index 591f8f484df6ff693b75bdd27ef69bb6dc1cc214..0000000000000000000000000000000000000000 --- a/lib_rend/ivas_cldfb_codec_bitstream.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#include "ivas_cldfb_codec_bitstream.h" -#include -#include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT -#include -#include -#include "prot.h" -#include "wmc_auto.h" - -/*------------------------------------------------------------------------------------------* - * Function BSForceBack() - * - * - *------------------------------------------------------------------------------------------*/ - -int32_t BSForceBack( - ivas_split_rend_bits_t *pBits, - int32_t iValue, - int32_t iBitCount ) -{ - pBits->bits_read -= iBitCount; - - return ( iValue >> iBitCount ); -} -#endif diff --git a/lib_rend/ivas_cldfb_codec_bitstream.h b/lib_rend/ivas_cldfb_codec_bitstream.h deleted file mode 100644 index 0fd6d6a223b00840904841e3d99d09b3d485a669..0000000000000000000000000000000000000000 --- a/lib_rend/ivas_cldfb_codec_bitstream.h +++ /dev/null @@ -1,48 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#ifndef _IVAS_CLDFB_CODEC_BITSTREAM_H_ -#define _IVAS_CLDFB_CODEC_BITSTREAM_H_ - -#include "lib_rend.h" -#include "ivas_prot_rend.h" -#include "options.h" - -#ifdef SPLIT_REND_WITH_HEAD_ROT - -int32_t BSForceBack( - ivas_split_rend_bits_t *pBits, - int32_t iValue, - int32_t iBitCount ); - -#endif -#endif /* _BITSTREAM_H_ */ diff --git a/lib_rend/ivas_lcld_decoder.c b/lib_rend/ivas_lcld_decoder.c index 47d1e5f6013c9ba7e433fb96d7cc6f2df7590720..7825f249c6cf92c74189c4c0b398531d5441317d 100644 --- a/lib_rend/ivas_lcld_decoder.c +++ b/lib_rend/ivas_lcld_decoder.c @@ -35,7 +35,6 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_lcld_prot.h" #include "ivas_lcld_rom_tables.h" -#include "ivas_cldfb_codec_bitstream.h" #include "prot.h" #include #include "ivas_prot_rend.h" @@ -735,24 +734,24 @@ static void InvQuantizeSpectrum( const int32_t iNumGroups, const int32_t *piGrou static void InvMSCoding( const int32_t iNumBlocks, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiffs, const int32_t *piMSPredCoefs, float ***pppfReal, float ***pppfImag ); -static int32_t ReadHeaderInformation( int32_t *piNumBands, ivas_split_rend_bits_t *pBits ); +static int32_t ReadHeaderInformation( int32_t *piNumBands, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t ReadMSInformation( const int32_t iNumBands, int32_t *piMSMode, int32_t *piMSFlags, int32_t *piLRPhaseDiffs, int32_t *piMSPredCoefs, ivas_split_rend_bits_t *pBits ); +static int32_t ReadMSInformation( const int32_t iNumBands, int32_t *piMSMode, int32_t *piMSFlags, int32_t *piLRPhaseDiffs, int32_t *piMSPredCoefs, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t ReadGroupInformation( const int32_t iChannels, const int32_t iNumBlocks, int32_t *piCommonGrouping, int32_t *piNumGroups, int32_t **ppiGroupLengths, ivas_split_rend_bits_t *pBits ); +static int32_t ReadGroupInformation( const int32_t iChannels, const int32_t iNumBlocks, int32_t *piCommonGrouping, int32_t *piNumGroups, int32_t **ppiGroupLengths, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t ReadHuff( const uint32_t ( *pauiHuffDecTable )[HUFF_DEC_TABLE_SIZE], int32_t *piSymbol, ivas_split_rend_bits_t *pBits ); +static int32_t ReadHuff( const uint32_t ( *pauiHuffDecTable )[HUFF_DEC_TABLE_SIZE], int32_t *piSymbol, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t ReadRMSEnvelope( const int32_t iChannels, const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiRMSEnvelope, ivas_split_rend_bits_t *pBits ); +static int32_t ReadRMSEnvelope( const int32_t iChannels, const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiRMSEnvelope, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t ReadAllocInformation( int32_t *piAllocOffset, ivas_split_rend_bits_t *pBits ); +static int32_t ReadAllocInformation( int32_t *piAllocOffset, IVAS_SPLIT_REND_BITS_HANDLE pBits ); #ifdef ROM_TO_RAM static int32_t -ReadLCLDData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits, uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE] ); +ReadLCLDData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, IVAS_SPLIT_REND_BITS_HANDLE pBits, uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE] ); #else static int32_t -ReadLCLDData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits ); +ReadLCLDData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, IVAS_SPLIT_REND_BITS_HANDLE pBits ); #endif static void ComputeAllocation( const int32_t iChannels, const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiSMR, const int32_t iAllocOffset, int32_t ***pppiAlloc ); @@ -766,7 +765,7 @@ static void ComputeAllocation( const int32_t iChannels, const int32_t *piNumGrou int32_t DecodeLCLDFrame( LCLDDecoder *psLCLDDecoder, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, float ***pppfLCLDReal, float ***pppfLCLDImag ) { @@ -1114,7 +1113,7 @@ static void InvMSCoding( /* Currently only the number of bands in frame */ static int32_t ReadHeaderInformation( int32_t *piNumBands, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsRead; @@ -1132,7 +1131,7 @@ static int32_t ReadMSInformation( int32_t *piMSFlags, int32_t *piLRPhaseDiffs, int32_t *piMSPredCoefs, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsRead; @@ -1269,7 +1268,7 @@ static int32_t ReadGroupInformation( int32_t *piCommonGrouping, int32_t *piNumGroups, int32_t **ppiGroupLengths, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t c, k, iBitsRead; @@ -1366,10 +1365,21 @@ static int32_t ReadGroupInformation( } +static int32_t BSForceBack( + IVAS_SPLIT_REND_BITS_HANDLE pBits, + int32_t iValue, + int32_t iBitCount ) +{ + pBits->bits_read -= iBitCount; + + return ( iValue >> iBitCount ); +} + + static int32_t ReadHuff( const uint32_t ( *pauiHuffDecTable )[HUFF_DEC_TABLE_SIZE], int32_t *piSymbol, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsRead; int32_t iSymbol; @@ -1408,7 +1418,7 @@ static int32_t ReadRMSEnvelope( const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiRMSEnvelope, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t b, k, n; int32_t iBitsRead, iLastRMSVal; @@ -1441,7 +1451,11 @@ static int32_t ReadRMSEnvelope( #ifdef ENABLE_PMOD_ADJUST -static int32_t ReadPmodInformation( int32_t **ppiHiSMRFlags, ivas_split_rend_bits_t *pBits, int32_t iChannels, int32_t iNumBands ) +static int32_t ReadPmodInformation( + int32_t **ppiHiSMRFlags, + IVAS_SPLIT_REND_BITS_HANDLE pBits, + int32_t iChannels, + int32_t iNumBands ) { int32_t iBitsRead; int32_t c; @@ -1498,7 +1512,7 @@ static int32_t ReadPmodInformation( int32_t **ppiHiSMRFlags, ivas_split_rend_bit static int32_t ReadAllocInformation( int32_t *piAllocOffset, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsRead; @@ -1509,6 +1523,8 @@ static int32_t ReadAllocInformation( return iBitsRead; } + + #ifdef ROM_TO_RAM static int32_t ReadLCLDData( const int32_t iNumGroups, @@ -1521,7 +1537,7 @@ static int32_t ReadLCLDData( int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE] ) #else static int32_t ReadLCLDData( @@ -1535,7 +1551,7 @@ static int32_t ReadLCLDData( int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) #endif { int32_t b, k, m, n; diff --git a/lib_rend/ivas_lcld_encoder.c b/lib_rend/ivas_lcld_encoder.c index 7abfabbbd501833364f6bebc077bb279f99fb1ed..00996eb8aa4393af74aa46e5817976379ef875e6 100644 --- a/lib_rend/ivas_lcld_encoder.c +++ b/lib_rend/ivas_lcld_encoder.c @@ -38,7 +38,6 @@ #include "ivas_lcld_prot.h" #include "ivas_lcld_rom_tables.h" #include "prot.h" -#include "ivas_cldfb_codec_bitstream.h" #include "ivas_prot_rend.h" #ifdef ENABLE_PMOD_ADJUST #include "ton_corr.h" @@ -482,20 +481,19 @@ static void RemoveRMSEnvelope( const int32_t iNumBands, const int32_t *piBandwid static int32_t CountLCLDBits( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiQReal, int32_t **ppiQImag ); -static int32_t WriteHeaderInformation( const int32_t iNumBands, ivas_split_rend_bits_t *pBits ); +static int32_t WriteHeaderInformation( const int32_t iNumBands, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t WritePmodInformation( const int32_t **ppiHiSMRFlags, ivas_split_rend_bits_t *pBits, int32_t iChannels, int32_t iNumBands ); +static int32_t WritePmodInformation( const int32_t **ppiHiSMRFlags, IVAS_SPLIT_REND_BITS_HANDLE pBits, int32_t iChannels, int32_t iNumBands ); -static int32_t WriteMSInformation( const int32_t iNumBands, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiffs, const int32_t *piMSPredCoefs, int32_t iNumMSPredBands, ivas_split_rend_bits_t *pBits ); +static int32_t WriteMSInformation( const int32_t iNumBands, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiffs, const int32_t *piMSPredCoefs, int32_t iNumMSPredBands, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t WriteGroupInformation( const int32_t iChannels, const int32_t iCommonGrouping, const int32_t *piNumGroups, int32_t **ppiGroupLengths, ivas_split_rend_bits_t *pBits ); +static int32_t WriteGroupInformation( const int32_t iChannels, const int32_t iCommonGrouping, const int32_t *piNumGroups, int32_t **ppiGroupLengths, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t WriteRMSEnvelope( const int32_t iChannels, const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiRMSEnvelope, ivas_split_rend_bits_t *pBits ); +static int32_t WriteRMSEnvelope( const int32_t iChannels, const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiRMSEnvelope, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t WriteAllocInformation( const int32_t iAllocOffset, - ivas_split_rend_bits_t *pBits ); +static int32_t WriteAllocInformation( const int32_t iAllocOffset, IVAS_SPLIT_REND_BITS_HANDLE pBits ); -static int32_t WriteLCLDData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits ); +static int32_t WriteLCLDData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, IVAS_SPLIT_REND_BITS_HANDLE pBits ); static int32_t ComputeAllocation( const int32_t iChannels, const int32_t *piNumGroups, int32_t **ppiGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, float ***pppfReal, float ***pppfImag, int32_t ***pppiSMR, const int32_t iAvailableBits, int32_t *piAllocOffset, int32_t ***pppiAlloc, int32_t ***pppiQReal, int32_t ***pppiQImag, int32_t ***pppiSignReal, int32_t ***pppiSignImag, int32_t **ppiPredEnable, float **ppfA1Real, float **ppfA1Imag ); @@ -512,7 +510,7 @@ int32_t EncodeLCLDFrame( float ***pppfLCLDImag, int32_t *piBitsWritten, const int32_t available_bits, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t n; int32_t iAvailableBits, iBitsWritten; @@ -1437,7 +1435,7 @@ static int32_t CountLCLDBits( /* Currently only the number of bands in frame */ static int32_t WriteHeaderInformation( const int32_t iNumBands, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsWritten; @@ -1456,7 +1454,7 @@ static int32_t WriteMSInformation( const int32_t *piLRPhaseDiff, const int32_t *piMSPredCoef, int32_t iNumMSPredBands, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsWritten; int32_t iMSPredAll = ( iNumMSPredBands == iNumBands ); @@ -1567,7 +1565,7 @@ static int32_t WriteGroupInformation( const int32_t iCommonGrouping, const int32_t *piNumGroups, int32_t **ppiGroupLengths, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t c, k, n, iBitsWritten; @@ -1643,7 +1641,7 @@ static int32_t WriteRMSEnvelope( const int32_t *piNumGroups, const int32_t iNumBands, int32_t ***pppiRMSEnvelope, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t k, n; int32_t iBitsWritten; @@ -1685,7 +1683,7 @@ static int32_t WriteRMSEnvelope( #ifdef ENABLE_PMOD_ADJUST static int32_t WritePmodInformation( const int32_t **ppiHiSMRFlags, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, int32_t iChannels, int32_t iNumBands ) { @@ -1748,7 +1746,7 @@ static int32_t WritePmodInformation( static int32_t WriteAllocInformation( const int32_t iAllocOffset, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsWritten; @@ -1777,7 +1775,7 @@ static int32_t WriteLCLDData( int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t n; int32_t iBitsWritten; diff --git a/lib_rend/ivas_lcld_prot.h b/lib_rend/ivas_lcld_prot.h index fa92e1be5ddd851e479362aebba7bbd115baf89c..ad35e50f0096b570da5a585ac0b310b0d2b62945 100644 --- a/lib_rend/ivas_lcld_prot.h +++ b/lib_rend/ivas_lcld_prot.h @@ -38,6 +38,7 @@ #include "lib_rend.h" #include "ivas_lcld_rom_tables.h" +/* clang-format off */ typedef struct LCLD_ENCODER LCLDEncoder; @@ -49,7 +50,8 @@ ivas_error CreateLCLDEncoder( const int32_t iAllowSidePred ); void DeleteLCLDEncoder( - LCLDEncoder *psLCLDEncoder ); + LCLDEncoder *psLCLDEncoder +); int32_t EncodeLCLDFrame( LCLDEncoder *psLCLDEncoder, @@ -57,10 +59,11 @@ int32_t EncodeLCLDFrame( float ***pppfLCLDImag, int32_t *piNumiBites, const int32_t available_bits, - ivas_split_rend_bits_t *pBits ); + IVAS_SPLIT_REND_BITS_HANDLE pBits ); int32_t GetNumGroups( - LCLDEncoder *psLCLDEncoder ); + LCLDEncoder *psLCLDEncoder +); typedef struct LCLD_DECODER LCLDDecoder; @@ -71,13 +74,15 @@ ivas_error CreateLCLDDecoder( const int32_t iChannels ); void DeleteLCLDDecoder( - LCLDDecoder *psLCLDDecoder ); + LCLDDecoder *psLCLDDecoder +); int32_t DecodeLCLDFrame( LCLDDecoder *psLCLDDecoder, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, float ***pppfLCLDReal, - float ***pppfLCLDImag ); + float ***pppfLCLDImag +); /*----------------------------------------------------------------------------------* @@ -85,13 +90,15 @@ int32_t DecodeLCLDFrame( *----------------------------------------------------------------------------------*/ int32_t quantPhase( - float phase ); + float phase +); void cplxmult( float *pr1, float *pi1, float r2, - float i2 ); + float i2 +); #ifdef SIMPLE_PHASE void rot_pm_pi( @@ -100,7 +107,8 @@ void rot_pm_pi( void rot_p_pi_2( float *pr, - float *pi ); + float *pi +); void rot_m_pi_2( float *pr, @@ -108,43 +116,53 @@ void rot_m_pi_2( void rot_zero( float *pr, - float *pi ); + float *pi +); #endif int32_t requantPhase( - int32_t phaseQ ); + int32_t phaseQ +); int32_t quantPred( - const float pred ); + const float pred +); float dequantPhase( - const int32_t phaseQ ); + const int32_t phaseQ +); float dequantPred( - int32_t predQ ); + int32_t predQ +); int32_t PrepEncode( int32_t *piQuant, const int32_t *piMSFlags, - const int32_t numBands ); + const int32_t numBands +); void EncodePhase( int32_t *phaseQuant, const int32_t numMSBands, - const int32_t diffDim ); + const int32_t diffDim +); void DecodePhase( int32_t *phaseQuant, const int32_t numMSBands, - const int32_t diffDim ); + const int32_t diffDim +); int32_t EncodePredCoef( int32_t *predQuant, - const int32_t numMSBands ); + const int32_t numMSBands +); void DecodePredCoef( int32_t *phaseQuant, - const int32_t numMSBands ); + const int32_t numMSBands +); void writeMSPred( int32_t *phaseQuant, @@ -153,14 +171,16 @@ void writeMSPred( const int32_t numMSBands, int32_t numBands, void *fid, - int32_t *piMsFlags ); + int32_t *piMsFlags +); int32_t CountMSBits( int32_t iNumBands, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiff, - const int32_t *piMSPredCoef ); + const int32_t *piMSPredCoef +); /*----------------------------------------------------------------------------------* @@ -175,9 +195,13 @@ typedef struct NOISE_GEN float *pfNoiseBuffer; } NoiseGen; -NoiseGen *CreateNoiseGen( void ); +NoiseGen *CreateNoiseGen( + void +); -void DeleteNoiseGen( NoiseGen *psNoiseGen ); +void DeleteNoiseGen( + NoiseGen *psNoiseGen +); inline float GetNoise( NoiseGen *psNoiseGen ) { @@ -199,7 +223,8 @@ extern void PerceptualModel( const int32_t iMaxQuantBands, const int32_t *piRMSEnvelope, int32_t *piExcitation, - int32_t *piSMR ); + int32_t *piSMR +); extern void PerceptualModelStereo( const int32_t iMaxQuantBands, @@ -209,13 +234,14 @@ extern void PerceptualModelStereo( int32_t *piExcitation0, int32_t *piExcitation1, int32_t *piSMR0, - int32_t *piSMR1 ); + int32_t *piSMR1 +); + /*----------------------------------------------------------------------------------* * PredEncoder/PredDecoder prototypes *----------------------------------------------------------------------------------*/ - typedef struct PREDICTION_ENCODER { int32_t iChannels; @@ -242,25 +268,29 @@ typedef struct PREDICTION_ENCODER ivas_error CreatePredictionEncoder( PredictionEncoder **psPredictionEncoder_out, const int32_t iChannels, - const int32_t iNumBlocks ); + const int32_t iNumBlocks +); void DeletePredictionEncoder( - PredictionEncoder *psPredictionEncoder ); + PredictionEncoder *psPredictionEncoder +); int32_t ComputePredictors( PredictionEncoder *psPredictionEncoder, float ***pppfReal, - float ***pppfImag ); + float ***pppfImag +); void ApplyForwardPredictors( PredictionEncoder *psPredictionEncoder, float ***pppfReal, - float ***pppfImag ); - + float ***pppfImag +); int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, - ivas_split_rend_bits_t *pBits ); + IVAS_SPLIT_REND_BITS_HANDLE pBits +); typedef struct PREDICTION_DECODER { @@ -288,19 +318,23 @@ typedef struct PREDICTION_DECODER ivas_error CreatePredictionDecoder( PredictionDecoder **psPredictionDecoder_out, const int32_t iChannels, - const int32_t iNumBlocks ); + const int32_t iNumBlocks +); void DeletePredictionDecoder( - PredictionDecoder *psPredictionDecoder ); + PredictionDecoder *psPredictionDecoder +); int32_t ReadPredictors( PredictionDecoder *psPredictionDecoder, - ivas_split_rend_bits_t *pBits ); + IVAS_SPLIT_REND_BITS_HANDLE pBits +); void ApplyInversePredictros( PredictionDecoder *psPredictionDecoder, float ***pppfReal, - float ***pppfImag ); + float ***pppfImag +); /*----------------------------------------------------------------------------------* @@ -310,10 +344,12 @@ void ApplyInversePredictros( typedef struct RMS_ENVELOPE_GROUPING RMSEnvelopeGrouping; RMSEnvelopeGrouping *CreateRMSEnvelopeGrouping( - const int32_t iNumBlocks ); + const int32_t iNumBlocks +); void DeleteRMSEnvelopeGrouping( - RMSEnvelopeGrouping *psRMSEnvelopeGrouping ); + RMSEnvelopeGrouping *psRMSEnvelopeGrouping +); void ComputeEnvelopeGrouping( RMSEnvelopeGrouping *psRMSEnvelopeGrouping, @@ -324,9 +360,11 @@ void ComputeEnvelopeGrouping( float ***pppfImag, int32_t *piNumGroups, int32_t *piGroupLengths, - int32_t ***pppiRMSEnvelope ); + int32_t ***pppiRMSEnvelope +); #endif +/* clang-format on */ #endif /* _LCLD_ENCODER_H_ */ diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 3947dec9bb6ffec883033cfb31902d51034f6ea8..314f30af10af7132c07caa4952e0f15b86bb386b 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -699,10 +699,12 @@ ivas_error ivas_td_binaural_renderer_ext( } push_wmops( "ivas_td_binaural_renderer_ext" ); + inConfigType = getAudioConfigType( inConfig ); lfe_idx = LFE_CHANNEL; hIsmMetaData[0] = NULL; + if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { ivas_format = MC_FORMAT; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index e84761e6f0eecb3679fd7cbe2b19f0e9899e0d35..7233813cbb8012645aced147ae215226575e0f0a 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -570,7 +570,7 @@ ivas_error ivas_td_binaural_renderer_ext( const AUDIO_CONFIG inConfig, /* i : Input audio configuration */ const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData,/* i : Combined head and external orientations */ - const IVAS_ISM_METADATA *currentPos, /* i : Object position */ + const IVAS_ISM_METADATA *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ const int16_t ism_md_subframe_update_ext, /* i : Metadata Delay in subframes to sync with audio delay */ const int32_t output_Fs, /* i : output sampling rate */ @@ -835,7 +835,7 @@ void ivas_rend_closeCrend( ); ivas_error ivas_hrtf_init( - HRTFS_DATA *hHrtf /* i/o: HRTF handle */ + HRTFS_DATA *hHrtf /* i/o: HRTF handle */ ); ivas_error ivas_rend_initCrendWrapper( @@ -861,7 +861,7 @@ ivas_error ivas_rend_crendProcess( const int16_t num_subframes, /* i : number of subframes to render */ const int16_t pos_idx /* i : pose index */ #else - const int16_t num_subframes /* i : number of subframes to render */ + const int16_t num_subframes /* i : number of subframes to render */ #endif ); @@ -1444,7 +1444,7 @@ void ivas_splitBinLCLDEncProcess( float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int32_t available_bits, - ivas_split_rend_bits_t *pBits + IVAS_SPLIT_REND_BITS_HANDLE pBits ); ivas_error ivas_splitBinLCLDDecOpen( @@ -1459,7 +1459,7 @@ void ivas_splitBinLCLDDecClose( void ivas_splitBinLCLDDecProcess( BIN_HR_SPLIT_LCLD_DEC_HANDLE hSplitBinLCLDDec, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t bfi @@ -1502,7 +1502,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( const int32_t SplitRendBitRate, IVAS_SPLIT_REND_CODEC splitCodec, int16_t codec_frame_size_ms, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t max_bands, @@ -1518,7 +1518,7 @@ void ivas_rend_CldfbSplitPreRendProcess( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t target_md_bits, const int16_t low_res_pre_rend_rot ); @@ -1541,7 +1541,7 @@ void ivas_splitBinPostRendClose( BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend ); void ivas_splitBinPostRendMdDec( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, @@ -1790,7 +1790,7 @@ void ivas_mat_mult_2by2_complex( ); void ivas_split_rend_bitstream_init( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t buf_len_bytes, uint8_t *pbuf ); @@ -1826,13 +1826,13 @@ void ivas_SplitRenderer_getdiagdiff( ); void ivas_split_rend_bitstream_write_int32( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t val, const int32_t bits ); int32_t ivas_split_rend_bitstream_read_int32( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t bits ); diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index 9868a8d0b54c4aeaa00c502d9e04ab31ff69a1bf..1d81dfebc9c2179a18b10524111f7f1721bf4255 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -165,7 +165,7 @@ void ivas_splitBinLCLDDecClose( void ivas_splitBinLCLDDecProcess( BIN_HR_SPLIT_LCLD_DEC_HANDLE hSplitBinLCLDDec, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t bfi ) diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index 0a4090a480019621d0ea0f45abacd8e4a78a2f2b..a0789d63a8a74d55b22c24ec605ff74bf6098372 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -156,7 +156,7 @@ void ivas_splitBinLCLDEncProcess( float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int32_t available_bits, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int32_t iBitsWritten; diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 68bfb726ad090b94f37cf51a738421f71ebfc8f0..090a959e8b5f7e2d0c50625932c8de933c00c169 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -205,7 +205,7 @@ static int32_t ivas_split_rend_huffman_code_bits_present( static int16_t ivas_split_rend_huffman_decode_opt( ivas_split_rend_huffman_cfg_t *huff_cfg, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int16_t *idx_trav_list ) { int32_t i, ind, code, num_bits, code_b, num_bits_read; @@ -343,7 +343,7 @@ static void ivas_split_rend_unquant_md( *-----------------------------------------------------------------------------------------*/ static void ivas_splitBinPostRendMdBase2Dec( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int16_t num_subframes, @@ -484,7 +484,7 @@ static void ivas_splitBinPostRendMdBase2Dec( *-----------------------------------------------------------------------------------------*/ static void ivas_splitBinPostRendMdHuffDec( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int16_t num_subframes, @@ -661,7 +661,7 @@ static void ivas_splitBinPostRendMdHuffDec( *-----------------------------------------------------------------------------------------*/ void ivas_splitBinPostRendMdDec( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index 6e97d70a5d13dec591e8c9444961ecca4b0dd4eb..bba54f8c8b8044cc7bba1e4bb320a5afeaba7c59 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -835,7 +835,7 @@ static void ivas_SplitRenderer_code_md_base2( const int16_t bands_pitch, const int16_t pred_real_bands_roll, const int16_t pred_imag_bands_roll, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int16_t pos_idx, b, ch1, ch2, sf_idx; int16_t min_pred_idx, min_gd_idx, min_p_gd_idx, pred_code_len, gd_code_len, p_gd_code_len, num_poses; @@ -994,7 +994,7 @@ static void ivas_SplitRenderer_code_md_huff( const int16_t bands_pitch, const int16_t pred_real_bands_roll, const int16_t pred_imag_bands_roll, - ivas_split_rend_bits_t *pBits ) + IVAS_SPLIT_REND_BITS_HANDLE pBits ) { int16_t pos_idx, b, ch1, ch2, sf_idx, num_poses; int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; @@ -1175,7 +1175,7 @@ static void ivas_SplitRenderer_quant_code( const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, const IVAS_QUATERNION headPosition, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int16_t low_res_pre_rend_rot, const int32_t target_md_bits ) { @@ -1552,7 +1552,7 @@ void ivas_rend_CldfbSplitPreRendProcess( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t target_md_bits, const int16_t low_res_pre_rend_rot ) { @@ -2193,7 +2193,7 @@ void ivas_split_renderer_close( static ivas_error splitRendLc3plusEncodeAndWrite( SPLIT_REND_WRAPPER *hSplitBin, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t SplitRendBitRate, float *in[] ) { @@ -2246,7 +2246,7 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( const IVAS_QUATERNION headPosition, const int32_t SplitRendBitRate, const int16_t codec_frame_size_ms, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int16_t max_bands, float *in[], const int16_t low_res_pre_rend_rot, @@ -2469,7 +2469,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( const int32_t SplitRendBitRate, IVAS_SPLIT_REND_CODEC splitCodec, int16_t codec_frame_size_ms, - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t max_bands, diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index 3583294f61cc16cbeaddac3c1e26e5fde4627412..7e361c4e26e61aa99027b26f142d1bfdd90e1451 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -92,7 +92,7 @@ void ivas_mat_mult_2by2_complex( *------------------------------------------------------------------------*/ void ivas_split_rend_bitstream_init( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t buf_len_bytes, uint8_t *pbuf ) { @@ -385,7 +385,7 @@ void ivas_SplitRenderer_getdiagdiff( *------------------------------------------------------------------------*/ int32_t ivas_split_rend_bitstream_read_int32( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t bits ) { int32_t val, k, bit_val; @@ -415,7 +415,7 @@ int32_t ivas_split_rend_bitstream_read_int32( *------------------------------------------------------------------------*/ void ivas_split_rend_bitstream_write_int32( - ivas_split_rend_bits_t *pBits, + IVAS_SPLIT_REND_BITS_HANDLE pBits, const int32_t val, const int32_t bits ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 96e57509933b2ca7cfd1e69600b826364c5e10dd..e505058edfb6a3132f5cf5b8a6d3359276b0ad25 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -341,7 +341,7 @@ static float *getSmplPtr( #ifdef SPLIT_REND_WITH_HEAD_ROT static void convertBitsBufferToInternalBitsBuff( const IVAS_REND_BitstreamBuffer outBits, - ivas_split_rend_bits_t *hBits ) + IVAS_SPLIT_REND_BITS_HANDLE hBits ) { hBits->bits_buf = outBits.bits; hBits->bits_read = outBits.config.bitsRead; @@ -356,7 +356,7 @@ static void convertBitsBufferToInternalBitsBuff( static void convertInternalBitsBuffToBitsBuffer( IVAS_REND_BitstreamBuffer *hOutBits, - const ivas_split_rend_bits_t bits ) + const IVAS_SPLIT_REND_BITS_DATA bits ) { hOutBits->bits = bits.bits_buf; hOutBits->config.bitsRead = bits.bits_read; @@ -2491,7 +2491,6 @@ static void clearInputMc( efap_free_data( &inputMc->efapInWrapper.hEfap ); } - #ifdef SPLIT_REND_WITH_HEAD_ROT ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses ); #else @@ -7221,7 +7220,7 @@ static void renderSbaToSba( #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error splitBinLc3plusDecode( SPLIT_POST_REND_WRAPPER *hSplitBin, - ivas_split_rend_bits_t *bits, + IVAS_SPLIT_REND_BITS_HANDLE bits, float outputBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k], IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction ) { @@ -7268,7 +7267,7 @@ static ivas_error renderSplitBinauralWithPostRot( float Cldfb_ImagBuffer_Binaural_5ms[MAX_PARAM_SPATIAL_SUBFRAMES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t sf_idx, ch_idx; - ivas_split_rend_bits_t bits; + IVAS_SPLIT_REND_BITS_DATA bits; float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; float tmpCrendBuffer_sf[BINAURAL_CHANNELS][L_FRAME48k]; COMBINED_ORIENTATION_HANDLE pCombinedOrientationData; @@ -8605,7 +8604,7 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_SetIsmMetadataDelay( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const float sync_md_delay /* i : ISM Metadata Delay in ms to sync with audio delay */ ) { @@ -8797,7 +8796,7 @@ static ivas_error getSamplesInternal( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { - ivas_split_rend_bits_t bits; + IVAS_SPLIT_REND_BITS_DATA bits; int16_t cldfb_in_flag; float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 06d94c6caed7a068257a7ef17a5b85a06a9312ad..1224ab54626fe4b0190cfb80eb2d2792ccda10b8 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -48,19 +48,6 @@ #define RENDERER_MAX_BIN_INPUTS 1 #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT -/*----------------------------------------------------------------------------------* - * Split rendering bitrate constants - *----------------------------------------------------------------------------------*/ - -#define SPLIT_REND_256k 256000 -#define SPLIT_REND_320k 320000 -#define SPLIT_REND_384k 384000 -#define SPLIT_REND_512k 512000 -#define SPLIT_REND_768k 768000 -#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k -#define SPLIT_REND_ADDITIONAL_BYTES_TO_READ 1 -#endif /*---------------------------------------------------------------------* * Renderer structures diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 5028ac88bb34a0df25efc22a840641bb132a6f31..1a08a69297ab1380a7c87c04aaa0b190f5f36c7a 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -354,7 +354,7 @@ ivas_error split_rend_read_bits_from_file( { return IVAS_ERR_FAILED_FILE_READ; } - for ( i = 0; i < SPLIT_REND_ADDITIONAL_BYTES_TO_READ; i++ ) + for ( i = 0; i < IVAS_SPLIT_REND_ADDITIONAL_BYTES_TO_READ; i++ ) { bits[num_bytes + i] = 0; }