unsignedlonghash32;/// fully identifies current table
struct{
unsignedshortscale;/// 6.10: 0x400 is 1.0 scale (>=1.0) is applied in the driver, saturating result
union{
unsignedshorthash16;/// scale-independent part of the table (tables themselves are calculated outside of the driver)
struct{
union{
unsignedlonghash32;/// fully identifies current table
struct{
unsignedshortscale;/// 6.10: 0x400 is 1.0 scale (>=1.0) is applied in the driver, saturating result
union{
unsignedshorthash16;/// scale-independent part of the table (tables themselves are calculated outside of the driver)
struct{
unsignedchargamma;/// "gamma" in the range 0.0 ... 2.55
unsignedcharblack;/// black level to subtract (scaled to full scale) from the input data
};
};
};
};
unsignedlonglongvalid;/// 0 - table invalid, 1 - table valid +2 for table locked (until sent to FPGA)
// int locked; /// bit frame+ (color<<3) locked for color/frame
unsignedlonglonglocked;/// NOTE: Changed to just color locked for color
intthis_non_scaled;// 0 for non-scaled, others - (for scaled) - pointer to the corresponding non-scaled
union{/// used in head (element 0) and non-scaled chain (not used in scaled)
struct{/// element 0 - heads of the chains
intoldest_non_scaled;//
intnewest_non_scaled;//
};
struct{/// non-scaled (gamma data is full 16-bit)
intnewer_non_scaled;// table type (non-scaled prototype) used later than this one
intolder_non_scaled;// table type (non-scaled prototype) used before this one
};
};
union{/// used in head (element 0) and scaled chain (not used in non-scaled) (or maybe it will be used?)
struct{/// element 0 - heads of the chains
intoldest_all;//
intnewest_all;//
};
struct{/// scaled (gamma data is hardware defined 10 bit)
intnewer_all;/// newer in a single chain of all scaled tables, regardless of the prototype
intolder_all;/// older in a single chain of all scaled tables, regardless of the prototype
/// *_all also includes yet unused nodes (after init)
};
};
union{/// used in non-scaled and scaled, not in the head (element 0)
struct{/// non-scaled
intoldest_scaled;// oldest derivative of this prototype (scaled)
intnewest_scaled;// newest derivative of this prototype (scaled)
};
struct{/// scaled (gamma data is hardware defined 10 bit)
intnewer_scaled;// table type (non-scaled prototype) used later than this one
intolder_scaled;// table type (non-scaled prototype) used before this one
};
struct{/// reuse in the head (element 0) - to make this variable visible through mmap to PHP (for debugging)
intnon_scaled_length;// current number of different hash values
intnum_locked;// number of nodes locked (until table sent to FPGA)
};
};
union{
struct{
unsignedshortdirect[257];// "Gamma" table, 16-bit for both non-scaled prototypes and scaled, 0..0xffff range (hardware will use less)
unsignedshortdummy1;// to have it 32-bit aligned
// unsigned short reverse[256]; // reverse table to speed-up reversing (still need interpolation).Index - most significant 8 bits, data - largest direct argument...
unsignedcharreverse[256];/// reverse table to speed-up reversing. No division, but needs interpolation by the application
unsignedlongfpga[256];// data encoded for FPGA "gamma" table (18 bits, "floating point")
};
struct{
// int locked_col_frame[4 * PARS_FRAMES]; //index of the table to load to color/frame (should be locked, until unlocked)
intlocked_chn_color[4*MAX_SENSORS*SENSOR_PORTS];/// NOTE: Changed to just color (locked last written to FPGA - maybe needed again, as the FPGA needs all table to be overwritten - two pages)
// For NC393 - using 64 entries - individual for each channel/subchannel, color is in 2 lower bits
// int other [129+128+256 -(4 * PARS_FRAMES)];
// int other [129+64+256 -(4 * PARS_FRAMES)];
intother[129+64+256-4*MAX_SENSORS*SENSOR_PORTS];
};
};
};
};
unsignedlonglongvalid;/// 0 - table invalid, 1 - table valid +2 for table locked (until sent to FPGA)
// int locked; /// bit frame+ (color<<3) locked for color/frame
unsignedlonglonglocked;/// NOTE: Changed to just color locked for color
intthis_non_scaled;// 0 for non-scaled, others - (for scaled) - pointer to the corresponding non-scaled
union{/// used in head (element 0) and non-scaled chain (not used in scaled)
struct{/// element 0 - heads of the chains
intoldest_non_scaled;//
intnewest_non_scaled;//
};
struct{/// non-scaled (gamma data is full 16-bit)
intnewer_non_scaled;// table type (non-scaled prototype) used later than this one
intolder_non_scaled;// table type (non-scaled prototype) used before this one
};
};
union{/// used in head (element 0) and scaled chain (not used in non-scaled) (or maybe it will be used?)
struct{/// element 0 - heads of the chains
intoldest_all;//
intnewest_all;//
};
struct{/// scaled (gamma data is hardware defined 10 bit)
intnewer_all;/// newer in a single chain of all scaled tables, regardless of the prototype
intolder_all;/// older in a single chain of all scaled tables, regardless of the prototype
/// *_all also includes yet unused nodes (after init)
};
};
union{/// used in non-scaled and scaled, not in the head (element 0)
struct{/// non-scaled
intoldest_scaled;// oldest derivative of this prototype (scaled)
intnewest_scaled;// newest derivative of this prototype (scaled)
};
struct{/// scaled (gamma data is hardware defined 10 bit)
intnewer_scaled;// table type (non-scaled prototype) used later than this one
intolder_scaled;// table type (non-scaled prototype) used before this one
};
struct{/// reuse in the head (element 0) - to make this variable visible through mmap to PHP (for debugging)
intnon_scaled_length;// current number of different hash values
intnum_locked;// number of nodes locked (until table sent to FPGA)
};
};
union{
struct{
unsignedshortdirect[257];// "Gamma" table, 16-bit for both non-scaled prototypes and scaled, 0..0xffff range (hardware will use less)
unsignedshortdummy1;// to have it 32-bit aligned
unsignedcharreverse[256];/// reverse table to speed-up reversing. No division, but needs interpolation by the application
unsignedlongfpga[256];// data encoded for FPGA "gamma" table (18 bits, "floating point")
};
struct{
intlocked_chn_color[4*MAX_SENSORS*SENSOR_PORTS];/// NOTE: Changed to just color (locked last written to FPGA - maybe needed again, as the FPGA needs all table to be overwritten - two pages)
// For NC393 - using 64 entries - individual for each channel/subchannel, color is in 2 lower bits