Skip to main content

Crate yscv_video

Crate yscv_video 

Source
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§

BiMotionVector
Bi-directional motion vectors for B-slice macroblocks.
BitstreamReader
Reads individual bits and Exp-Golomb coded integers from a byte slice.
CabacContext
Adaptive probability context model for CABAC (H.264, 9.3.1).
CabacDecoder
CABAC arithmetic decoder for HEVC (ITU-T H.265, 9.3.3).
CameraConfig
CameraDeviceInfo
CameraFrameSource
CodingTreeUnit
Coding Tree Unit — the basic processing unit in HEVC (replaces H.264 macroblock).
CodingUnitData
Decoded data produced by parse_coding_unit.
ContextModel
Adaptive probability context model for CABAC (ITU-T H.265, 9.3.1).
DecodedCu
Result of decoding one coding unit leaf.
DecodedFrame
A decoded video frame with metadata.
EncodedPacket
A compressed video packet.
Frame
One decoded/produced frame in HWC tensor layout.
FrameStream
Pull-based frame stream wrapper with deterministic optional limit.
H264CabacDecoder
CABAC binary arithmetic decoder for H.264.
H264Decoder
Baseline H.264 decoder.
HevcDecoder
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).
HevcMvField
Per-PU motion information for L0 and L1 reference lists.
HevcPps
HEVC Picture Parameter Set.
HevcReferencePicture
A reconstructed reference picture stored in the DPB.
HevcSliceCabacState
CABAC state for decoding a single slice, holding all context models and the arithmetic decoder tied to the slice payload data.
HevcSliceHeader
HEVC Slice Header (simplified).
HevcSps
HEVC Sequence Parameter Set.
HevcVps
HEVC Video Parameter Set.
ImageSequenceReader
Image sequence reader: reads numbered image files as a video stream.
InMemoryFrameSource
Deterministic in-memory source for tests and reproducible local runs.
MotionVector
Motion vector for a macroblock partition.
Mp4Box
A parsed MP4 box header.
Mp4VideoReader
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).
RawVideoReader
Reads raw RGB8 frames from a simple uncompressed video file.
RawVideoWriter
Writes raw RGB8 frames to a simple uncompressed video file.
ReferenceFrameBuffer
Simple reference frame buffer for P-slice decoding.
Rgb8Frame
Raw RGB8 frame payload that can be consumed without f32 conversion.
SaoParams
SAO parameters for a single CTU and colour component.
SliceHeader
Parsed slice header (subset of fields needed for IDR decoding).
Sps
Parsed Sequence Parameter Set (subset of fields needed for frame dimensions).
VideoMeta
Video container metadata.

Enums§

BPredMode
B-slice prediction mode.
EntropyCodingMode
Identifies the entropy coding mode from a PPS.
HevcIntraMode
HEVC intra prediction mode index.
HevcNalUnitType
HEVC NAL unit types (ITU-T H.265).
HevcPredMode
Prediction mode for a coding unit.
HevcSliceType
HEVC slice types.
NalUnitType
H.264 NAL unit types.
PixelFormat
SaoType
SAO offset type.
VideoCodec
Supported video codec identifiers.
VideoError

Constants§

CRATE_ID
H264_NUM_CABAC_CONTEXTS
Number of context variables used in H.264 CABAC.
HEVC_BETA_TABLE
beta (decision threshold) table indexed by Q' = 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 by Q = 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§

FrameSource
Generic frame source abstraction.
VideoDecoder
Trait for video decoders that convert compressed NAL units to RGB8 frames.
VideoEncoder
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 p and q.
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_flag for 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 n bits using bypass decoding.
decode_mb_type_i_slice
Decode mb_type for an I-slice macroblock.
decode_mb_type_p_slice
Decode mb_type for 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 >> shift per coefficient.
hevc_derive_beta
Look up the beta threshold from QP.
hevc_derive_tc
Look up the tc threshold 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 0x000001 or 0x00000001 start 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_idx from 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_flag from 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.