Skip to content
......@@ -58,8 +58,8 @@ N_FRAMES_DLY_PROFILE = 7500
GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {N_FRAMES_DLY_PROFILE} {EP_FILE}"
MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"]
AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"]
# timeout of 15 minutes per en/decoding to safeguard against endless loops
TIMEOUT = 60 * 20
# timeout of 25 minutes per en/decoding to safeguard against endless loops
TIMEOUT = 60 * 25
HEAD_TRAJ_FILE = str(pathlib.Path("./head_rot_traj.csv").resolve())
EXOF_TRAJ_FILE = str(pathlib.Path("./exof_traj.csv").resolve())
......
#! /usr/bin/bash
# (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
# contributors to this repository. All Rights Reserved.
# This software is protected by copyright law and by international treaties.
# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
# contributors to this repository retain full ownership rights in their respective contributions in
# the software. This notice grants no license of any kind, including but not limited to patent
# license, nor is any license granted by implication, estoppel or otherwise.
# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
# contributions.
# This software is provided "AS IS", without any express or implied warranties. The software is in the
# development stage. It is intended exclusively for experts who have experience with such software and
# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
# and fitness for a particular purpose are hereby disclaimed and excluded.
# Any dispute, controversy or claim arising under or in relation to providing this software shall be
# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
# the United Nations Convention on Contracts on the International Sales of Goods.
function usage {
echo
echo "Usage:"
echo " smoke_test_complexity.sh [--max_cores nMaxCores]"
echo
echo " nMaxCores - the number of CPUs to use (default 42)"
exit
}
if [ ! -d "lib_com" ]; then
echo "not in root directory! - please run in IVAS root"
exit 1
fi
if [[ -z "$1" ]]; then
MAX_CORES=42
elif [[ "$1" == "--max_cores" ]]; then
if [[ -z "$2" ]]; then
echo "Need maximum number of cores"
exit 1
else
MAX_CORES=$2
fi
else
usage
fi
cfg=./scripts/config/ci_linux_ltv.json
ism_md_cmd="--ism_metadata_files /usr/local/ltv/ltvISM1.csv /usr/local/ltv/ltvISM2.csv /usr/local/ltv/ltvISM3.csv /usr/local/ltv/ltvISM4.csv"
duration_arg=""
complexity_cmd="--checks COMPLEXITY --create_complexity_tables"
max_num_workers="--max_workers $MAX_CORES"
# prepare combined format test signals
echo "\n======================= 0. preparing combined format test inputs =======================\n\n"
./scripts/prepare_combined_format_inputs.py
# Modes
mono_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^mono)
FOA_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^FOA)
HOA2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^HOA2)
HOA3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^HOA3)
PlanarFOA_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^PlanarFOA)
PlanarHOA2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^PlanarHOA2)
PlanarHOA3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^PlanarHOA3)
MASA_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^MASA)
MC_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^MC)
stereo_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^stereo)
stereoDmx_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^StereoDmx)
OMASA_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OMASA)
OSBA_ISM1_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OSBA_ISM1)
OSBA_ISM2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OSBA_ISM2)
OSBA_ISM3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OSBA_ISM3)
OSBA_ISM4_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OSBA_ISM4)
ISM1_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM1)
ISM2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM2)
ISM3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM3)
ISM4_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM4)
ISM_plus1_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM+1)
ISM_plus2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM+2)
ISM_plus3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM+3)
ISM_plus4_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM+4)
echo "\n======================= 1. Mono =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_mono_no_fec -m $mono_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_mono.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 2. FOA =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_FOA_no_fec -m $FOA_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_FOA.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 3. HOA2 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_HOA2_no_fec -m $HOA2_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_HOA2.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 4. HOA3 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_HOA3_no_fec -m $HOA3_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_HOA3.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 5. PlanarFOA =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_PlanarFOA_no_fec -m $PlanarFOA_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_PlanarFOA.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 6. PlanarHOA2 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_PlanarHOA2_no_fec -m $PlanarHOA2_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_PlanarHOA2.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 7. PlanarHOA3 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_PlanarHOA3_no_fec -m $PlanarHOA3_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_PlanarHOA3.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 8. MASA =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_MASA_no_fec -m $MASA_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_MASA.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 9. MC =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_MC_no_fec -m $MC_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_MC.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 10. stereo =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_stereo_no_fec -m $stereo_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_stereo.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 11. stereoDmx =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_stereoDmx_no_fec -m $stereoDmx_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_stereoDmx.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 12. OMASA =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OMASA_no_fec -m $OMASA_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OMASA.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 13. OSBA ISM1 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OSBA_ISM1_no_fec -m $OSBA_ISM1_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OSBA_ISM1.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 14. OSBA ISM2 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OSBA_ISM2_no_fec -m $OSBA_ISM2_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OSBA_ISM2.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 15. OSBA ISM3 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OSBA_ISM3_no_fec -m $OSBA_ISM3_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OSBA_ISM3.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 16. OSBA ISM4 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OSBA_ISM4_no_fec -m $OSBA_ISM4_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OSBA_ISM4.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 15. ISM1 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM1_no_fec -m $ISM1_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM1.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 16. ISM2 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM2_no_fec -m $ISM2_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM2.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 17. ISM3 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM3_no_fec -m $ISM3_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM3.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 18. ISM4 =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM4_no_fec -m $ISM4_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM4.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 19. ISM1 + extended metadata =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM_plus1_no_fec -m $ISM_plus1_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM_plus1.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 20. ISM2 + extended metadata =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM_plus2_no_fec -m $ISM_plus2_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM_plus2.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 21. ISM3 + extended metadata =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM_plus3_no_fec -m $ISM_plus3_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM_plus3.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
echo "\n======================= 22. ISM4 + extended metadata =======================\n\n"
./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM_plus4_no_fec -m $ISM_plus4_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM_plus4.txt
rm -r ./COMPLEXITY/dec/
rm -r ./COMPLEXITY/enc/
rm -r ./COMPLEXITY/pcm/
......@@ -57,6 +57,12 @@
#define IVAS_MAX_PARAM_SPATIAL_SUBFRAMES 4
#define IVAS_ROOM_ABS_COEFF 6
/* Maximum buffer length (per channel) in samples */
#define MAX_BUFFER_LENGTH_PER_CHANNEL ( L_FRAME48k )
/* Frame size required when rendering to binaural */
#define BINAURAL_RENDERING_FRAME_SIZE_MS 5
/*----------------------------------------------------------------------------------*
* Common API enum for output audio configurations
*----------------------------------------------------------------------------------*/
......@@ -201,9 +207,10 @@ typedef struct _IVAS_JBM_TRACE_DATA
* Split rendering API constants, structures, and enums
*----------------------------------------------------------------------------------*/
#define IVAS_MAX_SPLIT_REND_BITRATE 768000
#define IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) IVAS_MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 )
#define IVAS_SPLIT_REND_ADDITIONAL_BYTES_TO_READ 1
#define ISAR_MAX_SPLIT_REND_BITRATE 768000
#define ISAR_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) ISAR_MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 )
#define ISAR_SPLIT_REND_ADDITIONAL_BYTES_TO_READ 1
#define SPLIT_REND_BITS_BUFF_SIZE ( ISAR_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES + ISAR_SPLIT_REND_ADDITIONAL_BYTES_TO_READ )
typedef enum
{
......@@ -215,47 +222,51 @@ typedef enum
YAW_ROLL,
PITCH_ROLL
} IVAS_SPLIT_REND_ROT_AXIS;
} ISAR_SPLIT_REND_ROT_AXIS;
typedef enum
{
IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE,
IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB,
ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE,
ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB,
} IVAS_SPLIT_REND_POSE_CORRECTION_MODE;
} ISAR_SPLIT_REND_POSE_CORRECTION_MODE;
typedef enum
{
IVAS_SPLIT_REND_CODEC_LCLD,
IVAS_SPLIT_REND_CODEC_LC3PLUS,
IVAS_SPLIT_REND_CODEC_DEFAULT, /* Will use LCLD for CLDFB rendering paths and LC3plus for TD rendering paths */
IVAS_SPLIT_REND_CODEC_NONE
ISAR_SPLIT_REND_CODEC_LCLD,
ISAR_SPLIT_REND_CODEC_LC3PLUS,
ISAR_SPLIT_REND_CODEC_DEFAULT, /* Will use LCLD for CLDFB rendering paths and LC3plus for TD rendering paths */
ISAR_SPLIT_REND_CODEC_NONE
} IVAS_SPLIT_REND_CODEC;
} ISAR_SPLIT_REND_CODEC;
typedef enum
{
IVAS_SPLIT_REND_RENDERER_SELECTION_CREND,
IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV,
IVAS_SPLIT_REND_RENDERER_SELECTION_PARAMBIN,
IVAS_SPLIT_REND_RENDERER_SELECTION_TDREND,
IVAS_SPLIT_REND_RENDERER_SELECTION_DEFAULT,
ISAR_SPLIT_REND_RENDERER_SELECTION_CREND,
ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV,
ISAR_SPLIT_REND_RENDERER_SELECTION_PARAMBIN,
ISAR_SPLIT_REND_RENDERER_SELECTION_TDREND,
ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT,
} IVAS_SPLIT_REND_RENDERER_SELECTION;
} ISAR_SPLIT_REND_RENDERER_SELECTION;
typedef struct _IVAS_SPLIT_REND_BITS_DATA
typedef struct _ISAR_SPLIT_REND_BITS_DATA
{
uint8_t *bits_buf;
int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/
int32_t bits_written;
int32_t bits_read;
int16_t codec_frame_size_ms;
IVAS_SPLIT_REND_CODEC codec;
IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
ISAR_SPLIT_REND_CODEC codec;
ISAR_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
int16_t isar_frame_size_ms;
int16_t lc3plus_highres;
#endif
} IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE;
} ISAR_SPLIT_REND_BITS_DATA, *ISAR_SPLIT_REND_BITS_HANDLE;
typedef struct _IVAS_SPLIT_REND_CONFIG
typedef struct _ISAR_SPLIT_REND_CONFIG
{
int32_t splitRendBitRate; /*Bit rate for split rendering mode, if "pcm_out" is set then "splitRendBitRate" is used as a limit for MD bitrate */
int16_t hq_mode; /*High quality 3DOF mode with additional side information. Requires more pre-renditions. */
......@@ -267,12 +278,18 @@ typedef struct _IVAS_SPLIT_REND_CONFIG
3 - (3dof correction. By default YAW, PITCH and ROLL correction)
*/
int16_t codec_delay_ms; /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
int16_t isar_frame_size_ms; /* ISAR bit stream frame size in milliseconds */
#endif
int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */
IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode;
IVAS_SPLIT_REND_CODEC codec;
IVAS_SPLIT_REND_RENDERER_SELECTION rendererSelection;
ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode;
ISAR_SPLIT_REND_CODEC codec;
ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
int16_t lc3plus_highres;
#endif
} IVAS_SPLIT_REND_CONFIG_DATA;
} ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE;
#endif
/*----------------------------------------------------------------------------------*
......@@ -315,10 +332,28 @@ typedef struct _IVAS_RENDER_CONFIG
#endif
IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics;
#ifdef SPLIT_REND_WITH_HEAD_ROT
IVAS_SPLIT_REND_CONFIG_DATA split_rend_config;
ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
#endif
float directivity[IVAS_MAX_NUM_OBJECTS * 3];
#ifdef CONF_DISTATT
float distAtt[3];
#endif
} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;
typedef struct
{
int16_t numSamplesPerChannel;
int16_t numChannels;
#ifdef SPLIT_REND_WITH_HEAD_ROT
int16_t is_cldfb;
#endif
} IVAS_REND_AudioBufferConfig;
typedef struct
{
IVAS_REND_AudioBufferConfig config;
float *data;
} IVAS_REND_AudioBuffer;
#endif /* COMMON_API_TYPES_H */
......@@ -123,14 +123,6 @@ typedef enum
RENDERER_OMASA_MIX_EXT
} RENDERER_TYPE;
#ifdef SPLIT_REND_WITH_HEAD_ROT
typedef enum
{
PCM_INT16,
PCM_FLOAT32,
PCM_NOT_KNOW = 0xffff
} PCM_RESOLUTION;
#endif
/*----------------------------------------------------------------------------------*
* IVAS general constants
......@@ -1432,7 +1424,9 @@ typedef enum
typedef enum
{
IVAS_FILTER_ORDER_1 = 1,
#ifndef NONBE_FIX_MC_LFE_LPF
IVAS_FILTER_ORDER_2 = 2,
#endif
IVAS_FILTER_ORDER_4 = 4,
} ivas_filter_order;
......@@ -1481,18 +1475,6 @@ typedef enum
EFAP_DMX_INTENSITY
} EFAP_VTX_DMX_TYPE;
#ifdef SPLIT_REND_WITH_HEAD_ROT
typedef enum
{
ANY_YAW,
PITCH_ONLY,
ANY_ROLL,
PRED_ONLY,
PRED_ROLL_ONLY,
COM_GAIN_ONLY,
LR_GAIN_ONLY
} IVAS_SPLIT_REND_POSE_TYPE;
#endif
#define VBAP_NUM_SEARCH_SECTORS 4
......@@ -1535,66 +1517,6 @@ typedef enum
#define HEADROT_SHMAT_DIM2 ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM )
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*----------------------------------------------------------------------------------*
* Split Binaural Rendering Constants
*----------------------------------------------------------------------------------*/
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define CLDFB_PLC_XF 2 /* Length of cross-fade into first good frame after frame loss in CLDFB cols. */
#endif
#define SPLIT_REND_DECOR_ALPHA 0.25f
#define SPLIT_REND_MAX_YAW_ONLY_POSES 2
#define SPLIT_REND_MAX_PITCH_ONLY_POSES 2
#define SPLIT_REND_MAX_ROLL_ONLY_POSES 2
#define SPLIT_REND_MAX_ONE_AXIS_MD_POSES 2
#define MAX_EXTRAPOLATION_ANGLE 15.0f /* this means additional 15 degrees can be extrapolated on top of MD probing poses*/
#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)
#define MAX_SPLIT_REND_MD_BANDS 20
#define MAX_SPLIT_MD_SUBFRAMES 1
#define COMPLEX_MD_BAND_THRESH MAX_SPLIT_REND_MD_BANDS
#define COMPLEX_MD_BAND_THRESH_LOW 5
#define SPLIT_REND_RO_MD_BAND_THRESH 4
#define IVAS_SPLIT_REND_NUM_QUANT_STRATS 4
#define IVAS_SPLIT_REND_PRED_63QUANT_PNTS 63
#define IVAS_SPLIT_REND_PRED_31QUANT_PNTS 31
#define IVAS_SPLIT_REND_ROLL_PRED_QUANT_PNTS 31
#define IVAS_SPLIT_REND_D_QUANT_PNTS 15
#define IVAS_SPLIT_REND_PRED_MIN_VAL -1.4f
#define IVAS_SPLIT_REND_PRED_MAX_VAL 1.4f
#define IVAS_SPLIT_REND_PITCH_G_MIN_VAL 0.5f
#define IVAS_SPLIT_REND_PITCH_G_MAX_VAL 1.5f
#define IVAS_SPLIT_REND_PITCH_G_QUANT_PNTS IVAS_SPLIT_REND_D_QUANT_PNTS
#define IVAS_SPLIT_REND_D_MIN_VAL 0.0f
#define IVAS_SPLIT_REND_D_MAX_VAL 1.0f
#define IVAS_SPLIT_REND_PRED_ROLL_Q_STEP (( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL ) / ( IVAS_SPLIT_REND_ROLL_PRED_QUANT_PNTS - 1 ))
#define IVAS_SPLIT_REND_PRED_ROLL_1BYQ_STEP (( IVAS_SPLIT_REND_ROLL_PRED_QUANT_PNTS - 1 )/( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL ))
#define IVAS_SPLIT_REND_PRED31_Q_STEP (( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL ) / ( IVAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ))
#define IVAS_SPLIT_REND_PRED31_1BYQ_STEP (( IVAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 )/( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL ))
#define IVAS_SPLIT_REND_PRED63_Q_STEP (( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL ) / ( IVAS_SPLIT_REND_PRED_63QUANT_PNTS - 1 ))
#define IVAS_SPLIT_REND_PRED63_1BYQ_STEP (( IVAS_SPLIT_REND_PRED_63QUANT_PNTS - 1 )/( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL ))
#define IVAS_SPLIT_REND_D_Q_STEP (( IVAS_SPLIT_REND_D_MAX_VAL - IVAS_SPLIT_REND_D_MIN_VAL ) / ( IVAS_SPLIT_REND_D_QUANT_PNTS - 1 ))
#define IVAS_SPLIT_REND_D_1BYQ_STEP (( IVAS_SPLIT_REND_D_QUANT_PNTS - 1 )/( IVAS_SPLIT_REND_D_MAX_VAL - IVAS_SPLIT_REND_D_MIN_VAL ))
#define IVAS_SPLIT_REND_PITCH_G_Q_STEP (( IVAS_SPLIT_REND_PITCH_G_MAX_VAL - IVAS_SPLIT_REND_PITCH_G_MIN_VAL ) / ( IVAS_SPLIT_REND_PITCH_G_QUANT_PNTS - 1 ))
#define IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP (( IVAS_SPLIT_REND_PITCH_G_QUANT_PNTS - 1 )/( IVAS_SPLIT_REND_PITCH_G_MAX_VAL - IVAS_SPLIT_REND_PITCH_G_MIN_VAL ))
#define IVAS_SPLIT_REND_MAX_NUM_BYTES 4000
#define IVAS_SPLIT_REND_HEAD_POSE_BITS 9
#define IVAS_SPLIT_REND_DOF_BITS 2
#define IVAS_SPLIT_REND_HQ_MODE_BITS 1
#define IVAS_SPLIT_REND_ROT_AXIS_BITS 3
#endif
/*----------------------------------------------------------------------------------*
* TD Binaural Object renderer
*----------------------------------------------------------------------------------*/
......@@ -1798,19 +1720,6 @@ typedef enum
#define QUANT_STRAT_0 0
#define QUANT_STRAT_2 2
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*----------------------------------------------------------------------------------*
* Split rendering bitrate constants
*----------------------------------------------------------------------------------*/
#define SPLIT_REND_256k 256000
#define SPLIT_REND_320k 320000
#define SPLIT_REND_384k 384000
#define SPLIT_REND_512k 512000
#define SPLIT_REND_768k 768000
#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k
#endif
/*----------------------------------------------------------------------------------*
* Limiter constants
......
......@@ -342,10 +342,10 @@ void ivas_get_dirac_sba_max_md_bits(
{
*bits_frame_nominal = ACELP_16k40 / FRAMES_PER_SEC;
*metadata_max_bits = 103;
/* OSBA needs an additional 2-bits safety margin to avoid acelp crashes */
/* OSBA needs an additional 5-bits safety margin to avoid acelp crashes */
if ( ivas_format == SBA_ISM_FORMAT )
{
( *metadata_max_bits ) -= 3;
( *metadata_max_bits ) -= 7;
}
}
else if ( sba_total_brate <= IVAS_32k )
......
......@@ -104,6 +104,12 @@ typedef enum
* input data errors *
*----------------------------------------*/
IVAS_ERR_INVALID_BITSTREAM = 0x2000,
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
IVAS_ERR_UNEXPECTED_LC3PLUS_BITSTREAM,
IVAS_ERR_UNEXPECTED_LC3PLUS_BITSTREAM_CONFIG,
#endif
#endif
/*----------------------------------------*
* hardware errors *
......
......@@ -30,6 +30,9 @@
*******************************************************************************************************/
#ifndef IVAS_ERROR_UTILS_H
#define IVAS_ERROR_UTILS_H
#include "options.h"
#include <assert.h>
......@@ -42,9 +45,6 @@
#include <stdio.h>
#endif
#ifndef IVAS_ERROR_UTILS_H
#define IVAS_ERROR_UTILS_H
/*
* Usage:
*
......@@ -83,7 +83,6 @@ static inline ivas_error ivas_error_wrapper( const ivas_error error_code, const
va_end( args );
fprintf( stderr, "\n\nIn function: %s(), %s:%d\n\n", function, file, line );
// assert( 0 );
return error_code;
}
......
......@@ -62,7 +62,11 @@ void ivas_filters_init(
int16_t i;
filter_state->order = order;
#ifdef NONBE_FIX_MC_LFE_LPF
if ( order == IVAS_FILTER_ORDER_1 )
#else
if ( order == IVAS_FILTER_ORDER_2 || order == IVAS_FILTER_ORDER_1 )
#endif
{
filter_state->filt_len = order + 1;
......@@ -116,7 +120,9 @@ void ivas_filter_process(
switch ( filter_state->order )
{
case IVAS_FILTER_ORDER_1:
#ifndef NONBE_FIX_MC_LFE_LPF
case IVAS_FILTER_ORDER_2:
#endif
ivas_iir_2_filter( filter_state, pIn_Out, length, IVAS_FILTER_STAGE_0 );
break;
case IVAS_FILTER_ORDER_4:
......
......@@ -60,6 +60,7 @@ void ivas_lfe_lpf_select_filt_coeff(
{
switch ( order )
{
#ifndef NONBE_FIX_MC_LFE_LPF
case IVAS_FILTER_ORDER_2:
switch ( sampling_rate )
{
......@@ -76,6 +77,7 @@ void ivas_lfe_lpf_select_filt_coeff(
break;
}
break;
#endif
case IVAS_FILTER_ORDER_4:
switch ( sampling_rate )
{
......
......@@ -34,7 +34,7 @@
#include "options.h"
#include <math.h>
#include "prot.h"
#include "ivas_prot_rend.h"
#include "ivas_prot.h"
#include "wmc_auto.h"
#include <assert.h>
......
......@@ -31,30 +31,39 @@
*******************************************************************************************************/
#include "options.h"
#include "ivas_lc3plus_common.h"
#include "ivas_error.h"
#include "lc3.h"
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*-----------------------------------------------------------------------------------------*
* Function IVAS_LC3PLUS_LC3plusErrToIvasErr()
*
*
*-----------------------------------------------------------------------------------------*/
ivas_error IVAS_LC3PLUS_LC3plusErrToIvasErr(
const LC3PLUS_Error lc3PlusError )
#include "ivas_cnst.h"
#include "ivas_prot.h"
#include "prot.h"
#include "ivas_rom_com.h"
#ifdef DEBUGGING
#include "debug.h"
#endif
/*! r : ISM format mode */
ISM_MODE ivas_osba_ism_mode_select(
const int32_t ivas_total_brate, /* i : IVAS total bitrate */
const int16_t nchan_ism /* i : number of input ISM's */
)
{
switch ( lc3PlusError )
ISM_MODE ism_mode = ISM_MODE_NONE;
switch ( nchan_ism )
{
case LC3PLUS_OK:
return IVAS_ERR_OK;
case LC3PLUS_BITRATE_ERROR:
return IVAS_ERR_LC3PLUS_INVALID_BITRATE;
default:
case 1:
if ( ivas_total_brate >= IVAS_96k )
{
ism_mode = ISM_SBA_MODE_DISC;
}
break;
case 2:
case 3:
case 4:
if ( ivas_total_brate >= IVAS_128k )
{
ism_mode = ISM_SBA_MODE_DISC;
}
break;
}
return IVAS_ERR_INTERNAL;
return ism_mode;
}
#endif
......@@ -42,6 +42,7 @@
#include "stat_com.h"
#include "ivas_stat_enc.h"
#include "ivas_stat_dec.h"
#include "ivas_stat_rend.h"
#include "ivas_stat_com.h"
#include "ivas_error_utils.h"
......@@ -981,20 +982,14 @@ ivas_error ivas_ism_metadata_enc_create(
ivas_error ivas_ism_metadata_dec_create(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
const int16_t n_ISms, /* i : number of separately coded objects */
#else
const int16_t n_ISms, /* i : number of objects */
#endif
int32_t element_brate_tmp[] /* o : element bitrate per object */
);
#ifdef NONBE_FIX_1065_ISM_MD_HANDLE
void ivas_ism_reset_metadata_handle_dec(
ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */
);
#endif
ivas_error ivas_ism_enc(
Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */
float *data[], /* i : input signal [channels][samples] */
......@@ -3212,6 +3207,9 @@ void ivas_qmetadata_enc_sid_encode(
BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */
IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */
const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure*/
#ifdef NONBE_FIX_1052_SBA_EXT
const int16_t nchan_transport, /* i : number of transport channels */
#endif
const int16_t ivas_format /* i : ivas format */
);
......@@ -3520,6 +3518,13 @@ int16_t ivas_sba_get_nchan_metadata(
const int32_t ivas_total_brate /* i : IVAS total bitrate */
);
#ifdef NONBE_FIX_1052_SBA_EXT
/*! r: number of bits in SPAR SID frame */
int16_t ivas_sba_spar_sid_bitlen(
const int16_t nchan_transport /* i : number of transport channels */
);
#endif
void ivas_sba_get_spar_hoa_ch_ind(
const int16_t num_md_chs, /* i : number of MD channels */
const int32_t ivas_total_brate, /* i : IVAS total bitrate */
......@@ -3621,6 +3626,9 @@ ivas_error ivas_dirac_enc(
const int16_t input_frame, /* i : input frame length */
const int16_t dtx_vad, /* i : DTX vad flag */
const IVAS_FORMAT ivas_format, /* i : ivas format */
#ifdef NONBE_FIX_1052_SBA_EXT
const int16_t nchan_transport, /* i : number of transport channels */
#endif
const int16_t hodirac_flag /* i : hodirac flag */
);
......@@ -3676,6 +3684,9 @@ void ivas_dirac_dec_read_BS(
int16_t *nb_bits, /* o : number of bits read */
const int16_t last_bit_pos, /* i : last read bitstream position */
const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */
#ifdef NONBE_FIX_1052_SBA_EXT
const int16_t nchan_transport, /* i : number of transport channels */
#endif
int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */
);
......@@ -5506,7 +5517,11 @@ void ivas_lfe_enc(
ivas_error ivas_create_lfe_dec(
LFE_DEC_HANDLE *hLFE_out, /* o : IVAS LFE decoder structure */
const int32_t output_Fs, /* i : output sampling rate */
#ifdef NONBE_FIX_MC_LFE_LPF
const int32_t delay_ns /* i : additional LFE delay to sync other channel outputs */
#else
const int32_t binauralization_delay_ns /* i : additional LFE delay to sync with binaural renderer */
#endif
);
void ivas_lfe_dec_close(
......@@ -5613,7 +5628,10 @@ void ivas_osba_data_close(
SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */
);
ISM_MODE ivas_osba_ism_mode_select(
const int32_t ivas_total_brate, /* i : IVAS total bitrate */
const int16_t nchan_ism /* i : number of input ISM's */
);
/*----------------------------------------------------------------------------------*
* OMASA prototypes
*---------------------------------------------------------------------------------*/
......@@ -5933,6 +5951,56 @@ int16_t ivas_get_num_bands_from_bw_idx(
const int16_t bwidth /* i : audio bandwidth */
);
void Euler2Quat(
const float yaw, /* i : yaw (x) */
const float pitch, /* i : pitch (y) */
const float roll, /* i : roll (z) */
IVAS_QUATERNION *quat /* o : quaternion describing the rotation */
);
float deg2rad(
float degrees
);
#ifdef SPLIT_REND_WITH_HEAD_ROT
void Quat2EulerDegree(
const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */
float *yaw, /* o : yaw */
float *pitch, /* o : pitch */
float *roll /* o : roll */
);
#endif
/*----------------------------------------------------------------------------------*
* Limiter prototypes
*----------------------------------------------------------------------------------*/
ivas_error ivas_limiter_open(
IVAS_LIMITER_HANDLE *hLimiter_out, /* o : limiter struct handle */
const int16_t num_channels, /* i : number of I/O channels */
const int32_t sampling_rate /* i : sampling rate for processing */
);
void ivas_limiter_close(
IVAS_LIMITER_HANDLE* phLimiter /* i/o: pointer to limiter handle, can be NULL */
);
void ivas_limiter_dec
(
IVAS_LIMITER_HANDLE hLimiter, /* i/o: limiter struct handle */
float *output[MAX_OUTPUT_CHANNELS], /* i/o: input/output buffer */
const int16_t num_channels, /* i : number of channels to be processed */
const int16_t output_frame, /* i : number of samples per channel in the buffer */
const int16_t BER_detect /* i : BER detect flag */
);
void limiter_process(
IVAS_LIMITER_HANDLE hLimiter, /* i/o: limiter struct handle */
const int16_t output_frame, /* i : number of samples to be processed per channel in the I/O buffer */
const float threshold, /* i : signal amplitude above which limiting starts to be applied */
const int16_t BER_detect, /* i : BER detect flag */
int16_t *strong_saturation_cnt /* i/o: counter of strong saturations (can be NULL) */
);
/* clang-format on */
......
......@@ -3079,6 +3079,7 @@ const float ivas_lpf_4_butter_48k_sos[IVAS_BIQUAD_FILT_LEN << 2] =
1.00000000471366f, 1.f , -1.98677297369091f, 0.987060670205863f
};
 
#ifndef NONBE_FIX_MC_LFE_LPF
const float ivas_lpf_2_butter_16k[IVAS_BIQUAD_FILT_LEN << 1] =
{
0.000628720643081143f, 0.00125744128616229f, 0.000628720643081143f, 1.f, -1.92783286977036f, 0.930347752342683f
......@@ -3093,7 +3094,7 @@ const float ivas_lpf_2_butter_48k[IVAS_BIQUAD_FILT_LEN << 1] =
{
7.15317998432330e-05f, 0.000143063599686466f, 7.15317998432330e-05f, 1.f, -1.97593552482925f, 0.976221652028620f
};
#endif
const ivas_lfe_freq_models ivas_str_lfe_freq_models =
{
{ 16384, 14924, 13463, 12003, 10542, 9082, 7622, 6161,
......
......@@ -348,9 +348,11 @@ extern const int16_t Param_ISM_band_grouping[MAX_PARAM_ISM_NBANDS + 1];
extern const float ivas_lpf_4_butter_16k_sos[IVAS_BIQUAD_FILT_LEN << 2];
extern const float ivas_lpf_4_butter_32k_sos[IVAS_BIQUAD_FILT_LEN << 2];
extern const float ivas_lpf_4_butter_48k_sos[IVAS_BIQUAD_FILT_LEN << 2];
#ifndef NONBE_FIX_MC_LFE_LPF
extern const float ivas_lpf_2_butter_16k[IVAS_BIQUAD_FILT_LEN << 1];
extern const float ivas_lpf_2_butter_32k[IVAS_BIQUAD_FILT_LEN << 1];
extern const float ivas_lpf_2_butter_48k[IVAS_BIQUAD_FILT_LEN << 1];
#endif
extern const float ivas_lfe_window_coeff_48k[IVAS_LFE_FADE_LEN_48K];
extern const float ivas_lfe_window_coeff_32k[IVAS_LFE_FADE_LEN_32K];
......
/******************************************************************************************************
(C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
contributors to this repository. All Rights Reserved.
This software is protected by copyright law and by international treaties.
The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
contributors to this repository retain full ownership rights in their respective contributions in
the software. This notice grants no license of any kind, including but not limited to patent
license, nor is any license granted by implication, estoppel or otherwise.
Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
contributions.
This software is provided "AS IS", without any express or implied warranties. The software is in the
development stage. It is intended exclusively for experts who have experience with such software and
solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
and fitness for a particular purpose are hereby disclaimed and excluded.
Any dispute, controversy or claim arising under or in relation to providing this software shall be
submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
the United Nations Convention on Contracts on the International Sales of Goods.
*******************************************************************************************************/
#include "ivas_cnst.h"
#include <assert.h>
#include <stdint.h>
#include "options.h"
#include <math.h>
#include "cnst.h"
#include "prot.h"
#include "ivas_prot.h"
#ifdef DEBUGGING
#include "debug.h"
#endif
#include "wmc_auto.h"
/*-------------------------------------------------------------------------
* Euler2Quat()
*
* Calculate corresponding Quaternion from Euler angles in radians
*------------------------------------------------------------------------*/
void Euler2Quat(
const float yaw, /* i : yaw (x) */
const float pitch, /* i : pitch (y) */
const float roll, /* i : roll (z) */
IVAS_QUATERNION *quat /* o : quaternion describing the rotation */
)
{
float cr = cosf( roll * 0.5f );
float sr = sinf( roll * 0.5f );
float cp = cosf( pitch * 0.5f );
float sp = sinf( pitch * 0.5f );
float cy = cosf( yaw * 0.5f );
float sy = sinf( yaw * 0.5f );
quat->w = cr * cp * cy + sr * sp * sy;
quat->x = sr * cp * cy - cr * sp * sy;
quat->y = sr * cp * sy + cr * sp * cy;
quat->z = cr * cp * sy - sr * sp * cy;
return;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*-------------------------------------------------------------------------
* Quat2EulerDegree()
*
* Quaternion handling: calculate corresponding Euler angles in degrees
*------------------------------------------------------------------------*/
void Quat2EulerDegree(
const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */
float *yaw, /* o : yaw */
float *pitch, /* o : pitch */
float *roll /* o : roll */
)
{
if ( quat.w != -3.0 )
{
float p;
*yaw = atan2f( 2 * ( quat.w * quat.x + quat.y * quat.z ), 1 - 2 * ( quat.x * quat.x + quat.y * quat.y ) );
p = 2 * ( quat.w * quat.y - quat.z * quat.x );
p = max( -1.0f, min( 1.0f, p ) );
*pitch = asinf( p );
*roll = atan2f( 2 * ( quat.w * quat.z + quat.x * quat.y ), 1 - 2 * ( quat.y * quat.y + quat.z * quat.z ) );
*yaw *= _180_OVER_PI;
*pitch *= _180_OVER_PI;
*roll *= _180_OVER_PI;
}
else
{
/* Euler angles in R_X(roll)*R_Y(pitch)*R_Z(yaw) convention
*
* yaw: rotate scene counter-clockwise in the horizontal plane
* pitch: rotate scene in the median plane, increase elevation with positive values
* roll: rotate scene from the right ear to the top
*/
*yaw = quat.z;
*pitch = quat.y;
*roll = quat.x;
}
return;
}
#endif
/*-------------------------------------------------------------------------
* deg2rad()
*
* Converts degrees to normalized radians
*------------------------------------------------------------------------*/
float deg2rad(
float degrees )
{
while ( degrees >= 180.0f )
{
degrees = degrees - 360.0f;
}
while ( degrees <= -180.0f )
{
degrees = degrees + 360.0f;
}
return PI_OVER_180 * degrees;
}
......@@ -158,6 +158,29 @@ int16_t ivas_sba_get_nchan(
return ( nb_channels );
}
#ifdef NONBE_FIX_1052_SBA_EXT
/*-------------------------------------------------------------------*
* ivas_sba_spar_sid_bitlen()
*
* Get number of bits in SPAR SID frame
*-------------------------------------------------------------------*/
/*! r: number of bits in SPAR SID frame */
int16_t ivas_sba_spar_sid_bitlen(
const int16_t nchan_transport /* i : number of transport channels */
)
{
int16_t num_bits;
num_bits = SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND;
if ( nchan_transport > 1 )
{
num_bits -= 2;
}
return num_bits;
}
#endif
/*-------------------------------------------------------------------*
* ivas_sba_get_nchan_metadata()
......
......@@ -782,6 +782,4 @@ typedef struct ivas_param_ism_data_structure
float last_cardioid_left[MAX_NUM_OBJECTS];
} PARAM_ISM_CONFIG_DATA, *PARAM_ISM_CONFIG_HANDLE;
#endif /* IVAS_STAT_COM */
......@@ -154,10 +154,21 @@
/* only BE switches wrt selection floating point code */
/*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */
/*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#define SPLIT_REND_WITH_HEAD_ROT /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define ISAR_BITSTREAM_UPDATE_LC3PLUS /* FhG: Multiple improvements to the ISAR bitstream when LC3plus is used. See MR 1456 for details. */
#define SPLIT_REND_POSE_CORRECTION_UNUSED_BITS
#define FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK /* VA: issue 1081: correct error print-out when BINAURAL_SPLIT_PCM is requested */
#endif
#define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */
#define CONF_DISTATT /* Eri: Make distance attenuation configurable */
#define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */
#define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */
#define FIX_1060_USAN_ARRAY_BOUNDS /* FhG: issue 1060: USAN array-bounds errors */
#define FIX_989_TD_REND_ROM /* Eri: Clean-up for TD renderer and completion of ROM generation tool */
#define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/
/* #################### End BE switches ################################## */
......@@ -165,11 +176,14 @@
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */
#define NONBE_FIX_1045_ISM_BITRATE_SWITCHING /* Eri: Difference between ROM/File HRTF in ISM bitrate switching */
#define NONBE_FIX_1067_QUATERNIONSLERP_INACCURACIES /* Philips: issue 1067: QuaternionSlerp inaccuracies in corner cases */
#define NONBE_FIX_1065_ISM_MD_HANDLE /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */
#define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */
#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/
#define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */
#define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */
#define NONBE_FIX_1069_SVD_TUNING /* FhG: issue 1069: tune SVD constants */
#define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
#define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */
#define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */
/* ##################### End NON-BE switches ########################### */
/* ################## End DEVELOPMENT switches ######################### */
......
This diff is collapsed.
This diff is collapsed.