From 278c6f2ef17b1d809c7f6040b82685fa1fc4eace Mon Sep 17 00:00:00 2001 From: Saxon Date: Fri, 19 Jul 2019 20:51:48 +0930 Subject: [PATCH] codec/h264/h264dec/nalunit.go: added commenting --- codec/h264/h264dec/nalunit.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/codec/h264/h264dec/nalunit.go b/codec/h264/h264dec/nalunit.go index 592d747f..dc76fb43 100644 --- a/codec/h264/h264dec/nalunit.go +++ b/codec/h264/h264dec/nalunit.go @@ -1,3 +1,12 @@ +/* +DESCRIPTION + nalunit.go provides structures for a NAL unit as well as it's extensions. + +AUTHORS + Saxon Nelson-Milton , The Australian Ocean Laboratory (AusOcean) + mrmod +*/ + 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{}