Commit 50965461 authored by multrus's avatar multrus
Browse files

Merge branch 'main' into...

Merge branch 'main' into basop-2567-harmonize-init_acelp-init_tcx-init_coder_ace_plus-init_core_sig_ana-init_modes
parents 65932f40 c8b0e506
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3195,7 +3195,7 @@ static ivas_error decodeVoIP(
#ifdef SUPPORT_JBM_TRACEFILE
                if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, &bitstreamReadDone, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
+4 −0
Original line number Diff line number Diff line
@@ -40,7 +40,9 @@
/* clang-format off */
  /* ################### Start compiler switches ######################## */

#ifndef NO_SUPPORT_JBM_TRACEFILE
#define SUPPORT_JBM_TRACEFILE                   /* support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */
#endif

/* #################### End compiler switches ######################### */

@@ -94,6 +96,7 @@
#define FIX_FLOAT_1539_G192_FORMAT_SWITCH               /* VA/Nokia: reintroduce format switching for g192 bitstreams */
#define HARMONIZE_2595_reconfig_decoder_LPD             /* FhG: Harmonize reconfig_decoder_LPD with its ivas derivate */
#define HARMONIZE_2596_SetModeIndex                     /* FhG: Harmonize SetModeIndex with its ivas derivate */
#define HARMONIZE_2597_ShapeSpectrum                    /* FhG: Harmonize ShapeSpectrum with its ivas derivate */

#define HARMONIZE_2567_init_functions                   /* FhG: harmonize derivates for evs/ivas regarding functions init_acelp*(),init_tcx_cfg*(), init_tcx*(), init_coder_ace_plus*(), init_core_sig_ana*() and init_modes*() */

@@ -110,6 +113,7 @@
#define FIX_NONBE_2580_USE_LENGTH_NOT_CONSTANT          /* Dolby: fix 2580: use dynamic length denominator for average energy in unclr_calc_corr_features_fx() */
#define FIX_BASOP_2599_TCA_OVERFLOW                     /* VA: issue 2599, Fix TCA overflow */
#define FIX_2588_MISSING_CONDITIONS                     /* VA: Proposed fix to 2588, addition of a condition in lsf_dec */
#define FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI         /* Nokia: BASOP issue 2442: Increase accuracy of computations and add additional gain clamp for low energy decorrelated signal rendering. */

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

+23 −1
Original line number Diff line number Diff line
@@ -221,6 +221,7 @@ void TNSAnalysis_fx(
    }
}

#ifndef HARMONIZE_2597_ShapeSpectrum
void ShapeSpectrum_fx(
    TCX_CONFIG_HANDLE hTcxCfg, /* i  : configuration of TCX               */
    Word16 A[],                /* input: quantized coefficients NxAz_q[M+1]  Q = 14 - norm(A[0])*/
@@ -460,14 +461,20 @@ void ShapeSpectrum_fx(
        PsychAdaptLowFreqEmph_fx( spectrum, gainlpc, gainlpc_e );
    }
}
#endif

#ifdef HARMONIZE_2597_ShapeSpectrum
void ShapeSpectrum_fx(
#else
void ShapeSpectrum_ivas_fx(
#endif
    TCX_CONFIG_HANDLE hTcxCfg, /* i  : configuration of TCX               */
    Word16 A[],                /* input: quantized coefficients NxAz_q[M+1], Q = 14 - norm(A[0]) */
    Word16 gainlpc[],          /* output: MDCT gains for the previous frame Q(15-gainlpc_e)*/
    Word16 gainlpc_e[],        /* output: MDCT gains exponents */
    Word16 L_frame_glob,       /* input: frame length             */
    Word16 L_spec,
    Word32 spectrum[],  /* i/o: MDCT spectrum Q(31-spectrum_e) */
    Word32 spectrum[],  /* i/o: MDCT spectrum */
    Word16 *spectrum_e, /* i/o: MDCT spectrum exponent */
    Word8 pfUseTns,     /* output: Flag indicating if TNS is used */
    Encoder_State *st,
@@ -724,7 +731,11 @@ void ShapeSpectrum_ivas_fx(
        {
            Word16 fac;
            fac = divide3232( max_low2, max_high );
#ifdef HARMONIZE_2597_ShapeSpectrum
            IF( GE_16( norm_s( fac ), max_fac_s ) || EQ_16( st->element_mode, EVS_MONO ) )
#else
            IF( GE_16( norm_s( fac ), max_fac_s ) )
#endif
            {
                fac = shl( mult_r( fac, max_fac_m ), max_fac_s );
                FOR( i = 0; i < ( L_spec - L_frame ); i++ )
@@ -3793,12 +3804,23 @@ void coder_tcx_fx(
        ProcessIGF_fx( st, 0, spectrum, &q_spectrum, NULL, 0, powerSpec, &powerSpec_e, 1, 0, 0, 0 );
    }

#ifdef HARMONIZE_2597_ShapeSpectrum
    ShapeSpectrum_fx( hTcxCfg, A, gainlpc, gainlpc_e,
                      L_frame_glob,
                      L_spec,
                      spectrum,
                      0,
                      hTcxEnc->fUseTns[0],
                      st,
                      0 );
#else
    ShapeSpectrum_fx( hTcxCfg, A, gainlpc, gainlpc_e,
                      L_frame_glob,
                      L_spec,
                      spectrum,
                      hTcxEnc->fUseTns[0],
                      st );
#endif
    if ( st->igf )
    {
        nb_bits = sub( nb_bits, st->hIGFEnc->infoTotalBitsPerFrameWritten );
+28 −1
Original line number Diff line number Diff line
@@ -171,6 +171,19 @@ void core_encode_twodiv_fx(
            }

            /* Shape spectrum */
#ifdef HARMONIZE_2597_ShapeSpectrum
            ShapeSpectrum_fx( st->hTcxCfg,
                              A_q,
                              gainlpc[n],
                              gainlpc_e[n],
                              shr( st->L_frame, 1 ),
                              shr( st->hTcxCfg->tcx_coded_lines, 1 ),
                              spectrum[n],
                              0,
                              hTcxEnc->fUseTns[n],
                              st,
                              0 );
#else
            ShapeSpectrum_fx( st->hTcxCfg,
                              A_q,
                              gainlpc[n],
@@ -180,6 +193,7 @@ void core_encode_twodiv_fx(
                              spectrum[n],
                              hTcxEnc->fUseTns[n],
                              st );
#endif

            st->last_core = st->core;
            move16();
@@ -266,7 +280,19 @@ void core_encode_twodiv_fx(

        E_LPC_f_lsp_a_conversion( lsp_q, A_q, M );


#ifdef HARMONIZE_2597_ShapeSpectrum
        ShapeSpectrum_fx( st->hTcxCfg,
                          A_q,
                          gainlpc[0],
                          gainlpc_e[0],
                          st->L_frame,
                          st->hTcxCfg->tcx_coded_lines,
                          spectrum[0],
                          0,
                          hTcxEnc->fUseTns[0],
                          st,
                          0 );
#else
        ShapeSpectrum_fx( st->hTcxCfg,
                          A_q,
                          gainlpc[0],
@@ -276,6 +302,7 @@ void core_encode_twodiv_fx(
                          spectrum[0],
                          hTcxEnc->fUseTns[0],
                          st );
#endif

        /*_DIFF_FLOAT_FIX_EVS_IVAS  -> The line below is present in float */
        // hTcxEnc->measuredBwRatio = 0x4000;
+8 −0
Original line number Diff line number Diff line
@@ -2125,7 +2125,11 @@ void ivas_mdct_core_whitening_enc_fx(
            move16();

            /* Shape spectrum */
#ifdef HARMONIZE_2597_ShapeSpectrum
            ShapeSpectrum_fx( st->hTcxCfg, A_q_fx[ch][n], NULL, NULL, L_subframe, tcx_subframe_coded_lines, st->hTcxEnc->spectrum_fx[n], &st->hTcxEnc->spectrum_e[n], st->hTcxEnc->fUseTns[n], st, scf_q_fx[ch][n] );
#else
            ShapeSpectrum_ivas_fx( st->hTcxCfg, A_q_fx[ch][n], NULL, NULL, L_subframe, tcx_subframe_coded_lines, st->hTcxEnc->spectrum_fx[n], &st->hTcxEnc->spectrum_e[n], st->hTcxEnc->fUseTns[n], st, scf_q_fx[ch][n] );
#endif

            Scale_sig32( st->hTcxEnc->spectrum_fx[n] + L_subframe, sub( L_subframeTCX, L_subframe ), sub( exp_tmp, st->hTcxEnc->spectrum_e[n] ) );
        }
@@ -2265,7 +2269,11 @@ void ivas_mdct_core_whitening_enc_fx(
                move16();

                /* Shape spectrum */
#ifdef HARMONIZE_2597_ShapeSpectrum
                ShapeSpectrum_fx( st->hTcxCfg, A_q_fx[ch][n], NULL, NULL, L_subframe, tcx_subframe_coded_lines, mdst_spectrum_fx[ch][n], &mdst_spectrum_e[ch][n], st->hTcxEnc->fUseTns[n], st, scf_q_fx[ch][n] );
#else
                ShapeSpectrum_ivas_fx( st->hTcxCfg, A_q_fx[ch][n], NULL, NULL, L_subframe, tcx_subframe_coded_lines, mdst_spectrum_fx[ch][n], &mdst_spectrum_e[ch][n], st->hTcxEnc->fUseTns[n], st, scf_q_fx[ch][n] );
#endif

                Scale_sig32( mdst_spectrum_fx[ch][n] + L_subframe, sub( L_subframeTCX, L_subframe ), sub( exp_tmp, mdst_spectrum_e[ch][n] ) );
            }
Loading