The [SMPTE ST 2084] standard defines the transfer function used by High Dynamic Range content.
m1 = (2610 / 4096) / 4
m2 = (2523 / 4096) * 128
c1 = 3424 / 4096
c2 = (2413 / 4096) * 32
c3 = (2392 / 4096) * 32
L' = ((c1 + c2 * Lm1) / (1 + c3 * Lm1))m2
L = (max(L'1/m2 - c1, 0) / (c2 - c3 * L'1/m2))1/m1