Skip to main content

Crate oximedia_codec

Crate oximedia_codec 

Source
Expand description

Audio and video codec implementations for OxiMedia.

This crate provides encoding and decoding for royalty-free codecs:

§Video Codecs

  • AV1 - Alliance for Open Media codec (primary)
  • VP9 - Google’s royalty-free codec
  • VP8 - Google’s earlier royalty-free codec
  • Theora - Xiph.Org Foundation codec (VP3-based)

§Audio Codecs

  • Opus - Modern low-latency audio codec

§Architecture

All codecs implement unified traits:

§Example

use oximedia_codec::{VideoDecoder, Av1Decoder};

let mut decoder = Av1Decoder::new(&codec_params)?;
decoder.send_packet(&packet)?;
while let Some(frame) = decoder.receive_frame()? {
    // Process decoded frame
}

§Audio Example

use oximedia_codec::opus::OpusDecoder;

let mut decoder = OpusDecoder::new(48000, 2)?;
let audio_frame = decoder.decode_packet(&packet_data)?;

Re-exports§

pub use vorbis::SimpleVorbisEncoder;
pub use vorbis::VorbisConfig;
pub use vorbis::VorbisEncConfig;
pub use vorbis::VorbisEncoder;
pub use vorbis::VorbisPacket;
pub use vorbis::VorbisQuality;
pub use audio::AudioFrame;
pub use audio::ChannelLayout;
pub use audio::SampleFormat;
pub use error::CodecError;
pub use error::CodecResult;
pub use frame::ColorInfo;
pub use frame::ColorPrimaries;
pub use frame::FrameType;
pub use frame::MatrixCoefficients;
pub use frame::Plane;
pub use frame::TransferCharacteristics;
pub use frame::VideoFrame;
pub use multipass::allocation::AllocationStrategy;
pub use multipass::Allocator;
pub use multipass::Analyzer;
pub use multipass::Buffer;
pub use multipass::BufferConfig;
pub use multipass::ComplexityStats;
pub use multipass::EncoderConfig as MultiPassConfig;
pub use multipass::EncoderError;
pub use multipass::EncodingResult;
pub use multipass::FrameAllocation;
pub use multipass::FrameComplexity;
pub use multipass::LookaheadAnalysis;
pub use multipass::LookaheadFrame;
pub use multipass::MultiPassEncoder;
pub use multipass::PassStats;
pub use multipass::PassType;
pub use multipass::SceneChangeDetector;
pub use multipass::Stats;
pub use multipass::VbvStatistics;
pub use rate_control::AdaptiveAllocation;
pub use rate_control::AdaptiveQuantization;
pub use rate_control::AllocationResult;
pub use rate_control::AnalysisResult;
pub use rate_control::AqMode;
pub use rate_control::BitrateAllocator;
pub use rate_control::BlockQpMap;
pub use rate_control::BufferModel;
pub use rate_control::CbrController;
pub use rate_control::ComplexityEstimator;
pub use rate_control::ContentAdaptiveAllocator;
pub use rate_control::ContentAnalyzer;
pub use rate_control::ContentMetrics;
pub use rate_control::ContentType;
pub use rate_control::CqpController;
pub use rate_control::CrfController;
pub use rate_control::FrameStats;
pub use rate_control::GopAllocationStatus;
pub use rate_control::GopStats;
pub use rate_control::Lookahead;
pub use rate_control::QpResult;
pub use rate_control::QpSelector;
pub use rate_control::QpStrategy;
pub use rate_control::RateControlMode;
pub use rate_control::RateController;
pub use rate_control::RcConfig;
pub use rate_control::RcOutput;
pub use rate_control::SceneChangeDetector as RcSceneChangeDetector;
pub use rate_control::SceneChangeThreshold;
pub use rate_control::SceneContentType;
pub use rate_control::TextureMetrics;
pub use rate_control::VbrController;
pub use reconstruct::BufferPool;
pub use reconstruct::CdefApplicator;
pub use reconstruct::CdefBlockConfig;
pub use reconstruct::CdefFilterResult;
pub use reconstruct::ChromaSubsampling;
pub use reconstruct::DeblockFilter;
pub use reconstruct::DeblockParams;
pub use reconstruct::DecoderPipeline;
pub use reconstruct::EdgeFilter;
pub use reconstruct::FilmGrainParams;
pub use reconstruct::FilmGrainSynthesizer;
pub use reconstruct::FilterDirection;
pub use reconstruct::FilterStrength;
pub use reconstruct::FrameBuffer;
pub use reconstruct::GrainBlock;
pub use reconstruct::LoopFilterPipeline;
pub use reconstruct::OutputConfig;
pub use reconstruct::OutputFormat;
pub use reconstruct::OutputFormatter;
pub use reconstruct::PipelineConfig;
pub use reconstruct::PipelineStage;
pub use reconstruct::PlaneBuffer;
pub use reconstruct::PlaneType;
pub use reconstruct::ReconstructResult;
pub use reconstruct::ReconstructionError;
pub use reconstruct::ResidualBuffer;
pub use reconstruct::ResidualPlane;
pub use reconstruct::StageResult;
pub use reconstruct::SuperResConfig;
pub use reconstruct::SuperResUpscaler;
pub use reconstruct::UpscaleMethod;
pub use tile::assemble_tiles;
pub use tile::decode_tile_stream;
pub use tile::decode_tiles_parallel;
pub use tile::HeaderedTileEncodeOp;
pub use tile::RawLumaEncodeOp;
pub use tile::TileConfig;
pub use tile::TileCoord;
pub use tile::TileDecodeOp;
pub use tile::TileDecodeResult;
pub use tile::TileEncodeOp;
pub use tile::TileEncodeStats;
pub use tile::TileEncoder;
pub use tile::TileResult;
pub use pcm::ByteOrder;
pub use pcm::PcmConfig;
pub use pcm::PcmDecoder;
pub use pcm::PcmEncoder;
pub use pcm::PcmFormat;
pub use traits::BitrateMode;
pub use traits::DecoderConfig;
pub use traits::EncodedPacket;
pub use traits::EncoderConfig;
pub use traits::EncoderPreset;
pub use traits::VideoDecoder;
pub use traits::VideoEncoder;
pub use av1::Av1Decoder;
pub use av1::Av1Encoder;
pub use ffv1::Ffv1Decoder;
pub use ffv1::Ffv1Encoder;
pub use image::convert_rgb_to_yuv420p;
pub use image::convert_yuv420p_to_rgb;
pub use image::rgb_to_yuv;
pub use image::yuv_to_rgb;
pub use image::EncoderConfig as ImageEncoderConfig;
pub use image::ImageDecoder;
pub use image::ImageEncoder;
pub use image::ImageFormat;
pub use png::batch_encode as batch_encode_png;
pub use png::best_encoder;
pub use png::decode as decode_png;
pub use png::encode_grayscale as encode_png_grayscale;
pub use png::encode_rgb as encode_png_rgb;
pub use png::encode_rgba as encode_png_rgba;
pub use png::encoder_from_profile;
pub use png::fast_encoder;
pub use png::get_info as png_info;
pub use png::is_png;
pub use png::optimize as optimize_png;
pub use png::transcode as transcode_png;
pub use png::validate as validate_png;
pub use png::Chromaticity;
pub use png::ColorType as PngColorType;
pub use png::CompressionLevel as PngCompressionLevel;
pub use png::DecodedImage as PngImage;
pub use png::EncoderBuilder as PngEncoderBuilder;
pub use png::EncoderConfig as PngEncoderConfig;
pub use png::EncodingProfile;
pub use png::EncodingStats;
pub use png::FilterStrategy;
pub use png::FilterType;
pub use png::ImageHeader as PngHeader;
pub use png::PaletteEntry;
pub use png::PaletteOptimizer;
pub use png::ParallelPngEncoder;
pub use png::PhysicalDimensions;
pub use png::PngDecoder;
pub use png::PngDecoderExtended;
pub use png::PngEncoder;
pub use png::PngEncoderExtended;
pub use png::PngInfo;
pub use png::PngMetadata;
pub use png::SignificantBits;
pub use png::TextChunk;
pub use gif::is_gif;
pub use gif::DisposalMethod;
pub use gif::DitheringMethod;
pub use gif::GifDecoder;
pub use gif::GifEncoder;
pub use gif::GifEncoderConfig;
pub use gif::GifFrame;
pub use gif::GifFrameConfig;
pub use gif::GraphicsControlExtension;
pub use gif::ImageDescriptor;
pub use gif::LogicalScreenDescriptor;
pub use gif::QuantizationMethod;
pub use jpegxl::AnsDecoder;
pub use jpegxl::AnsDistribution;
pub use jpegxl::AnsEncoder;
pub use jpegxl::BitReader as JxlBitReader;
pub use jpegxl::BitWriter as JxlBitWriter;
pub use jpegxl::DecodedImage as JxlImage;
pub use jpegxl::JxlColorSpace;
pub use jpegxl::JxlConfig;
pub use jpegxl::JxlDecoder;
pub use jpegxl::JxlEncoder;
pub use jpegxl::JxlFrameEncoding;
pub use jpegxl::JxlHeader;
pub use jpegxl::ModularDecoder;
pub use jpegxl::ModularEncoder;
pub use avif::AvifConfig;
pub use avif::AvifDecoder;
pub use avif::AvifEncoder;
pub use avif::AvifImage;
pub use avif::AvifProbeResult;
pub use avif::YuvFormat;

Modules§

apng
APNG (Animated Portable Network Graphics) top-level encoder and decoder.
audio
Audio frame types and sample format definitions.
av1
AV1 codec implementation.
av1_obu
AV1 Open Bitstream Unit (OBU) parsing structures.
avif
AVIF (AV1 Image File Format) encoder and decoder.
bitrate_model
Bitrate modelling and estimation for video encoding.
bitstream_filter
Bitstream filters for codec-level NAL and OBU transformations.
bitstream_writer
Bitstream reading and writing utilities.
celt
Standalone CELT frame decoding types and scaffolding.
codec_caps
Codec capability discovery and hardware acceleration detection.
codec_probe
Codec identification from raw bitstream bytes.
codec_profile
Codec profile and level definitions, and constraint validation.
codec_registry
Codec registry — register and look up codecs by name, FOURCC, or CodecId.
color_range
Color range and level mapping for codec output.
entropy_coding
Entropy coding primitives.
entropy_tables
Table-based CDF arithmetic coding for AV1 entropy coding optimization.
error
Codec-specific error types.
error_concealment
Error concealment for lost or corrupted video frames.
features
Codec capability and feature detection.
ffv1
FFV1 (FF Video Codec 1) lossless video codec.
flac
FLAC (Free Lossless Audio Codec) encoder and decoder.
flac_codec
Simplified FLAC codec using fixed linear prediction + Rice coding.
frame
Video frame types.
frame_queue
Encoder frame queue with PTS-ordered input, B-frame reorder buffer, and DTS calculation.
frame_types
Frame type management for video encoding.
gif
GIF (Graphics Interchange Format) codec implementation.
gop_structure
GOP (Group of Pictures) structure analysis and planning.
hdr
HDR Tone Mapping operators for High Dynamic Range to Standard Dynamic Range conversion.
image
Image I/O for thumbnails and frame extraction.
intra
Shared intra prediction module for AV1 and VP9 decoders.
jpegxl
JPEG-XL (ISO/IEC 18181) codec implementation.
motion
Motion estimation module for video encoders.
multipass
Multi-pass encoding with look-ahead for OxiMedia codecs.
multipass_quality
Multipass encoding quality comparison.
nal_unit
NAL unit handling for H.264/H.265.
packet_builder
Codec packet and frame building utilities.
packet_queue
Codec packet queuing and reordering.
packet_splitter
Packet splitting and fragment reassembly for codec bitstreams.
pcm
PCM (Pulse Code Modulation) codec — trivial encode/decode for raw audio.
picture_timing
Picture timing supplemental enhancement information (SEI) types.
png
PNG (Portable Network Graphics) codec implementation.
profile_level
Codec profile and level definitions.
psycho_visual
Psycho-visual masking model for perceptual rate control.
quality_metrics
Quality metrics for codec evaluation.
rate_control
Rate control module for video encoders.
rate_control_accuracy
Rate control accuracy verification.
reconstruct
Video frame reconstruction pipeline.
reference_frames
Reference frame management for H.264/H.265 decoded picture buffers (DPB).
scene_change_idr
Scene-change detection and adaptive I-frame (IDR) insertion.
sei_nal
SEI / NAL-unit helpers for VP8/AV1 metadata attachment.
silk
Standalone SILK frame decoding types and scaffolding.
simd
SIMD abstraction layer for video codec implementations.
slice_header
H.264/H.265 slice header types and parsing utilities.
stats
Bitstream quality statistics.
stream_info
Stream information parsing and media container metadata.
tile
Generic tile-based parallel frame encoding for OxiMedia codecs.
tile_encoder
Tile-based parallel frame encoding for OxiMedia codecs.
traits
Codec traits for video encoding and decoding.
vbr_twopass
VBR two-pass encoding state tracking.
vorbis
Vorbis audio encoder and decoder.
webp
WebP codec support.