diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 67c6a4b6844880cd3d2abaa632170b27fa97ff3f..987455ea7ca8444e81ae82064a047c17a7c50d77 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5592,7 +5592,9 @@ void ivas_osba_stereo_add_channels( const float gain, /* i : gain bed value */ const int16_t nchan_out, /* i : number of output channels */ const int16_t nchan_ism, /* i : number of ISM channels */ +#ifndef NONBE_FIX_1262_OSBA_STEREO const int16_t ism_mode, /* i : ISM mode */ +#endif const int16_t n_samples_to_render /* i : output frame length per channel */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 716dc78ddb90255a300ee47aa413761c25f9c108..754937c540e986ed56ce1dad969e20055463b056 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,6 +172,7 @@ #define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ #define NONBE_1215_FIX_JBM_MAX_SCALING /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */ #define NONBE_FIX_1255_OBJ_EDIT_JBM /* VA: issue 1255: restore object editing in JBM */ +#define NONBE_FIX_1262_OSBA_STEREO /* FhG: issue 1262: Fix missing scaling factor for OSBA stereo output */ #define NONBE_FIX_1189_GSC_IVAS_OMASA /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */ #define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ #define NONBE_FIX_1261_MASA_EXT_META_JBM /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 3fd629a6853fa337568ac029270ecfbf079e496c..f986791d97e364b9dff1d0617969955379aae0df 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1096,7 +1096,11 @@ ivas_error ivas_jbm_dec_render( ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); /* add already rendered SBA part */ +#ifdef NONBE_FIX_1262_OSBA_STEREO + ivas_osba_stereo_add_channels( p_tc, p_output, st_ivas->hSbaIsmData->gain_bed, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); +#else ivas_osba_stereo_add_channels( p_tc, p_output, st_ivas->hSbaIsmData->gain_bed, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); +#endif } else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 18493968bf533d23fd1e7e61064baa97a701c72a..473d82dee2ed0d45cb97bbbabe9bf240e6217800 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -309,19 +309,23 @@ ivas_error ivas_osba_render_sf( *-------------------------------------------------------------------------*/ void ivas_osba_stereo_add_channels( - float *tc_f[], /* i : transport channels */ - float *output_f[], /* i/o: output channels */ - const float gain, /* i : gain bed value */ - const int16_t nchan_out, /* i : number of output channels */ - const int16_t nchan_ism, /* i : number of ISM channels */ - const int16_t ism_mode, /* i : ISM mode */ + float *tc_f[], /* i : transport channels */ + float *output_f[], /* i/o: output channels */ + const float gain, /* i : gain bed value */ + const int16_t nchan_out, /* i : number of output channels */ + const int16_t nchan_ism, /* i : number of ISM channels */ +#ifndef NONBE_FIX_1262_OSBA_STEREO + const int16_t ism_mode, /* i : ISM mode */ +#endif const int16_t n_samples_to_render /* i : output frame length per channel */ ) { int16_t n; +#ifndef NONBE_FIX_1262_OSBA_STEREO if ( ism_mode == ISM_SBA_MODE_DISC ) { +#endif if ( gain != 1.0f && gain >= 0.0f ) { int16_t i; @@ -340,6 +344,7 @@ void ivas_osba_stereo_add_channels( v_add( output_f[n], tc_f[n + nchan_ism], output_f[n], n_samples_to_render ); } } +#ifndef NONBE_FIX_1262_OSBA_STEREO } else { @@ -348,6 +353,14 @@ void ivas_osba_stereo_add_channels( v_add( output_f[n], tc_f[n + nchan_ism], output_f[n], n_samples_to_render ); } } +#endif +#ifdef NONBE_FIX_1262_OSBA_STEREO + + for ( n = 0; n < nchan_out; n++ ) + { + v_multc( output_f[n], 0.5f, output_f[n], n_samples_to_render ); + } +#endif return; }