introduce WebPHasAlpha8b and WebPHasAlpha32b

Rewrote WebPPictureHasTransparency() to use them (even for argb).
This is 10% faster, for some reasons.

SSE2 version should be straightforward.
Removes a TODO.

Change-Id: I7ad5848fc5e355e2df505dbcd5a0f42fb6cbab41
This commit is contained in:
Pascal Massimino
2017-11-16 06:59:52 -08:00
parent 80285d97ad
commit 44a0ee3fa7
3 changed files with 38 additions and 15 deletions

View File

@ -578,6 +578,11 @@ void WebPMultARGBRow_C(uint32_t* const ptr, int width, int inverse);
extern void (*WebPPackRGB)(const uint8_t* r, const uint8_t* g, const uint8_t* b,
int len, int step, uint32_t* out);
// This function returns true if src[i] contains a value different from 0xff.
extern int (*WebPHasAlpha8b)(const uint8_t* src, int length);
// This function returns true if src[4*i] contains a value different from 0xff.
extern int (*WebPHasAlpha32b)(const uint8_t* src, int length);
// To be called first before using the above.
void WebPInitAlphaProcessing(void);