Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate grain synth code to external crate and allow chroma grain synth #653

Merged
merged 4 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions av1an-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ pub struct CliOpts {
#[clap(long, help_heading = "ENCODING")]
pub photon_noise: Option<u8>,

/// Adds chroma grain synthesis to the grain table generated by `--photon-noise`. (Default: false)
#[clap(long, help_heading = "ENCODING", requires = "photon-noise")]
pub chroma_noise: bool,

/// Determines method used for concatenating encoded chunks and audio into output file
///
/// ffmpeg - Uses ffmpeg for concatenation. Unfortunately, ffmpeg sometimes produces files
Expand Down Expand Up @@ -618,6 +622,7 @@ pub fn parse_cli(args: CliOpts) -> anyhow::Result<Vec<EncodeArgs>> {
photon_noise: args
.photon_noise
.and_then(|arg| if arg == 0 { None } else { Some(arg) }),
chroma_noise: args.chroma_noise,
sc_pix_format: args.sc_pix_format,
keep: args.keep,
max_tries: args.max_tries,
Expand Down
3 changes: 3 additions & 0 deletions av1an-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ arrayvec = "0.7.2"
atty = "0.2.14"
av-format = "0.3.1"
av-ivf = "0.2.2"
av1-grain = { version = "0.1.1", default-features = false, features = [
"create",
] }
memchr = "2.4.1"
anyhow = "1.0.42"
rand = "0.8.4"
Expand Down
263 changes: 0 additions & 263 deletions av1an-core/src/grain.rs

This file was deleted.

3 changes: 1 addition & 2 deletions av1an-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ use std::time::Instant;

use ::ffmpeg::color::TransferCharacteristic;
use anyhow::Context;
use av1_grain::TransferFunction;
use chunk::Chunk;
use dashmap::DashMap;
use grain::TransferFunction;
use once_cell::sync::OnceCell;
use serde::{Deserialize, Serialize};
use strum::{Display, EnumString, IntoStaticStr};
Expand All @@ -52,7 +52,6 @@ pub mod chunk;
pub mod concat;
pub mod encoder;
pub mod ffmpeg;
mod grain;
pub(crate) mod parse;
pub mod progress_bar;
pub mod scene_detect;
Expand Down
1 change: 1 addition & 0 deletions av1an-core/src/scenes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ fn get_test_args() -> EncodeArgs {
encoder: Encoder::aom,
extra_splits_len: Some(100),
photon_noise: Some(10),
chroma_noise: false,
sc_pix_format: None,
keep: false,
max_tries: 3,
Expand Down
Loading