Skip to content

[kritamultiarch] Implement vectorization for the AVIF/HEIF plugin

Amy spark requested to merge lsegovia/krita:work/amyspark/kis-multi-arch into master

MRs !1546 (merged), !1547 (merged) and !1551 (merged) were the prerequisites for demonstrating this: a SIMD-accelerated file format plugin.

This MR proposes how we could manage the import and export of AVIF/HEIF files; in previous research of @woltherav, we'd already found the linearization step was the biggest performance hog (barring, of course, libheif's own time). To alleviate it, I'm proposing two separate alternatives here:

  • fully multi-arch'd dispatch of the linearization step for the import
  • SSE2/Neon only accelerated version for the export

Both alternatives make use of extensive build-time templating to remove all signs of branches within the conversion logic.

This is an example of the performance improvement:

Before After
imagen imagen

Test Plan

Build Krita and run tests. Then save and load AVIF HDR files.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

/cc @rempt @dragonmux

Edited by Amy spark

Merge request reports