Commit 1ac4f836 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'basop_instrumentation_com_rend' into 'main'

BASOP and instrumentation changes for lib_com, lib_rend modules files

See merge request !427
parents 804fd537 988c29a0
Loading
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ void UnmapIndex(

        *FractionalResolution = kLtpHmFractionalResolution;
        move16();
        *Lag = L_shr( L_mult0( LtpPitchLag, Ratios_fx[Bandwidth][LtpPitchIndex][Multiplier - 1] ), 8 );
        *Lag = L_shr( L_mult0( LtpPitchLag, Ratios_fx[Bandwidth][LtpPitchIndex][sub( Multiplier, 1 )] ), 8 );
        move32();
    }
    ELSE
@@ -75,6 +75,7 @@ void UnmapIndex(
            }
        }
        *Lag = L_deposit_l( Lag16 );
        move32();
    }
}

@@ -95,7 +96,7 @@ void ConfigureContextHm(

    Bandwidth = 0;
    move16();
    IF( GE_16( NumCoeffs, 256 ) )
    if ( GE_16( NumCoeffs, 256 ) )
    {
        Bandwidth = 1;
        move16();
@@ -104,7 +105,7 @@ void ConfigureContextHm(
    SmallerLags = 0;
    move16();
    test();
    IF( ( LE_16( TargetBits, kSmallerLagsTargetBitsThreshold ) ) || ( Bandwidth == 0 ) )
    if ( ( LE_16( TargetBits, kSmallerLagsTargetBitsThreshold ) ) || ( Bandwidth == 0 ) )
    {
        SmallerLags = 1;
        move16();
@@ -134,6 +135,7 @@ void ConfigureContextHm(
        }
    }
    hm_cfg->numPeakIndices = (Word16) ( tmp - hm_cfg->indexBuffer );
    move16();

    /* Set up and fill holeIndices */
    hm_cfg->holeIndices = hm_cfg->indexBuffer + hm_cfg->numPeakIndices;
@@ -161,6 +163,7 @@ void ConfigureContextHm(
        }
    }
    hm_cfg->numHoleIndices = (Word16) ( tmp - hm_cfg->holeIndices );
    move16();
    *tmp++ = NumCoeffs;
    move16(); /* Add extremal element signaling the end of the buffer */
}
@@ -186,7 +189,7 @@ Word16 CountIndexBits(
}


int tcx_hm_render(
Word32 tcx_hm_render(
    Word32 lag,       /* i: pitch lag                         Q0  */
    Word16 fract_res, /* i: fractional resolution of the lag  Q0  */
    Word16 p[]        /* o: harmonic model                    Q13 */
@@ -231,6 +234,7 @@ int tcx_hm_render(
    FOR( k = 1; k <= kTcxHmParabolaHalfWidth; ++k )
    {
        p[kTcxHmParabolaHalfWidth + k] = round_fx( Mpy_32_16_1( BASOP_Util_InvLog2( L_shl( L_mult0( i_mult2( negate( k ), k ), tmp ), 10 ) ), height ) );
        move16();
    }
    /* Mirror */
    FOR( k = -kTcxHmParabolaHalfWidth; k < 0; ++k )
@@ -279,7 +283,7 @@ void tcx_hm_modify_envelope(
        l2 = s_min( add( k, kTcxHmParabolaHalfWidth ), L_frame_m1 );
        FOR( x = l1; x <= l2; ++x )
        {
            env[x] = Mpy_32_16_1( env[x], inv_shape[x - k + kTcxHmParabolaHalfWidth] );
            env[x] = Mpy_32_16_1( env[x], inv_shape[add( sub( x, k ), kTcxHmParabolaHalfWidth )] );
            move32();
        }

+3 −3
Original line number Diff line number Diff line
@@ -168,11 +168,11 @@ void powfp_odd2_evs(
        h = shl( 1, k ); /* highest bit of exp2 */
        out2 = base;
        move16();
        out = mult_r( out, pows[k + 1] ); /* we already know that "exp" has the highest bit set to one since we calculated .. */
        out = mult_r( out, pows[add( k, 1 )] ); /* we already know that "exp" has the highest bit set to one since we calculated .. */
        /* .. the effective length of "exp" earlier on, thus we omit the branch for out2 */
        if ( s_and( exp2, h ) != 0 )
        {
            out2 = mult_r( out2, pows[k + 1] );
            out2 = mult_r( out2, pows[add( k, 1 )] );
        }

        h = shr( h, 1 );
@@ -315,7 +315,7 @@ void tcx_arith_scale_envelope_flt(
    IF( tmp <= 0 )
    {
        tmp = 0;

        move16();
        FOR( k = 0; k < L_frame; k++ )
        {
            s_env[k] = 0;
+3 −0
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ void tcx_arith_scale_envelope(
    Word16 mean_e, tmp, tmp2;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif


@@ -264,6 +265,7 @@ void tcx_arith_scale_envelope(
    IF( tmp <= 0 )
    {
        tmp = 0;
        move16();
        set16_fx( s_env, 0, L_frame );
    }
    ELSE
@@ -429,6 +431,7 @@ void tcx_arith_scale_envelope(
        L_tmp = Mpy_32_16_1( L_shl( env[k], tmp ), iscale );
        L_tmp = L_min( L_tmp, a );
        s_env[k] = round_fx( L_tmp );
        move16();
    }
}

+2 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ void basop_lpc2mdct( Word16 *lpcCoeffs, Word16 lpcOrder, Word16 *mdct_gains, Wor
    /* short-cut, to avoid calling of BASOP_getTables() */
    ptwiddle = SineTable512_fx;
    step = 8;

    move16();
    /*ODFT*/
    assert( lpcOrder < FDNS_NPTS );

@@ -106,6 +106,7 @@ void basop_lpc2mdct( Word16 *lpcCoeffs, Word16 lpcOrder, Word16 *mdct_gains, Wor
    j = FDNS_NPTS - 1;
    k = 0;
    move16();
    move16();

    FOR( i = 0; i < FDNS_NPTS / 2; i++ )
    {
+3 −0
Original line number Diff line number Diff line
@@ -849,6 +849,8 @@ int16_t BitAllocWB(

    factor_fx[0] = 16384; /*Q13     move16(); */
    factor_fx[1] = 24576; /*Q13     move16(); */
    move16();
    move16();
    {
        R_diff_32_fx[0] = L_sub( Ravg_sub_32_fx[0], Ravg_sub_32_fx[1] );
        move32(); /*Q16 */
@@ -1013,6 +1015,7 @@ int16_t BitAllocWB(
    {
        L_tmp = L_add( L_tmp, Rsubband_buf[i] );         /*Q21 */
        R[i] = extract_h( L_shr( Rsubband_buf[i], 5 ) ); /*Q0 */
        move16();
    }
    t_fx = extract_h( L_shr( L_tmp, 5 ) ); /*Q0 */

Loading