Expand description
Hardware acceleration abstraction layer for OxiMedia.
oximedia-accel provides GPU-accelerated computation for video processing
operations using Vulkan compute shaders. It includes CPU fallback paths
for systems without GPU support.
§Features
- Device Management: Automatic GPU device enumeration and selection
- Buffer Management: Efficient GPU memory allocation and transfer
- Compute Kernels: Image scaling, color conversion, motion estimation
- CPU Fallback: Automatic fallback to CPU implementations
- Safe Vulkan: Uses vulkano for safe Vulkan API access
§Architecture
The acceleration layer is designed around the HardwareAccel trait,
which provides a unified interface for both GPU and CPU implementations.
┌─────────────────────────────────────────┐
│ HardwareAccel Trait │
└─────────────────────────────────────────┘
│ │
▼ ▼
┌────────────┐ ┌────────────┐
│ VulkanAccel│ │ CpuFallback│
└────────────┘ └────────────┘§Example
use oximedia_accel::{AccelContext, HardwareAccel, ScaleFilter};
use oximedia_core::types::PixelFormat;
// Create acceleration context (automatically selects GPU or CPU)
let accel = AccelContext::new()?;
// Perform image scaling
let input = vec![0u8; 1920 * 1080 * 3];
let output = accel.scale_image(
&input,
1920, 1080,
1280, 720,
PixelFormat::Rgb24,
ScaleFilter::Bilinear,
)?;Re-exports§
pub use error::AccelError;pub use error::AccelResult;pub use traits::HardwareAccel;pub use traits::ScaleFilter;pub use accel_stats::AccelProfiler;pub use accel_stats::ProfileEntry;pub use memory_arena::MemoryPressureMonitor;pub use memory_arena::MemoryPressurePolicy;pub use memory_arena::PressureLevel;pub use ops::convolution::ConvolutionConfig;pub use ops::convolution::ConvolutionFilter;pub use ops::convolution::EdgeMode;pub use ops::deinterlace::DeinterlaceConfig;pub use ops::deinterlace::DeinterlaceMethod;pub use ops::deinterlace::FieldOrder;pub use ops::color::hlg_to_sdr_tonemap;pub use ops::color::pq_to_sdr_tonemap;pub use ops::color::rgb_to_yuv420;pub use ops::color::yuv420_to_rgb;pub use ops::color::YuvRange;pub use ops::color::YuvStandard;pub use ops::alpha_blend;pub use ops::alpha_blend_rgba;pub use workgroup::compute_optimal_workgroup;pub use workgroup::OpType;
Modules§
- accel_
profile - Acceleration target profiles for
oximedia-accel. - accel_
stats - Performance statistics and counters for the acceleration layer.
- buffer
- GPU buffer management for efficient data transfer.
- cache
- LRU cache for accelerated processing results.
- cpu_
fallback - CPU fallback implementations for hardware acceleration operations.
- descriptor_
pool - Descriptor set pooling for Vulkan compute pipelines.
- device
- GPU device enumeration and selection.
- device_
caps - GPU device capability detection and feature reporting.
- dispatch
- CPU capability detection and runtime dispatch selection.
- error
- Error types for hardware acceleration.
- fence_
timeline - GPU fence / timeline synchronisation primitives.
- kernels
- High-level kernel interfaces for compute operations.
- memory_
arena - GPU-style memory arena allocator.
- memory_
bandwidth - Memory-bandwidth measurement utilities for
oximedia-accel. - ops
- High-level operations built on compute kernels.
- pipeline_
accel - Pipeline acceleration helpers.
- pool
- Thread-pool abstraction for accelerated work items.
- prefetch
- Memory prefetching helpers.
- shaders
- Vulkan compute shaders for image processing operations.
- task_
graph - Directed acyclic graph (DAG) for expressing GPU/CPU task dependencies.
- task_
scheduler - Task scheduler for hardware-accelerated operations in
oximedia-accel. - traits
- Traits for hardware acceleration.
- vulkan
- Vulkan-based hardware acceleration implementation.
- workgroup
- Compute workgroup size management for GPU dispatch.
Structs§
- Accel
Context - Main acceleration context that automatically selects GPU or CPU backend.