Skip to content

Commit 3ba42b4

Browse files
committed
Fix tests
1 parent 2a7c288 commit 3ba42b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dolby_vision/src/xml/parser.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl CmXmlParser {
7676

7777
let source_min_pq =
7878
nits_to_pq_12_bit(min_display_mastering_luminance as f64 / 10000.0);
79-
let source_max_pq = nits_to_pq_12_bit(max_display_mastering_luminance as f64);
79+
let source_max_pq = nits_to_pq_12_bit(max_display_mastering_luminance);
8080
parser.config.source_min_pq = Some(source_min_pq);
8181
parser.config.source_max_pq = Some(source_max_pq);
8282

@@ -576,9 +576,9 @@ impl CmXmlParser {
576576
"invalid L1 trim: should be 3 values"
577577
);
578578

579-
let min_pq = nits_to_pq_12_bit(measurements[0].parse::<f32>().unwrap());
580-
let avg_pq = nits_to_pq_12_bit(measurements[1].parse::<f32>().unwrap());
581-
let max_pq = nits_to_pq_12_bit(measurements[2].parse::<f32>().unwrap());
579+
let min_pq = (measurements[0].parse::<f32>().unwrap() * 4095.0).round() as u16;
580+
let avg_pq = (measurements[1].parse::<f32>().unwrap() * 4095.0).round() as u16;
581+
let max_pq = (measurements[2].parse::<f32>().unwrap() * 4095.0).round() as u16;
582582

583583
Ok(ExtMetadataBlockLevel1::from_stats_cm_version(
584584
min_pq,

0 commit comments

Comments
 (0)