1mlib_SignalLimit(3MLIB) mediaLib Library Functions mlib_SignalLimit(3MLIB)
2
3
4
6 mlib_SignalLimit, mlib_SignalLimit_S16_S16, mlib_SignalLimit_S16S_S16S,
7 mlib_SignalLimit_S16, mlib_SignalLimit_S16S, mlib_SignalLimit_F32_F32,
8 mlib_SignalLimit_F32S_F32S, mlib_SignalLimit_F32, mlib_SignalLimit_F32S
9 - signal hard limiting
10
12 cc [ flag... ] file... -lmlib [ library... ]
13 #include <mlib.h>
14
15 mlib_status mlib_SignalLimit_S16_S16(mlib_s16 *dst,
16 const mlib_s16 *src, const mlib_s16 *low,
17 const mlib_s16 *high, mlib_s32 n);
18
19
20 mlib_status mlib_SignalLimit_S16S_S16S(mlib_s16 *dst,
21 const mlib_s16 *src, const mlib_s16 *low,
22 const mlib_s16 *high, mlib_s32 n);
23
24
25 mlib_status mlib_SignalLimit_S16(mlib_s16 *srcdst,
26 const mlib_s16 *low, const mlib_s16 *high, mlib_s32 n);
27
28
29 mlib_status mlib_SignalLimit_S16S(mlib_s16 *srcdst,
30 const mlib_s16 *low, const mlib_s16 *high, mlib_s32 n);
31
32
33 mlib_status mlib_SignalLimit_F32_F32(mlib_f32 *dst,
34 const mlib_f32 *src, const mlib_f32 *low,
35 const mlib_f32 *high, mlib_s32 n);
36
37
38 mlib_status mlib_SignalLimit_F32S_F32S(mlib_f32 *dst,
39 const mlib_f32 *src, const mlib_f32 *low,
40 const mlib_f32 *high, mlib_s32 n);
41
42
43 mlib_status mlib_SignalLimit_F32(mlib_f32 *srcdst,
44 const mlib_f32 *low, const mlib_f32 *high, mlib_s32 n);
45
46
47 mlib_status mlib_SignalLimit_F32S(mlib_f32 *srcdst,
48 const mlib_f32 *low, const mlib_f32 *high, mlib_s32 n);
49
50
52 Each of these functions performs hard limiting.
53
54
55 For monaural signals, the following equation is used:
56
57 dst[i] = low[0] if src[i] < low[0]
58 dst[i] = src[i] if low[0] ≤ src[i] < high[0]
59 dst[i] = high[0] if src[i] ≥ high[0]
60
61
62
63 where i = 0, 1, ..., (n - 1).
64
65
66 For stereo signals, the following equation is used:
67
68 dst[2*i] = low[0] if src[2*i] < low[0]
69 dst[2*i] = src[2*i] if low[0] ≤ src[2*i] < high[0]
70 dst[2*i] = high[0] if src[2*i] ≥ high[0]
71
72 dst[2*i+1] = low[1] if src[2*i+1] < low[1]
73 dst[2*i+1] = src[2*i+1] if low[1] ≤ src[2*i+1] < high[1]
74 dst[2*i+1] = high[1] if src[2*i+1] ≥ high[1]
75
76
77
78 where i = 0, 1, ..., (n - 1).
79
81 Each of the functions takes some of the following arguments:
82
83 dst Destination signal array.
84
85
86 src Source signal array.
87
88
89 srcdst Source and destination signal array.
90
91
92 low Lower input limit. In the stereo version, low[0] contains the
93 lower limit for channel 0, and low[1] contains the lower
94 limit for channel 1.
95
96
97 high Upper input limit. In the stereo version. high[0] contains
98 the upper limit for channel 0, and high[1] contains the upper
99 limit for channel 1.
100
101
102 n Number of samples in the source signal array.
103
104
106 Each of the functions returns MLIB_SUCCESS if successful. Otherwise it
107 returns MLIB_FAILURE.
108
110 See attributes(5) for descriptions of the following attributes:
111
112
113
114
115 ┌─────────────────────────────┬─────────────────────────────┐
116 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
117 ├─────────────────────────────┼─────────────────────────────┤
118 │Interface Stability │Committed │
119 ├─────────────────────────────┼─────────────────────────────┤
120 │MT-Level │MT-Safe │
121 └─────────────────────────────┴─────────────────────────────┘
122
124 attributes(5)
125
126
127
128SunOS 5.11 2 Mar 2007 mlib_SignalLimit(3MLIB)