Commit a551678b authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Fixes issue 647 with silent output in parambin for silent W and non-silent Y in SBA.

parent 45be697e
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@
#define FIX_618_STEREO_SW_DIV_BY_ZERO                   /* VA: fix issue 618 - UBSAN: division-by-zero in stereo bitrate switching */
#define FIX_625_IDX_OOB                                 /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */
#define FIX_613_DIRAC_NULL_PTR_USAN                     /* Nokia: Issue #613: USAN in DirAC decoder setup */
#define FIX_647_SILENT_W_PARAMBIN                       /* Nokia: Issue #647: Fix silent W SH inputs in parametric binauralizer */

#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */

+21 −0
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@
#define CLDFB_HALF_BIN_FREQUENCY_OFFSET         0.5f
#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN        ( 2.0f )
#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f )
#ifdef FIX_647_SILENT_W_PARAMBIN
#define SBA_CARDI_TARGET_ENERGY_GAIN 0.5f
#endif

#ifdef MASA_AND_OBJECTS
#define STEREO_PREPROCESS_IIR_FACTOR ( 0.9f )
@@ -1231,18 +1234,36 @@ static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices(
    if ( ivas_format == SBA_FORMAT && nchan_transport == 2 )
    {
        float tempRe, tempIm;
#ifdef FIX_647_SILENT_W_PARAMBIN
        float subFrameSumEne[CLDFB_NO_CHANNELS_MAX];

        v_multc( subFrameTotalEne, SBA_CARDI_TARGET_ENERGY_GAIN, subFrameTotalEne, nBins );

        set_zero( subFrameSumEne, CLDFB_NO_CHANNELS_MAX );
#else
        set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX );

#endif
        for ( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ )
        {
            for ( bin = 0; bin < nBins; bin++ )
            {
                tempRe = inRe[0][slot][bin] + inRe[1][slot][bin];
                tempIm = inIm[0][slot][bin] + inIm[1][slot][bin];
#ifdef FIX_647_SILENT_W_PARAMBIN
                subFrameSumEne[bin] += tempRe * tempRe + tempIm * tempIm;
#else
                subFrameTotalEne[bin] += tempRe * tempRe + tempIm * tempIm;
#endif
            }
        }

#ifdef FIX_647_SILENT_W_PARAMBIN
        for ( bin = 0; bin < nBins; bin++ )
        {
            subFrameTotalEne[bin] = max( subFrameTotalEne[bin], subFrameSumEne[bin] );
        }
#endif
    }

    /* Temporal IIR-type smoothing of covariance matrices. Also apply encoding quality based smoothing factor. */