mirror of
https://github.com/master-of-zen/Av1an.git
synced 2024-11-25 02:29:40 +00:00
wip aom keyframes
This commit is contained in:
parent
d6a650876f
commit
a8219d220e
6 changed files with 33 additions and 6 deletions
|
@ -1,6 +1,3 @@
|
|||
[workspace]
|
||||
|
||||
members = [
|
||||
"av1an-core",
|
||||
"av1an-pyo3",
|
||||
]
|
||||
members = ["av1an-core", "av1an-pyo3", "av1an-scene-detection"]
|
||||
|
|
|
@ -37,7 +37,7 @@ fn process_inputs(inputs: Vec<&Path>) -> Vec<&Path> {
|
|||
|
||||
// Process all inputs (folders and files)
|
||||
// into single path vector
|
||||
for fl in inputs {
|
||||
for fl in inputs.clone() {
|
||||
if fl.is_dir() {
|
||||
for file in fl {
|
||||
let path_file = Path::new(file);
|
||||
|
@ -58,6 +58,12 @@ fn process_inputs(inputs: Vec<&Path>) -> Vec<&Path> {
|
|||
.filter(|x| match_file_type(*x))
|
||||
.collect();
|
||||
|
||||
if result.is_empty() {
|
||||
println!("Not valid inputs");
|
||||
println!("{:#?}", inputs);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ use std::str::FromStr;
|
|||
use std::{fs::File, io::Write};
|
||||
use sysinfo::SystemExt;
|
||||
|
||||
pub mod aom_kf;
|
||||
pub mod concat;
|
||||
pub mod ffmpeg;
|
||||
pub mod file_validation;
|
||||
|
|
7
av1an-scene-detection/Cargo.toml
Normal file
7
av1an-scene-detection/Cargo.toml
Normal file
|
@ -0,0 +1,7 @@
|
|||
[package]
|
||||
name = "av1an-scene-detection"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
@ -1,3 +1,5 @@
|
|||
use core::f64;
|
||||
|
||||
struct AomFirstPassStats {
|
||||
frame: u64, // Frame number
|
||||
weight: u64, // Weight assigned to this frame
|
||||
|
@ -27,3 +29,16 @@ struct AomFirstPassStats {
|
|||
noise_var: u64,
|
||||
cor_coeff: u64,
|
||||
}
|
||||
|
||||
fn get_second_ref_usage_thresh(frame_count_so_far: u64) -> f64 {
|
||||
let adapt_upto = 32.0;
|
||||
let min_second_ref_usage_thresh = 0.085;
|
||||
let second_ref_usage_thresh_max_delta = 0.035;
|
||||
|
||||
if frame_count_so_far as f64 >= adapt_upto {
|
||||
return min_second_ref_usage_thresh + second_ref_usage_thresh_max_delta;
|
||||
} else {
|
||||
min_second_ref_usage_thresh
|
||||
+ (frame_count_so_far as f64 / (adapt_upto - 1.0)) * second_ref_usage_thresh_max_delta
|
||||
}
|
||||
}
|
3
av1an-scene-detection/src/lib.rs
Normal file
3
av1an-scene-detection/src/lib.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
#![allow(unused)]
|
||||
|
||||
pub mod aom_kf;
|
Loading…
Reference in a new issue