Skip to content

Commit

Permalink
Fix xpsnr inf score parsing (#261)
Browse files Browse the repository at this point in the history
Fix changelog formatting
  • Loading branch information
alexheretic authored Dec 30, 2024
1 parent 5581db4 commit 7b48a35
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 0.9.0
# Unreleased (v0.9.1)
* Fix xpsnr inf score parsing.

# v0.9.0
* Add XPSNR support as a VMAF alternative.
- Add sample-encode `--xpsnr` arg which toggles use of XPSNR instead of VMAF.
- Add crf-search, auto-encode `--min-xpsnr` arg _(alternative to `--min-vmaf`)_.
Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/xpsnr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ fn score_from_line(line: &str) -> Option<f32> {

let yidx = line.find(MIN_PREFIX)?;
let tail = &line[yidx + MIN_PREFIX.len()..];
if tail.starts_with("inf") {
return Some(f32::INFINITY);
}

let end_idx = tail
.char_indices()
.take_while(|(_, c)| *c == '.' || c.is_numeric())
Expand Down

0 comments on commit 7b48a35

Please sign in to comment.