Hi Pierre,
When opening high-resolution HEIC or AVIF photos (such as 50MP 8160×6120 images from modern smartphones) in the XnView MP viewer, decoding currently runs on a single CPU thread, causing a noticeable delay when viewing or stepping through large photos. (This appears to be the root cause behind the sluggish HEIC browsing reported in this thread, and is similar to the earlier request for multithreaded JXL decoding.)
Modern smartphone cameras encode high-resolution HEIC/AVIF files as tiled grids.
For example, inspecting a 50MP Samsung Galaxy .heic photo with heif-info shows 192 independent tiles:
image: 8160x6120 (id=193), primary
tiles: 16x12, tile size: 512x512
colorspace: YCbCr, 4:2:0
bit depth: 8
libheif supports parallel tile decoding across multiple CPU cores out of the box, but defaults to 1 thread unless explicitly configured on the heif_context before calling heif_decode_image().
Would it be possible to pass the available CPU thread count to libheif when opening single HEIF/HEIC/AVIF files in the viewer?
In the libheif C API, this only requires calling:
cpp
heif_context_set_max_decoding_threads(ctx, max_threads); // e.g., std::thread::hardware_concurrency() or QThread::idealThreadCount()
(When Batch Convert is running multiple files concurrently across CPU cores, max_threads could remain 1 per worker to avoid thread oversubscription, while single-image viewing uses all available threads.)
Thank you for considering this—it would make browsing 50MP+ HEIC and AVIF photos dramatically faster!
Thx,
Alex
Enable multi-threaded tile decoding for HEIF/HEIC and AVIF (heif_context_set_max_decoding_threads)
Moderator: xnview
-
isarrider
- Posts: 1
- Joined: Tue Nov 17, 2026 6:12 pm