comparison libtwamr/mac_32.h @ 374:61047a2912a2

libtwamr: integrate mac_32.c
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 06 May 2024 04:09:45 +0000
parents
children
comparison
equal deleted inserted replaced
373:128ec87489b6 374:61047a2912a2
1 /*
2 ********************************************************************************
3 *
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
5 * R99 Version 3.3.0
6 * REL-4 Version 4.1.0
7 *
8 ********************************************************************************
9 *
10 * File : mac_32.h
11 * Purpose : 32 x 32 and 32 x 16 bit DPF multiy & accumulate
12 * (similar as Mpy_32 and Mpy_32_16 in oper_32b.c)
13 *
14 ********************************************************************************
15 */
16
17 /*
18 ********************************************************************************
19 * MODULE INCLUDE FILE AND VERSION ID
20 ********************************************************************************
21 */
22 #ifndef mac_32_h
23 #define mac_32_h "$Id $"
24
25 /*
26 ********************************************************************************
27 * INCLUDE FILES
28 ********************************************************************************
29 */
30 #include "typedef.h"
31
32 /*
33 ********************************************************************************
34 * PUBLIC PROGRAM CODE
35 ********************************************************************************
36 */
37
38 /*****************************************************************************
39 * Function Mac_32() *
40 * *
41 * Multiply two 32 bit integers (DPF) and accumulate with (normal) 32 bit *
42 * integer. The multiplication result is divided by 2**31 *
43 * *
44 * L_32 = L_32 + (hi1*hi2)<<1 + ( (hi1*lo2)>>15 + (lo1*hi2)>>15 )<<1 *
45 * *
46 * This operation can also be viewed as the multiplication of two Q31 *
47 * number and the result is also in Q31. *
48 * *
49 * Arguments: *
50 * *
51 * hi1 hi part of first number *
52 * lo1 lo part of first number *
53 * hi2 hi part of second number *
54 * lo2 lo part of second number *
55 * *
56 *****************************************************************************
57 */
58
59 Word32 Mac_32 (Word32 L_32, Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2);
60
61 /*****************************************************************************
62 * Function Mac_32_16() *
63 * *
64 * Multiply a 16 bit integer by a 32 bit (DPF) and accumulate with (normal)*
65 * 32 bit integer. The multiplication result is divided by 2**15 *
66 * *
67 * *
68 * L_32 = L_32 + (hi1*lo2)<<1 + ((lo1*lo2)>>15)<<1 *
69 * *
70 * Arguments: *
71 * *
72 * hi hi part of 32 bit number. *
73 * lo lo part of 32 bit number. *
74 * n 16 bit number. *
75 * *
76 *****************************************************************************
77 */
78
79 Word32 Mac_32_16 (Word32 L_32, Word16 hi, Word16 lo, Word16 n);
80
81 #endif