Skip to main content

Crate ffcine_filters

Crate ffcine_filters 

Source
Expand description

Frame filters that are ours rather than libplacebo render params: a motion-compensated temporal denoiser, a spatial NLM, and film grain. docs/denoise.md, docs/design.md#frame-filters.

A Filter says where it runs (Point) and what it reads (Footprint, motion), and FilterChain::plan groups a chain into dispatches: a pointwise filter folds into the dispatch before it; one that gathers neighbours (spatial or temporal) needs the whole previous result written out first, so it starts a new dispatch.

How they run (ffcine-render, backend/denoise.rs), all on the grade pass’s pl_gpu (so ffmpeg’s VkDevice, its frames), nothing leaving VRAM:

  • Point::Source (denoise) runs as compute dispatches on the decoded planes right before pl_render_image, into textures the render then reads as its source frame. Not a pl_hook: temporal filters need frames after the current one, and a hook can’t delay its output.
  • Point::Output (grain) is pointwise, so it becomes an mpv .hook on OUTPUT and fuses into the render pass itself.

Kernels are generated GLSL (denoise, grain); this crate has no GPU dependency.

Re-exports§

pub use denoise::Denoise;
pub use denoise::Motion;
pub use denoise::Overrides;
pub use denoise::Preset;
pub use denoise::Spatial;
pub use denoise::Temporal;
pub use grain::Grain;

Modules§

denoise
Motion-compensated temporal denoise plus a spatial NLM, as Vulkan compute kernels.
effect
Timeline effects (docs/timeline.md#effect-schemas): ffcine.fx.denoise/1 and ffcine.fx.grain/1, from an effect’s metadata.ffcine object.
grain
Film grain: luma-weighted, optionally coarse (value noise), fresh every frame. A pointwise kernel at Point::Output, run as an mpv .hook on the grade pass’s OUTPUT stage so it costs no dispatch of its own: libplacebo folds it into the pass that writes the target.

Structs§

FilterChain
Filters in the order they apply within each Point.
Pass
One compute dispatch: a gathering filter (or the frame as is) followed by pointwise ones.

Enums§

Footprint
What a filter reads around the pixel it writes.
Point
Where in the libplacebo grade pass a filter runs.

Traits§

Filter
One frame filter.