|
Hermes 0.7.0
Linux game streaming host
|
Removing filler data units from an Annex B H.264 or HEVC frame. More...
#include <cstddef>#include <cstdint>#include <cstring>Go to the source code of this file.
Enumerations | |
| enum class | video::annexb::codec_e { h264 , hevc } |
| Which bitstream syntax a frame uses. More... | |
Functions | |
| std::size_t | video::annexb::detail::find_start_code (const std::uint8_t *data, std::size_t from, std::size_t size) |
| Offset of the next 00 00 01 start code at or after from, or size. | |
| bool | video::annexb::detail::is_filler (std::uint8_t header, codec_e codec) |
| Filler data: H.264 nal_unit_type 12, HEVC nal_unit_type 38 (FD_NUT). | |
| std::size_t | video::annexb::strip_filler_data (std::uint8_t *data, std::size_t size, codec_e codec) |
Removing filler data units from an Annex B H.264 or HEVC frame.
Definition in file annexb_filler.h.
|
strong |
Which bitstream syntax a frame uses.
Definition at line 14 of file annexb_filler.h.
|
inline |
Offset of the next 00 00 01 start code at or after from, or size.
Definition at line 21 of file annexb_filler.h.
|
inline |
Filler data: H.264 nal_unit_type 12, HEVC nal_unit_type 38 (FD_NUT).
Definition at line 37 of file annexb_filler.h.
|
inline |
Remove the filler data units from an Annex B frame, in place.
In CBR, radeonsi pads H.264 and HEVC frames with filler data up to the target bitrate, and FFmpeg has no option to turn that off: a still screen streams at the full bitrate, nearly all of it filler. A decoder discards filler data, so the client has no use for it.
A unit runs from the zero bytes before its start code to the zero bytes before the next one. A unit never ends in a zero byte, so those zeros are framing, and removing a unit with them leaves its neighbours exactly as they were. The payload is escaped, so a start code only ever marks a unit. Kept units move only when something before them was removed.
Definition at line 59 of file annexb_filler.h.