mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
optimize the ARGB->ARGB Import to use memcpy
(instead of the generic VP8PackARGB call) Change-Id: I86edeb5934e7c062593f0248de7607cca5f1027c
This commit is contained in:
parent
f153603900
commit
b494fdec45
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user