home *** CD-ROM | disk | FTP | other *** search
- Note
- ====
-
- This version has been finished in something a flurry. I'm really supposed to
- be doing work on my Third Year final project, but I'd got bored with it. :-)
- Anyway, now I have to get back to work but I thought I might as well release
- this now because it'll probably be months before I get this much free time
- to work on a project.
-
- Spelling mistakes, incomprehensible documentation, etc. are all to be
- expected. Don't hesitate to get in touch with me by email if you can't
- understand me.
-
- Anyway, there are now really, really, really simple decompressors for you in
- case you're one of these people who just wants to be able to compress all
- the samples they're using in a program and have it up and running again 5
- minutes later. So now you've no excuse to waste everybody's download time
- with your 300K+ samples when they could be 160K or less.
-
- Oh yes, and please don't upload this to The Plasma Sphere - that's where I
- put the lastest versions. I'm sick of people uploading older versions than
- those already on the board, and then have people download them thinking
- they're new because they show up in the list of new files.
-
-
- Possible future improvements
- ============================
-
- - Type 6 samples to support *storage* of 16bit samples.
- - StrongHelp files for documentation in addition to text files.
- - Type 5 to be added, based on Type 4. I've already got something in mind
- but a recent trial only brought compression down from 50% to about 46%
- so it needs a bit more work.
- - Sharing of tables in Expand modules to make the universal decoder
- much smaller.
- - All compressors to accept 16-bit linear and 8-bit VIDC as input as well
- as 8-bit linear.
- - Optional external 12-bit lin->VIDC and VIDC->16-bit lin tables for
- improved quality, plus a short utility of some sort to generate such
- tables. Otherwise the internal 8-bit tables will be used.
- - LoadCSamp can optionally produce a voice generator that repeats the sound
- automatically for background noises in games eg. engine noises.
-
- Version 1.14
- ============
-
- - Type 7 added. This is a slight variation of Type 6 with the sign of deltas
- coded in a new way so as to favour positive deltas and unbalance the tree.
- This yields a small increase in compression. By small I mean *small*! For
- example, a 460K sample compressed down to 300K with Type 6. With Type 7
- it compressed to 296K, a saving of only 4K. I had expected more than this,
- but perhaps things will improve if I add the predictor I've been
- considering... Certainly this technique can be applied to Type 5 when I
- get round to doing it.
- - Type6 changed to Type6-7. I had to make the new variant into Type 7 to
- maintain compatibility with the old Type 6 decoder. The new feature is
- enabled by setting bit 2 of the flags, otherwise the standard Type 6
- output is generated.
-
- Version 1.13
- ============
-
- - Slight changes to documentation here and there.
- - Addition of Type 4 decompressor and compressor. Type 5 is not yet ready.
- - Slight internal changes to all compressors and decompressors.
- - New reason code can be returned from Compress. Code 7 is used to request
- claiming of the phase 1 workspace. I'm having a bit of a rethink about
- this so it might change in the future, perhaps adding a similar mechanism
- for the global workspace.
-
- Version 1.12
- ============
-
- - Minor bug fix to Compress. If you try to compress a file of zero length
- then only the 7 byte header is actually written. Expand modified to accept
- these files.
- - Added optional table to Type6 for use with 8-bit samples to improve
- compression. Worst case it *could* increase the file size by 32 bytes, but
- almost always results in a slight improvement so is well worthwhile.
-
- Version 1.11 - beta-test release
- ============
-
- - New sample type added (type 6). Slightly more efficient than types 0-3,
- requires less code for the decoder and is probably faster too.
- - From now on, all code that is modified will adopt the version number of
- the particular release of !CompUtils, rather than having individual
- histories.
- - Minor bug fix to Expand types 0-3.
- - C/APCS and ObjAsm versions of Compress/Expand/ExpCode. Note that these
- are patched versions of the raw code and therefore not as easy to use and
- feel a little hacky. Let me know if you have any problems with them.
- - New management of !CompUtils sources to provide automatic updating in
- future by means of Amu. Means it is now possible to develop new algorithms
- without an admin explosion. Took three days to do just this, which is why
- I've mentioned this, even though you aren't going to be remotely
- interested. :-(
- - Expand header offset removed from ExpCode header and replaced with the
- filetype for compressed samples.
- - Can now access files through a path variable, eg. CompUtils:Expand.Type6
- - Loads of new documentation, including a reorganisation of same.
- - Compress and Expand now never return error codes 4 and 7. These are now
- reserved for future use. Therefore, 0-3 are valid return codes, 4-7 are
- soft errors, and 8 and up are hard errors.
- - Various minor bug fixes
- - Complete rewrite of the universal Expand. Somehow it hadn't been updated
- when it should and still expected a valid source buffer at the first call.
- It now behaves as a normal Expand utility again.
- - Type 6 samples now have a logarithm mode which is more efficient than
- previously. However, the linear mode is still recommended.
- - There is now a facility within Compress whereby multiple passes of the
- source file may be used in the scanning phase. Compress can now return
- reason code 4 (previously an unused error condition) which is a request
- to move back to the start of the source. Unlike reason code 3 it does
- *not* indicate the end of the phase, and the workspace should be left
- untouched. At present no compressor uses this facility but it is expected
- that Type6 might do in the near future.
- - Sample format now returned in Expand's header (but not in ExpCode's)
- - Loads of example code added
- - A module similar to LoadSample but it loads the sample into a block of RMA
- and installs a voice generator for it. Hey presto, compressed samples can
- be added to any program that wants them just by adding a few *commands to
- the !Run file.
-
-
- Version 1.10 - never released (complete rewrite)
- ============
-
- This is a development version distributed to any users who may be
- considering using !CompUtils in their own programs. The aim is to let them
- try out the new versions of Expand and Compress before the proper release.
- The code may therefore still contain bugs. Please report any problems to me
- a.s.a.p. The next release will be a proper release and should contain code
- for type 4 samples (16bit ADPCM) and possibly 5 and 6 if I have the time.
- The algorithms for these have already been created, but not fully
- implemented.
-
- General
- -------
-
- - New directory structure.
- - A program can reference CompUtils code by <CompUtils$Dir> during assembly.
- - Compression code added.
- - Separate code modules for compressing/expanding each sample type, plus
- a code module to decompress *any* known sample type.
- - Sprites directory added, containing both low res and high res sprites to
- be used for file icons. Any of these can be added to your own !Sprites
- file.
- - Histories started, simply because I keep getting letters from people who
- have ancient versions of this or !Compress and I can't remember what
- changes I've made. From now on all that's changed (and you lot get to see
- what a busy beaver I've been).
-
- Expand
- ------
-
- - Expand code now handles returning to the user in a much improved manner.
- This means that you should *not* pass any source data to Expand until it
- asks for it. In addition, when a reason code of 0 is returned to indicate
- completion, the output buffer will *not* contain any data. Any outstanding
- data would have been passed using reason code 2 (destination buffer full)
- beforehand. All output buffers bar the last one will be completely full.
- The last one may be partially empty, but never completely empty.
- - When reason code 0 is returned from Expand, +28 gives the number of bytes
- that were in the last destination buffer returned, unless the buffer was
- completely full, in which case +28 is 0.
- - +44, the number of bytes left to be decompressed is now no longer divided
- by 16. After reason code 3 it is identical to +40.
- - +40 is the total number of output bytes not the total number of samples.
- This distinction is important now as Expand can output 16bit samples,
- where the number of bytes is twice the number of samples.
- - The output data no longer includes the sample period byte used for
- Armadeus files. This can be added manually using +48, which becomes valid
- after reason code 3. The output length calculated also omits this byte.
- - No data will be written to the output until after reason code 3 is
- returned. The destination buffer pointer and length values do not need to
- be set up until then.
- - The output buffer does not need to be a special length any more - any
- non-zero size will do. Similarly, the source buffer size is unrestricted.
- (Previous versions of Expand insisted the first source buffer passed was
- at least 320 or so bytes long, and that all destination buffers had to be
- a multiple of either 16 or 32 bytes.)
- - Bit 2 of the output flags is no longer relevant, so is now used to produce
- 16bit linear output (little endian - ie. lower byte first) instead of 8bit
- if linear output is selected. Sample types 0-3 only support 8bit samples
- internally, so Expand0-3 just outputs each byte twice, thus 8bit &FE
- becomes 16bit &FEFE. This is really provided for forward compatability.
- - Bit 3 of the output flags is no longer used. Previous this was used to
- downgrade the enhanced sample output flag when batches of samples were
- used (mainly when !Player is playing a sequence file). This is no longer
- supported. Instead, Expand returns information about the sample and how it
- intends to output it on reason code 3, as follows:
-
- bit 31 - if set, sample format stores sample as 16 bit. This specifies
- whether it would be worthwhile trying to output the sample as
- 16bit: if it is clear you gain nothing in quality but double the
- output sample size. Of course, it is too late to alter bit 3 now.
- You would have to restart the whole operation to change it.
- bit 30 - if set, sample file is storing the sample as linear signed rather
- than logarithmic. This is pretty much irrelevant.
- bit 29 - if set, Expand intends to use the enhance output format. In this
- case the output length is doubled and every other byte is formed
- by interpolating its two neighbours (to reduce distortion
- caused by the sampling waveform appearing in the output - a
- problem with low sample rates which results in a whining noise).
- bit 28 - if set, Expand is going to store the sample as 16bit rather than
- 8bit. It can be used in conjuction with bit 29, which would lead
- to an output sample four times larger than the original Armadeus
- file.
-
- - Output can be stored as enhanced regardless of whether or not the sample
- itself was compressed with the enhance flag set. (From now on, the enhance
- flag in the !Compress status window will described as a linear/log
- switch.) However, the output sample must be set to linear output to use
- either this feature or the 16bit output (or both).
- - The sample period in the header is unaffected by whether or not the sample
- is to be stored as enhanced, thus with enhanced output it will be twice
- as large as you might expect. Use bit 29 of the output flags if this is a
- problem to you.
- - Error codes 4-7 are considered soft errors. If you can determine and
- correct the problem encountered, then you may carry on as if nothing had
- happened. Error code 8 is a fatal error and you *must* abort the operation
- not continue or Expand will crash.
-
- ExpCode
- -------
-
- Largely unchanged. A few small changes internally to let it use the new
- version of Expand.
-
- - The restrictions that applied to the flags previously now no longer hold.
- The flags are passed to Expand every time you call ExpCode, and the flags
- returned from Expand are passed back to you in ExpCode's header. You can
- therefore use the new status bits (28-31) for information.
-
- LoadSample
- ----------
-
- Unchanged externally, but uses the new version of ExpCode.
-
- Compress
- --------
-
- This did not exist previously, so all features are new!
-
- !Player/!Compress
- -----------------
-
- These have not yet been updated and may crash horribly when used.
-
-