add SSE2 functions. ~2x faster encoding on average.

For now, SSE2 functions are compiled a-minima: only on platforms
where __SSE2__ is defined. Let's later add some autoconf-based
config to enable/disable at will.

One can disable SSE2 at run-time by hooking-up VP8GetInfo.
There is a new option "-noasm" in cwebp for that.
Output should be binary the same between C and SSE2 version. If not,
that's a bug!

patch by Christian Duvivier (cduvivier at google dot com)

Change-Id: Iae006c3cdcb7e8280e846cedb94d239dab1e42ae
This commit is contained in:
Pascal Massimino
2011-04-22 12:14:45 -07:00
parent e7ff3f9af6
commit cfbf88a6c4
7 changed files with 680 additions and 31 deletions

View File

@ -37,6 +37,8 @@
#include "webp/encode.h"
#include "stopwatch.h"
extern void* VP8GetCPUInfo;
//-----------------------------------------------------------------------------
static int verbose = 0;
@ -596,6 +598,7 @@ static void HelpLong(void) {
printf(" -short ................. condense printed message\n");
printf(" -quiet ................. don't print anything.\n");
printf(" -version ............... print version number and exit.\n");
printf(" -noasm ................. disable all assembly optimizations.\n");
printf(" -v ..................... verbose, e.g. print encoding/decoding "
"times\n");
printf("\n");
@ -680,6 +683,8 @@ int main(int argc, const char *argv[]) {
crop_y = strtol(argv[++c], NULL, 0);
crop_w = strtol(argv[++c], NULL, 0);
crop_h = strtol(argv[++c], NULL, 0);
} else if (!strcmp(argv[c], "-noasm")) {
VP8GetCPUInfo = NULL;
} else if (!strcmp(argv[c], "-version")) {
const int version = WebPGetEncoderVersion();
printf("%d.%d.%d\n",