optimize the ARGB->ARGB Import to use memcpy

(instead of the generic VP8PackARGB call)

Change-Id: I86edeb5934e7c062593f0248de7607cca5f1027c
This commit is contained in:
Pascal Massimino 2017-02-03 16:54:52 +01:00
parent f153603900
commit b494fdec45

View File

@ -1105,9 +1105,14 @@ static int Import(WebPPicture* const picture,
if (import_alpha) {
uint32_t* dst = picture->argb;
const int do_copy = !swap_rb && !ALPHA_IS_LAST;
assert(step == 4);
for (y = 0; y < height; ++y) {
VP8PackARGB(a_ptr, r_ptr, g_ptr, b_ptr, width, dst);
if (do_copy) {
memcpy(dst, r_ptr, width * sizeof(*dst));
} else {
VP8PackARGB(a_ptr, r_ptr, g_ptr, b_ptr, width, dst);
}
a_ptr += rgb_stride;
r_ptr += rgb_stride;
g_ptr += rgb_stride;