Add flag to modify the number of compressions in order to take an average of the compression time.

This commit is contained in:
Pavel Krajcevski 2012-09-15 10:29:36 -04:00
parent 1c8b065261
commit e25e5bae90
2 changed files with 15 additions and 0 deletions

View file

@ -18,11 +18,24 @@ int main(int argc, char **argv) {
int quality = 50;
int numThreads = 1;
int numCompressions = 1;
bool bUseSIMD = false;
bool knowArg = false;
do {
knowArg = false;
if(strcmp(argv[fileArg], "-n") == 0) {
fileArg++;
if(fileArg == argc || (numCompressions = atoi(argv[fileArg])) < 0) {
PrintUsage();
exit(1);
}
fileArg++;
knowArg = true;
}
if(strcmp(argv[fileArg], "-s") == 0) {
fileArg++;
@ -67,6 +80,7 @@ int main(int argc, char **argv) {
settings.bUseSIMD = bUseSIMD;
settings.iNumThreads = numThreads;
settings.iQuality = quality;
settings.iNumCompressions = numCompressions;
CompressedImage *ci = CompressImage(file, settings);

View file

@ -10,6 +10,7 @@ struct SCompressionSettings {
bool bUseSIMD;
int iNumThreads;
int iQuality;
int iNumCompressions;
};
extern CompressedImage * CompressImage(