Commit ca181576 authored by JÜRGEN Gerstacker's avatar JÜRGEN Gerstacker
Browse files

Merge branch 'main' into...

Merge branch 'main' into basop-2388-harmonize-inittnsconfiguration_ivas_fx-and-inittnsconfiguration_fx
parents 17ebdc5c 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" );
+12 −0
Original line number Diff line number Diff line
@@ -1587,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
@@ -1890,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     */
@@ -2088,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          */
+4 −0
Original line number Diff line number Diff line
@@ -87,6 +87,9 @@
#define FIX_2388_INITTNSCONFIGURATION                   /* FhG: issue 2388 : harmonizing InitTnsConfiguration() function */
#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 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 ################################## */

@@ -97,6 +100,7 @@
#define FIX_2338_HARM_GSC_GAIN_COMP                     /* VA: basop issue 2338: harmonization of band gain computation for both EVS and IVAS */
#define FIX_BASOP_2361_OTR                              /* FhG: Basop issue 2361: Orientation tracking tests for equivalent rotations fail */
#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 ########################### */

+21 −8
Original line number Diff line number Diff line
@@ -7587,8 +7587,13 @@ ivas_error core_switching_pre_dec_fx(
ivas_error core_switching_post_dec_fx(
    Decoder_State *st_fx, /* i/o: decoder state structure                                                           */
    Word16 *synth,        /* i/o: output synthesis                                                            Qsynth*/
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 *output_fx,        /* i/o: LB synth/upsampled LB synth                                                    Q11*/
    Word32 output_mem_fx32[], /* i  : OLA memory from last TCX/HQ frame                                               Qx*/
#else
    Word32 *output_fx,           /* i/o: LB synth/upsampled LB synth                                                     Q4*/
    Word16 output_mem_fx[],      /* i  : OLA memory from last TCX/HQ frame                                               Qx*/
#endif
    const Word16 use_cldfb_for_dft,     /* i  : flag to use of CLDFB for DFT Stereo                                             Q0*/
    const Word16 output_frame,          /* i  : frame length                                                                    Q0*/
    const Word16 core_switching_flag,   /* i  : ACELP->HQ switching flag                                                        Q0*/
@@ -10123,9 +10128,17 @@ Word16 swb_bwe_dec_fx32(
ivas_error acelp_core_dec_fx(
    Decoder_State *st, /* i/o: decoder state structure                                                 */
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 output_fx32[], /* o  : synthesis @internal Fs                                               Q11*/
#else
    Word16 output_fx[],          /* o  : synthesis @internal Fs                                                  */
#endif
    Word16 synth_fx16[], /* o  : synthesis                                                               */
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 save_hb_synth_fx32[], /* o  : HB synthesis                                                          Q0*/
#else
    Word16 save_hb_synth_fx16[], /* o  : HB synthesis                                                            */
#endif
    Word32 bwe_exc_extended_fx[],        /* i/o: bandwidth extended excitation                                           */
    Word16 *voice_factors_fx,            /* o  : voicing factors                                                         */
    Word16 old_syn_12k8_16k_fx[],        /* o  : intermediate ACELP synthesis at 12.8kHz or 16kHz to be used by SWB BWE  */
+29 −5
Original line number Diff line number Diff line
@@ -53,9 +53,17 @@

ivas_error acelp_core_dec_fx(
    Decoder_State *st, /* i/o: decoder state structure                                                 */
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 output_fx32[], /* o  : synthesis @internal Fs                                                  Q11*/
#else
    Word16 output_fx[],                         /* o  : synthesis @internal Fs                                                  Q_syn*/
#endif
    Word16 synth_fx16[], /* o  : synthesis                                                               Q_syn2*/
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 save_hb_synth_fx32[], /* o  : HB synthesis                                                            Q0*/
#else
    Word16 save_hb_synth_fx16[],                /* o  : HB synthesis                                                            Q0*/
#endif
    Word32 bwe_exc_extended_fx[],        /* i/o: bandwidth extended excitation                                           2*Q_exc*/
    Word16 *voice_factors_fx,            /* o  : voicing factors                                                         Q15*/
    Word16 old_syn_12k8_16k_fx[],        /* o  : intermediate ACELP synthesis at 12.8kHz or 16kHz to be used by SWB BWE  Q_syn2-1*/
@@ -205,7 +213,11 @@ ivas_error acelp_core_dec_fx(
            Copy( lsp_new_fx, st->lsp_old_fx, M ); /*Q15*/
        }

#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
        set32_fx( output_fx32, 0, st->L_frame ); /* output and synth are not used in DFT domain CNG generation and the decoder output is unaffected if they are left uninitalized */
#else
        set16_fx( output_fx, 0, output_frame ); /* output and synth are not used in DFT domain CNG generation and the decoder output is unaffected if they are left uninitalized */
#endif
        set16_fx( synth_fx16, 0, output_frame ); /* They are however read in a few places which causes errors in the valgrind tests. Simplest solution from a code perspective was to set them to zero. */

        /* CN generation done in DFT domain */
@@ -2008,7 +2020,11 @@ ivas_error acelp_core_dec_fx(
                }
            }

#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
            IF( save_hb_synth_fx32 != NULL )
#else
            IF( save_hb_synth_fx16 != NULL )
#endif
            {
                /* save and then zero-out lowband */
                max_real = 0;
@@ -2049,9 +2065,13 @@ ivas_error acelp_core_dec_fx(
                    }
                }

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

                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++ )
@@ -2194,10 +2214,14 @@ ivas_error acelp_core_dec_fx(

        /* Copy output signal */
        Scale_sig( syn_tmp_fx, add( st->L_frame, L_SUBFR ), negate( st->Q_syn ) ); // Q0
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
        Copy_Scale_sig_16_32_no_sat( psyn_fx, output_fx32, st->L_frame, sub( Q11, st->Q_syn2 ) ); // Q_syn2->Q11
#else
        IF( st->element_mode > EVS_MONO )
        {
            Copy( psyn_fx, output_fx, st->L_frame ); /*Q_syn*/
        }
#endif

        Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q_syn2
        st->Q_syn2 = 0;
Loading