feat(core): score by distance from target size (#63)
This commit was merged in pull request #63.
This commit is contained in:
@@ -6,8 +6,10 @@ use std::{collections::BTreeMap, path::PathBuf, time::SystemTime};
|
||||
|
||||
pub mod lang;
|
||||
pub mod policy;
|
||||
pub mod score;
|
||||
|
||||
pub use arr_parse::NameClaims as ParsedRelease;
|
||||
pub use score::{Score, ScoreWeights};
|
||||
|
||||
macro_rules! id_type {
|
||||
($name:ident) => {
|
||||
@@ -124,10 +126,19 @@ pub struct HdrRules {
|
||||
pub rejected_dolby_vision_profiles: Vec<DolbyVisionProfile>,
|
||||
}
|
||||
|
||||
/// One resolution's size band (`DESIGN.md` §5.5). Below the floor is a hard
|
||||
/// filter; the target is where the score peaks; above it the penalty grows
|
||||
/// with every gibibyte.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub struct SizeBand {
|
||||
pub floor_bytes: u64,
|
||||
pub target_bytes: u64,
|
||||
/// Points lost per gibibyte above `target_bytes`, on the scale set by
|
||||
/// [`ScoreWeights::size_at_target`] — 1000 points at target means one
|
||||
/// point is a tenth of a percent, fine enough to tune by hand without a
|
||||
/// fractional type. Applied per byte over, so a partial gibibyte costs
|
||||
/// its fraction.
|
||||
pub penalty_points_per_gib_over: i32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
@@ -140,6 +151,7 @@ pub struct Policy {
|
||||
pub size_bands: BTreeMap<Resolution, SizeBand>,
|
||||
pub resolution_preference: Vec<Resolution>,
|
||||
pub source_weights: BTreeMap<Source, i32>,
|
||||
pub score_weights: ScoreWeights,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Eq, PartialEq)]
|
||||
|
||||
Reference in New Issue
Block a user