Commit 24df9ef7 authored by multrus's avatar multrus
Browse files

merge from main

parents 72ef7fda 0aa89070
Loading
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -1357,13 +1357,22 @@ void stereo_tcx_init_dec_fx(
    const Word16 last_element_mode                              /* i  : element mode of previous frame      */
);

void stereo_icBWE_enc_ivas_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(
@@ -6382,7 +6391,7 @@ UWord16 get_indice_st(

void stereo_mdct_core_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                   */
    Word16 new_samples[CPE_CHANNELS][L_INP],                    /* i  : new samples                           Q0*/
    Word16 new_samples[CPE_CHANNELS][L_INP],                    /* i  : new samples                       Qnew-1*/
    Word16 old_wsp[CPE_CHANNELS][L_WSP],                        /* i  : 12.8kHz weighted speech (for LTP      Qx*/
    Word16 pitch_buf_fx[CPE_CHANNELS][NB_SUBFR16k]              /* o  : floating pitch for each subframe      Q6*/
);
+14 −2
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@
/*#define DISABLE_LIMITER*/

/* ################### Start MAINTENANCE switches ########################### */
#define FIX_2255_ISAR_RENDER_POSES                           /* VA: issue 2255: fix missing check in isar_render_poses() */

/* ################### Start BE switches ################################# */
/* only BE switches wrt wrt. TS 26.251 V3.0 */
@@ -85,6 +84,7 @@
#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_2318_CLANG_DECODER                          /* VA: basop issue 2318: Initialize command-line parameter arg.non_diegetic_pan_gain_fx */
@@ -101,12 +101,24 @@
#define FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND  /* Nokia: basop issue 2332: Uses predefined memory sizes instead computing wrong */
#define FIX_BASOP_2333_MCMASA_ANA_MEMORY_LEAK           /* Nokia: basop issue 2333: Add missing free for direction_vector_e to ivas_mcmasa_ana_fx.c */
#define HARM_COREDECODER_FUNCTIONS                      /* VA: basop issue 2347: Remove various duplicated code in core-decoder  */
#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_2351_EXTREND_SCALE                    /* FhG: basop issue 2351: Only scale initialized samples in renderer, related to 2326 */
#define FIX_2331_CLANG18_MSAN_UNINIT_VARIABLE           /* FhG: Fix issue 2331: Uninitialized variable */
#define FIX_2362_TOTAL_BRATE_CALCULATION                /* FhG: basop issue 2362: fix calculation of st->total_brate in ivas_cpe_enc_fx() */
#define FIX_2330_CLANG_18_WARNINGS_REND                 /* FhG: Fix renderer warnings */
#define FIX_BASOP_2350_HARM_0B_BWE                      /* VA: basop issue 2350: harmonization of the 0b BWE */
#define FIX_BASOP_2350_HARM_0B_BWE_2                    /* VA: basop issue 2350: Simplify calling of hf_synth_fx() */
#define FIX_2349_HARM_FIND_UV                           /* VA: basop issue 2349: harmonization of find_uv() function */
#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 */

/* #################### End BE switches ################################## */
@@ -120,10 +132,10 @@
#define FIX_1500_ISM_MD_DTX                             /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */
#define FIX_2348_REPLACE_FEC_ENC                        /* VA: basop issue 2348: replace FEC_encode_ivas_fx with FEC_encode_fx  */
#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   */

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


/* ################## End MAINTENANCE switches ######################### */

/* clang-format on */
+10 −5
Original line number Diff line number Diff line
@@ -10338,9 +10338,13 @@ void Copy_Scale_sig32(
void swb_pre_proc_ivas_fx(
    Encoder_State *st,      /* i/o: encoder state structure                  */
    Word16 *new_swb_speech, /* o  : original input signal at 32kHz - Q0      */
#ifndef REMOVE_SCALING_SHB_SPEECH
    Word32 *new_swb_speech_fx, /* o  : original input signal at 32kHz - Q - q_reImBuffer */
    Word16 *shb_speech,        /* o  : SHB target signal (6-14kHz) at 16kHz- Q(Q_shb_spch) */
#endif
    Word16 *shb_speech, /* o  : SHB target signal (6-14kHz) at 16kHz - Q0*/
#ifndef REMOVE_SCALING_SHB_SPEECH
    Word16 *Q_shb_spch,
#endif
    Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i  : real buffer Q - q_reImbuffer             */
    Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i  : imag buffer Q - q_reImbuffer             */
    Word16 q_reImBuffer,                                        /* i  : scale data of real and imag CLDFB buffers*/
@@ -11027,7 +11031,7 @@ void bands_and_bit_alloc_ivas_fx(
    const Word16 element_mode,     /* i  : element mode                                          */
    const Word16 GSC_IVAS_mode     /* i  : GSC IVAS mode                                         */
);
#ifndef FIX_2363_FIND_WSP
void ivas_find_wsp_fx(
    const Word16 L_frame,    /* i  : length of the frame                   Q0*/
    const Word16 L_subfr,    /* i  : length of subframe                    Q0*/
@@ -11041,6 +11045,7 @@ void ivas_find_wsp_fx(
    const Word16 gamma,      /* i  : weighting factor                       Q15 */
    const Word16 L_look      /* i  : look-ahead                            Q0*/
);
#endif
Word16 RCcontextMapping_encode2_estimate_bandWise_start_fx(
    Word16 *x,           /* Q0 */
+19 −2
Original line number Diff line number Diff line
@@ -74,7 +74,9 @@ ivas_error acelp_core_dec_fx(
    const Word16 read_sid_info           /* i  : read SID info flag                          */
)
{
#ifndef FIX_BASOP_2350_HARM_0B_BWE_2
    Word32 synth_fx[960], save_hb_synth_fx[960] /*, bwe_exc_extended_fx[L_FRAME32k + NL_BUFF_OFFSET]*/;
#endif
    Word16 old_exc_fx[L_EXC_DEC], *exc_fx;                                           /* excitation signal buffer              */
    Word16 syn_tmp_fx[L_FRAME16k + L_SUBFR], *psyn_fx;                               /* synthesis signal buffer               */
    Word16 output_frame;                                                             /* frame length at output sampling freq. */
@@ -1896,6 +1898,9 @@ ivas_error acelp_core_dec_fx(
                              st->stab_fac_fx, &st->stab_fac_smooth_fx, st->coder_type, st->Q_syn, bpf_error_signal_16fx );
        }

#ifdef FIX_BASOP_2350_HARM_0B_BWE_2
        Word32 synth_fx[L_FRAME48k];
#endif
        Word32 syn_tmp_32_fx[L_FRAME16k + L_SUBFR], *syn_32_fx;
        set32_fx( syn_tmp_32_fx, 0, L_FRAME16k + L_SUBFR );
        syn_32_fx = syn_tmp_32_fx + L_SUBFR;
@@ -2049,7 +2054,11 @@ ivas_error acelp_core_dec_fx(
                    }
                }

                cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, save_hb_synth_fx, -1, sub( Q11, Q_real ), -10, st->cldfbSynHB );
                cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx /*tmp buffer for save_hb_synth_fx[] */, -1, sub( Q11, Q_real ), -10, st->cldfbSynHB );

#ifdef FIX_BASOP_2350_HARM_0B_BWE_2
                Copy_Scale_sig_32_16( synth_fx, save_hb_synth_fx16, output_frame, 0 ); // Q0
#endif

                /* restore lowband */
                FOR( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ )
@@ -2197,6 +2206,9 @@ ivas_error acelp_core_dec_fx(
            Copy( psyn_fx, output_fx, st->L_frame ); /*Q_syn*/
        }

#ifdef FIX_BASOP_2350_HARM_0B_BWE_2
        Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q_syn2
#endif
        st->Q_syn2 = 0;
        move16();
    }
@@ -2217,6 +2229,9 @@ ivas_error acelp_core_dec_fx(
        IF( ( EQ_16( st->L_frame, L_FRAME ) && ( st->bwidth != NB ) && GE_16( output_frame, L_FRAME16k ) &&
              ( EQ_16( st->extl, -1 ) || EQ_16( st->extl, SWB_CNG ) || ( EQ_16( st->extl, WB_BWE ) && st->extl_brate == 0 && NE_16( st->coder_type, AUDIO ) ) ) ) )
        {
#ifdef FIX_BASOP_2350_HARM_0B_BWE_2
            hf_synth_fx( st->hBWE_zero, st->element_mode, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 );
#else
            IF( EQ_16( st->element_mode, EVS_MONO ) )
            {
#ifndef FIX_BASOP_2350_HARM_0B_BWE
@@ -2235,6 +2250,7 @@ ivas_error acelp_core_dec_fx(
#endif
                Copy_Scale_sig_16_32_DEPREC( synth_fx16, synth_fx, output_frame, 0 );
            }
#endif
        }
        ELSE
        {
@@ -2352,6 +2368,7 @@ ivas_error acelp_core_dec_fx(
        }
    }

#ifndef FIX_BASOP_2350_HARM_0B_BWE_2
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        IF( save_hb_synth_fx16 != NULL )
@@ -2360,7 +2377,7 @@ ivas_error acelp_core_dec_fx(
        }
        Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q_syn2
    }

#endif
    pop_wmops();
    return error;
}
+3 −0
Original line number Diff line number Diff line
@@ -4021,6 +4021,9 @@ void decoder_tcx_ivas_fx(
    move16();
    fUseTns = 0; /* flag that is set if TNS data is present */
    move16();
#ifdef FIX_2353_PTR_INIT
    prm_sqQ = NULL;
#endif

    set16_fx( xn_buf_fx, 0, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX );

Loading