Commit 1299c05d authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'basop_lib_com_optimizations_1' into 'main'

BASOP and instrumentation changes, optimizations

See merge request !470
parents af8cb9bd 995ba508
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1583,6 +1583,22 @@ Word16 idiv1616( Word16 x, Word16 y )
    return y;
}

Word16 idiv1616_1( Word16 x, Word16 y )
{
    IF( L_mult0( x, y ) < 0 )
    {
        return negate( idiv1616( abs_s( x ), abs_s( y ) ) );
    }
    ELSE IF( L_mult0( x, y ) > 0 )
    {
        return idiv1616( x, y );
    }
    ELSE
    {
        return 0;
    }
}

Word32 norm_llQ31(               /* o : normalized result              Q31 */
                   Word32 L_c,   /* i : upper bits of accu             Q-1 */
                   Word32 L_sum, /* i : lower bits of accu, unsigned   Q31 */
+2 −0
Original line number Diff line number Diff line
@@ -582,6 +582,8 @@ Word16 idiv1616U( Word16 x, Word16 y );

Word16 idiv1616( Word16 x, Word16 y );

Word16 idiv1616_1( Word16 x, Word16 y );

/*------------------------------------------------------------------*
 * Dot_product16HQ:
 *
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ void bitallocsum_fx(
        total = add( total, tmp );
    }
    *sum = total;
    move16();

    IF( LE_16( length, L_FRAME32k ) )
    {
@@ -49,6 +50,7 @@ void bitallocsum_fx(
                move16();
                diff = sub( diff, 1 );
                *sum = add( *sum, 1 );
                move16();
            }
            i = add( i, 1 );
            if ( GE_16( i, nb_sfm ) )
+573 −289

File changed.

Preview size limit exceeded, changes collapsed.

+49 −7
Original line number Diff line number Diff line
@@ -1947,6 +1947,38 @@ uint16_t get_indice(
 *-------------------------------------------------------------------*/

/*! r: value of the indice */
#ifdef IVAS_FLOAT_FIXED
UWord16 get_indice_st(
    Decoder_State *st,          /* i/o: decoder state structure                 */
    const Word32 element_brate, /* i  : element bitrate                         */
    const Word16 pos,           /* i  : absolute position in the bitstream      */
    const Word16 nb_bits        /* i  : number of bits to quantize the indice   */
)
{
    UWord16 value;
    Word16 i;

    assert( nb_bits <= 16 );

    /* detect corrupted bitstream */
    IF( GT_32( L_deposit_l( add( pos, nb_bits ) ), Mpy_32_32( element_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ) )
    {
        st->BER_detect = 1;
        move16();
        return ( 0 );
    }

    value = 0;
    move16();
    FOR( i = 0; i < nb_bits; i++ )
    {
        value = shl( value, 1 );
        value = add( value, st->bit_stream[add( pos, i )] );
    }

    return value;
}
#else
uint16_t get_indice_st(
    Decoder_State *st,           /* i/o: decoder state structure                 */
    const int32_t element_brate, /* i  : element bitrate                         */
@@ -1975,7 +2007,8 @@ uint16_t get_indice_st(

    return value;
}

#endif
#ifndef IVAS_FLOAT_FIXED
/*-------------------------------------------------------------------*
 * get_indice_1()
 *
@@ -1999,7 +2032,7 @@ uint16_t get_indice_1(

    return st->bit_stream[pos];
}

#endif
#define WMC_TOOL_SKIP

/*-------------------------------------------------------------------*
@@ -2031,15 +2064,24 @@ void reset_indices_enc(
 *
 * Reset the buffer of decoder indices
 *-------------------------------------------------------------------*/

#ifdef IVAS_FLOAT_FIXED
void reset_indices_dec(
    Decoder_State *st )
{
    st->next_bit_pos = 0;
    move16();

    return;
}
#else
void reset_indices_dec(
    Decoder_State *st )
{
    st->next_bit_pos = 0;

    return;
}
#endif
/*-------------------------------------------------------------------*
 * write_indices_to_stream()
 *
@@ -2269,7 +2311,7 @@ ivas_error write_indices_ivas(
    return error;
}


#ifndef IVAS_FLOAT_FIXED
/*---------------------------------------------------------------------*
 * convertSerialToBytestream( )
 *
@@ -2318,7 +2360,7 @@ void convertBytestreamToSerial(
        serial[i] = ( bytestream[( i >> 3 )] >> ( 7 - ( i & 7 ) ) ) & 0x1;
    }
}

#endif
/*-------------------------------------------------------------------*
 * decoder_selectCodec()
 *
@@ -3053,7 +3095,7 @@ ivas_error read_indices(

    return error;
}

#ifndef IVAS_FLOAT_FIXED
/*-------------------------------------------------------------------*
 * get_rfFrameType()
 *
@@ -3471,5 +3513,5 @@ void dtx_read_padding_bits(

    return;
}

#endif
#undef WMC_TOOL_SKIP
Loading