Line data Source code
1 : /*==================================================================================== 2 : EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 3 : ====================================================================================*/ 4 : 5 : #include <stdint.h> 6 : #include "assert.h" 7 : #include "options.h" 8 : #include "prot_fx.h" 9 : #include "cnst.h" 10 : 11 : /** 12 : * \brief 31x16 Bit multiply (x*y) 13 : * 14 : * \param[i] xh high part, bit [30..15] 15 : * \param[i] xl low part, 15 LSBits 16 : * \param[i] y 17 : * 18 : * \return x*y 19 : */ 20 13853435 : Word32 L_multi31x16_X2( Word16 xh, Word16 xl, Word16 y ) 21 : { 22 : Word32 z; 23 : 24 13853435 : z = L_shl( L_mult0( xh, y ), 15 ); 25 13853435 : z = L_mac0( z, xl, y ); 26 : 27 13853435 : return z; 28 : } 29 : 30 : /*--------------------------------------------------------------- 31 : Ari 14 bits common routines 32 : -------------------------------------------------------------*/ 33 : 34 : /** 35 : * \brief Integer Multiply 36 : * 37 : * \param[i] r 38 : * \param[i] c 39 : * 40 : * \return r*c 41 : */ 42 104635154 : Word32 mul_sbc_14bits( 43 : Word32 r, /* Q0 */ 44 : Word16 c /* Q0 */ 45 : ) 46 : { 47 : Word32 ret; 48 : 49 : 50 : /* 51 : temp = (((int32) r)*((int32) c))>>stat_bitsnew; 52 : */ 53 : assert( stat_bitsnew == 14 ); 54 104635154 : ret = Mpy_32_16_1( L_shl( r, 15 - stat_bitsnew ), c ); 55 : 56 : /*assert( (((int) r)*((int) c))>>stat_bitsnew == ret);*/ 57 : 58 104635154 : return ( ret ); 59 : }