From 5dd4ee6a6f9f9e58c354d2ba417ede2c65ec40ad Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 24 Aug 2022 12:32:06 +0200 Subject: [PATCH] fix for issue 87: decoder crash for SBA with head tracking --- lib_com/options.h | 3 +++ lib_dec/ivas_output_init.c | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 98d71f99c3..434f8fef84 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -149,6 +149,9 @@ #define LBR_SBA_CORE_CODING_TUNING /* Contribution "3 Core Coder Tuning for low bitrate SBA with 2 TCs" */ + +#define FIX_I87 /* fix for issue 86: incorrect Ambisonics order set for head rotation in SBA */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif diff --git a/lib_dec/ivas_output_init.c b/lib_dec/ivas_output_init.c index 4398b3cb93..c21cbafda3 100644 --- a/lib_dec/ivas_output_init.c +++ b/lib_dec/ivas_output_init.c @@ -263,6 +263,10 @@ void ivas_renderer_select( AUDIO_CONFIG output_config; AUDIO_CONFIG transport_config; + #ifdef FIX_I87 + int16_t nchan_internal; +#endif + renderer_type = &( st_ivas->renderer_type ); internal_config = &( st_ivas->intern_config ); output_config = st_ivas->hDecoderConfig->output_config; @@ -355,6 +359,26 @@ void ivas_renderer_select( if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { + +#ifdef FIX_I87 + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_order ); + if ( nchan_internal == 2 ) + { + st_ivas->hHeadTrackData->shd_rot_max_order = 1; + } + else if ( nchan_internal == 4 || nchan_internal == 3 ) + { + st_ivas->hHeadTrackData->shd_rot_max_order = 0; + } + else if ( nchan_internal == 6 || nchan_internal == 5 ) + { + st_ivas->hHeadTrackData->shd_rot_max_order = 2; + } + else if ( nchan_internal == 8 || nchan_internal == 7 ) + { + st_ivas->hHeadTrackData->shd_rot_max_order = 3; + } +#else if ( st_ivas->nchan_transport == 2 ) { st_ivas->hHeadTrackData->shd_rot_max_order = 1; @@ -371,6 +395,7 @@ void ivas_renderer_select( { st_ivas->hHeadTrackData->shd_rot_max_order = 3; } +#endif } } else if ( st_ivas->ivas_format == MC_FORMAT ) -- GitLab