Roll skia/third_party/skcms 710aa46f904e..b9dc92669da2 (1 commits)

https://skia.googlesource.com/skcms.git/+log/710aa46f904e..b9dc92669da2

2018-09-12 mtklein@google.com add little-endian 16-bit support


The AutoRoll server is located here: https://autoroll.skia.org/r/skcms-skia-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
TBR=caryclark@google.com

Change-Id: Ie88e77be7337669eb79799fb414791ccfb9bee1f
Reviewed-on: https://skia-review.googlesource.com/154078
Commit-Queue: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Reviewed-by: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
This commit is contained in:
skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com 2018-09-12 20:28:38 +00:00 committed by Skia Commit-Bot
parent 167e1ea5bc
commit 69bcd16f53
4 changed files with 149 additions and 52 deletions

View File

@ -1757,8 +1757,10 @@ typedef enum {
Op_load_888,
Op_load_8888,
Op_load_1010102,
Op_load_161616,
Op_load_16161616,
Op_load_161616LE,
Op_load_16161616LE,
Op_load_161616BE,
Op_load_16161616BE,
Op_load_hhh,
Op_load_hhhh,
Op_load_fff,
@ -1805,8 +1807,10 @@ typedef enum {
Op_store_888,
Op_store_8888,
Op_store_1010102,
Op_store_161616,
Op_store_16161616,
Op_store_161616LE,
Op_store_16161616LE,
Op_store_161616BE,
Op_store_16161616BE,
Op_store_hhh,
Op_store_hhhh,
Op_store_fff,
@ -1992,19 +1996,21 @@ static OpAndArg select_curve_op(const skcms_Curve* curve, int channel) {
static size_t bytes_per_pixel(skcms_PixelFormat fmt) {
switch (fmt >> 1) { // ignore rgb/bgr
case skcms_PixelFormat_A_8 >> 1: return 1;
case skcms_PixelFormat_G_8 >> 1: return 1;
case skcms_PixelFormat_ABGR_4444 >> 1: return 2;
case skcms_PixelFormat_RGB_565 >> 1: return 2;
case skcms_PixelFormat_RGB_888 >> 1: return 3;
case skcms_PixelFormat_RGBA_8888 >> 1: return 4;
case skcms_PixelFormat_RGBA_1010102 >> 1: return 4;
case skcms_PixelFormat_RGB_161616 >> 1: return 6;
case skcms_PixelFormat_RGBA_16161616 >> 1: return 8;
case skcms_PixelFormat_RGB_hhh >> 1: return 6;
case skcms_PixelFormat_RGBA_hhhh >> 1: return 8;
case skcms_PixelFormat_RGB_fff >> 1: return 12;
case skcms_PixelFormat_RGBA_ffff >> 1: return 16;
case skcms_PixelFormat_A_8 >> 1: return 1;
case skcms_PixelFormat_G_8 >> 1: return 1;
case skcms_PixelFormat_ABGR_4444 >> 1: return 2;
case skcms_PixelFormat_RGB_565 >> 1: return 2;
case skcms_PixelFormat_RGB_888 >> 1: return 3;
case skcms_PixelFormat_RGBA_8888 >> 1: return 4;
case skcms_PixelFormat_RGBA_1010102 >> 1: return 4;
case skcms_PixelFormat_RGB_161616LE >> 1: return 6;
case skcms_PixelFormat_RGBA_16161616LE >> 1: return 8;
case skcms_PixelFormat_RGB_161616BE >> 1: return 6;
case skcms_PixelFormat_RGBA_16161616BE >> 1: return 8;
case skcms_PixelFormat_RGB_hhh >> 1: return 6;
case skcms_PixelFormat_RGBA_hhhh >> 1: return 8;
case skcms_PixelFormat_RGB_fff >> 1: return 12;
case skcms_PixelFormat_RGBA_ffff >> 1: return 16;
}
assert(false);
return 0;
@ -2070,19 +2076,21 @@ bool skcms_Transform(const void* src,
switch (srcFmt >> 1) {
default: return false;
case skcms_PixelFormat_A_8 >> 1: *ops++ = Op_load_a8; break;
case skcms_PixelFormat_G_8 >> 1: *ops++ = Op_load_g8; break;
case skcms_PixelFormat_ABGR_4444 >> 1: *ops++ = Op_load_4444; break;
case skcms_PixelFormat_RGB_565 >> 1: *ops++ = Op_load_565; break;
case skcms_PixelFormat_RGB_888 >> 1: *ops++ = Op_load_888; break;
case skcms_PixelFormat_RGBA_8888 >> 1: *ops++ = Op_load_8888; break;
case skcms_PixelFormat_RGBA_1010102 >> 1: *ops++ = Op_load_1010102; break;
case skcms_PixelFormat_RGB_161616 >> 1: *ops++ = Op_load_161616; break;
case skcms_PixelFormat_RGBA_16161616 >> 1: *ops++ = Op_load_16161616; break;
case skcms_PixelFormat_RGB_hhh >> 1: *ops++ = Op_load_hhh; break;
case skcms_PixelFormat_RGBA_hhhh >> 1: *ops++ = Op_load_hhhh; break;
case skcms_PixelFormat_RGB_fff >> 1: *ops++ = Op_load_fff; break;
case skcms_PixelFormat_RGBA_ffff >> 1: *ops++ = Op_load_ffff; break;
case skcms_PixelFormat_A_8 >> 1: *ops++ = Op_load_a8; break;
case skcms_PixelFormat_G_8 >> 1: *ops++ = Op_load_g8; break;
case skcms_PixelFormat_ABGR_4444 >> 1: *ops++ = Op_load_4444; break;
case skcms_PixelFormat_RGB_565 >> 1: *ops++ = Op_load_565; break;
case skcms_PixelFormat_RGB_888 >> 1: *ops++ = Op_load_888; break;
case skcms_PixelFormat_RGBA_8888 >> 1: *ops++ = Op_load_8888; break;
case skcms_PixelFormat_RGBA_1010102 >> 1: *ops++ = Op_load_1010102; break;
case skcms_PixelFormat_RGB_161616LE >> 1: *ops++ = Op_load_161616LE; break;
case skcms_PixelFormat_RGBA_16161616LE >> 1: *ops++ = Op_load_16161616LE; break;
case skcms_PixelFormat_RGB_161616BE >> 1: *ops++ = Op_load_161616BE; break;
case skcms_PixelFormat_RGBA_16161616BE >> 1: *ops++ = Op_load_16161616BE; break;
case skcms_PixelFormat_RGB_hhh >> 1: *ops++ = Op_load_hhh; break;
case skcms_PixelFormat_RGBA_hhhh >> 1: *ops++ = Op_load_hhhh; break;
case skcms_PixelFormat_RGB_fff >> 1: *ops++ = Op_load_fff; break;
case skcms_PixelFormat_RGBA_ffff >> 1: *ops++ = Op_load_ffff; break;
}
if (srcFmt & 1) {
*ops++ = Op_swap_rb;
@ -2228,19 +2236,21 @@ bool skcms_Transform(const void* src,
}
switch (dstFmt >> 1) {
default: return false;
case skcms_PixelFormat_A_8 >> 1: *ops++ = Op_store_a8; break;
case skcms_PixelFormat_G_8 >> 1: *ops++ = Op_store_g8; break;
case skcms_PixelFormat_ABGR_4444 >> 1: *ops++ = Op_store_4444; break;
case skcms_PixelFormat_RGB_565 >> 1: *ops++ = Op_store_565; break;
case skcms_PixelFormat_RGB_888 >> 1: *ops++ = Op_store_888; break;
case skcms_PixelFormat_RGBA_8888 >> 1: *ops++ = Op_store_8888; break;
case skcms_PixelFormat_RGBA_1010102 >> 1: *ops++ = Op_store_1010102; break;
case skcms_PixelFormat_RGB_161616 >> 1: *ops++ = Op_store_161616; break;
case skcms_PixelFormat_RGBA_16161616 >> 1: *ops++ = Op_store_16161616; break;
case skcms_PixelFormat_RGB_hhh >> 1: *ops++ = Op_store_hhh; break;
case skcms_PixelFormat_RGBA_hhhh >> 1: *ops++ = Op_store_hhhh; break;
case skcms_PixelFormat_RGB_fff >> 1: *ops++ = Op_store_fff; break;
case skcms_PixelFormat_RGBA_ffff >> 1: *ops++ = Op_store_ffff; break;
case skcms_PixelFormat_A_8 >> 1: *ops++ = Op_store_a8; break;
case skcms_PixelFormat_G_8 >> 1: *ops++ = Op_store_g8; break;
case skcms_PixelFormat_ABGR_4444 >> 1: *ops++ = Op_store_4444; break;
case skcms_PixelFormat_RGB_565 >> 1: *ops++ = Op_store_565; break;
case skcms_PixelFormat_RGB_888 >> 1: *ops++ = Op_store_888; break;
case skcms_PixelFormat_RGBA_8888 >> 1: *ops++ = Op_store_8888; break;
case skcms_PixelFormat_RGBA_1010102 >> 1: *ops++ = Op_store_1010102; break;
case skcms_PixelFormat_RGB_161616LE >> 1: *ops++ = Op_store_161616LE; break;
case skcms_PixelFormat_RGBA_16161616LE >> 1: *ops++ = Op_store_16161616LE; break;
case skcms_PixelFormat_RGB_161616BE >> 1: *ops++ = Op_store_161616BE; break;
case skcms_PixelFormat_RGBA_16161616BE >> 1: *ops++ = Op_store_16161616BE; break;
case skcms_PixelFormat_RGB_hhh >> 1: *ops++ = Op_store_hhh; break;
case skcms_PixelFormat_RGBA_hhhh >> 1: *ops++ = Op_store_hhhh; break;
case skcms_PixelFormat_RGB_fff >> 1: *ops++ = Op_store_fff; break;
case skcms_PixelFormat_RGBA_ffff >> 1: *ops++ = Op_store_ffff; break;
}
auto run = baseline::run_program;

View File

@ -185,10 +185,21 @@ typedef enum skcms_PixelFormat {
skcms_PixelFormat_RGBA_1010102,
skcms_PixelFormat_BGRA_1010102,
skcms_PixelFormat_RGB_161616, // Big-endian. Pointers must be 16-bit aligned.
skcms_PixelFormat_BGR_161616,
skcms_PixelFormat_RGBA_16161616,
skcms_PixelFormat_BGRA_16161616,
skcms_PixelFormat_RGB_161616LE, // Little-endian. Pointers must be 16-bit aligned.
skcms_PixelFormat_BGR_161616LE,
skcms_PixelFormat_RGBA_16161616LE,
skcms_PixelFormat_BGRA_16161616LE,
skcms_PixelFormat_RGB_161616BE, // Big-endian. Pointers must be 16-bit aligned.
skcms_PixelFormat_BGR_161616BE,
skcms_PixelFormat_RGBA_16161616BE,
skcms_PixelFormat_BGRA_16161616BE,
// TODO: clean up references to non-explicit endian 16161616
skcms_PixelFormat_RGB_161616 = skcms_PixelFormat_RGB_161616BE,
skcms_PixelFormat_BGR_161616 = skcms_PixelFormat_BGR_161616BE,
skcms_PixelFormat_RGBA_16161616 = skcms_PixelFormat_RGBA_16161616BE,
skcms_PixelFormat_BGRA_16161616 = skcms_PixelFormat_BGRA_16161616BE,
skcms_PixelFormat_RGB_hhh, // 1-5-10 half-precision float.
skcms_PixelFormat_BGR_hhh, // Pointers must be 16-bit aligned.

View File

@ -658,7 +658,43 @@ static void exec_ops(const Op* ops, const void** args,
a = cast<F>((rgba >> 30) & 0x3 ) * (1/ 3.0f);
} break;
case Op_load_161616:{
case Op_load_161616LE:{
uintptr_t ptr = (uintptr_t)(src + 6*i);
assert( (ptr & 1) == 0 ); // src must be 2-byte aligned for this
const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
#if defined(USING_NEON)
uint16x4x3_t v = vld3_u16(rgb);
r = cast<F>((U16)v.val[0]) * (1/65535.0f);
g = cast<F>((U16)v.val[1]) * (1/65535.0f);
b = cast<F>((U16)v.val[2]) * (1/65535.0f);
#else
r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
#endif
} break;
case Op_load_16161616LE:{
uintptr_t ptr = (uintptr_t)(src + 8*i);
assert( (ptr & 1) == 0 ); // src must be 2-byte aligned for this
const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
#if defined(USING_NEON)
uint16x4x4_t v = vld4_u16(rgba);
r = cast<F>((U16)v.val[0]) * (1/65535.0f);
g = cast<F>((U16)v.val[1]) * (1/65535.0f);
b = cast<F>((U16)v.val[2]) * (1/65535.0f);
a = cast<F>((U16)v.val[3]) * (1/65535.0f);
#else
U64 px = load<U64>(rgba);
r = cast<F>((px >> 0) & 0xffff) * (1/65535.0f);
g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
#endif
} break;
case Op_load_161616BE:{
uintptr_t ptr = (uintptr_t)(src + 6*i);
assert( (ptr & 1) == 0 ); // src must be 2-byte aligned for this
const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
@ -678,7 +714,7 @@ static void exec_ops(const Op* ops, const void** args,
#endif
} break;
case Op_load_16161616:{
case Op_load_16161616BE:{
uintptr_t ptr = (uintptr_t)(src + 8*i);
assert( (ptr & 1) == 0 ); // src must be 2-byte aligned for this
const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
@ -977,7 +1013,47 @@ static void exec_ops(const Op* ops, const void** args,
| cast<U32>(to_fixed(a * 3) << 30));
} return;
case Op_store_161616: {
case Op_store_161616LE: {
uintptr_t ptr = (uintptr_t)(dst + 6*i);
assert( (ptr & 1) == 0 ); // The dst pointer must be 2-byte aligned
uint16_t* rgb = (uint16_t*)ptr; // for this cast to uint16_t* to be safe.
#if defined(USING_NEON)
uint16x4x3_t v = {{
(uint16x4_t)cast<U16>(to_fixed(r * 65535)),
(uint16x4_t)cast<U16>(to_fixed(g * 65535)),
(uint16x4_t)cast<U16>(to_fixed(b * 65535)),
}};
vst3_u16(rgb, v);
#else
store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
#endif
} return;
case Op_store_16161616LE: {
uintptr_t ptr = (uintptr_t)(dst + 8*i);
assert( (ptr & 1) == 0 ); // The dst pointer must be 2-byte aligned
uint16_t* rgba = (uint16_t*)ptr; // for this cast to uint16_t* to be safe.
#if defined(USING_NEON)
uint16x4x4_t v = {{
(uint16x4_t)cast<U16>(to_fixed(r * 65535)),
(uint16x4_t)cast<U16>(to_fixed(g * 65535)),
(uint16x4_t)cast<U16>(to_fixed(b * 65535)),
(uint16x4_t)cast<U16>(to_fixed(a * 65535)),
}};
vst4_u16(rgba, v);
#else
U64 px = cast<U64>(to_fixed(r * 65535)) << 0
| cast<U64>(to_fixed(g * 65535)) << 16
| cast<U64>(to_fixed(b * 65535)) << 32
| cast<U64>(to_fixed(a * 65535)) << 48;
store(rgba, px);
#endif
} return;
case Op_store_161616BE: {
uintptr_t ptr = (uintptr_t)(dst + 6*i);
assert( (ptr & 1) == 0 ); // The dst pointer must be 2-byte aligned
uint16_t* rgb = (uint16_t*)ptr; // for this cast to uint16_t* to be safe.
@ -999,7 +1075,7 @@ static void exec_ops(const Op* ops, const void** args,
} return;
case Op_store_16161616: {
case Op_store_16161616BE: {
uintptr_t ptr = (uintptr_t)(dst + 8*i);
assert( (ptr & 1) == 0 ); // The dst pointer must be 2-byte aligned
uint16_t* rgba = (uint16_t*)ptr; // for this cast to uint16_t* to be safe.

View File

@ -1 +1 @@
710aa46f904eeaeada89005257ed57ebf1019488
b9dc92669da2318ad57418afa0377e45264a9a07