MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
HEVCParser Class Reference

#include <HEVCParser.h>

Inheritance diagram for HEVCParser:
Inheritance graph
[legend]
Collaboration diagram for HEVCParser:
Collaboration graph
[legend]

Public Types

enum  NAL_unit_type {
  TAIL_N = 0, TAIL_R = 1, TSA_N = 2, TSA_R = 3,
  STSA_N = 4, STSA_R = 5, RADL_N = 6, RADL_R = 7,
  RASL_N = 8, RASL_R = 9, RSV_VCL_N10 = 10, RSV_VCL_N12 = 12,
  RSV_VCL_N14 = 14, RSV_VCL_R11 = 11, RSV_VCL_R13 = 13, RSV_VCL_R15 = 15,
  BLA_W_LP = 16, BLA_W_RADL = 17, BLA_N_LP = 18, IDR_W_RADL = 19,
  IDR_N_LP = 20, CRA_NUT = 21, RSV_IRAP_VCL22 = 22, RSV_IRAP_VCL23 = 23,
  RSV_VCL24 = 24, RSV_VCL25 = 25, RSV_VCL26 = 26, RSV_VCL27 = 27,
  RSV_VCL28 = 28, RSV_VCL29 = 29, RSV_VCL30 = 30, RSV_VCL31 = 31,
  VPS_NUT = 32, SPS_NUT = 33, PPS_NUT = 34, AUD_NUT = 35,
  EOS_NUT = 36, EOB_NUT = 37, FD_NUT = 38, PREFIX_SEI_NUT = 39,
  SUFFIX_SEI_NUT = 40, RSV_NVCL41 = 41, RSV_NVCL42 = 42, RSV_NVCL43 = 43,
  RSV_NVCL44 = 44, RSV_NVCL45 = 45, RSV_NVCL46 = 46, RSV_NVCL47 = 47,
  UNSPEC48 = 48, UNSPEC49 = 49, UNSPEC50 = 50, UNSPEC51 = 51,
  UNSPEC52 = 52, UNSPEC53 = 53, UNSPEC54 = 54, UNSPEC55 = 55,
  UNSPEC56 = 56, UNSPEC57 = 57, UNSPEC58 = 58, UNSPEC59 = 59,
  UNSPEC60 = 60, UNSPEC61 = 61, UNSPEC62 = 62, UNSPEC63 = 63
}
 
using SPS = struct { uint8_t log2_min_luma_coding_block_size
 
using VPS = struct { uint8_t max_sub_layers
 
using PPS = struct { bool dependent_slice_segments_enabled_flag
 
using ShortTermRefPicSet = struct { int32_t DeltaPocS0[16]
 
using ScalingList = struct { int16_t scaling_list_dc_coef_minus8_16x16[6]
 
using QuantMatrixSize = enum { QUANT_MATIX_4X4=0, QUANT_MATIX_8X8=1, QUANT_MATIX_16X16=2, QUANT_MATIX_32X32=3 }
 
- Public Types inherited from H2645Parser
enum  { MAX_SLICE_HEADER_SIZE = 256 }
 
enum  field_type { FRAME = 'F', FIELD_TOP = 'T', FIELD_BOTTOM = 'B' }
 
enum  NAL_unit_type { UNKNOWN = -1 }
 
enum  SLICE_type {
  SLICE_P = 0, SLICE_B = 1, SLICE_I = 2, SLICE_SP = 3,
  SLICE_SI = 4, SLICE_P_a = 5, SLICE_B_a = 6, SLICE_I_a = 7,
  SLICE_SP_a = 8, SLICE_SI_a = 9, SLICE_UNDEF = 10
}
 

Public Member Functions

 HEVCParser (void)
 
 HEVCParser (const HEVCParser &rhs)
 
 ~HEVCParser (void) override
 
uint32_t addBytes (const uint8_t *bytes, uint32_t byte_count, uint64_t stream_offset) override
 
void Reset (void) override
 
QString NAL_type_str (int8_t type) override
 
uint pictureWidthCropped (void) const override
 
uint pictureHeightCropped (void) const override
 
field_type getFieldType (void) const override
 
void getFrameRate (FrameRate &result) const override
 
- Public Member Functions inherited from H2645Parser
 H2645Parser (void)
 
 H2645Parser (const H2645Parser &rhs)
 
virtual ~H2645Parser (void)
 
bool stateChanged (void) const
 
bool onFrameStart (void) const
 
bool onKeyFrameStart (void) const
 
uint pictureWidth (void) const
 
uint pictureHeight (void) const
 
uint aspectRatio (void) const
 Computes aspect ratio from picture size and sample aspect ratio. More...
 
uint64_t frameAUstreamOffset (void) const
 
uint64_t keyframeAUstreamOffset (void) const
 
uint64_t SPSstreamOffset (void) const
 
uint32_t GetTimeScale (void) const
 
uint32_t GetUnitsInTick (void) const
 
SCAN_t GetScanType (void) const
 

Static Public Member Functions

static bool NALisRAP (uint type)
 
static bool NALisIRAP (uint type)
 
static bool NALisVCL (uint type)
 

Public Attributes

uint8_t log2_diff_max_min_luma_coding_block_size
 
uint8_t log2_max_pic_order_cnt_lsb
 
bool separate_colour_plane_flag
 
bool sub_layer_ordering_info_present_flag
 
bool output_flag_present_flag
 
uint8_t num_extra_slice_header_bits
 
int sps_id
 
int32_t DeltaPocS1 [16]
 
uint8_t UsedByCurrPicS0 [16]
 
uint8_t UsedByCurrPicS1 [16]
 
uint8_t NumDeltaPocs
 
uint8_t NumNegativePics
 
uint8_t NumPositivePics
 
bool inter_ref_pic_set_prediction_flag
 
uint16_t abs_delta_rps_minus1
 
uint8_t delta_idx_minus1
 
uint8_t delta_rps_sign
 
int16_t scaling_list_dc_coef_minus8_32x32 [2]
 
uint8_t scaling_lists_4x4 [6][16]
 
uint8_t scaling_lists_8x8 [6][64]
 
uint8_t scaling_lists_16x16 [6][64]
 
uint8_t scaling_lists_32x32 [2][64]
 

Protected Member Functions

bool newAU (void)
 
void processRBSP (bool rbsp_complete)
 
bool profileTierLevel (GetBitContext *gb, bool profilePresentFlag, int maxNumSubLayersMinus1)
 
bool parseSliceSegmentLayer (GetBitContext *gb)
 
bool parseSliceSegmentHeader (GetBitContext *gb)
 
bool parseSPS (GetBitContext *gb)
 
bool parseVPS (GetBitContext *gb)
 
bool parsePPS (GetBitContext *gb)
 
- Protected Member Functions inherited from H2645Parser
void resetRBSP (void)
 
bool fillRBSP (const uint8_t *byteP, uint32_t byte_count, bool found_start_code)
 
void vui_parameters (GetBitContext *gb, bool hevc)
 

Private Attributes

uint32_t m_maxPicOrderCntLsb {0}
 
uint32_t m_picOrderCntMsb {0}
 
uint32_t m_picOrderCntVal {0}
 
uint32_t m_prevPicOrderCntLsb {0}
 
uint32_t m_prevPicOrderCntMsb {0}
 
uint32_t m_resolutionCheck {0}
 
uint m_nalUnitType {UNSPEC63}
 
uint8_t m_nalTemperalId {0}
 
uint8_t m_nuhLayerId {0}
 
bool m_firstSliceSegmentInPicFlag {false}
 
bool m_nextNALisAU {false}
 
bool m_noRaslOutputFlag {false}
 
bool m_seenEOS {true}
 
std::map< uint, SPSm_sps
 
std::map< uint, PPSm_pps
 
std::map< uint, VPSm_vps
 
std::map< uint, uintm_poc
 

Additional Inherited Members

- Protected Types inherited from H2645Parser
enum  constants { EXTENDED_SAR = 255 }
 
- Protected Attributes inherited from H2645Parser
uint64_t m_framecnt {0}
 
uint64_t m_keyframecnt {0}
 
uint64_t m_totalframecnt {0}
 
uint64_t m_totalkeyframecnt {0}
 
uint64_t m_auOffset {0}
 
uint64_t m_frameStartOffset {0}
 
uint64_t m_keyframeStartOffset {0}
 
uint64_t m_pktOffset {0}
 
uint64_t m_spsOffset {0}
 
uint32_t m_consecutiveZeros {0}
 
uint32_t m_rbspBufferSize {188 * 2}
 
uint32_t m_rbspIndex {0}
 
uint32_t m_syncAccumulator {0xffffffff}
 
uint32_t m_timeScale {0}
 
uint32_t m_unitsInTick {0}
 
SCAN_t m_scanType {SCAN_t::PROGRESSIVE}
 
uint m_frameCropBottomOffset {0}
 
uint m_frameCropLeftOffset {0}
 
uint m_frameCropRightOffset {0}
 
uint m_frameCropTopOffset {0}
 
uint m_picHeight {0}
 
uint m_picWidth {0}
 
uint m_sarHeight {0}
 
uint m_sarWidth {0}
 
uint8_t * m_rbspBuffer {nullptr}
 
uint8_t m_aspectRatioIdc {0}
 
int8_t m_chromaFormatIdc {1}
 
bool m_auPending {false}
 
bool m_fixedRate {false}
 
bool m_haveUnfinishedNAL {false}
 
bool m_isKeyframe {false}
 
bool m_onAU {false}
 
bool m_onFrame {false}
 
bool m_onKeyFrame {false}
 
bool m_seenSPS {false}
 
bool m_separateColourPlaneFlag {false}
 
bool m_stateChanged {false}
 

Detailed Description

Definition at line 29 of file HEVCParser.h.

Member Typedef Documentation

◆ SPS

using HEVCParser::SPS = struct { uint8_t log2_min_luma_coding_block_size

Definition at line 164 of file HEVCParser.h.

◆ VPS

using HEVCParser::VPS = struct { uint8_t max_sub_layers

Definition at line 173 of file HEVCParser.h.

◆ PPS

using HEVCParser::PPS = struct { bool dependent_slice_segments_enabled_flag

Definition at line 177 of file HEVCParser.h.

◆ ShortTermRefPicSet

using HEVCParser::ShortTermRefPicSet = struct { int32_t DeltaPocS0[16]

Definition at line 184 of file HEVCParser.h.

◆ ScalingList

using HEVCParser::ScalingList = struct { int16_t scaling_list_dc_coef_minus8_16x16[6]

Definition at line 212 of file HEVCParser.h.

◆ QuantMatrixSize

using HEVCParser::QuantMatrixSize = enum { QUANT_MATIX_4X4 = 0, QUANT_MATIX_8X8 = 1, QUANT_MATIX_16X16 = 2, QUANT_MATIX_32X32 = 3 }

Definition at line 222 of file HEVCParser.h.

Member Enumeration Documentation

◆ NAL_unit_type

Enumerator
TAIL_N 
TAIL_R 
TSA_N 
TSA_R 
STSA_N 
STSA_R 
RADL_N 
RADL_R 
RASL_N 
RASL_R 
RSV_VCL_N10 
RSV_VCL_N12 
RSV_VCL_N14 
RSV_VCL_R11 
RSV_VCL_R13 
RSV_VCL_R15 
BLA_W_LP 
BLA_W_RADL 
BLA_N_LP 
IDR_W_RADL 
IDR_N_LP 
CRA_NUT 
RSV_IRAP_VCL22 
RSV_IRAP_VCL23 
RSV_VCL24 
RSV_VCL25 
RSV_VCL26 
RSV_VCL27 
RSV_VCL28 
RSV_VCL29 
RSV_VCL30 
RSV_VCL31 
VPS_NUT 
SPS_NUT 
PPS_NUT 
AUD_NUT 
EOS_NUT 
EOB_NUT 
FD_NUT 
PREFIX_SEI_NUT 
SUFFIX_SEI_NUT 
RSV_NVCL41 
RSV_NVCL42 
RSV_NVCL43 
RSV_NVCL44 
RSV_NVCL45 
RSV_NVCL46 
RSV_NVCL47 
UNSPEC48 
UNSPEC49 
UNSPEC50 
UNSPEC51 
UNSPEC52 
UNSPEC53 
UNSPEC54 
UNSPEC55 
UNSPEC56 
UNSPEC57 
UNSPEC58 
UNSPEC59 
UNSPEC60 
UNSPEC61 
UNSPEC62 
UNSPEC63 

Definition at line 52 of file HEVCParser.h.

Constructor & Destructor Documentation

◆ HEVCParser() [1/2]

HEVCParser::HEVCParser ( void  )
inline

Definition at line 231 of file HEVCParser.h.

◆ HEVCParser() [2/2]

HEVCParser::HEVCParser ( const HEVCParser rhs)

◆ ~HEVCParser()

HEVCParser::~HEVCParser ( void  )
inlineoverride

Definition at line 233 of file HEVCParser.h.

Member Function Documentation

◆ NALisRAP()

static bool HEVCParser::NALisRAP ( uint  type)
inlinestatic

Definition at line 240 of file HEVCParser.h.

◆ NALisIRAP()

static bool HEVCParser::NALisIRAP ( uint  type)
inlinestatic

Definition at line 250 of file HEVCParser.h.

Referenced by parseSliceSegmentHeader(), and processRBSP().

◆ NALisVCL()

static bool HEVCParser::NALisVCL ( uint  type)
inlinestatic

Definition at line 255 of file HEVCParser.h.

Referenced by addBytes(), newAU(), and processRBSP().

◆ addBytes()

uint32_t HEVCParser::addBytes ( const uint8_t *  bytes,
uint32_t  byte_count,
uint64_t  stream_offset 
)
overridevirtual

Implements H2645Parser.

Definition at line 130 of file HEVCParser.cpp.

◆ Reset()

void HEVCParser::Reset ( void  )
overridevirtual

Reimplemented from H2645Parser.

Definition at line 49 of file HEVCParser.cpp.

◆ NAL_type_str()

QString HEVCParser::NAL_type_str ( int8_t  type)
overridevirtual

Implements H2645Parser.

Definition at line 54 of file HEVCParser.cpp.

Referenced by addBytes().

◆ pictureWidthCropped()

uint HEVCParser::pictureWidthCropped ( void  ) const
overridevirtual

Implements H2645Parser.

Definition at line 2053 of file HEVCParser.cpp.

◆ pictureHeightCropped()

uint HEVCParser::pictureHeightCropped ( void  ) const
overridevirtual

Implements H2645Parser.

Definition at line 2064 of file HEVCParser.cpp.

◆ getFieldType()

field_type HEVCParser::getFieldType ( void  ) const
inlineoverridevirtual

Implements H2645Parser.

Definition at line 271 of file HEVCParser.h.

◆ getFrameRate()

void HEVCParser::getFrameRate ( FrameRate result) const
overridevirtual

Implements H2645Parser.

Definition at line 2074 of file HEVCParser.cpp.

◆ newAU()

bool HEVCParser::newAU ( void  )
protected

Definition at line 254 of file HEVCParser.cpp.

Referenced by processRBSP().

◆ processRBSP()

void HEVCParser::processRBSP ( bool  rbsp_complete)
protected

Definition at line 463 of file HEVCParser.cpp.

Referenced by addBytes().

◆ profileTierLevel()

bool HEVCParser::profileTierLevel ( GetBitContext *  gb,
bool  profilePresentFlag,
int  maxNumSubLayersMinus1 
)
protected

Definition at line 583 of file HEVCParser.cpp.

Referenced by parseSPS(), and parseVPS().

◆ parseSliceSegmentLayer()

bool HEVCParser::parseSliceSegmentLayer ( GetBitContext *  gb)
protected

Definition at line 1238 of file HEVCParser.cpp.

Referenced by processRBSP().

◆ parseSliceSegmentHeader()

bool HEVCParser::parseSliceSegmentHeader ( GetBitContext *  gb)
protected

Definition at line 1255 of file HEVCParser.cpp.

Referenced by parseSliceSegmentLayer().

◆ parseSPS()

bool HEVCParser::parseSPS ( GetBitContext *  gb)
protected

Definition at line 1584 of file HEVCParser.cpp.

Referenced by processRBSP().

◆ parseVPS()

bool HEVCParser::parseVPS ( GetBitContext *  gb)
protected

Definition at line 1841 of file HEVCParser.cpp.

Referenced by processRBSP().

◆ parsePPS()

bool HEVCParser::parsePPS ( GetBitContext *  gb)
protected

Definition at line 1969 of file HEVCParser.cpp.

Member Data Documentation

◆ log2_diff_max_min_luma_coding_block_size

uint8_t HEVCParser::log2_diff_max_min_luma_coding_block_size

Definition at line 166 of file HEVCParser.h.

◆ log2_max_pic_order_cnt_lsb

uint8_t HEVCParser::log2_max_pic_order_cnt_lsb

Definition at line 167 of file HEVCParser.h.

◆ separate_colour_plane_flag

bool HEVCParser::separate_colour_plane_flag

Definition at line 168 of file HEVCParser.h.

◆ sub_layer_ordering_info_present_flag

bool HEVCParser::sub_layer_ordering_info_present_flag

Definition at line 169 of file HEVCParser.h.

◆ output_flag_present_flag

bool HEVCParser::output_flag_present_flag

Definition at line 179 of file HEVCParser.h.

◆ num_extra_slice_header_bits

uint8_t HEVCParser::num_extra_slice_header_bits

Definition at line 180 of file HEVCParser.h.

◆ sps_id

int HEVCParser::sps_id

Definition at line 181 of file HEVCParser.h.

Referenced by parseSPS().

◆ DeltaPocS1

int32_t HEVCParser::DeltaPocS1[16]

Definition at line 187 of file HEVCParser.h.

◆ UsedByCurrPicS0

uint8_t HEVCParser::UsedByCurrPicS0[16]

Definition at line 188 of file HEVCParser.h.

◆ UsedByCurrPicS1

uint8_t HEVCParser::UsedByCurrPicS1[16]

Definition at line 189 of file HEVCParser.h.

◆ NumDeltaPocs

uint8_t HEVCParser::NumDeltaPocs

Definition at line 190 of file HEVCParser.h.

◆ NumNegativePics

uint8_t HEVCParser::NumNegativePics

Definition at line 191 of file HEVCParser.h.

◆ NumPositivePics

uint8_t HEVCParser::NumPositivePics

Definition at line 192 of file HEVCParser.h.

◆ inter_ref_pic_set_prediction_flag

bool HEVCParser::inter_ref_pic_set_prediction_flag

Definition at line 195 of file HEVCParser.h.

◆ abs_delta_rps_minus1

uint16_t HEVCParser::abs_delta_rps_minus1

Definition at line 196 of file HEVCParser.h.

◆ delta_idx_minus1

uint8_t HEVCParser::delta_idx_minus1

Definition at line 197 of file HEVCParser.h.

◆ delta_rps_sign

uint8_t HEVCParser::delta_rps_sign

Definition at line 198 of file HEVCParser.h.

◆ scaling_list_dc_coef_minus8_32x32

int16_t HEVCParser::scaling_list_dc_coef_minus8_32x32[2]

Definition at line 214 of file HEVCParser.h.

◆ scaling_lists_4x4

uint8_t HEVCParser::scaling_lists_4x4[6][16]

Definition at line 216 of file HEVCParser.h.

◆ scaling_lists_8x8

uint8_t HEVCParser::scaling_lists_8x8[6][64]

Definition at line 217 of file HEVCParser.h.

◆ scaling_lists_16x16

uint8_t HEVCParser::scaling_lists_16x16[6][64]

Definition at line 218 of file HEVCParser.h.

◆ scaling_lists_32x32

uint8_t HEVCParser::scaling_lists_32x32[2][64]

Definition at line 219 of file HEVCParser.h.

◆ m_maxPicOrderCntLsb

uint32_t HEVCParser::m_maxPicOrderCntLsb {0}
private

Definition at line 287 of file HEVCParser.h.

◆ m_picOrderCntMsb

uint32_t HEVCParser::m_picOrderCntMsb {0}
private

Definition at line 288 of file HEVCParser.h.

Referenced by parseSliceSegmentHeader().

◆ m_picOrderCntVal

uint32_t HEVCParser::m_picOrderCntVal {0}
private

Definition at line 289 of file HEVCParser.h.

Referenced by parseSliceSegmentHeader().

◆ m_prevPicOrderCntLsb

uint32_t HEVCParser::m_prevPicOrderCntLsb {0}
private

Definition at line 290 of file HEVCParser.h.

Referenced by parseSliceSegmentHeader().

◆ m_prevPicOrderCntMsb

uint32_t HEVCParser::m_prevPicOrderCntMsb {0}
private

Definition at line 291 of file HEVCParser.h.

Referenced by parseSliceSegmentHeader().

◆ m_resolutionCheck

uint32_t HEVCParser::m_resolutionCheck {0}
private

Definition at line 292 of file HEVCParser.h.

Referenced by parseSPS().

◆ m_nalUnitType

uint HEVCParser::m_nalUnitType {UNSPEC63}
private

Definition at line 294 of file HEVCParser.h.

Referenced by addBytes(), newAU(), parseSliceSegmentHeader(), and processRBSP().

◆ m_nalTemperalId

uint8_t HEVCParser::m_nalTemperalId {0}
private

Definition at line 296 of file HEVCParser.h.

Referenced by addBytes().

◆ m_nuhLayerId

uint8_t HEVCParser::m_nuhLayerId {0}
private

Definition at line 297 of file HEVCParser.h.

Referenced by addBytes(), newAU(), and parseSPS().

◆ m_firstSliceSegmentInPicFlag

bool HEVCParser::m_firstSliceSegmentInPicFlag {false}
private

Definition at line 299 of file HEVCParser.h.

Referenced by newAU(), and parseSliceSegmentHeader().

◆ m_nextNALisAU

bool HEVCParser::m_nextNALisAU {false}
private

Definition at line 300 of file HEVCParser.h.

Referenced by newAU().

◆ m_noRaslOutputFlag

bool HEVCParser::m_noRaslOutputFlag {false}
private

Definition at line 301 of file HEVCParser.h.

Referenced by newAU(), and parseSliceSegmentHeader().

◆ m_seenEOS

bool HEVCParser::m_seenEOS {true}
private

Definition at line 302 of file HEVCParser.h.

Referenced by newAU().

◆ m_sps

std::map<uint, SPS> HEVCParser::m_sps
private

Definition at line 304 of file HEVCParser.h.

Referenced by parseSliceSegmentHeader(), and parseSPS().

◆ m_pps

std::map<uint, PPS> HEVCParser::m_pps
private

Definition at line 305 of file HEVCParser.h.

Referenced by parsePPS(), and parseSliceSegmentHeader().

◆ m_vps

std::map<uint, VPS> HEVCParser::m_vps
private

Definition at line 306 of file HEVCParser.h.

Referenced by parseSPS(), and parseVPS().

◆ m_poc

std::map<uint, uint> HEVCParser::m_poc
private

Definition at line 307 of file HEVCParser.h.

Referenced by parseSPS().


The documentation for this class was generated from the following files: