diff --git a/lib_com/options.h b/lib_com/options.h index 98d71f99c3137d48b0079b5304e349b62e238129..434f8fef84cb0ef439ed73c66f0aece3efd38447 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 4398b3cb9378f3fbbf7370ed6edb379e20734f73..c21cbafda3db38b20b37869d9149e953d6c4fc4c 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 )