multi-threaded alpha encoding for lossy

new option: 'cwebp -mt ...'
new config flag: config.thread_level
(allowed thread_level are 0 or 1 for now. Maybe more later...)
If -mt is activated (and WEBP_USE_THREAD is used for compile), the alpha-compression
will be done in parallel to RGB coding for lossy. Can save quite a bit of latency...
Has no effect for lossless encoding.

Change-Id: I769d0bf90e7380cf99344ad62cd77277f4df5a46
This commit is contained in:
skal
2013-03-01 01:21:34 +01:00
parent 72655350ea
commit f817930a55
9 changed files with 96 additions and 33 deletions

View File

@ -546,6 +546,7 @@ static void HelpLong(void) {
printf(" -pass <int> ............ analysis pass number (1..10)\n");
printf(" -crop <x> <y> <w> <h> .. crop picture with the given rectangle\n");
printf(" -resize <w> <h> ........ resize picture (after any cropping)\n");
printf(" -mt .................... use multi-threading if available\n");
#ifdef WEBP_EXPERIMENTAL_FEATURES
printf(" -444 / -422 / -gray ..... Change colorspace\n");
#endif
@ -724,6 +725,8 @@ int main(int argc, const char *argv[]) {
config.autofilter = 1;
} else if (!strcmp(argv[c], "-jpeg_like")) {
config.emulate_jpeg_size = 1;
} else if (!strcmp(argv[c], "-mt")) {
++config.thread_level; // increase thread level
} else if (!strcmp(argv[c], "-strong")) {
config.filter_type = 1;
} else if (!strcmp(argv[c], "-nostrong")) {