SDWebImage / SDWebImageHEIFCoder

A SDWebImage coder plugin to support HEIF image without Apple's Image/IO framework
MIT License
33 stars 6 forks source link

Support for AVIF(AV1 codec for HEIF container) image format #4

Open dreampiggy opened 5 years ago

dreampiggy commented 5 years ago

AVIF is a AV1 codec based HEIF container. The spec is here: https://aomediacodec.github.io/av1-avif/

Current third-party HEIF decoder libheif does not support this format natively. But however, it's a future format which based on AV1 (VP9 's next successor). And it's the competition of current HEVC/H.265

In short term, since that AVIF spec is still in draft, we decide not to do some work for that. But however, after that spec is release or the third-party HEIF decoder libheif have support for AVIF, I'll update this and introduce the support.

dreampiggy commented 5 years ago

The AVIF's official spec v1.0.0 is released. Maybe it's possible to support it in the middle of this year. See: https://aomediacodec.github.io/av1-avif/

Depends: https://github.com/strukturag/libheif/tree/avif to be merged in upstream.

Or depends the future of https://github.com/strukturag/libheif/issues/96 to use dav1d instead of libaom codec.

Currentlly I can build a preview of the AVIF support in the avif branch.

EwoutH commented 5 years ago

libavif tagged a new release, 0.1.3. See Colorist for an example implementation.

dreampiggy commented 5 years ago

@EwoutH Actually...I've created one SDWebImageAVIFCoder specify for AVIF coder. And it exactly use libavif v1.0.3 (from v0.2.0, see: release)...Please have a try :)

dreampiggy commented 5 years ago

But to say, the libavif encoding speed is still a problem. From my local benchmark, it's 100x slower than WebP format, 100x slower than BPG image format... 😅

Benchmark code: ModernImageFormatBenchmark

dreampiggy commented 5 years ago

And. This repo have a avif branch. It based on the libheif support for AVIF (see their readme, they also have a avif branch).

The libheif codec implementation is far more performent than the AVIF, but it's not so stable. So this is why we currently only use that libavif for users. In the future, we will switch back to libheif codec implementation.