Skip to content

feat(videodec2): add HEVC picture-information queries - #2161

Closed
inmert wants to merge 1 commit into
boykopovar:mainfrom
inmert:feat/videodec2-hevc-picture-info
Closed

inmert wants to merge 1 commit into
boykopovar:mainfrom
inmert:feat/videodec2-hevc-picture-info

Conversation

@inmert

@inmert inmert commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What

HEVC decoding is already supported, but sceVideodec2GetHevcPictureInfo is missing and the generic picture-info query rejects HEVC output.

Add the HEVC export and dispatch to it from sceVideodec2GetPictureInfo. Capture SPS/VUI metadata and timestamps with each access unit so they stay attached to the right picture through B-frame reordering. Queries report coded dimensions, profile and level, timing, aspect ratio, colour information and NAL-presence flags.

Keep metadata available for retained output buffers and track which decoder last wrote each buffer. Reusing a buffer between decoders must return the newer picture's metadata; resetting or deleting its decoder invalidates the record.

This covers single-layer, single-temporal-layer, uncropped 8-bit 4:2:0 pictures. Crop/display windows, field sequences, explicit scaling lists, predicted SPS reference sets, HRD, SPS extensions and picture-timing/frame-packing/alternative-transfer SEI still throw when queried. Existing decoding continues to work. Unsupported persistent SEI keeps subsequent queries unsupported until decoder reset.

The 184-byte layout follows the public PS5 declaration and matches the shadPS4 layout. Metadata parsing follows FFmpeg's HEVC syntax. Accepted structure sizes, inferred defaults and unverified console behaviour are recorded in TechnicalDebt.md. There is no known title caller used to validate these queries.

The overlap warning with #1831, #1916 and #2142 is limited to docs/dev/TechnicalDebt.md. Those PRs append unrelated entries immediately after the decoder note that this PR corrects. There are no shared exports or implementation changes, and none is a dependency. The documentation conflict can be resolved by keeping the corrected HEVC note and the other PR's entry.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, Ninja, Release, BUILD_TESTING=ON. The full project build completed after rebasing onto current main, and both focused CTest cases passed with no skips (6.85 seconds total). Tests use synthetic bitstreams; no game, console or Linux testing.

  • guest_videodec2: Annex-B and length-prefixed HEVC, B-frame timestamps, SPS/VUI changes, retained and reused buffers, reset/deletion, structure bounds, malformed input and unsupported persistent SEI. Existing H.264, HEVC and VP9 decode hashes still pass.
  • The buffer-reuse regression failed before ownership tracking was added, returning the previous decoder's metadata; it passes with the fix.
  • patched_libraries: all 116 libraries loaded, with no failures.
  • Repository conventions, test registration and git diff --check passed.
cmake --build build --parallel 2
ctest --test-dir build -R '^(guest_videodec2|patched_libraries)$' --output-on-failure --timeout 30

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt. No new stubs.
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source. No new dependency added.
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

Read SPS/VUI metadata and preserve it with each access unit through frame reordering. Add the 184-byte HEVC export and generic query dispatch, validate structure sizes, and reject unsupported metadata explicitly. Track the current decoder owning each output buffer.

Extend decoder regressions for timestamps, retained and reused buffers, reset, ABI bounds, malformed bitstreams and persistent SEI. Record public ABI sources and unverified console behavior in TechnicalDebt.

Windows 11, MinGW-w64 GCC 15.2.0, Release: full build and both guest_videodec2 and patched_libraries CTests pass. No console or game validation. AI-assisted.
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2142 docs/dev/TechnicalDebt.md L367
#2182 docs/dev/TechnicalDebt.md L367
#2203 core/libs/tests/GuestVideodec2.cpp L8
#2281 docs/dev/TechnicalDebt.md L367
#2381 docs/dev/TechnicalDebt.md L366-367

@muhzain05

Copy link
Copy Markdown
Contributor

Thanks for the HEVC picture-information work!

I've been building a complementary follow-up on top of this PR that extends picture metadata support to VP9 and generalizes picture ownership across AVC, HEVC, and VP9.

The follow-up also addresses a conversion-retry edge case where a failed output conversion can consume a queued picture before it is successfully published.

I'll keep those changes separate to avoid expanding the scope of #2161, and plan to rebase onto main once this lands.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: no title calls sceVideodec2GetHevcPictureInfo on main, as the description says, and a new HEVC metadata parser needs one that does. Please reopen with the title ID and the log line if you find one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants