Expand description
Video and camera input pipeline primitives for yscv.
Modules§
- cavlc
- H.264 CAVLC (Context-Adaptive Variable-Length Coding) entropy decoding.
- h264_
bslice - H.264 B-slice decoding: bi-directional motion vectors, prediction modes, and bi-predictive motion compensation.
- h264_
cabac - H.264 CABAC (Context-based Adaptive Binary Arithmetic Coding) entropy decoder.
- h264_
deblock - H.264 in-loop deblocking filter.
- h264_
motion - H.264 P-slice motion compensation: motion vector parsing, prediction, reference frame buffering, and inter-frame block copy.
- hevc_
cabac - HEVC CABAC (Context-based Adaptive Binary Arithmetic Coding) entropy decoder.
- hevc_
decoder - H.265/HEVC Video Decoder
- hevc_
filter - HEVC in-loop filters (deblocking + SAO) and chroma decoding.
- hevc_
inter - HEVC inter prediction: reference picture management, motion compensation, merge mode, AMVP, and inter CU parsing (ITU-T H.265 sections 8.5, 8.5.3).
- hevc_
syntax - HEVC CU/PU/TU syntax parsing using CABAC (ITU-T H.265, sections 7.3.8-7.3.12).
Structs§
- BiMotion
Vector - Bi-directional motion vectors for B-slice macroblocks.
- Bitstream
Reader - Reads individual bits and Exp-Golomb coded integers from a byte slice.
- Cabac
Context - Adaptive probability context model for CABAC (H.264, 9.3.1).
- Cabac
Decoder - CABAC arithmetic decoder for HEVC (ITU-T H.265, 9.3.3).
- Camera
Config - Camera
Device Info - Camera
Frame Source - Coding
Tree Unit - Coding Tree Unit — the basic processing unit in HEVC (replaces H.264 macroblock).
- Coding
Unit Data - Decoded data produced by
parse_coding_unit. - Context
Model - Adaptive probability context model for CABAC (ITU-T H.265, 9.3.1).
- Decoded
Cu - Result of decoding one coding unit leaf.
- Decoded
Frame - A decoded video frame with metadata.
- Encoded
Packet - A compressed video packet.
- Frame
- One decoded/produced frame in HWC tensor layout.
- Frame
Stream - Pull-based frame stream wrapper with deterministic optional limit.
- H264
Cabac Decoder - CABAC binary arithmetic decoder for H.264.
- H264
Decoder - Baseline H.264 decoder.
- Hevc
Decoder - Top-level HEVC decoder state.
- HevcDpb
- Decoded Picture Buffer — manages reference pictures for inter prediction.
- HevcMv
- Quarter-pel motion vector (14-bit range + sign per component).
- Hevc
MvField - Per-PU motion information for L0 and L1 reference lists.
- HevcPps
- HEVC Picture Parameter Set.
- Hevc
Reference Picture - A reconstructed reference picture stored in the DPB.
- Hevc
Slice Cabac State - CABAC state for decoding a single slice, holding all context models and the arithmetic decoder tied to the slice payload data.
- Hevc
Slice Header - HEVC Slice Header (simplified).
- HevcSps
- HEVC Sequence Parameter Set.
- HevcVps
- HEVC Video Parameter Set.
- Image
Sequence Reader - Image sequence reader: reads numbered image files as a video stream.
- InMemory
Frame Source - Deterministic in-memory source for tests and reproducible local runs.
- Motion
Vector - Motion vector for a macroblock partition.
- Mp4Box
- A parsed MP4 box header.
- Mp4Video
Reader - Reads H.264-encoded MP4 video files and decodes frames to RGB8.
- NalUnit
- A parsed NAL unit from an Annex B bitstream.
- Pps
- Parsed Picture Parameter Set (subset).
- RawVideo
Reader - Reads raw RGB8 frames from a simple uncompressed video file.
- RawVideo
Writer - Writes raw RGB8 frames to a simple uncompressed video file.
- Reference
Frame Buffer - Simple reference frame buffer for P-slice decoding.
- Rgb8
Frame - Raw RGB8 frame payload that can be consumed without f32 conversion.
- SaoParams
- SAO parameters for a single CTU and colour component.
- Slice
Header - Parsed slice header (subset of fields needed for IDR decoding).
- Sps
- Parsed Sequence Parameter Set (subset of fields needed for frame dimensions).
- Video
Meta - Video container metadata.
Enums§
- BPred
Mode - B-slice prediction mode.
- Entropy
Coding Mode - Identifies the entropy coding mode from a PPS.
- Hevc
Intra Mode - HEVC intra prediction mode index.
- Hevc
NalUnit Type - HEVC NAL unit types (ITU-T H.265).
- Hevc
Pred Mode - Prediction mode for a coding unit.
- Hevc
Slice Type - HEVC slice types.
- NalUnit
Type - H.264 NAL unit types.
- Pixel
Format - SaoType
- SAO offset type.
- Video
Codec - Supported video codec identifiers.
- Video
Error
Constants§
- CRATE_
ID - H264_
NUM_ CABAC_ CONTEXTS - Number of context variables used in H.264 CABAC.
- HEVC_
BETA_ TABLE beta(decision threshold) table indexed byQ' = Clip3(0, 51, qP_L + beta_offset). ITU-T H.265 Table 8-12.- HEVC_
CHROMA_ FILTER - HEVC 4-tap chroma interpolation filter coefficients. Index by fractional-sample phase (1/8-pel, 0..7); phase 0 is pass-through.
- HEVC_
TC_ TABLE tc(clipping threshold) table indexed byQ = Clip3(0, 53, qP_L + 2*(bs-1) + tc_offset). ITU-T H.265 Table 8-11.- NUM_
CABAC_ CONTEXTS - Total number of CABAC context models for syntax parsing.
Traits§
- Frame
Source - Generic frame source abstraction.
- Video
Decoder - Trait for video decoders that convert compressed NAL units to RGB8 frames.
- Video
Encoder - Trait for video encoders that compress RGB8 frames.
Functions§
- build_
amvp_ candidates - Build the AMVP candidate list (2 candidates).
- build_
merge_ candidates - Build the merge candidate list from spatial neighbours (simplified).
- build_
mpm_ list - Build the MPM list from left and above neighbour intra modes.
- chroma_
interpolate_ row - Apply horizontal 4-tap chroma interpolation across a row.
- chroma_
interpolate_ sample - Apply 4-tap chroma interpolation to produce one output sample.
- compute_
boundary_ strength - Compute boundary strength (bS) for a pair of adjacent blocks
pandq. - deblock_
edge_ luma - Apply the deblocking filter to a single edge consisting of 4 pixel pairs.
- deblock_
frame - Filter all macroblock boundaries in a frame.
- decode_
b_ macroblock - Decode a B-slice macroblock: parse mb_type and motion vectors, then apply motion compensation.
- decode_
coded_ block_ flag - Decode
coded_block_flagfor a 4x4 luma block. - decode_
coding_ tree - Recursively decode a coding tree (quad-tree split).
- decode_
coding_ tree_ cabac - Recursively decode a coding tree using CABAC, producing decoded CU leaves.
- decode_
exp_ golomb_ bypass - Decode a k-th order Exp-Golomb coded value using bypass bins.
- decode_
fixed_ length - Decode a fixed-length code of
nbits using bypass decoding. - decode_
mb_ type_ i_ slice - Decode
mb_typefor an I-slice macroblock. - decode_
mb_ type_ p_ slice - Decode
mb_typefor a P-slice macroblock. - decode_
residual_ block_ cabac - Decode residual coefficients for one 4x4 block via CABAC.
- decode_
truncated_ unary - Decode a truncated-unary coded value.
- decode_
unary - Decode a unary-coded value (sequence of 1s terminated by 0, or max bins).
- dequant_
4x4 - Dequantizes a 4x4 block of transform coefficients in-place.
- derive_
chroma_ qp - Derive chroma QP from luma QP (clamped).
- extract_
parameter_ sets - Extracts SPS and PPS NAL units from an Annex B bitstream.
- filter_
camera_ devices - finalize_
hevc_ frame - Produce a YCbCr frame with deblocking and SAO applied, then convert to RGB.
- find_
box - Finds a box by 4-char type code.
- hevc_
apply_ sao - Apply SAO to one colour plane of a reconstructed CTU.
- hevc_
bipred_ average - Bi-prediction average: combine L0 and L1 predictions and clip to [0, 255].
- hevc_
boundary_ strength - Compute boundary strength (bs) for an edge between blocks P and Q.
- hevc_
deblock_ frame - Apply deblocking filter to an entire frame (all three planes).
- hevc_
dequant - HEVC dequantisation for a transform block.
Applies
level * scale >> shiftper coefficient. - hevc_
derive_ beta - Look up the
betathreshold from QP. - hevc_
derive_ tc - Look up the
tcthreshold from QP and boundary strength. - hevc_
filter_ edge_ chroma - Filter one 2-sample chroma edge (ITU-T H.265, 8.7.2.5.5).
- hevc_
filter_ edge_ luma - Filter one 4-sample luma edge.
- hevc_
frame_ dimensions - Extract frame dimensions from HEVC SPS.
- hevc_
inverse_ dct_ 4x4 - Inverse 4×4 DCT-II (HEVC).
- hevc_
inverse_ dct_ 8x8 - Inverse 8×8 DCT-II (HEVC).
- hevc_
inverse_ dct_ 16x16 - Generic inverse DCT for 16×16 blocks (partial butterfly, simplified).
- hevc_
inverse_ dct_ 32x32 - Generic inverse DCT for 32×32 blocks (direct matrix multiply, simplified).
- hevc_
inverse_ dst_ 4x4 - Inverse 4×4 DST (HEVC, for intra 4×4 luma).
- hevc_
mc_ luma - Luma motion compensation with quarter-pel interpolation (8-tap filter).
- hevc_
parse_ mvd - Parse a motion vector difference from the CABAC bitstream.
- hevc_
unipred_ clip - Uni-prediction clip: convert an intermediate i16 buffer to u8.
- init_
cabac_ contexts - Initialise a full set of CABAC context variables for a given QP.
- intra_
predict_ angular - Simple angular intra prediction placeholder (modes 2..=34). Uses horizontal or vertical extrapolation depending on mode direction. HEVC angular intra prediction with fractional-sample interpolation.
- intra_
predict_ dc - DC intra prediction: fills block with average of top and left neighbours.
- intra_
predict_ planar - Planar intra prediction (HEVC mode 0).
- inverse_
dct_ 4x4 - Performs the H.264 4x4 inverse integer transform in-place.
- list_
camera_ devices - motion_
compensate_ 16x16 - Apply motion compensation: copy a 16x16 block from the reference frame with the given motion vector offset. Pixel coordinates that fall outside the reference frame are clamped to the nearest edge sample.
- motion_
compensate_ bipred - Bi-directional motion compensation: dispatches to the correct mode and averages forward and backward predictions when needed.
- normalize_
rgb8_ to_ f32_ inplace - Converts raw RGB8 bytes to normalized f32 values (
0.0..=1.0) in-place. - parse_
annex_ b - Parses H.264 Annex B bitstream into NAL units.
Splits on
0x000001or0x00000001start codes. - parse_
child_ boxes - Parses child boxes inside a parent box.
- parse_
coding_ unit - Parse a coding unit from the bitstream (ITU-T H.265, 7.3.8.5).
- parse_
hevc_ pps - Parse HEVC PPS from NAL unit payload (after the 2-byte NAL header).
- parse_
hevc_ sps - Parse HEVC SPS from NAL unit payload (after the 2-byte NAL header).
- parse_
hevc_ vps - Parse HEVC VPS from NAL unit payload (after the 2-byte NAL header).
- parse_
inter_ prediction - Parse inter prediction data for one CU from the CABAC bitstream.
- parse_
merge_ idx - Parse
merge_idxfrom the CABAC bitstream (truncated unary, bypass coded). - parse_
mp4_ boxes - Parses top-level MP4 boxes from a byte buffer.
- parse_
pps - Parses a PPS NAL unit (without the NAL header byte).
- parse_
sao_ params - Parse SAO parameters from the CABAC decoder.
- parse_
split_ cu_ flag - Read
split_cu_flagfrom the bitstream. - parse_
sps - Parses an SPS NAL unit (without the NAL header byte).
- parse_
transform_ unit - Parse a transform unit’s residual coefficients.
- predict_
mv - Predict motion vector from neighboring blocks (median prediction).
- query_
camera_ devices - reconstruct_
chroma_ plane - Reconstruct chroma planes from decoded CU data.
- resolve_
camera_ device - resolve_
camera_ device_ index - yuv420_
to_ rgb8 - Converts YUV 4:2:0 planar to RGB8 interleaved using BT.601 coefficients.