1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Shared fixtures and helpers visible to all test sub-modules.
// Item names available to sub-files via `use super::<name>;`.
use MasteringDisplay;
// ---- shared helpers -------------------------------------------------------
/// Find the first occurrence of a 4-byte tag in a byte slice.
/// Returns the offset of the tag itself (i.e. the four matching bytes),
/// not the preceding size field.
pub
/// Count every occurrence of a 4-byte tag (used where the tag may appear
/// inside payload bytes as well as in box headers).
pub
// ---- shared fixture -------------------------------------------------------
/// HDR10-canonical mastering display values: BT.2020 primaries +
/// D65 white point + 1000 nits / 0.0001 nits luminance, all in the
/// HEVC SEI 137 / SMPTE ST 2086 spec-domain integer encoding.
///
/// Cross-references for the wire numbers (so future reviewers can
/// re-derive without chasing a spec PDF):
/// BT.2020 R primary (0.708 , 0.292) → (35400, 14600)
/// BT.2020 G primary (0.170 , 0.797) → ( 8500, 39850)
/// BT.2020 B primary (0.131 , 0.046) → ( 6550, 2300)
/// D65 white point (0.3127, 0.3290) → (15635, 16450)
/// max luminance 1000 cd/m² → 10_000_000 (0.0001 cd/m² steps)
/// min luminance 0.0001 cd/m² → 1
pub