Skip to content

Commit

Permalink
av1: add missing sequence header field (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Jan 1, 2025
1 parent d0642e1 commit 89f364e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/codecs/av1/sequence_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ type SequenceHeader struct {
EnableCdef bool
EnableRestoration bool
ColorConfig SequenceHeader_ColorConfig
FilmGrainParamsPresent bool
}

// Unmarshal decodes a SequenceHeader.
Expand Down Expand Up @@ -523,7 +524,19 @@ func (h *SequenceHeader) Unmarshal(buf []byte) error {
h.EnableCdef = bits.ReadFlagUnsafe(buf, &pos)
h.EnableRestoration = bits.ReadFlagUnsafe(buf, &pos)

return h.ColorConfig.unmarshal(h.SeqProfile, buf, &pos)
err = h.ColorConfig.unmarshal(h.SeqProfile, buf, &pos)
if err != nil {
return err
}

err = bits.HasSpace(buf, pos, 1)
if err != nil {
return err
}

h.FilmGrainParamsPresent = bits.ReadFlagUnsafe(buf, &pos)

return nil
}

// Width returns the video width.
Expand Down

0 comments on commit 89f364e

Please sign in to comment.