RFR: 8279216: Investigate implementation of premultiplied alpha in the Little-CMS 2.13

Phil Race prr at openjdk.org
Fri Apr 7 20:45:43 UTC 2023


On Mon, 20 Mar 2023 01:07:25 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> 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% |

Results look good. This passes all my testing.

-------------

Marked as reviewed by prr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13095#pullrequestreview-1376565699



More information about the client-libs-dev mailing list