Skip to main content

Module codec_profile

Module codec_profile 

Source
Expand description

Codec profile and level definitions, and constraint validation.

This module provides:

  • Profile enumerations for AV1, VP9, and Opus.
  • The AV1 level table (levels 2.0 – 6.3) with decoded capability limits.
  • CodecConstraints — a codec-agnostic constraints bag and validation helpers for both video and audio streams.

§Example

use oximedia_codec::codec_profile::{Av1Level, CodecConstraints};

// Find the lowest AV1 level sufficient for 4K @ 60 fps / 20 Mbps.
let level = Av1Level::select_for(3840, 2160, 60.0, 20_000);
assert!(level.is_some());

// Validate a stream against AV1 Main profile constraints.
let c = CodecConstraints::av1_main();
let result = CodecConstraints::validate_video(&c, 1920, 1080, 60.0, 10_000);
assert!(result.is_ok());

Structs§

Av1Level
An entry in the AV1 level table.
Av1ProfileDef
Full AV1 profile definition with chroma and bit depth constraints.
CodecCapability
Codec capability descriptor for negotiation.
CodecConstraints
A codec-agnostic constraints record used for profile/level validation.
HwDecodeCapability
Hardware decode capability for a specific decoder tier.
NegotiatedCapability
Result of capability negotiation.
Vp9ProfileDef
Full VP9 profile definition with bit depth and chroma constraints.

Enums§

Av1Profile
AV1 codec profile.
ChromaSubsampling
Chroma subsampling format.
HwDecoderTier
Hardware decoder tier.
OpusProfile
Opus application / profile mode.
Vp9Profile
VP9 codec profile.

Functions§

is_profile_compatible
Check if a decoder supporting decoder_profile can handle content encoded with content_profile.
negotiate_capabilities
Negotiate the best common capability between an encoder and decoder.
required_hw_tier
Determine the minimum hardware tier required for a given stream.