glide icon indicating copy to clipboard operation
glide copied to clipboard

AVIF decode time is too long

Open wangxuyang518 opened this issue 2 years ago • 2 comments

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?

wangxuyang518 avatar May 18 '22 03:05 wangxuyang518

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?

vigneshvg avatar May 19 '22 16:05 vigneshvg

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

wangxuyang518 avatar May 20 '22 02:05 wangxuyang518

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

vignesh-em avatar May 12 '23 15:05 vignesh-em

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).

vigneshvg avatar May 12 '23 16:05 vigneshvg