Skip to main content

Module h264_poc

Module h264_poc 

Source
Expand description

Reconstruct the H.264 picture order count (POC) from a bitstream.

The POC (ITU-T H.264 §8.2.1) is the one signal that cannot lie about a stream’s true display order: every slice header carries enough information to recover the relative presentation order of samples, independent of any container metadata (stts/ctts) or of what a (possibly buggy) writer put in a per-frame timestamp SEI. Within a coded video sequence (delimited by IDR pictures), sorting frames by POC yields presentation order.

This module is used both to reorder frames into presentation order (see crate::FrameDataSource::presentation_order_iter) and by mp4-bframe-doctor to detect/repair files whose timing disagrees with the bitstream’s real display order.

Structs§

PocReader
Accumulates the H.264 parsing context (SPS/PPS) and the POC strategy as samples are read, so a whole file can be walked (in decode order) and each frame’s picture order count reconstructed the same way.