Repository navigation
decoder: read the parameter sets and slice headers with h264's readers - #44
Merged
Merged
Conversation
…s (step 2c) The decoder parsed its streams with internal/syntax, a second implementation of what the root package reads. It now uses the root: ParseSPS, ParsePPS (with PPSIDs to pick its sequence set), SlicePPSID and ParseSliceReferences, whose DataBit says where the macroblocks start. * internal/decoder/header.go joins the two halves of a slice header into the one value the decoder uses, with the weight defaults filled in (an entry that states no weight weighs 2^denominator, offset 0). * level, loopfilter and the decoder take h264.SPS, h264.PPS and h264.ChromaQP. * The root keeps its stricter checks and gains the ones the decoder's reader had: seq_parameter_set_id <= 31, max_num_ref_frames <= 16, a picture at most 1024 macroblocks across (read before the +1 that wraps), a crop that does not remove the picture (computed in 64 bits; the 32-bit difference could wrap). * A parameter set the root refuses as unsupported surfaces as ErrUnsupported. Parameter sets still refer to each other as before: a picture set read before its sequence set is read as 8-bit 4:2:0, and one that states scaling lists needs it. Checked: 69 of 73 JVT streams bit-exact against ffmpeg as before (4 pending oops1/go.264#2); every test of ./... passes; the stream-building tests keep internal/syntax's fixture writers and a converter (compat_test.go) until the parsers there are removed (next step). Timing is deferred: slices are now unescaped twice (once by the reader of the header, once for the macroblock data). Refs go-avkit/decode#10 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tannevaled
force-pushed
the
decoder-on-root
branch
from
November 10, 2026 20:30
78c7b50 to
1229898
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
decoder: read the parameter sets and slice headers with h264's readers (step 2c)
The decoder parsed its streams with internal/syntax, a second implementation of
what the root package reads. It now uses the root: ParseSPS, ParsePPS (with PPSIDs
to pick its sequence set), SlicePPSID and ParseSliceReferences, whose DataBit says
where the macroblocks start.
value the decoder uses, with the weight defaults filled in (an entry that states
no weight weighs 2^denominator, offset 0).
seq_parameter_set_id <= 31, max_num_ref_frames <= 16, a picture at most 1024
macroblocks across (read before the +1 that wraps), a crop that does not remove
the picture (computed in 64 bits; the 32-bit difference could wrap).
Parameter sets still refer to each other as before: a picture set read before its
sequence set is read as 8-bit 4:2:0, and one that states scaling lists needs it.
Checked: 69 of 73 JVT streams bit-exact against ffmpeg as before (4 pending
oops1/go.264#2); every test of ./... passes; the stream-building tests keep
internal/syntax's fixture writers and a converter (compat_test.go) until the
parsers there are removed (next step). Timing is deferred: slices are now
unescaped twice (once by the reader of the header, once for the macroblock data).
Refs go-avkit/decode#10
🤖 Generated with Claude Code