diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cc24ab729eb6a795d53872a700710ee2fbc5332e..d047b4e906902fe4812947267a9eb7b1b8cc9614 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -594,8 +594,7 @@ split-rendering-pytest-on-merge-request: # some helper variables - "|| true" to prevent failures from grep not finding anything - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[split*[ -]*non[ -]*be\]") || true - # TODO: needs splitting the test between reference and cut generation - #- ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true + - ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true # store the current commit hash - source_branch_commit_sha=$(git rev-parse HEAD) @@ -615,6 +614,9 @@ split-rendering-pytest-on-merge-request: - make clean - make -j + ### Run test using main branch scripts and input + - if [ $ref_using_main == 1 ]; then git checkout $target_commit; fi + # run test - exit_code=0 - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering_be_comparison.py || exit_code=$? diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_mspc.txt b/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_mspc.txt new file mode 100644 index 0000000000000000000000000000000000000000..cbba6f14e835579676ff72b07a95f51c7acf491b --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_mspc.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = 1536000; +DOF = 2; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_mspc.txt b/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_mspc.txt new file mode 100644 index 0000000000000000000000000000000000000000..ccca80ee758c78091e2a861f27578918d206815e --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_mspc.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = 1792000; +DOF = 3; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_mspc.txt b/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_mspc.txt new file mode 100644 index 0000000000000000000000000000000000000000..7c6cc741164b809f8ec0c53de764a248007d1560 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_mspc.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = 320000; +DOF = 0; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_mspc.txt b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_mspc.txt new file mode 100644 index 0000000000000000000000000000000000000000..34911224be633d5458c18a5e3c13e3566d317b47 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_mspc.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = 768000; +DOF = 1; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/lc3plus/adjust_global_gain.c b/lc3plus/adjust_global_gain.c index 803240f74818e1fa60a76a5c77034a5fb8c0d5ae..e7674dd7101b7079137738cd85e859562c1ed0ce 100644 --- a/lc3plus/adjust_global_gain.c +++ b/lc3plus/adjust_global_gain.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_idx_off, LC3_FLOAT* gain, LC3_INT target, LC3_INT nBits, LC3_INT* gainChange, LC3_INT fs_idx diff --git a/lc3plus/al_fec_fl.c b/lc3plus/al_fec_fl.c index fd0b55b91e115d41fc713efa2e8c1811cea700d7..0cae36dade9bf580d3774b942dec6eb24b3cf62d 100644 --- a/lc3plus/al_fec_fl.c +++ b/lc3plus/al_fec_fl.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "stdint.h" #include #include diff --git a/lc3plus/apply_global_gain.c b/lc3plus/apply_global_gain.c index 45bfae5343523cc5ca90a9831537e2f07808399f..c67432e2c3bebcc30da1912ea0c63813f3471d46 100644 --- a/lc3plus/apply_global_gain.c +++ b/lc3plus/apply_global_gain.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processApplyGlobalGain_fl(LC3_FLOAT x[], LC3_INT xLen, LC3_INT global_gain_idx, LC3_INT global_gain_off) diff --git a/lc3plus/ari_codec.c b/lc3plus/ari_codec.c index 238e2a1268036d55fcdaa301c43fd0cd6ab944d6..80c75fcf0cebcf278e4522643ab460beb46cc5bf 100644 --- a/lc3plus/ari_codec.c +++ b/lc3plus/ari_codec.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static void ac_shift_fl(Encoder_State_fl* st); diff --git a/lc3plus/attack_detector.c b/lc3plus/attack_detector.c index 83643d76c2c0b7a4781a518697cf9d647184162f..c9f7c0a94c0be6529592f96793969ff5b2edb5b4 100644 --- a/lc3plus/attack_detector.c +++ b/lc3plus/attack_detector.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void attack_detector_fl(LC3_FLOAT* in, LC3_INT frame_size, LC3_INT fs, LC3_INT* lastAttackPosition, LC3_FLOAT* accNrg, LC3_INT* attackFlag, diff --git a/lc3plus/constants.c b/lc3plus/constants.c index b32edab9e61e61fe0ec6f4d086ffff2563570763..8189761a04c12632f10a502e51f0479efbdc00fe 100644 --- a/lc3plus/constants.c +++ b/lc3plus/constants.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" /* DCT */ diff --git a/lc3plus/cutoff_bandwidth.c b/lc3plus/cutoff_bandwidth.c index ea8ad00c9d83ad3bd8fb94a825e5b196d749c524..642b2afda2ef1848f5b232a4caf9d0770db6ef57 100644 --- a/lc3plus/cutoff_bandwidth.c +++ b/lc3plus/cutoff_bandwidth.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void process_cutoff_bandwidth(LC3_FLOAT *d_fl, LC3_INT len, LC3_INT bw_bin) diff --git a/lc3plus/dct4.c b/lc3plus/dct4.c index b470430b94d5ba7e9213b8e3104b5b1f6dd3d73e..8fd5784b287477aeffd3ee987e81527f755f2163 100644 --- a/lc3plus/dct4.c +++ b/lc3plus/dct4.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void dct2_init(Dct2* dct, int length) diff --git a/lc3plus/dec_entropy.c b/lc3plus/dec_entropy.c index ec7c09708db508679a15bcce353cee739097ed10..d8512a1068b49c042f627936fa46b0b3df21339b 100644 --- a/lc3plus/dec_entropy.c +++ b/lc3plus/dec_entropy.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit); diff --git a/lc3plus/dec_lc3_fl.c b/lc3plus/dec_lc3_fl.c index 51c430060d52ed4387387a29ade4a2808ec61af6..88c528b0f639178567a55b87a2084a20cc9b8864 100644 --- a/lc3plus/dec_lc3_fl.c +++ b/lc3plus/dec_lc3_fl.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/detect_cutoff_warped.c b/lc3plus/detect_cutoff_warped.c index b34a88a4c016e87b9306feb9abcdafd12e2c624d..9392867208e6d9270092e5789153a267c68f13e8 100644 --- a/lc3plus/detect_cutoff_warped.c +++ b/lc3plus/detect_cutoff_warped.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT* bw_idx) diff --git a/lc3plus/enc_entropy.c b/lc3plus/enc_entropy.c index ed34bca7b80188d8695a25a3adb2654019b26149..a7ff8cd70006ea601d7ffa0b579989a3258ba9f7 100644 --- a/lc3plus/enc_entropy.c +++ b/lc3plus/enc_entropy.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT numbytes, LC3_INT bw_cutoff_bits, diff --git a/lc3plus/enc_lc3_fl.c b/lc3plus/enc_lc3_fl.c index 5bf05465a4b158af0dfb265917c3fefbf0505ded..c89f7244ca8e03bc7593d0a49ebc873f14981c8c 100644 --- a/lc3plus/enc_lc3_fl.c +++ b/lc3plus/enc_lc3_fl.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s_in, uint8_t* bytes, int bps diff --git a/lc3plus/estimate_global_gain.c b/lc3plus/estimate_global_gain.c index df4b1bc5461c64156549cd8a815cb2c9261dd0e4..df9b1f5f238f39cfe0c41ae58c398b8746a970df 100644 --- a/lc3plus/estimate_global_gain.c +++ b/lc3plus/estimate_global_gain.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/fft/cfft.c b/lc3plus/fft/cfft.c index e1bcc2806f7520fba843797df5cf57ff3fd42ab4..4bd8d29ade753c2c594dc34d0680fbdb3b9c5e8a 100644 --- a/lc3plus/fft/cfft.c +++ b/lc3plus/fft/cfft.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "cfft.h" #include "iisfft.h" /* for M_PIl */ #include /* for abs() */ diff --git a/lc3plus/fft/iis_fft.c b/lc3plus/fft/iis_fft.c index 1ff9b8303ed882c87b603958d00289a7b255b74a..b1f8ab5ab8d42629700fa31642587bb93f4900e5 100644 --- a/lc3plus/fft/iis_fft.c +++ b/lc3plus/fft/iis_fft.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include #include #include diff --git a/lc3plus/fft/iisfft.c b/lc3plus/fft/iisfft.c index 2b5829b220e20fb1106cb377a2b958b2f129d77e..227d2b6037c8fef97141631b512e6736987603b9 100644 --- a/lc3plus/fft/iisfft.c +++ b/lc3plus/fft/iisfft.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include #include /* for mmove */ diff --git a/lc3plus/imdct.c b/lc3plus/imdct.c index 597c21e0df740f7c49a0f152166f7f8dbc76425e..5d38aa6cc78077272ea68a12eb0bcf05a5d714ee 100644 --- a/lc3plus/imdct.c +++ b/lc3plus/imdct.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" /* Function expects already flipped window */ diff --git a/lc3plus/lc3.c b/lc3plus/lc3.c index 8b4ebafaa61d9e14a24b74d17cbf7d6d88b577c9..17d2ccb71296628426a4edbb9598145b700ecf1f 100644 --- a/lc3plus/lc3.c +++ b/lc3plus/lc3.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "lc3.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/lc3plus_fft.c b/lc3plus/lc3plus_fft.c index 89c6eff2a2b2c44b340cabaf2f7a20f5d9a8c59b..14f443f860d995f76b063ecbbe8636f54b52720f 100644 --- a/lc3plus/lc3plus_fft.c +++ b/lc3plus/lc3plus_fft.c @@ -6,8 +6,9 @@ * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * ******************************************************************************/ - + +#include "options.h" #include "functions.h" #include "fft/iis_fft.c" #include "fft/iisfft.c" @@ -15,14 +16,14 @@ void fft_init(Fft* fft, int length) { - assert(length % 2 == 0); HANDLE_IIS_FFT handle = NULL; IIS_FFT_ERROR error = 0; - + assert(length % 2 == 0); + fft->length = length; - + error = LC3_IIS_CFFT_Create(&handle, length, IIS_FFT_FWD); - + assert(error == IIS_FFT_NO_ERROR); fft->handle = handle; } @@ -30,10 +31,10 @@ void fft_init(Fft* fft, int length) void fft_free(Fft* fft) { IIS_FFT_ERROR error = 0; - + if (fft) { error = LC3_IIS_CFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); - + assert(error == IIS_FFT_NO_ERROR); memset(fft, 0, sizeof(*fft)); } @@ -53,8 +54,8 @@ void real_fft_free(Fft* fft) void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) { - assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; + assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ fft->length = length; @@ -66,8 +67,8 @@ void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) void real_ifft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) { - assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; + assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ fft->length = length; @@ -81,7 +82,7 @@ void fft_apply(Fft* fft, const Complex* input, Complex* output) { IIS_FFT_ERROR error = 0; error = LC3_IIS_FFT_Apply_CFFT(fft->handle, input, output); - + assert(error == IIS_FFT_NO_ERROR); } @@ -89,11 +90,10 @@ void fft_apply(Fft* fft, const Complex* input, Complex* output) void real_fft_apply(Fft* fft, const LC3_FLOAT* input, LC3_FLOAT* output) { IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; - + UNUSED(error); - error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); + error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); assert(error == IIS_FFT_NO_ERROR); } - diff --git a/lc3plus/ltpf_coder.c b/lc3plus/ltpf_coder.c index 5f8cff63acb5b6c2c2adcc424bbdec84fd324eda..fac8c481c003aee4bf8fb8b2d03b921cd33a047f 100644 --- a/lc3plus/ltpf_coder.c +++ b/lc3plus/ltpf_coder.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len); diff --git a/lc3plus/ltpf_decoder.c b/lc3plus/ltpf_decoder.c index c881801618d850c129dd0ea2b95c5df154ebe64e..a40c85213a13afa678bd1e4cbff6a62b5169086a 100644 --- a/lc3plus/ltpf_decoder.c +++ b/lc3plus/ltpf_decoder.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT fs, LC3_FLOAT* mem_old_x, LC3_FLOAT* mem_old_y, diff --git a/lc3plus/mdct.c b/lc3plus/mdct.c index 8b50397a8e63a77470e0328fdc342396e3bfd9d1..11618b9465d4e3303f4251a50142f1f3b2954f31 100644 --- a/lc3plus/mdct.c +++ b/lc3plus/mdct.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT hrmode) diff --git a/lc3plus/mdct_shaping.c b/lc3plus/mdct_shaping.c index 1033802ac50fe5c9e683daaeab9496960c5e86e8..18761925042015e48be9b8e9f9bbb2ea46a0e376 100644 --- a/lc3plus/mdct_shaping.c +++ b/lc3plus/mdct_shaping.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processMdctShaping_fl(LC3_FLOAT x[], LC3_FLOAT scf[], const LC3_INT bands_offset[], LC3_INT fdns_npts) diff --git a/lc3plus/near_nyquist_detector.c b/lc3plus/near_nyquist_detector.c index 215e309e2e4e41bc5ad9405e48e7468588992ebc..ce94351302bcce089ac5c764420ae8fb4487cff2 100644 --- a/lc3plus/near_nyquist_detector.c +++ b/lc3plus/near_nyquist_detector.c @@ -8,6 +8,7 @@ ******************************************************************************/ #include "functions.h" +#include "options.h" void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT fs_idx, const LC3_INT near_nyquist_index, diff --git a/lc3plus/noise_factor.c b/lc3plus/noise_factor.c index c92a94158c1ecba3f2a6e5b965bb47027f6d21c2..c5aa582e456812b02a60d7a27d3ad935e55fb210 100644 --- a/lc3plus/noise_factor.c +++ b/lc3plus/noise_factor.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3_INT frame_dms, diff --git a/lc3plus/noise_filling.c b/lc3plus/noise_filling.c index a5a6b4b424db6e2e2beffa7626779858c51fc151..7fac5e0f72de7b66130fcbbd93ee99e794543d3e 100644 --- a/lc3plus/noise_filling.c +++ b/lc3plus/noise_filling.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx) diff --git a/lc3plus/olpa.c b/lc3plus/olpa.c index cc6e76371659eac0634072329b0d7ac797af484b..6bec50952e5966214080221eb36e156b9ba0b176 100644 --- a/lc3plus/olpa.c +++ b/lc3plus/olpa.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_FLOAT len_buf, LC3_INT len_input); diff --git a/lc3plus/pc_apply.c b/lc3plus/pc_apply.c index e9cd3e62b6fea1ab0762384de585f717b58a7da2..1d1bc40005b4d9382cb951570a6dbf569d5ab19a 100644 --- a/lc3plus/pc_apply.c +++ b/lc3plus/pc_apply.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/pc_classify.c b/lc3plus/pc_classify.c index 96be02911959eda794494f1d339a8f8db55dae3f..71196edb89692cf1ebdbf8a1508e31174e92b8ae 100644 --- a/lc3plus/pc_classify.c +++ b/lc3plus/pc_classify.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/pc_main.c b/lc3plus/pc_main.c index b0d853d6a784ddf06632e19f99f5abee3b2ce55a..268ee94d2a383cf043d99089da3829907702c9c4 100644 --- a/lc3plus/pc_main.c +++ b/lc3plus/pc_main.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/pc_update.c b/lc3plus/pc_update.c index 62b9d3f8dc9f03524e214d833edef1f805d35b88..57539b50797673f624e35305a0bddb11614911b2 100644 --- a/lc3plus/pc_update.c +++ b/lc3plus/pc_update.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/per_band_energy.c b/lc3plus/per_band_energy.c index 538f6e6615c70c1b2b6415ed5dffdb8fa2930f48..db1b5b2d0f411925327aacd78ace3c30ce239b47 100644 --- a/lc3plus/per_band_energy.c +++ b/lc3plus/per_band_energy.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d) diff --git a/lc3plus/plc_classify.c b/lc3plus/plc_classify.c index 20f577b3663611df81f19b12f7757a671ada0498..619a1f7419b1301242a9bb9264b5f7fe77330c89 100644 --- a/lc3plus/plc_classify.c +++ b/lc3plus/plc_classify.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/plc_compute_stab_fac.c b/lc3plus/plc_compute_stab_fac.c index 049c07251413e26836d55fc0017a5c46d8b0e4af..4a1111a2c7317f29d815fe0c0346d314b9e17569 100644 --- a/lc3plus/plc_compute_stab_fac.c +++ b/lc3plus/plc_compute_stab_fac.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/plc_damping_scrambling.c b/lc3plus/plc_damping_scrambling.c index 347276ab1db52600598c019eaf39b309d1a28c20..ecea32be5fa151684a7ced58dd0c5d7e04b045d7 100644 --- a/lc3plus/plc_damping_scrambling.c +++ b/lc3plus/plc_damping_scrambling.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/plc_main.c b/lc3plus/plc_main.c index 877196b7ff510bd02b87e98997a7dc0432d8a82f..df3fd184d903c169de288fd2630816b027129b3f 100644 --- a/lc3plus/plc_main.c +++ b/lc3plus/plc_main.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* decoder, DecSetup* h_DecSetup, LC3_INT bfi, diff --git a/lc3plus/plc_noise_substitution.c b/lc3plus/plc_noise_substitution.c index 94c3aa37aa4ca87ceb25bd6f56a00bb7fc14e173..4913ee53e5f2ac954d9f1e12f81b5979c49baf60 100644 --- a/lc3plus/plc_noise_substitution.c +++ b/lc3plus/plc_noise_substitution.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_f0_refine_first.c b/lc3plus/plc_phecu_f0_refine_first.c index 5b2309586de1a4717c67f46ebc60f2911bec812f..11ebf276b151b9c4f58f37de5632863aa8341ae1 100644 --- a/lc3plus/plc_phecu_f0_refine_first.c +++ b/lc3plus/plc_phecu_f0_refine_first.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_fec_hq.c b/lc3plus/plc_phecu_fec_hq.c index b9d63e36acb5bc3a0b7f5e0b150a8374c120313e..c25466c3e995a0310ce70c92f81070558dc6d87e 100644 --- a/lc3plus/plc_phecu_fec_hq.c +++ b/lc3plus/plc_phecu_fec_hq.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_hq_ecu.c b/lc3plus/plc_phecu_hq_ecu.c index 8429d422c91ec34f0442235e895b66072b24947d..5b1978bcabfe7995abd483962079984e38e1ab71 100644 --- a/lc3plus/plc_phecu_hq_ecu.c +++ b/lc3plus/plc_phecu_hq_ecu.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_lf_peak_analysis.c b/lc3plus/plc_phecu_lf_peak_analysis.c index 6c519071b86e4f79ffa8bd278ff681729e2757a4..0bcc98d7a489b37cdf94f118131188d17ca1a5ba 100644 --- a/lc3plus/plc_phecu_lf_peak_analysis.c +++ b/lc3plus/plc_phecu_lf_peak_analysis.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_rec_frame.c b/lc3plus/plc_phecu_rec_frame.c index 6b86a7a7430900f5a00ea1167e49ed62bbbd1825..0e6570743ae7f8464e17d0b891a389ee3b1cccd0 100644 --- a/lc3plus/plc_phecu_rec_frame.c +++ b/lc3plus/plc_phecu_rec_frame.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_setf0hz.c b/lc3plus/plc_phecu_setf0hz.c index b713fd93a800d80b4859d8d742c6cd197b327eb4..b14327e2b2af0f4c04c1f9bc633e0ac06a1a2114 100644 --- a/lc3plus/plc_phecu_setf0hz.c +++ b/lc3plus/plc_phecu_setf0hz.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_spec_ana.c b/lc3plus/plc_phecu_spec_ana.c index 89724d1575dd314a777954c86e68e3cefb3198a5..b49690030596c08363f4168b5b6d1abd8c9d3b7b 100644 --- a/lc3plus/plc_phecu_spec_ana.c +++ b/lc3plus/plc_phecu_spec_ana.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_subst_spec.c b/lc3plus/plc_phecu_subst_spec.c index 7b44ccc78cbbcd609a8ffa52ae2d45f6140e81ee..43f806339b8ed85c9b5a1ebae1f1586210dda817 100644 --- a/lc3plus/plc_phecu_subst_spec.c +++ b/lc3plus/plc_phecu_subst_spec.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" #include "constants.h" diff --git a/lc3plus/plc_phecu_tba_per_band_gain.c b/lc3plus/plc_phecu_tba_per_band_gain.c index 6cd8168811b895396b03736f5497ce3427318d91..9f585f28dd8104991b5598f8f029df55f69d0433 100644 --- a/lc3plus/plc_phecu_tba_per_band_gain.c +++ b/lc3plus/plc_phecu_tba_per_band_gain.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_tba_spect_Xavg.c b/lc3plus/plc_phecu_tba_spect_Xavg.c index e8cca43309212713c9e3d06718a9825742810aad..600b9714e45865fb437ea653d8de8e2dab182a23 100644 --- a/lc3plus/plc_phecu_tba_spect_Xavg.c +++ b/lc3plus/plc_phecu_tba_spect_Xavg.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_tba_trans_dect_gains.c b/lc3plus/plc_phecu_tba_trans_dect_gains.c index 61107dec58aea9a56feea3b5802cd30b23a5fd84..e5f0d3caae0d71e0600e9281e0e84f7c781489b4 100644 --- a/lc3plus/plc_phecu_tba_trans_dect_gains.c +++ b/lc3plus/plc_phecu_tba_trans_dect_gains.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_phecu_trans_burst_ana_sub.c b/lc3plus/plc_phecu_trans_burst_ana_sub.c index 34eadd7cf788e32ee05f029dc45de7c9943d9ec6..c860cd6ce3d69968dbd7b217ae7f363a7e791e27 100644 --- a/lc3plus/plc_phecu_trans_burst_ana_sub.c +++ b/lc3plus/plc_phecu_trans_burst_ana_sub.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "defines.h" #include "functions.h" diff --git a/lc3plus/plc_tdc.c b/lc3plus/plc_tdc.c index bbee9e0651defc2e0f5cc30d22139fed545ab007..1a1a408f4d9d3b6216f048c34704735256eb5562 100644 --- a/lc3plus/plc_tdc.c +++ b/lc3plus/plc_tdc.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" /***************************************************************************\ * contents/description: Main function for Time domain concealment \***************************************************************************/ diff --git a/lc3plus/plc_tdc_tdac.c b/lc3plus/plc_tdc_tdac.c index 4d36d870ada89190f1727d65715f8660b84b1e71..329361b14c7f995b74a6ca2de051011c81ec088c 100644 --- a/lc3plus/plc_tdc_tdac.c +++ b/lc3plus/plc_tdc_tdac.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/plc_update.c b/lc3plus/plc_update.c index e19515fd7a6548a77f4cc4c2922b53db7b25126c..a151420eb7484c7fca0aaa3af5b67f4f994eec27 100644 --- a/lc3plus/plc_update.c +++ b/lc3plus/plc_update.c @@ -8,6 +8,7 @@ ******************************************************************************/ #include "functions.h" +#include "options.h" void processPlcUpdate_fl(PlcAdvSetup *PlcAdvSetup, LC3_INT32 frame_length, LC3_FLOAT *syntM, LC3_FLOAT *scf_q, diff --git a/lc3plus/quantize_spec.c b/lc3plus/quantize_spec.c index 95f4433f5a051bed4f8285d4734e8bff6bfd1af4..7886b4586d6e412a8c9aa44dbf004ed738ec61a6 100644 --- a/lc3plus/quantize_spec.c +++ b/lc3plus/quantize_spec.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static LC3_INT sign(LC3_FLOAT x); diff --git a/lc3plus/reorder_bitstream.c b/lc3plus/reorder_bitstream.c index e69809eb32fb80a9861572731214bf31387a1ca5..77b50d7a13ba0dc8ffda32396bb5342b6438961d 100644 --- a/lc3plus/reorder_bitstream.c +++ b/lc3plus/reorder_bitstream.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" diff --git a/lc3plus/resamp12k8.c b/lc3plus/resamp12k8.c index fa8d3c828cb08ffc5c7a80fc61f6955bce302e76..0cab5daae94fdd67d480dd8d3b2f7ef2cd55db4f 100644 --- a/lc3plus/resamp12k8.c +++ b/lc3plus/resamp12k8.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3_INT mem_in_len, LC3_FLOAT mem_50[], LC3_FLOAT mem_out[], diff --git a/lc3plus/residual_coding.c b/lc3plus/residual_coding.c index e5d90124c0b7bfbb2ddcab0986dda01c7d58dc4e..42094d275f2a2cfb6b42b92dd0ad21f79b503fd1 100644 --- a/lc3plus/residual_coding.c +++ b/lc3plus/residual_coding.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t* resBits, LC3_INT* numResBits diff --git a/lc3plus/residual_decoding.c b/lc3plus/residual_decoding.c index f0b9d64815c4ce6e6d01eb2bf33a31c223b3ab45..97fd94afc35e19d43c5a7866bbffb92758cdad96 100644 --- a/lc3plus/residual_decoding.c +++ b/lc3plus/residual_decoding.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec, uint8_t prm[], LC3_INT resQBits diff --git a/lc3plus/setup_com_lc3.c b/lc3plus/setup_com_lc3.c index ca876eb78d92c8cb1693fa7230ece7ca400a4299..17054d1ffcfdd63015e0e169b199ae606379217f 100644 --- a/lc3plus/setup_com_lc3.c +++ b/lc3plus/setup_com_lc3.c @@ -8,6 +8,7 @@ ******************************************************************************/ #include "functions.h" +#include "options.h" LC3_FLOAT array_max_abs(LC3_FLOAT *in, LC3_INT32 len) { diff --git a/lc3plus/setup_dec_lc3.c b/lc3plus/setup_dec_lc3.c index 8cf92311c9c1ab1b382179911760d0c59e4b5ba7..c14309720ec4e0cae213b81d64ef7b170a5b651d 100644 --- a/lc3plus/setup_dec_lc3.c +++ b/lc3plus/setup_dec_lc3.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "setup_dec_lc3.h" #include "functions.h" #include diff --git a/lc3plus/setup_enc_lc3.c b/lc3plus/setup_enc_lc3.c index 27401aca19da363d80500dac9cf210092b554ba1..986b43d6085443e801d293370634cd30bf9c7b6d 100644 --- a/lc3plus/setup_enc_lc3.c +++ b/lc3plus/setup_enc_lc3.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "setup_enc_lc3.h" #include "functions.h" #include diff --git a/lc3plus/sns_compute_scf.c b/lc3plus/sns_compute_scf.c index 744d9e2d6da69c4f38c35993b79b06d9a778fc52..5cb041925bbcf0dc5b8a0c47f0b5d8aa07d01bd1 100644 --- a/lc3plus/sns_compute_scf.c +++ b/lc3plus/sns_compute_scf.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor) diff --git a/lc3plus/sns_interpolate_scf.c b/lc3plus/sns_interpolate_scf.c index 49bf0afe37c3c8b5c1579ebaacd5ae64a8e0de26..4419397890d890f097d538b3ee4799ca1a14c7b9 100644 --- a/lc3plus/sns_interpolate_scf.c +++ b/lc3plus/sns_interpolate_scf.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_int) diff --git a/lc3plus/sns_quantize_scf.c b/lc3plus/sns_quantize_scf.c index 738738eb32e9a202020aa0653ae49b35b7ce8ecf..704127cce71fdab61027a76f66f9382859048ed4 100644 --- a/lc3plus/sns_quantize_scf.c +++ b/lc3plus/sns_quantize_scf.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static void pvq_dec(LC3_INT k, LC3_INT m, LC3_INT LS_ind, LC3_INT MPVQ_ind, LC3_INT* pulses); diff --git a/lc3plus/tns_coder.c b/lc3plus/tns_coder.c index 257e2b32ad1deaf2822a5544034b81440d1ba9a6..ff3883d2b5fa964a7a2c4a4523757432d080a5cb 100644 --- a/lc3plus/tns_coder.c +++ b/lc3plus/tns_coder.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" static void xcorr(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT lag, LC3_INT inLen); diff --git a/lc3plus/tns_decoder.c b/lc3plus/tns_decoder.c index 8b20652e5c6a2e4fa2afc5f99f37e7f3b4f8f240..d3aeefc3a379a224273e7cc7b7be1eee545af774 100644 --- a/lc3plus/tns_decoder.c +++ b/lc3plus/tns_decoder.c @@ -8,6 +8,7 @@ ******************************************************************************/ +#include "options.h" #include "functions.h" void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT numfilters, LC3_INT bw_fcbin, LC3_INT N, LC3_INT fs) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 59f63879350f94c087720ff95b09b8e3c3f889e7..df76be9296a0d0be454935142db90d3b29d33bd7 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -105,6 +105,9 @@ typedef enum { IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB, +#ifdef SPLIT_REND_TD_POSE_CORRECTION + IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD, +#endif } IVAS_SPLIT_REND_POSE_CORRECTION_MODE; typedef enum diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 4cd06c6ed45e1bdf67dcc36a717ca47b599211c4..fa5eb1c349d2109f94ea5273a62e65dd34a0ff85 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1539,7 +1539,13 @@ typedef enum #define SPLIT_REND_MAX_DOF (3) -#define MAX_HEAD_ROT_POSES (2 + SPLIT_REND_MAX_YAW_ONLY_POSES + SPLIT_REND_MAX_PITCH_ONLY_POSES + SPLIT_REND_MAX_ROLL_ONLY_POSES) /* TODO tmu : revisit for harmonization */ +#define MAX_HEAD_ROT_POSES (2 + SPLIT_REND_MAX_YAW_ONLY_POSES + SPLIT_REND_MAX_PITCH_ONLY_POSES + SPLIT_REND_MAX_ROLL_ONLY_POSES) +#ifdef SPLIT_REND_TD_POSE_CORRECTION +#define SPLIT_REND_MSPC_NPOSES_0DOF (1) +#define SPLIT_REND_MSPC_NPOSES_1DOF (3) +#define SPLIT_REND_MSPC_NPOSES_2DOF (7) +#define SPLIT_REND_MSPC_NPOSES_3DOF (8) +#endif #define MAX_SPLIT_REND_MD_BANDS (20) #define MAX_SPLIT_MD_SUBFRAMES (1) #define COMPLEX_MD_BAND_THRESH (MAX_SPLIT_REND_MD_BANDS) @@ -1821,9 +1827,15 @@ typedef enum #define SPLIT_REND_384k 384000 #define SPLIT_REND_512k 512000 #define SPLIT_REND_768k 768000 +#ifdef SPLIT_REND_TD_POSE_CORRECTION +#define SPLIT_REND_1536k 1536000 +#define SPLIT_REND_1792k 1792000 +#define SPLIT_REND_MAX_BRATE SPLIT_REND_1792k +#else #define SPLIT_REND_MAX_BRATE SPLIT_REND_768k +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ #define SPLIT_REND_ADDITIONAL_BYTES_TO_READ ( 1 ) -#endif +#endif /* SPLIT_REND_WITH_HEAD_ROT */ /*----------------------------------------------------------------------------------* * Limiter constants diff --git a/lib_com/options.h b/lib_com/options.h index c2bc0b866b05b09d53460339bca577ae01a9052d..4e2ab323e49c01b3d983c2441a9022cbe1161a71 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -201,6 +201,7 @@ #define TD_REND_FIX_DIV_BY_ZERO /* FhG: avoid division by zero in sincResample fn */ #define RENAME_GWLPR /* FhG: Rename clashing symbol */ #define SPLIT_REND_WITH_HEAD_ROT /* Dlb,FhG: Split Rendering contributions 21 and 35 */ +#define SPLIT_REND_TD_POSE_CORRECTION /* FhG: Contribution 44: Multi-Stream Pose Correction */ #define FIX_594_STL_INCLUDE /* FhG: issue 594: Missing include of stl.h */ #define FIX_619_ADD_UNDEF_VAL_FOR_CONCEALMENT_MODE /* FhG: fix usan error */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 5ca878a00ec58382864b493b2665782dbb4f20a9..df208c88128d1fcf18c2d615e45f9ff7ae6ed5fd 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -274,6 +274,15 @@ ivas_error ivas_dec( if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + ivas_renderSplitUpdateTdCorrectionPoseData( &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); + } +#endif + ObjRenderIvasFrame_splitBinaural( st_ivas, output, output_frame ); } else @@ -849,16 +858,19 @@ ivas_error ivas_dec( max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; - ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, - st_ivas->hHeadTrackData->Quaternions, - st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, - st_ivas->hRenderConfig->split_rend_config.codec, - hSplitBinRend->hSplitRendBits, - hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, - hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, - max_band, output, 1, - st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV, - pcm_out ); + if ( ( error = ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, + st_ivas->hHeadTrackData->Quaternions, + st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, + st_ivas->hRenderConfig->split_rend_config.codec, + hSplitBinRend->hSplitRendBits, + hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, + hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, + max_band, output, 1, + st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV, + pcm_out ) ) != IVAS_ERR_OK ) + { + return error; + } free( st_ivas->splitBinRend.hMultiBinCldfbData ); } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 616069f25fbe1000500cd49ff6179189ab351bcd..fe34af9f357f6f3290aecfbd1c421f08c24d517d 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1287,10 +1287,24 @@ ivas_error ivas_init_decoder( if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - ivas_renderSplitGetMultiBinPoseData( - &st_ivas->hRenderConfig->split_rend_config, - &st_ivas->splitBinRend.splitrend.multiBinPoseData, - st_ivas->hHeadTrackData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { +#endif + ivas_renderSplitGetMultiBinPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + } + else + { + ivas_renderSplitUpdateTdCorrectionPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); + } +#endif } #endif if ( ( error = ivas_binRenderer_open( st_ivas ) ) != IVAS_ERR_OK ) @@ -1302,12 +1316,12 @@ ivas_error ivas_init_decoder( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, 0, - ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, hDecoderConfig->output_Fs, - 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + 1, st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); if ( error != IVAS_ERR_OK ) { @@ -1353,17 +1367,30 @@ ivas_error ivas_init_decoder( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, 1, - ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); - - ivas_renderSplitGetMultiBinPoseData( - &st_ivas->hRenderConfig->split_rend_config, - &st_ivas->splitBinRend.splitrend.multiBinPoseData, - st_ivas->hHeadTrackData->sr_pose_pred_axis ); + st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { +#endif + ivas_renderSplitGetMultiBinPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + } + else + { + ivas_renderSplitUpdateTdCorrectionPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); + } +#endif error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, hDecoderConfig->output_Fs, 0, - ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); if ( error != IVAS_ERR_OK ) { @@ -1412,14 +1439,28 @@ ivas_error ivas_init_decoder( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { int16_t pcm_out; - pcm_out = ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + pcm_out = st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM; ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, 1, pcm_out ); - ivas_renderSplitGetMultiBinPoseData( - &st_ivas->hRenderConfig->split_rend_config, - &st_ivas->splitBinRend.splitrend.multiBinPoseData, - st_ivas->hHeadTrackData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { +#endif + ivas_renderSplitGetMultiBinPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + } + else + { + ivas_renderSplitUpdateTdCorrectionPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); + } +#endif error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index abc9a9012dfe0b90e81193ce49f12716626a2834..12669ff8a6dcc677a787ee4dc4c54b11bf871517 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -511,10 +511,23 @@ void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS hSplitBinRend->hMultiBinCldfbData = (IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE) malloc( sizeof( IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA ) ); - ivas_renderSplitGetMultiBinPoseData( - hSplitBinConfig, - &hSplitBinRend->splitrend.multiBinPoseData, - hCombinedOrientationData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( hSplitBinConfig->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { +#endif + ivas_renderSplitGetMultiBinPoseData( + hSplitBinConfig, + &hSplitBinRend->splitrend.multiBinPoseData, + hCombinedOrientationData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + } + else + { + ivas_renderSplitUpdateTdCorrectionPoseData( + hSplitBinConfig, + &hSplitBinRend->splitrend.multiBinPoseData, + hCombinedOrientationData->sr_pose_pred_axis ); + } if ( ( hCombinedOrientationData != NULL ) && ( hSplitBinRend->splitrend.multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) ) { @@ -534,4 +547,5 @@ void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS return; } -#endif +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ +#endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 763a1b222fde2f2c596e3f0239a9ea812788475c..16fb49813d592a3668b5f6aef1e6c8b1f2c5bd19 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -274,7 +274,7 @@ ivas_error ivas_sba_dec_reconfigure( assert( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LCLD ); error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, - hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + hDecoderConfig->output_Fs, 1, st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 42ef8beaa3249d8ee4cb25a09cf62cc049fea268..4046af62302b780980467d510468229eb900b4c3 100644 --- a/lib_rend/ivas_efap.c +++ b/lib_rend/ivas_efap.c @@ -79,9 +79,11 @@ static void vertex_init( const float *aziSpk, const float *eleSpk, EFAP_VERTEX_D static void efap_panning( const float azi, const float ele, const EFAP_POLYSET_DATA *polyData, float *bufferL ); +#ifndef SPLIT_REND_TD_POSE_CORRECTION static void get_poly_gains( const float azi, const float ele, const float aziPoly[EFAP_MAX_CHAN_NUM], const float elePoly[EFAP_MAX_CHAN_NUM], const int16_t numChan, float *buffer ); static float get_tri_gain( const float A[2], const float B[2], const float C[2], const float P_minus_A[2] ); +#endif #ifdef DEBUG_EFAP_POLY_TOFILE static void get_poly_select( EFAP_POLYSET_DATA *polyData ); @@ -124,7 +126,9 @@ static int16_t get_poly_num( const float P[2], const EFAP_POLYSET_DATA *polyData static int16_t in_poly( const float P[2], const EFAP_POLYSET poly ); +#ifndef SPLIT_REND_TD_POSE_CORRECTION static int16_t in_tri( float A[2], float B[2], float C[2], float P_minus_A[2] ); +#endif static void sph2cart( const float azi, const float ele, float *pos ); @@ -1364,7 +1368,11 @@ static void efap_panning( * Compute the gain for a precise polygon *-------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_TD_POSE_CORRECTION +void get_poly_gains( +#else static void get_poly_gains( +#endif const float azi, /* i : Value of the azimuth */ const float ele, /* i : Value of the elevation */ const float aziPoly[EFAP_MAX_CHAN_NUM], /* i : Azimuths of the considered polygons */ @@ -1419,7 +1427,11 @@ static void get_poly_gains( * Compute the value of the gain for a given triangle *-------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_TD_POSE_CORRECTION +float get_tri_gain( +#else static float get_tri_gain( +#endif const float A[2], /* i : Coordinate of one apex of the triangle */ const float B[2], /* i : Coordinate of one apex of the triangle */ const float C[2], /* i : Coordinate of one apex of the triangle */ @@ -2214,7 +2226,11 @@ static int16_t in_poly( * Determines if a given point is within a triangle or not *-------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_TD_POSE_CORRECTION +int16_t in_tri( +#else static int16_t in_tri( +#endif float A[2], /* i : Coordinate of one apex of the triangle */ float B[2], /* i : Coordinate of one apex of the triangle */ float C[2], /* i : Coordinate of one apex of the triangle */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 7b345e6910357442aeaf7bbc4e885e2a480193ae..692a23bc9d8a220283ec7654dbb6874fdf92896a 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -132,6 +132,31 @@ void efap_determine_gains( const int16_t efap_mode /* i : indicates whether EFAP or EFIP is used */ ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION +void get_poly_gains( + const float azi, /* i : Value of the azimuth */ + const float ele, /* i : Value of the elevation */ + const float aziPoly[EFAP_MAX_CHAN_NUM], /* i : Azimuths of the considered polygons */ + const float elePoly[EFAP_MAX_CHAN_NUM], /* i : Elevations of the considered polygons */ + const int16_t numChan, /* i : Length of aziPoly & elePoly */ + float *buffer /* o : 1D array of length numSpk that will contain the tmp values */ +); + +float get_tri_gain( + const float A[2], /* i : Coordinate of one apex of the triangle */ + const float B[2], /* i : Coordinate of one apex of the triangle */ + const float C[2], /* i : Coordinate of one apex of the triangle */ + const float P_minus_A[2] /* i : Value of (P - A) */ +); + +int16_t in_tri( + float A[2], /* i : Coordinate of one apex of the triangle */ + float B[2], /* i : Coordinate of one apex of the triangle */ + float C[2], /* i : Coordinate of one apex of the triangle */ + float P_minus_A[2] /* i : Value of (P - A) */ +); +#endif + /*----------------------------------------------------------------------------------* * DirAC/MASA rendering @@ -909,6 +934,9 @@ IVAS_QUATERNION ivas_split_rend_get_sf_rot_data( void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend ); int32_t ivas_get_lcld_bitrate( const int32_t SplitRendBitRate, const IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ); int32_t ivas_get_split_rend_md_target_brate( const int32_t SplitRendBitRate, const int16_t pcm_out ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION +int32_t ivas_get_max_td_pose_correction_bitrate( void ); +#endif int32_t ivas_get_lc3plus_bitrate( const int32_t SplitRendBitRate, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ); int8_t ivas_get_lc3plus_bitrate_id( const int32_t SplitRendBitRate ); int32_t ivas_get_lc3plus_size_from_id( const int8_t SplitRendBitRateId, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ); @@ -1478,6 +1506,13 @@ void ivas_renderSplitUpdateNoCorrectionPoseData( const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION +void ivas_renderSplitUpdateTdCorrectionPoseData( + const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const IVAS_SPLIT_REND_ROT_AXIS rot_axis); +#endif + ivas_error ivas_renderMultiBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], @@ -1512,6 +1547,13 @@ void ivas_rend_CldfbSplitPostRendProcess( float output[][L_FRAME48k], const int16_t is_cldfb_in ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION +void ivas_rend_TdSplitPostRendProcess( + ivas_split_rend_bits_t *pBits, + IVAS_QUATERNION headPosition[MAX_PARAM_SPATIAL_SUBFRAMES], + MULTI_BIN_REND_POSE_DATA *multiBinPoseData ); +#endif + void ivas_splitBinPreRendClose( BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend ); diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 74fb7fae687b3edf11f85f490a6a9b85b3fd56f4..e8f779ea230d7acc0a62dd7291c87cc48ad21953 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -920,6 +920,38 @@ void ivas_splitBinPostRendMdDec( return; } +#ifdef SPLIT_REND_TD_POSE_CORRECTION +void ivas_rend_TdSplitPostRendProcess( + ivas_split_rend_bits_t *pBits, + IVAS_QUATERNION headPosition[MAX_PARAM_SPATIAL_SUBFRAMES], + MULTI_BIN_REND_POSE_DATA *multiBinPoseData ) +{ + const int32_t tmp_num_bits = 16; + + push_wmops( "ivas_rend_TdSplitPostRendProcess" ); + + multiBinPoseData->num_poses = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, tmp_num_bits ); + + for ( int32_t sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; ++sf_idx ) + { + headPosition[sf_idx].w = -3.0f; + headPosition[sf_idx].x = (float) ivas_split_rend_bitstream_read_int32( pBits, tmp_num_bits ) - 180; + headPosition[sf_idx].y = (float) ivas_split_rend_bitstream_read_int32( pBits, tmp_num_bits ) - 180; + headPosition[sf_idx].z = (float) ivas_split_rend_bitstream_read_int32( pBits, tmp_num_bits ) - 180; + + /* Other shifted head positions */ + for ( int32_t pose = 1; pose < multiBinPoseData->num_poses; ++pose ) + { + multiBinPoseData->relative_head_poses[pose][0] = (float) ivas_split_rend_bitstream_read_int32( pBits, tmp_num_bits ) - 180; + multiBinPoseData->relative_head_poses[pose][1] = (float) ivas_split_rend_bitstream_read_int32( pBits, tmp_num_bits ) - 180; + multiBinPoseData->relative_head_poses[pose][2] = (float) ivas_split_rend_bitstream_read_int32( pBits, tmp_num_bits ) - 180; + } + } + + pop_wmops(); +} +#endif + static void wrap_around_angle( float *a ) { if ( ( *a ) > 180.0f ) @@ -1674,4 +1706,4 @@ void ivas_init_split_post_rend_handles( SPLIT_POST_REND_WRAPPER *hSplitRendWrapp hSplitRendWrapper->first_good_frame_received = 0; return; } -#endif +#endif /* SPLIT_REND_WITH_HEAD_ROT */ diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index 1b8a157f5bf3686aa4f002c8539a8a1670d0d90c..f5907fbaa106a21196245965aa57849bd3601561 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -1526,6 +1526,58 @@ void ivas_rend_CldfbSplitPreRendProcess( return; } +#ifdef SPLIT_REND_TD_POSE_CORRECTION +static void ivas_rend_TdSplitPreRendProcess( + const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + ivas_split_rend_bits_t *pBits ) +{ + const int32_t tmp_num_bits = 16; + + push_wmops( "ivas_rend_TdSplitPreRendProcess" ); + + /* write number of poses so that decoding side knows how many x/y/z triples to read */ + ivas_split_rend_bitstream_write_int32( pBits, pMultiBinPoseData->num_poses, tmp_num_bits ); + + for ( int32_t sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; ++sf_idx ) + { + int16_t angle; + IVAS_QUATERNION head_pos_euler; + Quat2EulerDegree( headPositions[sf_idx], &head_pos_euler.z, &head_pos_euler.y, &head_pos_euler.x ); + + angle = (int16_t) roundf( head_pos_euler.x ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, tmp_num_bits ); + + angle = (int16_t) roundf( head_pos_euler.y ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, tmp_num_bits ); + + angle = (int16_t) roundf( head_pos_euler.z ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, tmp_num_bits ); + + /* Other shifted head positions. Note - these seem to be all the same for every subframe */ + for ( int32_t pose = 1; pose < pMultiBinPoseData->num_poses; ++pose ) + { + angle = (int16_t) roundf( pMultiBinPoseData->relative_head_poses[pose][0] ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, tmp_num_bits ); + + angle = (int16_t) roundf( pMultiBinPoseData->relative_head_poses[pose][1] ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, tmp_num_bits ); + + angle = (int16_t) roundf( pMultiBinPoseData->relative_head_poses[pose][2] ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, tmp_num_bits ); + } + } + + pop_wmops(); +} +#endif + ivas_error ivas_splitBinPreRendOpen( BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData @@ -1641,6 +1693,9 @@ void ivas_init_split_rend_handles( SPLIT_REND_WRAPPER *hSplitRendWrapper ) hSplitRendWrapper->lc3plusDelayBuffers[i] = NULL; } hSplitRendWrapper->lc3plusDelaySamples = 0; +#ifdef SPLIT_REND_TD_POSE_CORRECTION + hSplitRendWrapper->multiBinPoseData.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; +#endif ivas_init_multi_bin_pose_data( &hSplitRendWrapper->multiBinPoseData ); return; @@ -1658,7 +1713,18 @@ static ivas_error split_renderer_open_lc3plus( SPLIT_REND_WRAPPER *hSplitRendWra config.ivas_frame_duration_us = 20000; config.samplerate = OutSampleRate; +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( pSplitRendConfig->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + config.channels = BINAURAL_CHANNELS * hSplitRendWrapper->multiBinPoseData.num_poses; + } + else + { + config.channels = BINAURAL_CHANNELS; + } +#else config.channels = BINAURAL_CHANNELS; +#endif error = IVAS_LC3PLUS_ENC_Open( config, ivas_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode ), &hSplitRendWrapper->hLc3plusEnc ); if ( error != IVAS_ERR_OK ) @@ -1720,7 +1786,11 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, useLc3plus = pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS; /* TODO(sgi): change "useLc3plus" to "splitCodec" */ error = IVAS_ERR_OK; +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( ( pSplitRendConfig->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB && is_cldfb_in == 0 ) || pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LCLD ) +#else if ( is_cldfb_in == 0 ) +#endif { isCldfbNeeded = 1; cldfbMode = CLDFB_ANALYSIS; @@ -1921,7 +1991,11 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( useLc3plus = hSplitBin->hLc3plusEnc != NULL; - if ( useLc3plus ) + if ( useLc3plus +#ifdef SPLIT_REND_TD_POSE_CORRECTION + && hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB +#endif + ) { int32_t frame_size = hSplitBin->hLc3plusEnc->config.samplerate / (int32_t) FRAMES_PER_SECOND; @@ -1996,6 +2070,15 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( target_md_bits, low_res_pre_rend_rot ); } +#ifdef SPLIT_REND_TD_POSE_CORRECTION + else if ( hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + ivas_rend_TdSplitPreRendProcess( + headPositions, + &hSplitBin->multiBinPoseData, + pBits ); + } +#endif if ( pcm_out == 0 ) { @@ -2119,7 +2202,34 @@ ivas_error ivas_renderMultiBinToSplitBinaural( set_pose_types( hSplitBin->hBinHrSplitPreRend->pose_type, &hSplitBin->multiBinPoseData ); } - /*TODO : why should this be called during run time ?*/ +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( splitCodec == IVAS_SPLIT_REND_CODEC_LC3PLUS && hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD && !td_input ) + { + /* CLDFB synthesis */ + int16_t ch, slot_idx, pose_idx; + for ( pose_idx = 0; pose_idx < hSplitBin->multiBinPoseData.num_poses; ++pose_idx ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + float *Cldfb_In_BinReal_p[CLDFB_NO_COL_MAX]; + float *Cldfb_In_BinImag_p[CLDFB_NO_COL_MAX]; + + for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) + { + Cldfb_In_BinReal_p[slot_idx] = Cldfb_In_BinReal[ch][slot_idx]; + Cldfb_In_BinImag_p[slot_idx] = Cldfb_In_BinImag[ch][slot_idx]; + } + cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, out[pose_idx * BINAURAL_CHANNELS + ch], -1, hSplitBin->hCldfbHandles->cldfbAna[pose_idx * BINAURAL_CHANNELS + ch] ); + } + } + + td_input = 1; + } +#endif + + /* Needs to be done at runtime. If this was in another API function, + * there would be no guarantee that the user did not change + * the split rendering config before calling the main rendering function */ ivas_split_rend_choose_default_codec( &splitCodec, td_input, pcm_out ); if ( td_input ) diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index b1068054f887b1a71ecdc61000b6c6c2524b66ef..b9ec73cf6d1d2e08d795ce87de9946df1857d908 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -440,6 +440,12 @@ int32_t ivas_get_lc3plus_bitrate( const int32_t SplitRendBitRate, IVAS_SPLIT_REN int32_t inBandMdBps = (int32_t) ( 8 * FRAMES_PER_SECOND ); return ivas_get_lcld_bitrate( SplitRendBitRate, poseCorrectionMode ) - inBandMdBps; } +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + return SplitRendBitRate - ivas_get_max_td_pose_correction_bitrate(); + } +#endif if ( poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) { return SplitRendBitRate; @@ -454,6 +460,16 @@ int8_t ivas_get_lc3plus_bitrate_id( const int32_t SplitRendBitRate ) { switch ( SplitRendBitRate ) { +#ifdef SPLIT_REND_TD_POSE_CORRECTION + case SPLIT_REND_1792k: + { + return 6; + } + case SPLIT_REND_1536k: + { + return 5; + } +#endif case SPLIT_REND_768k: { return 4; @@ -487,6 +503,18 @@ int32_t ivas_get_lc3plus_size_from_id( const int8_t SplitRendBitRateId, IVAS_SPL switch ( SplitRendBitRateId ) { +#ifdef SPLIT_REND_TD_POSE_CORRECTION + case 6: + { + bitrate = SPLIT_REND_1792k; + break; + } + case 5: + { + bitrate = SPLIT_REND_1536k; + break; + } +#endif case 4: { bitrate = SPLIT_REND_768k; @@ -514,15 +542,31 @@ int32_t ivas_get_lc3plus_size_from_id( const int8_t SplitRendBitRateId, IVAS_SPL } default: { - return -1; + bitrate = -1; + break; } } +#ifdef SPLIT_REND_TD_POSE_CORRECTION bitrate = ivas_get_lc3plus_bitrate( bitrate, poseCorrectionMode ); /* Return size in bytes */ return (int32_t) ( bitrate / FRAMES_PER_SECOND / 8 ); +#else + /* Return size in bytes */ + return (int32_t) ( bitrate / FRAMES_PER_SECOND / 8 ); +#endif +} + +#ifdef SPLIT_REND_TD_POSE_CORRECTION +int32_t ivas_get_max_td_pose_correction_bitrate( void ) +{ + int32_t bits_per_value = 16; + int32_t num_values_per_frame = 1 + MAX_PARAM_SPATIAL_SUBFRAMES * MAX_HEAD_ROT_POSES * 3; + + return (int32_t) ( bits_per_value * num_values_per_frame * FRAMES_PER_SECOND ); } +#endif ivas_error ivas_split_rend_validate_config( const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, const int16_t is_pcm_out ) { @@ -538,24 +582,58 @@ ivas_error ivas_split_rend_validate_config( const IVAS_SPLIT_REND_CONFIG_DATA *p return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Only CLDFB pose correction supports HQ mode" ); } +#ifdef SPLIT_REND_TD_POSE_CORRECTION + /* Split rendering with no pose correction - 0 DOF and pose correction NONE must only ever be set together */ + if ( ( pSplitRendConfig->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE && pSplitRendConfig->dof != 0 ) || + ( pSplitRendConfig->poseCorrectionMode != IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE && pSplitRendConfig->dof == 0 ) ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "0 DOF and pose correction NONE must only ever be set together" ); + } +#endif + /* Validate bitrate */ if ( is_pcm_out == 0 ) { switch ( pSplitRendConfig->splitRendBitRate ) { - case SPLIT_REND_384k: - case SPLIT_REND_512k: - case SPLIT_REND_768k: - /* Always valid */ - break; case SPLIT_REND_256k: + if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LCLD ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Unsupported bitrate for LCLD codec" ); + } + + if ( pSplitRendConfig->dof != 0 ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "bitrates below 320 kbps are only valid with 0 DOF" ); + } + break; case SPLIT_REND_320k: /* Only valid with 0 DOF */ if ( pSplitRendConfig->dof != 0 ) { - return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "bitrates below 320 kpbs are only valid with 0 DOF" ); + return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "bitrates below 320 kbps are only valid with 0 DOF" ); + } + break; + case SPLIT_REND_384k: + case SPLIT_REND_512k: + /* Always valid */ + break; + case SPLIT_REND_768k: + if ( pSplitRendConfig->dof == 0 && pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Bitrate is too high for LC3plus with 0 DOF" ); + } + break; +#ifdef SPLIT_REND_TD_POSE_CORRECTION + case SPLIT_REND_1536k: + case SPLIT_REND_1792k: + /* Only valid with IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD */ + if ( pSplitRendConfig->poseCorrectionMode != IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Bitrate only supported with Multi-Stream Pose Correction!" ); } break; +#endif default: return IVAS_ERR_LC3PLUS_INVALID_BITRATE; } @@ -771,9 +849,118 @@ void ivas_renderSplitUpdateNoCorrectionPoseData( pMultiBinPoseData->poseCorrectionMode = pSplit_rend_config->poseCorrectionMode; } +#ifdef SPLIT_REND_TD_POSE_CORRECTION +void ivas_renderSplitUpdateTdCorrectionPoseData( + const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const IVAS_SPLIT_REND_ROT_AXIS rot_axis ) +{ + const float yawOffset = 15.0f; + const float pitchOffset = 15.0f; + const float rollOffset = 90.0f; + int16_t pos_idx; + pMultiBinPoseData->poseCorrectionMode = pSplit_rend_config->poseCorrectionMode; + + ivas_renderSplitGetMultiBinPoseData( pSplit_rend_config, pMultiBinPoseData, rot_axis ); + + if ( pSplit_rend_config->dof == 2 && pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + pMultiBinPoseData->num_poses = SPLIT_REND_MSPC_NPOSES_2DOF; + assert( pMultiBinPoseData->num_poses <= MAX_HEAD_ROT_POSES ); + + pos_idx = 1; /* first relative head pose */ + /* YAW_L_PITCH_U */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = yawOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* YAW_L_PITCH_D */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = yawOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = -1.0f * pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* YAW_R_PITCH_U */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = -1.0f * yawOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* YAW_R_PITCH_D */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = -1.0f * yawOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = -1.0f * pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* PITCH_U */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* PITCH_D */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = -1.0f * pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + + pMultiBinPoseData->dof = pSplit_rend_config->dof; + pMultiBinPoseData->hq_mode = pSplit_rend_config->hq_mode; + pMultiBinPoseData->rot_axis = rot_axis; + } + else if ( pSplit_rend_config->dof == 3 && pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + pMultiBinPoseData->num_poses = SPLIT_REND_MSPC_NPOSES_3DOF; + assert( pMultiBinPoseData->num_poses <= MAX_HEAD_ROT_POSES ); + + pos_idx = 1; /* first relative head pose */ + /* YAW_L_PITCH_U */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = yawOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* YAW_L_PITCH_D */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = yawOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = -1.0f * pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* YAW_R_PITCH_U */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = -1.0f * yawOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* YAW_R_PITCH_D */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = -1.0f * yawOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = -1.0f * pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* PITCH_U */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* PITCH_D */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = -1.0f * pitchOffset; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + pos_idx++; + /* ROLL_C */ + pMultiBinPoseData->relative_head_poses[pos_idx][0] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = rollOffset; + pos_idx++; + + pMultiBinPoseData->dof = pSplit_rend_config->dof; + pMultiBinPoseData->hq_mode = pSplit_rend_config->hq_mode; + pMultiBinPoseData->rot_axis = rot_axis; + } +} +#endif + void ivas_init_multi_bin_pose_data( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ) { int16_t pos_idx; +#ifdef SPLIT_REND_TD_POSE_CORRECTION + int16_t subframe_idx; + int16_t subframe_len; + float norm; +#endif for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) { @@ -786,6 +973,27 @@ void ivas_init_multi_bin_pose_data( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData pMultiBinPoseData->hq_mode = 0; pMultiBinPoseData->rot_axis = DEFAULT_AXIS; +#ifdef SPLIT_REND_TD_POSE_CORRECTION + subframe_len = L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES; + norm = 1.f / ( subframe_len - 1 ); + + for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) + { + set_zero( pMultiBinPoseData->td_data[subframe_idx].gains, MAX_HEAD_ROT_POSES ); + pMultiBinPoseData->td_data[subframe_idx].gains[0] = 1.f; + + pMultiBinPoseData->td_data[subframe_idx].swap_default = false; + pMultiBinPoseData->td_data[subframe_idx].swap_yaw_l = false; + pMultiBinPoseData->td_data[subframe_idx].swap_yaw_r = false; + pMultiBinPoseData->td_data[subframe_idx].swap_roll = false; + } + + for ( pos_idx = 0; pos_idx < subframe_len; pos_idx++ ) + { + pMultiBinPoseData->xfade[pos_idx] = pos_idx * norm; + } +#endif + return; } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 36c4a1783654583e146ceeaa66ccc38ad58840d6..e1630fef47144f7550de1e51c1465f6d8cd5edc4 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -662,6 +662,17 @@ typedef struct #endif } CLDFB_HANDLES_WRAPPER, *CLDFB_HANDLES_WRAPPER_HANDLE; +#ifdef SPLIT_REND_TD_POSE_CORRECTION +typedef struct +{ + bool swap_default; + bool swap_yaw_l; + bool swap_yaw_r; + bool swap_roll; + float gains[MAX_HEAD_ROT_POSES]; +} MULTI_BIN_REND_TD_POSE_CORRECTION_DATA; +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ + typedef struct { int16_t num_poses; @@ -670,6 +681,10 @@ typedef struct int16_t hq_mode; IVAS_SPLIT_REND_ROT_AXIS rot_axis; IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; +#ifdef SPLIT_REND_TD_POSE_CORRECTION + MULTI_BIN_REND_TD_POSE_CORRECTION_DATA td_data[MAX_PARAM_SPATIAL_SUBFRAMES]; + float xfade[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ } MULTI_BIN_REND_POSE_DATA; /* Forward declaration of TD_OBJECT_RENDERER_HANDLE. diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6dd53bdd025d3d6d75fe8c70f4b771223fa4c46d..e32b1dc4a80ce24317907c5f88342d8df1ec2372 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -216,6 +216,29 @@ typedef struct } input_split_post_rend; #endif +#ifdef SPLIT_REND_TD_POSE_CORRECTION +typedef enum +{ + MSPC_POSE_DEFAULT = 0, + MSPC_POSE_YAW_L, + MSPC_POSE_YAW_R, + MSPC_POSE_PITCH_U, + MSPC_POSE_PITCH_D, + MSPC_POSE_ROLL_C, + MSPC_POSE_YAW_L_PITCH_U, + MSPC_POSE_YAW_L_PITCH_D, + MSPC_POSE_YAW_R_PITCH_U, + MSPC_POSE_YAW_R_PITCH_D, + MSPC_POSE_NUM_POSES +} split_mspc_pose; + +typedef struct +{ + int16_t pose_idx[MSPC_POSE_NUM_POSES]; + float *poses[MSPC_POSE_NUM_POSES][BINAURAL_CHANNELS]; +} split_mspc_pose_data; +#endif + /* Due to API of some rendering methods, the renderer has to use the decoder struct. Only struct members relevant for rendering will be initialized, therefore typedef as "dummy" decoder struct */ typedef Decoder_Struct DecoderDummy; @@ -2501,7 +2524,9 @@ static void clearInputMc( ivas_rend_closeCrend( &inputMc->crendWrapper #ifdef SPLIT_REND_WITH_HEAD_ROT , - 1 + ( inputMc->base.ctx.pSplitRendWrapper != NULL ) + ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses + : 1 #endif ); @@ -3478,6 +3503,12 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN { ivas_renderSplitGetMultiBinPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData, headRotData.sr_pose_pred_axis ); } +#ifdef SPLIT_REND_TD_POSE_CORRECTION + else if ( pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + ivas_renderSplitUpdateTdCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData, headRotData.sr_pose_pred_axis ); + } +#endif else if ( pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) { ivas_renderSplitUpdateNoCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData ); @@ -3487,7 +3518,7 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN pSplit_rend_config, outputSampleRate, 0, - ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); if ( error != IVAS_ERR_OK ) { return error; @@ -4068,6 +4099,7 @@ static void closeSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_Aud if ( pSplitRendEncBuffer->data != NULL ) { free( pSplitRendEncBuffer->data ); + pSplitRendEncBuffer->data = NULL; } pSplitRendEncBuffer->config.numChannels = 0; pSplitRendEncBuffer->config.numSamplesPerChannel = 0; @@ -4102,6 +4134,11 @@ ivas_error IVAS_REND_AddInput( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hIvasRend->splitRendEncBuffer.data == NULL && hIvasRend->hRendererConfig != NULL ) { + + ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, + 1, + hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); + if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK ) { return error; @@ -4974,6 +5011,16 @@ int16_t IVAS_REND_FeedRenderConfig( { return error; } + + /* Must re-initialize split rendering config in case renderer config is updated after adding renderer inputs */ + closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, + 1, + hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); + if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK ) + { + return error; + } #endif return IVAS_ERR_OK; @@ -6135,10 +6182,11 @@ static ivas_error renderIsmToSplitBinaural( accumulate2dArrayToBuffer( tmpBinaural, &outAudio ); pop_wmops(); + /* Encoding to split rendering bitstream done at a higher level */ return IVAS_ERR_OK; } #endif /* SPLIT_REND_WITH_HEAD_ROT */ -/* Encoding to split rendering bitstream done at a higher level */ + static ivas_error renderIsmToMasa( input_ism *ismInput, IVAS_REND_AudioBuffer outAudio ) @@ -6809,6 +6857,12 @@ static ivas_error renderMcToSplitBinaural( } } + /* temporary buffer for rotation in source format for CREND */ + tmpRotBuffer = mcInput->base.inputBuffer; + if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inConfig != IVAS_REND_AUDIO_CONFIG_5_1 && inConfig != IVAS_REND_AUDIO_CONFIG_7_1 ) + { + tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + } for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) { @@ -6869,9 +6923,6 @@ static ivas_error renderMcToSplitBinaural( * 4. LFE mixing * 5. tmpSplitBinBuffer accumulated to outBuffer */ - /* temporary buffer for rotation in source format */ - tmpRotBuffer = mcInput->base.inputBuffer; - tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); /* copy input for in-place rotation */ mvr2r( mcInput->base.inputBuffer.data, tmpRotBuffer.data, @@ -6912,8 +6963,6 @@ static ivas_error renderMcToSplitBinaural( * overwrite original audio, which is still needed for rendering next head pose. */ mvr2r( tmpRendBuffer[0], tmpSplitBinauralBuffer[2 * pos_idx], output_frame ); mvr2r( tmpRendBuffer[1], tmpSplitBinauralBuffer[2 * pos_idx + 1], output_frame ); - - free( tmpRotBuffer.data ); } /* restore original headrotation data */ @@ -6923,7 +6972,12 @@ static ivas_error renderMcToSplitBinaural( } } - /* TODO tmu : needs delay compensation */ + if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inConfig != IVAS_REND_AUDIO_CONFIG_5_1 && inConfig != IVAS_REND_AUDIO_CONFIG_7_1 ) + { + /* free temporary buffer for rotation in source format for CREND */ + free( tmpRotBuffer.data ); + } + if ( ( error = renderLfeToBinaural( mcInput, outConfig, outAudio ) ) != IVAS_ERR_OK ) { return error; @@ -7074,6 +7128,773 @@ static void renderSbaToSba( return; } +#ifdef SPLIT_REND_TD_POSE_CORRECTION +static float tangent_pan( float azi, float OFFSET ) +{ + float A, g; + + while ( azi > 180 ) + { + azi -= 360; + } + while ( azi < -180 ) + { + azi += 360; + } + A = tanf( azi * PI_OVER_180 ) / tanf( OFFSET * PI_OVER_180 ); + g = ( A + 1 ) / 2; + return g; +} + +static float wrap_angle( + const float a /* i : angle in degrees to wrap */ +) +{ + float tmp; + tmp = fmodf( a + 180, 360 ); + if ( tmp < 0 ) + { + tmp += 360; + } + return tmp - 180; +} + +static void split_mspc_getPoseDiff( + const IVAS_QUATERNION headpose_current, + const IVAS_QUATERNION headpose_bitstream, + float *pose_diff ) +{ + IVAS_QUATERNION headpose_current_euler; + IVAS_QUATERNION headpose_bitstream_euler; + + /* current head pose */ + headpose_current_euler.w = -3.0f; + if ( headpose_current.w != -3.0f ) + { + Quat2EulerDegree( headpose_current, /* TODO tmu : needs a bugfix for ordering */ + &headpose_current_euler.z, + &headpose_current_euler.y, + &headpose_current_euler.x ); + } + else + { + headpose_current_euler.x = headpose_current.x; + headpose_current_euler.y = headpose_current.y; + headpose_current_euler.z = headpose_current.z; + } + + /* bitstream head pose */ + headpose_bitstream_euler.w = -3.0f; + if ( headpose_bitstream.w != -3.0f ) + { + Quat2EulerDegree( headpose_bitstream, /* TODO tmu : needs a bugfix for ordering */ + &headpose_bitstream_euler.z, + &headpose_bitstream_euler.y, + &headpose_bitstream_euler.x ); + } + else + { + headpose_bitstream_euler.x = headpose_bitstream.x; + headpose_bitstream_euler.y = headpose_bitstream.y; + headpose_bitstream_euler.z = headpose_bitstream.z; + } + + /* compute pose diff */ + pose_diff[0] = headpose_current_euler.x - headpose_bitstream_euler.x; + pose_diff[1] = headpose_current_euler.y - headpose_bitstream_euler.y; + pose_diff[2] = headpose_current_euler.z - headpose_bitstream_euler.z; + + pose_diff[0] = wrap_angle( pose_diff[0] ); + pose_diff[1] = wrap_angle( pose_diff[1] ); + pose_diff[2] = wrap_angle( pose_diff[2] ); + + return; +} + +static ivas_error split_mspc_get0DofGains( + split_mspc_pose_data *spp, + MULTI_BIN_REND_TD_POSE_CORRECTION_DATA *td_data ) +{ + td_data->gains[spp->pose_idx[MSPC_POSE_DEFAULT]] = 1.f; + + return IVAS_ERR_OK; +} + +static ivas_error split_mspc_get1DofGains( + float yaw_diff, + float yaw_offset, + split_mspc_pose_data *spp, + MULTI_BIN_REND_TD_POSE_CORRECTION_DATA *td_data ) +{ + float g; + float yaw_offset_hlf; + + if ( fabsf( yaw_diff ) > 180.f ) + { + return IVAS_ERR_INTERNAL_FATAL; + } + + if ( yaw_diff == 0 ) + { + return split_mspc_get0DofGains( spp, td_data ); + } + + yaw_offset_hlf = yaw_offset / 2.f; + + /* select signals to form the tangent panning pair + swap channels to approximate large yaw offsets */ + if ( yaw_diff >= 0.f ) + { + if ( yaw_diff <= yaw_offset ) + { + /* front left */ + g = tangent_pan( yaw_diff - yaw_offset_hlf, yaw_offset_hlf ); + + td_data->gains[spp->pose_idx[MSPC_POSE_YAW_L]] = g; + td_data->gains[spp->pose_idx[MSPC_POSE_DEFAULT]] = 1 - g; + } + else if ( yaw_diff > yaw_offset && yaw_diff < ( 180.f - yaw_offset ) ) + { + /* left */ + g = tangent_pan( yaw_diff - 90.f, 90.f - yaw_offset ); + + td_data->swap_yaw_r = true; + td_data->gains[spp->pose_idx[MSPC_POSE_YAW_R]] = g; + td_data->gains[spp->pose_idx[MSPC_POSE_YAW_L]] = 1 - g; + } + else if ( yaw_diff >= ( 180.f - yaw_offset ) && yaw_diff <= 180.f ) + { + /* rear left */ + g = tangent_pan( yaw_diff - 180.f + yaw_offset_hlf, yaw_offset_hlf ); + + td_data->swap_default = true; + td_data->gains[spp->pose_idx[MSPC_POSE_DEFAULT]] = g; + td_data->swap_yaw_r = true; + td_data->gains[spp->pose_idx[MSPC_POSE_YAW_R]] = 1 - g; + } + } + else /* yaw_diff < 0.f */ + { + if ( yaw_diff >= -yaw_offset ) + { + /* front right */ + g = tangent_pan( -yaw_diff - yaw_offset_hlf, yaw_offset_hlf ); + + td_data->gains[spp->pose_idx[MSPC_POSE_YAW_R]] = g; + td_data->gains[spp->pose_idx[MSPC_POSE_DEFAULT]] = 1 - g; + } + else if ( yaw_diff < -yaw_offset && yaw_diff > -( 180.f - yaw_offset ) ) + { + /* right */ + g = tangent_pan( -yaw_diff - 90.f, 90.f - yaw_offset ); + + td_data->swap_yaw_l = true; + td_data->gains[spp->pose_idx[MSPC_POSE_YAW_L]] = g; + td_data->gains[spp->pose_idx[MSPC_POSE_YAW_R]] = 1 - g; + } + else if ( yaw_diff <= -( 180.f - yaw_offset ) && yaw_diff >= -180.f ) + { + /* rear right */ + g = tangent_pan( -yaw_diff - 180.f + yaw_offset_hlf, yaw_offset_hlf ); + + td_data->swap_default = true; + td_data->gains[spp->pose_idx[MSPC_POSE_DEFAULT]] = g; + td_data->swap_yaw_l = true; + td_data->gains[spp->pose_idx[MSPC_POSE_YAW_L]] = 1 - g; + } + } + + return IVAS_ERR_OK; +} + +static ivas_error split_mspc_get2DofGains( + float yaw_diff, + float pitch_diff, + float yaw_offset, + float pitch_offset, + split_mspc_pose_data *spp, + MULTI_BIN_REND_TD_POSE_CORRECTION_DATA *td_data ) +{ + int16_t i, nvtx; + float a, c; + float abs_yaw_diff; + float tri_azi[3], tri_ele[3]; + float tri_gains[3]; + split_mspc_pose tri_ch_map[3]; + + abs_yaw_diff = fabsf( yaw_diff ); + if ( abs_yaw_diff > 180.f ) + { + return IVAS_ERR_INTERNAL_FATAL; + } + + /* clamp pitch */ + if ( fabsf( pitch_diff ) > pitch_offset ) + { + pitch_diff = copysignf( pitch_offset, pitch_diff ); + } + + /* determine triangles for gain computation */ + nvtx = 0; + if ( abs_yaw_diff <= yaw_offset ) + { + /* front */ + /* vertex 1 */ + tri_azi[nvtx] = 0.f; + tri_ele[nvtx] = 0.f; + tri_ch_map[nvtx] = MSPC_POSE_DEFAULT; + nvtx++; + + /* vertices 2 and 3 */ + if ( pitch_diff >= 0.f && pitch_diff > abs_yaw_diff ) + { + tri_azi[nvtx] = 0.f; + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = MSPC_POSE_PITCH_U; + nvtx++; + + tri_azi[nvtx] = copysignf( yaw_offset, yaw_diff ); + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_L_PITCH_U : MSPC_POSE_YAW_R_PITCH_U; + nvtx++; + } + else if ( pitch_diff < 0.f && pitch_diff < -abs_yaw_diff ) + { + tri_azi[nvtx] = 0.f; + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = MSPC_POSE_PITCH_D; + nvtx++; + + tri_azi[nvtx] = copysignf( yaw_offset, yaw_diff ); + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_L_PITCH_D : MSPC_POSE_YAW_R_PITCH_D; + nvtx++; + } + else + { + tri_azi[nvtx] = copysignf( yaw_offset, yaw_diff ); + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_L_PITCH_U : MSPC_POSE_YAW_R_PITCH_U; + nvtx++; + + tri_azi[nvtx] = copysignf( yaw_offset, yaw_diff ); + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_L_PITCH_D : MSPC_POSE_YAW_R_PITCH_D; + nvtx++; + } + } + else if ( abs_yaw_diff > yaw_offset && abs_yaw_diff < 180.f - yaw_offset ) + { + /* side */ + /* set swap flags */ + if ( yaw_diff >= 0.f ) + { + td_data->swap_yaw_r = true; + } + else + { + td_data->swap_yaw_l = true; + } + + /* line equation for deterministic triangulation */ + a = pitch_offset / ( 90.f - yaw_offset ); + c = -90.f * a; + + if ( pitch_diff >= ( a * abs_yaw_diff + c ) ) + { + tri_azi[nvtx] = copysignf( yaw_offset, yaw_diff ); + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_L_PITCH_U : MSPC_POSE_YAW_R_PITCH_U; + nvtx++; + + tri_azi[nvtx] = copysignf( yaw_offset, yaw_diff ); + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_L_PITCH_D : MSPC_POSE_YAW_R_PITCH_D; + nvtx++; + + tri_azi[nvtx] = copysignf( 180.f - yaw_offset, yaw_diff ); + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_R_PITCH_U : MSPC_POSE_YAW_L_PITCH_U; + nvtx++; + } + else /* other side of line */ + { + tri_azi[nvtx] = copysignf( 180.f - yaw_offset, yaw_diff ); + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_R_PITCH_U : MSPC_POSE_YAW_L_PITCH_U; + nvtx++; + + tri_azi[nvtx] = copysignf( 180.f - yaw_offset, yaw_diff ); + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_R_PITCH_D : MSPC_POSE_YAW_L_PITCH_D; + nvtx++; + + tri_azi[nvtx] = copysignf( yaw_offset, yaw_diff ); + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_L_PITCH_D : MSPC_POSE_YAW_R_PITCH_D; + nvtx++; + } + } + else if ( abs_yaw_diff >= ( 180.f - yaw_offset ) && abs_yaw_diff <= 180.f ) + { + /* rear */ + /* set swap flags */ + td_data->swap_default = true; + if ( yaw_diff >= 0.f ) + { + td_data->swap_yaw_r = true; + } + else + { + td_data->swap_yaw_l = true; + } + + /* vertex 1 */ + tri_azi[nvtx] = copysignf( 180.f, yaw_diff ); + tri_ele[nvtx] = 0.f; + tri_ch_map[nvtx] = MSPC_POSE_DEFAULT; + nvtx++; + + /* vertices 2 and 3 */ + if ( pitch_diff >= 0.f && pitch_diff > ( 180.f - abs_yaw_diff ) ) + { + tri_azi[nvtx] = copysignf( 180.f, yaw_diff ); + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = MSPC_POSE_PITCH_U; + nvtx++; + + + tri_azi[nvtx] = copysignf( 180.f - yaw_offset, yaw_diff ); + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_R_PITCH_U : MSPC_POSE_YAW_L_PITCH_U; + nvtx++; + } + else if ( pitch_diff < 0.f && pitch_diff < -( 180.f - abs_yaw_diff ) ) + { + tri_azi[nvtx] = copysignf( 180.f, yaw_diff ); + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = MSPC_POSE_PITCH_D; + nvtx++; + + tri_azi[nvtx] = copysignf( 180.f - yaw_offset, yaw_diff ); + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_R_PITCH_D : MSPC_POSE_YAW_L_PITCH_D; + nvtx++; + } + else + { + tri_azi[nvtx] = copysignf( 180.f - yaw_offset, yaw_diff ); + tri_ele[nvtx] = pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_R_PITCH_U : MSPC_POSE_YAW_L_PITCH_U; + nvtx++; + + tri_azi[nvtx] = copysignf( 180.f - yaw_offset, yaw_diff ); + tri_ele[nvtx] = -pitch_offset; + tri_ch_map[nvtx] = ( yaw_diff >= 0.f ) ? MSPC_POSE_YAW_R_PITCH_D : MSPC_POSE_YAW_L_PITCH_D; + nvtx++; + } + } + + /* EFAP panning */ + set_zero( tri_gains, 3 ); + get_poly_gains( yaw_diff, pitch_diff, tri_azi, tri_ele, 3, tri_gains ); + for ( i = 0; i < 3; ++i ) + { + if ( fabsf( tri_gains[i] ) < 1e-6f ) + { + tri_gains[i] = 0.f; + } + } + +#ifdef DEBUGGING + assert( sum_f( tri_gains, nvtx ) <= 1.f && "Sum of gains > 1" ); +#endif + + for ( i = 0; i < 3; ++i ) + { + td_data->gains[spp->pose_idx[tri_ch_map[i]]] = tri_gains[i]; + } + + return IVAS_ERR_OK; +} + +static ivas_error split_mspc_get3DofGains( + float yaw_diff, + float pitch_diff, + float roll_diff, + float yaw_offset, + float pitch_offset, + float roll_offset, + split_mspc_pose_data *spp, + MULTI_BIN_REND_TD_POSE_CORRECTION_DATA *td_data ) +{ + ivas_error error; + + /* same gain computation as for 2DOF */ + error = split_mspc_get2DofGains( yaw_diff, + pitch_diff, + yaw_offset, + pitch_offset, + spp, + td_data ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + + /* set roll gains additionally */ + if ( roll_diff == 0.f ) /* TODO tmu : add a threshold? */ + { + return IVAS_ERR_OK; + } + else if ( roll_diff < 0.f ) + { + td_data->swap_roll = true; + td_data->gains[spp->pose_idx[MSPC_POSE_ROLL_C]] = -roll_diff / roll_offset; + } + else + { + td_data->gains[spp->pose_idx[MSPC_POSE_ROLL_C]] = roll_diff / roll_offset; + } + + return IVAS_ERR_OK; +} + +static ivas_error split_mspc_getPoseGains( + const float pose_diff[3], + split_mspc_pose_data *spp, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + int16_t subframe_idx ) +{ + int16_t i; + int16_t prev_subframe_idx; + float yaw_offset, pitch_offset, roll_offset; + ivas_error error; + + error = IVAS_ERR_OK; + + prev_subframe_idx = subframe_idx - 1; + if ( -1 == prev_subframe_idx ) + { + prev_subframe_idx = MAX_PARAM_SPATIAL_SUBFRAMES - 1; + } + + /* update state */ + set_zero( pMultiBinPoseData->td_data[subframe_idx].gains, MAX_HEAD_ROT_POSES ); + pMultiBinPoseData->td_data[subframe_idx].swap_default = false; + pMultiBinPoseData->td_data[subframe_idx].swap_yaw_l = false; + pMultiBinPoseData->td_data[subframe_idx].swap_yaw_r = false; + pMultiBinPoseData->td_data[subframe_idx].swap_roll = false; + + yaw_offset = 0.f; + pitch_offset = 0.f; + roll_offset = 0.f; + for ( i = 1; i < MAX_HEAD_ROT_POSES; ++i ) + { + yaw_offset = max( yaw_offset, fabsf( pMultiBinPoseData->relative_head_poses[i][0] ) ); + pitch_offset = max( pitch_offset, fabsf( pMultiBinPoseData->relative_head_poses[i][1] ) ); + roll_offset = max( roll_offset, fabsf( pMultiBinPoseData->relative_head_poses[i][2] ) ); + } + + switch ( pMultiBinPoseData->num_poses ) + { + case SPLIT_REND_MSPC_NPOSES_0DOF: + error = split_mspc_get0DofGains( spp, + &pMultiBinPoseData->td_data[subframe_idx] ); + break; + case SPLIT_REND_MSPC_NPOSES_1DOF: + error = split_mspc_get1DofGains( pose_diff[0], + yaw_offset, + spp, + &pMultiBinPoseData->td_data[subframe_idx] ); + break; + case SPLIT_REND_MSPC_NPOSES_2DOF: + error = split_mspc_get2DofGains( pose_diff[0], + pose_diff[1], + yaw_offset, + pitch_offset, + spp, + &pMultiBinPoseData->td_data[subframe_idx] ); + break; + case SPLIT_REND_MSPC_NPOSES_3DOF: + error = split_mspc_get3DofGains( pose_diff[0], + pose_diff[1], + pose_diff[2], + yaw_offset, + pitch_offset, + roll_offset, + spp, + &pMultiBinPoseData->td_data[subframe_idx] ); + break; + default: + /* unknown configuration */ + return IVAS_ERR_INTERNAL_FATAL; + } + + return error; +} + +static ivas_error split_mspc_getMultiStreamGains( + float inOutBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k], + const IVAS_QUATERNION headpose_current, + const IVAS_QUATERNION headpose_bitstream, + split_mspc_pose_data *spp, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + int16_t subframe_idx ) +{ + int16_t pose_idx; + float yaw, pitch, roll; + float pose_diff[3]; + split_mspc_pose pose; + + if ( NULL == pMultiBinPoseData ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + push_wmops( "split_mspc_getMultiStreamGains" ); + + set_s( spp->pose_idx, -1, MSPC_POSE_NUM_POSES ); + + /* MSPC_POSE_DEAULT is always the first stream */ + pose = MSPC_POSE_DEFAULT; + spp->poses[pose][0] = inOutBuffer[0]; + spp->poses[pose][1] = inOutBuffer[1]; + spp->pose_idx[pose] = 0; + + for ( pose_idx = 1; pose_idx < pMultiBinPoseData->num_poses; pose_idx++ ) + { + yaw = pMultiBinPoseData->relative_head_poses[pose_idx][0]; + pitch = pMultiBinPoseData->relative_head_poses[pose_idx][1]; + roll = pMultiBinPoseData->relative_head_poses[pose_idx][2]; + + if ( roll == 0 ) + { + if ( pitch > 0 && yaw > 0 ) + { + pose = MSPC_POSE_YAW_L_PITCH_U; + } + else if ( pitch < 0 && yaw > 0 ) + { + pose = MSPC_POSE_YAW_L_PITCH_D; + } + else if ( pitch > 0 && yaw < 0 ) + { + pose = MSPC_POSE_YAW_R_PITCH_U; + } + else if ( pitch < 0 && yaw < 0 ) + { + pose = MSPC_POSE_YAW_R_PITCH_D; + } + else if ( pitch > 0 && yaw == 0 ) + { + pose = MSPC_POSE_PITCH_U; + } + else if ( pitch < 0 && yaw == 0 ) + { + pose = MSPC_POSE_PITCH_D; + } + else if ( pitch == 0 && yaw > 0 ) + { + pose = MSPC_POSE_YAW_L; + } + else if ( pitch == 0 && yaw < 0 ) + { + pose = MSPC_POSE_YAW_R; + } + } + else + { + assert( roll == 90 ); + pose = MSPC_POSE_ROLL_C; + } + + spp->poses[pose][0] = inOutBuffer[pose_idx * BINAURAL_CHANNELS]; + spp->poses[pose][1] = inOutBuffer[pose_idx * BINAURAL_CHANNELS + 1]; + spp->pose_idx[pose] = pose_idx; + } + + /* get pose difference */ + split_mspc_getPoseDiff( headpose_current, headpose_bitstream, pose_diff ); + + /* select poses for interpolation and compute necessary gains */ + split_mspc_getPoseGains( pose_diff, spp, pMultiBinPoseData, subframe_idx ); + + pop_wmops(); + + return IVAS_ERR_OK; +} + +static int16_t split_mspc_checkPoseSwap( + const split_mspc_pose pose, + const MULTI_BIN_REND_TD_POSE_CORRECTION_DATA *td_data ) +{ + if ( ( td_data->swap_default && ( pose == MSPC_POSE_DEFAULT ) ) || + ( td_data->swap_yaw_l && ( pose == MSPC_POSE_YAW_L || pose == MSPC_POSE_YAW_L_PITCH_D || pose == MSPC_POSE_YAW_L_PITCH_U ) ) || + ( td_data->swap_yaw_r && ( pose == MSPC_POSE_YAW_R || pose == MSPC_POSE_YAW_R_PITCH_D || pose == MSPC_POSE_YAW_R_PITCH_U ) ) || + ( td_data->swap_roll && ( pose == MSPC_POSE_ROLL_C ) ) ) + { + return 1; + } + else + { + return 0; + } +} + +static ivas_error split_mspc_poseCorrProcess( + float inOutBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k], + split_mspc_pose_data *spp, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + int16_t subframe_idx, + int16_t subframe_len ) +{ + int16_t subframe_smp_idx, frame_smp_idx; + int16_t prev_subframe_idx; + int16_t mapped_pose_idx; + float fade_in, fade_out; + float tmp_ch0, tmp_ch1; + float outBinBuffer[BINAURAL_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; + split_mspc_pose pose; + MULTI_BIN_REND_TD_POSE_CORRECTION_DATA *td_data_new, *td_data_old; + + push_wmops( "split_mspc_poseCorrProcess" ); + + set_zero( outBinBuffer[0], subframe_len ); + set_zero( outBinBuffer[1], subframe_len ); + + prev_subframe_idx = subframe_idx - 1; + if ( -1 == prev_subframe_idx ) + { + prev_subframe_idx = MAX_PARAM_SPATIAL_SUBFRAMES - 1; + } + + td_data_new = &pMultiBinPoseData->td_data[subframe_idx]; + td_data_old = &pMultiBinPoseData->td_data[prev_subframe_idx]; + + /* sample loop */ + frame_smp_idx = subframe_idx * subframe_len; + for ( subframe_smp_idx = 0; subframe_smp_idx < subframe_len; ++subframe_smp_idx, ++frame_smp_idx ) + { + fade_in = pMultiBinPoseData->xfade[subframe_smp_idx]; + fade_out = 1 - fade_in; + + for ( pose = MSPC_POSE_DEFAULT; pose < MSPC_POSE_NUM_POSES; ++pose ) + { + mapped_pose_idx = spp->pose_idx[pose]; + if ( mapped_pose_idx == -1 ) + { + continue; + } + + if ( ( td_data_new->gains[mapped_pose_idx] == td_data_old->gains[mapped_pose_idx] ) && ( ( fabsf( td_data_new->gains[mapped_pose_idx] ) > EPSILON ) && ( fabs( td_data_old->gains[mapped_pose_idx] ) > EPSILON ) ) ) + { + /* no fading necessary */ + if ( split_mspc_checkPoseSwap( pose, td_data_new ) ) + { + tmp_ch0 = spp->poses[pose][1][frame_smp_idx]; + tmp_ch1 = spp->poses[pose][0][frame_smp_idx]; + } + else + { + tmp_ch0 = spp->poses[pose][0][frame_smp_idx]; + tmp_ch1 = spp->poses[pose][1][frame_smp_idx]; + } + /* accumulate to output */ + outBinBuffer[0][subframe_smp_idx] += td_data_new->gains[mapped_pose_idx] * tmp_ch0; + outBinBuffer[1][subframe_smp_idx] += td_data_new->gains[mapped_pose_idx] * tmp_ch1; + } + else if ( ( fabsf( td_data_new->gains[mapped_pose_idx] ) > EPSILON ) || ( fabsf( td_data_old->gains[mapped_pose_idx] ) > EPSILON ) ) + { + /* fade in new gains */ + if ( split_mspc_checkPoseSwap( pose, td_data_new ) ) + { + tmp_ch0 = spp->poses[pose][1][frame_smp_idx]; + tmp_ch1 = spp->poses[pose][0][frame_smp_idx]; + } + else + { + tmp_ch0 = spp->poses[pose][0][frame_smp_idx]; + tmp_ch1 = spp->poses[pose][1][frame_smp_idx]; + } + /* accumulate to output */ + outBinBuffer[0][subframe_smp_idx] += fade_in * td_data_new->gains[mapped_pose_idx] * tmp_ch0; + outBinBuffer[1][subframe_smp_idx] += fade_in * td_data_new->gains[mapped_pose_idx] * tmp_ch1; + + /* fade out old gains */ + if ( split_mspc_checkPoseSwap( pose, td_data_old ) ) + { + tmp_ch0 = spp->poses[pose][1][frame_smp_idx]; + tmp_ch1 = spp->poses[pose][0][frame_smp_idx]; + } + else + { + tmp_ch0 = spp->poses[pose][0][frame_smp_idx]; + tmp_ch1 = spp->poses[pose][1][frame_smp_idx]; + } + /* accumulate to output */ + outBinBuffer[0][subframe_smp_idx] += fade_out * td_data_old->gains[mapped_pose_idx] * tmp_ch0; + outBinBuffer[1][subframe_smp_idx] += fade_out * td_data_old->gains[mapped_pose_idx] * tmp_ch1; + } + } + } + + mvr2r( outBinBuffer[0], &inOutBuffer[0][subframe_idx * subframe_len], subframe_len ); + mvr2r( outBinBuffer[1], &inOutBuffer[1][subframe_idx * subframe_len], subframe_len ); + + pop_wmops(); + + return IVAS_ERR_OK; +} + +static void split_mspc_multiStreamGainsToDecSelection( + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + split_mspc_pose_data spp[MAX_PARAM_SPATIAL_SUBFRAMES], + int16_t *sfSelectiveDecMtx[MAX_PARAM_SPATIAL_SUBFRAMES] ) +{ + bool use_prev, use_new; + int16_t prev_subframe_idx, subframe_idx; + int16_t mapped_pose_idx, ch_idx, dec_idx; + split_mspc_pose pose; + MULTI_BIN_REND_TD_POSE_CORRECTION_DATA *td_data_new, *td_data_old; + + for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; ++subframe_idx ) + { + prev_subframe_idx = subframe_idx - 1; + if ( -1 == prev_subframe_idx ) + { + prev_subframe_idx = MAX_PARAM_SPATIAL_SUBFRAMES - 1; + } + + td_data_new = &pMultiBinPoseData->td_data[subframe_idx]; + td_data_old = &pMultiBinPoseData->td_data[prev_subframe_idx]; + + set_s( sfSelectiveDecMtx[subframe_idx], 0, pMultiBinPoseData->num_poses * BINAURAL_CHANNELS ); + + for ( pose = MSPC_POSE_DEFAULT; pose < MSPC_POSE_NUM_POSES; ++pose ) + { + mapped_pose_idx = spp[subframe_idx].pose_idx[pose]; + if ( mapped_pose_idx == -1 ) + { + continue; + } + use_new = ( fabsf( td_data_new->gains[mapped_pose_idx] ) > EPSILON ); + use_prev = ( fabsf( td_data_old->gains[mapped_pose_idx] ) > EPSILON ); + + for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ++ch_idx ) + { + dec_idx = BINAURAL_CHANNELS * mapped_pose_idx + ch_idx; + + if ( use_new || ( !use_new && use_prev ) ) + { + sfSelectiveDecMtx[subframe_idx][dec_idx] = 1; + } + } + } + } +} +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ + #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error splitBinLc3plusDecode( SPLIT_POST_REND_WRAPPER *hSplitBin, @@ -7130,6 +7951,9 @@ static ivas_error renderSplitBinauralWithPostRot( float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; COMBINED_ORIENTATION_HANDLE pCombinedOrientationData; SPLIT_POST_REND_WRAPPER *hSplitBin; +#ifdef SPLIT_REND_TD_POSE_CORRECTION + IVAS_QUATERNION mainBitstreamHeadPosition[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ int8_t isPostRendInputCldfb; isPostRendInputCldfb = 0; @@ -7150,7 +7974,11 @@ static ivas_error renderSplitBinauralWithPostRot( return error; } } - else if ( bits.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && splitBinInput->splitPostRendWrapper.hLc3plusDec == NULL ) + else if ( bits.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS +#ifdef SPLIT_REND_TD_POSE_CORRECTION + && bits.pose_correction != IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD +#endif + && splitBinInput->splitPostRendWrapper.hLc3plusDec == NULL ) { LC3PLUS_CONFIG config; config.lc3plus_frame_duration_us = 5000; @@ -7158,11 +7986,15 @@ static ivas_error renderSplitBinauralWithPostRot( config.channels = BINAURAL_CHANNELS; config.samplerate = *splitBinInput->base.ctx.pOutSampleRate; - IVAS_LC3PLUS_DEC_Open( config, + error = IVAS_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING - 0 /* caching disabled */, + 0 /* caching disabled */, #endif - &splitBinInput->splitPostRendWrapper.hLc3plusDec ); + &splitBinInput->splitPostRendWrapper.hLc3plusDec ); + if ( error != IVAS_ERR_OK ) + { + return error; + } } for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) @@ -7177,21 +8009,55 @@ static ivas_error renderSplitBinauralWithPostRot( if ( hSplitBin->first_good_frame_received == 1 ) { - if ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) +#ifdef SPLIT_REND_TD_POSE_CORRECTION + int16_t subframe_idx; + int16_t **sfSelectiveDecMtx; + split_mspc_pose_data spp[MAX_PARAM_SPATIAL_SUBFRAMES]; + + if ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) { - if ( !SplitRendBFI ) /* ToDo: this is always true */ + ivas_rend_TdSplitPostRendProcess( + &bits, + mainBitstreamHeadPosition, + &hSplitBin->multiBinPoseData ); + + if ( splitBinInput->splitPostRendWrapper.hLc3plusDec == NULL ) { - ivas_splitBinPostRendMdDec( - &bits, - hSplitBin->hBinHrSplitPostRend, - &hSplitBin->multiBinPoseData + LC3PLUS_CONFIG config; + config.lc3plus_frame_duration_us = 5000; + config.ivas_frame_duration_us = 20000; + config.channels = hSplitBin->multiBinPoseData.num_poses * BINAURAL_CHANNELS; + config.samplerate = *splitBinInput->base.ctx.pOutSampleRate; + + error = IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + 1 /* caching enabled */, +#endif + &splitBinInput->splitPostRendWrapper.hLc3plusDec ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + } + else +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ + if ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { + if ( !SplitRendBFI ) /* ToDo: this is always true */ + { + ivas_splitBinPostRendMdDec( + &bits, + hSplitBin->hBinHrSplitPostRend, + &hSplitBin->multiBinPoseData #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - , - hSplitBin->hBinHrSplitPreRend + , + hSplitBin->hBinHrSplitPreRend #endif /* SPLIT_REND_WITH_HEAD_ROT_DEBUG */ - ); + ); + } } - } + /*copy pose correction after MD is parsed*/ hSplitBin->multiBinPoseData.poseCorrectionMode = bits.pose_correction; @@ -7210,11 +8076,64 @@ static ivas_error renderSplitBinauralWithPostRot( } else { +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + error = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &sfSelectiveDecMtx, hSplitBin->multiBinPoseData.num_poses * BINAURAL_CHANNELS ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + + for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; ++subframe_idx ) + { + error = split_mspc_getMultiStreamGains( tmpCrendBuffer, + QuaternionsPost[subframe_idx], + mainBitstreamHeadPosition[subframe_idx], + &spp[subframe_idx], + &hSplitBin->multiBinPoseData, + subframe_idx ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + + /* convert gain matrix to selection matrix */ + split_mspc_multiStreamGainsToDecSelection( &hSplitBin->multiBinPoseData, spp, sfSelectiveDecMtx ); + + error = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( hSplitBin->hLc3plusDec, sfSelectiveDecMtx ); + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( sfSelectiveDecMtx ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ + error = splitBinLc3plusDecode( hSplitBin, &bits, tmpCrendBuffer, bits.pose_correction ); if ( error != IVAS_ERR_OK ) { return error; } +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD ) + { + /* TODO tmu : support for smoothing flag from decoder */ + for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; ++subframe_idx ) + { + error = split_mspc_poseCorrProcess( tmpCrendBuffer, + &spp[subframe_idx], + &hSplitBin->multiBinPoseData, + subframe_idx, + (int16_t) L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + } +#endif /* SPLIT_REND_TD_POSE_CORRECTION */ } } else @@ -8452,10 +9371,25 @@ ivas_error IVAS_REND_GetSamples( outAudio.config.is_cldfb = 0; outAudio.config.numSamplesPerChannel >>= 1; } - ivas_renderSplitGetMultiBinPoseData( - &hIvasRend->hRendererConfig->split_rend_config, - &hIvasRend->splitRendWrapper.multiBinPoseData, - hIvasRend->headRotData.sr_pose_pred_axis ); + +#ifdef SPLIT_REND_TD_POSE_CORRECTION + if ( hIvasRend->hRendererConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { +#endif + ivas_renderSplitGetMultiBinPoseData( + &hIvasRend->hRendererConfig->split_rend_config, + &hIvasRend->splitRendWrapper.multiBinPoseData, + hIvasRend->headRotData.sr_pose_pred_axis ); +#ifdef SPLIT_REND_TD_POSE_CORRECTION + } + else + { + ivas_renderSplitUpdateTdCorrectionPoseData( + &hIvasRend->hRendererConfig->split_rend_config, + &hIvasRend->splitRendWrapper.multiBinPoseData, + hIvasRend->headRotData.sr_pose_pred_axis ); + } +#endif assert( num_poses_orig == hIvasRend->splitRendWrapper.multiBinPoseData.num_poses && "number of poses should not change dynamically" ); /* Clear output buffer */ @@ -8549,7 +9483,6 @@ ivas_error IVAS_REND_GetSamples( } #endif /* SPLIT_REND_WITH_HEAD_ROT */ - return IVAS_ERR_OK; } diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index d2941713f74cbe0b9d8afd5a926350bf5733d60f..0b2ec8e8e85ca9e0899e104dc9374359f8eaab8e 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -563,6 +563,12 @@ ivas_error RenderConfigReader_read( { hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; } +#ifdef SPLIT_REND_TD_POSE_CORRECTION + else if ( strcmp( pValue, "MSPC" ) == 0 ) + { + hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD; + } +#endif else if ( strcmp( pValue, "NONE" ) == 0 ) { hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index b596a5781cd30ce9dfaaaec906a441ccf80dfec8..bb75f9fa9d74f3badd6be02b5badf87b9c53f506 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -235,7 +235,7 @@ ivas_error split_rend_read_bits_from_file( header_len = strlen( header ); - /*write frame header*/ + /*read frame header*/ for ( i = 0; i < header_len; i++ ) { if ( fread( &header_read[i], sizeof( char ), 1, hSplitRendFileReadWrite->file ) != 1 ) diff --git a/scripts/lc3plus_lib_setup/get_lc3plus.sh b/scripts/lc3plus_lib_setup/get_lc3plus.sh index 36faf111bdbae59f43d9ec0dc2e2685189a9fe28..01ad362b717228ef82a3410a99b37b473045c242 100755 --- a/scripts/lc3plus_lib_setup/get_lc3plus.sh +++ b/scripts/lc3plus_lib_setup/get_lc3plus.sh @@ -12,7 +12,7 @@ unzip lc3plus_sources.zip -d . # Modify LC3plus code to be compatible with IVAS tools (e.g. WMC tool) git apply --ignore-whitespace lc3plus.patch -mv ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c +rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/codec_exe.c # Remove unneeded files diff --git a/scripts/lc3plus_lib_setup/lc3plus.patch b/scripts/lc3plus_lib_setup/lc3plus.patch index fdf8a69f5b3b16b85b0662edaa5257fca35e9c79..14b81a39727b034b4d1de3b01a90879baeb34947 100644 --- a/scripts/lc3plus_lib_setup/lc3plus.patch +++ b/scripts/lc3plus_lib_setup/lc3plus.patch @@ -1,7 +1,26 @@ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_idx_off, LC3_FLOAT* gain, LC3_INT target, LC3_INT nBits, LC3_INT* gainChange, LC3_INT fs_idx diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-07-13 12:41:20 -@@ -1010,8 +1010,8 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "stdint.h" + #include + #include +@@ -1010,8 +1011,8 @@ LC3_UINT8 blacklist[FEC_N_MODES]; LC3_INT32 rop; @@ -11,10 +30,29 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin /* initialization */ blacklist[0] = 0; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processApplyGlobalGain_fl(LC3_FLOAT x[], LC3_INT xLen, LC3_INT global_gain_idx, LC3_INT global_gain_off) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-07-13 12:41:20 -@@ -620,7 +620,7 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void ac_shift_fl(Encoder_State_fl* st); +@@ -620,7 +621,7 @@ if (st.pc_c_bp_side != 0) { @@ -23,7 +61,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } } -@@ -891,7 +891,7 @@ +@@ -891,7 +892,7 @@ { LC3_INT bits = 0, mask = 0, val = 0, over1 = 0, high = 0, over2 = 0, c = 0, b = 0; @@ -32,7 +70,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin mask = ((LC3_INT)pow(2, 24) - 1) >> bits; val = st->low + mask; over1 = val >> 24; -@@ -1078,8 +1078,8 @@ +@@ -1078,8 +1079,8 @@ } /* Residual bits */ @@ -43,10 +81,51 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (st.cache >= 0) { nbits_ari = nbits_ari + 8; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void attack_detector_fl(LC3_FLOAT* in, LC3_INT frame_size, LC3_INT fs, LC3_INT* lastAttackPosition, LC3_FLOAT* accNrg, LC3_INT* attackFlag, +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + /* DCT */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void process_cutoff_bandwidth(LC3_FLOAT *d_fl, LC3_INT len, LC3_INT bw_bin) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-07-13 12:41:20 -@@ -27,11 +27,11 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void dct2_init(Dct2* dct, int length) +@@ -27,11 +28,11 @@ void dct2_apply(Dct2* dct, const LC3_FLOAT* input, LC3_FLOAT* output) { @@ -59,7 +138,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin for (i = 0; i < len / 2; i++) { tmp1[i] = cmplx(input[i * 2], 0); -@@ -49,8 +49,8 @@ +@@ -49,8 +50,8 @@ void dct4_init(Dct4* dct, int length) { @@ -69,7 +148,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin dct->length = length; dct->twid1 = calloc(sizeof(*dct->twid1), length / 2); dct->twid2 = calloc(sizeof(*dct->twid2), length / 2); -@@ -73,12 +73,12 @@ +@@ -73,12 +74,12 @@ void dct4_apply(Dct4* dct, const LC3_FLOAT* input, LC3_FLOAT* output) { @@ -85,8 +164,16 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin tmp1[i] = cmul(cmplx(input[i * 2], input[len - i * 2 - 1]), dct->twid1[i]); diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-07-13 12:41:20 -@@ -53,7 +53,7 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit); +@@ -53,7 +54,7 @@ LC3_INT nbbytes = nbbits >> 3; LC3_INT lastnz; LC3_INT bw_cutoff_idx; @@ -95,7 +182,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (nbits > nbbits) { -@@ -173,7 +173,7 @@ +@@ -173,7 +174,7 @@ } /* Last non-zero tuple */ @@ -106,8 +193,16 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (*lastnz > N) { diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-07-13 12:41:20 -@@ -53,8 +53,8 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +@@ -53,8 +54,8 @@ if (decoder->rframe == 1 && zero_frame == 0 && bfi != 1) { @@ -119,7 +214,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin # ifdef ENABLE_025_DMS_MODE diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-07-13 12:41:20 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-06-29 12:58:27 @@ -24,13 +24,13 @@ typedef uint32_t LC3_UINT32; @@ -149,8 +244,16 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #define LC3_SQRT(x) (sqrtf(x)) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-07-13 12:41:20 -@@ -68,7 +68,7 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT* bw_idx) +@@ -68,7 +69,7 @@ dist = bw_dist[counter]; for (i = stop; i >= stop - dist; i--) { @@ -161,8 +264,16 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin brickwall = 1; diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-07-13 12:41:20 -@@ -33,11 +33,11 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT numbytes, LC3_INT bw_cutoff_bits, +@@ -33,11 +34,11 @@ /* Last non zero touple */ if (bfi_ext == 1) { @@ -176,10 +287,29 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } /* LSB mode bit */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s_in, uint8_t* bytes, int bps diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-07-13 12:41:20 -@@ -60,8 +60,8 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +@@ -60,8 +61,8 @@ } else { g_min = x_max / (32767 - 0.375); } @@ -190,7 +320,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin ind_min = ceil(ind_min + LC3_FABS(ind_min) * LC3_EPS); -@@ -76,7 +76,7 @@ +@@ -76,7 +77,7 @@ tmp += x[i + 1] * x[i + 1]; tmp += x[i + 2] * x[i + 2]; tmp += x[i + 3] * x[i + 3]; @@ -201,20 +331,24 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-07-13 12:41:20 -@@ -8,7 +8,6 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-06-29 12:58:27 +@@ -8,7 +8,7 @@ ******************************************************************************/ - ++#include "options.h" #include "cfft.h" #include "iisfft.h" /* for M_PIl */ #include /* for abs() */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-07-13 12:41:20 -@@ -10,12 +10,12 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-06-29 12:58:27 +@@ -8,14 +8,15 @@ + ******************************************************************************/ + ++#include "options.h" #include #include -#include "iis_fft.h" @@ -228,7 +362,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin /**************************************************************************************************/ /* AFFT uses two fft implementations -@@ -24,9 +24,6 @@ +@@ -24,9 +25,6 @@ fast lengths, check the fft_n function. */ @@ -238,7 +372,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #define FFT_COMPLEX 1 #define FFT_REAL 2 -@@ -122,12 +119,13 @@ +@@ -122,12 +120,13 @@ IIS_FFT_ERROR LC3_IIS_FFT_Apply_CFFT(HANDLE_IIS_FFT handle, const Complex* input, Complex* output) { @@ -255,7 +389,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } else { diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-07-13 12:41:20 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-06-29 12:58:27 @@ -12,6 +12,7 @@ #define IIS_FFT_H @@ -264,9 +398,20 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #include "cfft.h" #ifdef __cplusplus +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + + #include + #include /* for mmove */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-07-13 12:41:20 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-06-29 12:58:27 @@ -11,6 +11,7 @@ #ifndef IISFFT_H #define IISFFT_H @@ -275,10 +420,29 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #ifndef M_PIl #define M_PIl 3.1415926535897932384626433832795029L /* pi */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + /* Function expects already flipped window */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-07-13 12:41:20 -@@ -48,8 +48,9 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "lc3.h" + #include "defines.h" + #include "functions.h" +@@ -48,8 +49,9 @@ case 44100: return 1; case 48000: return 1; case 96000: return 1; @@ -289,7 +453,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } static int lc3plus_plc_mode_supported(LC3PLUS_PlcMode plc_mode) -@@ -58,8 +59,9 @@ +@@ -58,8 +60,9 @@ { case LC3PLUS_PLC_ADVANCED: /* fallthru */ return 1; @@ -300,7 +464,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } static int lc3plus_frame_size_supported(float frame_ms) -@@ -69,8 +71,9 @@ +@@ -69,8 +72,9 @@ case 25: /* fallthru */ case 50: /* fallthru */ case 100: return 1; @@ -311,7 +475,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } static int null_in_list(void **list, int n) -@@ -97,13 +100,14 @@ +@@ -97,13 +101,14 @@ /* encoder functions *********************************************************/ LC3PLUS_Error lc3plus_enc_init(LC3PLUS_Enc *encoder, int samplerate, int channels, int hrmode, int32_t lfe_channel_array[]) { @@ -327,7 +491,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin for (ch = 0; ch < channels; ch++) { RETURN_IF(!lc3_enc_supported_lfe() && lfe_channel_array[ch], LC3PLUS_LFE_MODE_NOT_SUPPORTED); -@@ -142,6 +146,7 @@ +@@ -142,6 +147,7 @@ int lc3plus_enc_get_real_bitrate(const LC3PLUS_Enc *encoder) { int ch = 0, totalBytes = 0; @@ -335,7 +499,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin RETURN_IF(encoder == NULL, 0); RETURN_IF(!encoder->lc3_br_set, LC3PLUS_BITRATE_UNSET_ERROR); -@@ -150,7 +155,7 @@ +@@ -150,7 +156,7 @@ totalBytes += encoder->channel_setup[ch]->targetBytes; } @@ -344,7 +508,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (encoder->fs_in == 44100) { -@@ -191,11 +196,13 @@ +@@ -191,11 +197,13 @@ LC3PLUS_Error lc3plus_enc_set_bandwidth(LC3PLUS_Enc *encoder, int bandwidth) { @@ -359,7 +523,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (encoder->bandwidth != bandwidth) { if (encoder->fs_in > 40000) { effective_fs = 40000; -@@ -338,9 +345,9 @@ +@@ -338,9 +346,9 @@ LC3PLUS_Error lc3plus_free_encoder_structs(LC3PLUS_Enc* encoder) { @@ -370,7 +534,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin for (ch = 0; ch < encoder->channels; ch++) { mdct_free(&encoder->channel_setup[ch]->mdctStruct); dct2_free(&encoder->channel_setup[ch]->dct2StructSNS); -@@ -351,9 +358,9 @@ +@@ -351,9 +359,9 @@ LC3PLUS_Error lc3plus_free_decoder_structs(LC3PLUS_Dec* decoder) { @@ -381,7 +545,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin for (ch = 0; ch < decoder->channels; ch++) { dct4_free(&decoder->channel_setup[ch]->dct4structImdct); real_fft_free(&decoder->channel_setup[ch]->PlcAdvSetup->PlcPhEcuSetup.PhEcu_Fft); -@@ -378,11 +385,14 @@ +@@ -378,11 +386,14 @@ LC3PLUS_Error lc3plus_enc_set_ep_mode(LC3PLUS_Enc *encoder, LC3PLUS_EpMode epmode) { @@ -398,10 +562,143 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (error != LC3PLUS_OK) { encoder->epmode = oldEpmode; // preserve old epmode in case of failure +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 1970-01-01 01:00:00 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 2023-06-29 12:58:27 +@@ -0,0 +1,99 @@ ++/****************************************************************************** ++* ETSI TS 103 634 V1.4.1 * ++* Low Complexity Communication Codec Plus (LC3plus) * ++* * ++* Copyright licence is solely granted through ETSI Intellectual Property * ++* Rights Policy, 3rd April 2019. No patent licence is granted by implication, * ++* estoppel or otherwise. * ++******************************************************************************/ ++ ++ ++#include "options.h" ++#include "functions.h" ++#include "fft/iis_fft.c" ++#include "fft/iisfft.c" ++#include "fft/cfft.c" ++ ++void fft_init(Fft* fft, int length) ++{ ++ HANDLE_IIS_FFT handle = NULL; ++ IIS_FFT_ERROR error = 0; ++ assert(length % 2 == 0); ++ ++ fft->length = length; ++ ++ error = LC3_IIS_CFFT_Create(&handle, length, IIS_FFT_FWD); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++ fft->handle = handle; ++} ++ ++void fft_free(Fft* fft) ++{ ++ IIS_FFT_ERROR error = 0; ++ ++ if (fft) { ++ error = LC3_IIS_CFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++ memset(fft, 0, sizeof(*fft)); ++ } ++} ++ ++void real_fft_free(Fft* fft) ++{ ++ IIS_FFT_ERROR error = 0; ++ ++ if (fft) { ++ error = LC3_IIS_RFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++ memset(fft, 0, sizeof(*fft)); ++ } ++} ++ ++void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) ++{ ++ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; ++ assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ ++ ++ fft->length = length; ++ ++ error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_FWD); ++ assert(error == IIS_FFT_NO_ERROR); ++ fft->handle = *handle; ++} ++ ++ ++void real_ifft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) ++{ ++ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; ++ assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ ++ ++ fft->length = length; ++ ++ error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_BWD); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++ fft->handle = *handle; ++} ++ ++void fft_apply(Fft* fft, const Complex* input, Complex* output) ++{ ++ IIS_FFT_ERROR error = 0; ++ error = LC3_IIS_FFT_Apply_CFFT(fft->handle, input, output); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++} ++ ++ ++void real_fft_apply(Fft* fft, const LC3_FLOAT* input, LC3_FLOAT* output) ++{ ++ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; ++ ++ UNUSED(error); ++ ++ error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++} +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT fs, LC3_FLOAT* mem_old_x, LC3_FLOAT* mem_old_y, diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-07-13 12:41:20 -@@ -104,6 +104,7 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT hrmode) +@@ -104,6 +105,7 @@ { LC3_FLOAT tmp[MAX_LEN * 2] = {0}; LC3_INT i = 0; @@ -409,7 +706,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin move_float(tmp, mdct->mem, mdct->mem_length); move_float(tmp + mdct->mem_length, input, mdct->length); -@@ -112,7 +113,7 @@ +@@ -112,7 +114,7 @@ mult_vec(tmp, mdct->window, mdct->length * 2); @@ -418,10 +715,34 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin for (i = 0; i < hlen; i++) { output[i] = -tmp[hlen * 3 - i - 1] - tmp[hlen * 3 + i]; output[hlen + i] = tmp[i] - tmp[hlen * 2 - i - 1]; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processMdctShaping_fl(LC3_FLOAT x[], LC3_FLOAT scf[], const LC3_INT bands_offset[], LC3_INT fdns_npts) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/.gitignore mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/.gitignore +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/.gitignore 1970-01-01 01:00:00 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/.gitignore 2023-06-29 12:58:27 +@@ -0,0 +1 @@ ++Win32/ +\ No newline at end of file diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-07-13 12:50:08 -@@ -14,9 +14,9 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-06-29 12:58:35 +@@ -8,15 +8,16 @@ + ******************************************************************************/ + + #include "functions.h" ++#include "options.h" + + + void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT fs_idx, const LC3_INT near_nyquist_index, const LC3_INT bands_number, const LC3_FLOAT* ener) { *near_nyquist_flag = 0; @@ -433,10 +754,139 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin LC3_INT i = 0; LC3_FLOAT ener_low = FLT_EPSILON, ener_high = 0; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3_INT frame_dms, +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_FLOAT len_buf, LC3_INT len_input); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-07-13 12:41:20 -@@ -56,6 +56,8 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* decoder, DecSetup* h_DecSetup, LC3_INT bfi, +@@ -56,6 +57,8 @@ { case 2: { @@ -445,7 +895,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin assert(decoder->fs_idx == floor(decoder->fs / 10000)); // phaseECU supports only 10ms framing assert(PlcSetup->nbLostCmpt != 0 || decoder->frame_dms == 100); -@@ -69,7 +71,7 @@ +@@ -69,7 +72,7 @@ } /* call phaseEcu */ @@ -454,10 +904,106 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (prev_bfi_plc2 == 0) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-07-13 12:41:20 -@@ -135,13 +135,13 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +@@ -135,13 +136,13 @@ if (max_xfp_abs >= 0.5) { @@ -475,8 +1021,16 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-07-13 12:41:20 -@@ -30,6 +30,7 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + #include "constants.h" +@@ -30,6 +31,7 @@ LC3_INT32 segmentLen, e; LC3_FLOAT Xph; LC3_FLOAT seed_local; @@ -484,7 +1038,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin UNUSED(corr_phase_dbg); UNUSED(X_i_new_re_dbg); -@@ -49,8 +50,8 @@ +@@ -49,8 +51,8 @@ // EVOLVE PHASE ----------------- @@ -495,7 +1049,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin one_peak_flag_mask = -1; if (n_plocs < 3 && n_plocs > 0) { -@@ -219,9 +220,10 @@ +@@ -219,9 +221,10 @@ } static LC3_INT32 own_rand(LC3_INT32 seed) { @@ -511,14 +1065,15 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-07-13 12:50:08 -@@ -6,13 +6,13 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-06-29 12:58:35 +@@ -6,13 +6,14 @@ * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * ******************************************************************************/ - + ++#include "options.h" #include "defines.h" #include "functions.h" @@ -528,7 +1083,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin { LC3_INT32 i; -@@ -34,10 +34,10 @@ +@@ -34,10 +35,10 @@ trans[i] = 1.0; /* 0/0 no transient , no power change */ } } @@ -541,16 +1096,39 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin + return; } +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-07-13 12:50:08 -@@ -6,16 +6,16 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-06-29 12:58:35 +@@ -6,16 +6,17 @@ * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * ******************************************************************************/ - + ++#include "options.h" #include "defines.h" #include "functions.h" @@ -565,7 +1143,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin { LC3_FLOAT gr_pow_left[MAX_LGW]; LC3_FLOAT gr_pow_right[MAX_LGW]; -@@ -27,7 +27,7 @@ +@@ -27,7 +28,7 @@ LC3_INT32 attDegreeFrames; LC3_FLOAT thresh_dbg; @@ -574,7 +1152,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin UNUSED(tr_dec_dbg); UNUSED(gpc_dbg); -@@ -39,7 +39,7 @@ +@@ -39,7 +40,7 @@ } @@ -583,10 +1161,73 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin plc_phEcu_tba_trans_dect_gains(burst_len, n_grp, grp_pow_change, stPhECU_beta_mute, stPhECU_mag_chg_1st, alpha, beta, mag_chg, ph_dith, tr_dec, att_val, &attDegreeFrames, &thresh_dbg); return; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + /***************************************************************************\ + * contents/description: Main function for Time domain concealment + \***************************************************************************/ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + #include "functions.h" ++#include "options.h" + + + void processPlcUpdate_fl(PlcAdvSetup *PlcAdvSetup, LC3_INT32 frame_length, LC3_FLOAT *syntM, LC3_FLOAT *scf_q, +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static LC3_INT sign(LC3_FLOAT x); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-07-13 12:41:20 -@@ -17,6 +17,8 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3_INT mem_in_len, LC3_FLOAT mem_50[], LC3_FLOAT mem_out[], +@@ -17,6 +18,8 @@ LC3_INT len_12k8 = 0, N12k8 = 0, i = 0, k = 0; LC3_FLOAT mac = 0, buf_out[120 + MAX_LEN] = {0}, bufdown[128] = {0}, buf[120 + MAX_LEN] = {0}; @@ -595,7 +1236,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin const LC3_FLOAT *filter; const LC3_FLOAT *filt_input, *filt_coeff; -@@ -49,12 +51,12 @@ +@@ -49,12 +52,12 @@ /* Upsampling & Low-pass Filtering & Downsampling */ @@ -614,7 +1255,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin k = 0; for (i = 0; i < N12k8; i++) { -@@ -78,9 +80,8 @@ +@@ -78,9 +81,8 @@ /* 50Hz High-Pass */ @@ -626,10 +1267,51 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin for (i = 0; i < len_12k8; i++) { LC3_FLOAT y1 = (highpass50_filt_b[0] * bufdown[i] + u_11); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t* resBits, LC3_INT* numResBits +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec, uint8_t prm[], LC3_INT resQBits +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + #include "functions.h" ++#include "options.h" + + LC3_FLOAT array_max_abs(LC3_FLOAT *in, LC3_INT32 len) + { diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-07-13 12:41:20 -@@ -32,6 +32,7 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "setup_dec_lc3.h" + #include "functions.h" + #include +@@ -32,6 +33,7 @@ LC3_FLOAT *sine_table1_phecu, *sine_table2_phecu; HANDLE_IIS_FFT handle_fft_phaseecu; HANDLE_IIS_FFT handle_ifft_phaseecu; @@ -637,7 +1319,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin for (ch = 0; ch < channels; ch++) { DecSetup* setup = balloc(decoder, &size, sizeof(DecSetup)); -@@ -56,7 +57,7 @@ +@@ -56,7 +58,7 @@ sine_table1_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1)); sine_table2_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1)); @@ -646,7 +1328,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (decoder) { decoder->channel_setup[ch] = setup; -@@ -346,6 +347,7 @@ +@@ -346,6 +348,7 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) { int totalBits = 0, bitsTmp = 0, channel_bytes = 0, maxBytes = 0, minBytes = 0; @@ -654,7 +1336,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (decoder->hrmode) { -@@ -375,7 +377,7 @@ +@@ -375,7 +378,7 @@ channel_bytes = nBytes; @@ -665,8 +1347,16 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin { diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-07-13 12:41:20 -@@ -33,6 +33,7 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "setup_enc_lc3.h" + #include "functions.h" + #include +@@ -33,6 +34,7 @@ , int32_t lfe_channel_array[] ) { @@ -674,7 +1364,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin memset(encoder, 0, lc3plus_enc_get_size(samplerate, channels)); alloc_encoder(encoder, channels); -@@ -56,7 +57,6 @@ +@@ -56,7 +58,6 @@ encoder->r12k8_mem_in_len = 2 * 8 * encoder->fs / 12800; encoder->r12k8_mem_out_len = 24; @@ -682,7 +1372,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin for (ch = 0; ch < encoder->channels; ch++) { encoder->channel_setup[ch]->lfe = lfe_channel_array[ch] != 0; -@@ -220,6 +220,7 @@ +@@ -220,6 +221,7 @@ if (encoder->hrmode) { @@ -690,7 +1380,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin switch (encoder->frame_dms) { case 25: -@@ -243,6 +244,7 @@ +@@ -243,6 +245,7 @@ default: return LC3PLUS_HRMODE_ERROR; } @@ -698,7 +1388,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } else { -@@ -368,7 +370,7 @@ +@@ -368,7 +371,7 @@ setup->total_bits = setup->targetBytes << 3; setup->targetBitsInit = setup->total_bits - encoder->envelope_bits - encoder->global_gain_bits - encoder->noise_fac_bits - encoder->BW_cutoff_bits - @@ -709,8 +1399,16 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin setup->targetBitsInit = setup->targetBitsInit - 1; diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-07-13 12:41:20 -@@ -109,7 +109,7 @@ ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor) +@@ -109,7 +110,7 @@ /* Log-domain */ for (i = 0; i < 64; i++) { @@ -719,3 +1417,58 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } /* Downsampling */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_int) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void pvq_dec(LC3_INT k, LC3_INT m, LC3_INT LS_ind, LC3_INT MPVQ_ind, LC3_INT* pulses); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-06-29 12:58:27 +@@ -17,6 +17,7 @@ + #include + #include + ++ + #if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) || defined(__arm__) || \ + defined(__aarch64__) + #define __TWI_LE /* _T_iny _W_ave _I_n _L_ittle _E_ndian */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void xcorr(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT lag, LC3_INT inLen); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-06-29 12:58:27 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT numfilters, LC3_INT bw_fcbin, LC3_INT N, LC3_INT fs) diff --git a/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_384k_MSPC.txt b/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_384k_MSPC.txt new file mode 100644 index 0000000000000000000000000000000000000000..e1cdc2ef443938136190890f9afe5389c146c3a3 --- /dev/null +++ b/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_384k_MSPC.txt @@ -0,0 +1,6 @@ +[SPLITREND] +BITRATE = 384000; +DOF = 1; +HQMODE = 0; +POSECORRECTION = MSPC; +CODEC = LC3PLUS; diff --git a/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_512k_MSPC.txt b/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_512k_MSPC.txt new file mode 100644 index 0000000000000000000000000000000000000000..3c1bb945066a95752b0e5fdb1e2739cebaf62f5b --- /dev/null +++ b/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_512k_MSPC.txt @@ -0,0 +1,6 @@ +[SPLITREND] +BITRATE = 512000; +DOF = 1; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; diff --git a/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_768k_MSPC.txt b/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_768k_MSPC.txt new file mode 100644 index 0000000000000000000000000000000000000000..f2c88ab37e7ce13ec5bb12facf0b8c35a7ab6052 --- /dev/null +++ b/tests/split_rendering/renderer_configs/attic/split_renderer_config_1dof_768k_MSPC.txt @@ -0,0 +1,6 @@ +[SPLITREND] +BITRATE = 768000; +DOF = 1; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; diff --git a/tests/split_rendering/renderer_configs/attic/split_renderer_config_2dof_1536k_MSPC.txt b/tests/split_rendering/renderer_configs/attic/split_renderer_config_2dof_1536k_MSPC.txt new file mode 100644 index 0000000000000000000000000000000000000000..7a96a864e924fc9818d2811f78f158b59091218a --- /dev/null +++ b/tests/split_rendering/renderer_configs/attic/split_renderer_config_2dof_1536k_MSPC.txt @@ -0,0 +1,6 @@ +[SPLITREND] +BITRATE = 1536000; +DOF = 2; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; diff --git a/tests/split_rendering/renderer_configs/attic/split_renderer_config_2dof_768k_MSPC.txt b/tests/split_rendering/renderer_configs/attic/split_renderer_config_2dof_768k_MSPC.txt new file mode 100644 index 0000000000000000000000000000000000000000..39f3bbfa78a01c2d103a9dc75e3effa3d5c5ec8a --- /dev/null +++ b/tests/split_rendering/renderer_configs/attic/split_renderer_config_2dof_768k_MSPC.txt @@ -0,0 +1,6 @@ +[SPLITREND] +BITRATE = 768000; +DOF = 2; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; diff --git a/tests/split_rendering/renderer_configs/attic/split_renderer_config_3dof_1792k_MSPC.txt b/tests/split_rendering/renderer_configs/attic/split_renderer_config_3dof_1792k_MSPC.txt new file mode 100644 index 0000000000000000000000000000000000000000..6a19f6898b2caa8d3a09c6c6ae9030c87547a792 --- /dev/null +++ b/tests/split_rendering/renderer_configs/attic/split_renderer_config_3dof_1792k_MSPC.txt @@ -0,0 +1,6 @@ +[SPLITREND] +BITRATE = 1792000; +DOF = 3; +HQMODE = 0; +CODEC = LC3PLUS; +POSECORRECTION = MSPC; diff --git a/tests/split_rendering/test_split_rendering.py b/tests/split_rendering/test_split_rendering.py index 76f114b689ccec347587e915a2ea5450dec81ba2..b023c8d4eb451dd5b7a4d77fc1b91f15bd17d91b 100644 --- a/tests/split_rendering/test_split_rendering.py +++ b/tests/split_rendering/test_split_rendering.py @@ -30,6 +30,13 @@ import pytest from tests.split_rendering.utils import * +def check_xfail(in_fmt, render_config): + if "0dof" in render_config and "768k" in render_config: + pytest.xfail("Bitrate is too high for default codec selection of LC3plus with 0DOF") + + if "256k" in render_config and in_fmt in INPUT_FORMATS_AMBI: + pytest.xfail("Unsupported bitrate for LCLD codec") + """ Ambisonics """ @@ -37,8 +44,7 @@ from tests.split_rendering.utils import * @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) def test_ambisonics_full_chain_split(test_info, in_fmt, render_config, trajectory): - if in_fmt != "HOA3": - pytest.xfail("Split Rendering currently only supported with HOA3") + check_xfail(in_fmt, render_config) post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -56,8 +62,7 @@ def test_ambisonics_full_chain_split(test_info, in_fmt, render_config, trajector @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory): - if in_fmt != "HOA3": - pytest.xfail("Split Rendering currently only supported with HOA3") + check_xfail(in_fmt, render_config) post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -78,8 +83,7 @@ def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC[2:]) def test_multichannel_full_chain_split(test_info, in_fmt, render_config, trajectory): - if "768k" in render_config: - pytest.xfail("Unsupported bitrate for LC3plus") + check_xfail(in_fmt, render_config) post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -97,8 +101,7 @@ def test_multichannel_full_chain_split(test_info, in_fmt, render_config, traject @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC[2:]) def test_multichannel_external_split(test_info, in_fmt, render_config, trajectory): - if "768k" in render_config: - pytest.xfail("Unsupported bitrate for LC3plus") + check_xfail(in_fmt, render_config) post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -119,8 +122,7 @@ def test_multichannel_external_split(test_info, in_fmt, render_config, trajector @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) def test_ism_full_chain_split(test_info, in_fmt, render_config, trajectory): - if "768k" in render_config: - pytest.xfail("Unsupported bitrate for LC3plus") + check_xfail(in_fmt, render_config) post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -138,8 +140,7 @@ def test_ism_full_chain_split(test_info, in_fmt, render_config, trajectory): @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) def test_ism_external_split(test_info, in_fmt, render_config, trajectory): - if "768k" in render_config: - pytest.xfail("Unsupported bitrate for LC3plus") + check_xfail(in_fmt, render_config) post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")