Skip to content

decoder: import the decoding layer of oops1/go.264 v1.12.0 - #35

Merged
tannevaled merged 3 commits into
mainfrom
decoder-import
Nov 10, 2026
Merged

tannevaled merged 3 commits into
mainfrom
decoder-import

Conversation

@tannevaled

@tannevaled tannevaled commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

decoder: import the decoding layer of oops1/go.264 v1.12.0

h264 read headers and derived the reference structure; it did not turn a
stream into pixels. This adds a decoder, as decided for go-avkit/decode#10:

  • decoder/ is the public package (Decoder, Limits, Frame, errors); no hardware
    back end, no encoder.
  • internal/{bits,cabac,cavlc,deblock,decoder,frame,level,loopfilter,mc,nal,
    parallel,pred,simd,syntax,transform,testutil} are go.264's packages of that
    name at commit 3373a3f (v1.12.0), import path rewritten, nothing else
    changed. Their tests come with them and pass under -race.
  • LICENSE-go.264 keeps Valery Chukalin's BSD 2-Clause text; README says what was
    imported and from which commit.
  • testdata/conformance (go.264's 35 x264 streams with their ffmpeg output),
    testdata/jvt (ffmpeg framemd5 manifests of 73 ITU-T H.264.1 streams).

Conformance: TestJVTConformance, 67 of 73 streams bit-exact against ffmpeg
framemd5 with the local copy of the vectors, 4 pending the MMCO 5 fix of
oops1/go.264#2 (the test fails if one starts to pass), 2 not downloaded here;
CI downloads all of them with tools/jvtfetch and sets H264_JVT_REQUIRE=1.

CI: the 100 % gate applies to the root package as before; the decoder runs
under -race on three OSes, on every architecture lane, in a conformance job and
in a fuzz job (FuzzDecode, FuzzStream).

Refs go-avkit/decode#10

🤖 Generated with Claude Code

h264 read headers and derived the reference structure; it did not turn a
stream into pixels. This adds a decoder, as decided for go-avkit/decode#10:

* decoder/ is the public package (Decoder, Limits, Frame, errors); no hardware
  back end, no encoder.
* internal/{bits,cabac,cavlc,deblock,decoder,frame,level,loopfilter,mc,nal,
  parallel,pred,simd,syntax,transform,testutil} are go.264's packages of that
  name at commit 3373a3f (v1.12.0), import path rewritten, nothing else
  changed. Their tests come with them and pass under -race.
* LICENSE-go.264 keeps Valery Chukalin's BSD 2-Clause text; README says what was
  imported and from which commit.
* testdata/conformance (go.264's 35 x264 streams with their ffmpeg output),
  testdata/jvt (ffmpeg framemd5 manifests of 73 ITU-T H.264.1 streams).

Conformance: TestJVTConformance, 67 of 73 streams bit-exact against ffmpeg
framemd5 with the local copy of the vectors, 4 pending the MMCO 5 fix of
oops1/go.264#2 (the test fails if one starts to pass), 2 not downloaded here;
CI downloads all of them with tools/jvtfetch and sets H264_JVT_REQUIRE=1.

CI: the 100 % gate applies to the root package as before; the decoder runs
under -race on three OSes, on every architecture lane, in a conformance job and
in a fuzz job (FuzzDecode, FuzzStream).
* TestJVTConformance took the stream to be NAME/NAME.ext; two archives name it
  otherwise (cabac_mot_frm0_full.zip holds camp_mot_frm0_full.26l), so CI, which
  fails on a missing stream, failed on them. It takes the largest file with a
  bitstream extension, as jvtfetch does. Locally 69 of 73 streams are bit-exact,
  4 pending the MMCO 5 fix (oops1/go.264#2).
* TestStartCodeStormStaysLinear and TestScannerCostIsLinearInTheInput compared
  a wall-clock time with a fixed bound, which the riscv64 lane under qemu
  exceeded (780 ms against 500 ms). They now compare the time for N bytes with
  the time for 4N: linear is about 4, the quadratic scanner they guard about 16.
The sequential download of the 73 archives took about ten minutes in CI.
@tannevaled
tannevaled merged commit 7fc74b7 into main Nov 10, 2026
13 checks passed
@tannevaled
tannevaled deleted the decoder-import branch November 10, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant