Skip to content

Commit

Permalink
Add Z bit to VP9 unmarshaller
Browse files Browse the repository at this point in the history
This was added in draft-ietf-payload-vp9-10.
  • Loading branch information
jech authored and Sean-Der committed Jul 15, 2021
1 parent 88ebab1 commit 222e61e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions codecs/vp9_packet.go
Expand Up @@ -25,12 +25,12 @@ const (
// Payload fragments an VP9 packet across one or more byte arrays
func (p *VP9Payloader) Payload(mtu int, payload []byte) [][]byte {
/*
* https://www.ietf.org/id/draft-ietf-payload-vp9-10.txt
* https://www.ietf.org/id/draft-ietf-payload-vp9-13.txt
*
* Flexible mode (F=1)
* 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+
* |I|P|L|F|B|E|V|-| (REQUIRED)
* |I|P|L|F|B|E|V|Z| (REQUIRED)
* +-+-+-+-+-+-+-+-+
* I: |M| PICTURE ID | (REQUIRED)
* +-+-+-+-+-+-+-+-+
Expand All @@ -47,7 +47,7 @@ func (p *VP9Payloader) Payload(mtu int, payload []byte) [][]byte {
* Non-flexible mode (F=0)
* 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+
* |I|P|L|F|B|E|V|-| (REQUIRED)
* |I|P|L|F|B|E|V|Z| (REQUIRED)
* +-+-+-+-+-+-+-+-+
* I: |M| PICTURE ID | (RECOMMENDED)
* +-+-+-+-+-+-+-+-+
Expand Down Expand Up @@ -121,6 +121,7 @@ type VP9Packet struct {
B bool // Start of a frame
E bool // End of a frame
V bool // Scalability structure (SS) data present
Z bool // Not a reference frame for upper spatial layers

// Recommended headers
PictureID uint16 // 7 or 16 bits, picture ID
Expand Down Expand Up @@ -171,6 +172,7 @@ func (p *VP9Packet) Unmarshal(packet []byte) ([]byte, error) {
p.B = packet[0]&0x08 != 0
p.E = packet[0]&0x04 != 0
p.V = packet[0]&0x02 != 0
p.Z = packet[0]&0x01 != 0

pos := 1
var err error
Expand Down

0 comments on commit 222e61e

Please sign in to comment.