codec/h264/h264dec/nalunit.go: added commenting

This commit is contained in:
Saxon 2019-07-19 20:51:48 +09:30
parent bdf3b37fef
commit 278c6f2ef1
1 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,12 @@
/*
DESCRIPTION
nalunit.go provides structures for a NAL unit as well as it's extensions.
AUTHORS
Saxon Nelson-Milton <saxon@ausocean.org>, The Australian Ocean Laboratory (AusOcean)
mrmod <mcmoranbjr@gmail.com>
*/
package h264dec
import (
@ -8,6 +17,8 @@ import (
"bitbucket.org/ausocean/av/codec/h264/h264dec/bits"
)
// MVCExtension describes a NAL unit header multiview video coding extension, as
// defined in section H.7.3.1.1 of the specifications.
type MVCExtension struct {
NonIdrFlag bool
PriorityID int
@ -18,6 +29,9 @@ type MVCExtension struct {
ReservedOneBit int
}
// NewMVCExtension parses a NAL unit header multiview video coding extension
// from br following the syntax structure specified in section H.7.3.1.1, and
// returns as a new MVCExtension.
func NewMVCExtension(br *bits.BitReader) (*MVCExtension, error) {
e := &MVCExtension{}
var err error
@ -60,6 +74,8 @@ func NewMVCExtension(br *bits.BitReader) (*MVCExtension, error) {
return e, nil
}
// ThreeDAVCExtension describes a NAL unit header 3D advanced video coding
// extension, as defined in section J.7.3.1.1 of the specifications.
type ThreeDAVCExtension struct {
ViewIdx int
DepthFlag bool
@ -69,6 +85,9 @@ type ThreeDAVCExtension struct {
InterViewFlag bool
}
// NewThreeDAVCExtension parses a NAL unit header 3D advanced video coding
// extension from br following the syntax structure specified in section
// J.7.3.1.1, and returns as a new ThreeDAVCExtension.
func NewThreeDAVCExtension(br *bits.BitReader) (*ThreeDAVCExtension, error) {
e := &ThreeDAVCExtension{}
var err error
@ -106,6 +125,8 @@ func NewThreeDAVCExtension(br *bits.BitReader) (*ThreeDAVCExtension, error) {
return e, nil
}
// SVCExtension describes a NAL unit header scalable video coding extension, as
// defined in section G.7.3.1.1 of the specifications.
type SVCExtension struct {
IdrFlag bool
PriorityId int
@ -119,6 +140,9 @@ type SVCExtension struct {
ReservedThree2Bits int
}
// NewSVCExtension parses a NAL unit header scalable video coding extension from
// br following the syntax structure specified in section G.7.3.1.1, and returns
// as a new SVCExtension.
func NewSVCExtension(br *bits.BitReader) (*SVCExtension, error) {
e := &SVCExtension{}
var err error
@ -176,6 +200,8 @@ func NewSVCExtension(br *bits.BitReader) (*SVCExtension, error) {
return e, nil
}
// NALUnit describes a network abstraction layer unit, as defined in section
// 7.3.1 of the specifications.
type NALUnit struct {
ForbiddenZeroBit int
RefIdc int
@ -189,6 +215,8 @@ type NALUnit struct {
RBSP []byte
}
// NewNALUnit parses a network abstraction layer unit from br following the
// syntax structure specified in section 7.3.1, and returns as a new NALUnit.
func NewNALUnit(br *bits.BitReader) (*NALUnit, error) {
n := &NALUnit{}