Skip to content
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
3 changes: 3 additions & 0 deletions .idea/av-denoise.iml

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

10 changes: 7 additions & 3 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ strum_macros = "0.28"
bon = "3"
cubecl = { version = "0.10", features = ["std"] }
av-denoise-core = { path = "av-denoise-core", version = "0.5.0-alpha3", default-features = false }
av-denoise = { path = "av-denoise", version = "0.5.0-alpha3", default-features = false }

[profile.test]
opt-level = 3
Expand Down
5 changes: 5 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ build-static features=static_features:
bench *ARGS:
cargo bench -p av-denoise-core {{ARGS}}

# Benchmarks the host layer, end to end through `HostDenoiser` and `PlanarDenoiser`.
bench-host *ARGS:
cargo bench -p av-denoise --features vulkan {{ARGS}}

build-vs *ARGS:
cargo build -p av-denoise-vs --release {{ARGS}}

Expand All @@ -84,6 +88,7 @@ test-rust:
cargo nextest run --release -p av-denoise --features vulkan,binary
cargo nextest run --release -p av-denoise-vs --features vulkan
cargo test --doc -p av-denoise-core --features vulkan
cargo test --doc -p av-denoise --features vulkan
cargo check --workspace

# Every Python test, including the ones that render on the GPU.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ without use.

If the cache directory cannot be created, `av-denoise` logs a warning and carries on without a cache.

Library users can call `av_denoise::install_compilation_cache()` before `Denoiser::create` to get the same
behaviour in their own binary. It has to run before the first `Denoiser` exists, because building a CubeCL client
Library users can call `av_denoise::install_compilation_cache()` before `HostDenoiser::create` to get the same
behaviour in their own binary. It has to run before the first denoiser exists, because building a CubeCL client
locks the global config. An embedder that wants to choose the cache directory itself can call
`av_denoise::default_cache_dir()` to get the same default this crate uses, and
`av_denoise::install_compilation_cache_at()` to install it, or any other directory, directly.
16 changes: 1 addition & 15 deletions av-denoise-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Core kernels and types for av-denoise (Do not use directly)"
description = "GPU denoising engines that read and write CubeCL handles"
categories = ["multimedia::video"]
keywords = ["cubecl", "denoise", "gpu"]
readme = "README.md"
Expand All @@ -28,14 +28,12 @@ tracing = "0.1"
strum_macros = "0.28"
strum = "0.28"
bon = "3"
etcetera = "0.11"

cubecl = { version = "0.10", features = ["std"] }

[dev-dependencies]
futures = "0.3"
clap = { version = "4", features = ["derive"] }
tempfile = "3"

[features]
vulkan = ["cubecl/vulkan"]
Expand All @@ -52,26 +50,14 @@ harness = false
name = "bench_kernels"
harness = false

[[bench]]
name = "denoise"
harness = false

[[bench]]
name = "motion"
harness = false

[[bench]]
name = "convert"
harness = false

[[bench]]
name = "nl4d_ablation"
harness = false

[[bench]]
name = "reseed"
harness = false

[[bench]]
name = "mc_accuracy"
harness = false
43 changes: 41 additions & 2 deletions av-denoise-core/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# av-denoise-core

The core library and kernels for the av-denoise system.
GPU denoising engines that read and write CubeCL plane handles.

You should use either the `av-denoise` library, binary or VapourSynth plugin, not this crate directly.
`Nlmeans` and `Nl4d` implement `Engine`. Push one frame of planes at a time. Each push returns how many
frames are ready, and every ready frame is written into planes you own with `Engine::emit_into` before the
next push. At the end of a stream, `Engine::finish` returns the tail count.

`Nl4dOptions::default()` uses the base preset's `temporal_radius` and calibrated defaults for the rest.

```rust,no_run
use av_denoise_core::{ChannelMode, DevicePlane, Engine, Geometry, Nl4d, Nl4dOptions, SampleFormat};
use cubecl::Runtime;
use cubecl::wgpu::WgpuRuntime;

# fn main() -> Result<(), av_denoise_core::Error> {
let device = <WgpuRuntime as Runtime>::Device::default();
let client = WgpuRuntime::client(&device);
let geometry = Geometry {
width: 1920,
height: 1080,
channels: ChannelMode::Luma,
input: SampleFormat::U16 { depth: 10 },
output: SampleFormat::U16 { depth: 10 },
};
let mut engine = Nl4d::new(&client, Nl4dOptions::default(), geometry)?;

let input = client.empty(1920 * 1080 * 2);
let output = client.empty(1920 * 1080 * 2);
let input_planes = [DevicePlane::new(&input, 1920, 1080)];
let output_planes = [DevicePlane::new(&output, 1920, 1080)];

let ready = engine.push(&input_planes)?;
for _ in 0..ready {
engine.emit_into(&output_planes)?;
}

let tail = engine.finish()?;
for _ in 0..tail {
engine.emit_into(&output_planes)?;
}
# Ok(())
# }
```
Loading
Loading