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

Sergey Bylokhov serb at openjdk.org
Fri Apr 21 19:20:57 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% |

This pull request has now been integrated.

Changeset: 117c5b11
Author:    Sergey Bylokhov <serb at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/117c5b116b0c4e98ad34b3ddd3af844ed247ea09
Stats:     515 lines in 5 files changed: 485 ins; 7 del; 23 mod

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

Reviewed-by: prr

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

PR: https://git.openjdk.org/jdk/pull/13095



More information about the client-libs-dev mailing list