1mlib_MatrixMulShift_S16_S16m_eMdoida(L3iMbLILBi)brarmyliFbu_nMcattiroinxsMulShift_S16_S16_Mod(3MLIB)
2
3
4
6 mlib_MatrixMulShift_S16_S16_Mod, mlib_MatrixMulShift_S16_S16_Sat,
7 mlib_MatrixMulShift_S16C_S16C_Mod, mlib_MatrixMulShift_S16C_S16C_Sat -
8 matrix multiplication plus shifting
9
11 cc [ flag... ] file... -lmlib [ library... ]
12 #include <mlib.h>
13
14 mlib_status mlib_MatrixMulShift_S16_S16_Mod(mlib_s16 *z,
15 const mlib_s16 *x, const mlib_s16 *y, mlib_s32 m,
16 mlib_s32 l, mlib_s32 n, mlib_s32 shift);
17
18
19 mlib_status mlib_MatrixMulShift_S16_S16_Sat(mlib_s16 *z,
20 const mlib_s16 *x, const mlib_s16 *y, mlib_s32 m,
21 mlib_s32 l, mlib_s32 n, mlib_s32 shift);
22
23
24 mlib_status mlib_MatrixMulShift_S16C_S16C_Mod(mlib_s16 *z,
25 const mlib_s16 *x, const mlib_s16 *y, mlib_s32 m,
26 mlib_s32 l, mlib_s32 n, mlib_s32 shift);
27
28
29 mlib_status mlib_MatrixMulShift_S16C_S16C_Sat(mlib_s16 *z,
30 const mlib_s16 *x, const mlib_s16 *y, mlib_s32 m,
31 mlib_s32 l, mlib_s32 n, mlib_s32 shift);
32
33
35 Each of these functions performs a multiplication of two matrices and
36 shifts the result.
37
38
39 For real data, the following equation is used:
40
41 l-1
42 z[i*n + j] = {SUM (x[i*l + k] * y[k*n + j])} * 2**(-shift)
43 k=0
44
45
46
47 where i = 0, 1, ..., (m - 1); j = 0, 1, ..., (n - 1).
48
49
50 For complex data, the following equation is used:
51
52 l-1
53 z[2*(i*n + j)] = {SUM (xR*yR - xI*yI)} * 2**(-shift)
54 k=0
55
56 l-1
57 z[2*(i*n + j) + 1] = {SUM (xR*yI + xI*yR)} * 2**(-shift)
58 k=0
59
60
61
62 where
63
64 xR = x[2*(i*l + k)]
65 xI = x[2*(i*l + k) + 1]
66 yR = y[2*(k*n + j)]
67 yI = y[2*(k*n + j) + 1]
68 i = 0, 1, ..., (m - 1)
69 j = 0, 1, ..., (n - 1)
70
71
73 Each of the functions takes the following arguments:
74
75 z Pointer to the first element of the result matrix, in row
76 major order.
77
78
79 x Pointer to the first element of the first matrix, in row major
80 order.
81
82
83 y Pointer to the first element of the second matrix, in row
84 major order.
85
86
87 m Number of rows in the first matrix. m > 0.
88
89
90 l Number of columns in the first matrix, and the number of rows
91 in the second matrix. l > 0.
92
93
94 n Number of columns in the second matrix. n > 0.
95
96
97 shift Right shifting factor. 1 ≤ shift ≤ 16.
98
99
101 Each of the functions returns MLIB_SUCCESS if successful. Otherwise it
102 returns MLIB_FAILURE.
103
105 See attributes(5) for descriptions of the following attributes:
106
107
108
109
110 ┌─────────────────────────────┬─────────────────────────────┐
111 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
112 ├─────────────────────────────┼─────────────────────────────┤
113 │Interface Stability │Committed │
114 ├─────────────────────────────┼─────────────────────────────┤
115 │MT-Level │MT-Safe │
116 └─────────────────────────────┴─────────────────────────────┘
117
119 mlib_MatrixMul_U8_U8_Mod(3MLIB), attributes(5)
120
121
122
123SunOS 5.11 2 Mar 2m0l0i7b_MatrixMulShift_S16_S16_Mod(3MLIB)