Gcc ICE on compiling chromium 68 [arm64 armhf]
reassign 901290 gcc-6
notfound 901290 68.0.3440.7-1
found 6.4.0-17
thanks
Compiling chrome 68 with results an gcc ICE. This affects both arm64[1] and
armhf[2]. Filing against gcc-6 as this what buildd used, but this affects
other versions too:
+-------+-------+-------+-------+
| | gcc-6 | gcc-7 | gcc-8 |
+-------+-------+-------+-------+
| armhf | ICE | ICE | ICE |
| arm64 | ICE | works | works |
+-------+-------+-------+-------+
gcc-6 -MMD -MF obj/skia/skcms/Transform.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Igen -I../../third_party/skia/third_party/skcms -w -std=c11 -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -pthread -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -mfpu=vfpv3-d16 -mthumb -Wall -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-missing-field-initializers -Wno-unused-parameter -Os -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -std=gnu11 -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -c ../../third_party/skia/third_party/skcms/src/Transform.c -o obj/skia/skcms/Transform.o
In file included from ../../third_party/skia/third_party/skcms/src/Transform.c:176:0:
../../third_party/skia/third_party/skcms/src/Transform_inl.h: In function 'exec_ops':
../../third_party/skia/third_party/skcms/src/Transform_inl.h:159:20: internal compiler error: in store_constructor, at expr.c:6565
*rgba = (*rgba & 0x00ff00ff00ff00ff) << 8
~~~~~~~^~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccLLjPon.out file, please attach this to your bugreport.
[1] https://buildd.debian.org/status/fetch.php?pkg=chromium-browser&arch=arm64&ver=68.0.3440.7-1&stamp=1528688783&raw=1
[2] https://buildd.debian.org/status/fetch.php?pkg=chromium-browser&arch=armhf&ver=68.0.3440.7-1&stamp=1528694705&raw=1
// === BEGIN GCC DUMP ===
// Target: arm-linux-gnueabihf
// Configured with: ../src/configure -v --with-pkgversion='Debian 6.4.0-17' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-as=/usr/bin/arm-linux-gnueabihf-as --with-ld=/usr/bin/arm-linux-gnueabihf-ld --program-suffix=-6 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
// Thread model: posix
// gcc version 6.4.0 20180424 (Debian 6.4.0-17)
//
// In file included from ../../third_party/skia/third_party/skcms/src/Transform.c:176:0:
// ../../third_party/skia/third_party/skcms/src/Transform_inl.h: In function 'exec_ops':
// ../../third_party/skia/third_party/skcms/src/Transform_inl.h:159:20: internal compiler error: in store_constructor, at expr.c:6565
// *rgba = (*rgba & 0x00ff00ff00ff00ff) << 8
// ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
// Please submit a full bug report,
// with preprocessed source if appropriate.
// See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
// /usr/lib/gcc/arm-linux-gnueabihf/6/cc1 -quiet -I ../.. -I gen -I ../../third_party/skia/third_party/skcms -imultilib . -imultiarch arm-linux-gnueabihf -MMD obj/skia/skcms/Transform.d -MF obj/skia/skcms/Transform.o.d -MQ obj/skia/skcms/Transform.o -D_REENTRANT -D V8_DEPRECATION_WARNINGS -D USE_UDEV -D USE_AURA=1 -D USE_GLIB=1 -D USE_NSS_CERTS=1 -D USE_X11=1 -D NO_TCMALLOC -D FULL_SAFE_BROWSING -D SAFE_BROWSING_CSD -D SAFE_BROWSING_DB_LOCAL -D CHROMIUM_BUILD -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D _LARGEFILE64_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D _FORTIFY_SOURCE=2 -D NDEBUG -D NVALGRIND -D DYNAMIC_ANNOTATIONS_ENABLED=0 -D __DATE__= -D __TIME__= -D __TIMESTAMP__= -D _FORTIFY_SOURCE=2 ../../third_party/skia/third_party/skcms/src/Transform.c -quiet -dumpbase Transform.c -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -mfpu=vfpv3-d16 -mthumb -mtls-dialect=gnu -auxbase-strip obj/skia/skcms/Transform.o -g0 -g -Os -O2 -Wno-builtin-macro-redefined -Wall -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-missing-field-initializers -Wno-unused-parameter -Wdate-time -Wformat=1 -Werror=format-security -w -std=c11 -std=gnu11 -fno-strict-aliasing -fstack-protector -funwind-tables -fPIC -fno-delete-null-pointer-checks -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -fvisibility=hidden -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong --param ssp-buffer-size=4 -o - -frandom-seed=0 -fdump-noaddr
# 1 "../../third_party/skia/third_party/skcms/src/Transform.c"
# 1 "/<<PKGBUILDDIR>>/out/Release//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "../../third_party/skia/third_party/skcms/src/Transform.c"
# 1 "../../third_party/skia/third_party/skcms/src/../skcms.h" 1
# 1 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stdbool.h" 1 3 4
# 17 "../../third_party/skia/third_party/skcms/src/../skcms.h" 2
# 1 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h" 1 3 4
# 149 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h" 3 4
# 149 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 216 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h" 3 4
typedef unsigned int size_t;
# 328 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h" 3 4
typedef unsigned int wchar_t;
# 426 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h" 3 4
typedef struct {
long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
} max_align_t;
# 18 "../../third_party/skia/third_party/skcms/src/../skcms.h" 2
# 1 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/arm-linux-gnueabihf/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 424 "/usr/include/features.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/sys/cdefs.h" 1 3 4
# 427 "/usr/include/arm-linux-gnueabihf/sys/cdefs.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/wordsize.h" 1 3 4
# 428 "/usr/include/arm-linux-gnueabihf/sys/cdefs.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/long-double.h" 1 3 4
# 429 "/usr/include/arm-linux-gnueabihf/sys/cdefs.h" 2 3 4
# 425 "/usr/include/features.h" 2 3 4
# 448 "/usr/include/features.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/gnu/stubs.h" 1 3 4
# 10 "/usr/include/arm-linux-gnueabihf/gnu/stubs.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/gnu/stubs-hard.h" 1 3 4
# 11 "/usr/include/arm-linux-gnueabihf/gnu/stubs.h" 2 3 4
# 449 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/arm-linux-gnueabihf/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/types.h" 1 3 4
# 27 "/usr/include/arm-linux-gnueabihf/bits/types.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/wordsize.h" 1 3 4
# 28 "/usr/include/arm-linux-gnueabihf/bits/types.h" 2 3 4
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;
__extension__ typedef long long int __quad_t;
__extension__ typedef unsigned long long int __u_quad_t;
__extension__ typedef long long int __intmax_t;
__extension__ typedef unsigned long long int __uintmax_t;
# 130 "/usr/include/arm-linux-gnueabihf/bits/types.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/typesizes.h" 1 3 4
# 131 "/usr/include/arm-linux-gnueabihf/bits/types.h" 2 3 4
__extension__ typedef __u_quad_t __dev_t;
__extension__ typedef unsigned int __uid_t;
__extension__ typedef unsigned int __gid_t;
__extension__ typedef unsigned long int __ino_t;
__extension__ typedef __u_quad_t __ino64_t;
__extension__ typedef unsigned int __mode_t;
__extension__ typedef unsigned int __nlink_t;
__extension__ typedef long int __off_t;
__extension__ typedef __quad_t __off64_t;
__extension__ typedef int __pid_t;
__extension__ typedef struct { int __val[2]; } __fsid_t;
__extension__ typedef long int __clock_t;
__extension__ typedef unsigned long int __rlim_t;
__extension__ typedef __u_quad_t __rlim64_t;
__extension__ typedef unsigned int __id_t;
__extension__ typedef long int __time_t;
__extension__ typedef unsigned int __useconds_t;
__extension__ typedef long int __suseconds_t;
__extension__ typedef int __daddr_t;
__extension__ typedef int __key_t;
__extension__ typedef int __clockid_t;
__extension__ typedef void * __timer_t;
__extension__ typedef long int __blksize_t;
__extension__ typedef long int __blkcnt_t;
__extension__ typedef __quad_t __blkcnt64_t;
__extension__ typedef unsigned long int __fsblkcnt_t;
__extension__ typedef __u_quad_t __fsblkcnt64_t;
__extension__ typedef unsigned long int __fsfilcnt_t;
__extension__ typedef __u_quad_t __fsfilcnt64_t;
__extension__ typedef int __fsword_t;
__extension__ typedef int __ssize_t;
__extension__ typedef long int __syscall_slong_t;
__extension__ typedef unsigned long int __syscall_ulong_t;
typedef __off64_t __loff_t;
typedef char *__caddr_t;
__extension__ typedef int __intptr_t;
__extension__ typedef unsigned int __socklen_t;
typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/arm-linux-gnueabihf/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/arm-linux-gnueabihf/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;
__extension__
typedef long long int int_least64_t;
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;
__extension__
typedef unsigned long long int uint_least64_t;
typedef signed char int_fast8_t;
typedef int int_fast16_t;
typedef int int_fast32_t;
__extension__
typedef long long int int_fast64_t;
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
__extension__
typedef unsigned long long int uint_fast64_t;
# 103 "/usr/include/stdint.h" 3 4
typedef int intptr_t;
typedef unsigned int uintptr_t;
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stdint.h" 2 3 4
# 19 "../../third_party/skia/third_party/skcms/src/../skcms.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4
# 1 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 42 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memmove (void *__dest, const void *__src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int memcmp (const void *__s1, const void *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 90 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 121 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strncat (char *__restrict __dest, const char *__restrict __src,
size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcoll (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strxfrm (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 1 "/usr/include/arm-linux-gnueabihf/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/arm-linux-gnueabihf/bits/types/locale_t.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/types/__locale_t.h" 1 3 4
# 28 "/usr/include/arm-linux-gnueabihf/bits/types/__locale_t.h" 3 4
struct __locale_struct
{
struct __locale_data *__locales[13];
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
const char *__names[13];
};
typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/arm-linux-gnueabihf/bits/types/locale_t.h" 2 3 4
typedef __locale_t locale_t;
# 153 "/usr/include/string.h" 2 3 4
extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern char *strdup (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
extern char *strndup (const char *__string, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 225 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 252 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 272 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strspn (const char *__s, const char *__accept)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 302 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 329 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strtok (char *__restrict __s, const char *__restrict __delim)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern char *__strtok_r (char *__restrict __s,
const char *__restrict __delim,
char **__restrict __save_ptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
char **__restrict __save_ptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 384 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern size_t strnlen (const char *__string, size_t __maxlen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 409 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__nonnull__ (2)));
# 427 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/arm-linux-gnueabihf/6/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4
extern int bcmp (const void *__s1, const void *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bcopy (const void *__src, void *__dest, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int strcasecmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern int strncasecmp_l (const char *__s1, const char *__s2,
size_t __n, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
# 1 "/usr/include/arm-linux-gnueabihf/bits/strings_fortified.h" 1 3 4
# 22 "/usr/include/arm-linux-gnueabihf/bits/strings_fortified.h" 3 4
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void
__attribute__ ((__nothrow__ , __leaf__)) bcopy (const void *__src, void *__dest, size_t __len)
{
(void) __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void
__attribute__ ((__nothrow__ , __leaf__)) bzero (void *__dest, size_t __len)
{
(void) __builtin___memset_chk (__dest, '\0', __len, __builtin_object_size (__dest, 0));
}
# 145 "/usr/include/strings.h" 2 3 4
# 432 "/usr/include/string.h" 2 3 4
extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern char *strsep (char **__restrict __stringp,
const char *__restrict __delim)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *__stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 494 "/usr/include/string.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/string_fortified.h" 1 3 4
# 30 "/usr/include/arm-linux-gnueabihf/bits/string_fortified.h" 3 4
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void *
__attribute__ ((__nothrow__ , __leaf__)) memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len)
{
return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void *
__attribute__ ((__nothrow__ , __leaf__)) memmove (void *__dest, const void *__src, size_t __len)
{
return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
}
# 58 "/usr/include/arm-linux-gnueabihf/bits/string_fortified.h" 3 4
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void *
__attribute__ ((__nothrow__ , __leaf__)) memset (void *__dest, int __ch, size_t __len)
{
# 71 "/usr/include/arm-linux-gnueabihf/bits/string_fortified.h" 3 4
return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0));
}
void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void
__attribute__ ((__nothrow__ , __leaf__)) explicit_bzero (void *__dest, size_t __len)
{
__explicit_bzero_chk (__dest, __len, __builtin_object_size (__dest, 0));
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
__attribute__ ((__nothrow__ , __leaf__)) strcpy (char *__restrict __dest, const char *__restrict __src)
{
return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
}
# 102 "/usr/include/arm-linux-gnueabihf/bits/string_fortified.h" 3 4
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
__attribute__ ((__nothrow__ , __leaf__)) strncpy (char *__restrict __dest, const char *__restrict __src, size_t __len)
{
return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
}
extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
size_t __destlen) __attribute__ ((__nothrow__ , __leaf__));
extern char *__stpncpy_alias (char *__dest, const char *__src, size_t __n) __asm__ ("" "stpncpy") __attribute__ ((__nothrow__ , __leaf__))
;
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
__attribute__ ((__nothrow__ , __leaf__)) stpncpy (char *__dest, const char *__src, size_t __n)
{
if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1
&& (!__builtin_constant_p (__n) || __n > __builtin_object_size (__dest, 2 > 1)))
return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1));
return __stpncpy_alias (__dest, __src, __n);
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
__attribute__ ((__nothrow__ , __leaf__)) strcat (char *__restrict __dest, const char *__restrict __src)
{
return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
__attribute__ ((__nothrow__ , __leaf__)) strncat (char *__restrict __dest, const char *__restrict __src, size_t __len)
{
return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
}
# 495 "/usr/include/string.h" 2 3 4
# 20 "../../third_party/skia/third_party/skcms/src/../skcms.h" 2
# 26 "../../third_party/skia/third_party/skcms/src/../skcms.h"
typedef struct skcms_Matrix3x3 {
float vals[3][3];
} skcms_Matrix3x3;
typedef struct skcms_Matrix3x4 {
float vals[3][4];
} skcms_Matrix3x4;
# 42 "../../third_party/skia/third_party/skcms/src/../skcms.h"
typedef struct skcms_TransferFunction {
float g, a,b,c,d,e,f;
} skcms_TransferFunction;
typedef union skcms_Curve {
struct {
uint32_t alias_of_table_entries;
skcms_TransferFunction parametric;
};
struct {
uint32_t table_entries;
const uint8_t* table_8;
const uint8_t* table_16;
};
} skcms_Curve;
typedef struct skcms_A2B {
uint32_t input_channels;
skcms_Curve input_curves[4];
uint8_t grid_points[4];
const uint8_t* grid_8;
const uint8_t* grid_16;
uint32_t matrix_channels;
skcms_Curve matrix_curves[3];
skcms_Matrix3x4 matrix;
uint32_t output_channels;
skcms_Curve output_curves[3];
} skcms_A2B;
typedef struct skcms_ICCProfile {
const uint8_t* buffer;
uint32_t size;
uint32_t data_color_space;
uint32_t pcs;
uint32_t tag_count;
# 93 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 93 "../../third_party/skia/third_party/skcms/src/../skcms.h"
has_trc;
skcms_Curve trc[3];
# 98 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 98 "../../third_party/skia/third_party/skcms/src/../skcms.h"
has_toXYZD50;
skcms_Matrix3x3 toXYZD50;
# 103 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 103 "../../third_party/skia/third_party/skcms/src/../skcms.h"
has_A2B;
skcms_A2B A2B;
} skcms_ICCProfile;
const skcms_ICCProfile* skcms_sRGB_profile(void);
const skcms_ICCProfile* skcms_XYZD50_profile(void);
const skcms_TransferFunction* skcms_sRGB_TransferFunction(void);
const skcms_TransferFunction* skcms_sRGB_Inverse_TransferFunction(void);
const skcms_TransferFunction* skcms_Identity_TransferFunction(void);
# 119 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 119 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_ApproximatelyEqualProfiles(const skcms_ICCProfile* A,
const skcms_ICCProfile* B);
# 125 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 125 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_AreApproximateInverses(const skcms_Curve* curve,
const skcms_TransferFunction* inv_tf);
# 131 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 131 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_TRCs_AreApproximateInverse(const skcms_ICCProfile* profile,
const skcms_TransferFunction* inv_tf);
# 137 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 137 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_Parse(const void*, size_t, skcms_ICCProfile*);
static inline void skcms_OptimizeForSpeed(skcms_ICCProfile* p) { (void)p; }
# 142 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 142 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_ApproximateCurve(const skcms_Curve* curve,
skcms_TransferFunction* approx,
float* max_error);
typedef struct skcms_ICCTag {
uint32_t signature;
uint32_t type;
uint32_t size;
const uint8_t* buf;
} skcms_ICCTag;
void skcms_GetTagByIndex (const skcms_ICCProfile*, uint32_t idx, skcms_ICCTag*);
# 154 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 154 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_GetTagBySignature(const skcms_ICCProfile*, uint32_t sig, skcms_ICCTag*);
enum {
skcms_Signature_CMYK = 0x434D594B,
skcms_Signature_Gray = 0x47524159,
skcms_Signature_RGB = 0x52474220,
skcms_Signature_Lab = 0x4C616220,
skcms_Signature_XYZ = 0x58595A20,
};
typedef enum skcms_PixelFormat {
skcms_PixelFormat_RGB_565,
skcms_PixelFormat_BGR_565,
skcms_PixelFormat_RGB_888,
skcms_PixelFormat_BGR_888,
skcms_PixelFormat_RGBA_8888,
skcms_PixelFormat_BGRA_8888,
skcms_PixelFormat_RGBA_1010102,
skcms_PixelFormat_BGRA_1010102,
skcms_PixelFormat_RGB_161616,
skcms_PixelFormat_BGR_161616,
skcms_PixelFormat_RGBA_16161616,
skcms_PixelFormat_BGRA_16161616,
skcms_PixelFormat_RGB_hhh,
skcms_PixelFormat_BGR_hhh,
skcms_PixelFormat_RGBA_hhhh,
skcms_PixelFormat_BGRA_hhhh,
skcms_PixelFormat_RGB_fff,
skcms_PixelFormat_BGR_fff,
skcms_PixelFormat_RGBA_ffff,
skcms_PixelFormat_BGRA_ffff,
} skcms_PixelFormat;
# 208 "../../third_party/skia/third_party/skcms/src/../skcms.h"
typedef enum skcms_AlphaFormat {
skcms_AlphaFormat_Opaque,
skcms_AlphaFormat_Unpremul,
skcms_AlphaFormat_PremulAsEncoded,
skcms_AlphaFormat_PremulLinear,
} skcms_AlphaFormat;
# 221 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 221 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_Transform(const void* src,
skcms_PixelFormat srcFmt,
skcms_AlphaFormat srcAlpha,
const skcms_ICCProfile* srcProfile,
void* dst,
skcms_PixelFormat dstFmt,
skcms_AlphaFormat dstAlpha,
const skcms_ICCProfile* dstProfile,
size_t npixels);
# 234 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 234 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_MakeUsableAsDestination(skcms_ICCProfile* profile);
# 240 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 240 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_MakeUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile);
# 242 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
_Bool
# 242 "../../third_party/skia/third_party/skcms/src/../skcms.h"
skcms_PrimariesToXYZD50(float rx, float ry,
float gx, float gy,
float bx, float by,
float wx, float wy,
skcms_Matrix3x3* toXYZD50);
static inline void skcms_Init(skcms_ICCProfile* p) {
memset(p, 0, sizeof(*p));
p->data_color_space = skcms_Signature_RGB;
p->pcs = skcms_Signature_XYZ;
}
static inline void skcms_SetTransferFunction(skcms_ICCProfile* p,
const skcms_TransferFunction* tf) {
p->has_trc =
# 257 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
1
# 257 "../../third_party/skia/third_party/skcms/src/../skcms.h"
;
for (int i = 0; i < 3; ++i) {
p->trc[i].table_entries = 0;
p->trc[i].parametric = *tf;
}
}
static inline void skcms_SetXYZD50(skcms_ICCProfile* p, const skcms_Matrix3x3* m) {
p->has_toXYZD50 =
# 265 "../../third_party/skia/third_party/skcms/src/../skcms.h" 3 4
1
# 265 "../../third_party/skia/third_party/skcms/src/../skcms.h"
;
p->toXYZD50 = *m;
}
# 9 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 1 "../../third_party/skia/third_party/skcms/src/Curve.h" 1
float skcms_eval_curve(const skcms_Curve*, float x);
float skcms_MaxRoundtripError(const skcms_Curve* curve, const skcms_TransferFunction* inv_tf);
# 10 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 1 "../../third_party/skia/third_party/skcms/src/LinearAlgebra.h" 1
typedef struct { float vals[3]; } skcms_Vector3;
# 15 "../../third_party/skia/third_party/skcms/src/LinearAlgebra.h" 3 4
_Bool
# 15 "../../third_party/skia/third_party/skcms/src/LinearAlgebra.h"
skcms_Matrix3x3_invert(const skcms_Matrix3x3*, skcms_Matrix3x3*);
skcms_Matrix3x3 skcms_Matrix3x3_concat(const skcms_Matrix3x3* A, const skcms_Matrix3x3* B);
skcms_Vector3 skcms_MV_mul(const skcms_Matrix3x3*, const skcms_Vector3*);
# 11 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 1 "../../third_party/skia/third_party/skcms/src/Macros.h" 1
# 12 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 1 "../../third_party/skia/third_party/skcms/src/PortableMath.h" 1
static const union {
uint32_t bits;
float f;
} inf_ = { 0x7f800000 };
static inline float floorf_(float x) {
float roundtrip = (float)((int)x);
return roundtrip > x ? roundtrip - 1 : roundtrip;
}
static inline float fmaxf_(float x, float y) { return x > y ? x : y; }
static inline float fminf_(float x, float y) { return x < y ? x : y; }
static inline float fabsf_(float x) { return x < 0 ? -x : x; }
float log2f_(float);
float exp2f_(float);
float powf_(float, float);
static inline
# 30 "../../third_party/skia/third_party/skcms/src/PortableMath.h" 3 4
_Bool
# 30 "../../third_party/skia/third_party/skcms/src/PortableMath.h"
isfinitef_(float x) { return 0 == x*0; }
# 13 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 1 "../../third_party/skia/third_party/skcms/src/TransferFunction.h" 1
# 14 "../../third_party/skia/third_party/skcms/src/TransferFunction.h" 3 4
_Bool
# 14 "../../third_party/skia/third_party/skcms/src/TransferFunction.h"
skcms_TransferFunction_isValid(const skcms_TransferFunction*);
float skcms_TransferFunction_eval(const skcms_TransferFunction*, float);
# 18 "../../third_party/skia/third_party/skcms/src/TransferFunction.h" 3 4
_Bool
# 18 "../../third_party/skia/third_party/skcms/src/TransferFunction.h"
skcms_TransferFunction_invert(const skcms_TransferFunction*, skcms_TransferFunction*);
int skcms_fit_linear(const skcms_Curve*, int N, float tol, float* c, float* d, float* f);
# 14 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 1 "../../third_party/skia/third_party/skcms/src/Transform.h" 1
# 10 "../../third_party/skia/third_party/skcms/src/Transform.h"
# 60 "../../third_party/skia/third_party/skcms/src/Transform.h"
typedef enum {
Op_noop, Op_load_565, Op_load_888, Op_load_8888, Op_load_1010102, Op_load_161616, Op_load_16161616, Op_load_hhh, Op_load_hhhh, Op_load_fff, Op_load_ffff, Op_swap_rb, Op_clamp, Op_invert, Op_force_opaque, Op_premul, Op_unpremul, Op_matrix_3x3, Op_matrix_3x4, Op_lab_to_xyz, Op_tf_r, Op_tf_g, Op_tf_b, Op_tf_a, Op_table_8_r, Op_table_8_g, Op_table_8_b, Op_table_8_a, Op_table_16_r, Op_table_16_g, Op_table_16_b, Op_table_16_a, Op_clut_3D_8, Op_clut_3D_16, Op_clut_4D_8, Op_clut_4D_16, Op_store_565, Op_store_888, Op_store_8888, Op_store_1010102, Op_store_161616, Op_store_16161616, Op_store_hhh, Op_store_hhhh, Op_store_fff, Op_store_ffff,
} Op;
# 15 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 16 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 1 "/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h" 1 3 4
# 34 "/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h" 3 4
# 1 "/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/syslimits.h" 1 3 4
# 1 "/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h" 1 3 4
# 168 "/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 183 "/usr/include/limits.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/posix1_lim.h" 1 3 4
# 160 "/usr/include/arm-linux-gnueabihf/bits/posix1_lim.h" 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/local_lim.h" 1 3 4
# 38 "/usr/include/arm-linux-gnueabihf/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/arm-linux-gnueabihf/bits/local_lim.h" 2 3 4
# 161 "/usr/include/arm-linux-gnueabihf/bits/posix1_lim.h" 2 3 4
# 184 "/usr/include/limits.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabihf/bits/posix2_lim.h" 1 3 4
# 188 "/usr/include/limits.h" 2 3 4
# 169 "/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h" 2 3 4
# 8 "/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h" 2 3 4
# 17 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
extern
# 20 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
_Bool
# 20 "../../third_party/skia/third_party/skcms/src/Transform.c"
g_skcms_dump_profile;
# 21 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
_Bool
# 21 "../../third_party/skia/third_party/skcms/src/Transform.c"
g_skcms_dump_profile =
# 21 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 21 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
# 71 "../../third_party/skia/third_party/skcms/src/Transform.c"
static inline Op profile_next_op(Op op) {
(void)g_skcms_dump_profile;
return op;
}
# 99 "../../third_party/skia/third_party/skcms/src/Transform.c"
typedef float __attribute__((vector_size(16))) Fx4;
typedef int32_t __attribute__((vector_size(16))) I32x4;
typedef uint64_t __attribute__((vector_size(32))) U64x4;
typedef uint32_t __attribute__((vector_size(16))) U32x4;
typedef uint16_t __attribute__((vector_size( 8))) U16x4;
typedef uint8_t __attribute__((vector_size( 4))) U8x4;
typedef float __attribute__((vector_size(32))) Fx8;
typedef int32_t __attribute__((vector_size(32))) I32x8;
typedef uint64_t __attribute__((vector_size(64))) U64x8;
typedef uint32_t __attribute__((vector_size(32))) U32x8;
typedef uint16_t __attribute__((vector_size(16))) U16x8;
typedef uint8_t __attribute__((vector_size( 8))) U8x8;
typedef float __attribute__((vector_size( 64))) Fx16;
typedef int32_t __attribute__((vector_size( 64))) I32x16;
typedef uint64_t __attribute__((vector_size(128))) U64x16;
typedef uint32_t __attribute__((vector_size( 64))) U32x16;
typedef uint16_t __attribute__((vector_size( 32))) U16x16;
typedef uint8_t __attribute__((vector_size( 16))) U8x16;
# 176 "../../third_party/skia/third_party/skcms/src/Transform.c"
# 1 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 1
# 88 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
static inline __attribute__((always_inline)) I32x4 to_fixed_(Fx4 f) { return (I32x4){(f + 0.5f)[0],(f + 0.5f)[1],(f + 0.5f)[2],(f + 0.5f)[3]}; }
# 117 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
static inline __attribute__((always_inline)) Fx4 F_from_Half_(U16x4 half) {
U32x4 wide = (U32x4){(half)[0],(half)[1],(half)[2],(half)[3]};
U32x4 s = wide & 0x8000,
em = wide ^ s;
U32x4 norm_bits = (s<<16) + (em<<13) + ((127-15)<<23);
Fx4 norm;
__builtin_memcpy(&norm, &norm_bits, sizeof(norm));
return (Fx4)( ((em < 0x0400) & (I32x4)((Fx4){0,0,0,0})) | (~(em < 0x0400) & (I32x4)(norm)) );
}
static inline __attribute__((always_inline)) U16x4 Half_from_F_(Fx4 f) {
U32x4 sem;
__builtin_memcpy(&sem, &f, sizeof(sem));
U32x4 s = sem & 0x80000000,
em = sem ^ s;
return (U16x4){((U32x4)( ((em < 0x38800000) & (I32x4)((U32x4)(Fx4){0,0,0,0})) | (~(em < 0x38800000) & (I32x4)((s>>16) + (em>>13) - ((127-15)<<10))) ))[0],((U32x4)( ((em < 0x38800000) & (I32x4)((U32x4)(Fx4){0,0,0,0})) | (~(em < 0x38800000) & (I32x4)((s>>16) + (em>>13) - ((127-15)<<10))) ))[1],((U32x4)( ((em < 0x38800000) & (I32x4)((U32x4)(Fx4){0,0,0,0})) | (~(em < 0x38800000) & (I32x4)((s>>16) + (em>>13) - ((127-15)<<10))) ))[2],((U32x4)( ((em < 0x38800000) & (I32x4)((U32x4)(Fx4){0,0,0,0})) | (~(em < 0x38800000) & (I32x4)((s>>16) + (em>>13) - ((127-15)<<10))) ))[3]}
;
}
# 158 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
static inline __attribute__((always_inline)) void swap_endian_16x4_(U64x4* rgba) {
*rgba = (*rgba & 0x00ff00ff00ff00ff) << 8
| (*rgba & 0xff00ff00ff00ff00) >> 8;
}
static inline __attribute__((always_inline)) Fx4 min__(Fx4 x, Fx4 y) { return (Fx4)( ((x > y) & (I32x4)(y)) | (~(x > y) & (I32x4)(x)) ); }
static inline __attribute__((always_inline)) Fx4 max__(Fx4 x, Fx4 y) { return (Fx4)( ((x < y) & (I32x4)(y)) | (~(x < y) & (I32x4)(x)) ); }
static inline __attribute__((always_inline)) Fx4 floor__(Fx4 x) {
# 188 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
Fx4 roundtrip = (Fx4){((I32x4){(x)[0],(x)[1],(x)[2],(x)[3]})[0],((I32x4){(x)[0],(x)[1],(x)[2],(x)[3]})[1],((I32x4){(x)[0],(x)[1],(x)[2],(x)[3]})[2],((I32x4){(x)[0],(x)[1],(x)[2],(x)[3]})[3]};
return roundtrip - (Fx4)( ((roundtrip > x) & (I32x4)((Fx4){1,1,1,1})) | (~(roundtrip > x) & (I32x4)((Fx4){0,0,0,0})) );
}
static inline __attribute__((always_inline)) Fx4 approx_log2_(Fx4 x) {
I32x4 bits;
__builtin_memcpy(&bits, &x, sizeof(bits));
Fx4 e = (Fx4){(bits)[0],(bits)[1],(bits)[2],(bits)[3]} * (1.0f / (1<<23));
I32x4 m_bits = (bits & 0x007fffff) | 0x3f000000;
Fx4 m;
__builtin_memcpy(&m, &m_bits, sizeof(m));
return e - 124.225514990f
- 1.498030302f*m
- 1.725879990f/(0.3520887068f + m);
}
static inline __attribute__((always_inline)) Fx4 approx_exp2_(Fx4 x) {
Fx4 fract = x - floor__(x);
I32x4 bits = (I32x4){((1.0f * (1<<23)) * (x + 121.274057500f - 1.490129070f*fract + 27.728023300f/(4.84252568f - fract)))[0],((1.0f * (1<<23)) * (x + 121.274057500f - 1.490129070f*fract + 27.728023300f/(4.84252568f - fract)))[1],((1.0f * (1<<23)) * (x + 121.274057500f - 1.490129070f*fract + 27.728023300f/(4.84252568f - fract)))[2],((1.0f * (1<<23)) * (x + 121.274057500f - 1.490129070f*fract + 27.728023300f/(4.84252568f - fract)))[3]}
;
__builtin_memcpy(&x, &bits, sizeof(x));
return x;
}
static inline __attribute__((always_inline)) Fx4 approx_pow_(Fx4 x, float y) {
# 237 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
return (Fx4)( (((x == (Fx4){0,0,0,0}) | (x == (Fx4){1,1,1,1})) & (I32x4)(x)) | (~((x == (Fx4){0,0,0,0}) | (x == (Fx4){1,1,1,1})) & (I32x4)(approx_exp2_(approx_log2_(x) * y))) )
;
}
static inline __attribute__((always_inline)) Fx4 apply_transfer_function_(const skcms_TransferFunction* tf, Fx4 x) {
Fx4 sign = (Fx4)( ((x < 0) & (I32x4)(-(Fx4){1,1,1,1})) | (~(x < 0) & (I32x4)((Fx4){1,1,1,1})) );
x *= sign;
Fx4 linear = tf->c*x + tf->f;
Fx4 nonlinear = approx_pow_(tf->a*x + tf->b, tf->g) + tf->e;
return sign * (Fx4)( ((x < tf->d) & (I32x4)(linear)) | (~(x < tf->d) & (I32x4)(nonlinear)) );
}
# 298 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
static inline __attribute__((always_inline)) U8x4 gather_8_(const uint8_t* p, I32x4 ix) {
U8x4 v = { p[ix[0]], p[ix[1]], p[ix[2]], p[ix[3]] };
# 312 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
return v;
}
static inline __attribute__((always_inline)) uint16_t load_16_(const uint8_t* p, int ix) {
uint16_t v;
__builtin_memcpy(&v, p + 2*ix, 2);
return v;
}
static inline __attribute__((always_inline)) U16x4 gather_16_(const uint8_t* p, I32x4 ix) {
U16x4 v = { load_16_(p,ix[0]), load_16_(p,ix[1]), load_16_(p,ix[2]), load_16_(p,ix[3]) };
# 338 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
return v;
}
static inline __attribute__((always_inline)) uint32_t load_24_32_(const uint8_t* p, int ix) {
uint32_t v;
__builtin_memcpy(&v, p + 3*ix, 4);
return v;
}
static inline __attribute__((always_inline)) uint64_t load_48_64_(const uint8_t* p, int ix) {
uint64_t v;
__builtin_memcpy(&v, p + 6*ix, 8);
return v;
}
static inline __attribute__((always_inline)) U32x4 gather_24_(const uint8_t* p, I32x4 ix) {
p -= 1;
U32x4 v = { load_24_32_(p,ix[0]), load_24_32_(p,ix[1]), load_24_32_(p,ix[2]), load_24_32_(p,ix[3]) };
# 392 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
return v >> 8;
}
# 451 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
static inline __attribute__((always_inline)) Fx4 F_from_U8_(U8x4 v) {
return (Fx4){(v)[0],(v)[1],(v)[2],(v)[3]} * (1/255.0f);
}
static inline __attribute__((always_inline)) Fx4 F_from_U16_BE_(U16x4 v) {
v = (U16x4)( ((v<<8)|(v>>8)) & 0xffff );
return (Fx4){(v)[0],(v)[1],(v)[2],(v)[3]} * (1/65535.0f);
}
static inline __attribute__((always_inline)) Fx4 minus_1_ulp_(Fx4 v) {
I32x4 bits;
__builtin_memcpy(&bits, &v, sizeof(bits));
bits = bits - 1;
__builtin_memcpy(&v, &bits, sizeof(bits));
return v;
}
static inline __attribute__((always_inline)) Fx4 table_8_(const skcms_Curve* curve, Fx4 v) {
Fx4 ix = max__((Fx4){0,0,0,0}, min__(v, (Fx4){1,1,1,1})) * (float)(curve->table_entries - 1);
I32x4 lo = (I32x4){(ix)[0],(ix)[1],(ix)[2],(ix)[3]},
hi = (I32x4){(minus_1_ulp_(ix+1.0f))[0],(minus_1_ulp_(ix+1.0f))[1],(minus_1_ulp_(ix+1.0f))[2],(minus_1_ulp_(ix+1.0f))[3]};
Fx4 t = ix - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]};
Fx4 l = F_from_U8_(gather_8_(curve->table_8, lo)),
h = F_from_U8_(gather_8_(curve->table_8, hi));
return l + (h-l)*t;
}
static inline __attribute__((always_inline)) Fx4 table_16_(const skcms_Curve* curve, Fx4 v) {
Fx4 ix = max__((Fx4){0,0,0,0}, min__(v, (Fx4){1,1,1,1})) * (float)(curve->table_entries - 1);
I32x4 lo = (I32x4){(ix)[0],(ix)[1],(ix)[2],(ix)[3]},
hi = (I32x4){(minus_1_ulp_(ix+1.0f))[0],(minus_1_ulp_(ix+1.0f))[1],(minus_1_ulp_(ix+1.0f))[2],(minus_1_ulp_(ix+1.0f))[3]};
Fx4 t = ix - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]};
Fx4 l = F_from_U16_BE_(gather_16_(curve->table_16, lo)),
h = F_from_U16_BE_(gather_16_(curve->table_16, hi));
return l + (h-l)*t;
}
static inline __attribute__((always_inline)) void clut_0_8_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) {
U32x4 rgb = gather_24_(a2b->grid_8, ix);
*r = (Fx4){((rgb >> 0) & 0xff)[0],((rgb >> 0) & 0xff)[1],((rgb >> 0) & 0xff)[2],((rgb >> 0) & 0xff)[3]} * (1/255.0f);
*g = (Fx4){((rgb >> 8) & 0xff)[0],((rgb >> 8) & 0xff)[1],((rgb >> 8) & 0xff)[2],((rgb >> 8) & 0xff)[3]} * (1/255.0f);
*b = (Fx4){((rgb >> 16) & 0xff)[0],((rgb >> 16) & 0xff)[1],((rgb >> 16) & 0xff)[2],((rgb >> 16) & 0xff)[3]} * (1/255.0f);
(void)a;
(void)stride;
}
static inline __attribute__((always_inline)) void clut_0_16_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) {
*r = F_from_U16_BE_(gather_16_(a2b->grid_16, 3*ix+0));
*g = F_from_U16_BE_(gather_16_(a2b->grid_16, 3*ix+1));
*b = F_from_U16_BE_(gather_16_(a2b->grid_16, 3*ix+2));
# 533 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
(void)a;
(void)stride;
}
# 571 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
static inline void clut_1_8_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) { I32x4 limit = (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]}; limit += a2b->grid_points[1 -1]; const Fx4* srcs[] = { r,g,b,&a }; Fx4 src = *srcs[1 -1]; Fx4 x = max__((Fx4){0,0,0,0}, min__(src, (Fx4){1,1,1,1})) * (Fx4){(limit - 1)[0],(limit - 1)[1],(limit - 1)[2],(limit - 1)[3]}; I32x4 lo = (I32x4){(x)[0],(x)[1],(x)[2],(x)[3]}, hi = (I32x4){(minus_1_ulp_(x+1.0f))[0],(minus_1_ulp_(x+1.0f))[1],(minus_1_ulp_(x+1.0f))[2],(minus_1_ulp_(x+1.0f))[3]}; Fx4 lr = *r, lg = *g, lb = *b, hr = *r, hg = *g, hb = *b; clut_0_8_(a2b, stride*lo + ix, stride*limit, &lr,&lg,&lb,a); clut_0_8_(a2b, stride*hi + ix, stride*limit, &hr,&hg,&hb,a); Fx4 t = x - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]}; *r = lr + (hr-lr)*t; *g = lg + (hg-lg)*t; *b = lb + (hb-lb)*t; }
static inline void clut_2_8_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) { I32x4 limit = (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]}; limit += a2b->grid_points[2 -1]; const Fx4* srcs[] = { r,g,b,&a }; Fx4 src = *srcs[2 -1]; Fx4 x = max__((Fx4){0,0,0,0}, min__(src, (Fx4){1,1,1,1})) * (Fx4){(limit - 1)[0],(limit - 1)[1],(limit - 1)[2],(limit - 1)[3]}; I32x4 lo = (I32x4){(x)[0],(x)[1],(x)[2],(x)[3]}, hi = (I32x4){(minus_1_ulp_(x+1.0f))[0],(minus_1_ulp_(x+1.0f))[1],(minus_1_ulp_(x+1.0f))[2],(minus_1_ulp_(x+1.0f))[3]}; Fx4 lr = *r, lg = *g, lb = *b, hr = *r, hg = *g, hb = *b; clut_1_8_(a2b, stride*lo + ix, stride*limit, &lr,&lg,&lb,a); clut_1_8_(a2b, stride*hi + ix, stride*limit, &hr,&hg,&hb,a); Fx4 t = x - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]}; *r = lr + (hr-lr)*t; *g = lg + (hg-lg)*t; *b = lb + (hb-lb)*t; }
static inline void clut_3_8_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) { I32x4 limit = (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]}; limit += a2b->grid_points[3 -1]; const Fx4* srcs[] = { r,g,b,&a }; Fx4 src = *srcs[3 -1]; Fx4 x = max__((Fx4){0,0,0,0}, min__(src, (Fx4){1,1,1,1})) * (Fx4){(limit - 1)[0],(limit - 1)[1],(limit - 1)[2],(limit - 1)[3]}; I32x4 lo = (I32x4){(x)[0],(x)[1],(x)[2],(x)[3]}, hi = (I32x4){(minus_1_ulp_(x+1.0f))[0],(minus_1_ulp_(x+1.0f))[1],(minus_1_ulp_(x+1.0f))[2],(minus_1_ulp_(x+1.0f))[3]}; Fx4 lr = *r, lg = *g, lb = *b, hr = *r, hg = *g, hb = *b; clut_2_8_(a2b, stride*lo + ix, stride*limit, &lr,&lg,&lb,a); clut_2_8_(a2b, stride*hi + ix, stride*limit, &hr,&hg,&hb,a); Fx4 t = x - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]}; *r = lr + (hr-lr)*t; *g = lg + (hg-lg)*t; *b = lb + (hb-lb)*t; }
static inline void clut_4_8_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) { I32x4 limit = (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]}; limit += a2b->grid_points[4 -1]; const Fx4* srcs[] = { r,g,b,&a }; Fx4 src = *srcs[4 -1]; Fx4 x = max__((Fx4){0,0,0,0}, min__(src, (Fx4){1,1,1,1})) * (Fx4){(limit - 1)[0],(limit - 1)[1],(limit - 1)[2],(limit - 1)[3]}; I32x4 lo = (I32x4){(x)[0],(x)[1],(x)[2],(x)[3]}, hi = (I32x4){(minus_1_ulp_(x+1.0f))[0],(minus_1_ulp_(x+1.0f))[1],(minus_1_ulp_(x+1.0f))[2],(minus_1_ulp_(x+1.0f))[3]}; Fx4 lr = *r, lg = *g, lb = *b, hr = *r, hg = *g, hb = *b; clut_3_8_(a2b, stride*lo + ix, stride*limit, &lr,&lg,&lb,a); clut_3_8_(a2b, stride*hi + ix, stride*limit, &hr,&hg,&hb,a); Fx4 t = x - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]}; *r = lr + (hr-lr)*t; *g = lg + (hg-lg)*t; *b = lb + (hb-lb)*t; }
static inline void clut_1_16_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) { I32x4 limit = (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]}; limit += a2b->grid_points[1 -1]; const Fx4* srcs[] = { r,g,b,&a }; Fx4 src = *srcs[1 -1]; Fx4 x = max__((Fx4){0,0,0,0}, min__(src, (Fx4){1,1,1,1})) * (Fx4){(limit - 1)[0],(limit - 1)[1],(limit - 1)[2],(limit - 1)[3]}; I32x4 lo = (I32x4){(x)[0],(x)[1],(x)[2],(x)[3]}, hi = (I32x4){(minus_1_ulp_(x+1.0f))[0],(minus_1_ulp_(x+1.0f))[1],(minus_1_ulp_(x+1.0f))[2],(minus_1_ulp_(x+1.0f))[3]}; Fx4 lr = *r, lg = *g, lb = *b, hr = *r, hg = *g, hb = *b; clut_0_16_(a2b, stride*lo + ix, stride*limit, &lr,&lg,&lb,a); clut_0_16_(a2b, stride*hi + ix, stride*limit, &hr,&hg,&hb,a); Fx4 t = x - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]}; *r = lr + (hr-lr)*t; *g = lg + (hg-lg)*t; *b = lb + (hb-lb)*t; }
static inline void clut_2_16_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) { I32x4 limit = (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]}; limit += a2b->grid_points[2 -1]; const Fx4* srcs[] = { r,g,b,&a }; Fx4 src = *srcs[2 -1]; Fx4 x = max__((Fx4){0,0,0,0}, min__(src, (Fx4){1,1,1,1})) * (Fx4){(limit - 1)[0],(limit - 1)[1],(limit - 1)[2],(limit - 1)[3]}; I32x4 lo = (I32x4){(x)[0],(x)[1],(x)[2],(x)[3]}, hi = (I32x4){(minus_1_ulp_(x+1.0f))[0],(minus_1_ulp_(x+1.0f))[1],(minus_1_ulp_(x+1.0f))[2],(minus_1_ulp_(x+1.0f))[3]}; Fx4 lr = *r, lg = *g, lb = *b, hr = *r, hg = *g, hb = *b; clut_1_16_(a2b, stride*lo + ix, stride*limit, &lr,&lg,&lb,a); clut_1_16_(a2b, stride*hi + ix, stride*limit, &hr,&hg,&hb,a); Fx4 t = x - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]}; *r = lr + (hr-lr)*t; *g = lg + (hg-lg)*t; *b = lb + (hb-lb)*t; }
static inline void clut_3_16_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) { I32x4 limit = (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]}; limit += a2b->grid_points[3 -1]; const Fx4* srcs[] = { r,g,b,&a }; Fx4 src = *srcs[3 -1]; Fx4 x = max__((Fx4){0,0,0,0}, min__(src, (Fx4){1,1,1,1})) * (Fx4){(limit - 1)[0],(limit - 1)[1],(limit - 1)[2],(limit - 1)[3]}; I32x4 lo = (I32x4){(x)[0],(x)[1],(x)[2],(x)[3]}, hi = (I32x4){(minus_1_ulp_(x+1.0f))[0],(minus_1_ulp_(x+1.0f))[1],(minus_1_ulp_(x+1.0f))[2],(minus_1_ulp_(x+1.0f))[3]}; Fx4 lr = *r, lg = *g, lb = *b, hr = *r, hg = *g, hb = *b; clut_2_16_(a2b, stride*lo + ix, stride*limit, &lr,&lg,&lb,a); clut_2_16_(a2b, stride*hi + ix, stride*limit, &hr,&hg,&hb,a); Fx4 t = x - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]}; *r = lr + (hr-lr)*t; *g = lg + (hg-lg)*t; *b = lb + (hb-lb)*t; }
static inline void clut_4_16_(const skcms_A2B* a2b, I32x4 ix, I32x4 stride, Fx4* r, Fx4* g, Fx4* b, Fx4 a) { I32x4 limit = (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]}; limit += a2b->grid_points[4 -1]; const Fx4* srcs[] = { r,g,b,&a }; Fx4 src = *srcs[4 -1]; Fx4 x = max__((Fx4){0,0,0,0}, min__(src, (Fx4){1,1,1,1})) * (Fx4){(limit - 1)[0],(limit - 1)[1],(limit - 1)[2],(limit - 1)[3]}; I32x4 lo = (I32x4){(x)[0],(x)[1],(x)[2],(x)[3]}, hi = (I32x4){(minus_1_ulp_(x+1.0f))[0],(minus_1_ulp_(x+1.0f))[1],(minus_1_ulp_(x+1.0f))[2],(minus_1_ulp_(x+1.0f))[3]}; Fx4 lr = *r, lg = *g, lb = *b, hr = *r, hg = *g, hb = *b; clut_3_16_(a2b, stride*lo + ix, stride*limit, &lr,&lg,&lb,a); clut_3_16_(a2b, stride*hi + ix, stride*limit, &hr,&hg,&hb,a); Fx4 t = x - (Fx4){(lo)[0],(lo)[1],(lo)[2],(lo)[3]}; *r = lr + (hr-lr)*t; *g = lg + (hg-lg)*t; *b = lb + (hb-lb)*t; }
static void exec_ops(const Op* ops, const void** args,
const char* src, char* dst, int i) {
Fx4 r = (Fx4){0,0,0,0}, g = (Fx4){0,0,0,0}, b = (Fx4){0,0,0,0}, a = (Fx4){0,0,0,0};
while (
# 585 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
1
# 585 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
) {
switch (profile_next_op(*ops++)) {
case Op_noop: break;
case Op_load_565:{
U16x4 rgb;
__builtin_memcpy(&rgb, src + 2*i, 2*4);
r = (Fx4){(rgb & (31<< 0))[0],(rgb & (31<< 0))[1],(rgb & (31<< 0))[2],(rgb & (31<< 0))[3]} * (1.0f / (31<< 0));
g = (Fx4){(rgb & (63<< 5))[0],(rgb & (63<< 5))[1],(rgb & (63<< 5))[2],(rgb & (63<< 5))[3]} * (1.0f / (63<< 5));
b = (Fx4){(rgb & (31<<11))[0],(rgb & (31<<11))[1],(rgb & (31<<11))[2],(rgb & (31<<11))[3]} * (1.0f / (31<<11));
a = (Fx4){1,1,1,1};
} break;
case Op_load_888:{
const uint8_t* rgb = (const uint8_t*)(src + 3*i);
# 618 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
r = (Fx4){((U32x4){(rgb+0)[0], (rgb+0)[3], (rgb+0)[6], (rgb+0)[ 9]})[0],((U32x4){(rgb+0)[0], (rgb+0)[3], (rgb+0)[6], (rgb+0)[ 9]})[1],((U32x4){(rgb+0)[0], (rgb+0)[3], (rgb+0)[6], (rgb+0)[ 9]})[2],((U32x4){(rgb+0)[0], (rgb+0)[3], (rgb+0)[6], (rgb+0)[ 9]})[3]} * (1/255.0f);
g = (Fx4){((U32x4){(rgb+1)[0], (rgb+1)[3], (rgb+1)[6], (rgb+1)[ 9]})[0],((U32x4){(rgb+1)[0], (rgb+1)[3], (rgb+1)[6], (rgb+1)[ 9]})[1],((U32x4){(rgb+1)[0], (rgb+1)[3], (rgb+1)[6], (rgb+1)[ 9]})[2],((U32x4){(rgb+1)[0], (rgb+1)[3], (rgb+1)[6], (rgb+1)[ 9]})[3]} * (1/255.0f);
b = (Fx4){((U32x4){(rgb+2)[0], (rgb+2)[3], (rgb+2)[6], (rgb+2)[ 9]})[0],((U32x4){(rgb+2)[0], (rgb+2)[3], (rgb+2)[6], (rgb+2)[ 9]})[1],((U32x4){(rgb+2)[0], (rgb+2)[3], (rgb+2)[6], (rgb+2)[ 9]})[2],((U32x4){(rgb+2)[0], (rgb+2)[3], (rgb+2)[6], (rgb+2)[ 9]})[3]} * (1/255.0f);
a = (Fx4){1,1,1,1};
} break;
case Op_load_8888:{
U32x4 rgba;
__builtin_memcpy(&rgba, src + 4*i, 4*4);
r = (Fx4){((rgba >> 0) & 0xff)[0],((rgba >> 0) & 0xff)[1],((rgba >> 0) & 0xff)[2],((rgba >> 0) & 0xff)[3]} * (1/255.0f);
g = (Fx4){((rgba >> 8) & 0xff)[0],((rgba >> 8) & 0xff)[1],((rgba >> 8) & 0xff)[2],((rgba >> 8) & 0xff)[3]} * (1/255.0f);
b = (Fx4){((rgba >> 16) & 0xff)[0],((rgba >> 16) & 0xff)[1],((rgba >> 16) & 0xff)[2],((rgba >> 16) & 0xff)[3]} * (1/255.0f);
a = (Fx4){((rgba >> 24) & 0xff)[0],((rgba >> 24) & 0xff)[1],((rgba >> 24) & 0xff)[2],((rgba >> 24) & 0xff)[3]} * (1/255.0f);
} break;
case Op_load_1010102:{
U32x4 rgba;
__builtin_memcpy(&rgba, src + 4*i, 4*4);
r = (Fx4){((rgba >> 0) & 0x3ff)[0],((rgba >> 0) & 0x3ff)[1],((rgba >> 0) & 0x3ff)[2],((rgba >> 0) & 0x3ff)[3]} * (1/1023.0f);
g = (Fx4){((rgba >> 10) & 0x3ff)[0],((rgba >> 10) & 0x3ff)[1],((rgba >> 10) & 0x3ff)[2],((rgba >> 10) & 0x3ff)[3]} * (1/1023.0f);
b = (Fx4){((rgba >> 20) & 0x3ff)[0],((rgba >> 20) & 0x3ff)[1],((rgba >> 20) & 0x3ff)[2],((rgba >> 20) & 0x3ff)[3]} * (1/1023.0f);
a = (Fx4){((rgba >> 30) & 0x3)[0],((rgba >> 30) & 0x3)[1],((rgba >> 30) & 0x3)[2],((rgba >> 30) & 0x3)[3]} * (1/ 3.0f);
} break;
case Op_load_161616:{
uintptr_t ptr = (uintptr_t)(src + 6*i);
# 647 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 647 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
const uint16_t* rgb = (const uint16_t*)ptr;
U32x4 R = (U32x4){(rgb+0)[0], (rgb+0)[3], (rgb+0)[6], (rgb+0)[ 9]},
G = (U32x4){(rgb+1)[0], (rgb+1)[3], (rgb+1)[6], (rgb+1)[ 9]},
B = (U32x4){(rgb+2)[0], (rgb+2)[3], (rgb+2)[6], (rgb+2)[ 9]};
r = (Fx4){((R & 0x00ff)<<8 | (R & 0xff00)>>8)[0],((R & 0x00ff)<<8 | (R & 0xff00)>>8)[1],((R & 0x00ff)<<8 | (R & 0xff00)>>8)[2],((R & 0x00ff)<<8 | (R & 0xff00)>>8)[3]} * (1/65535.0f);
g = (Fx4){((G & 0x00ff)<<8 | (G & 0xff00)>>8)[0],((G & 0x00ff)<<8 | (G & 0xff00)>>8)[1],((G & 0x00ff)<<8 | (G & 0xff00)>>8)[2],((G & 0x00ff)<<8 | (G & 0xff00)>>8)[3]} * (1/65535.0f);
b = (Fx4){((B & 0x00ff)<<8 | (B & 0xff00)>>8)[0],((B & 0x00ff)<<8 | (B & 0xff00)>>8)[1],((B & 0x00ff)<<8 | (B & 0xff00)>>8)[2],((B & 0x00ff)<<8 | (B & 0xff00)>>8)[3]} * (1/65535.0f);
a = (Fx4){1,1,1,1};
} break;
case Op_load_16161616:{
uintptr_t ptr = (uintptr_t)(src + 8*i);
# 668 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 668 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
const uint16_t* rgba = (const uint16_t*)ptr;
U64x4 px;
__builtin_memcpy(&px, rgba, 8*4);
swap_endian_16x4_(&px);
r = (Fx4){((px >> 0) & 0xffff)[0],((px >> 0) & 0xffff)[1],((px >> 0) & 0xffff)[2],((px >> 0) & 0xffff)[3]} * (1/65535.0f);
g = (Fx4){((px >> 16) & 0xffff)[0],((px >> 16) & 0xffff)[1],((px >> 16) & 0xffff)[2],((px >> 16) & 0xffff)[3]} * (1/65535.0f);
b = (Fx4){((px >> 32) & 0xffff)[0],((px >> 32) & 0xffff)[1],((px >> 32) & 0xffff)[2],((px >> 32) & 0xffff)[3]} * (1/65535.0f);
a = (Fx4){((px >> 48) & 0xffff)[0],((px >> 48) & 0xffff)[1],((px >> 48) & 0xffff)[2],((px >> 48) & 0xffff)[3]} * (1/65535.0f);
} break;
case Op_load_hhh:{
uintptr_t ptr = (uintptr_t)(src + 6*i);
# 690 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 690 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
const uint16_t* rgb = (const uint16_t*)ptr;
U16x4 R = (U16x4){(rgb+0)[0], (rgb+0)[3], (rgb+0)[6], (rgb+0)[ 9]},
G = (U16x4){(rgb+1)[0], (rgb+1)[3], (rgb+1)[6], (rgb+1)[ 9]},
B = (U16x4){(rgb+2)[0], (rgb+2)[3], (rgb+2)[6], (rgb+2)[ 9]};
r = F_from_Half_(R);
g = F_from_Half_(G);
b = F_from_Half_(B);
a = (Fx4){1,1,1,1};
} break;
case Op_load_hhhh:{
uintptr_t ptr = (uintptr_t)(src + 8*i);
# 710 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 710 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
const uint16_t* rgba = (const uint16_t*)ptr;
U64x4 px;
__builtin_memcpy(&px, rgba, 8*4);
U16x4 R = (U16x4){((px >> 0) & 0xffff)[0],((px >> 0) & 0xffff)[1],((px >> 0) & 0xffff)[2],((px >> 0) & 0xffff)[3]},
G = (U16x4){((px >> 16) & 0xffff)[0],((px >> 16) & 0xffff)[1],((px >> 16) & 0xffff)[2],((px >> 16) & 0xffff)[3]},
B = (U16x4){((px >> 32) & 0xffff)[0],((px >> 32) & 0xffff)[1],((px >> 32) & 0xffff)[2],((px >> 32) & 0xffff)[3]},
A = (U16x4){((px >> 48) & 0xffff)[0],((px >> 48) & 0xffff)[1],((px >> 48) & 0xffff)[2],((px >> 48) & 0xffff)[3]};
r = F_from_Half_(R);
g = F_from_Half_(G);
b = F_from_Half_(B);
a = F_from_Half_(A);
} break;
case Op_load_fff:{
uintptr_t ptr = (uintptr_t)(src + 12*i);
# 734 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 734 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
const float* rgb = (const float*)ptr;
r = (Fx4){(rgb+0)[0], (rgb+0)[3], (rgb+0)[6], (rgb+0)[ 9]};
g = (Fx4){(rgb+1)[0], (rgb+1)[3], (rgb+1)[6], (rgb+1)[ 9]};
b = (Fx4){(rgb+2)[0], (rgb+2)[3], (rgb+2)[6], (rgb+2)[ 9]};
a = (Fx4){1,1,1,1};
} break;
case Op_load_ffff:{
uintptr_t ptr = (uintptr_t)(src + 16*i);
# 751 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 751 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
const float* rgba = (const float*)ptr;
r = (Fx4){(rgba+0)[0], (rgba+0)[4], (rgba+0)[8], (rgba+0)[12]};;
g = (Fx4){(rgba+1)[0], (rgba+1)[4], (rgba+1)[8], (rgba+1)[12]};;
b = (Fx4){(rgba+2)[0], (rgba+2)[4], (rgba+2)[8], (rgba+2)[12]};;
a = (Fx4){(rgba+3)[0], (rgba+3)[4], (rgba+3)[8], (rgba+3)[12]};;
} break;
case Op_swap_rb:{
Fx4 t = r;
r = b;
b = t;
} break;
case Op_clamp:{
r = max__((Fx4){0,0,0,0}, min__(r, (Fx4){1,1,1,1}));
g = max__((Fx4){0,0,0,0}, min__(g, (Fx4){1,1,1,1}));
b = max__((Fx4){0,0,0,0}, min__(b, (Fx4){1,1,1,1}));
a = max__((Fx4){0,0,0,0}, min__(a, (Fx4){1,1,1,1}));
} break;
case Op_invert:{
r = (Fx4){1,1,1,1} - r;
g = (Fx4){1,1,1,1} - g;
b = (Fx4){1,1,1,1} - b;
a = (Fx4){1,1,1,1} - a;
} break;
case Op_force_opaque:{
a = (Fx4){1,1,1,1};
} break;
case Op_premul:{
r *= a;
g *= a;
b *= a;
} break;
case Op_unpremul:{
Fx4 scale = (Fx4)( (((Fx4){1,1,1,1} / a < inf_.f) & (I32x4)((Fx4){1,1,1,1} / a)) | (~((Fx4){1,1,1,1} / a < inf_.f) & (I32x4)((Fx4){0,0,0,0})) );
r *= scale;
g *= scale;
b *= scale;
} break;
case Op_matrix_3x3:{
const skcms_Matrix3x3* matrix = *args++;
const float* m = &matrix->vals[0][0];
Fx4 R = m[0]*r + m[1]*g + m[2]*b,
G = m[3]*r + m[4]*g + m[5]*b,
B = m[6]*r + m[7]*g + m[8]*b;
r = R;
g = G;
b = B;
} break;
case Op_matrix_3x4:{
const skcms_Matrix3x4* matrix = *args++;
const float* m = &matrix->vals[0][0];
Fx4 R = m[0]*r + m[1]*g + m[ 2]*b + m[ 3],
G = m[4]*r + m[5]*g + m[ 6]*b + m[ 7],
B = m[8]*r + m[9]*g + m[10]*b + m[11];
r = R;
g = G;
b = B;
} break;
case Op_lab_to_xyz:{
Fx4 L = r * 100.0f,
A = g * 255.0f - 128.0f,
B = b * 255.0f - 128.0f;
Fx4 Y = (L + 16.0f) * (1/116.0f),
X = Y + A*(1/500.0f),
Z = Y - B*(1/200.0f);
X = (Fx4)( ((X*X*X > 0.008856f) & (I32x4)(X*X*X)) | (~(X*X*X > 0.008856f) & (I32x4)((X - (16/116.0f)) * (1/7.787f))) );
Y = (Fx4)( ((Y*Y*Y > 0.008856f) & (I32x4)(Y*Y*Y)) | (~(Y*Y*Y > 0.008856f) & (I32x4)((Y - (16/116.0f)) * (1/7.787f))) );
Z = (Fx4)( ((Z*Z*Z > 0.008856f) & (I32x4)(Z*Z*Z)) | (~(Z*Z*Z > 0.008856f) & (I32x4)((Z - (16/116.0f)) * (1/7.787f))) );
r = X * 0.9642f;
g = Y ;
b = Z * 0.8249f;
} break;
case Op_tf_r:{ r = apply_transfer_function_(*args++, r); } break;
case Op_tf_g:{ g = apply_transfer_function_(*args++, g); } break;
case Op_tf_b:{ b = apply_transfer_function_(*args++, b); } break;
case Op_tf_a:{ a = apply_transfer_function_(*args++, a); } break;
case Op_table_8_r: { r = table_8_(*args++, r); } break;
case Op_table_8_g: { g = table_8_(*args++, g); } break;
case Op_table_8_b: { b = table_8_(*args++, b); } break;
case Op_table_8_a: { a = table_8_(*args++, a); } break;
case Op_table_16_r:{ r = table_16_(*args++, r); } break;
case Op_table_16_g:{ g = table_16_(*args++, g); } break;
case Op_table_16_b:{ b = table_16_(*args++, b); } break;
case Op_table_16_a:{ a = table_16_(*args++, a); } break;
case Op_clut_3D_8:{
const skcms_A2B* a2b = *args++;
clut_3_8_(a2b, (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]},(I32x4){((Fx4){1,1,1,1})[0],((Fx4){1,1,1,1})[1],((Fx4){1,1,1,1})[2],((Fx4){1,1,1,1})[3]}, &r,&g,&b,a);
} break;
case Op_clut_3D_16:{
const skcms_A2B* a2b = *args++;
clut_3_16_(a2b, (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]},(I32x4){((Fx4){1,1,1,1})[0],((Fx4){1,1,1,1})[1],((Fx4){1,1,1,1})[2],((Fx4){1,1,1,1})[3]}, &r,&g,&b,a);
} break;
case Op_clut_4D_8:{
const skcms_A2B* a2b = *args++;
clut_4_8_(a2b, (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]},(I32x4){((Fx4){1,1,1,1})[0],((Fx4){1,1,1,1})[1],((Fx4){1,1,1,1})[2],((Fx4){1,1,1,1})[3]}, &r,&g,&b,a);
a = (Fx4){1,1,1,1};
} break;
case Op_clut_4D_16:{
const skcms_A2B* a2b = *args++;
clut_4_16_(a2b, (I32x4){((Fx4){0,0,0,0})[0],((Fx4){0,0,0,0})[1],((Fx4){0,0,0,0})[2],((Fx4){0,0,0,0})[3]},(I32x4){((Fx4){1,1,1,1})[0],((Fx4){1,1,1,1})[1],((Fx4){1,1,1,1})[2],((Fx4){1,1,1,1})[3]}, &r,&g,&b,a);
a = (Fx4){1,1,1,1};
} break;
case Op_store_565: {
U16x4 rgb = (U16x4){(to_fixed_(r * 31) << 0)[0],(to_fixed_(r * 31) << 0)[1],(to_fixed_(r * 31) << 0)[2],(to_fixed_(r * 31) << 0)[3]}
| (U16x4){(to_fixed_(g * 63) << 5)[0],(to_fixed_(g * 63) << 5)[1],(to_fixed_(g * 63) << 5)[2],(to_fixed_(g * 63) << 5)[3]}
| (U16x4){(to_fixed_(b * 31) << 11)[0],(to_fixed_(b * 31) << 11)[1],(to_fixed_(b * 31) << 11)[2],(to_fixed_(b * 31) << 11)[3]};
__builtin_memcpy(dst + 2*i, &rgb, 2*4);
} return;
case Op_store_888: {
uint8_t* rgb = (uint8_t*)dst + 3*i;
# 915 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
(rgb+0)[0] = ((U8x4){(to_fixed_(r * 255))[0],(to_fixed_(r * 255))[1],(to_fixed_(r * 255))[2],(to_fixed_(r * 255))[3]})[0]; (rgb+0)[3] = ((U8x4){(to_fixed_(r * 255))[0],(to_fixed_(r * 255))[1],(to_fixed_(r * 255))[2],(to_fixed_(r * 255))[3]})[1]; (rgb+0)[6] = ((U8x4){(to_fixed_(r * 255))[0],(to_fixed_(r * 255))[1],(to_fixed_(r * 255))[2],(to_fixed_(r * 255))[3]})[2]; (rgb+0)[ 9] = ((U8x4){(to_fixed_(r * 255))[0],(to_fixed_(r * 255))[1],(to_fixed_(r * 255))[2],(to_fixed_(r * 255))[3]})[3];
(rgb+1)[0] = ((U8x4){(to_fixed_(g * 255))[0],(to_fixed_(g * 255))[1],(to_fixed_(g * 255))[2],(to_fixed_(g * 255))[3]})[0]; (rgb+1)[3] = ((U8x4){(to_fixed_(g * 255))[0],(to_fixed_(g * 255))[1],(to_fixed_(g * 255))[2],(to_fixed_(g * 255))[3]})[1]; (rgb+1)[6] = ((U8x4){(to_fixed_(g * 255))[0],(to_fixed_(g * 255))[1],(to_fixed_(g * 255))[2],(to_fixed_(g * 255))[3]})[2]; (rgb+1)[ 9] = ((U8x4){(to_fixed_(g * 255))[0],(to_fixed_(g * 255))[1],(to_fixed_(g * 255))[2],(to_fixed_(g * 255))[3]})[3];
(rgb+2)[0] = ((U8x4){(to_fixed_(b * 255))[0],(to_fixed_(b * 255))[1],(to_fixed_(b * 255))[2],(to_fixed_(b * 255))[3]})[0]; (rgb+2)[3] = ((U8x4){(to_fixed_(b * 255))[0],(to_fixed_(b * 255))[1],(to_fixed_(b * 255))[2],(to_fixed_(b * 255))[3]})[1]; (rgb+2)[6] = ((U8x4){(to_fixed_(b * 255))[0],(to_fixed_(b * 255))[1],(to_fixed_(b * 255))[2],(to_fixed_(b * 255))[3]})[2]; (rgb+2)[ 9] = ((U8x4){(to_fixed_(b * 255))[0],(to_fixed_(b * 255))[1],(to_fixed_(b * 255))[2],(to_fixed_(b * 255))[3]})[3];
} return;
case Op_store_8888: {
U32x4 rgba = (U32x4){(to_fixed_(r * 255) << 0)[0],(to_fixed_(r * 255) << 0)[1],(to_fixed_(r * 255) << 0)[2],(to_fixed_(r * 255) << 0)[3]}
| (U32x4){(to_fixed_(g * 255) << 8)[0],(to_fixed_(g * 255) << 8)[1],(to_fixed_(g * 255) << 8)[2],(to_fixed_(g * 255) << 8)[3]}
| (U32x4){(to_fixed_(b * 255) << 16)[0],(to_fixed_(b * 255) << 16)[1],(to_fixed_(b * 255) << 16)[2],(to_fixed_(b * 255) << 16)[3]}
| (U32x4){(to_fixed_(a * 255) << 24)[0],(to_fixed_(a * 255) << 24)[1],(to_fixed_(a * 255) << 24)[2],(to_fixed_(a * 255) << 24)[3]};
__builtin_memcpy(dst + 4*i, &rgba, 4*4);
} return;
case Op_store_1010102: {
U32x4 rgba = (U32x4){(to_fixed_(r * 1023) << 0)[0],(to_fixed_(r * 1023) << 0)[1],(to_fixed_(r * 1023) << 0)[2],(to_fixed_(r * 1023) << 0)[3]}
| (U32x4){(to_fixed_(g * 1023) << 10)[0],(to_fixed_(g * 1023) << 10)[1],(to_fixed_(g * 1023) << 10)[2],(to_fixed_(g * 1023) << 10)[3]}
| (U32x4){(to_fixed_(b * 1023) << 20)[0],(to_fixed_(b * 1023) << 20)[1],(to_fixed_(b * 1023) << 20)[2],(to_fixed_(b * 1023) << 20)[3]}
| (U32x4){(to_fixed_(a * 3) << 30)[0],(to_fixed_(a * 3) << 30)[1],(to_fixed_(a * 3) << 30)[2],(to_fixed_(a * 3) << 30)[3]};
__builtin_memcpy(dst + 4*i, &rgba, 4*4);
} return;
case Op_store_161616: {
uintptr_t ptr = (uintptr_t)(dst + 6*i);
# 939 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 939 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
uint16_t* rgb = (uint16_t*)ptr;
# 949 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
I32x4 R = to_fixed_(r * 65535),
G = to_fixed_(g * 65535),
B = to_fixed_(b * 65535);
(rgb+0)[0] = ((U16x4){((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[0],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[1],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[2],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[3]})[0]; (rgb+0)[3] = ((U16x4){((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[0],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[1],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[2],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[3]})[1]; (rgb+0)[6] = ((U16x4){((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[0],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[1],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[2],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[3]})[2]; (rgb+0)[ 9] = ((U16x4){((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[0],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[1],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[2],((R & 0x00ff) << 8 | (R & 0xff00) >> 8)[3]})[3];
(rgb+1)[0] = ((U16x4){((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[0],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[1],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[2],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[3]})[0]; (rgb+1)[3] = ((U16x4){((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[0],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[1],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[2],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[3]})[1]; (rgb+1)[6] = ((U16x4){((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[0],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[1],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[2],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[3]})[2]; (rgb+1)[ 9] = ((U16x4){((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[0],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[1],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[2],((G & 0x00ff) << 8 | (G & 0xff00) >> 8)[3]})[3];
(rgb+2)[0] = ((U16x4){((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[0],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[1],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[2],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[3]})[0]; (rgb+2)[3] = ((U16x4){((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[0],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[1],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[2],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[3]})[1]; (rgb+2)[6] = ((U16x4){((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[0],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[1],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[2],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[3]})[2]; (rgb+2)[ 9] = ((U16x4){((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[0],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[1],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[2],((B & 0x00ff) << 8 | (B & 0xff00) >> 8)[3]})[3];
} return;
case Op_store_16161616: {
uintptr_t ptr = (uintptr_t)(dst + 8*i);
# 961 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 961 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
uint16_t* rgba = (uint16_t*)ptr;
# 972 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
U64x4 px = (U64x4){(to_fixed_(r * 65535))[0],(to_fixed_(r * 65535))[1],(to_fixed_(r * 65535))[2],(to_fixed_(r * 65535))[3]} << 0
| (U64x4){(to_fixed_(g * 65535))[0],(to_fixed_(g * 65535))[1],(to_fixed_(g * 65535))[2],(to_fixed_(g * 65535))[3]} << 16
| (U64x4){(to_fixed_(b * 65535))[0],(to_fixed_(b * 65535))[1],(to_fixed_(b * 65535))[2],(to_fixed_(b * 65535))[3]} << 32
| (U64x4){(to_fixed_(a * 65535))[0],(to_fixed_(a * 65535))[1],(to_fixed_(a * 65535))[2],(to_fixed_(a * 65535))[3]} << 48;
swap_endian_16x4_(&px);
__builtin_memcpy(rgba, &px, 8*4);
} return;
case Op_store_hhh: {
uintptr_t ptr = (uintptr_t)(dst + 6*i);
# 983 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 983 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
uint16_t* rgb = (uint16_t*)ptr;
U16x4 R = Half_from_F_(r),
G = Half_from_F_(g),
B = Half_from_F_(b);
# 997 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
(rgb+0)[0] = (R)[0]; (rgb+0)[3] = (R)[1]; (rgb+0)[6] = (R)[2]; (rgb+0)[ 9] = (R)[3];
(rgb+1)[0] = (G)[0]; (rgb+1)[3] = (G)[1]; (rgb+1)[6] = (G)[2]; (rgb+1)[ 9] = (G)[3];
(rgb+2)[0] = (B)[0]; (rgb+2)[3] = (B)[1]; (rgb+2)[6] = (B)[2]; (rgb+2)[ 9] = (B)[3];
} return;
case Op_store_hhhh: {
uintptr_t ptr = (uintptr_t)(dst + 8*i);
# 1005 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 1005 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
uint16_t* rgba = (uint16_t*)ptr;
U16x4 R = Half_from_F_(r),
G = Half_from_F_(g),
B = Half_from_F_(b),
A = Half_from_F_(a);
# 1021 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
U64x4 px = (U64x4){(R)[0],(R)[1],(R)[2],(R)[3]} << 0
| (U64x4){(G)[0],(G)[1],(G)[2],(G)[3]} << 16
| (U64x4){(B)[0],(B)[1],(B)[2],(B)[3]} << 32
| (U64x4){(A)[0],(A)[1],(A)[2],(A)[3]} << 48;
__builtin_memcpy(rgba, &px, 8*4);
} return;
case Op_store_fff: {
uintptr_t ptr = (uintptr_t)(dst + 12*i);
# 1032 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 1032 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
float* rgb = (float*)ptr;
# 1042 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
(rgb+0)[0] = (r)[0]; (rgb+0)[3] = (r)[1]; (rgb+0)[6] = (r)[2]; (rgb+0)[ 9] = (r)[3];
(rgb+1)[0] = (g)[0]; (rgb+1)[3] = (g)[1]; (rgb+1)[6] = (g)[2]; (rgb+1)[ 9] = (g)[3];
(rgb+2)[0] = (b)[0]; (rgb+2)[3] = (b)[1]; (rgb+2)[6] = (b)[2]; (rgb+2)[ 9] = (b)[3];
} return;
case Op_store_ffff: {
uintptr_t ptr = (uintptr_t)(dst + 16*i);
# 1050 "../../third_party/skia/third_party/skcms/src/Transform_inl.h" 3 4
((void) (0))
# 1050 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
;
float* rgba = (float*)ptr;
# 1061 "../../third_party/skia/third_party/skcms/src/Transform_inl.h"
(rgba+0)[0] = (r)[0]; (rgba+0)[4] = (r)[1]; (rgba+0)[8] = (r)[2]; (rgba+0)[12] = (r)[3];
(rgba+1)[0] = (g)[0]; (rgba+1)[4] = (g)[1]; (rgba+1)[8] = (g)[2]; (rgba+1)[12] = (g)[3];
(rgba+2)[0] = (b)[0]; (rgba+2)[4] = (b)[1]; (rgba+2)[8] = (b)[2]; (rgba+2)[12] = (b)[3];
(rgba+3)[0] = (a)[0]; (rgba+3)[4] = (a)[1]; (rgba+3)[8] = (a)[2]; (rgba+3)[12] = (a)[3];
} return;
}
}
}
static void run_program(const Op* program, const void** arguments,
const char* src, char* dst, int n,
const size_t src_bpp, const size_t dst_bpp) {
int i = 0;
while (n >= 4) {
exec_ops(program, arguments, src, dst, i);
i += 4;
n -= 4;
}
if (n > 0) {
char tmp_src[4*4*4] = {0},
tmp_dst[4*4*4] = {0};
memcpy(tmp_src, (const char*)src + (size_t)i*src_bpp, (size_t)n*src_bpp);
exec_ops(program, arguments, tmp_src, tmp_dst, 0);
memcpy((char*)dst + (size_t)i*dst_bpp, tmp_dst, (size_t)n*dst_bpp);
}
}
# 177 "../../third_party/skia/third_party/skcms/src/Transform.c" 2
# 314 "../../third_party/skia/third_party/skcms/src/Transform.c"
static
# 314 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
_Bool
# 314 "../../third_party/skia/third_party/skcms/src/Transform.c"
is_identity_tf(const skcms_TransferFunction* tf) {
return tf->g == 1 && tf->a == 1
&& tf->b == 0 && tf->c == 0 && tf->d == 0 && tf->e == 0 && tf->f == 0;
}
typedef struct {
Op op;
const void* arg;
} OpAndArg;
static OpAndArg select_curve_op(const skcms_Curve* curve, int channel) {
static const struct { Op parametric, table_8, table_16; } ops[] = {
{ Op_tf_r, Op_table_8_r, Op_table_16_r },
{ Op_tf_g, Op_table_8_g, Op_table_16_g },
{ Op_tf_b, Op_table_8_b, Op_table_16_b },
{ Op_tf_a, Op_table_8_a, Op_table_16_a },
};
if (curve->table_entries == 0) {
return is_identity_tf(&curve->parametric)
? (OpAndArg){ Op_noop,
# 334 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
((void *)0)
# 334 "../../third_party/skia/third_party/skcms/src/Transform.c"
}
: (OpAndArg){ ops[channel].parametric, &curve->parametric };
} else if (curve->table_8) {
return (OpAndArg){ ops[channel].table_8, curve };
} else if (curve->table_16) {
return (OpAndArg){ ops[channel].table_16, curve };
}
# 342 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
((void) (0))
# 342 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
return (OpAndArg){Op_noop,
# 343 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
((void *)0)
# 343 "../../third_party/skia/third_party/skcms/src/Transform.c"
};
}
static size_t bytes_per_pixel(skcms_PixelFormat fmt) {
switch (fmt >> 1) {
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;
}
# 359 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
((void) (0))
# 359 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
return 0;
}
static
# 363 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
_Bool
# 363 "../../third_party/skia/third_party/skcms/src/Transform.c"
prep_for_destination(const skcms_ICCProfile* profile,
skcms_Matrix3x3* fromXYZD50,
skcms_TransferFunction* invR,
skcms_TransferFunction* invG,
skcms_TransferFunction* invB) {
return profile->has_trc
&& profile->has_toXYZD50
&& profile->trc[0].table_entries == 0
&& profile->trc[1].table_entries == 0
&& profile->trc[2].table_entries == 0
&& skcms_TransferFunction_invert(&profile->trc[0].parametric, invR)
&& skcms_TransferFunction_invert(&profile->trc[1].parametric, invG)
&& skcms_TransferFunction_invert(&profile->trc[2].parametric, invB)
&& skcms_Matrix3x3_invert(&profile->toXYZD50, fromXYZD50);
}
# 381 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
_Bool
# 381 "../../third_party/skia/third_party/skcms/src/Transform.c"
skcms_Transform(const void* src,
skcms_PixelFormat srcFmt,
skcms_AlphaFormat srcAlpha,
const skcms_ICCProfile* srcProfile,
void* dst,
skcms_PixelFormat dstFmt,
skcms_AlphaFormat dstAlpha,
const skcms_ICCProfile* dstProfile,
size_t nz) {
const size_t dst_bpp = bytes_per_pixel(dstFmt),
src_bpp = bytes_per_pixel(srcFmt);
if (nz * dst_bpp > 0x7fffffff || nz * src_bpp > 0x7fffffff) {
return
# 394 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 394 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
int n = (int)nz;
if (!dstProfile != !srcProfile) {
return
# 400 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 400 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
if (dst == src && (dstFmt >> 1) != (srcFmt >> 1)) {
return
# 405 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 405 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
Op program [32];
const void* arguments[32];
Op* ops = program;
const void** args = arguments;
skcms_TransferFunction inv_dst_tf_r, inv_dst_tf_g, inv_dst_tf_b;
skcms_Matrix3x3 from_xyz;
switch (srcFmt >> 1) {
default: return
# 420 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 420 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
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;
}
if (srcFmt & 1) {
*ops++ = Op_swap_rb;
}
if (srcProfile->data_color_space == skcms_Signature_CMYK) {
*ops++ = Op_invert;
srcAlpha = skcms_AlphaFormat_Unpremul;
}
if (srcAlpha == skcms_AlphaFormat_Opaque) {
*ops++ = Op_force_opaque;
} else if (srcAlpha == skcms_AlphaFormat_PremulAsEncoded) {
*ops++ = Op_unpremul;
}
if (dstProfile != srcProfile ||
srcAlpha == skcms_AlphaFormat_PremulLinear ||
dstAlpha == skcms_AlphaFormat_PremulLinear) {
if (!prep_for_destination(dstProfile,
&from_xyz, &inv_dst_tf_r, &inv_dst_tf_b, &inv_dst_tf_g)) {
return
# 458 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 458 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
if (srcProfile->has_A2B) {
if (srcProfile->A2B.input_channels) {
for (int i = 0; i < (int)srcProfile->A2B.input_channels; i++) {
OpAndArg oa = select_curve_op(&srcProfile->A2B.input_curves[i], i);
if (oa.op != Op_noop) {
*ops++ = oa.op;
*args++ = oa.arg;
}
}
switch (srcProfile->A2B.input_channels) {
case 3: *ops++ = srcProfile->A2B.grid_8 ? Op_clut_3D_8 : Op_clut_3D_16; break;
case 4: *ops++ = srcProfile->A2B.grid_8 ? Op_clut_4D_8 : Op_clut_4D_16; break;
default: return
# 473 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 473 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
*args++ = &srcProfile->A2B;
}
if (srcProfile->A2B.matrix_channels == 3) {
for (int i = 0; i < 3; i++) {
OpAndArg oa = select_curve_op(&srcProfile->A2B.matrix_curves[i], i);
if (oa.op != Op_noop) {
*ops++ = oa.op;
*args++ = oa.arg;
}
}
static const skcms_Matrix3x4 I = {{
{1,0,0,0},
{0,1,0,0},
{0,0,1,0},
}};
if (0 != memcmp(&I, &srcProfile->A2B.matrix, sizeof(I))) {
*ops++ = Op_matrix_3x4;
*args++ = &srcProfile->A2B.matrix;
}
}
if (srcProfile->A2B.output_channels == 3) {
for (int i = 0; i < 3; i++) {
OpAndArg oa = select_curve_op(&srcProfile->A2B.output_curves[i], i);
if (oa.op != Op_noop) {
*ops++ = oa.op;
*args++ = oa.arg;
}
}
}
if (srcProfile->pcs == skcms_Signature_Lab) {
*ops++ = Op_lab_to_xyz;
}
} else if (srcProfile->has_trc && srcProfile->has_toXYZD50) {
for (int i = 0; i < 3; i++) {
OpAndArg oa = select_curve_op(&srcProfile->trc[i], i);
if (oa.op != Op_noop) {
*ops++ = oa.op;
*args++ = oa.arg;
}
}
} else {
return
# 521 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 521 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
if (srcAlpha == skcms_AlphaFormat_PremulLinear) {
*ops++ = Op_unpremul;
}
# 535 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
((void) (0))
# 535 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
static const skcms_Matrix3x3 I = {{
{ 1.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f },
}};
const skcms_Matrix3x3* to_xyz = srcProfile->has_A2B ? &I : &srcProfile->toXYZD50;
if (0 != memcmp(&dstProfile->toXYZD50, to_xyz, sizeof(skcms_Matrix3x3))) {
from_xyz = skcms_Matrix3x3_concat(&from_xyz, to_xyz);
*ops++ = Op_matrix_3x3;
*args++ = &from_xyz;
}
if (dstAlpha == skcms_AlphaFormat_PremulLinear) {
*ops++ = Op_premul;
}
if (!is_identity_tf(&inv_dst_tf_r)) { *ops++ = Op_tf_r; *args++ = &inv_dst_tf_r; }
if (!is_identity_tf(&inv_dst_tf_g)) { *ops++ = Op_tf_g; *args++ = &inv_dst_tf_g; }
if (!is_identity_tf(&inv_dst_tf_b)) { *ops++ = Op_tf_b; *args++ = &inv_dst_tf_b; }
}
if (dstAlpha == skcms_AlphaFormat_Opaque) {
*ops++ = Op_force_opaque;
} else if (dstAlpha == skcms_AlphaFormat_PremulAsEncoded) {
*ops++ = Op_premul;
}
if (dstFmt & 1) {
*ops++ = Op_swap_rb;
}
if (dstFmt < skcms_PixelFormat_RGB_hhh) {
*ops++ = Op_clamp;
}
switch (dstFmt >> 1) {
default: return
# 575 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 575 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
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;
}
void (*run)(const Op*, const void**, const char*, char*, int, size_t,size_t) = run_program;
run(program, arguments, src, dst, n, src_bpp,dst_bpp);
return
# 595 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
1
# 595 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
static void assert_usable_as_destination(const skcms_ICCProfile* profile) {
(void)profile;
}
# 608 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
_Bool
# 608 "../../third_party/skia/third_party/skcms/src/Transform.c"
skcms_MakeUsableAsDestination(skcms_ICCProfile* profile) {
skcms_Matrix3x3 fromXYZD50;
if (!profile->has_trc || !profile->has_toXYZD50
|| !skcms_Matrix3x3_invert(&profile->toXYZD50, &fromXYZD50)) {
return
# 612 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 612 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
skcms_TransferFunction tf[3];
for (int i = 0; i < 3; i++) {
skcms_TransferFunction inv;
if (profile->trc[i].table_entries == 0
&& skcms_TransferFunction_invert(&profile->trc[i].parametric, &inv)) {
tf[i] = profile->trc[i].parametric;
continue;
}
float max_error;
if (!skcms_ApproximateCurve(&profile->trc[i], &tf[i], &max_error)) {
return
# 627 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 627 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
}
for (int i = 0; i < 3; ++i) {
profile->trc[i].table_entries = 0;
profile->trc[i].parametric = tf[i];
}
assert_usable_as_destination(profile);
return
# 637 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
1
# 637 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
# 640 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
_Bool
# 640 "../../third_party/skia/third_party/skcms/src/Transform.c"
skcms_MakeUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile) {
skcms_ICCProfile result = *profile;
if (!skcms_MakeUsableAsDestination(&result)) {
return
# 644 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
0
# 644 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
int best_tf = 0;
float min_max_error = inf_.f;
for (int i = 0; i < 3; i++) {
skcms_TransferFunction inv;
skcms_TransferFunction_invert(&result.trc[i].parametric, &inv);
float err = 0;
for (int j = 0; j < 3; ++j) {
err = fmaxf_(err, skcms_MaxRoundtripError(&profile->trc[j], &inv));
}
if (min_max_error > err) {
min_max_error = err;
best_tf = i;
}
}
for (int i = 0; i < 3; i++) {
result.trc[i].parametric = result.trc[best_tf].parametric;
}
*profile = result;
assert_usable_as_destination(profile);
return
# 669 "../../third_party/skia/third_party/skcms/src/Transform.c" 3 4
1
# 669 "../../third_party/skia/third_party/skcms/src/Transform.c"
;
}
Reply to: