#![allow(clippy::cast_lossless)]
#![allow(clippy::needless_range_loop)]
#![allow(clippy::unreadable_literal)]
#![allow(clippy::wrong_self_convention)]
#![deny(missing_docs)]
#[macro_use]
extern crate itertools;
#[macro_use]
extern crate thiserror;
pub mod video;
#[cfg(cargo_c)]
mod capi;
#[cfg(cargo_c)]
pub use capi::*;
pub use v_frame;
#[derive(Debug, Error)]
pub enum MetricsError {
#[error("Could not read input file: {reason}")]
MalformedInput {
#[doc(hidden)]
reason: &'static str,
},
#[error("Input type not supported: {reason}")]
UnsupportedInput {
#[doc(hidden)]
reason: &'static str,
},
#[error("Input videos must have matching formats: {reason}")]
InputMismatch {
#[doc(hidden)]
reason: &'static str,
},
#[doc(hidden)]
#[error("Unreachable")]
NonExhaustive,
}
#[cfg(test)]
#[inline(always)]
fn assert_metric_eq(expected: f64, value: f64) {
assert!(
(expected - value).abs() < 0.01,
"Expected {}, got {}",
expected,
value
);
}