Skip to content

Complete H.264 reference marking and stream capability checks - #23

Open
antono3 wants to merge 13 commits into
masterfrom
cleanup/remaining-todos
Open

antono3 wants to merge 13 commits into
masterfrom
cleanup/remaining-todos

Conversation

@antono3

@antono3 antono3 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

  • Remove obsolete helper code and stale TODOs from the former library split.
  • Parse 1, 2, and 4 byte AVC NAL prefixes, account for every slice in an MP4 sample, skip metadata-only samples, and reject slices that describe different pictures.
  • Preflight SPS/PPS syntax, truncation, reference counts, bit widths, and fixed-array limits before calling the pinned H.264 parser; reject invalid crop dimensions, slice types, and duplicate parameter-set IDs.
  • Resolve noncontiguous SPS/PPS IDs in both MP4 parsing and runtime decode command construction. Add a five-frame fixture with SPS/PPS ID 7 and tests for its parameter sets and slice references.
  • Convert H.264 SPS levels to Vulkan's ordinal enum and reject streams above a GPU's reported maximum before session creation.
  • Correct weighted-prediction header parsing; calculate H.264 POC types 0–2 and separate top/bottom counts; apply sliding-window and MMCO 1–6 reference marking, including long-term references and MMCO 5 renumbering.
  • Select a GPU using the stream's level, padded coded extent, DPB/reference limits, output mode, and required image formats.
  • Preserve custom H.264 SPS/PPS scaling lists in Vulkan session parameters; add an opt-in NV12 readback path and FFmpeg comparison script. Update the learning guide with direct source-line links and fixture instructions.

Verification

  • Pinned V 0.5.2: all 3 software test files passed; release and trace executables built. The new tests include SPS/PPS truncation and single-bit mutations, invalid slice type, and nonzero parameter-set IDs.
  • Linux GeForce GTX 1060: decoded NV12 matched FFmpeg byte for byte for the ID-7 fixture (5 frames), four-slice fixture (24), MMCO 5 Tandberg stream (300), and long-term-reference Sony stream (60). The Sony comparison first exposed a gray-output bug caused by missing custom scaling-list values; it matched after the fix. Reproduction commands are in PLATFORM_SUPPORT.md.
  • On the Linux GTX 1060, X11 window captures matched FFmpeg within 2/255 per RGB channel at nine BT.601 limited-range color-bar pixels and eight BT.709 full-range color-bar pixels. Other color modes, full-frame output, and other drivers remain unverified.
  • Checked 151 local Markdown links, including source-line targets; all resolve and direct targets were inspected.
  • Release CI on current head 6a5ac21: Linux stable shared/static, pinned Linux V3, and Windows stable all passed. The advisory current-master lane is still running on this head; its previous run failed on generated C .output and StructureType errors.

Remaining validation

  • Windows Vulkan Video hardware playback remains untested because no compatible machine is available.
  • Other color modes, full-frame window output, and other GPU drivers remain unverified.
  • SPS/PPS preflight catches truncation and bounded fields; it does not establish every semantic relationship in arbitrarily corrupted bitstreams.

@antono3 antono3 changed the title Clean obsolete TODOs and handle H.264 MMCO 5 resets Complete H.264 reference marking and stream capability checks Sep 24, 2026
@antono3
antono3 marked this pull request as ready for review September 25, 2026 17:25
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