Expand description
oxideav-core types as oxinfer’s in-memory media (the oxideav feature): decoded pictures,
audio and video as VideoFrame / AudioFrame plus the CodecParameters that describe
them, converted to what the towers take (RGB8, mono f32 at the model’s rate), and RGB output
(Stable Diffusion) back to a frame.
Only oxideav-core is used: no codec, container or file code, so these work in a build without
the media feature, e.g. inside an oxideav pipeline filter that already has decoded frames.
oxideav frames carry no geometry or format of their own; CodecParameters gives width,
height and pixel_format (video), sample_rate, channels and sample_format (audio).
YCbCr is converted with the matrix and range of the colour signal (the frame’s
VideoFrame::color_signal record, else CodecParameters::color_signal): unspecified
means BT.601, limited range (full for the YuvJ* formats). The arithmetic (Q15 fixed point,
nearest-neighbour chroma, deep samples narrowed to their top 8 bits) is the one of
oxideav-pixfmt, so every format both convert gives the same RGB bytes as
oxideav_image::Image::to_rgb8, which the path-based inputs use.
Structs§
- Audio
Clip - Decoded audio: frames in stream order and the stream parameters describing them
(
sample_rate,channels,sample_format). An audio attachment, or Whisper input. - Picture
- A decoded picture: one frame and the stream parameters describing it (
width,height,pixel_format, optionally the colour signal). An image attachment, or a decision’s image. - Video
Clip - Decoded video: frames in presentation order, the stream parameters describing them and the
time base of their
pts. Frames are sampled as the model’s video processor does (seecrate::video::VideoOptions); the prompt timestamps of the sampled frames come from theirptswhen every frame has one andtime_baseis set, otherwise from their index and the frame rate. The frame rate isparams.frame_rate, else the one theptsimply, elseDEFAULT_FPS.
Functions§
- audio_
frames_ to_ mono - Decoded audio frames to mono f32 in [-1, 1] (channels averaged) at
rateHz, resampled withcrate::audio::resamplewhen the stream’s rate differs.paramsgivessample_rate,channels(default 1) andsample_format(inferred from the frame layout when missing). EverySampleFormat, interleaved or planar, is supported. - complete_
params - The parameters a decoder left out (
width,height,pixel_format), inferred from the frame’s plane layout: some decoders do not report their output format in the stream parameters. - mono_
audio_ frame - One frame of mono
F32samples atsample_ratewith presentation timepts(in samples, i.e. a time base of 1 /sample_rate) and the parameters describing it: text-to-speech output (crate::tts), whole or streamed. - rgb_
frame - A tightly packed
Rgb24frame (pts0) and itsrawvideoparameters (width,height,pixel_format), e.g. to hand a generated image to an oxideav encoder. The colour signal is left unspecified, as oxideav-image does for raw RGB: an sRGB signal would carry the identity matrix, which an RGB to YCbCr conversion downstream would then apply. - video_
frame_ to_ rgb - Converts a decoded frame to tightly packed RGB8.
paramsgiveswidth,heightandpixel_format; when one is missing it is inferred from the plane layout as for decoded files (complete_params). Alpha is dropped (not composited), deeper samples are narrowed to their top 8 bits, palettes (Pal8) are expanded. YCbCr uses the colour signal’s matrix (BT.601 when unspecified; BT.709, FCC, BT.470BG, SMPTE 170M / 240M, BT.2020 NCL and identity are implemented) and range (limited unless signalled, or aYuvJ*format). Formats without an RGB meaning here (CMYK, float, …) are an error naming the format.