RFR: 8279216: Investigate implementation of premultiplied alpha in the Little-CMS 2.13 [v2]
Sergey Bylokhov
serb at openjdk.org
Thu Apr 13 21:24:30 UTC 2023
> Support of premultiplied alpha is added to the "accelerated" code path of the CMM. It is implemented on top of the new feature added to the littlecms library in 2.13 and 2.15.
>
> The next formats are now "supported": TYPE_INT_ARGB_PRE, TYPE_4BYTE_ABGR_PRE, and any custom images which use the ComponentColorModel+8-bit-precision like RGBApre or ApreBGR.
>
> After this patch, we will fully support all our standard types(8-bit precision), and mostly any combinations of blits between them, having two exceptions:
> * lcms does not convert pre-alpha for transparent src if dst is opaque
> * lcms does not set correct alpha(=1.0) for transparent dst if src is opaque
>
> Both of them are "features", so we probably need to implement a workaround someday, but for now we will use our generic/slow code.
>
> Performance results for the ColorConvertOp.filter() for images with premultiplied alpha.
>
> | Test | Base(avgt in us/op) | Fix(avgt in us/op) | Improvement % |
> | ------------- | ------------- | ------------- |------------- |
> | 32 Threads, from=sRGB:size=10:to=CIEXYZ | 97| 12| 708% |
> | 32 Threads, from=sRGB:size=100:to=CIEXYZ | 8 013 | 617 | 1199% |
> | 32 Threads, from=sRGB:size=1000:to=CIEXYZ | 651 838 | 104 969| 521% |
> | 1 Thread, from=sRGB:size=10:to=CIEXYZ | 21| 5| 320% |
> | 1 Thread, from=sRGB:size=100:to=CIEXYZ | 677 | 300 | 126% |
> | 1 Thread, from=sRGB:size=1000:to=CIEXYZ | 60 095 | 30 536 | 97% |
Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision:
SkipSampleModel
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/13095/files
- new: https://git.openjdk.org/jdk/pull/13095/files/c4ff2a6b..e5e012da
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=13095&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=13095&range=00-01
Stats: 84 lines in 2 files changed: 83 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/13095.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/13095/head:pull/13095
PR: https://git.openjdk.org/jdk/pull/13095
More information about the client-libs-dev
mailing list