Skip to content

Commit

Permalink
vp9: simplify header structure (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Apr 28, 2024
1 parent 70681a7 commit 0973182
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions pkg/codecs/vp9/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ import (
"github.com/bluenviron/mediacommon/pkg/bits"
)

// FrameType is a frame type.
type FrameType bool

// frame types.
const (
FrameTypeKeyFrame FrameType = false
FrameTypeNonKeyFrame FrameType = true
)

// Header_ColorConfig is the color_config member of an header.
type Header_ColorConfig struct { //nolint:revive
TenOrTwelveBit bool
Expand Down Expand Up @@ -110,7 +101,7 @@ type Header struct {
Profile uint8
ShowExistingFrame bool
FrameToShowMapIdx uint8
FrameType FrameType
NonKeyFrame bool
ShowFrame bool
ErrorResilientMode bool
ColorConfig *Header_ColorConfig
Expand Down Expand Up @@ -164,11 +155,11 @@ func (h *Header) Unmarshal(buf []byte) error {
return err
}

h.FrameType = FrameType(bits.ReadFlagUnsafe(buf, &pos))
h.NonKeyFrame = bits.ReadFlagUnsafe(buf, &pos)
h.ShowFrame = bits.ReadFlagUnsafe(buf, &pos)
h.ErrorResilientMode = bits.ReadFlagUnsafe(buf, &pos)

if !h.FrameType {
if !h.NonKeyFrame {
err := bits.HasSpace(buf, pos, 24)
if err != nil {
return err
Expand Down

0 comments on commit 0973182

Please sign in to comment.