mirror of https://bitbucket.org/ausocean/av.git
codec/h264/h264dec/nalunit.go: using consts for NAL unit types check in newNALUnit
This commit is contained in:
parent
b71d8fdd8b
commit
520ead0c6c
|
@ -19,6 +19,8 @@ const (
|
|||
naluTypePrefixNALU
|
||||
naluTypeSubsetSPS
|
||||
naluTypeDepthParamSet
|
||||
naluTypeSliceLayerExtRBSP = 20
|
||||
naluTypeSliceLayerExtRBSP2 = 21
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -234,10 +234,9 @@ func NewNALUnit(br *bits.BitReader) (*NALUnit, error) {
|
|||
n.RefIdc = uint8(r.readBits(2))
|
||||
n.Type = uint8(r.readBits(5))
|
||||
|
||||
// TODO: use consts for the NAL types here
|
||||
var err error
|
||||
if n.Type == 14 || n.Type == 20 || n.Type == 21 {
|
||||
if n.Type != 21 {
|
||||
if n.Type == naluTypePrefixNALU || n.Type == naluTypeSliceLayerExtRBSP || n.Type == naluTypeSliceLayerExtRBSP2 {
|
||||
if n.Type != naluTypeSliceLayerExtRBSP2 {
|
||||
n.SVCExtensionFlag = r.readBits(1) == 1
|
||||
} else {
|
||||
n.AVC3DExtensionFlag = r.readBits(1) == 1
|
||||
|
|
Loading…
Reference in New Issue