Commit 365cdb66 authored by Arash Azizi's avatar Arash Azizi
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into basop-2389-harmonize-readtnsdata_ivas_fx-readtnsdata_fx-and-decodetnsdata_ivas_fx-decodetnsdata

# Conflicts:
#	lib_com/prot_fx.h
#	lib_dec/dec_prm_fx.c
#	lib_dec/dec_tcx_fx.c
#	lib_dec/tns_base_dec_fx.c
parents 757328d4 b3c0bbf8
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1713,9 +1713,13 @@ static ivas_error initOnFirstGoodFrame(
        if ( arg.rtpOutSR && srRtp != NULL )
        {
            FILE *fParamsSR = NULL;
            char srParamsFile[FILENAME_MAX], *ext = ".sr.txt";
            strncpy( srParamsFile, arg.outputWavFilename, FILENAME_MAX - sizeof( ext ) );
            strncat( srParamsFile, ext, sizeof( ext ) + 1 );
            char srParamsFile[FILENAME_MAX];
            const char *ext = ".sr.txt";

            strncpy( srParamsFile, arg.outputWavFilename, FILENAME_MAX - strlen( ext ) - 1 );
            srParamsFile[FILENAME_MAX - strlen( ext ) - 1] = '\0';
            strncat( srParamsFile, ext, strlen( ext ) );
            srParamsFile[FILENAME_MAX - 1] = '\0';

            /* Write the Split Rendering Params passed from SDP to srParamsFile */
            fParamsSR = fopen( srParamsFile, "w" );
+0 −2
Original line number Diff line number Diff line
@@ -996,10 +996,8 @@ ivas_error openCldfb(
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" );
    }

#ifdef FIX_2319_CLDFB_INIT_FLAGS
    hs->flags = 0;
    move16();
#endif

    hs->type = type;
    move16();
+0 −24
Original line number Diff line number Diff line
@@ -751,19 +751,11 @@ void highband_exc_dct_in_fx(
    test();
    IF( bfi || LT_32( core_brate, 6000 ) || ( LT_32( core_brate, 8600 ) && EQ_16( coder_type, UNVOICED ) ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 13107, MBANDS_GN ); /*0.4 in Q15 */
#else
        set16_fx( noisepb, 13107, last_bin ); /*0.4 in Q15 */
#endif
    }
    ELSE IF( EQ_16( GSC_IVAS_mode, 3 ) || ( GSC_IVAS_mode > 0 && EQ_16( GSC_noisy_speech, 1 ) ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 13107 /*0.4f*/, MBANDS_GN16k );
#else
        set16_fx( noisepb, 13107 /*0.4f*/, last_bin );
#endif
    }
    ELSE
    {
@@ -780,11 +772,7 @@ void highband_exc_dct_in_fx(
    test();
    IF( GSC_IVAS_mode == 0 && GSC_noisy_speech && !bfi && LE_16( element_mode, IVAS_SCE ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 3277, MBANDS_GN );
#else
        set16_fx( noisepb, 3277, last_bin );
#endif
    }
    test();
    IF( LT_32( core_brate, 6000 ) && LE_16( coder_type, UNVOICED ) )
@@ -1150,19 +1138,11 @@ void highband_exc_dct_in_ivas_fx(
    test();
    IF( bfi || LT_32( core_brate, 6000 ) || ( LT_32( core_brate, 8600 ) && EQ_16( coder_type, UNVOICED ) ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 13107, MBANDS_GN ); /*0.4 in Q15 */
#else
        set16_fx( noisepb, 13107, last_bin ); /*0.4 in Q15 */
#endif
    }
    ELSE IF( EQ_16( GSC_IVAS_mode, 3 ) || ( GSC_IVAS_mode > 0 && EQ_16( GSC_noisy_speech, 1 ) ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 13107 /*0.4f*/, MBANDS_GN16k );
#else
        set16_fx( noisepb, 13107 /*0.4f*/, last_bin );
#endif
    }
    ELSE
    {
@@ -1179,11 +1159,7 @@ void highband_exc_dct_in_ivas_fx(

    IF( GSC_IVAS_mode == 0 && GSC_noisy_speech && !bfi && LE_16( element_mode, IVAS_SCE ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 3277, MBANDS_GN );
#else
        set16_fx( noisepb, 3277, last_bin );
#endif
    }

    test();
+12 −10
Original line number Diff line number Diff line
@@ -1359,20 +1359,10 @@ void stereo_tcx_init_dec_fx(

void stereo_icBWE_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                */
#ifdef REMOVE_SCALING_SHB_SPEECH
    const Word16 shb_speech_ref_fx16[],                         /* i  : SHB speech ref channel             Q0*/
    Word16 shb_speech_nonref_fx_16[],                           /* i/o: SHB speech non-ref channel         shb_speech_nonref_e*/
#else
    const Word32 shb_speech_ref_fx[],                           /* i  : SHB speech ref channel               */
    const Word16 shb_speech_ref_e,                              /* i  : SHB speech ref channel               */
    Word32 shb_speech_nonref_fx[],                              /* i/o: SHB speech non-ref channel           */
#endif
    Word16 shb_speech_nonref_e,                                 /* i/o: SHB speech non-ref channel           */
#ifdef REMOVE_SCALING_SHB_SPEECH
    const Word16 *voice_factors_fx                              /* i  : voicing factors                  Q15 */
#else
    const Word32 *voice_factors_fx                              /* i  : voicing factors                     Q31 */
#endif
);

void initMdctStereoDecData_fx(
@@ -1597,8 +1587,12 @@ void ivas_hq_core_dec_fx(
    const Word16 output_frame,                                  /* i  : output frame length                     */
    const Word16 hq_core_type,                                  /* i  : HQ core type                            */
    const Word16 core_switching_flag,                           /* i  : ACELP->HQ switching frame flag          */
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 *output_32_fx                                        /* o  : synthesis @internal_Fs, Q11             */
#else
    Word16 output[],
    Word16 *Q_output 
#endif
);

#ifndef HARMONIZE_TBE
@@ -1900,7 +1894,11 @@ void GenShapedWBExcitation_ivas_fx(
/* o : Q_syn_hb*/
Word16 ivas_wb_bwe_dec_fx(
    Decoder_State *st_fx,                                       /* i/o: decoder state structure                 */
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 output_fx32[],                                       /* o  : synthesis @internal Fs               Q11*/
#else
    const Word16 output[],                                      /* i  : suntehsis @ internal Fs Q_input         */
    #endif
    Word16 *synth_fx,                                           /* i/o: ACELP core synthesis/final synthesis   Q0/Qpost */
    Word16 *hb_synth_fx,                                        /* o  : SHB synthesis/final synthesis          Q_syn_hb */
    const Word16 use_cldfb_for_dft,                             /* i  : flag to use of CLDFB for DFT Stereo     */
@@ -2098,7 +2096,11 @@ void ivas_buffer_deinterleaved_to_interleaved_fx(
void stereo_tcx_core_dec_fx(
    Decoder_State *st,                                          /* i/o: decoder state structure                     */
    const FRAME_MODE frameMode,                                 /* i  : Decoder frame mode                          */
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 *signal_out_32_fx,                                   /* o  : synthesis @internal_Fs, Q11                 */
#else
    Word16 *signal_out,                                         /* o  : synthesis @internal_Fs, Q0                  */
#endif
    Word16 *signal_outFB,                                       /* o  : synthesis @output_Fs, Q0                    */
    Word16 pitch_buf[],                                         /* o  : floating pitch for each subframe, Q6        */
    const Word16 sba_dirac_stereo_flag,                         /* i  : signal stereo output for SBA DirAC          */
+5 −27
Original line number Diff line number Diff line
@@ -81,35 +81,15 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK       /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_2255_ISAR_RENDER_POSES                      /* VA: issue 2255: fix missing check in isar_render_poses() */
#define FIX_1904_HARM_GSC_ENC                           /* VA: #1904 Harmonization of EVS and IVAS GSC code */
#define FIX_1478_UNINIT_ON_BFI                          /* VA: Fix issue 1478 where a vector is partly un-initialized during bfi */
#define FIX_BASOP_2358_SCALING_OOB                      /* Eri: Basip issue 2358: Clang-18 reports OOB access where scaling is applied to L_FRAME48k instead of output_frame */
#define FIX_BASOP_2350_HARM_0B_BWE_2                    /* VA: basop issue 2350: Simplify calling of hf_synth_fx() */
#define FIX_2364_HARM_MULT_HARM                         /* VA: basop issue 2364 : harmonizing multi_harm_fx function */
#define FIX_2363_FIND_WSP                               /* VA: basop issue 2363 : harmonizing find_wsp function */
#define FIX_2370_UNUSED_BUFFERS_CORE_ENC                /* VA: basop issue 2370: remove temporary input buffers in core-encoder  */
#define FIX_2376_FIX_USAN_PRE_PROC                      /* VA: basop issue 2376: Resolve "USAN: SEGV in ivas_compute_core_buffers_fx() */
#define FIX_2367_REMOVE_CODE_ICBWE                      /* VA: basop issue 2367: Remove IC-BWE obsolete code  */
#define REMOVE_SCALING_SHB_SPEECH                       /* VA: remove unnecessary scaling and 32-bit buffers from ivas_core_enc_fx() */
#define FIX_2352_COPY_AQ_IN_TCX                         /* FhG: basop issue 2352: prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */
#define FIX_2353_PTR_INIT                               /* FhG: basop issue 2353: initialize prm_sqQ-pointer, to prevent being uninitialized in case of bfi == 1 */
#define FIX_2356_GET_CHAN_ENERGIES                      /* FhG: basop issue 2356: correctly initialize exponents in getChannelEnergies_fx() */
#define FIX_2355_IGF_EXP_POWERSPEC                      /* FhG: basop issue 2355: make sure exp_pPowerSpectrumParameter_fx is initialized in all cases */
#define FIX_2319_CLDFB_INIT_FLAGS                       /* FhG: basop issue 2319: init hs->flags during openCldfb(), to avoid reading of uninitialized memory */
#define FIX_BASOP_2357_OBJECT_EDIT_MSAN                 /* Nokia: basop issue 2357: initialize missing exponents in object edit */
#define FIX_BASOP_2354_MSAN_DIFF_Q_VALUE                /* Nokia: Initialize Q value of diffuseness in rendering to Q30 */
#define FIX_2371_REMOVE_UNUSED_ISAR_FCNS                /* Dolby: basop issue 2371: remove unused ISAR-related functions */      
#define FIX_2384_INIT_DEQUANT_COV                       /* FhG: basop issue 2384: only read initialized values from Cy_buf_e[k] in ivas_param_mc_dequantize_cov_fx() during renormalization */
#define FIX_2383_INIT_Q_A_ITF                           /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */
#define FIX_2382_COPY_AQ_IN_MCT                         /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */
#define FIX_2391_INIT_HQ_GENERIC_OFFSET                 /* FhG/Eri: basop issue 2391: make sure hq_generic_offset is initialized inside hq_hr_dec_fx() */
#define FIX_2397_COPY_AQ_MDCT_CORE_BFI                  /* FhG: prevent copying of uninit memory in MDCT stereo core if bfi is set */
#define HARMONIZE_TBE                                   /* VA: harmonize core-coder TBE function duplications */
#define HARMONIZE_READ_DECODE_TNS                       /* FhG: issue 2389: Harmonization of two pairs ReadTnsData() and DecodeTnsData()*/
#define FIX_2405_HARM_SMC_INIT                          /* VA, basop 2405, harmonisation of SMC init */
#define FIX_2280_REDUCTION_UNNECESSARY_SCALING          /* VA: reduction of unnecessary scaling */
#define FIX_2280_REDUCTION_UNNECESSARY_SCALING_NONBE    /* VA: reduction of unnecessary scaling, non-BE part */

/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
@@ -117,11 +97,9 @@

#define FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT  /* Dolby: Issue 2250:  random vector generation in GenShapedSHBExcitation() */
#define FIX_2338_HARM_GSC_GAIN_COMP                     /* VA: basop issue 2338: harmonization of band gain computation for both EVS and IVAS */
#define FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG       /* Eri: Basop issue 2317: Uninitialized value read in case of DTX and BW switching   */
#define FIX_BASOP_2361_OTR                              /* FhG: Basop issue 2361: Orientation tracking tests for equivalent rotations fail */
#define FIX_1283_STEREO_DFT_COLLAPSE                    /* FhG: float issue 1283: fix for critical issue with DFT stereo core coder */
#define FIX_2379_REMOVE_previoussynth_fx_32             /* VA: basop issue 2379: remove duplicated buffer st->previoussynth_fx_32[] */
#define FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER           /* FhG/VA: basop issue 2396: keep TC channel pointers in one constant place during decoding and rendering */
#define FIX_2408_FD_BWE_UPDATE                          /* VA: basop issue 2408: bug-fix in the FD BWE memory updates in wb_pre_proc_ivas_fx()  */

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

Loading