Commit e006cb43 authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Merge remote-tracking branch 'origin/main' into 2087-fix-bigger-difference-for-mcmasa-decoding

parents 05d0594d 120c6cd3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@
#define FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO          /* FhG: Reduce hStereoDft->q_smooth_buf_fx by one to prevent overflow in the subframe_band_nrg[][] calculation */
#define FIX_2015_PREMPH_SAT_ALT                              /* VA: saturation can happen during preemphasis filtering due to a too aggressive scaling factor, allows preemphis to get 1 more bit headroom */
#define FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE       /* Nokia: Fixes float  to fx conversion in decoder app with object edit file interface */
#define FIX_2070_JBM_TC_CHANNEL_RESCALING_ISSUE              /* Eri/Orange: scale_sig32 problem on p_tc_fx[] */

#define FIX_1947_DEC_HIGH_MLD_FOR_STEREO2MONO                /* FhG: Make Q-factor of synth_16_fx and output_16_fx dynamic to prevent overflow in HQ_CORE mode */
/* ################### End FIXES switches ########################### */

+17 −2
Original line number Diff line number Diff line
@@ -2159,10 +2159,12 @@ ivas_error ivas_jbm_dec_render_fx(
                    FOR( i = 0; i < nchan_in; i++ )
                    {
                        scale_sig32( p_output_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor
#ifndef FIX_1330_JBM_MEMORY
                        IF( st_ivas->hDecoderConfig->Opt_tsm )
                        {
                            scale_sig32( p_tc_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor
                        }
#endif
                    }
                }
                ELSE
@@ -2175,22 +2177,34 @@ ivas_error ivas_jbm_dec_render_fx(

                IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
                {
#ifdef FIX_1330_JBM_MEMORY
                    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, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK )
#else
                    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_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK )
#endif
                    {
                        return error;
                    }
                }
                ELSE
                {
#ifdef FIX_1330_JBM_MEMORY
                    IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                                                                            &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ),
                               IVAS_ERR_OK ) )
#else
                    IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                                                                            &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ),
                               IVAS_ERR_OK ) )
#endif
                    {
                        return error;
                    }

                    // Todo main-pc update: This might be needed also in the split rendering path
#ifndef FIX_1330_JBM_MEMORY
                    IF( st_ivas->hDecoderConfig->Opt_tsm )
                    {
                        IF( NE_16( exp, *st_ivas->hCrendWrapper->p_io_qfactor ) )
@@ -2201,7 +2215,7 @@ ivas_error ivas_jbm_dec_render_fx(
                            }
                        }
                    }

#endif
                    ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_tc_fx, p_output_fx );
                }

@@ -2219,12 +2233,13 @@ ivas_error ivas_jbm_dec_render_fx(
                {
                    scale_sig32( p_output_fx[i], *nSamplesRendered, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q11
                }

#ifndef FIX_1330_JBM_MEMORY
                IF( st_ivas->hDecoderConfig->Opt_tsm && crendInPlaceRotation )
                {
                    n = 0;
                    move16();
                }
#endif

                FOR( i = n; i < nchan_in; i++ )
                {