Commit 3d25443c authored by Nicolas Roussin's avatar Nicolas Roussin
Browse files

Merge branch '2142-implement-basop-w_min-and-w_max-functions' into 2193-optimize-eig2x2

parents a791a152 ce38e7c0
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -94,6 +94,9 @@
#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_2173_UBSAN_IN_JBM_PCMDSP_APA                     /* FhG: Fix UBSAN problems in jbm_pcmdsp_apa_fx.c */
#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 ########################### */

@@ -131,6 +134,7 @@
#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING         /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */
#define FIX_1383_HEAD_TRACK_SANITIZER                   /* Nok: issue 1383: Fix head tracking struc values reading in renderer */
#define FIX_1330_JBM_MEMORY                             /* VA: issue 1330: memory savings in the JBM decoder */
#define FIX_1330_JBM_MEMORY_FIX                         /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */
#define FIX_1411_IGF_CRASH_BW_SWITCHING                 /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/
#define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG       /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */
#define NONBE_1344_REND_MASA_LOW_FS                     /* Nokia: Issue 1344: Fix sanitizer errors when using IVAS_rend to render MASA with lower sampling rates */
+20 −2
Original line number Diff line number Diff line
@@ -1576,6 +1576,9 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx(
            FOR( ch = 0; ch < s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch++ )
            {
                hTcBuffer->tc_fx[ch] = &hTcBuffer->tc_buffer_fx[offset];
#ifdef FIX_1330_JBM_MEMORY_FIX
                st_ivas->p_output_fx[ch] = hTcBuffer->tc_fx[ch];
#endif
                offset = add( offset, len_offset );
            }
        }
@@ -2159,10 +2162,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 +2180,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 +2218,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 +2236,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++ )
                {
+9 −1
Original line number Diff line number Diff line
@@ -127,7 +127,11 @@ struct apa_state_t
    UWord16 qualityred;      /* quality reduction threshold */
    UWord16 qualityrise;     /* quality rising for adaptive quality thresholds */

#ifdef FIX_2173_UBSAN_IN_JBM_PCMDSP_APA
    Word16 last_pitch; /* last pitch/sync position */
#else
    UWord16 last_pitch;     /* last pitch/sync position */
#endif
    UWord16 bad_frame_count;  /* # frames before quality threshold is lowered */
    UWord16 good_frame_count; /* # scaled frames */

@@ -1392,7 +1396,11 @@ static Word8 logarithmic_search_fx( const apa_state_t *ps,

    DO
    {
#ifdef FIX_2173_UBSAN_IN_JBM_PCMDSP_APA
        coeff_max = INT32_MIN; /* will always be overwritten with result of first correlation */
#else
        coeff_max = 0x80000000; /* will always be overwritten with result of first correlation */
#endif
        move32();

        FOR( i = s_start; i < s_start + inlen; i += css * ps->num_channels )