[speex-dev] Sphinx work-in-progress sourcecode
Christian.Buchner1 at epost.de
Mon Jun 30 00:08:12 PDT 2003
Since two people have asked me to open the source code on my work-in-progress
Integer Speex project, I have put it up onto my site www.openacm.org as a
download in the project tree.
the suggested directory structure is as follows, i.e. the speex source folder
should be on the same directory level as the sphinx filder.
peex-1.0.1 (ideally the folder from within the SpeexACM source archive)
I am doing development on Visual C++ .NET Basic (2002). The solution file to
open would be libspeex.sln
I am currently testing the code with a modified 'testenc_uwb" version. This
links against both speex and sphinx and the Visual C++ project file expects
to find speex includes and libraries in that above cited speex-1.0.1 folder.
testenc_uwb.exe elfi.snd elfi_out.snd elfi.bits
where elfi.snd would be a 32kbit/s raw soundfile, 16 bit signed Little Endian.
testenc_uwb.exe will output three SNR values per frame. The first one is the
original Speex codec, the second one being the result of the floating point
Sphinx codepath, the third one calculated from the integer output of Sphinx.
Both the Floating Point and Integer codepaths execute mostly in parallel, however
the integer path is not yet complete. So completely ignore the integer SNR value
I am working through the encoder step by step. Now I have everything up to the
LSP coefficients integerized. Then these coefficients get converted back
into floating point and are used in the remaining floating point codepath. That
is why currently only the Sphinx FP SNR value is of interest. If this value
drops relative to the Speex SNR value, you know you have messed up ;)
Regarding the API:
I converted all public speex_ calls to sphinx_. All non-public functions and
some tables have been prepended with an underscore sign to allow linking against
both libraries without conflicts.
Fully integerized subroutines are often prepended with an I_. I have
created a second stack (called _stack) in both encoder and decoder that holds
integers instead of floats. All variables replacing floats are also beginning
with an underscore character.
Sometimes I have subroutines that operate on both FP and Integer in parallel.
That is mainly for verification purposes. You will often find code that says
/* DEBUG: do something */. Most of the times it is commented out. The purpose
of this code is verification in most cases.
The files integer.h and integer.c contain macros and subroutines for my
integer arithmetics. Most operations in the codec are multiplications
followed by rightshifts. That is the equivalent of a scaling operation.
BTW, the precision problem with the Levinson-Durbin algorithm I whined about
recently - that was my own fault. When inserting the coefficients back into
the FP codepath, I forgot to typecast to float, resulting in such interesting
coefficents as +1, 0 and -1. Yeah, that certainly kills your SNR. ;)
Remember: This is WORK IN PROGRESS. Stuff may change. Things may yet be
non-optimal. There may even be errors. You can choose to contribute - or not.
But you cannot sue me if I don't like every submissions or suggestion I get ;)
This is mainly a service for those who asked for source code.
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Speex-dev