SDWebImageAVIFCoder icon indicating copy to clipboard operation
SDWebImageAVIFCoder copied to clipboard

avifDecoderNextImage interface take a lot time

Open ghost opened this issue 3 years ago • 3 comments
trafficstars

截屏2022-11-01 16 53 49

Unit of time milliseconds iphone x: avifDecoderNextImage: 397.489014--SDCreateCGImageFromAVIF: 1.329102 iphone 11 pro max: avifDecoderNextImage: 279.439941--SDCreateCGImageFromAVIF: 1.563965

ghost avatar Nov 01 '22 08:11 ghost

This avifDecoderNextImage seems used for AVIF animated image (really rare but supported).

I think this need more information to test and increase performance. May need libavif's upstream help :)

dreampiggy avatar Dec 16 '22 08:12 dreampiggy

Known issue for animated AVIF. But we have no better way to avoid this.

A possible way is like using the internal API of AOM like https://github.com/SDWebImage/SDWebImageWebPCoder

Which calculate a latest reusable frame index and canvas without re-scan, but it's complicated and I have no free time to complete.

dreampiggy avatar May 16 '23 09:05 dreampiggy

You can have a try by different AVIF codec (for decoding)

From v0.11.0, we support using SDImageCoderAVIFDecodeCodecChoice to chooce codec at runtime. You can install all 4 AVIF decoding codec and compare them one by one

dreampiggy avatar Sep 28 '23 08:09 dreampiggy