Escolar Documentos
Profissional Documentos
Cultura Documentos
Software Limitations
The software implements levels I and II and psychophysical
auditory models I and II as described in the ISO 3-11171 rev 1
standard. The input/output audio data may either be headerless raw
16 bit data or alternatively an AIFF formatted file (Audio Interchange
File Format) with certain limitations. (For more information on the
AIFF format see the postscript file /sgi/aiff-c.9.26.91.ps at the
anonymous ftp site FTP.SGI.COM (192.48.153.1)). The AIFF formatted
file is a convenient way for storing sampling rate of the audio file.
The encoder and decoder software are configured to output the
coded audio bitstreams as a string of hexadecimal ascii characters.
For greater compression efficiency, compile flag, BS_FORMAT, in
common.h can be switched to configure the bitstream reading and
writing routines to process raw binary bitstreams.
This software has been run and verified on a large variety of
computers and operating systems. In particular UNIX, MS_DOS (with
MicroSoft C version 6), Macintosh, AIX Platform (RS6000) and Convex.
Table 1 illustrates how the encoder and decoder is formed from the
component files. In this table the definition files are enclosed in
parenthesis and listed immediately below the primary source file
which uses them. The data file names are listed within braces and
also placed immediately below the source file which uses them.
Table 1
encoder common decoder
files files files
---------- ------------ ------------
musicin.c common.c musicout.c
encode.c (common.h) decode.c
(encoder.h) {alloc_0} (decoder.h)
{enwindow} {alloc_1} {dewindow}
psy.c, subs.c {alloc_2}
{absthr_0} {alloc_3}
{absthr_1}
{absthr_2}
tonal.c
{1cb0}, {1cb1}, {1cb2}
{2cb0}, {2cb1}, {2cb2}
{1th0}, {1th1}, {1th2}
{2th0}, {2th1}, {2th2}
The test files orig.mpg and sine.dec are approximately
129026 and 387072 bytes. (Small variations are due to the blocking
structures imposed by various disk operating systems.)
Software Installation
Place are the 21 tables (absthr_*, *cb*, *th*, alloc_*)
in a subdirectory called tables. Modify the common.h to reflect
the compiler and machine you are using. (ie. uncomment one of the
defs UNIX, MACINTOSH, MS_DOS, MSC60, AIX or CONVEX). Compile and
link the files using one of the makefiles provided as a guideline.
Note that the compiler may issue warning messages such as
common.c: In function `aiff_read_headers':
common.c:686: warning: multi-character character constant
common.c:687: warning: multi-character character constant
common.c:703: warning: multi-character character constant
common.c:735: warning: multi-character character constant
common.c: In function `aiff_write_headers':
common.c:825: warning: multi-character character constant
common.c:826: warning: multi-character character constant
common.c:827: warning: multi-character character constant
musicin.c:920: warning: static declaration for `usage' follows non-static
musicin.c: In function `aiff_check':
musicin.c:960: warning: multi-character character constant
These messages are dependent on the preprocessor directives specified
in the common.h file.
Usuage
To run the code type the name of the file followed by a
carriage return. The programs will prompt you to input the
appropriate parameters. The sound input file for the encoder should
be sound data, monophonic or stereophonic, sampled at 32, 44.1, or
48 kHz with 16 bits per sample. For stereophonic data the left
channel sample should precede the right channel sample. The sound
output file of the decoder will be the same format as the sound input
file used by the decoder, except for possible byte order differences
if the encoder and decoder programs are run on different computer
systems which have different byte ordering conventions.
Assuming the program musicin produces the MPEG coded file
and musicout decodes the MPEG coded file, the programs can be run
in either commandline mode or user prompt mode. For example, on a
UNIX operating system, entering
musicin sine.dec sine.mpg
will run the program with the current built in defaults. The output
from the program should appear as below.
Encoding configuration:
Layer=II mode=stereo extn=0 psy model=2
samp frq=44.1 kHz total bitrate=384 kbps
de-emph=0 c/right=0 orig=0 errprot=0
input file: 'sine.dec' output file: 'sine.mpg'
using bit allocation table alloc_1
slots/frame = 1253
frac SpF=0.878, tot bitrate=384 kbps, s freq=44.1 kHz
Fractional number of slots, padding required
{ 0}absthr[][] sampling frequency index: 1
{ 1}{ 2}{ 3}{ 4}{ 5}{ 6}{ 7}...