Skip to content

Commit

Permalink
Support grain tables for SVT-AV1
Browse files Browse the repository at this point in the history
  • Loading branch information
shssoichiro committed Dec 14, 2023
1 parent ea92120 commit 642b8b1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions av1an-core/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ properly into a mkv file. Specify mkvmerge as the concatenation method by settin
if strength > 64 {
bail!("Valid strength values for photon noise are 0-64");
}
if ![Encoder::aom, Encoder::rav1e].contains(&self.encoder) {
bail!("Photon noise synth is only supported with aomenc and rav1e");
if ![Encoder::aom, Encoder::rav1e, Encoder::svt_av1].contains(&self.encoder) {
bail!("Photon noise synth is only supported with aomenc, rav1e, and svt-av1");
}
}

Expand Down Expand Up @@ -345,6 +345,17 @@ pub(crate) fn insert_noise_table_params(
video_params.retain(|param| !param.starts_with("--denoise-noise-level="));
video_params.push(format!("--film-grain-table={}", table.to_str().unwrap()));
}
Encoder::svt_av1 => {
let film_grain_idx = video_params
.iter()
.find_position(|param| param.as_str() == "--film-grain");
if let Some((idx, _)) = film_grain_idx {
video_params.remove(idx + 1);
video_params.remove(idx);
}
video_params.push("--fgs-table".to_string());
video_params.push(table.to_str().unwrap().to_string());
}
Encoder::rav1e => {
let photon_noise_idx = video_params
.iter()
Expand Down

0 comments on commit 642b8b1

Please sign in to comment.