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 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::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::ContentAnalyzer;
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::SceneChangeThreshold;
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::HeaderedTileEncodeOp;
pub use tile::RawLumaEncodeOp;
pub use tile::TileConfig;
pub use tile::TileCoord;
pub use tile::TileEncodeOp;
pub use tile::TileEncodeStats;
pub use tile::TileEncoder;
pub use tile::TileResult;
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;

Modules§

audio
Audio frame types and sample format definitions.
av1
AV1 codec implementation.
av1_obu
AV1 Open Bitstream Unit (OBU) parsing structures.
bitrate_model
Bitrate modelling and estimation for video encoding.
bitstream_writer
Bitstream reading and writing utilities.
celt
Standalone CELT frame decoding types and scaffolding.
codec_caps
Codec capability discovery and hardware acceleration detection.
color_range
Color range and level mapping for codec output.
entropy_coding
Entropy coding primitives.
error
Codec-specific error types.
ffv1
FFV1 (FF Video Codec 1) lossless video codec.
frame
Video frame types.
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.
nal_unit
NAL unit handling for H.264/H.265.
packet_queue
Codec packet queuing and reordering.
picture_timing
Picture timing supplemental enhancement information (SEI) types.
png
PNG (Portable Network Graphics) codec implementation.
profile_level
Codec profile and level definitions.
rate_control
Rate control module for video encoders.
reconstruct
Video frame reconstruction pipeline.
reference_frames
Reference frame management for H.264/H.265 decoded picture buffers (DPB).
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.
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.