TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Parser for Advanced Video Coding data. More...
#include <tsAVCParser.h>
Public Member Functions | |
AVCParser (const void *data, size_t size_in_bytes) | |
Constructor. | |
bool | byteAligned () const |
Check if the current bit pointer is on a byte boundary. | |
bool | endOfStream () const |
Check end of stream. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr, typename std::enable_if< std::is_signed< INT >::value >::type * = nullptr> | |
bool | i (INT &val, size_t n) |
Read the next signed integer using n bits and advance the bitstream pointer. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
bool | nextBits (INT &val, size_t n) |
Provide the next n bits without advancing the bitstream pointer. | |
bool | rbspTrailingBits () |
Skip an rbsp_trailing_bits() as defined by ISO/EIC 14496-10 7.3.2.11. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
bool | readBits (INT &val, size_t n) |
Read the next n bits and advance the bitstream pointer. | |
size_t | remainingBits () const |
Get number of remaining bits. | |
size_t | remainingBytes () const |
Get number of remaining bytes (rounded down). | |
void | reset (const void *data, size_t size_in_bytes) |
Reset with a new memory area. | |
void | reset (size_t byte_offset=0, size_t bit_offset=0) |
Reset parsing at the specified point. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr, typename std::enable_if< std::is_signed< INT >::value >::type * = nullptr> | |
bool | se (INT &val) |
Read the next Exp-Golomb-coded signed integer and advance the bitstream pointer. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr, typename std::enable_if< std::is_unsigned< INT >::value >::type * = nullptr> | |
bool | u (INT &val, size_t n) |
Read the next unsigned integer using n bits and advance the bitstream pointer. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr, typename std::enable_if< std::is_unsigned< INT >::value >::type * = nullptr> | |
bool | ue (INT &val) |
Read the next Exp-Golomb-coded unsigned integer and advance the bitstream pointer. | |
Parser for Advanced Video Coding data.
Originally defined for AVC, it is now used in:
The naming of methods such as readBits(), i(), u(), etc. is directly transposed from ISO/IEC 14496-10, ITU-T Rec. H.264.
ts::AVCParser::AVCParser | ( | const void * | data, |
size_t | size_in_bytes | ||
) |
Constructor.
[in] | data | Address of a memory area to parse. It must remain valid as long as the AVCParser object is used. |
[in] | size_in_bytes | Size in bytes of the memory area to parse. |
void ts::AVCParser::reset | ( | const void * | data, |
size_t | size_in_bytes | ||
) |
Reset with a new memory area.
[in] | data | Address of a memory area to parse. It must remain valid as long as the AVCParser object is used. |
[in] | size_in_bytes | Size in bytes of the memory area to parse. |
void ts::AVCParser::reset | ( | size_t | byte_offset = 0 , |
size_t | bit_offset = 0 |
||
) |
Reset parsing at the specified point.
[in] | byte_offset | Offset of first byte to analyze. |
[in] | bit_offset | Offset of first bit in first byte. The bit offset zero is the most significant bit. |
size_t ts::AVCParser::remainingBytes | ( | ) | const |
Get number of remaining bytes (rounded down).
This is the remaining bytes in the input raw binary data. The remaining number of bytes to read can be lower, especially in case of "start code emulation prevention".
size_t ts::AVCParser::remainingBits | ( | ) | const |
Get number of remaining bits.
This is the remaining bits in the input raw binary data. The remaining number of bits to read can be lower, especially in case of "start code emulation prevention".
|
inline |
Check end of stream.
|
inline |
Check if the current bit pointer is on a byte boundary.
bool ts::AVCParser::rbspTrailingBits | ( | ) |
Skip an rbsp_trailing_bits() as defined by ISO/EIC 14496-10 7.3.2.11.
bool ts::AVCParser::nextBits | ( | INT & | val, |
size_t | n | ||
) |
Provide the next n bits without advancing the bitstream pointer.
INT | An integer type for the returned data. |
[out] | val | Returned integer value. |
[in] | n | Number of bits to read. |
bool ts::AVCParser::readBits | ( | INT & | val, |
size_t | n | ||
) |
Read the next n bits and advance the bitstream pointer.
INT | An integer type for the returned data. |
[out] | val | Returned integer value. |
[in] | n | Number of bits to read. |
|
inline |
Read the next unsigned integer using n bits and advance the bitstream pointer.
INT | An integer type for the returned data. |
[out] | val | Returned integer value. |
[in] | n | Number of bits to read. |
|
inline |
Read the next signed integer using n bits and advance the bitstream pointer.
INT | An integer type for the returned data. |
[out] | val | Returned integer value. |
[in] | n | Number of bits to read. |
|
inline |
Read the next Exp-Golomb-coded unsigned integer and advance the bitstream pointer.
INT | An integer type for the returned data. |
[out] | val | Returned integer value. |
bool ts::AVCParser::se | ( | INT & | val | ) |
Read the next Exp-Golomb-coded signed integer and advance the bitstream pointer.
INT | An integer type for the returned data. |
[out] | val | Returned integer value. |