diff --git a/lib_com/options.h b/lib_com/options.h index 48d95867588603b678831904db481e27cfcb47a1..965e181727ff38eccaea67edebc1a8074b626c87 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,7 +166,7 @@ #define FIX_835_PARAMMC_BUFFER_VALUES /* FhG: issue 835: wide range of buffer values for cx in ParamMC */ #define NONBE_FIX_943_PORT_1208_DFT_STEREO_PLC_BURST /* Ericsson: BASOP Issue 943, Float Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */ #define FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */ - +#define FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC_FP /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */ /* #################### End FIXES switches ############################ */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index d9369f31778328c82623c02ae9a44c628f7b2afe..f6b98a37fc6fc56e2afaaa9157eb9ef48521f0f8 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1233,7 +1233,7 @@ static int16_t decode_lfe_to_total_energy_ratio( ivas_error ivas_masa_dec_reconfigure( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ - int16_t *data /* o : output synthesis signal */ + int16_t *data /* o : output synthesis signal */ ) { int16_t n, tmp, num_bits; @@ -1250,12 +1250,12 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; - if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) - { - mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; - } + if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) + { + mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; + } ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); @@ -1350,7 +1350,7 @@ ivas_error ivas_masa_dec_reconfigure( if ( st_ivas->hDiracDecBin != NULL ) { - /* regularization factor is bitrate-dependent */ + /* regularization factor is bitrate-dependent */ st_ivas->hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); } @@ -2347,13 +2347,21 @@ static int16_t ivas_decode_masaism_metadata( if ( azimuth * hMasaIsmData->q_azimuth_old[obj] > 0 ) { delta_phi = 180.0f / (float) ( no_phi_masa[bits_ism[obj] - 1][idx_el] ); /* 360/2*/ +#ifdef FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC_FP + if ( roundf( 100 * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( azimuth - hMasaIsmData->q_azimuth_old[obj] ) ) / (float) 100.0f > 180.0f ) +#else if ( azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi ) +#endif { azimuth -= delta_phi; } else { +#ifdef FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC_FP + if ( roundf( 100 * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( hMasaIsmData->q_azimuth_old[obj] - azimuth ) ) / 100.0f > 180.0f ) +#else if ( hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi ) +#endif { azimuth += delta_phi; }