diff options
-rw-r--r-- | lcms2/src/cmsxform.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/lcms2/src/cmsxform.c b/lcms2/src/cmsxform.c index 0863f3720..4e7bf863d 100644 --- a/lcms2/src/cmsxform.c +++ b/lcms2/src/cmsxform.c | |||
@@ -408,34 +408,32 @@ void TransformOnePixelWithGamutCheck(_cmsTRANSFORM* p, | |||
408 | #define GAMUTCHECK | 408 | #define GAMUTCHECK |
409 | #include "extra_xform.h" | 409 | #include "extra_xform.h" |
410 | 410 | ||
411 | |||
412 | // No gamut check, Caché, 16 bits, | 411 | // No gamut check, Caché, 16 bits, |
413 | #define FUNCTION_NAME CachedXFORM | 412 | #define FUNCTION_NAME CachedXFORM |
414 | #define CACHED | 413 | #define CACHED |
415 | #include "extra_xform.h" | 414 | #include "extra_xform.h" |
416 | 415 | ||
417 | |||
418 | // All those nice features together | 416 | // All those nice features together |
419 | #define FUNCTION_NAME CachedXFORMGamutCheck | 417 | #define FUNCTION_NAME CachedXFORMGamutCheck |
420 | #define CACHED | 418 | #define CACHED |
421 | #define GAMUTCHECK | 419 | #define GAMUTCHECK |
422 | #include "extra_xform.h" | 420 | #include "extra_xform.h" |
423 | 421 | ||
424 | // No gamut check, Cache, 16 bits, 4 bytes | 422 | // No gamut check, Cache, 16 bits, <= 4 bytes |
425 | #define FUNCTION_NAME CachedXFORM4 | 423 | #define FUNCTION_NAME CachedXFORM4 |
426 | #define CACHED | 424 | #define CACHED |
427 | #define INBYTES 4 | 425 | #define INBYTES 4 |
428 | #define EXTRABYTES 0 | 426 | #define EXTRABYTES 0 |
429 | #include "extra_xform.h" | 427 | #include "extra_xform.h" |
430 | 428 | ||
431 | // No gamut check, Cache, 16 bits, 8 bytes | 429 | // No gamut check, Cache, 16 bits, <= 8 bytes total |
432 | #define FUNCTION_NAME CachedXFORM8 | 430 | #define FUNCTION_NAME CachedXFORM8 |
433 | #define CACHED | 431 | #define CACHED |
434 | #define INBYTES 8 | 432 | #define INBYTES 8 |
435 | #define EXTRABYTES 0 | 433 | #define EXTRABYTES 0 |
436 | #include "extra_xform.h" | 434 | #include "extra_xform.h" |
437 | 435 | ||
438 | // Special one for common case. | 436 | // Special ones for common cases. |
439 | #define FUNCTION_NAME CachedXFORM3to1 | 437 | #define FUNCTION_NAME CachedXFORM3to1 |
440 | #define CACHED | 438 | #define CACHED |
441 | #define INBYTES 6 | 439 | #define INBYTES 6 |
@@ -452,6 +450,22 @@ do { \ | |||
452 | } while (0); | 450 | } while (0); |
453 | #include "extra_xform.h" | 451 | #include "extra_xform.h" |
454 | 452 | ||
453 | #define FUNCTION_NAME CachedXFORM3x2to1x2 | ||
454 | #define CACHED | ||
455 | #define INBYTES 6 | ||
456 | #define EXTRABYTES 0 | ||
457 | #define UNPACK(T,D,S,Z) \ | ||
458 | do { \ | ||
459 | (D)[0] = *(cmsUInt16Number *)(S); (S) += 2; /* R */ \ | ||
460 | (D)[1] = *(cmsUInt16Number *)(S); (S) += 2; /* G */ \ | ||
461 | (D)[2] = *(cmsUInt16Number *)(S); (S) += 2; /* B */ \ | ||
462 | } while (0) | ||
463 | #define PACK(T,S,D,Z) \ | ||
464 | do { \ | ||
465 | *(cmsUInt16Number *)(D) = *(S); (D) += 2; \ | ||
466 | } while (0); | ||
467 | #include "extra_xform.h" | ||
468 | |||
455 | // Transform plug-ins ---------------------------------------------------------------------------------------------------- | 469 | // Transform plug-ins ---------------------------------------------------------------------------------------------------- |
456 | 470 | ||
457 | // List of used-defined transform factories | 471 | // List of used-defined transform factories |
@@ -636,6 +650,9 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number | |||
636 | else if ((InputFormat & ~COLORSPACE_SH(31)) == (CHANNELS_SH(3)|BYTES_SH(1)) && | 650 | else if ((InputFormat & ~COLORSPACE_SH(31)) == (CHANNELS_SH(3)|BYTES_SH(1)) && |
637 | (OutputFormat & ~COLORSPACE_SH(31)) == (CHANNELS_SH(1)|BYTES_SH(1))) | 651 | (OutputFormat & ~COLORSPACE_SH(31)) == (CHANNELS_SH(1)|BYTES_SH(1))) |
638 | p ->xform = CachedXFORM3to1; | 652 | p ->xform = CachedXFORM3to1; |
653 | else if ((InputFormat & ~COLORSPACE_SH(31)) == (CHANNELS_SH(3)|BYTES_SH(2)) && | ||
654 | (OutputFormat & ~COLORSPACE_SH(31)) == (CHANNELS_SH(1)|BYTES_SH(2))) | ||
655 | p ->xform = CachedXFORM3x2to1x2; | ||
639 | else { | 656 | else { |
640 | int inwords = T_CHANNELS(InputFormat); | 657 | int inwords = T_CHANNELS(InputFormat); |
641 | if (inwords <= 2) | 658 | if (inwords <= 2) |