saucecontrol / PhotoSauce

MagicScaler high-performance, high-quality image processing pipeline for .NET
http://photosauce.net/
MIT License
569 stars 49 forks source link

AVIF Encoder #110

Open iamcarbon opened 1 year ago

iamcarbon commented 1 year ago

Surfacing this feature request again now that the path to JXR support in browsers has become hazy, and Apple has committed to shipping AVIF across 3 OS versions in Safari 16.4 (currently in BETA). Microsoft Edge appears to be the last holdout to supporting AVIF natively.

What are our challenges to introducing AVIF encoding support to the library? How's libavif looking these days?

https://github.com/microsoft/vcpkg/blob/master/ports/libavif/vcpkg.json https://github.com/AOMediaCodec/libavif/blob/main/src/avif.c

saucecontrol commented 1 year ago

It's been a while, but I don't remember any particular challenges. I think I mostly gave up on AVIF because of the question marks around browser support and the insane memory/CPU expense of the software AV1 encoders. Then JXL had some momentum and looked like the better technology anyway 😢.

On the encode side, I've seen some promising numbers from SVT-AV1, which generally tests out an order of magnitude faster than libaom and is supported by the latest libheif. That's probably the quickest path to support, although I still intend to get rid of libheif eventually.

I'll give that a look soon and see if I can get it integrated into the current plugin.

iamcarbon commented 1 year ago

Some solid improvements in the SVT-AV1 release this week (https://gitlab.com/AOMediaCodec/SVT-AV1/-/releases/v1.5.0).

The benchmarks on the latest high-core count AVX-512 compatible chips are also looking really good.

saucecontrol commented 1 year ago

Thanks, I missed that one. I haven't had a chance to put together good benchmarks myself yet, but I've seen conflicting info on the image quality vs performance between AOM and SVT-AV1. SVT is whooping up in video encode speed (apparently mostly due to much better multi-threading), but from what I gather, the same doesn't apply to photo encoding. AOM also has an intra-only mode that is supposed to be better for photo quality.

This definitely demands some investigation 🕵️‍♂️

iamcarbon commented 10 months ago

Withdrawing this request, now that Safari has adopted JXL! Hopeful we'll see the other browser revisit again soon.