GoogleChromeLabs / squoosh

Make images smaller using best-in-class codecs, right in the browser.
https://squoosh.app
Apache License 2.0
22.05k stars 1.56k forks source link

Update libavif (v0.12-main) and AOM (3.6) for improved compression and speed #1334

Closed andrerom closed 1 year ago

andrerom commented 1 year ago

Noticed there are several newer AOM and libavif releases where out that have focused a lot on compression quality and speed. There is no libavif tag yet using AOM 3.6 so used latests commit here.


Quick comparison locally:

Sustainable Development Goal 3 graphic, iprt.uneca.org

People crossing street in Vienna, unsplash.com Credit: https://unsplash.com/photos/PMxT0XtQ--A


Result is a bit of a mixed bag considering building this took 3 hours (on M1). Was hoping for both quality, size and speed improvements across the board, but 2 out of 3 in most cases at least.

x86-64 users might see better speed numbers as there are a fair bit of SSE (AOM 3.3) and AVX (AOM 3.5) optimizations recently in AOM (assuming WASM SIMD is used here for AVIF).

google-cla[bot] commented 1 year ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

andrerom commented 1 year ago

Since Google bot does not update it's comment with this: CLA has been signed, either click link above and click "Refresh", or directly the new invocation url.

jakearchibald commented 1 year ago

Thanks for this! I'll get the AVIF team to take a look, as I'd also like to know if there are new features we could be exposing.

andrerom commented 1 year ago

Great! And yes, might be there are incoming changes in libavif worth waiting for, and/or libavif/AOM features Squoosh could easily take advantage of for more speed/quality/features.

jakearchibald commented 1 year ago

I'm not so bothered about waiting, more that there may have been features already in this new version that we could expose. I also want them to check our glue code is still the best way to interface with the library. I've seen some colour shifting occasionally that makes me worry that we're doing something incorrect with colour spaces, but I've also seen others say that colour shifting is a general AVIF issue.

jakearchibald commented 1 year ago

I've updated things for the latest AVIF recommended internally. Let's land this! Thanks for the help @andrerom