Commit 0c4f8790 authored by thomas dettbarn's avatar thomas dettbarn Committed by Manuel Jander
Browse files

updated the style to the standard of the rest of the code. the magic shifts...

updated the style to the standard of the rest of the code. the magic shifts have been explained. total   150.00  603.963 644.322 631.525
parent f684f168
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ static Word16 sns_1st_cod_fx(
    Word32 *snsq_fx /* o  : quantized sns    Q16 */
)
{
    IF( exp_sns == 15 )
    IF( exp_sns == Q15 )
    {
        Word16 index;
        const Word16 split_len = M / 2;
@@ -118,15 +118,12 @@ static Word16 sns_1st_cod_fx(
                {
                    Word32 tmp;
                    Word32 dist;
                    Word16 tmp2;

                    tmp = L_mult( *cdbk_ptr++, cdbk_fix ); // Q12-Q16
                    tmp = L_mult( *cdbk_ptr++, cdbk_fix ); // Q12->Q16
                    dist = L_sub( snsq_fx[j], tmp );       // Q16
                    dist = L_shr( dist, 4 );               // make sure that the next multiplication does not overflow

                    tmp2 = extract_l( dist );
                    dist = L_mult( tmp2, tmp2 );
                    dist = L_shr( dist, 4 ); // make sure that the sum does not overflow
                    dist = L_shl( dist, 11 ); // cdbk_ptr is a 16 bit LUT with 3.12 values, used as 3.16. assumption: snsq_fx has the same representation. thus, the subtraction results are in 4.16, which leaves 11 bit headroom.
                    dist = Mpy_32_32( dist, dist );
                    dist = L_shr( dist, 3 ); // make sure that the sum of 8 values does not overflow
                    dist_fx = L_add( dist_fx, dist );
                }