Commit e9153526 authored by Arash Azizi's avatar Arash Azizi
Browse files

Issue 2551: necessary changes for harmonization. Converting all instances of...

Issue 2551: necessary changes for harmonization. Converting all instances of the function to the unified version. getting rid of some changes that became obsolete because of another merge !2965
parent 53aa44eb
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -3091,9 +3091,11 @@ void QuantizeTCXSpectrum_fx(

            /* Quantize original spectrum */
            sqGain_fx = SQ_gain_ivas_fx( spectrum_fx, *spectrum_e, ( mult( hTcxEnc->tcx_target_bits_fac, shl( sqTargetBits, 1 ) ) ), L_spec, &sqGain_e );

#ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN
            tcx_scalar_quantization_ivas_fx(spectrum_fx, *spectrum_e, sqQ, L_spec, sqGain_fx, sqGain_e, st->hTcxCfg->sq_rounding, hTcxEnc->memQuantZeros, st->tcxonly);

#else
            tcx_scalar_quantization_fx(spectrum_fx, *spectrum_e, sqQ, L_spec, sqGain_fx, sqGain_e, st->hTcxCfg->sq_rounding, hTcxEnc->memQuantZeros, st->tcxonly, st->element_mode);
#endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN
            /* Estimate original bitrate */
            stop = 0;
            move16();
@@ -3184,8 +3186,11 @@ void QuantizeTCXSpectrum_fx(
                sqGain_fx = SQ_gain_ivas_fx( spectrum_fx, *spectrum_e, shl( mult( hTcxEnc->tcx_target_bits_fac, sqTargetBits ), 1 ), L_spec, &sqGain_e );
            }
            /* Quantize spectrum */
#ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN
            tcx_scalar_quantization_ivas_fx(spectrum_fx, *spectrum_e, sqQ, L_spec, sqGain_fx, sqGain_e, st->hTcxCfg->sq_rounding, hTcxEnc->memQuantZeros, st->tcxonly);

#else
            tcx_scalar_quantization_fx(spectrum_fx, *spectrum_e, sqQ, L_spec, sqGain_fx, sqGain_e, st->hTcxCfg->sq_rounding, hTcxEnc->memQuantZeros, st->tcxonly, st->element_mode);
#endif
            /* Estimate bitrate */
            stop = 0;
            move16();
@@ -3454,8 +3459,12 @@ void QuantizeTCXSpectrum_fx(
            move16();
            sqGain_e = 1;
            move16();

#ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN
            tcx_scalar_quantization_ivas_fx(spectrum_fx, *spectrum_e, sqQ, L_spec, sqGain_fx, sqGain_e, st->hTcxCfg->sq_rounding, hTcxEnc->memQuantZeros, st->tcxonly);
#else
            tcx_scalar_quantization_fx(spectrum_fx, *spectrum_e, sqQ, L_spec, sqGain_fx, sqGain_e, st->hTcxCfg->sq_rounding, hTcxEnc->memQuantZeros, st->tcxonly, st->element_mode);
#endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN

            stop = 1;
            IF( st->element_mode > EVS_MONO )
            {
+5 −1
Original line number Diff line number Diff line
@@ -969,7 +969,11 @@ static Word16 QuantSpecEstimateBits_fx(
    Word16 stop, sqBits, nEncoded;
    Word16 lastnz;

#ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN
    tcx_scalar_quantization_ivas_fx(spec_fx, spec_e, sqQ, length, G_fx, G_e, 16384 /*Q15*/, NULL, 1);
#else
    tcx_scalar_quantization_fx(spec_fx, spec_e, sqQ, length, G_fx, G_e, 16384 /*Q15*/, NULL, 1, IVAS_SCE);
#endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN

    stop = 0;
    move16();
+12 −7
Original line number Diff line number Diff line
@@ -1665,13 +1665,7 @@ Word16 tcx_scalar_quantization_rateloop_fx(
        }

        /* Quantize spectrum */
#ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN
        tcx_scalar_quantization_fx(x, x_e, xq, L_frame, sqGain, sqGain_e, offset, memQuantZeros_fx, tcxonly);  
#else
        tcx_scalar_quantization_fx(x, x_e, xq, L_frame, sqGain, sqGain_e, offset, memQuantZeros_fx, tcxonly, st->element_mode);
#endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN

        
        /* Estimate bitrate */
        stopFlag = 1;
        move16();
@@ -2146,6 +2140,7 @@ Word16 tcx_scalar_quantization_rateloop_fx(
        }

        /* Quantize spectrum */
#ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN
#ifndef FIX_BASOP_2546_HARMONIZE_TCX_SCALAR
        tcx_scalar_quantization_ivas_fx( x, x_e, xq, L_frame, sqGain, sqGain_e, offset, memQuantZeros_fx, tcxonly );
#else
@@ -2158,6 +2153,9 @@ Word16 tcx_scalar_quantization_rateloop_fx(
            tcx_scalar_quantization_ivas_fx( x, x_e, xq, L_frame, sqGain, sqGain_e, offset, memQuantZeros_fx, tcxonly );
        }
#endif // !FIX_BASOP_2546_HARMONIZE_TCX_SCALAR
#else
        tcx_scalar_quantization_fx(x, x_e, xq, L_frame, sqGain, sqGain_e, offset, memQuantZeros_fx, tcxonly, element_mode);
#endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN
        /* Estimate bitrate */
        stopFlag = 1;
        move16();
@@ -2212,6 +2210,8 @@ Word16 tcx_scalar_quantization_rateloop_fx(

    IF( GE_16( tcxRateLoopOpt, 1 ) )
    {
#ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN

#ifndef FIX_BASOP_2546_HARMONIZE_TCX_SCALAR
        /* Quantize spectrum */
        tcx_scalar_quantization_ivas_fx( x, x_e, xq, L_frame, *gain, *gain_e, offset, memQuantZeros_fx, tcxonly );
@@ -2226,6 +2226,11 @@ Word16 tcx_scalar_quantization_rateloop_fx(
        }
#endif // !FIX_BASOP_2546_HARMONIZE_TCX_SCALAR

#else
        tcx_scalar_quantization_fx(x, x_e, xq, L_frame, *gain, *gain_e, offset, memQuantZeros_fx, tcxonly, element_mode);
#endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN


        /* Output */
        *nEncoded = old_nEncoded;
        move16();