TOOLS: Addition of libvorbis and libflac
|Reported by:||SF/lightcast||Owned by:||SF/knakos|
The first part of my SoC work.
The vast majority of the changes occur in compress.c
The new function encodeRaw() takes in an array of raw audio data and encodes it using either libvorbis or libflac instead of using the external tools. encodeAudio() was rewritten to use this function instead of calling the external tools, except in the case of MP3 compression where it remains unchanged.
FLAC arguments are now stored in an actual struct instead of simply passing argv. All compression levels, block size, verify, and silent are supported as FLAC arguments.
Hard bitrate restrictions now work when using Vorbis compression. They were broken in the original tools.
Modified compress_queen to use compress.c
Modified compress_scumm_bun and compress_scumm_san to use --vorbis instead of --ogg to be consistent with the other tools.
Modified the command line arguments of compress_kyra, compress_scumm_san, and compress_scumm_bun to be more consistent, which also removed a couple of HACK's.
Modified all of the tools with updated help messages to reflect the changes to FLAC arguments.
Several cosmetic changes (i.e. invalid arguments listed in the help messages of some tools, unnecessary whitespace removed, etc.)
Compiled on MSVC, MinGW, and gcc. Tested on Simon 1 & 2, Full Throttle, Flight of the Amazon Queen, and Broken Sword 2. This covers all the modified functions in compress.c, so all the other tools should also work.
Slight Quirk: Vorbis compressed files produced from a MSVC compiled executable are slightly larger than both the original tools and the MinGW/gcc compiled tools. They still work but for some reason the bitrate calculated for a specified quality level is slightly higher. I tried changing optimizations and re-compiling the libraries but nothing changed the results. I'm not sure what's causing this to happen.
Ticket imported from: #1746270. Ticket imported from: patches/812.