home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / sounds / snrc21.zip / SONARC.DOC < prev    next >
Text File  |  1993-09-26  |  31KB  |  670 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.     SSSSSSS       OOOOO     N         N       A       RRRRRRR        CCCCCC
  11.    S       S     O     O    NN        N      A A      R      RR     C      C
  12.   S         S   O       O   N N       N     A   A     R        R   C        C
  13.   S            O         O  N  N      N    A     A    R        R  C
  14.    SSS         O         O  N   N     N   A       A   R      RR   C
  15.       SSS      O         O  N    N    N  A         A  RRRRRRR     C
  16.          SSS   O         O  N     N   N  AAAAAAAAAAA  R   R       C
  17.             S  O         O  N      N  N  A         A  R    R      C
  18.   S         S   O       O   N       N N  A         A  R     R      C        C
  19.    S       S     O     O    N        NN  A         A  R      R      C      C
  20.     SSSSSSS       OOOOO     N         N  A         A  R       R      CCCCCC
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                 SONARC: Digital Audio Compression, Version 2.1
  29.                 ──────────────────────────────────────────────
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                      (C) Copyright 1993 Speech Compression
  36.                               All Rights Reserved
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.                             U S E R    M A N U A L
  48.  
  49.  
  50.  
  51.                                 September 1993
  52.  
  53. SONARC version 2.1     Copyright 1993 Speech Compression              Page  i
  54. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  55.  
  56.  
  57.                                    CONTENTS
  58.  
  59.  
  60. INTRODUCTION .......................................................... 1
  61.  
  62. THE UTILITIES ......................................................... 2
  63.  
  64.   SONARC.EXE .......................................................... 2
  65.  
  66.   SONARCX.EXE ......................................................... 5
  67.  
  68. LICENSING INFORMATION ................................................. 6
  69.  
  70. OTHER LICENSABLE MODULES .............................................. 7
  71.  
  72.   SONLIB.DLL .......................................................... 7
  73.  
  74.   LINKABLE OBJECTS .................................................... 9
  75.  
  76. POSTSCRIPT ........................................................... 11
  77.  
  78.  
  79.  
  80.  
  81.                                LEGAL MUMBO-JUMBO
  82.                                       AND
  83.                          ACKNOWLEDGMENT OF TRADEMARKS
  84.  
  85. Even though Speech Compression has tested the Sonarc software and reviewed
  86. the documentation, SPEECH COMPRESSION MAKES NO WARRANTY OR REPRESENTATION,
  87. EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO SONARC SOFTWARE, ITS QUALITY,
  88. PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.  AS A
  89. RESULT, THIS SOFTWARE IS PROVIDED "AS IS", AND YOU, THE USER, ARE ASSUMING
  90. THE ENTIRE RISK AS TO ITS QUALITY AND PERFORMANCE.
  91.  
  92. IN NO EVENT WILL SPEECH COMPRESSION BE LIABLE FOR DIRECT, INDIRECT, SPECIAL,
  93. INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT IN SONARC
  94. SOFTWARE OR ITS DOCUMENTATION, even if advised of the possibility of such
  95. damages.  In particular, Speech Compression shall have no liability for any
  96. programs or data used with Sonarc software, including the cost of recovering
  97. such programs or data.
  98.  
  99.  
  100. Sonarc, Sonarcx and ZipTalk are trademarks of Speech Compression.
  101.  
  102. Microsoft and MS-DOS are registered trademarks and Windows is a trademark of
  103. Microsoft Corporation.
  104.  
  105. BORLAND is a registered trademark of Borland International, Inc.
  106.  
  107. PKZIP is a registered trademark of PKWARE Inc.
  108.  
  109. All other brand and product names mentioned are trademarks or registered
  110. trademarks of their respective holders.
  111.  
  112. SONARC version 2.1     Copyright 1993 Speech Compression              Page  1
  113. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  114.  
  115.                                  INTRODUCTION
  116.  
  117. Sonarc is a new compression technology specifically optimized for digital
  118. audio.  Think of Sonarc as the PKZIP(r) of digitized audio.  Unlike the older
  119. ADPCM techniques, Sonarc features variable-rate compression which can be
  120. reversed to precisely reconstruct the original, uncompressed signal.  You
  121. don't need to judge its quality by listening to the original and decompressed
  122. versions of the signal; just run MS-DOS's COMP or FC commands!
  123.  
  124. What's the average amount of compression achievable with Sonarc?  Obviously,
  125. truly random sequences of numbers (white noise) will not compress at all
  126. losslessly.  On the other hand, there are 8-bit, 22 KHz sound-effects files
  127. in products on the market today for which Sonarc achieves an average of 3:1
  128. lossless compression (see below).  It all depends upon the quality of the
  129. recording and sampling and on the nature of the audio signal being processed.
  130. The grand average compression of all 8-bit, 11 KHz WAVE and VOC files that
  131. have been processed so far by Sonarc is about 55% (over 2:1).
  132.  
  133. Sonarc was not intended to be a general-purpose data compression utility,
  134. like the other compressors to which it is compared below.  In fact, Sonarc
  135. does only a mediocre job of compression on files which contain non-audio data.
  136. The following comparison is not for the purpose of denigrating the other
  137. compression products, but simply to show how well Sonarc is adapted to the
  138. compression of audio data.  The four files used in this comparison are
  139. probably the most widely distributed audio files in the world, since they
  140. come with each copy of Microsoft's Windows v3.1.
  141.  
  142.     File      Original size     LHA v2.13     PKZIP v2.04g   Sonarc v2.1
  143. ───────────────────────────────────────────────────────────────────────────
  144.   CHIMES.WAV     15,920           8,680          8,690          4,172
  145.   CHORD.WAV      24,982           9,407          8,861          7,172
  146.   DING.WAV       11,598           4,704          4,630          2,200
  147.   TADA.WAV       27,804          18,388         18,566         11,532
  148.                  ──────          ──────         ──────         ──────
  149.                  80,304          41,179         40,747         25,076
  150.  
  151. The command-line option -ex (Maximum Compression) was used with PKZIP.
  152. Sonarc used the command-line options -o0 and -x for maximum compression.
  153.  
  154. SONARC version 2.1     Copyright 1993 Speech Compression              Page  2
  155. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  156.  
  157.                                  THE UTILITIES
  158.  
  159. Compression and decompression are accomplished using the programs SONARC.EXE
  160. and SONARCX.EXE, respectively.
  161.  
  162. Both programs use a simple command-line interface.  Typing SONARC or SONARCX
  163. alone at the DOS prompt will cause the program to display a little "help"
  164. screen, explaining the syntax of the command line parameters.
  165.  
  166. Monaural and stereo, 8-bit and 16-bit files are supported in both WAVE and VOC
  167. formats.  Creative Labs' new v1.20 VOC files are fully supported.
  168.  
  169. Neither utility uses extended or EMS memory.  Both use less than 256K of
  170. conventional memory.
  171.  
  172. Both utilities run on 8086 processors; however, when processing 16-bit data,
  173. they "sense" whether they are executing on a '386 or better, and if so, will
  174. use the '386 instruction set for faster execution.
  175.  
  176. SONARC.EXE (file-to-file compression program)
  177. ───────────────────────────────────────────────────────────────────────────
  178.  
  179. The syntax for invoking SONARC is:
  180.  
  181.         SONARC {-<option>} <input-file> [<output-file>]
  182. or
  183.         SONARC {-<option>} <wildcarded-name> [<dest-path>]
  184.  
  185. If the input file has an extension, then it must be supplied.  If the input
  186. file is not in the current directory, then the path needed to reach it from
  187. the current directory is also required.
  188.  
  189. The output file specification is optional.  If it is omitted, then the output
  190. file will be created in the current directory with a name which is formed by
  191. concatenating the root name in the input file with one of the extensions
  192. shown below.  If it is supplied, then a path can be specified to cause the
  193. output file to be written to a directory other than the current directory.
  194. If no extension is specified for the output file, the extension will be WV,
  195. VC, or SNC, depending on whether the input file is in WAVE, VOC, or another
  196. format, respectively.  (SONARC scans the beginning of the file for a WAVE or
  197. VOC header.  If it finds neither, it assumes the file is "raw", i.e., contains
  198. only audio samples; it then prepends its own header to the output file.)
  199.  
  200. Alternatively, a wild-card specification (with source path, if needed) can be
  201. used.  If a destination path is supplied, the output files will be written to
  202. that path, otherwise to the current directory.  Any destination name or
  203. extension will be ignored.
  204.  
  205. If the input file to Sonarc is a WAVE file, then the output file is also a
  206. WAVE file in a special, proprietary format which has been registered with
  207. Microsoft's Multimedia Product Management.
  208.  
  209. Although the letter options are shown on the next page in upper case, they can
  210. be entered in either upper or lower case.  The option prefix character may be
  211. either a '-' or '/'.
  212.  
  213. SONARC version 2.1     Copyright 1993 Speech Compression              Page  3
  214. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  215.  
  216. The command-line options for SONARC.EXE are:
  217.  
  218.         Q        quiet mode; no banners, no statistics, no warning for
  219.                  overwriting existing files.
  220.  
  221.         D        delete the input file upon successful operation.
  222.  
  223.         S[n]     (used with "raw" files) assume stereo (two interleaved
  224.                  tracks, or "n" interleaved tracks if the optional number "n"
  225.                  is specified).  The default is to assume that the "raw" file
  226.                  is monaural.
  227.  
  228.         16       assume 16-bit samples, if the input file is "raw". 
  229.                  The default for "raw" files is to assume that they 
  230.                  are all 8-bit samples.  Options S and 16 may be 
  231.                  used together to compress "raw" 16-bit, stereo 
  232.                  files.
  233.  
  234.         Fnum     set the frame size to num in the range 256-4096.  Sonarc
  235.                  divides the source into "frames" of so many samples each.
  236.                  The compressed file then consists of compressed "frames",
  237.                  each of which contains table data specific for that frame.
  238.                  If the frame size is too small, then the size of the table
  239.                  data will not be amortized over enough compressed samples
  240.                  and the compression ratio will suffer.  If the frame size is
  241.                  too big, then spectral changes within the frame will not be
  242.                  tracked accurately enough, and so the compression ratio will
  243.                  suffer for that reason.  Different files will have different
  244.                  "optimal" values for frame size.  This option overrides the
  245.                  default frame size of 2048.
  246.  
  247.         Onum     set order to num in the range from 0 to 30.  "Order" is
  248.                  the number of previous samples to take into consideration
  249.                  when attempting to predict the next sample.  This option
  250.                  fixes the order to the number specified, except that a num
  251.                  of 0 causes the program to "search" for the best value of
  252.                  order for each frame.  This added searching will slow the
  253.                  compression process substantially, but generally yields more
  254.                  compression.  The default order is 10.
  255.  
  256.         X        use floating-point calculations to analyze the signal more
  257.                  thoroughy than is otherwise done (the default is to use fixed-
  258.                  point integer arithmetic).  Setting this option will slow the
  259.                  compression process moderately, or immoderately if combined
  260.                  with the -o0 option described above.  The floating-point code
  261.                  uses a "sensing" library that uses a co-processor if detected
  262.                  at run-time.  A co-processor is not necessary, but is highly
  263.                  recommended nevertheless for the sake of compression speed.
  264.  
  265. SONARC version 2.1     Copyright 1993 Speech Compression              Page  4
  266. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  267.  
  268. Examples:
  269.  
  270.     SONARC C:\WIN31\*.WAV
  271.         Compress all the .WAV files in the C:\WIN31 directory and write the
  272.         output to the current directory
  273.  
  274.     SONARC /D ILBEBACK.WAV ..
  275.         Compress ilbeback.wav in the current directory to ilbeback.wv, in the
  276.         parent directory.  Erase ilbeback.wav if no errors occur.
  277.  
  278.     sonarc -q *.voc d:
  279.         Compress all the .VOC files in the current directory and write the
  280.         corresponding .VC files to the current directory of the D: drive.
  281.         Suppress all screen output.
  282.  
  283.     sonarc piano.sou pno
  284.         (assuming piano.sou is "raw":) Compress piano.sou to pno.snc
  285.  
  286.     sonarc -s piano.sou pno.cmp
  287.         Compress piano.sou to pno.cmp; assume the samples are interleaved
  288.         stereo tracks
  289.  
  290.     sonarc -16 piano.sou pno.
  291.         Compress piano.sou to pno; assume piano.sou is sampled at 16 bits
  292.  
  293.     sonarc -x -o0 g145.wav
  294.         Compress g145.wav for maximum compression ratio, at the expense of
  295.         considerable extra time in compressing the file
  296.  
  297. SONARC version 2.1     Copyright 1993 Speech Compression              Page  5
  298. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  299.  
  300. SONARCX.EXE (file-to-file decompression program)
  301. ───────────────────────────────────────────────────────────────────────────
  302.  
  303. The syntax for invoking SONARCX is:
  304.  
  305.         SONARCX {-<option>} <input-file> [<output-file>]
  306. or
  307.         SONARCX {-<option>} <wildcarded-name> [<dest-path>]
  308.  
  309. The input (compressed) file specification requires the file's extension, if
  310. any.  (This will be the extension specified for the output file during the
  311. execution of SONARC, or else WV, VC, or SNC, if no extension was specified.)
  312.  
  313. If the input file is not in the current directory, then the path needed to
  314. reach the file from the current directory is also required.
  315.  
  316. The output (decompressed) file specification is optional.  If it is omitted,
  317. then the output file will be created in the current directory with a name
  318. which is formed by concatenating the root name in the input file with one of
  319. extensions described below.  If it is supplied, then a path can be specified
  320. to cause the output file to be written to a directory other than the current
  321. directory.  If no extension is specified for the output file, the extension
  322. will be WAV, VOC, or the original file's extension in the case where the
  323. original file was not in either WAVE or VOC format.
  324.  
  325. Alternatively, a wild-card specification (with source path, if needed) can
  326. be used for specifying the input (compressed) files.  If a destination path
  327. is supplied, then the output (decompressed) files will be written to that
  328. path, otherwise to the current directory.  Any destination name or extension
  329. will be ignored.
  330.  
  331. Since Sonarc is a LOSSLESS compression technology, the decompressed and
  332. original files will differ only in their timestamps.  They will otherwise
  333. compare identically, using the FC or COMP commands in DOS.
  334.  
  335. The command-line options for SONARCX.EXE are:
  336.  
  337.         Q      quiet mode; no chatter, no statistics, no warning for 
  338.                overwriting existing files.
  339.  
  340.         D      delete the input file upon successful operation.
  341.  
  342. Examples:
  343.  
  344.     SONARCX *.WV
  345.         Decompress all the .WV files in the current directory and write the
  346.         reconstructed files to the current directory
  347.  
  348.     sonarcx -q *.vc d:\
  349.         Decompress all the .VC files in the current directory and write the
  350.         corresponding .VOC files to the root directory of the D: drive.
  351.         Suppress all screen output.
  352.  
  353.     sonarcx pno.snc piano
  354.         Decompress pno.snc to piano.sou (if "sou" was the extension on the
  355.         original file, stored in the pno.snc file header).
  356.  
  357. SONARC version 2.1     Copyright 1993 Speech Compression              Page  6
  358. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  359.  
  360.                              LICENSING INFORMATION
  361.  
  362. What you may do with Sonarc depends on what classification you fall under.
  363. The archive referred to is the SNRC21.ZIP file from which this file was
  364. extracted.
  365.  
  366. 1. Shareware distributors, computer clubs and user groups:
  367.  
  368.   Members of this category are permitted to distribute this archive along with
  369.   other shareware programs as long as the charge for the diskette containing
  370.   this archive does not exceed US$10.
  371.  
  372. 2. Bulletin-board services:
  373.  
  374.   You may post this archive freely for the downloading convenience of your
  375.   customers.
  376.   
  377.   You may add a comment to the archive promoting your BBS.  Please inform me
  378.   if you do this.
  379.  
  380.   You may use Sonarc to compress any sound files in your possession and offer
  381.   the Sonarc-compressed files for downloading by your customers as long as
  382.   doing so does not violate any copyrights.  Please inform me if you do this.
  383.  
  384. 3. All other organizations (for-profit, not-for-profit, or governmental):
  385.  
  386.   After an evaluation period not to exceed 120 days, your organization must
  387.   either license the software from Speech Compression or destroy all copies
  388.   in its possession.
  389.  
  390.   For its internal use only, the organization must obtain a Site License.
  391.   For use in distributed products, the organization must obtain a Distribution
  392.   License.  These are available from the contact address below.
  393.  
  394. 4. Individuals (not including fictitious persons, such as corporations):
  395.  
  396.   You may use Sonarc in any way you want for as long as you want, as long as
  397.   it's not-for-profit.  This software is being distributed as shareware, i.e.,
  398.   "try before you buy."
  399.  
  400.   You may make copies of this archive and distribute it freely or upload it
  401.   to BBS's.  You are required to keep the component files of this archive
  402.   together, unmodified.
  403.  
  404.   You are cordially invited to send in a registration fee of $20 if you find
  405.   this software useful.  In exchange, you will receive one free upgrade of the
  406.   next version of Sonarc (v2.2 with a "lossy" algorithm) when it becomes
  407.   available.  You will also get the satisfaction of paying for value received.
  408.  
  409.   Please send your check made out to "Speech Compression", along with your
  410.   name and address (if not already imprinted on the check), to:
  411.  
  412.                              Speech Compression
  413.                              P.O. Box 2481
  414.                              Laguna Hills, CA  92654-2481
  415.  
  416. SONARC version 2.1     Copyright 1993 Speech Compression              Page  7
  417. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  418.  
  419.                      OTHER LICENSABLE MODULES: SONLIB.DLL
  420.  
  421. A DLL version of the SONARCX.EXE utility is also available for licensing.
  422. This DLL is useful for applications which install under Windows and use lots
  423. of WAVE files.  It is described in detail below.  It is available for
  424. licensing by contacting Speech Compression at the address on the previous
  425. page.
  426.  
  427. The SONLIB.DLL library has just a single callable function at index 1.  The "C"
  428. calling interface is as follows:
  429.  
  430.     extern int far pascal sonarcx(char* infyl,
  431.                                   char* outfyl,
  432.                                   int   EraseInputFile,
  433.                                   int   ShowNames);
  434.  
  435. or, in Pascal,
  436.  
  437.     function sonarcx(infyl, outfyl: pchar;
  438.                      EraseInputFile,
  439.                      ShowNames: Boolean): integer; far; external;
  440.  
  441. The type "pchar" is a Borland extension to Pascal which is a pointer to a 
  442. C-style, null-terminated string.
  443.  
  444. The first argument, infyl, may be wildcarded, in which case the second 
  445. argument, outfyl, should be the empty string '' or a destination path.  The
  446. third argument, EraseInputFile, has the same effect as the "-D" option in the
  447. SONARCX utility, that is, it causes the input file to be erased after
  448. successful completion.
  449.  
  450. The fourth argument, ShowNames, has the inverse effect of the "-Q" option in
  451. SONARCX.  If false, no screen I/O occurs whatsoever.  If true, however, it
  452. writes the name of the file currently being decompressed in an area of the DLL
  453. caller's active window.
  454.  
  455. SONARC version 2.1     Copyright 1993 Speech Compression              Page  8
  456. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  457.  
  458.                  OTHER LICENSABLE MODULES: SONLIB.DLL (cont.)
  459.  
  460. The function result is 0 if there were no errors detected.  The following are
  461. the error codes and conditions that may be returned:
  462.  
  463. -17      16-bit file encounted by a DLL configured to process only 8-bits.
  464. -16      .WV file was produced by a later version of Sonarc than v2.1.
  465. -15      specify output file name different from input file name.
  466. -14      bad block type in .VC file.
  467. -13      corrupted VC format file header.
  468. -12      input file is not a Sonarc-compressed file.
  469. -11      input file is an uncompressed VOC file.
  470. -10      internal error: corrupted frame data.
  471.  -9      version mismatch: compressed VOC file is obsolete version.
  472.  -8      unknown chunk type in data list.
  473.  -7      internal error: mismatch in sample count.
  474.  -6      missing "fact" chunk.
  475.  -5      "fact" chunk has corrupted length field.
  476.  -3      WAVE file is already in uncompressed format.
  477.  -2      WAVE file already compressed using another vendorÆs process.
  478.  -1      internal error: bad frame checksum (corrupted frame).
  479.   2      File not found.
  480.   3      Non-existent drive, sub-directory or badly formed file name.
  481.   5      Name is directory or existing read-only file.
  482. 100      Attempt to read past end of file: probably corrupted sound file.
  483. 101      Disk full.
  484. 150      Disk is write-protected.
  485. 152      Drive not ready.
  486. 162      Hardware failure.
  487.  
  488. Other error codes may be returned from DOS for various I/O operations.
  489.  
  490. SONARC version 2.1     Copyright 1993 Speech Compression              Page  9
  491. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  492.  
  493.                   OTHER LICENSABLE MODULES: LINKABLE OBJECTS
  494.  
  495. There are also assembly-coded buffer-to-buffer compression and decompression
  496. routines available which are highly optimized for both space and speed.  The
  497. interfaces for these routines are described in detail below.
  498.  
  499. Organizations wishing to obtain copies of these linkable modules must contact
  500. Speech Compression at the address on page 6.
  501.  
  502. The "C" declarations for the 8- and 16-bit compression routines are:
  503.  
  504.     typedef unsigned char[max_buf_len]* p_bytary;
  505.  
  506.     extern int far pascal cmp8(p_bytary p_input,
  507.                                int in_size,
  508.                                p_bytary p_output,
  509.                                int out_max,
  510.                                int order);
  511.  
  512.     typedef int[max_buf_len]* p_intary;
  513.  
  514.     extern int far pascal cmp16(p_intary p_input,
  515.                                 int in_size,
  516.                                 p_intary
  517.                                 p_output,
  518.                                 int out_max,
  519.                                 int order);
  520.  
  521. The corresponding Pascal declarations are:
  522.  
  523.     type bytary = array [0..max_buf_len-1] of char;
  524.          p_bytary = ^bytary;
  525.  
  526.     function cmp8(p_input: p_bytary;
  527.                   in_size: integer;
  528.                   p_output: p_bytary;
  529.                   out_max, order: integer;
  530.                  ): integer; far; external;
  531.  
  532.     type intary = array [0..max_buf_len-1] of integer;
  533.          p_intary = ^intary;
  534.  
  535.     function cmp16(p_input: p_intary;
  536.                    in_size: integer;
  537.                    p_output: p_intary;
  538.                    out_max, order: integer;
  539.                   ): integer; far; external;
  540.  
  541. Both cmp8 and cmp16 take a buffer of order+in_size samples at p_input and
  542. compress the in_size samples beginning at p_input[order] into the output buffer
  543. at p_output, not to exceed out_max bytes.  Note that for cmp16, the size of the
  544. input buffer is 2*(order+in_size) bytes, since each sample is 2 bytes. Both
  545. p_input and p_output are long, i.e., 32-bit real-mode pointers.  The argument
  546. out_max is the size of the output buffer into which the compressed frame is
  547. copied.  Note that this is not the size of the compressed frame; that
  548. information is stored into the first 16-bit word of the frame itself.  The
  549. argument out_max is passed to the routine to prevent it from producing a frame
  550. larger than the output buffer whose address is passed in.
  551.  
  552. SONARC version 2.1     Copyright 1993 Speech Compression              Page 10
  553. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  554.  
  555. The function result is returned in the AX register, where most "C" and Pascal
  556. compilers expect it.  The result value is zero for normal, error-free 
  557. processing.
  558.  
  559. Two error conditions are possible.  If insufficient stack space is allocated, a
  560. result of -2 is returned.  This occurs if the SP register is less than 
  561. approximately in_size+2*order+200 at the time of the call to cmp8, or less than
  562. 2*in_size+2*order+200 at the time of the call to cmp16. 
  563.  
  564. The second error condition occurs when the number of bytes of output buffer
  565. needed for the compressed input buffer exceeds the value of out_max, in which
  566. case a result value of -1 is returned.
  567.  
  568. ───────────────────────────────────────────────────────────────────────────
  569.  
  570. The "C" declarations for the 8- and 16-bit decompression routines are:
  571.  
  572.     extern int far pascal dcmp8(p_bytary p_input,
  573.                                 p_bytary p_output);
  574.  
  575.     extern int far pascal dcmp16(p_intary p_input,
  576.                                  p_intary p_output);
  577.  
  578. The corresponding Pascal declarations are:
  579.  
  580.     function dcmp8(p_input,
  581.                    p_output: p_bytary
  582.                   ): integer; far; external;
  583.  
  584.     function dcmp16(p_input,
  585.                     p_output: p_intary
  586.                    ): integer; far; external;
  587.  
  588. Both dcmp8 and dcmp16 take a compressed frame at p_input and decompress it into
  589. the output buffer starting at p_output[order].  The decompression routine gets
  590. the order datum from the byte at offset 7 in the input v2.1 compressed frame
  591. (see the frame header description in the File and Frame Formats section).  As
  592. previously explained, the header of the compressed frame contains, at fixed
  593. offsets, the lengths needed by the caller and the decompression routine to
  594. figure out how much buffer space to allocate and use, respectively.
  595.  
  596. As is the case for the compression routines, the function result is returned in
  597. the AX register.  The result value is zero for normal, error-free processing. 
  598. The only error condition, resulting in a returned value of -1, is if the
  599. checksum fails.  If this error occurs, it means that the input frame has been
  600. folded, spindled, and/or mutilated at some point following its creation by the
  601. compression routine.  Keep in mind that the entire frame must be passed to the
  602. decompression routine; partial frames cannot be decompressed.
  603.  
  604. Note that stack overflow is not checked for in the decompression modules.
  605. However, the stack space required by these routines is guaranteed to be less
  606. than 50 bytes.
  607.  
  608. The DS, SS, CS, BP, SI and DI registers are preserved by these routines.  No
  609. instructions unique to the '186, '286, '386, or '486 processors are used in the
  610. 8-bit modules.  The 16-bit modules, however, make use of the '386 instruction
  611. family whenever they "sense" that they are running on a '386 or better.
  612.  
  613. SONARC version 2.1     Copyright 1993 Speech Compression              Page 11
  614. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  615.  
  616.                                   POSTSCRIPT
  617.  
  618. I picked the d.b.a. "Speech Compression" last year (1992), when I started
  619. working on a technology for PCs capable of compressing speech signals lossily
  620. at ratios of over 10:1.  Currently no compression is available for speech at
  621. such ratios (of any quality, that is) that does not require either huge run-
  622. time tables (>100 Kbytes), or some sort of special hardware support, such as a
  623. DSP or LPC chip.
  624.  
  625. I got ZipTalk (as I called it) developed to the point where I could prove to
  626. myself that decompression of speech signals could be accomplished on an 8088
  627. processor running at 4.77 MHertz with processor to spare, using tables of
  628. probably not much more than 16K bytes.
  629.  
  630. The compression side is a complex, but solved, problem since it piggy-backs
  631. off of linear-predictive analysis.  In fact, the whole trick is to transform
  632. frequency-domain parameters obtained through LPC techniques into a special
  633. format that I have discovered, which then permits real-time conversion back
  634. into time-domain signals.  (I can say it faster than I can develop it!)
  635.  
  636. However, while waiting for some research documents to arrive by USnail, I was
  637. put in contact with a company which needed lossless audio compression, and I
  638. diverted my energy to the development of Sonarc.  (If you need Sonarc to be
  639. an acronym of something, and you don't like "SOuNd ARChival" then I suppose
  640. it could be "Some Outfit Nagged About Reversible Compression".)
  641.  
  642. I've spent a considerable amount of time researching various ways of doing
  643. "lossy" audio compression.  Earlier versions of Sonarc featured a "lossy"
  644. parameter -Ln[n], which achieved higher compression ratios while keeping the
  645. total amplitude distortion in the decompressed signal less than n.[n]%.
  646. Unfortunately, the compression phase was extremely compute-intensive and
  647. generally required overnight runs to compress any significant amount of audio
  648. files.  I've never tried combining this "lossy" with the -x and -o0 options;
  649. I suspect there would be a measurable amount of proton decay before it could
  650. finish.  I only left it out of this shareware version because it is so slow,
  651. and I didn't want that sullying Sonarc's otherwise fine reputation.  I'm still
  652. developing the "lossy" algorithm, though, and I'll have a "lossy" solution in
  653. the v2.2.  Don't ask me when; it'll be ready when it's ready.
  654.  
  655. I suppose, in retrospect, I might have called myself "Sound Compression" or
  656. some such (not being particularly imaginative in the naming department).  But
  657. I'm stuck with "Speech Compression", even though I now do general audio
  658. compression, and may later branch out into image compression as well.  (Most
  659. algorithms which process 1-D signals can, in principle, be extended to process
  660. 2-D signals.)
  661.  
  662. I welcome your input, whether pats on the back or criticisms.  I strongly
  663. encourage you to register your copy of this software, as I would like nothing
  664. better than to spend full time on this; your $20 shareware payment will help
  665. make that possible.  I can be contacted by USnail at the address on page 6,
  666. or by e-mail on CompuServe: 76635,3652.
  667.  
  668.                               Richard P. Sprague
  669.  
  670.