1
0
mirror of https://github.com/RPCS3/soundtouch.git synced 2024-11-10 04:42:50 +01:00

Updated for 1.4.0

This commit is contained in:
oparviai 2009-01-25 14:12:12 +00:00
parent 9d7952e56e
commit 4c4bcae5e2

View File

@ -18,10 +18,10 @@
</head>
<body class="normal">
<hr>
<h1>SoundTouch audio processing library v1.3.9 (1.4.0-pre)
<h1>SoundTouch audio processing library v1.4.0
</h1>
<p class="normal">SoundTouch library Copyright (c) Olli
Parviainen 2002-2008 </p>
Parviainen 2002-2009 </p>
<hr>
<h2>1. Introduction </h2>
<p>SoundTouch is an open-source audio
@ -47,47 +47,37 @@ data instead of 16bit integers. See section "sample data format"
for more information.</p>
<h3>2.1. Building in Microsoft Windows</h3>
<p>Project files for Microsoft Visual C++ 6.0 and Visual C++ .NET are
supplied with the source code package. Please notice that SoundTouch
library uses processor-specific optimiations for Pentium III and AMD
processors that require a processor pack upgrade for
the Visual Studio 6.0 to be installed in order to support these
optimiations. The processor pack upgrade can be downloaded from
supplied with the source code package.&nbsp;</p>
<p> Please notice that SoundTouch
library uses processor-specific optimizations for Pentium III and AMD
processors. Visual Studio .NET and later versions supports the required
instructions by default, but Visual Studio 6.0 requires a processor pack upgrade
to be installed in order to support these optimizations. The processor pack upgrade can be downloaded from
Microsoft site at this URL:</p>
<p><a
href="http://msdn.microsoft.com/vstudio/downloads/tools/ppack/default.aspx">
http://msdn.microsoft.com/vstudio/downloads/tools/ppack/default.aspx</a></p>
<p><a href="http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx">http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx</a></p>
<p>If the above URL is unavailable or removed, go
to <a href="http://msdn.microsoft.com/">http://msdn.microsoft.com</a>
and perform a search with keywords processor pack. </p>
<p>Visual Studio .NET supports required
instructions by default and thus doesn't require installing the
processor pack.</p>
<p>To build the binaries with Visual C++ 6.0
compiler, either run "make-win.bat" script or open the
and perform a search with keywords &quot;processor pack&quot;. </p>
<p>To build the binaries with Visual C++
compiler, either run &quot;make-win.bat&quot; script, or open the
appropriate project files in source code directories with Visual
Studio. The final executable will appear under the "SoundTouch\bin"
directory. If using the Visual Studio IDE instead of the
make-win.bat script, directories bin and
lib have to be created manually to the SoundTouch
lib may need to be created manually to the SoundTouch
package root for the final executables. The make-win.bat script
creates these directories automatically.
</p>
<p>Also other C++ compilers than Visual C++ can be
used, but project or makefiles then have to be adapted accordingly.
Performance optimiations are written in Visual C++ compatible
syntax, they may or may not be compatible with other compilers. If
using GCC (Gnu C Compiler) compiler package such as DJGPP or Cygwin,
please see next chapter for instructions. </p>
<h3>2.2. Building in Gnu platforms</h3>
<p>The SoundTouch library can be compiled in
practically any platform supporting GNU compiler (GCC) tools.
SoundTouch have been tested with gcc version 3.3.4., but it
shouldn't be very specific about the gcc version. Assembler-level
performance optimiations for GNU platform are currently available in
performance optimizations for GNU platform are currently available in
x86 platforms only, they are automatically disabled and replaced with
standard C routines in other processor platforms.</p>
<p>To build and install the binaries, run the
following commands in SoundTouch/ directory:</p>
following commands in the SoundTouch/ directory:</p>
<table border="0" cellpadding="0" cellspacing="4">
<tbody>
<tr valign="top">
@ -121,14 +111,13 @@ binaries to the destination locations.</p>
</tr>
</tbody>
</table>
<p><b>NOTE:</b> At the time of release the SoundTouch package has been
<p><b>NOTE:</b> At the release time the SoundTouch package has been
tested
to compile in GNU/Linux platform. However, in past it's happened that
new
gcc versions aren't necessarily compatible with the assembler setttings
used in the optimied routines. <b>If you have problems getting the
SoundTouch library compiled, try the workaround of disabling the
optimiations</b> by editing the file "include/STTypes.h" and removing
used in the optimized routines. <b>If you have problems getting the
SoundTouch library compiled, try the workaround of disabling the optimizations</b> by editing the file "include/STTypes.h" and removing
the following definition there:</p>
<blockquote>
<pre>#define ALLOW_OPTIMIZATIONS 1</pre>
@ -142,7 +131,7 @@ default is 32bit floating point. </p>
<p>
In Windows environment, the sample data format is chosen
in file "STTypes.h" by choosing one of the following
in file &quot;STTypes.h&quot; by choosing one of the following
defines:</p>
<ul>
<li><span style="font-weight: bold;">#define INTEGER_SAMPLES</span>
@ -194,8 +183,7 @@ effects, <em>sample rate transposing</em> and <em>time-stretching</em>.</p>
<p><em>Sample rate transposing</em> affects
both the audio stream duration and pitch. It's implemented simply
by converting the original audio sample stream to the&nbsp; desired
duration by interpolating from the original audio samples. In
SoundTouch, linear interpolation with anti-alias filtering is
duration by interpolating from the original audio samples. In SoundTouch, linear interpolation with anti-alias filtering is
used. Theoretically a higher-order interpolation provide better
result than 1st order linear interpolation, but in audio
application linear interpolation together with anti-alias
@ -228,7 +216,7 @@ original duration but increased pitch.</li>
</ul>
<h3>3.4 Tuning the algorithm parameters</h3>
<p>The time-stretch algorithm has few
parameters that can be tuned to optimie sound quality for
parameters that can be tuned to optimize sound quality for
certain application. The current default parameters have been
chosen by iterative if-then analysis (read: "trial and error")
to obtain best subjective sound quality in pop/rock music
@ -236,10 +224,10 @@ processing, but in applications processing different kind of
sound the default parameter set may result into a sub-optimal
result.</p>
<p>The time-stretch algorithm default
parameter values are set by these #defines in file "TDStretch.h":</p>
parameter values are set by these #defines in file &quot;TDStretch.h&quot;:</p>
<blockquote>
<pre>#define DEFAULT_SEQUENCE_MS 82
#define DEFAULT_SEEKWINDOW_MS 28
<pre>#define DEFAULT_SEQUENCE_MS AUTOMATIC
#define DEFAULT_SEEKWINDOW_MS AUTOMATIC
#define DEFAULT_OVERLAP_MS 12</pre>
</blockquote>
<p>These parameters affect to the time-stretch
@ -251,13 +239,16 @@ which determines the how the original sound is chopped in
the time-stretch algorithm. Larger values mean fewer sequences
are used in processing. In principle a larger value sounds better when
slowing down the tempo, but worse when increasing the tempo and vice
versa.<br>
versa.&nbsp;<br>
<br>
By default, this setting value is calculated automatically according to
tempo value.<br>
</li>
<li><strong>DEFAULT_SEEKWINDOW_MS</strong>: The seeking window
default length in milliseconds is for the algorithm that seeks the best
possible overlapping location. This determines from how
wide a sample "window" the algorithm can use to find an optimal mixing
location when the sound sequences are to be linked back together.<br>
location when the sound sequences are to be linked back together.&nbsp;<br>
<br>
The bigger this window setting is, the higher the possibility to find a
better mixing position becomes, but at the same time large values may
@ -265,6 +256,9 @@ cause a "drifting" sound artifact because neighboring sequences can be
chosen at more uneven intervals. If there's a disturbing artifact that
sounds as if a constant frequency was drifting around, try reducing
this setting.<br>
<br>
By default, this setting value is calculated automatically according to
tempo value.<br>
</li>
<li><strong>DEFAULT_OVERLAP_MS</strong>: Overlap
length in milliseconds. When the sound sequences are mixed back
@ -290,9 +284,7 @@ magnitude</strong></td>
affects...</strong></td>
<td valign="top"><strong>Smaller value
affects...</strong></td>
<td valign="top"><strong>Music</strong></td>
<td valign="top"><strong>Speech</strong></td>
<td valign="top"><strong>Effect in CPU burden</strong></td>
<td valign="top"><strong>Effect to CPU burden</strong></td>
</tr>
<tr>
<td valign="top">
@ -306,9 +298,6 @@ better for slowing down tempo. Growing the value decelerates the
<td valign="top">Smaller value might be better
for speeding up tempo. Reducing the value accelerates the "echoing"
artifact when slowing down the tempo </td>
<td valign="top">Default value usually good</td>
<td valign="top">A smaller value than default
might be better</td>
<td valign="top">Increasing the parameter
value reduces computation burden</td>
</tr>
@ -322,9 +311,6 @@ large, chosen for slowing down music tempo</td>
good mixing position, but may cause a "drifting" artifact</td>
<td valign="top">Smaller reduce possibility to
find a good mixing position, but reduce the "drifting" artifact.</td>
<td valign="top">Default value usually good,
unless a "drifting" artifact is disturbing.</td>
<td valign="top">Default value usually good</td>
<td valign="top">Increasing the parameter
value increases computation burden</td>
</tr>
@ -337,15 +323,13 @@ large, chosen to suit with above parameters.</td>
<td valign="top">&nbsp;</td>
<td valign="top">If you reduce the "sequence
ms" setting, you might wish to try a smaller value.</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">Increasing the parameter
value increases computation burden</td>
</tr>
</tbody>
</table>
<h3>3.5 Performance Optimiations </h3>
<p><strong>General optimiations:</strong></p>
<h3>3.5 Performance Optimizations </h3>
<p><strong>General optimizations:</strong></p>
<p>The time-stretch routine has a 'quick' mode
that substantially speeds up the algorithm but may degrade the
sound quality by a small amount. This mode is activated by
@ -354,34 +338,55 @@ of SETTING_USE_QUICKSEEK and value "1", i.e. </p>
<blockquote>
<p>setSetting(SETTING_USE_QUICKSEEK, 1);</p>
</blockquote>
<p><strong>CPU-specific optimiations:</strong></p>
<p><strong>CPU-specific optimizations:</strong></p>
<ul>
<li>Intel MMX optimied routines are used with
compatible CPUs when 16bit integer sample type is used. MMX
optimiations are available both in Win32 and Gnu/x86 platforms.
<li>Intel MMX optimized routines are used with
compatible CPUs when 16bit integer sample type is used. MMX optimizations are available both in Win32 and Gnu/x86 platforms.
Compatible processors are Intel PentiumMMX and later; AMD K6-2, Athlon
and later. </li>
<li>Intel SSE optimied routines are used with
compatible CPUs when floating point sample type is used. SSE
optimiations are currently implemented for Win32 platform only.
<li>Intel SSE optimized routines are used with
compatible CPUs when floating point sample type is used. SSE optimizations are currently implemented for Win32 platform only.
Processors compatible with SSE extension are Intel processors starting
from Pentium-III, and AMD processors starting from Athlon XP. </li>
<li>AMD 3DNow! optimied routines are used with
<li>AMD 3DNow! optimized routines are used with
compatible CPUs when floating point sample type is used, but SSE
extension isn't supported . 3DNow! optimiations are currently
implemented for Win32 platform only. These optimiations are used in
extension isn't supported . 3DNow! optimizations are currently
implemented for Win32 platform only. These optimizations are used in
AMD K6-2 and Athlon (classic) CPU's; better performing SSE routines are
used with AMD processor starting from Athlon XP. </li>
</ul>
<h3>3.6 GNU compilation issues </h3>
<p><b>Required GNU tools</b>&nbsp;</p>
<p> Bash shell, GNU C++ compiler, autoconf and automake tools are required to compile
the SoundTouch library. These are usually included in the Linux distribution, but if
not, install these packages. For example, in Ubuntu these can be acquired and
installed in the &quot;build-essentials&quot; package by the following command:</p>
<pre><b>sudo apt-get install build-essential</b></pre>
<p><b>Problems with configure script or build process</b>&nbsp;</p>
<p>Due differences between various GNU toolchain versions, you may get errors when running the &quot;configure&quot; script or building the source
codes, if your GNU tool versions are not compatible with the versions used for
preparing the SoundTouch kit.&nbsp;</p>
<p>In such case, regenerate the configure script with your local tools by running
the &quot;<b>./bootstrap</b>&quot; script included in the SoundTouch source code
kit. After that, run the <b>configure</b> script and <b>make</b> as usually.</p>
<p><b>Compiler issues with non-x86 processors</b></p>
<p>SoundTouch works also on non-x86 processors.</p>
<p>However, in case that you get compiler errors when compiling for non-Intel processor,
then edit the file
&quot;<b>source\SoundTouch\Makefile.am</b>&quot; and remove the &quot;<b>-msse2</b>&quot;
flag on the <b>AM_CXXFLAGS </b>line:</p>
<pre><b>AM_CXXFLAGS=-O3 -fcheck-new -I../../include&nbsp;&nbsp;&nbsp; # Note: -msse2 flag removed!</b></pre>
<p>After that, run &quot;<b>./bootstrap</b>&quot; script, and then run <b>configure</b>
and <b>make</b> again.</p>
<hr>
<h2><a name="SoundStretch"></a>4. SoundStretch audio processing utility
</h2>
<p>SoundStretch audio processing utility<br>
Copyright (c) Olli Parviainen 2002-2005</p>
Copyright (c) Olli Parviainen 2002-2009</p>
<p>SoundStretch is a simple command-line
application that can change tempo, pitch and playback rates of
WAV sound files. This program is intended primarily to
demonstrate how the "SoundTouch" library can be used to
demonstrate how the &quot;SoundTouch&quot; library can be used to
process sound in your own program, but it can as well be used for
processing sound files.</p>
<h3>4.1. SoundStretch Usage Instructions</h3>
@ -448,8 +453,8 @@ n percents (n = -95.0 .. +5000.0 %) </td>
<td valign="top">
<pre>-bpm=n</pre>
</td>
<td valign="top">Detect the Beats-Per-Minute
(BPM) rate of the sound and adjust the tempo to meet 'n' BPMs. When this switch is
<td valign="top">Detect the Beats-Per-Minute (BPM) rate of the sound and adjust the tempo to meet 'n'
BPMs. When this switch is
applied, the &quot;-tempo&quot; switch is ignored. If "=n" is
omitted, i.e. switch &quot;-bpm&quot; is used alone, then the BPM rate is
estimated and displayed, but tempo not adjusted according to the BPM
@ -532,13 +537,15 @@ estimates the BPM rate:</p>
<h2>5. Change History</h2>
<h3>5.1. SoundTouch library Change History </h3>
<p><strong>v1.3.9 (1.4.0 pre):</strong></p>
<p><strong>1.4.0:</strong></p>
<ul>
<li>Improved sound quality by automatic calculation of time stretch algorithm
processing parameters according to tempo setting</li>
<li>Moved BPM detection routines from SoundStretch application into SoundTouch
library</li>
<li>Bugfixes: Using uninitialied variables, GNU build scripts, compiler errors
<li>Bugfixes: Usage of uninitialied variables, GNU build scripts, compiler errors
due to 'const' keyword mismatch.</li>
<li>Some source code cleanup</li>
<li>Source code cleanup</li>
</ul>
@ -546,10 +553,10 @@ estimates the BPM rate:</p>
</strong></p>
<ul>
<li>Changed static class declaration to GCC 4.x compiler compatible syntax.</li>
<li>Enabled MMX/SSE-optimied routines also for GCC compilers. Earlier
the MMX/SSE-optimied routines were written in compiler-specific inline
<li>Enabled MMX/SSE-optimized routines also for GCC compilers. Earlier
the MMX/SSE-optimized routines were written in compiler-specific inline
assembler, now these routines are migrated to use compiler intrinsic
syntax which allows compiling the same MMX/SSE-optimied source code with
syntax which allows compiling the same MMX/SSE-optimized source code with
both Visual C++ and GCC compilers. </li>
<li>Set floating point as the default sample format and added switch to
the GNU configure script for selecting the other sample format.</li>
@ -563,13 +570,13 @@ the GNU configure script for selecting the other sample format.</li>
error </li>
<li>Implemented separate processing routines for integer and
floating arithmetic to allow improvements to floating point routines
(earlier used algorithms mostly optimied for integer arithmetic also
(earlier used algorithms mostly optimized for integer arithmetic also
for floating point samples) </li>
<li>Fixed a bug that distorts sound if sample rate changes during the
sound stream </li>
<li>Fixed a memory leak that appeared in MMX/SSE/3DNow! optimied
<li>Fixed a memory leak that appeared in MMX/SSE/3DNow! optimized
routines </li>
<li>Reduced redundant code pieces in MMX/SSE/3DNow! optimied
<li>Reduced redundant code pieces in MMX/SSE/3DNow! optimized
routines vs. the standard C routines.</li>
<li>MMX routine incompatibility with new gcc compiler versions </li>
<li>Other miscellaneous bug fixes </li>
@ -587,8 +594,7 @@ SAMPLETYPE definitions.</li>
<p><strong>v1.2.0: </strong></p>
<ul>
<li>Added support for 32bit floating point sample
data type with SSE/3DNow! optimiations for Win32 platform (SSE/3DNow!
optimiations currently not supported in GCC environment)</li>
data type with SSE/3DNow! optimizations for Win32 platform (SSE/3DNow! optimizations currently not supported in GCC environment)</li>
<li>Replaced 'make-gcc' script for GNU environment
by master Makefile</li>
<li>Added time-stretch routine configurability to
@ -599,8 +605,7 @@ SoundTouch main class</li>
<ul>
<li>Moved SoundTouch under lesser GPL license (LGPL). This allows using SoundTouch library in programs that aren't
released under GPL license. </li>
<li>Changed MMX routine organiation so that MMX
optimied routines are now implemented in classes that are derived from
<li>Changed MMX routine organiation so that MMX optimized routines are now implemented in classes that are derived from
the basic classes having the standard non-mmx routines. </li>
<li>MMX routines to support gcc version 3. </li>
<li>Replaced windows makefiles by script using the .dsw files </li>
@ -622,18 +627,19 @@ files. </li>
<h3>5.2. SoundStretch application Change
History </h3>
<p><strong>v1.3.9 (1.4.0 pre):</strong></p>
<p><strong>1.4.0:</strong></p>
<ul>
<li>Moved BPM detection routines from SoundStretch application into SoundTouch
library</li>
<li>Allow using standard input/output pipes for processing&nbsp;</li>
<li>Allow using standard input/output pipes as audio processing input/output
streams</li>
</ul>
<p><strong>v1.3.0:</strong></p>
<ul>
<li>Simplified accessing WAV files with floating
point sample format.<br>
point sample format.
</li>
</ul>
<p><strong>v1.2.1: </strong></p>
@ -686,9 +692,8 @@ SoundTouch v1.3.1: </p>
Copyright (c) Olli Parviainen</p>
<p>This library is free software; you can
redistribute it and/or modify it under the terms of the GNU
Lesser General Public License as published by the Free Software
Foundation; either version 2.1 of the License, or (at your option)
any later version.</p>
Lesser General Public License vesrion 2.1 as published by the Free Software
Foundation.</p>
<p>This library is distributed in the hope
that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A