CIECAM02 speedup
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#define _CIECAM02_
|
||||
#include <cmath>
|
||||
#include "LUT.h"
|
||||
#include "opthelper.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
@@ -40,18 +41,33 @@ private:
|
||||
|
||||
static void xyz_to_cat02float ( float &r, float &g, float &b, float x, float y, float z, int gamu );
|
||||
static void cat02_to_hpefloat ( float &rh, float &gh, float &bh, float r, float g, float b, int gamu );
|
||||
static void cat02_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b, int gamu );
|
||||
static void hpe_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b );
|
||||
|
||||
#ifdef __SSE2__
|
||||
static void xyz_to_cat02float ( vfloat &r, vfloat &g, vfloat &b, vfloat x, vfloat y, vfloat z );
|
||||
static void cat02_to_hpefloat ( vfloat &rh, vfloat &gh, vfloat &bh, vfloat r, vfloat g, vfloat b );
|
||||
static vfloat nonlinear_adaptationfloat( vfloat c, vfloat fl );
|
||||
#endif
|
||||
|
||||
static void Aab_to_rgb( double &r, double &g, double &b, double A, double aa, double bb, double nbb );
|
||||
static void Aab_to_rgbfloat( float &r, float &g, float &b, float A, float aa, float bb, float nbb );
|
||||
static void calculate_ab( double &aa, double &bb, double h, double e, double t, double nbb, double a );
|
||||
static void calculate_abfloat( float &aa, float &bb, float h, float e, float t, float nbb, float a );
|
||||
|
||||
static double nonlinear_adaptation( double c, double fl );
|
||||
static float nonlinear_adaptationfloat( float c, float fl );
|
||||
static double inverse_nonlinear_adaptation( double c, double fl );
|
||||
|
||||
#ifndef __SSE2__
|
||||
static float inverse_nonlinear_adaptationfloat( float c, float fl );
|
||||
static void calculate_abfloat( float &aa, float &bb, float h, float e, float t, float nbb, float a );
|
||||
static void Aab_to_rgbfloat( float &r, float &g, float &b, float A, float aa, float bb, float nbb );
|
||||
static void hpe_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b );
|
||||
static void cat02_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b, int gamu );
|
||||
#else
|
||||
static vfloat inverse_nonlinear_adaptationfloat( vfloat c, vfloat fl );
|
||||
static void calculate_abfloat( vfloat &aa, vfloat &bb, vfloat h, vfloat e, vfloat t, vfloat nbb, vfloat a );
|
||||
static void Aab_to_rgbfloat( vfloat &r, vfloat &g, vfloat &b, vfloat A, vfloat aa, vfloat bb, vfloat nbb );
|
||||
static void hpe_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b );
|
||||
static void cat02_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b );
|
||||
#endif
|
||||
|
||||
public:
|
||||
Ciecam02 () {}
|
||||
@@ -69,12 +85,19 @@ public:
|
||||
double yb, double la,
|
||||
double f, double c, double nc, int gamu, double n, double nbb, double ncb, double fl, double cz, double d, double aw);
|
||||
|
||||
#ifndef __SSE2__
|
||||
static void jch2xyz_ciecam02float( float &x, float &y, float &z,
|
||||
float J, float C, float h,
|
||||
float xw, float yw, float zw,
|
||||
float yb, float la,
|
||||
float f, float c, float nc,int gamu,float n, float nbb, float ncb, float fl, float cz, float d, float aw );
|
||||
|
||||
#else
|
||||
static void jch2xyz_ciecam02float( vfloat &x, vfloat &y, vfloat &z,
|
||||
vfloat J, vfloat C, vfloat h,
|
||||
vfloat xw, vfloat yw, vfloat zw,
|
||||
vfloat yb, vfloat la,
|
||||
vfloat f, vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat fl, vfloat d, vfloat aw, vfloat reccmcz );
|
||||
#endif
|
||||
/**
|
||||
* Forward transform from XYZ to CIECAM02 JCh.
|
||||
*/
|
||||
@@ -104,6 +127,16 @@ public:
|
||||
float yb, float la,
|
||||
float f, float c, float nc, float pilotd, int gamu, float n, float nbb, float ncb, float pfl, float cz, float d );
|
||||
|
||||
#ifdef __SSE2__
|
||||
static void xyz2jchqms_ciecam02float( vfloat &J, vfloat &C, vfloat &h,
|
||||
vfloat &Q, vfloat &M, vfloat &s,vfloat aw, vfloat fl, vfloat wh,
|
||||
vfloat x, vfloat y, vfloat z,
|
||||
vfloat xw, vfloat yw, vfloat zw,
|
||||
vfloat yb, vfloat la,
|
||||
vfloat f, vfloat c, vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat pfl, vfloat cz, vfloat d );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user