-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebP support #7
base: master
Are you sure you want to change the base?
WebP support #7
Conversation
It may take seconds to decode an animated image. That make users wait too much time. My solution
The step 3 is the |
Please open a separate PR to update gradle and android sdk. |
Done. I'll try later to finish the complete function, and I can also give a try to #3 while I'm at it (in a separate PR). |
Any updates with this PR? |
I ended up rebasing the PR, however performance in release mode is 2x slower than Skia which also uses libwebp, so I think neon optimizations or cpu features are not working properly. I've tried to improve performance but the result was always the same. This also happened with the old Android.mk build instead of CMake... I'm out of ideas. |
It helps. bool webp_decode_buffer(...) {
...
webp_config.options.use_cropping = clip;
...
webp_config.options.use_scaling = ratio != 1;
...
} |
Indeed... that was the reason, now I've got the same results as Skia. Thanks! |
Was there any plans to merge this in? |
This PR adds support for WebP images (animated too) and updates gradle and the SDK to the latest version available.
Motivation: some sites may be using webp images, and Skia already supports this, so I thought why not include it here too. I'll accept it if you don't want to support webp though :).
I've split this PR into as many commits as possible to help reviewing. I can remove some of them if desired or move to a different PR.
This PR uses the whole libwebp library (tag v0.6.1). I haven't found a "decoding only" fork, but the folders
enc
andmux
could be deleted alongside some files insidedsp
andutils
. Those are not compiled anyways so it's probably not a problem.The
complete
function inimage_webp
is unfinished, but I don't understand yet how it works (I saw in png you clear the frames' buffer starting from the second frame and start over, but I still don't understand it).Also, I'm a bit concerned about memory management in
webp_decode
but I think it's fine.