bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.67k stars 6.12k forks source link

AVIF decode time is too long #4803

Open wangxuyang518 opened 2 years ago

wangxuyang518 commented 2 years ago

avif decoder is dependent on cpu , sometimes this decode process is too long 、sush as spending 10s or 5s

Is there a good optimization scheme?

vigneshvg commented 2 years ago

Yes AVIF decoder is dependent on the CPU. But ideally it should not take that long on any modern device.

Do you have a sample image that takes 5-10s to load? If so, i can try and take a look at what's going on. Also, which device are you trying this on?

wangxuyang518 commented 2 years ago

no explicit sample ,decoding long time is a random behavior . we also consider whether the avif file size affects the decoding. but at present, no rules have been found

vignesh-em commented 1 year ago

Android 12 introduces support for AVIF. Does this mean Glide can now take advantage of hardware acceleration (if available) to decode AVIFs?

vigneshvg commented 1 year ago

Android 12 introduces support for AVIF. Does this mean Glide can now take advantage of hardware acceleration (if available) to decode AVIFs?

Glide's AVIF integration is software only. So if you use that decoding will happen in software.

If you are using Glide without the AVIF integration, then AVIF images on Android 12+ will be decoded using the Android platform's decoder (which may be software or hardware depending on what the platform does). As far as i am aware, the platform does not use hardware AV1 decoder for AVIF decoding and uses software only. It is controlled by a system property which is not set by default on devices that i checked (Pixel 6, Pixel 7).