Skip to content

Commit

Permalink
Update constant representations to be formulaic
Browse files Browse the repository at this point in the history
It's how they're defined in the paper
  • Loading branch information
Beinsezii committed Jun 27, 2024
1 parent 5158488 commit cd8395b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@ const SRGBEOTF_CHI_INV: f32 = 0.0031308;
const LAB_DELTA: f32 = 6.0 / 29.0;

// <PQ EOTF Table 4 <https://www.itu.int/rec/R-REC-BT.2100/en>
const PQEOTF_M1: f32 = 0.1593017578125;
const PQEOTF_M2: f32 = 78.84375;
const PQEOTF_C1: f32 = 0.8359375;
const PQEOTF_C2: f32 = 18.8515625;
const PQEOTF_C3: f32 = 18.6875;
const PQEOTF_M1: f32 = 2610. / 16384.;
const PQEOTF_M2: f32 = 2523. / 4096. * 128.;
const PQEOTF_C1: f32 = 3424. / 4096.;
const PQEOTF_C2: f32 = 2413. / 4096. * 32.;
const PQEOTF_C3: f32 = 2392. / 4096. * 32.;

// JzAzBz
const JZAZBZ_B: f32 = 1.15;
const JZAZBZ_G: f32 = 0.66;
const JZAZBZ_D: f32 = -0.56;
const JZAZBZ_D0: f32 = 1.6295499532821566 * 1e-11;
const JZAZBZ_D0: f32 = 1.6295499532821566e-11;
const JZAZBZ_P: f32 = 1.7 * PQEOTF_M2;

// ### CONSTS ### }}}
Expand Down Expand Up @@ -313,14 +313,14 @@ const JZAZBZ_M2_INV: [[f32; 3]; 3] = [

// ICtCp
const ICTCP_M1: [[f32; 3]; 3] = [
[1688.0 / 4096.0, 2146.0 / 4096.0, 262.0 / 4096.0],
[683.0 / 4096.0, 2951.0 / 4096.0, 462.0 / 4096.0],
[99.0 / 4096.0, 309.0 / 4096.0, 3688.0 / 4096.0],
[1688. / 4096., 2146. / 4096., 262. / 4096.],
[683. / 4096., 2951. / 4096., 462. / 4096.],
[99. / 4096., 309. / 4096., 3688. / 4096.],
];
const ICTCP_M2: [[f32; 3]; 3] = [
[2048.0 / 4096.0, 2048.0 / 4096.0, 0.0 / 4096.0],
[6610.0 / 4096.0, -13613.0 / 4096.0, 7003.0 / 4096.0],
[17933.0 / 4096.0, -17390.0 / 4096.0, -543.0 / 4096.0],
[2048. / 4096., 2048. / 4096., 0. / 4096.],
[6610. / 4096., -13613. / 4096., 7003. / 4096.],
[17933. / 4096., -17390. / 4096., -543. / 4096.],
];

const ICTCP_M1_INV: [[f32; 3]; 3] = [
Expand Down

0 comments on commit cd8395b

Please sign in to comment.