feat: complete multichannel (5-7ch) ICC profile generation & verification

- Profile Creation & Inversion (profout.c, xlut.c, mchan_inv.c):
  * Unify BtoA CLUT resolutions for devchan >= 5 (9/17/25/33) to provide dense PCS inversion grids
  * Guard all reverse simplicial ops in xlut.c with within_restrictedsize() to prevent SIGSEGV when di > 4 (MXRI cap)
  * Enhance Powell optimizer in mchan_inv.c with multi-candidate starting strategy and scaled deltaE^2 Lab coordinates
  * Allow icSigColorantTableTag in V2 profiles for devchan >= 5 in icc.c

- Numerical & Geometry Stability (scat.c, gamut.c):
  * Fix SIGSEGV in rspl scat.c sparse matrix solver caused by assumption of sorted xcol in 4x unrolled loops
  * Add null pointer and tag checks in gamut.c radial_point_triang

- Test Targets & Verification (test_multichannel/):
  * Add synthetic .ti1 and .ti3 targets for 5-channel (CMYKO), 6-channel (CMYKOG), and 7-channel (CMYKOGV) workflows
  * Add ti1_to_ti3 conversion script and verify_roundtrip.py round-trip verification utility
  * Verified end-to-end:
    - 5-channel: avg dE = 2.38, max dE = 6.27
    - 6-channel: avg dE = 1.90, max dE = 5.40
    - 7-channel: avg dE = 2.15, max dE = 5.54

- Build & Housekeeping:
  * Add .gitignore for compiled executables, autotools outputs, and generated ICC profiles
  * Update MULTICHANNEL_IMPLEMENTATION_PLAN.md with verification results
This commit is contained in:
2026-11-18 16:49:43 +03:30
parent d909b331c2
commit eaab9e3dd3
17 changed files with 3336 additions and 247 deletions

View File

@@ -2742,35 +2742,19 @@ one_itter2(
int k0,k1,k2,k3;
double sm = 0.0;
/* Right of diagonal in 4's */
for (k = 1, k3 = i+xcol[k+3]; (k+3) < acols && k3 < gno; k += 4, k3 = i+xcol[k+3]) {
k0 = i + xcol[k+0];
k1 = i + xcol[k+1];
k2 = i + xcol[k+2];
sm += A[i][k+0] * x[k0];
sm += A[i][k+1] * x[k1];
sm += A[i][k+2] * x[k2];
sm += A[i][k+3] * x[k3];
/* Right of diagonal */
for (k = 1; k < acols; k++) {
int k3 = i + xcol[k];
if (k3 < gno)
sm += A[i][k] * x[k3];
}
/* Finish any remaining */
for (k3 = i + xcol[k]; k < acols && k3 < gno; k++, k3 = i + xcol[k])
sm += A[i][k] * x[k3];
/* Left of diagonal in 4's */
/* (We take advantage of A[][] symetry: what would be in the row */
/* to the left is repeated in the column above.) */
for (k = 1, k3 = i-xcol[k+3]; (k+3) < acols && k3 >= 0; k += 4, k3 = i-xcol[k+3]) {
k0 = i-xcol[k+0];
k1 = i-xcol[k+1];
k2 = i-xcol[k+2];
sm += A[k0][k+0] * x[k0];
sm += A[k1][k+1] * x[k1];
sm += A[k2][k+2] * x[k2];
sm += A[k3][k+3] * x[k3];
/* Left of diagonal */
for (k = 1; k < acols; k++) {
int k3 = i - xcol[k];
if (k3 >= 0)
sm += A[k3][k] * x[k3];
}
/* Finish any remaining */
for (k3 = i-xcol[k]; k < acols && k3 >= 0; k++, k3 = i-xcol[k])
sm += A[k3][k] * x[k3];
/* Compute x value that solves equation just for this point */
// x[i] = (b[i] - sm)/A[i][0];
@@ -2828,35 +2812,19 @@ soln_err(
int k0,k1,k2,k3;
double sm = 0.0;
/* Diagonal and to right in 4's */
for (k = 0, k3 = i+xcol[k+3]; (k+3) < acols && k3 < gno; k += 4, k3 = i+xcol[k+3]) {
k0 = i + xcol[k+0];
k1 = i + xcol[k+1];
k2 = i + xcol[k+2];
sm += A[i][k+0] * x[k0];
sm += A[i][k+1] * x[k1];
sm += A[i][k+2] * x[k2];
sm += A[i][k+3] * x[k3];
/* Diagonal and to right */
for (k = 0; k < acols; k++) {
int k3 = i + xcol[k];
if (k3 < gno)
sm += A[i][k] * x[k3];
}
/* Finish any remaining */
for (k3 = i + xcol[k]; k < acols && k3 < gno; k++, k3 = i + xcol[k])
sm += A[i][k] * x[k3];
/* Left of diagonal in 4's */
/* (We take advantage of the symetry: what would be in the row */
/* to the left is repeated in the column above.) */
for (k = 1, k3 = i-xcol[k+3]; (k+3) < acols && k3 >= 0; k += 4, k3 = i-xcol[k+3]) {
k0 = i-xcol[k+0];
k1 = i-xcol[k+1];
k2 = i-xcol[k+2];
sm += A[k0][k+0] * x[k0];
sm += A[k1][k+1] * x[k1];
sm += A[k2][k+2] * x[k2];
sm += A[k3][k+3] * x[k3];
/* Left of diagonal */
for (k = 1; k < acols; k++) {
int k3 = i - xcol[k];
if (k3 >= 0)
sm += A[k3][k] * x[k3];
}
/* Finish any remaining */
for (k3 = i-xcol[k]; k < acols && k3 >= 0; k++, k3 = i-xcol[k])
sm += A[k3][k] * x[k3];
sm = b[i] - sm;
resid += sm * sm;
@@ -2953,37 +2921,19 @@ cj_line(
int k0,k1,k2,k3;
sm = 0.0;
/* Diagonal and to right in 4's */
for (k = 0, k3 = ii+xcol[k+3]; (k+3) < acols && k3 < gno; k += 4, k3 = ii+xcol[k+3]) {
k0 = ii + xcol[k+0];
k1 = ii + xcol[k+1];
k2 = ii + xcol[k+2];
sm += A[ii][k+0] * x[k0];
sm += A[ii][k+1] * x[k1];
sm += A[ii][k+2] * x[k2];
sm += A[ii][k+3] * x[k3];
/* Diagonal and to right */
for (k = 0; k < acols; k++) {
int k3 = ii + xcol[k];
if (k3 < gno)
sm += A[ii][k] * x[k3];
}
/* Finish any remaining */
for (k3 = ii + xcol[k]; k < acols && k3 < gno; k++, k3 = ii + xcol[k])
sm += A[ii][k] * x[k3];
/* Left of diagonal in 4's */
/* (We take advantage of the symetry around the diagonal: what would be in the row */
/* to the left is repeated in the column above, so for an unsparse matrix */
/* we simply swapt the row and column index, for sparse we use the mirror column */
/* offset (ie. to the right side) and subtract the column offset from the row.) */
for (k = 1, k3 = ii-xcol[k+3]; (k+3) < acols && k3 >= 0; k += 4, k3 = ii-xcol[k+3]) {
k0 = ii-xcol[k+0];
k1 = ii-xcol[k+1];
k2 = ii-xcol[k+2];
sm += A[k0][k+0] * x[k0];
sm += A[k1][k+1] * x[k1];
sm += A[k2][k+2] * x[k2];
sm += A[k3][k+3] * x[k3];
/* Left of diagonal */
for (k = 1; k < acols; k++) {
int k3 = ii - xcol[k];
if (k3 >= 0)
sm += A[k3][k] * x[k3];
}
/* Finish any remaining */
for (k3 = ii-xcol[k]; k < acols && k3 >= 0; k++, k3 = ii-xcol[k])
sm += A[k3][k] * x[k3];
ta->r[i] = b[ii] - sm;
}