[Scummvm-cvs-logs] SF.net SVN: scummvm:[34873] tools/trunk
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Mon Nov 3 12:12:31 CET 2008
Revision: 34873
http://scummvm.svn.sourceforge.net/scummvm/?rev=34873&view=rev
Author: fingolfin
Date: 2008-11-03 11:12:31 +0000 (Mon, 03 Nov 2008)
Log Message:
-----------
cleanup
Modified Paths:
--------------
tools/trunk/README
tools/trunk/compress.cpp
tools/trunk/compress.h
Modified: tools/trunk/README
===================================================================
--- tools/trunk/README 2008-11-03 10:45:59 UTC (rev 34872)
+++ tools/trunk/README 2008-11-03 11:12:31 UTC (rev 34873)
@@ -146,7 +146,7 @@
*.bin files)
- The unsupported early DOS demo of Inherit the Earth
- compress_scumm_bun <inputfile> <inputdir> <outputdir> [params]
+ compress_scumm_bun
Used to the compress '.bun' music/voice files with MP3, Vorbis
or FLAC.
Modified: tools/trunk/compress.cpp
===================================================================
--- tools/trunk/compress.cpp 2008-11-03 10:45:59 UTC (rev 34872)
+++ tools/trunk/compress.cpp 2008-11-03 11:12:31 UTC (rev 34873)
@@ -85,8 +85,7 @@
*
* Copied from lame 3.96.1
*/
-static int map2MP3Frequency(int freq)
-{
+static int map2MP3Frequency(int freq) {
if (freq <= 8000) return 8000;
if (freq <= 11025) return 11025;
if (freq <= 12000) return 12000;
@@ -156,7 +155,7 @@
}
}
-#ifdef DISABLE_VORBIS
+#ifdef DISABLE_BUILTIN_VORBIS
if (compmode == kVorbisMode) {
tmp += sprintf(tmp, "oggenc ");
if (rawInput) {
@@ -200,7 +199,7 @@
}
#endif
-#ifdef DISABLE_FLAC
+#ifdef DISABLE_BUILTIN_FLAC
if (compmode == kFlacMode) {
/* --lax is needed to allow 11kHz, we dont need place for meta-tags, and no seektable */
/* -f is reqired to force override of unremoved temp file. See bug #1294648 */
@@ -297,7 +296,7 @@
}
void encodeRaw(char *rawData, int length, int samplerate, const char *outname, CompressMode compmode) {
-#ifndef DISABLE_VORBIS
+#ifndef DISABLE_BUILTIN_VORBIS
if (compmode == kVorbisMode) {
FILE *outputOgg;
char outputString[256] = "";
@@ -509,7 +508,7 @@
}
#endif
-#ifndef DISABLE_FLAC
+#ifndef DISABLE_BUILTIN_FLAC
if (compmode == kFlacMode) {
int i;
int numChannels = (rawAudioType.isStereo ? 2 : 1);
@@ -795,12 +794,11 @@
}
if (oggparms.minBitr < 8) {
- oggparms.minBitr = 8;
+ oggparms.minBitr = 8;
}
i++;
- }
- else if (strcmp(argv[i], "-M") == 0) {
+ } else if (strcmp(argv[i], "-M") == 0) {
oggparms.maxBitr = atoi(argv[i + 1]);
if ((oggparms.maxBitr % 8) != 0) {
@@ -816,21 +814,16 @@
}
i++;
- }
- else if (strcmp(argv[i], "-q") == 0) {
+ } else if (strcmp(argv[i], "-q") == 0) {
oggparms.quality = atoi(argv[i + 1]);
i++;
- }
- else if (strcmp(argv[i], "--silent") == 0) {
+ } else if (strcmp(argv[i], "--silent") == 0) {
oggparms.silent = 1;
- }
- else if (strcmp(argv[i], "--help") == 0) {
+ } else if (strcmp(argv[i], "--help") == 0) {
return 0;
- }
- else if (argv[i][0] == '-') {
+ } else if (argv[i][0] == '-') {
return 0;
- }
- else {
+ } else {
break;
}
}
@@ -847,53 +840,37 @@
if (strcmp(argv[i], "-b") == 0) {
flacparms.blocksize = atoi(argv[i + 1]);
i++;
- }
- else if (strcmp(argv[i], "--fast") == 0) {
+ } else if (strcmp(argv[i], "--fast") == 0) {
flacparms.compressionLevel = 0;
- }
- else if (strcmp(argv[i], "--best") == 0) {
+ } else if (strcmp(argv[i], "--best") == 0) {
flacparms.compressionLevel = 8;
- }
- else if (strcmp(argv[i], "-0") == 0) {
+ } else if (strcmp(argv[i], "-0") == 0) {
flacparms.compressionLevel = 0;
- }
- else if (strcmp(argv[i], "-1") == 0) {
+ } else if (strcmp(argv[i], "-1") == 0) {
flacparms.compressionLevel = 1;
- }
- else if (strcmp(argv[i], "-2") == 0) {
+ } else if (strcmp(argv[i], "-2") == 0) {
flacparms.compressionLevel = 2;
- }
- else if (strcmp(argv[i], "-3") == 0) {
+ } else if (strcmp(argv[i], "-3") == 0) {
flacparms.compressionLevel = 3;
- }
- else if (strcmp(argv[i], "-4") == 0) {
+ } else if (strcmp(argv[i], "-4") == 0) {
flacparms.compressionLevel = 4;
- }
- else if (strcmp(argv[i], "-5") == 0) {
+ } else if (strcmp(argv[i], "-5") == 0) {
flacparms.compressionLevel = 5;
- }
- else if (strcmp(argv[i], "-6") == 0) {
+ } else if (strcmp(argv[i], "-6") == 0) {
flacparms.compressionLevel = 6;
- }
- else if (strcmp(argv[i], "-7") == 0) {
+ } else if (strcmp(argv[i], "-7") == 0) {
flacparms.compressionLevel = 7;
- }
- else if (strcmp(argv[i], "-8") == 0) {
+ } else if (strcmp(argv[i], "-8") == 0) {
flacparms.compressionLevel = 8;
- }
- else if (strcmp(argv[i], "--verify") == 0) {
+ } else if (strcmp(argv[i], "--verify") == 0) {
flacparms.verify = true;
- }
- else if (strcmp(argv[i], "--silent") == 0) {
+ } else if (strcmp(argv[i], "--silent") == 0) {
flacparms.silent = true;
- }
- else if (strcmp(argv[i], "--help") == 0) {
+ } else if (strcmp(argv[i], "--help") == 0) {
return 0;
- }
- else if (argv[i][0] == '-') {
+ } else if (argv[i][0] == '-') {
return 0;
- }
- else {
+ } else {
break;
}
}
Modified: tools/trunk/compress.h
===================================================================
--- tools/trunk/compress.h 2008-11-03 10:45:59 UTC (rev 34872)
+++ tools/trunk/compress.h 2008-11-03 11:12:31 UTC (rev 34873)
@@ -20,12 +20,16 @@
*
*/
-#ifndef EXTRACT_H
-#define EXTRACT_H
+#ifndef COMPRESS_H
+#define COMPRESS_H
#include "util.h"
+#ifndef DISABLE_BUILTIN_VORBIS
#include <vorbis/vorbisenc.h>
+#endif
+#ifndef DISABLE_BUILTIN_FLAC
#include <FLAC/stream_encoder.h>
+#endif
/* These are the defaults parameters for the Lame invocation */
#define minBitrDef 24
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list