Commit d345213d authored by multrus's avatar multrus
Browse files

Merge branch 'basop-2454-harmonize-tcx_res_q_spec_fx-and-tcx_res_q_spec_ivas_fx' into 'main'

Resolve "Harmonize tcx_res_Q_spec_fx() and tcx_res_Q_spec_ivas_fx()"

Closes #2454

See merge request !2845
parents f6ae1b38 0c0cac3a
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@
#define FIX_2459_USAN_AMR_SIDSTART                      /* FhG: basop issue 2459: fix msan complaint */
#define FIX_2458_USAN_NULLPTR_WITH_ZERO_OFFSET          /* FhG: basop issue 2458: avoid indexing into null pointer */
#define HARM_2456_APPLY_SCALE                           /* FhG basop issue 2456: Harmonize apply_scale_ind(), apply_scale_ivas_fx() */
#define HARM_2454_TCX_RES_Q_SPEC                        /* FhG: harmonization of tcx_res_Q_spec_fx() and tcx_res_Q_spec_ivas_fx() */

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

+8 −0
Original line number Diff line number Diff line
@@ -3585,11 +3585,19 @@ void QuantizeTCXSpectrum_fx(
            resQBits = tcx_res_Q_gain_fx( gain_tcx_opt_fx, gain_tcx_opt_e, gain_tcx_fx, gain_tcx_e, sqQ + L_spec, resQTargetBits );
            IF( st->tcxonly )
            {
#ifdef HARM_2454_TCX_RES_Q_SPEC
                resQBits = tcx_res_Q_spec_fx( x_orig_fx, x_orig_e, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, sqQ + L_spec, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, NULL );
#else
                resQBits = tcx_res_Q_spec_ivas_fx( x_orig_fx, x_orig_e, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, sqQ + L_spec, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, NULL );
#endif
            }
            ELSE
            {
#ifdef HARM_2454_TCX_RES_Q_SPEC
                resQBits = tcx_res_Q_spec_fx( x_orig_fx, x_orig_e, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, sqQ + L_spec, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, lf_deemph_fact_fx );
#else
                resQBits = tcx_res_Q_spec_ivas_fx( x_orig_fx, x_orig_e, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, sqQ + L_spec, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, lf_deemph_fact_fx );
#endif
            }
        }
    }
+2 −1
Original line number Diff line number Diff line
@@ -1351,6 +1351,7 @@ Word16 tcx_res_Q_spec_fx(
    Word16 sq_round,
    const Word16 lf_deemph_factors[] );

#ifndef HARM_2454_TCX_RES_Q_SPEC
Word16 tcx_res_Q_spec_ivas_fx(
    Word32 *x_orig,
    Word16 x_orig_e,
@@ -1364,7 +1365,7 @@ Word16 tcx_res_Q_spec_ivas_fx(
    Word16 bits,
    Word16 sq_round,
    const Word16 lf_deemph_factors[] );

#endif
/* compute noise-measure flags for spectrum filling and quantization (0: tonal, 1: noise-like) */
void ComputeSpectrumNoiseMeasure_fx(
    const Word32 *powerSpec,
+4 −0
Original line number Diff line number Diff line
@@ -3388,6 +3388,7 @@ Word16 tcx_res_Q_gain_fx(
    return bits;
}

#ifndef HARM_2454_TCX_RES_Q_SPEC
Word16 tcx_res_Q_spec_fx(
    Word32 *x_orig,
    Word16 x_orig_e,
@@ -3568,6 +3569,9 @@ Word16 tcx_res_Q_spec_fx(


Word16 tcx_res_Q_spec_ivas_fx(
#else
Word16 tcx_res_Q_spec_fx(
#endif
    Word32 *x_orig,
    Word16 x_orig_e,
    Word32 *x_Q,