Documentation
¶
Overview ¶
Package hevc - parsing of HEVC(H.265) NAL unit headers, slice headers, VPS, SPS, and PPS.
Index ¶
- Constants
- Variables
- func CodecString(sampleEntry string, sps *SPS) string
- func ContainsNaluType(sample []byte, specificNalType NaluType) bool
- func GetParameterSets(sample []byte) (vps, sps, pps [][]byte)
- func HasParameterSets(b []byte) bool
- func IsRAPSample(sample []byte) bool
- type ConformanceWindow
- type HEVCDecConfRec
- type NaluArray
- type NaluType
- type ProfileTierLevel
- type SPS
- type SubLayerOrderingInfo
Constants ¶
const ( NALU_TRAIL_N = NaluType(0) NALU_TRAIL_R = NaluType(1) NALU_TSA_N = NaluType(2) NALU_TSA_R = NaluType(3) NALU_STSA_N = NaluType(4) NALU_STSA_R = NaluType(5) NALU_RADL_N = NaluType(6) NALU_RADL_R = NaluType(7) NALU_RASL_N = NaluType(8) NALU_RASL_R = NaluType(9) // BLA_W_LP and the following types are Random Access NALU_BLA_W_LP = NaluType(16) NALU_BLA_W_RADL = NaluType(17) NALU_BLA_N_LP = NaluType(18) NALU_IDR_W_RADL = NaluType(19) NALU_IDR_N_LP = NaluType(20) NALU_CRA = NaluType(21) // NALU_VPS - VideoParameterSet NAL Unit NALU_VPS = NaluType(32) // NALU_SPS - SequenceParameterSet NAL Unit NALU_SPS = NaluType(33) // NALU_PPS - PictureParameterSet NAL Unit NALU_PPS = NaluType(34) // NALU_AUD - AccessUnitDelimiter NAL Unit NALU_AUD = NaluType(35) //NALU_EOS - End of Sequence NAL Unit NALU_EOS = NaluType(36) //NALU_EOB - End of Bitstream NAL Unit NALU_EOB = NaluType(37) //NALU_FD - Filler data NAL Unit NALU_FD = NaluType(38) //NALU_SEI_PREFIX - Prefix SEI NAL Unit NALU_SEI_PREFIX = NaluType(39) //NALU_SEI_SUFFIX - Suffix SEI NAL Unit NALU_SEI_SUFFIX = NaluType(40) )
Variables ¶
var ErrLengthSize = errors.New("Can only handle 4byte NALU length size")
Functions ¶
func CodecString ¶ added in v0.22.0
CodecString - sub-parameter for MIME type "codecs" parameter like hev1.1.6.L93.B0 where hev1 is sampleEntry. Defined in ISO/IEC 14496-15 2017 Annex E.
func ContainsNaluType ¶ added in v0.18.0
ContainsNaluType - is specific NaluType present in sample
func GetParameterSets ¶
GetParameterSets - get (multiple) VPS, SPS, and PPS from a sample
func HasParameterSets ¶
HasParameterSets - Check if HEVC VPS, SPS and PPS are present
func IsRAPSample ¶
IsRAPSample - is Random Access Sample (NALU 16-23)
Types ¶
type ConformanceWindow ¶
type HEVCDecConfRec ¶
type HEVCDecConfRec struct {
ConfigurationVersion byte
GeneralProfileSpace byte
GeneralTierFlag bool
GeneralProfileIDC byte
GeneralProfileCompatibilityFlags uint32
GeneralConstraintIndicatorFlags uint64
GeneralLevelIDC byte
MinSpatialSegmentationIDC uint16
ParallellismType byte
ChromaFormatIDC byte
BitDepthLumaMinus8 byte
BitDepthChromaMinus8 byte
AvgFrameRate uint16
ConstantFrameRate byte
NumTemporalLayers byte
TemporalIDNested byte
LengthSizeMinusOne byte
NaluArrays []NaluArray
}
HEVCDecConfRec - HEVCDecoderConfigurationRecord Specified in ISO/IEC 14496-15 4't ed 2017 Sec. 8.3.3
func CreateHEVCDecConfRec ¶ added in v0.17.1
func CreateHEVCDecConfRec(vpsNalus, spsNalus, ppsNalus [][]byte, vpsComplete, spsComplete, ppsComplete bool) (HEVCDecConfRec, error)
CreateHEVCDecConfRec - extract information from vps, sps, pps and fill HEVCDecConfRec with that
func DecodeHEVCDecConfRec ¶
func DecodeHEVCDecConfRec(r io.Reader) (HEVCDecConfRec, error)
DecodeHEVCDecConfRec - decode an HEVCDecConfRec
func (*HEVCDecConfRec) Encode ¶
func (h *HEVCDecConfRec) Encode(w io.Writer) error
Encode - write an HEVCDecConfRec to w
func (*HEVCDecConfRec) GetNalusForType ¶
func (h *HEVCDecConfRec) GetNalusForType(naluType NaluType) [][]byte
GetNalusForType - get all nalus for a specific naluType
func (*HEVCDecConfRec) Size ¶
func (h *HEVCDecConfRec) Size() uint64
type NaluArray ¶
type NaluArray struct {
Nalus [][]byte
// contains filtered or unexported fields
}
NaluArray - HEVC NALU array including complete bit and type
func NewNaluArray ¶ added in v0.17.1
NewNaluArray - create an HEVC NaluArray
type NaluType ¶
type NaluType uint16
NaluType - HEVC nal type according to ISO/IEC 23008-2 Table 7.1
func FindNaluTypes ¶
FindNaluTypes - find list of nalu types in sample
func GetNaluType ¶
Get NaluType from first byte of NALU Header
type ProfileTierLevel ¶
type ProfileTierLevel struct {
GeneralProfileSpace byte
GeneralTierFlag bool
GeneralProfileIDC byte
GeneralProfileCompatibilityFlags uint32
GeneralConstraintIndicatorFlags uint64 // 48 bits
GeneralProgressiveSourceFlag bool
GeneralInterlacedSourceFlag bool
GeneralNonPackedConstraintFlag bool
GeneralFrameOnlyConstraintFlag bool
// 43 + 1 bits of info
GeneralLevelIDC byte
}
ISO/IEC 23008-2 Section 7.3.3
type SPS ¶
type SPS struct {
VpsID byte
MaxSubLayersMinus1 byte
TemporalIdNestingFlag bool
ProfileTierLevel ProfileTierLevel
SpsID byte
ChromaFormatIDC byte
SeparateColourPlaneFlag bool
ConformanceWindowFlag bool
PicWidthInLumaSamples uint32
PicHeightInLumaSamples uint32
ConformanceWindow ConformanceWindow
BitDepthLumaMinus8 byte
BitDepthChromaMinus8 byte
Log2MaxPicOrderCntLsbMinus4 byte
SubLayerOrderingInfoPresentFlag bool
SubLayeringOrderingInfos []SubLayerOrderingInfo
Log2MinLumaCodingBlockSizeMinus3 byte
Log2DiffMaxMinLumaCodingBlockSize byte
Log2MinLumaTransformBlockSizeMinus2 byte
Log2DiffMaxMinLumaTransformBlockSize byte
MaxTransformHierarchyDepthInter byte
MaxTransformHierarchyDepthIntra byte
ScalingListEnabledFlag bool
ScalingListDataPresentFlag bool
AmpEnabledFlag bool
SampleAdaptiveOffsetEnabledFlag bool
PCMEnabledFlag bool
NumShortTermRefPicSets byte
LongTermRefPicsPresentFlag bool
SpsTemporalMvpEnabledFlag bool
StrongIntraSmoothingEnabledFlag bool
VUIParametersPresentFlag bool
}
SPS - HEVC SPS parameters ISO/IEC 23008-2 Sec. 7.3.2.2
func ParseSPSNALUnit ¶
ParseSPSNALUnit - Parse HEVC SPS NAL unit starting with NAL unit header