You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/g191.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,17 +12,31 @@ Please refer to the official Recommendation ITU-T G.191 for the complete text: [
12
12
13
13
Recommendation ITU-T G.191 provides source code for speech and audio processing modules for narrowband, wideband and super-wideband telephony applications. The set includes codecs, filters, noise generators.
14
14
15
-
This edition introduces changes to Annex A, which describes the ITU-T Software Tools (STL) containing a high-quality, portable C code library for speech processing applications. This release of the STL, also known as STL2023, incorporates:
15
+
This edition introduces changes to Annex A, which describes the ITU-T Software Tools (STL) containing a high-quality, portable C code library for speech processing applications. This release of the STL, also known as STL2024, incorporates:
16
16
17
-
*An implementation of P.50 fullband MNRU as described in ITU-T P.810.
17
+
*BS1770demo improvements:
18
18
19
-
* A tool for automatic instrumentation of speech and audio codecs to measure their computational complexity and memory.
19
+
- a new RMS option disabling the gating function for background noise measurement,
20
20
21
-
Recommendation ITU-T G.191 includes an electronic attachment containing STL2023 and manual.
21
+
- the handling of the edge case where all gating blacks are below -70 LKFS,
22
+
23
+
- improved reporting with scaling factor being reported in the linear and log domains.
24
+
25
+
* WMC Tool updates:
26
+
27
+
- New command line parameter to allow control on the number of frames per second (default still 50)
28
+
29
+
- Export information on all memory allocations occurring during runtime
30
+
31
+
- Example script for graphical analysis and profiling of dymanic memory allocation
32
+
33
+
- Bugs fixes and code improvements
34
+
35
+
Recommendation ITU-T G.191 includes an electronic attachment containing STL2024 and manual.
Copy file name to clipboardExpand all lines: doc/manual/bs1770demo.tex
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -103,12 +103,18 @@ \section{Description of the Algorithm}
103
103
\texttt{fabs( 1.0 - fac / last\_fac ) \textless RELATIVE\_DIFF}, where \texttt{RELATIVE\_DIFF = 0.0001} or when the maximum number of iterations \texttt{MAX\_ITERATIONS = 10}
104
104
has been reached.
105
105
106
+
When measuring the loudness of signals with a large dynamic range, it may be desirable to disable the gating function
107
+
to obtain the level considering the full signal. This is useful e.g. for noise level adjustment in listening tests
108
+
including added background noise. For this reason, the gating function may be disabled using an RMS (Root-Mean-Square)
109
+
energy measurement option \texttt{-rms}. Note that this feature is not part of \cite{BS1770}.
Copy file name to clipboardExpand all lines: doc/manual/intro.tex
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,8 @@ \chapter{Introduction}
29
29
30
30
In 2023, STL release incorporates an implementation of P.50 fullband MNRU as described in ITU-T Rec. P.810, as well as WMC tool, a tool for automatic instrumentation of speech and audio codecs to measure their computational complexity and memory.
31
31
32
+
In 2024, the revision of the STL offers additional features and bug fixes to the BS.1770 demo and WMC tool.
33
+
32
34
Since STL2019, the build toolchain uses CMake to generate platform-dependent and tool-dependent build scripts as well as to execute regression tests for each module in the STL.
33
35
Modules have been tested on Windows, MacOS and several Linux flavors.
34
36
@@ -191,6 +193,8 @@ \section{Acknowledgements}
191
193
192
194
For the STL2023, the implementation of the P.50 Fullband MNRU was kindly provided by Mrs Anna Llagostera and Mr Jens Berger from SwissQual AG/Rohde \& Schwarz, with a contribution from NTT on filter routines, the integration into the existing MNRU code and documentation from Ludovic Malfait, and the DC filter and amplitude clipping improvement suggestions from Anssi Ramo (Nokia). The implementation of the WMC tool was kindly provided by Mr Guy Richard and Mr Vladimir Malenovsky from VoiceAge Corporation.
193
195
196
+
For the STL2024, the improvements to BS.1770 demo and WMC Tool were kindly provided by Mr Erik Norvell from Ericsson and Mr Vladimir Malenovsky from VoiceAge Corporation respectively.
197
+
194
198
Above all, special thank goes to ITU-T SG16 Counselor Mr~Sim\~ao Ferraz de Campos Neto, the ``father'' of the STL.
Copy file name to clipboardExpand all lines: doc/manual/wmc_tool.tex
+58-7Lines changed: 58 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -56,8 +56,11 @@ \subsection{Usage}
56
56
note: filename shall point to a .c file containing the print_mem() function
57
57
-b [--no-backup]: no backup of original files
58
58
-c dirname [--generate-wmc-files dirname]: copy wmc_auto.h and wmc_auto.c to a user-specified directory
59
+
-f value [--frames-per-second value]: set the number of frames per second (default 50.0)
59
60
\end{Verbatim}
60
61
62
+
The optional command-line parameters may be used to control either the instrumentation or the couting process. With the \verb|-i| optional argument the WMC tool prints the list of functions that are instrumented. It doesn't run the WMC tool. The parameter \verb|-d| runs the des-instrumentation phase only. The des-instrumentation phase removes all meta-information that has been previously added to the source code with the WMC tool. When \verb|-m| argument is provided the WMC tool adds code calculating ROM and RAM memory consumption and fills the \verb|print_mem()| function to print the statistics about memory usage. When \verb|-m| is provided the user needs to specify the name of the \verb|.c| file containing the \verb|print_mem()| function. The parameter \verb|-b| instructs the WMC tool not to create backup copies of the instrumented \verb|.c| files. The parameter \verb|-c| copies the control files \verb|wmc_auto.h| and \verb|wmc_auto.c| to a user-specified directory. The control files must be added to the project for calculating the complexity and memory consumption of all instrumented source files. The \verb|-f| parameter allows the users to override the default values for the number of frames per second. This value is important for the correct calculation of complexity in "WMOPS".
63
+
61
64
\subsection{Instrumentation process}
62
65
\label{ch:instrumentation_process}
63
66
@@ -107,7 +110,9 @@ \subsubsection{Warnings}
107
110
\section{Instrumentation of complexity}
108
111
\label{ch:instrumentation_of_complexity}
109
112
110
-
The WMC tool only instruments functions but not macros. System functions and functions with names that are considered as basic operations are skipped. The instrumentation mechanism has been designed to be as least intrusive as possible. The instrumentation code is inserted at the beginning of each instrumented line in the source code with a single macro that has the following form \verb|$("ops")| where \verb|ops| is a string of letters and symbols indicating individual operations. The WMC tool parses each source file and calculates the length of each instrumentation string. The maximum length is then used to indent the entire source file to make space for the instrumentation strings. This is shown in the example below.
113
+
The instrumentation mechanism has been designed to minimize intrusiveness. It skips system functions and functions labeled as basic operations. When instrumenting \verb|.c| source files, the WMC tool omits macros by default. However, it detects macros defined within the same \verb|.c| source file using the \verb|#define| pragma. Macros defined in external header files and included using \verb|#include| pragma cannot be directly detected. To address this, the instrumentation mechanism employs a heuristic: if a string contains more than 70\% capital letters, it's treated as a macro and skipped during instrumentation.
114
+
115
+
The instrumentation code is integrated at the start of every instrumented line in the source code using a singular macro format: \verb|$("ops")|, where \verb|ops| represents a string encompassing individual operations denoted by letters and symbols. Upon parsing each source file, the WMC tool computes the length of each instrumentation string. Subsequently, the maximum length determines the indentation of the entire source file to accommodate the instrumentation strings, as illustrated in the example below.
111
116
112
117
\begin{Verbatim}[fontsize=\small]
113
118
float calc_shift_value( const float totalStep )
@@ -125,13 +130,13 @@ \section{Instrumentation of complexity}
125
130
}
126
131
\end{Verbatim}
127
132
128
-
It is always possible to remove the instrumentation from the source code with the \verb|-d| command line option. In many cases, the source file will then return to its original non-instrumented state except for whitespace characters and text alignment. The un-instrumentation process is also invoked automatically by the WMC tool as the first step in the instrumentation process. This ensures that the results are identical even when the process is repeated multiple times. This allows the users to make modifications to an already instrumented source code by simply re-instrumenting it again. Note, that the un-instrumentation process does not remove the functions \verb|push_wmops()| and \verb|pop_wmops()| and the system functions. Lines that are preceded by
133
+
The removal of instrumentation from the source code can be achieved using the \verb|-d| command line option. In many instances, executing this option restores the source file to its original non-instrumented state, with the exception of whitespace characters and text alignment. The un-instrumentation process is automatically triggered by the WMC tool as the initial step in the instrumentation procedure. This ensures consistent results even with repeated executions. Consequently, users can modify previously instrumented source code by simply re-instrumenting it. It's important to note that the un-instrumentation process does not eliminate the \verb|push_wmops()| and \verb|pop_wmops()| functions, nor does it remove system functions. Lines preceded by
129
134
130
135
{
131
136
{\em /*AddedByWMC\_Tool*/}
132
137
}
133
138
134
-
are removed completely. At the end of the un-instrumentation process, the original indentation is restored.
139
+
are removed completely. At the end of the un-instrumentation process the original indentation is restored.
135
140
136
141
If, for any reason, it is necessary to avoid the automatic instrumentation and un-instrumentation of certain parts in the source code, the user may encapsulate such parts in \verb|#define WMC_TOOL_SKIP| \ldots\verb|#undef WMC_TOOL_SKIP| macro pairs. For example
All user-defined functions in the source code are instrumented with one or more underscore '\verb|_|' symbols appended to their names. The WMC tool will count the number of arguments from the function call and insert a wrapper macro at the top of the source file, after the first \verb|#include| section. See the example below.
246
+
All user-defined functions in the source code are instrumented with one or more underscore '\verb|_|' symbols appended to their names. The WMC tool counts the number of arguments in function calls and inserts a wrapper macro at the top of the source file, after the first \verb|#include| section. See the example below.
The WMC tool appends an additional underscore symbol '\verb|_|' in each variant of the user-defined function call. This means that if a function is defined to accept a variable number of arguments the first function call will have one underscore symbol '\verb|_|' appended to its name, the second function call will have two underscore symbols '\verb|__|' appended to its name and so on. The WMC tool supports up to 10 variants (different number of arguments) of the same function.
268
276
277
+
The WMC tool may encounter difficulties in properly instrumenting one-line functions that are defined as follows
In a local function, all declared variables should be positioned at the start of the function body. Additionally, the initialization of local variables should be segregated from their declaration. For instance, consider the following code snippet, where the WMC tool inserts \verb|$("M")| before \verb|int ch = 0;|
293
+
294
+
\begin{Verbatim}[fontsize=\small]
295
+
int free_structs(MY_STRUCT_INFO *ptr_dec)
296
+
{
297
+
if (ptr_dec == NULL) return -1;
298
+
299
+
$("M") int ch = 0;
300
+
301
+
for (ch = 0; ch < n_channels; ch++)
302
+
{
303
+
struct_free(&decoder->cfg[ch]->fft_buf);
304
+
struct_free(&decoder->cfg[ch]->ifft_buf);
305
+
}
306
+
307
+
return 0;
308
+
}
309
+
\end{Verbatim}
310
+
311
+
Compiling the instrumented code provided above results in the following error (gcc):
312
+
313
+
\begin{Verbatim}[fontsize=\small]
314
+
lib_thj/struct_f.c:373:17: error: expected expression before ‘int’
It was already shown in the previous section in this document that it is possible to avoid the automatic instrumentation by encapsulating parts of the source code with
415
+
As demonstrated in the preceding section of this document, it's possible to bypass automatic instrumentation by encapsulating sections of the source code with
365
416
366
417
\begin{Verbatim}[fontsize=\small]
367
418
#define WMC_TOOL_SKIP
@@ -435,7 +486,7 @@ \subsection{Complexity of functions and functional blocks}
435
486
}
436
487
\end{Verbatim}
437
488
438
-
The string inside each \verb|push_wmops()| macro shall be unique in the entire project and reflect what is being measured. It does not need to be the same as the name of the function in which it is used. The macro \verb|pop_wmops()| must \textbf{ALWAYS} be used to terminate the complexity counters associated with each \verb|push_wmops()| macro. The WMC tool supports nesting of these macro pairs. Note, that the \verb|push_wmops()| and the \verb|pop_wmops()| macros do not need to be encapsulated within the \verb|#define WMC_TOOL_SKIP| \ldots\verb|#undef WMC_TOOL_SKIP| macro pairs.
489
+
The \verb|push_wmops()| macro must be placed after the declaration of local variables. The string inside each \verb|push_wmops()| macro shall be unique in the entire project and reflect what is being measured. It does not need to be the same as the name of the function in which it is used. The macro \verb|pop_wmops()| must \textbf{ALWAYS} be used to terminate the complexity counters associated with each \verb|push_wmops()| macro. The WMC tool supports nesting of these macro pairs. Note, that the \verb|push_wmops()| and the \verb|pop_wmops()| macros do not need to be encapsulated within the \verb|#define WMC_TOOL_SKIP| \ldots\verb|#undef WMC_TOOL_SKIP| macro pairs.
0 commit comments