Commit d9fc53a5 authored by PLAINSI's avatar PLAINSI
Browse files

Merge branch 'main' into 652-mc-paramupmix-binaural-updates

parents 5697ddda 7a8335cc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1198,6 +1198,13 @@ void ivas_get_ism_sid_quan_bitbudget(
    int16_t *nBits_sce_id                                       /* o  : number of Q bits for sce_id_dtx             */
);

#ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE
void ivas_ism_dtx_limit_noise_energy_for_near_silence(
    SCE_DEC_HANDLE hSCE[],                                      /* i/o: SCE encoder structures                      */
    const int16_t sce_id_dtx,                                   /* i  : SCE DTX ID                                  */
    const int16_t nchan_transport                               /* i  : number of transport channels                */
);
#endif

/*----------------------------------------------------------------------------------*
 * DFT Stereo prototypes
+5 −1
Original line number Diff line number Diff line
@@ -194,6 +194,7 @@
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REND_PRED_QUANT_63_PNTS
#define SPLIT_REND_WITH_HEAD_ROT_PARAMBIN               /* Nokia: Issue 623: Split rendering support for parambin renderer */
#define FIX_658_SPLIT_REND_MASA                         /*Dlb : Fix for issue 658, uninitialized memory access in MASA in Split rendering 0DOF mode*/                 
#endif
#define FIX_594_STL_INCLUDE                             /* FhG: issue 594: Missing include of stl.h */

@@ -213,6 +214,7 @@
#define FIX_549_PARAM_ISM_BIN_GAIN                      /* FhG: Issue 549 : fix too quiet binaural output in ParamISM */
#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 MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */

@@ -225,11 +227,13 @@
/* #################### Start NON-BE CR switches ########################## */
/* any switch which is non-be wrt operation points tested in selection */
/* all switches in this category should start with "CR_" */

#define CR_FIX_585_MASA_2TC_DTX_EXT                     /* Nokia: issue 585: fixes transition artifacts in MASA 2TC DTX by applying correct condition */
#define CR_FIX_586_BPF_DFT_MEM                          /* FhG: issue 586: set input memory of DFT analysis of BPF signal to zero for HQ core to fix issue with PLC and bitrate switching */
#define CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE /* FhG: fix for cng in ISM DTX on sudden silence periods */

/* ##################### End NON-BE CR switches ########################### */


/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+21 −0
Original line number Diff line number Diff line
@@ -196,6 +196,16 @@ ivas_error ivas_dec(
            {
                return error;
            }
#ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE

            /* decode dominant object first so the noise energy of the other objects can be limited */
            if ( ( error = ivas_sce_dec( st_ivas, st_ivas->hISMDTX.sce_id_dtx, &output[st_ivas->hISMDTX.sce_id_dtx], output_frame, nb_bits_metadata[st_ivas->hISMDTX.sce_id_dtx] ) ) != IVAS_ERR_OK )
            {
                return error;
            }

            ivas_ism_dtx_limit_noise_energy_for_near_silence( st_ivas->hSCE, st_ivas->hISMDTX.sce_id_dtx, st_ivas->nchan_transport );
#endif
        }
        else if ( st_ivas->ism_mode == ISM_MODE_PARAM )
        {
@@ -214,10 +224,21 @@ ivas_error ivas_dec(

        for ( n = 0; n < st_ivas->nchan_transport; n++ )
        {
#ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE
            /* for DTX frames, dominant object has already been decoded before */
            if ( !( ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) && n == st_ivas->hISMDTX.sce_id_dtx ) )
            {
                if ( ( error = ivas_sce_dec( st_ivas, n, &output[n], output_frame, nb_bits_metadata[n] ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
#else
            if ( ( error = ivas_sce_dec( st_ivas, n, &output[n], output_frame, nb_bits_metadata[n] ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#endif

            /* HP filtering */
            hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs );
+49 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
*******************************************************************************************************/

#include <stdint.h>
#include <math.h>
#include "options.h"
#include "ivas_prot.h"
#include "prot.h"
@@ -156,3 +157,51 @@ ivas_error ivas_ism_dtx_dec(

    return IVAS_ERR_OK;
}


#ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE
/*-------------------------------------------------------------------*
 * ivs_ism_dtx_limit_noise_energy_for_near_silence()
 *
 * for DTX frames where the energy of the sent noise estimate of the dominant object
 * is near silence, limit the other objects CNG energies to the same level
 *-------------------------------------------------------------------*/

void ivas_ism_dtx_limit_noise_energy_for_near_silence(
    SCE_DEC_HANDLE hSCE[],        /* i/o: SCE encoder structures          */
    const int16_t sce_id_dtx,     /* i  : SCE DTX ID                      */
    const int16_t nchan_transport /* i  : number of transport channels    */
)
{
    float fac, cng_noise_nrg_obj, cng_noise_nrg_dominant;
    int16_t ch, cng_noise_level_len;
    HANDLE_FD_CNG_COM hFdCngCom;

    hFdCngCom = hSCE[sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom;
    cng_noise_level_len = hFdCngCom->stopFFTbin - hFdCngCom->startBand;
    cng_noise_nrg_dominant = dotp( hFdCngCom->cngNoiseLevel, hFdCngCom->cngNoiseLevel, cng_noise_level_len );

    if ( cng_noise_nrg_dominant < 1.f )
    {
        for ( ch = 0; ch < nchan_transport; ch++ )
        {
            if ( ch == sce_id_dtx )
            {
                continue;
            }

            hFdCngCom = hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom;
            cng_noise_level_len = hFdCngCom->stopFFTbin - hFdCngCom->startBand;
            cng_noise_nrg_obj = dotp( hFdCngCom->cngNoiseLevel, hFdCngCom->cngNoiseLevel, cng_noise_level_len );

            if ( cng_noise_nrg_obj > cng_noise_nrg_dominant )
            {
                fac = sqrtf( cng_noise_nrg_dominant / cng_noise_nrg_obj );
                v_multc( hFdCngCom->cngNoiseLevel, fac, hFdCngCom->cngNoiseLevel, cng_noise_level_len );
            }
        }
    }

    return;
}
#endif
+4 −0
Original line number Diff line number Diff line
@@ -555,6 +555,10 @@ ivas_error ivas_jbm_dec_tc(
        st_ivas->ini_active_frame++;
    }

#ifdef MASA_AND_OBJECTS
    st_ivas->last_ivas_format = st_ivas->ivas_format;
#endif

#ifdef DEBUG_MODE_INFO
    dbgwrite( &st_ivas->bfi, sizeof( int16_t ), 1, output_frame, "res/bfi" );
    dbgwrite( &st_ivas->BER_detect, sizeof( int16_t ), 1, output_frame, "res/BER_detect" );
Loading