Repository navigation
Add video encode/decode round-trip sample - #27
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d9afd66d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| nri::QueueFamilyDesc queueFamilies[] = { | ||
| {nullptr, 1, nri::QueueType::GRAPHICS}, | ||
| {nullptr, 1, nri::QueueType::VIDEO_ENCODE}, | ||
| {nullptr, 1, nri::QueueType::VIDEO_DECODE}, | ||
| }; |
There was a problem hiding this comment.
Defer requesting video queues until after capability checks
On adapters/backends that do not expose video encode or decode queues, this requests VIDEO_ENCODE and VIDEO_DECODE queues during nriCreateDevice, so initialization can fail before TryInitializeVideo() reaches its queueNum check and reports that video is unavailable. That makes the sample abort instead of running the graphics/preview path with a clear status on unsupported hardware; create the device with the graphics queue first, then request video queues only after confirming the adapter supports them.
Useful? React with 👍 / 👎.
682a319 to
b056394
Compare
9375a04 to
e6195c3
Compare
Adds the VideoEncodeDecode sample with an animated compute-generated NV12 source, GPU encode/decode round-trip display, and CLI codec selection for H.264, H.265, and AV1. Uses the backend-neutral NRIVideo flow across Vulkan and D3D12: video sessions and pictures, encode feedback readback, decode picture state queries, Annex-B header generation, AV1 metadata preparation, and aligned NV12 upload/readback layouts. Integrates the sample into CMake, shader configuration, README, and NRI submodule expectations, gating the target on the required NRIVideo version so older NRI trees skip cleanly.
Point the NRIFramework submodule at the branch that uses NRI video-queues, remove the local NRI override documentation, and apply formatting cleanup to the video sample.
860a482 to
8623cb9
Compare
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s the bottom partial CTB row) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e encode lists Without lists_modification_present_flag the encode list order matters, but the decode RPS order must not (D3D12/VK sort by POC): the *-nolistmod cases now exercise the decode sorting too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ling list and PPS-id/B cases without list modification, --enhancedBarriers Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d from the Linux station tester's scratch patch) The AV1 frame header comes from NRI's header parser; a reference NV12 file makes the decode bit-exact checked. Legacy D3D12 barriers unless VIDEO_SAMPLE_ENHANCED_BARRIERS is set. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…address the NV12 planes Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…1/libaom) bit-exact against a reference Runs on decode-only hardware (no AV1 encode). Parses the sequence header, uses the NRI header parser for the frame headers, tracks the 8 reference slots and SavedOrderHints, sets the decode picture extent to the AV1 frame size (the texture is rounded up to the decode granularity; the mismatch made NVIDIA decode gray / edge-different pictures). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-encode-decode-sample' into test/combined/codex-video-encode-decode-sample # Conflicts: # Source/VideoEncodeDecode.cpp # Source/VideoEncodeDecode/Stream.cpp
BBP streams signalled 1, so ffmpeg output the pictures in the wrong order (22 dB) while the NRI decode was right. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ts the passed references) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eference The slice RPS lists only the picture own references, a decoder removes the rest; the plan kept them and later pictures referenced missing POCs (ffmpeg: Could not find ref with POC 0). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-decode-sample' into test/combined/codex-video-encode-decode-sample
…e plan drops unreferenced DPB pictures itself) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r count from the plan, --enhancedBarriers for the headless paths, strict --decodeFile reference, NRI include dir from CMake - remove --h265ScalingList / h265-scaling-default (encoders do not apply the lists) - max_num_reorder_pics from GetReorderNum(plans) for --stream/--matrix and the interactive path - RunEnvironment::enhancedBarriers reaches both headless device creations (decodeFile had none) - decodeFile: reference keyed on the supplied path, length enforced, >= 1 decoded picture - SharedVideo.h found through NRI_SOURCE_DIR instead of a relative path Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…code-sample Updates NRIFramework/NRI to the aligned video test tip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D3D12 can't build AV1 decode info from a payload header (the payload has no frame header) or without encode feedback; NRI reports UNSUPPORTED, which the headless stream now reports as SKIP instead of FAIL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The payload header fallback is UNSUPPORTED on D3D12, so a real failure of the metadata path became a SKIP. Only a case without any usable path is unsupported now, and the metadata path, which needs the resolved metadata, is not tried without encode feedback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inter frames that inherit state from reference frames (libaom inherits the loop filter deltas of primary_ref_frame) need the state of the reference slots; the stream keeps the 'savedFrameState' of every refreshed slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Streams with film_grain_params_present decode in a film grain session
('VideoSessionDesc::av1FilmGrain', textures with 'videoAV1FilmGrain'). The
output gets the film grain, the DPB keeps the picture without it. Without
advertised distinct mode (VK on NVIDIA) only pictures applying film grain
use the distinct output, the others decode with the DPB picture as output.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the sample changes and main's C API compatibility fixes. Resolve NRIFramework through a merge that retains source override support and uses upstream NRI main, including the video fixes.
|
Finally! It's happening now... Merged! |
Summary
Adds a
VideoEncodeDecodesample that exercises the NRIVideo encode/decode round-trip path with a compute-generated animated NV12 source and a decoded preview.The sample supports H.264, H.265, and AV1 via
--codec, uses the same backend-agnostic NRIVideo flow for Vulkan and D3D12, and gates the target onNRI_VIDEO_VERSION >= 1so older NRI trees skip cleanly instead of failing at compile time.Details
Validation
VideoEncodeDecodein Release.VULKAN,D3D12H264,H265,AV1--debugNRI --debugAPI0with no filterederror,Failed,Invalid,VUID, crash, or exception lines.nri_video_tests: 69 tests run, 69 passed.