Skip to content
Commits on Source (133)
...@@ -167,6 +167,12 @@ stages: ...@@ -167,6 +167,12 @@ stages:
- git pull - git pull
- cd - - cd -
.update-ltv-repo-win: &update-ltv-repo-win
- Push-Location
- cd $LTV_DIR_WIN
- git pull
- Pop-Location
.enable-split-rendering: &enable-split-rendering .enable-split-rendering: &enable-split-rendering
# automatically enable #define SPLIT_REND_WITH_HEAD_ROT in options.h, handling both /**/-comment and //-comment # automatically enable #define SPLIT_REND_WITH_HEAD_ROT in options.h, handling both /**/-comment and //-comment
- sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)[[:space:]]*\*\//\1/g" ./lib_com/options.h - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)[[:space:]]*\*\//\1/g" ./lib_com/options.h
...@@ -189,6 +195,11 @@ stages: ...@@ -189,6 +195,11 @@ stages:
- cp "$LTV_DIR"/*.met scripts/testv/ - cp "$LTV_DIR"/*.met scripts/testv/
- cp "$LTV_DIR"/*.csv scripts/testv/ - cp "$LTV_DIR"/*.csv scripts/testv/
.copy-ltv-files-to-testv-dir-win: &copy-ltv-files-to-testv-dir-win
- cp $LTV_DIR_WIN\*.wav scripts\testv
- cp $LTV_DIR_WIN\*.met scripts\testv
- cp $LTV_DIR_WIN\*.csv scripts\testv
.activate-Werror-linux: &activate-Werror-linux .activate-Werror-linux: &activate-Werror-linux
- sed -i.bak "s/^# \(CFLAGS += -Werror\)/\1/" Makefile - sed -i.bak "s/^# \(CFLAGS += -Werror\)/\1/" Makefile
- sed -i.bak "s/# \(set(CMAKE_C_FLAGS \"\${CMAKE_C_FLAGS} -Werror\")\)/\1/" CMakeLists.txt - sed -i.bak "s/# \(set(CMAKE_C_FLAGS \"\${CMAKE_C_FLAGS} -Werror\")\)/\1/" CMakeLists.txt
...@@ -1360,7 +1371,7 @@ ivas-conformance: ...@@ -1360,7 +1371,7 @@ ivas-conformance:
tags: tags:
- ivas-windows - ivas-windows
stage: test stage: test
timeout: "60 minutes" timeout: "90 minutes"
rules: rules:
- if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance' - if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
...@@ -1378,9 +1389,8 @@ ivas-conformance: ...@@ -1378,9 +1389,8 @@ ivas-conformance:
# Reference creation # Reference creation
- python tests/create_short_testvectors.py - python tests/create_short_testvectors.py
- python scripts/prepare_combined_format_inputs.py - python scripts/prepare_combined_format_inputs.py
- python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --keep_files - python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --update_ref 1 -m create_ref --create_ref --keep_files
- python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref_part2 --keep_files - python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --update_ref 1 -m create_ref_part2 --keep_files
- python -m pytest tests/renderer/test_renderer.py --create_ref --keep_files
# Output creation # Output creation
- python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html - python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
...@@ -1405,6 +1415,11 @@ ivas-conformance: ...@@ -1405,6 +1415,11 @@ ivas-conformance:
- cp -r -force -ErrorAction Ignore tests/ref testvec/testv/ref - cp -r -force -ErrorAction Ignore tests/ref testvec/testv/ref
- cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref - cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref
- cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref - cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref
# Remove redundant files
- python scripts/cleanup_26252.py
# Copy test script files
- cp -r -force -ErrorAction Ignore tests/conformance-test testvec/ - cp -r -force -ErrorAction Ignore tests/conformance-test testvec/
- cp Readme_IVAS_dec.txt testvec - cp Readme_IVAS_dec.txt testvec
- cp Readme_IVAS_enc.txt testvec - cp Readme_IVAS_enc.txt testvec
...@@ -1414,6 +1429,7 @@ ivas-conformance: ...@@ -1414,6 +1429,7 @@ ivas-conformance:
- cp IVAS_dec.exe testvec/bin - cp IVAS_dec.exe testvec/bin
- cp IVAS_rend.exe testvec/bin - cp IVAS_rend.exe testvec/bin
# Test run generated scripts in testvec # Test run generated scripts in testvec
- cd testvec - cd testvec
- python -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html - python -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html
...@@ -1439,7 +1455,7 @@ ivas-conformance-linux: ...@@ -1439,7 +1455,7 @@ ivas-conformance-linux:
tags: tags:
- ivas-linux - ivas-linux
stage: test stage: test
timeout: "60 minutes" timeout: "90 minutes"
rules: rules:
- if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux' - if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
allow_failure: allow_failure:
...@@ -1455,12 +1471,12 @@ ivas-conformance-linux: ...@@ -1455,12 +1471,12 @@ ivas-conformance-linux:
# Reference creation # Reference creation
- python3 tests/create_short_testvectors.py - python3 tests/create_short_testvectors.py
- python3 scripts/prepare_combined_format_inputs.py - python3 scripts/prepare_combined_format_inputs.py
- python3 -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --keep_files - TEST_SET="tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py"
- python3 -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref_part2 --keep_files - python3 -m pytest $TEST_SET -v -n auto --update_ref 1 -m create_ref --create_ref --keep_files
- python3 -m pytest tests/renderer/test_renderer.py --create_ref --keep_files - python3 -m pytest $TEST_SET -v -n auto --update_ref 1 -m create_ref_part2 --keep_files
# Output creation # Output creation
- python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html - python3 -m pytest $TEST_SET -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
- python3 scripts/parse_commands.py report_cmd.html Readme_IVAS.txt - python3 scripts/parse_commands.py report_cmd.html Readme_IVAS.txt
# Copy input data and output ref data # Copy input data and output ref data
...@@ -1478,32 +1494,54 @@ ivas-conformance-linux: ...@@ -1478,32 +1494,54 @@ ivas-conformance-linux:
- cp -r tests/ref testvec/testv/ref - cp -r tests/ref testvec/testv/ref
- cp -r tests/dut/* testvec/testv/ref - cp -r tests/dut/* testvec/testv/ref
- cp -r tests/renderer/cut testvec/testv/renderer/ref - cp -r tests/renderer/cut testvec/testv/renderer/ref
# Remove redundant files
- python3 scripts/cleanup_26252.py
# Copy test script files
- cp -r tests/conformance-test testvec/ - cp -r tests/conformance-test testvec/
- cp Readme_IVAS_dec.txt testvec - cp Readme_IVAS_dec.txt testvec
- cp Readme_IVAS_enc.txt testvec - cp Readme_IVAS_enc.txt testvec
- cp Readme_IVAS_rend.txt testvec - cp Readme_IVAS_rend.txt testvec
- cp Readme_IVAS_JBM_dec.txt testvec - cp Readme_IVAS_JBM_dec.txt testvec
# Create GCOV execs for coverage analysis
- make clean
- make GCOV=1 -j
- cp IVAS_cod testvec/bin - cp IVAS_cod testvec/bin
- cp IVAS_dec testvec/bin - cp IVAS_dec testvec/bin
- cp IVAS_rend testvec/bin - cp IVAS_rend testvec/bin
# Test run generated scripts in testvec # Test run generated scripts in testvec
- cd testvec - cd testvec
- python3 -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html - exit_code=0
- python3 -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$?
- mv report.html .. - mv report.html ..
- mv report-junit.xml .. - mv report-junit.xml ..
# Collect coverage
- cd -
- lcov -c -d obj -o coverage.info
- lcov -r coverage.info "*apps*" -o coverage.info
- lcov -r coverage.info "*lib_util*" -o coverage.info
- commit_sha=$(git rev-parse HEAD)
- genhtml coverage.info -o coverage -t "Coverage on main @ $commit_sha"
artifacts: artifacts:
name: "ivas-conformance-linux-$CI_COMMIT_SHORT_SHA" name: "ivas-conformance-linux-$CI_COMMIT_SHORT_SHA"
expire_in: 1 week expire_in: 1 week
when: always when: always
paths: paths:
- report_cmd.html
- report-junit.xml - report-junit.xml
- report.html - report.html
- Readme_IVAS_dec.txt - Readme_IVAS_dec.txt
- Readme_IVAS_enc.txt - Readme_IVAS_enc.txt
- Readme_IVAS_rend.txt - Readme_IVAS_rend.txt
- Readme_IVAS_JBM_dec.txt - Readme_IVAS_JBM_dec.txt
- coverage.info
- coverage
expose_as: "Draft IVAS conformance -- Linux" expose_as: "Draft IVAS conformance -- Linux"
reports: reports:
junit: report-junit.xml junit: report-junit.xml
......
...@@ -660,7 +660,13 @@ int main( ...@@ -660,7 +660,13 @@ int main(
fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
goto cleanup; goto cleanup;
} }
#ifdef CONF_DISTATT
if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
goto cleanup;
}
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
......
...@@ -335,6 +335,9 @@ typedef struct _IVAS_RENDER_CONFIG ...@@ -335,6 +335,9 @@ typedef struct _IVAS_RENDER_CONFIG
ISAR_SPLIT_REND_CONFIG_DATA split_rend_config; ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
#endif #endif
float directivity[IVAS_MAX_NUM_OBJECTS * 3]; float directivity[IVAS_MAX_NUM_OBJECTS * 3];
#ifdef CONF_DISTATT
float distAtt[3];
#endif
} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;
......
...@@ -3207,6 +3207,9 @@ void ivas_qmetadata_enc_sid_encode( ...@@ -3207,6 +3207,9 @@ void ivas_qmetadata_enc_sid_encode(
BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */
IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */ IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */
const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure*/ 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 */ const int16_t ivas_format /* i : ivas format */
); );
...@@ -3515,6 +3518,13 @@ int16_t ivas_sba_get_nchan_metadata( ...@@ -3515,6 +3518,13 @@ int16_t ivas_sba_get_nchan_metadata(
const int32_t ivas_total_brate /* i : IVAS total bitrate */ 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( void ivas_sba_get_spar_hoa_ch_ind(
const int16_t num_md_chs, /* i : number of MD channels */ const int16_t num_md_chs, /* i : number of MD channels */
const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */
...@@ -3616,6 +3626,9 @@ ivas_error ivas_dirac_enc( ...@@ -3616,6 +3626,9 @@ ivas_error ivas_dirac_enc(
const int16_t input_frame, /* i : input frame length */ const int16_t input_frame, /* i : input frame length */
const int16_t dtx_vad, /* i : DTX vad flag */ const int16_t dtx_vad, /* i : DTX vad flag */
const IVAS_FORMAT ivas_format, /* i : ivas format */ 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 */ const int16_t hodirac_flag /* i : hodirac flag */
); );
...@@ -3671,6 +3684,9 @@ void ivas_dirac_dec_read_BS( ...@@ -3671,6 +3684,9 @@ void ivas_dirac_dec_read_BS(
int16_t *nb_bits, /* o : number of bits read */ int16_t *nb_bits, /* o : number of bits read */
const int16_t last_bit_pos, /* i : last read bitstream position */ const int16_t last_bit_pos, /* i : last read bitstream position */
const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ 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 */ int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */
); );
......
...@@ -158,6 +158,29 @@ int16_t ivas_sba_get_nchan( ...@@ -158,6 +158,29 @@ int16_t ivas_sba_get_nchan(
return ( nb_channels ); 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() * ivas_sba_get_nchan_metadata()
......
...@@ -161,13 +161,13 @@ ...@@ -161,13 +161,13 @@
#define LC3PLUS_LEA_COMPAT_BITRATES_48_6 /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel) */ #define LC3PLUS_LEA_COMPAT_BITRATES_48_6 /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel) */
#endif #endif
#define FIX_NUM_SUBFRAME_UPDATE #define FIX_NUM_SUBFRAME_UPDATE
#define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ #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_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */
#define FIX_1077_MEMORY_TEST_MISSING /* orange: issue 1077 : add missing memory test*/ #define FIX_1077_MEMORY_TEST_MISSING /* orange: issue 1077 : add missing memory test*/
#define FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK /* VA: issue 1081: correct error print-out when BINAURAL_SPLIT_PCM is requested */ #define FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK /* VA: issue 1081: correct error print-out when BINAURAL_SPLIT_PCM is requested */
#define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */
/* #################### End BE switches ################################## */ /* #################### End BE switches ################################## */
...@@ -177,10 +177,10 @@ ...@@ -177,10 +177,10 @@
#define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */ #define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */
#define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */ #define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */
#define NONBE_FIX_SBA_SIGNALING_BITS_B /* FhG: issue 1061: option B: signal sba order additionally in OSBA */ #define NONBE_FIX_SBA_SIGNALING_BITS_B /* FhG: issue 1061: option B: signal sba order additionally in OSBA */
#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_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */
#define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */
/* ##################### End NON-BE switches ########################### */ /* ##################### End NON-BE switches ########################### */
......
...@@ -1148,9 +1148,9 @@ ivas_error ivas_binRenderer_open( ...@@ -1148,9 +1148,9 @@ ivas_error ivas_binRenderer_open(
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{ {
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
hBinRenderer->numPoses = st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses + 1; hBinRenderer->numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses + 1;
#else #else
hBinRenderer->numPoses = st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; hBinRenderer->numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
#endif #endif
} }
else else
......
...@@ -765,6 +765,9 @@ ivas_error ivas_dirac_dec_config( ...@@ -765,6 +765,9 @@ ivas_error ivas_dirac_dec_config(
int16_t need_parambin; int16_t need_parambin;
int16_t dec_param_estim_old; int16_t dec_param_estim_old;
int16_t dec_param_estim_new; int16_t dec_param_estim_new;
#ifdef SPLIT_REND_WITH_HEAD_ROT
int16_t num_poses, pos_idx;
#endif
error = IVAS_ERR_OK; error = IVAS_ERR_OK;
...@@ -775,6 +778,14 @@ ivas_error ivas_dirac_dec_config( ...@@ -775,6 +778,14 @@ ivas_error ivas_dirac_dec_config(
hodirac_flag = ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ); hodirac_flag = ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order );
dec_param_estim_old = ( dec_config_flag == DIRAC_RECONFIGURE ) ? st_ivas->hDirAC->hConfig->dec_param_estim : FALSE; dec_param_estim_old = ( dec_config_flag == DIRAC_RECONFIGURE ) ? st_ivas->hDirAC->hConfig->dec_param_estim : FALSE;
#ifdef SPLIT_REND_WITH_HEAD_ROT
num_poses = 1;
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
num_poses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
}
#endif
sparfoa_flag = 0; sparfoa_flag = 0;
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA && st_ivas->ivas_format == SBA_FORMAT && !hodirac_flag ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA && st_ivas->ivas_format == SBA_FORMAT && !hodirac_flag )
{ {
...@@ -904,7 +915,7 @@ ivas_error ivas_dirac_dec_config( ...@@ -904,7 +915,7 @@ ivas_error ivas_dirac_dec_config(
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
/* copy td-decorr flag to split renderer side rendereres */ /* copy td-decorr flag to split renderer side rendereres */
for ( int16_t pos_idx = 1; pos_idx < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; pos_idx++ ) for ( pos_idx = 1; pos_idx < num_poses; pos_idx++ )
{ {
st_ivas->hDiracDecBin[pos_idx]->useTdDecorr = st_ivas->hDiracDecBin[0]->useTdDecorr; st_ivas->hDiracDecBin[pos_idx]->useTdDecorr = st_ivas->hDiracDecBin[0]->useTdDecorr;
} }
...@@ -939,7 +950,7 @@ ivas_error ivas_dirac_dec_config( ...@@ -939,7 +950,7 @@ ivas_error ivas_dirac_dec_config(
} }
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
for ( int16_t pos_idx = 0; pos_idx < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; pos_idx++ ) for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ )
{ {
st_ivas->hDiracDecBin[pos_idx]->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); st_ivas->hDiracDecBin[pos_idx]->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate );
} }
...@@ -1002,6 +1013,9 @@ void ivas_dirac_dec_read_BS( ...@@ -1002,6 +1013,9 @@ void ivas_dirac_dec_read_BS(
int16_t *nb_bits, /* o : number of bits read */ int16_t *nb_bits, /* o : number of bits read */
const int16_t last_bit_pos, /* i : last read bitstream position */ const int16_t last_bit_pos, /* i : last read bitstream position */
const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ 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 */ int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */
) )
{ {
...@@ -1035,7 +1049,12 @@ void ivas_dirac_dec_read_BS( ...@@ -1035,7 +1049,12 @@ void ivas_dirac_dec_read_BS(
} }
} }
#ifdef NONBE_FIX_1052_SBA_EXT
*nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT );
#else
*nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT ); *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT );
#endif
for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
{ {
hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0]; hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0];
...@@ -1083,7 +1102,11 @@ void ivas_dirac_dec_read_BS( ...@@ -1083,7 +1102,11 @@ void ivas_dirac_dec_read_BS(
next_bit_pos_orig = st->next_bit_pos; next_bit_pos_orig = st->next_bit_pos;
/* subtract mode signaling bits, since bitstream was moved after mode reading */ /* subtract mode signaling bits, since bitstream was moved after mode reading */
#ifdef NONBE_FIX_1052_SBA_EXT
st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS - SBA_PLANAR_BITS - SBA_ORDER_BITS );
#else
st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS );
#endif
/* 1 bit flag for signaling metadata to read */ /* 1 bit flag for signaling metadata to read */
b = st->bit_stream[( st->next_bit_pos )--]; b = st->bit_stream[( st->next_bit_pos )--];
( *nb_bits )++; ( *nb_bits )++;
...@@ -1103,7 +1126,11 @@ void ivas_dirac_dec_read_BS( ...@@ -1103,7 +1126,11 @@ void ivas_dirac_dec_read_BS(
} }
} }
#ifdef NONBE_FIX_1052_SBA_EXT
*nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT );
#else
*nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT ); *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT );
#endif
for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
{ {
hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0]; hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0];
...@@ -2338,17 +2365,17 @@ void ivas_dirac_dec_render_sf( ...@@ -2338,17 +2365,17 @@ void ivas_dirac_dec_render_sf(
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{ {
if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL ) if ( st_ivas->hSplitBinRend->hCldfbDataOut != NULL )
{ {
for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ )
{ {
for ( ch = 0; ch < st_ivas->hBinRenderer->nInChannels; ch++ ) for ( ch = 0; ch < st_ivas->hBinRenderer->nInChannels; ch++ )
{ {
mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_RealBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands ); mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands ); mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
} }
} }
st_ivas->hSplitBinRend.hCldfbDataOut->config = st_ivas->hIntSetup.output_config; st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config;
} }
} }
#endif #endif
...@@ -2356,7 +2383,7 @@ void ivas_dirac_dec_render_sf( ...@@ -2356,7 +2383,7 @@ void ivas_dirac_dec_render_sf(
/* Perform binaural rendering */ /* Perform binaural rendering */
ivas_binRenderer( st_ivas->hBinRenderer, ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData,
#endif #endif
st_ivas->hCombinedOrientationData, st_ivas->hCombinedOrientationData,
...@@ -2375,8 +2402,8 @@ void ivas_dirac_dec_render_sf( ...@@ -2375,8 +2402,8 @@ void ivas_dirac_dec_render_sf(
{ {
for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ )
{ {
mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands ); mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands ); mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
} }
} }
} }
......
...@@ -59,6 +59,10 @@ static ivas_error ivas_read_format( Decoder_Struct *st_ivas, int16_t *num_bits_r ...@@ -59,6 +59,10 @@ static ivas_error ivas_read_format( Decoder_Struct *st_ivas, int16_t *num_bits_r
static ivas_error doSanityChecks_IVAS( Decoder_Struct *st_ivas ); static ivas_error doSanityChecks_IVAS( Decoder_Struct *st_ivas );
#ifdef NONBE_FIX_1052_SBA_EXT
static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order );
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error ivas_dec_reconfig_split_rend( Decoder_Struct *st_ivas ); static ivas_error ivas_dec_reconfig_split_rend( Decoder_Struct *st_ivas );
...@@ -77,7 +81,7 @@ static ivas_error ivas_dec_reconfig_split_rend( ...@@ -77,7 +81,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
int16_t cldfb_in_flag, num_ch, ch, isCldfbNeeded, i, pcm_out_flag; int16_t cldfb_in_flag, num_ch, ch, isCldfbNeeded, i, pcm_out_flag;
SPLIT_REND_WRAPPER *hSplitRendWrapper; SPLIT_REND_WRAPPER *hSplitRendWrapper;
hSplitRendWrapper = &st_ivas->hSplitBinRend.splitrend; hSplitRendWrapper = &st_ivas->hSplitBinRend->splitrend;
pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
cldfb_in_flag = 0; cldfb_in_flag = 0;
...@@ -218,11 +222,11 @@ static ivas_error ivas_dec_init_split_rend( ...@@ -218,11 +222,11 @@ static ivas_error ivas_dec_init_split_rend(
cldfb_in_flag = 1; cldfb_in_flag = 1;
} }
ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS ); ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS );
if ( cldfb_in_flag == 1 && ( st_ivas->hSplitBinRend.splitrend.multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ) if ( cldfb_in_flag == 1 && ( st_ivas->hSplitBinRend->splitrend.multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) )
{ {
if ( ( st_ivas->hSplitBinRend.hCldfbDataOut = (ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA ) ) ) == NULL ) if ( ( st_ivas->hSplitBinRend->hCldfbDataOut = (ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA ) ) ) == NULL )
{ {
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for cldfb data out buffer\n" ) ); return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for cldfb data out buffer\n" ) );
} }
...@@ -235,11 +239,33 @@ static ivas_error ivas_dec_init_split_rend( ...@@ -235,11 +239,33 @@ static ivas_error ivas_dec_init_split_rend(
mixed_td_cldfb_flag = 1; mixed_td_cldfb_flag = 1;
} }
error = ISAR_PRE_REND_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, (int16_t) st_ivas->hDecoderConfig->render_framesize, mixed_td_cldfb_flag ); error = ISAR_PRE_REND_open( &st_ivas->hSplitBinRend->splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, (int16_t) st_ivas->hDecoderConfig->render_framesize, mixed_td_cldfb_flag );
return error; return error;
} }
#endif #endif
#ifdef NONBE_FIX_1052_SBA_EXT
static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order )
{
AUDIO_CONFIG output_config;
output_config = IVAS_AUDIO_CONFIG_HOA3;
switch ( sba_order )
{
case SBA_FOA_ORDER:
output_config = IVAS_AUDIO_CONFIG_FOA;
break;
case SBA_HOA2_ORDER:
output_config = IVAS_AUDIO_CONFIG_HOA2;
break;
case SBA_HOA3_ORDER:
output_config = IVAS_AUDIO_CONFIG_HOA3;
break;
default:
assert( 0 );
}
return output_config;
}
#endif
/*-------------------------------------------------------------------* /*-------------------------------------------------------------------*
* ivas_dec_setup() * ivas_dec_setup()
...@@ -327,6 +353,13 @@ ivas_error ivas_dec_setup( ...@@ -327,6 +353,13 @@ ivas_error ivas_dec_setup(
/* read Ambisonic (SBA) order */ /* read Ambisonic (SBA) order */
st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1];
st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read];
#ifdef NONBE_FIX_1052_SBA_EXT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
{
st_ivas->hDecoderConfig->output_config = ivas_set_output_config_from_sba_order( st_ivas->sba_order );
st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config );
}
#endif
num_bits_read += SBA_ORDER_BITS; num_bits_read += SBA_ORDER_BITS;
if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->last_active_ivas_total_brate && ivas_total_brate > IVAS_SID_5k2 ) if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->last_active_ivas_total_brate && ivas_total_brate > IVAS_SID_5k2 )
...@@ -608,6 +641,14 @@ ivas_error ivas_dec_setup( ...@@ -608,6 +641,14 @@ ivas_error ivas_dec_setup(
break; break;
} }
#ifdef NONBE_FIX_1052_SBA_EXT
if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
{
st_ivas->hDecoderConfig->output_config = ivas_set_output_config_from_sba_order( st_ivas->sba_order );
st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config );
}
#endif
if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == SBA_FORMAT ) if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == SBA_FORMAT )
{ {
int16_t nchan_transport_old, nchan_transport; int16_t nchan_transport_old, nchan_transport;
...@@ -884,6 +925,16 @@ static ivas_error ivas_read_format( ...@@ -884,6 +925,16 @@ static ivas_error ivas_read_format(
if ( st_ivas->ivas_format == SBA_FORMAT ) if ( st_ivas->ivas_format == SBA_FORMAT )
{ {
#ifdef NONBE_FIX_1052_SBA_EXT
/* read Ambisonic (SBA) planar flag */
st_ivas->sba_planar = st_ivas->bit_stream[*num_bits_read];
*num_bits_read += SBA_PLANAR_BITS;
/* read Ambisonic (SBA) order */
st_ivas->sba_order = st_ivas->bit_stream[*num_bits_read + 1];
st_ivas->sba_order += 2 * st_ivas->bit_stream[*num_bits_read];
*num_bits_read += SBA_ORDER_BITS;
#endif
if ( st_ivas->sba_analysis_order == 0 ) if ( st_ivas->sba_analysis_order == 0 )
{ {
st_ivas->sba_analysis_order = SBA_FOA_ORDER; st_ivas->sba_analysis_order = SBA_FOA_ORDER;
...@@ -1154,7 +1205,19 @@ ivas_error ivas_init_decoder( ...@@ -1154,7 +1205,19 @@ ivas_error ivas_init_decoder(
if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
{ {
#ifdef FIX_1052_EXT_OUTPUT
if ( st_ivas->ivas_format == STEREO_FORMAT )
{
hDecoderConfig->nchan_out = CPE_CHANNELS;
}
else if ( st_ivas->ivas_format == MC_FORMAT )
{
hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->transport_config );
}
else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
#else
if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
#endif
{ {
hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 );
hDecoderConfig->nchan_out += st_ivas->nchan_ism; hDecoderConfig->nchan_out += st_ivas->nchan_ism;
...@@ -1177,7 +1240,19 @@ ivas_error ivas_init_decoder( ...@@ -1177,7 +1240,19 @@ ivas_error ivas_init_decoder(
st_ivas->intern_config = output_config; st_ivas->intern_config = output_config;
#ifdef FIX_1052_EXT_OUTPUT
if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->ivas_format == MC_FORMAT )
{
ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->transport_config );
st_ivas->intern_config = st_ivas->transport_config;
}
else
{
ivas_output_init( &( st_ivas->hOutSetup ), output_config ); ivas_output_init( &( st_ivas->hOutSetup ), output_config );
}
#else
ivas_output_init( &( st_ivas->hOutSetup ), output_config );
#endif
if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
{ {
...@@ -1260,18 +1335,14 @@ ivas_error ivas_init_decoder( ...@@ -1260,18 +1335,14 @@ ivas_error ivas_init_decoder(
* Initialize binuaral split rendering * Initialize binuaral split rendering
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || if ( st_ivas->hSplitBinRend != NULL && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ||
( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) )
{ {
if ( ( error = ivas_dec_init_split_rend( st_ivas ) ) != IVAS_ERR_OK ) if ( ( error = ivas_dec_init_split_rend( st_ivas ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
} }
else
{
st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses = 1;
}
#endif #endif
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
...@@ -2067,7 +2138,7 @@ ivas_error ivas_init_decoder( ...@@ -2067,7 +2138,7 @@ ivas_error ivas_init_decoder(
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#else #else
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
...@@ -2614,10 +2685,7 @@ void ivas_initialize_handles_dec( ...@@ -2614,10 +2685,7 @@ void ivas_initialize_handles_dec(
st_ivas->hCombinedOrientationData = NULL; st_ivas->hCombinedOrientationData = NULL;
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
st_ivas->hSplitBinRend.hMultiBinCldfbData = NULL; st_ivas->hSplitBinRend = NULL;
st_ivas->hSplitBinRend.hCldfbDataOut = NULL;
st_ivas->hSplitBinRend.numTdSamplesPerChannelCached = 0;
isar_init_split_rend_handles( &st_ivas->hSplitBinRend.splitrend );
for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
{ {
st_ivas->hTdRendHandles[i] = NULL; st_ivas->hTdRendHandles[i] = NULL;
...@@ -2761,9 +2829,7 @@ void ivas_destroy_dec( ...@@ -2761,9 +2829,7 @@ void ivas_destroy_dec(
ivas_binRenderer_close( &st_ivas->hBinRenderer ); ivas_binRenderer_close( &st_ivas->hBinRenderer );
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
/* Split binaural renderer handle */ /* TD binaural renderer handles */
ISAR_PRE_REND_close( &st_ivas->hSplitBinRend.splitrend, NULL );
for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
{ {
if ( st_ivas->hTdRendHandles[i] != NULL ) if ( st_ivas->hTdRendHandles[i] != NULL )
...@@ -2772,12 +2838,6 @@ void ivas_destroy_dec( ...@@ -2772,12 +2838,6 @@ void ivas_destroy_dec(
ivas_td_binaural_close( &st_ivas->hTdRendHandles[i] ); ivas_td_binaural_close( &st_ivas->hTdRendHandles[i] );
} }
} }
if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL )
{
free( st_ivas->hSplitBinRend.hCldfbDataOut );
st_ivas->hSplitBinRend.hCldfbDataOut = NULL;
}
#endif #endif
/* Parametric binaural renderer handle */ /* Parametric binaural renderer handle */
...@@ -2790,7 +2850,7 @@ void ivas_destroy_dec( ...@@ -2790,7 +2850,7 @@ void ivas_destroy_dec(
/* Crend handle */ /* Crend handle */
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ); ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses );
#else #else
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) );
#endif #endif
...@@ -3153,11 +3213,25 @@ static ivas_error doSanityChecks_IVAS( ...@@ -3153,11 +3213,25 @@ static ivas_error doSanityChecks_IVAS(
/* Verify stereo output configuration */ /* Verify stereo output configuration */
if ( st_ivas->ivas_format == STEREO_FORMAT ) if ( st_ivas->ivas_format == STEREO_FORMAT )
{ {
#ifdef FIX_1052_EXT_OUTPUT
if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
#else
if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM ) if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM )
#endif
{ {
return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" ); return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" );
} }
} }
#ifdef FIX_1052_EXT_OUTPUT
/* Verify output configuration for other formats */
else
{
if ( output_config == IVAS_AUDIO_CONFIG_INVALID )
{
return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" );
}
}
#else
else if ( st_ivas->ivas_format == ISM_FORMAT ) else if ( st_ivas->ivas_format == ISM_FORMAT )
{ {
/* Verify ISM output configuration */ /* Verify ISM output configuration */
...@@ -3189,6 +3263,7 @@ static ivas_error doSanityChecks_IVAS( ...@@ -3189,6 +3263,7 @@ static ivas_error doSanityChecks_IVAS(
return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for Multi-channel" ); return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for Multi-channel" );
} }
} }
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 ) if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 )
......
...@@ -231,7 +231,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -231,7 +231,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
/* Open Crend Binaural renderer */ /* Open Crend Binaural renderer */
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#else #else
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif #endif
...@@ -298,7 +298,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -298,7 +298,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
/* close the crend binaural renderer */ /* close the crend binaural renderer */
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ); ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses );
#else #else
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) );
#endif #endif
......
...@@ -681,7 +681,11 @@ ivas_error ivas_jbm_dec_tc( ...@@ -681,7 +681,11 @@ ivas_error ivas_jbm_dec_tc(
/* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */
if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 ||
output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 ||
#ifdef FIX_1052_EXT_OUTPUT
output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) || output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
#else
output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) )
#endif
{ {
ivas_lfe_synth_with_filters( st_ivas->hMasa->hMasaLfeSynth, p_output, output_frame, n, LFE_CHANNEL ); ivas_lfe_synth_with_filters( st_ivas->hMasa->hMasaLfeSynth, p_output, output_frame, n, LFE_CHANNEL );
} }
...@@ -1332,7 +1336,7 @@ ivas_error ivas_jbm_dec_render( ...@@ -1332,7 +1336,7 @@ ivas_error ivas_jbm_dec_render(
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{ {
if ( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, if ( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
&st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : p_tc, p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : p_tc, p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK )
{ {
return error; return error;
...@@ -1497,7 +1501,7 @@ ivas_error ivas_jbm_dec_render( ...@@ -1497,7 +1501,7 @@ ivas_error ivas_jbm_dec_render(
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{ {
nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
} }
else else
{ {
...@@ -1665,14 +1669,37 @@ ivas_error ivas_jbm_dec_flush_renderer( ...@@ -1665,14 +1669,37 @@ ivas_error ivas_jbm_dec_flush_renderer(
{ {
if ( mc_mode_old == MC_MODE_MCT ) if ( mc_mode_old == MC_MODE_MCT )
{ {
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
int16_t crendInPlaceRotation = FALSE;
if ( st_ivas->transport_config != intern_config_old && ( intern_config_old == IVAS_AUDIO_CONFIG_FOA || intern_config_old == IVAS_AUDIO_CONFIG_HOA2 || intern_config_old == IVAS_AUDIO_CONFIG_HOA3 ) )
{
if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) < ( hIntSetupOld->nchan_out_woLFE + hIntSetupOld->num_lfe ) )
{
crendInPlaceRotation = TRUE;
ivas_mc2sba( st_ivas->hTransSetup, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, hIntSetupOld->ambisonics_order, GAIN_LFE );
}
}
#endif
if ( renderer_type_old == RENDERER_BINAURAL_MIXER_CONV || renderer_type_old == RENDERER_BINAURAL_MIXER_CONV_ROOM ) if ( renderer_type_old == RENDERER_BINAURAL_MIXER_CONV || renderer_type_old == RENDERER_BINAURAL_MIXER_CONV_ROOM )
{ {
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
#if defined SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : st_ivas->hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : st_ivas->hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
#else
#if defined SPLIT_REND_WITH_HEAD_ROT #if defined SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK )
#else #else
if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
#endif #endif
{ {
return error; return error;
...@@ -2312,7 +2339,11 @@ ivas_error ivas_jbm_dec_tc_buffer_open( ...@@ -2312,7 +2339,11 @@ ivas_error ivas_jbm_dec_tc_buffer_open(
const int16_t n_samples_granularity /* i : granularity of the renderer/buffer */ const int16_t n_samples_granularity /* i : granularity of the renderer/buffer */
) )
{ {
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
int32_t nsamp_to_allocate;
#else
int16_t nsamp_to_allocate; int16_t nsamp_to_allocate;
#endif
DECODER_TC_BUFFER_HANDLE hTcBuffer; DECODER_TC_BUFFER_HANDLE hTcBuffer;
int16_t nMaxSlotsPerSubframe; int16_t nMaxSlotsPerSubframe;
int16_t nchan_residual; int16_t nchan_residual;
...@@ -2391,7 +2422,11 @@ ivas_error ivas_jbm_dec_tc_buffer_open( ...@@ -2391,7 +2422,11 @@ ivas_error ivas_jbm_dec_tc_buffer_open(
{ {
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) );
} }
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
set_zero_l( hTcBuffer->tc_buffer, nsamp_to_allocate );
#else
set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate ); set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate );
#endif
offset = 0; offset = 0;
for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ )
...@@ -2437,7 +2472,12 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( ...@@ -2437,7 +2472,12 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
const int16_t n_samples_granularity /* i : new granularity of the renderer/buffer */ const int16_t n_samples_granularity /* i : new granularity of the renderer/buffer */
) )
{ {
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
int32_t nsamp_to_allocate, offset;
int16_t n_samp_full, n_samp_residual, nchan_residual;
#else
int16_t nsamp_to_allocate, n_samp_full, n_samp_residual, offset, nchan_residual; int16_t nsamp_to_allocate, n_samp_full, n_samp_residual, offset, nchan_residual;
#endif
int16_t ch_idx; int16_t ch_idx;
DECODER_TC_BUFFER_HANDLE hTcBuffer; DECODER_TC_BUFFER_HANDLE hTcBuffer;
...@@ -2524,7 +2564,11 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( ...@@ -2524,7 +2564,11 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
{ {
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) );
} }
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
set_zero_l( hTcBuffer->tc_buffer, nsamp_to_allocate );
#else
set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate ); set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate );
#endif
offset = 0; offset = 0;
for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ )
......
...@@ -397,7 +397,11 @@ ivas_error ivas_masa_decode( ...@@ -397,7 +397,11 @@ ivas_error ivas_masa_decode(
hMasa->config.coherencePresent = !hQMetaData->all_coherence_zero; hMasa->config.coherencePresent = !hQMetaData->all_coherence_zero;
#ifdef FIX_1052_EXT_OUTPUT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) )
#else
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
#endif
{ {
index_16bits( hQMetaData, hMasa->data.sph_grid16 ); index_16bits( hQMetaData, hMasa->data.sph_grid16 );
} }
...@@ -617,7 +621,11 @@ ivas_error ivas_masa_dec_open( ...@@ -617,7 +621,11 @@ ivas_error ivas_masa_dec_open(
hMasa->config.joinedSubframes = FALSE; hMasa->config.joinedSubframes = FALSE;
/* Create spherical grid only for external output */ /* Create spherical grid only for external output */
#ifdef FIX_1052_EXT_OUTPUT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) )
#else
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
#endif
{ {
if ( ( hMasa->data.sph_grid16 = (SPHERICAL_GRID_DATA *) malloc( sizeof( SPHERICAL_GRID_DATA ) ) ) == NULL ) if ( ( hMasa->data.sph_grid16 = (SPHERICAL_GRID_DATA *) malloc( sizeof( SPHERICAL_GRID_DATA ) ) ) == NULL )
{ {
...@@ -1048,6 +1056,9 @@ static ivas_error init_lfe_synth_data( ...@@ -1048,6 +1056,9 @@ static ivas_error init_lfe_synth_data(
( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 ||
output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_2 ||
output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 ||
#ifdef FIX_1052_EXT_OUTPUT
output_config == IVAS_AUDIO_CONFIG_EXTERNAL ||
#endif
output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 ||
output_config == IVAS_AUDIO_CONFIG_HOA3 || output_config == IVAS_AUDIO_CONFIG_HOA3 ||
( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) ) ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) )
......
...@@ -148,7 +148,11 @@ ivas_error ivas_param_mc_dec_open( ...@@ -148,7 +148,11 @@ ivas_error ivas_param_mc_dec_open(
hParamMC->hoa_encoder = NULL; hParamMC->hoa_encoder = NULL;
/* determine the synthesis config */ /* determine the synthesis config */
#ifdef FIX_1052_EXT_OUTPUT
if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD || st_ivas->transport_config == output_config || output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
#else
if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD || st_ivas->transport_config == output_config ) if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD || st_ivas->transport_config == output_config )
#endif
{ {
hParamMC->synthesis_conf = PARAM_MC_SYNTH_DIRECT; hParamMC->synthesis_conf = PARAM_MC_SYNTH_DIRECT;
} }
...@@ -1689,24 +1693,24 @@ void ivas_param_mc_dec_render( ...@@ -1689,24 +1693,24 @@ void ivas_param_mc_dec_render(
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{ {
if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL ) if ( st_ivas->hSplitBinRend->hCldfbDataOut != NULL )
{ {
for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ )
{ {
for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ ) for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ )
{ {
mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_RealBuffer[ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands ); mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer[ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands );
mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands ); mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands );
} }
} }
st_ivas->hSplitBinRend.hCldfbDataOut->config = st_ivas->hIntSetup.output_config; st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config;
} }
} }
#endif #endif
ivas_binRenderer( st_ivas->hBinRenderer, ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
NULL, NULL,
#endif #endif
...@@ -1725,8 +1729,8 @@ void ivas_param_mc_dec_render( ...@@ -1725,8 +1729,8 @@ void ivas_param_mc_dec_render(
{ {
for ( ch = 0; ch < nchan_out_cldfb; ch++ ) for ( ch = 0; ch < nchan_out_cldfb; ch++ )
{ {
mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands ); mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands );
mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands ); mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands );
} }
} }
} }
......
...@@ -761,18 +761,18 @@ static void ivas_mc_paramupmix_dec_sf( ...@@ -761,18 +761,18 @@ static void ivas_mc_paramupmix_dec_sf(
/*LFE handling for split rendering cases*/ /*LFE handling for split rendering cases*/
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{ {
if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL ) if ( st_ivas->hSplitBinRend->hCldfbDataOut != NULL )
{ {
for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ ) for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ )
{ {
for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ ) for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ )
{ {
mvr2r( Cldfb_RealBuffer_subfr[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_RealBuffer[ch][slot_index_start + slot_idx], maxBand ); mvr2r( Cldfb_RealBuffer_subfr[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer[ch][slot_index_start + slot_idx], maxBand );
mvr2r( Cldfb_ImagBuffer_subfr[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_index_start + slot_idx], maxBand ); mvr2r( Cldfb_ImagBuffer_subfr[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_index_start + slot_idx], maxBand );
} }
} }
st_ivas->hSplitBinRend.hCldfbDataOut->config = st_ivas->hIntSetup.output_config; st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config;
} }
} }
#endif #endif
...@@ -780,7 +780,7 @@ static void ivas_mc_paramupmix_dec_sf( ...@@ -780,7 +780,7 @@ static void ivas_mc_paramupmix_dec_sf(
/* Implement binaural rendering */ /* Implement binaural rendering */
ivas_binRenderer( st_ivas->hBinRenderer, ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData,
#endif #endif
st_ivas->hCombinedOrientationData, st_ivas->hCombinedOrientationData,
st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], st_ivas->hTcBuffer->subframe_nbslots[subframeIdx],
...@@ -798,8 +798,8 @@ static void ivas_mc_paramupmix_dec_sf( ...@@ -798,8 +798,8 @@ static void ivas_mc_paramupmix_dec_sf(
{ {
for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ )
{ {
mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_index_start + slot_idx], maxBand ); mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_index_start + slot_idx], maxBand );
mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_index_start + slot_idx], maxBand ); mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_index_start + slot_idx], maxBand );
} }
} }
} }
......
...@@ -673,6 +673,15 @@ ivas_error ivas_mc_dec_config( ...@@ -673,6 +673,15 @@ ivas_error ivas_mc_dec_config(
{ {
st_ivas->transport_config = signaled_config; st_ivas->transport_config = signaled_config;
} }
#ifdef FIX_1052_EXT_OUTPUT
else if ( st_ivas->transport_config != signaled_config )
{
#ifdef DEBUGGING
fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" );
#endif
return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" );
}
#endif
/* select MC format mode */ /* select MC format mode */
st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), st_ivas->hDecoderConfig->ivas_total_brate ); st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), st_ivas->hDecoderConfig->ivas_total_brate );
...@@ -680,7 +689,11 @@ ivas_error ivas_mc_dec_config( ...@@ -680,7 +689,11 @@ ivas_error ivas_mc_dec_config(
/* MC format switching */ /* MC format switching */
if ( st_ivas->ini_frame != 0 ) if ( st_ivas->ini_frame != 0 )
{ {
#ifdef FIX_1052_EXT_OUTPUT
if ( st_ivas->hDecoderConfig->last_ivas_total_brate != st_ivas->hDecoderConfig->ivas_total_brate || last_mc_mode != st_ivas->mc_mode )
#else
if ( st_ivas->hDecoderConfig->last_ivas_total_brate != st_ivas->hDecoderConfig->ivas_total_brate || st_ivas->transport_config != signaled_config || last_mc_mode != st_ivas->mc_mode ) if ( st_ivas->hDecoderConfig->last_ivas_total_brate != st_ivas->hDecoderConfig->ivas_total_brate || st_ivas->transport_config != signaled_config || last_mc_mode != st_ivas->mc_mode )
#endif
{ {
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_mc_dec_reconfig( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) if ( ( error = ivas_mc_dec_reconfig( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
...@@ -1227,7 +1240,7 @@ static ivas_error ivas_mc_dec_reconfig( ...@@ -1227,7 +1240,7 @@ static ivas_error ivas_mc_dec_reconfig(
{ {
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ); ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses );
#else #else
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) );
#endif #endif
...@@ -1308,7 +1321,7 @@ static ivas_error ivas_mc_dec_reconfig( ...@@ -1308,7 +1321,7 @@ static ivas_error ivas_mc_dec_reconfig(
else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) )
{ {
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#else #else
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif #endif
......
...@@ -61,8 +61,13 @@ ivas_error ivas_td_binaural_open( ...@@ -61,8 +61,13 @@ ivas_error ivas_td_binaural_open(
num_src = st_ivas->nchan_ism; num_src = st_ivas->nchan_ism;
} }
#ifdef CONF_DISTATT
return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, st_ivas->ivas_format,
st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hRenderConfig->distAtt, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns );
#else
return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, st_ivas->ivas_format, return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, st_ivas->ivas_format,
st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns );
#endif
} }
...@@ -255,7 +260,7 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( ...@@ -255,7 +260,7 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural(
float output_local[MAX_OUTPUT_CHANNELS][L_FRAME48k]; float output_local[MAX_OUTPUT_CHANNELS][L_FRAME48k];
push_wmops( "ivas_td_binaural_renderer_sf_splitBinaural" ); push_wmops( "ivas_td_binaural_renderer_sf_splitBinaural" );
pMultiBinPoseData = &st_ivas->hSplitBinRend.splitrend.multiBinPoseData; pMultiBinPoseData = &st_ivas->hSplitBinRend->splitrend.multiBinPoseData;
/* If not yet allocated, open additional instances of TD renderer */ /* If not yet allocated, open additional instances of TD renderer */
for ( i = 0; i < pMultiBinPoseData->num_poses - 1; ++i ) for ( i = 0; i < pMultiBinPoseData->num_poses - 1; ++i )
...@@ -271,6 +276,9 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( ...@@ -271,6 +276,9 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural(
st_ivas->ivas_format, st_ivas->ivas_format,
st_ivas->transport_config, st_ivas->transport_config,
st_ivas->hRenderConfig->directivity, st_ivas->hRenderConfig->directivity,
#ifdef CONF_DISTATT
st_ivas->hRenderConfig->distAtt,
#endif
st_ivas->hTransSetup, st_ivas->hTransSetup,
&st_ivas->hTdRendHandles[i], &st_ivas->hTdRendHandles[i],
&st_ivas->binaural_latency_ns ) ) != IVAS_ERR_OK ) &st_ivas->binaural_latency_ns ) ) != IVAS_ERR_OK )
......
...@@ -781,12 +781,12 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( ...@@ -781,12 +781,12 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm(
float Cldfb_ImagBuffer[CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[CLDFB_NO_CHANNELS_MAX];
float *p_rend_obj[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; /* [8 * 2] */ float *p_rend_obj[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; /* [8 * 2] */
for ( n = 0; n < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; n++ ) for ( n = 0; n < st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; n++ )
{ {
p_rend_obj[n] = &output_f[n][0]; p_rend_obj[n] = &output_f[n][0];
} }
num_cldfb_bands = st_ivas->hSplitBinRend.splitrend.hCldfbHandles->cldfbAna[0]->no_channels; num_cldfb_bands = st_ivas->hSplitBinRend->splitrend.hCldfbHandles->cldfbAna[0]->no_channels;
nchan_transport_orig = st_ivas->nchan_transport; nchan_transport_orig = st_ivas->nchan_transport;
st_ivas->nchan_transport = st_ivas->nchan_ism; st_ivas->nchan_transport = st_ivas->nchan_ism;
...@@ -797,15 +797,15 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( ...@@ -797,15 +797,15 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm(
st_ivas->nchan_transport = nchan_transport_orig; st_ivas->nchan_transport = nchan_transport_orig;
cldfb_slots = *nSamplesRendered / num_cldfb_bands; cldfb_slots = *nSamplesRendered / num_cldfb_bands;
for ( n = 0; n < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++n ) for ( n = 0; n < st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++n )
{ {
for ( slot_idx = 0; slot_idx < cldfb_slots; slot_idx++ ) for ( slot_idx = 0; slot_idx < cldfb_slots; slot_idx++ )
{ {
cldfbAnalysis_ts( &( p_rend_obj[n][num_cldfb_bands * slot_idx] ), Cldfb_RealBuffer, Cldfb_ImagBuffer, num_cldfb_bands, st_ivas->hSplitBinRend.splitrend.hCldfbHandles->cldfbAna[n] ); cldfbAnalysis_ts( &( p_rend_obj[n][num_cldfb_bands * slot_idx] ), Cldfb_RealBuffer, Cldfb_ImagBuffer, num_cldfb_bands, st_ivas->hSplitBinRend->splitrend.hCldfbHandles->cldfbAna[n] );
/* note: this intentionally differs from OSBA by: no scaling by 0.5 */ /* note: this intentionally differs from OSBA by: no scaling by 0.5 */
v_add( st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx], Cldfb_RealBuffer, st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx], num_cldfb_bands ); v_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx], Cldfb_RealBuffer, st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx], num_cldfb_bands );
v_add( st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx], Cldfb_ImagBuffer, st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx], num_cldfb_bands ); v_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx], Cldfb_ImagBuffer, st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx], num_cldfb_bands );
} }
} }
} }
......
...@@ -167,7 +167,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( ...@@ -167,7 +167,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm(
float Cldfb_RealBuffer[CLDFB_NO_CHANNELS_MAX]; float Cldfb_RealBuffer[CLDFB_NO_CHANNELS_MAX];
float Cldfb_ImagBuffer[CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[CLDFB_NO_CHANNELS_MAX];
num_cldfb_bands = st_ivas->hSplitBinRend.splitrend.hCldfbHandles->cldfbAna[0]->no_channels; num_cldfb_bands = st_ivas->hSplitBinRend->splitrend.hCldfbHandles->cldfbAna[0]->no_channels;
nchan_transport_orig = st_ivas->nchan_transport; nchan_transport_orig = st_ivas->nchan_transport;
st_ivas->nchan_transport = st_ivas->nchan_ism; st_ivas->nchan_transport = st_ivas->nchan_ism;
if ( ( error = ivas_td_binaural_renderer_sf_splitBinaural( st_ivas, output_f, *nSamplesRendered ) ) != IVAS_ERR_OK ) if ( ( error = ivas_td_binaural_renderer_sf_splitBinaural( st_ivas, output_f, *nSamplesRendered ) ) != IVAS_ERR_OK )
...@@ -177,20 +177,20 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( ...@@ -177,20 +177,20 @@ ivas_error ivas_osba_dirac_td_binaural_jbm(
st_ivas->nchan_transport = nchan_transport_orig; st_ivas->nchan_transport = nchan_transport_orig;
cldfb_slots = *nSamplesRendered / num_cldfb_bands; cldfb_slots = *nSamplesRendered / num_cldfb_bands;
for ( n = 0; n < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++n ) for ( n = 0; n < st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++n )
{ {
for ( slot_idx = 0; slot_idx < cldfb_slots; slot_idx++ ) for ( slot_idx = 0; slot_idx < cldfb_slots; slot_idx++ )
{ {
cldfbAnalysis_ts( &( output_f[n][num_cldfb_bands * slot_idx] ), Cldfb_RealBuffer, Cldfb_ImagBuffer, num_cldfb_bands, st_ivas->hSplitBinRend.splitrend.hCldfbHandles->cldfbAna[n] ); cldfbAnalysis_ts( &( output_f[n][num_cldfb_bands * slot_idx] ), Cldfb_RealBuffer, Cldfb_ImagBuffer, num_cldfb_bands, st_ivas->hSplitBinRend->splitrend.hCldfbHandles->cldfbAna[n] );
for ( b = 0; b < num_cldfb_bands; b++ ) for ( b = 0; b < num_cldfb_bands; b++ )
{ {
st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] = st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] =
( 0.5f * st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] ) + ( 0.5f * st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] ) +
( 0.5f * Cldfb_RealBuffer[b] ); ( 0.5f * Cldfb_RealBuffer[b] );
st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] = st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] =
( 0.5f * st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] ) + ( 0.5f * st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] ) +
( 0.5f * Cldfb_ImagBuffer[b] ); ( 0.5f * Cldfb_ImagBuffer[b] );
} }
} }
......
...@@ -433,7 +433,11 @@ void ivas_renderer_select( ...@@ -433,7 +433,11 @@ void ivas_renderer_select(
else if ( st_ivas->ivas_format == MC_FORMAT ) else if ( st_ivas->ivas_format == MC_FORMAT )
{ {
*internal_config = transport_config; *internal_config = transport_config;
#ifdef FIX_1052_EXT_OUTPUT
if ( st_ivas->mc_mode == MC_MODE_MCT && *internal_config != output_config && output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
#else
if ( st_ivas->mc_mode == MC_MODE_MCT && *internal_config != output_config ) if ( st_ivas->mc_mode == MC_MODE_MCT && *internal_config != output_config )
#endif
{ {
if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_HOA2 && output_config != IVAS_AUDIO_CONFIG_HOA3 ) if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_HOA2 && output_config != IVAS_AUDIO_CONFIG_HOA3 )
{ {
...@@ -447,7 +451,11 @@ void ivas_renderer_select( ...@@ -447,7 +451,11 @@ void ivas_renderer_select(
else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX )
{ {
*internal_config = transport_config; *internal_config = transport_config;
#ifdef FIX_1052_EXT_OUTPUT
if ( *internal_config != output_config && output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
#else
if ( *internal_config != output_config ) if ( *internal_config != output_config )
#endif
{ {
if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_HOA2 && output_config != IVAS_AUDIO_CONFIG_HOA3 ) if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_HOA2 && output_config != IVAS_AUDIO_CONFIG_HOA3 )
{ {
...@@ -472,7 +480,14 @@ void ivas_renderer_select( ...@@ -472,7 +480,14 @@ void ivas_renderer_select(
} }
else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) else if ( st_ivas->mc_mode == MC_MODE_MCMASA )
{ {
#ifdef FIX_1052_EXT_OUTPUT
if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
{
*internal_config = output_config; *internal_config = output_config;
}
#else
*internal_config = output_config;
#endif
/* No rendering for 1TC to Mono or Stereo and 2TC to Stereo */ /* No rendering for 1TC to Mono or Stereo and 2TC to Stereo */
if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO )
......
...@@ -1203,6 +1203,9 @@ int16_t ivas_qmetadata_dec_sid_decode( ...@@ -1203,6 +1203,9 @@ int16_t ivas_qmetadata_dec_sid_decode(
float direction_vector[3]; float direction_vector[3];
int16_t metadata_sid_bits; /* bits allocated to SID for metadata */ int16_t metadata_sid_bits; /* bits allocated to SID for metadata */
int16_t bits_delta, bits_dir; int16_t bits_delta, bits_dir;
#ifdef NONBE_FIX_1052_SBA_EXT
int16_t sba_spar_bitlen;
#endif
#ifdef DEBUG_MODE_QMETADATA #ifdef DEBUG_MODE_QMETADATA
static FILE *pF = NULL; static FILE *pF = NULL;
static FILE *pF_azi = NULL; static FILE *pF_azi = NULL;
...@@ -1221,7 +1224,12 @@ int16_t ivas_qmetadata_dec_sid_decode( ...@@ -1221,7 +1224,12 @@ int16_t ivas_qmetadata_dec_sid_decode(
if ( ivas_format == SBA_FORMAT ) if ( ivas_format == SBA_FORMAT )
{ {
#ifdef NONBE_FIX_1052_SBA_EXT
sba_spar_bitlen = ivas_sba_spar_sid_bitlen( nchan_transport );
metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - sba_spar_bitlen - SID_FORMAT_NBITS - SBA_ORDER_BITS - SBA_PLANAR_BITS - 1; /* -1 for inactive mode header bit*/
#else
metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 2 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/ metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 2 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/
#endif
} }
else else
{ {
......