Skip to content

Conversation

@zlatinski
Copy link
Contributor

Add support for Vulkan Video VP9 decode

The base changes required to support VP9 decode have been added.
Added VP9-decode-specific changes

Unfortunately, the Vulkan SDK with VP9 is not available yet.
The latest version of the Vulkan (video) headers is required.
Please make sure to update the headers by removing the old ones.
rm -rf ./build/_deps/vulkan-headers*

@dabrain34
Copy link
Contributor

I think you should rebase the branch on top of main as I changed some commits to support the release process.

ci: update ci scripts to generate zip files should be removed

@dabrain34
Copy link
Contributor

dabrain34 commented Jun 11, 2025

Add option to generate raw YUV frames

I dont think this commit is necessary in this VP9 decode PR as other commits which should be split to other PRs.

@zlatinski
Copy link
Contributor Author

zlatinski commented Jun 11, 2025

Add option to generate raw YUV frames

I dont think this commit is necessary in this VP9 decode PR as other commits which should be split to other PRs.

These were all coming from the VP9 branch. I just squashed the VP9-specific one and left the others alone. These other changes are still needed to VP9 to function correctly. I can remove the "generate raw YUV frames", if required.

@dabrain34
Copy link
Contributor

Yes it collides with #25 which disable the Y4M by default seen that there is a flag to enable it.

I did not backport it in #53 but I kept it in the list

@dabrain34
Copy link
Contributor

dabrain34 commented Jun 11, 2025

@zlatinski zlatinski force-pushed the vp9-decode-support branch from 43ae63f to 5530ad4 Compare June 11, 2025 22:03
@zzoon
Copy link
Contributor

zzoon commented Jun 12, 2025

I tested VP9 CTS with this series and seems fine. Thanks!

@dabrain34
Copy link
Contributor

dabrain34 commented Jun 12, 2025

There are typos in the commit message of:

Can you please add a prefix to the commit. It helps to understand it too.

Planning to add all these coding rules in #58

@zlatinski zlatinski force-pushed the vp9-decode-support branch from 5530ad4 to 44f1d05 Compare June 13, 2025 07:08
@zlatinski
Copy link
Contributor Author

There are typos in the commit message of:

Sorry, I should have caught these types while doing the rebase. Now those are fixed.

@zlatinski zlatinski force-pushed the vp9-decode-support branch from 44f1d05 to e762bc7 Compare June 13, 2025 07:14
@dabrain34 dabrain34 force-pushed the vp9-decode-support branch from e762bc7 to 067300b Compare June 16, 2025 09:19
krajunv and others added 7 commits June 16, 2025 11:52
For chroma resolution in 420 or 422 format,
round width/height to the next integer
when calculating from luma width and height.
Remove assert when fence times out but
the timeout value is less than the total wait time.
Instead of defining the destructor inline, provide its implementation
in a separate source file to make GCC 13 happy in release mode.

Also fix other compilation errors in release mode.

Signed-off-by: Raju Konda <kraju@nvidia.com>
Calculate the chroma plane width separately,
and add the U and V widths to get the final UV plane width in NV12.
Use VkSubmitInfo2KHR and use TL semaphores in both
encoder and decoder.
Update vp9 decode headers
VK_KHR_video_decode_vp9 spec update
Fix offset of frames in super frame for parsing and decoding
VP9 Decode: Derive UsePrevFrameMvs
VP9 Decode: Use previous loop filter values when not coded
Fix self assignment of renderHeight when frame and render sizes are different
resolution change fixes
Handle alignment of bitstream offset for frames in super frame

VP9 Decode: Use correct constants for DPB state arrays

Fix output DISTINCT case for VP9

After recent changes related to codedExtent in VP9, the output distinct
case was broken, since the codedExtent for the dstPictureResource is not
set. In the COINCIDE case, the dstPictureResource is copied from the
reference resource.

Fix preparing ref_frame_sign_bias bitmask

Display an existing frame when show_existing_frame is set and skip HW decode
Fix parsing of profile
Fix conversion of 12-bit chroma format from ffmpeg values to vulkan video.

Unify display logic for show_frame and show_existing_frame.
App runs fine if a frame is displayed once or not displayed.
It crashes if a frame is displayed more
than once (example clip: vp90-2-10-show-existing-frame.webm).

Fix odd resolution frame decoding

VulkanVideoDecoder: Fix VP9 include name

The VP9 include file uses upper case.

VP9 Decoder: use different bitstreamBuffer than the buffer
used in previous frame decoding

Use override for VulkanVP9Decoder

Remove useless av1 includes

Remove StdVideoDecodeVP9ReferenceInfo

Cleanup ParseFrameHeader interface

Set UsePrevFrameMvs to 0 when frame size is changed

Parse VP9 10bit profile correctly in header parser
Make sure to retrive the VP9 10bit profile correctly as value 2 in the parser

VP9Decode: fill BitDepth in pStdColorConfig

Remove BitDepth in VkParserVp9PictureData

Use maximum of frame width/height and render width/height for
 vp9 session

VP9Decoder: set codecProfile in nvsi

nvsi.codecProfile was always 0 and might be used
by a parser client (CTS).

Enable requested video codec extension by adding it to required extension list.
Enable maintenance1 extension.  Add it to optional extension list.
Cleanup code to get codec type to chose decode extension list earlier.

Align source buffer range to the multiple of minBitstreamBufferSizeAlignment

Remove the local headers
Include pSetupReferenceSlot in the
VkVideoBeginCodingInfoKHR::pReferenceSlots list
when it is not null.
@dabrain34 dabrain34 force-pushed the vp9-decode-support branch from 067300b to 321f336 Compare June 16, 2025 09:52
@dabrain34
Copy link
Contributor

There are typos in the commit message of:

Sorry, I should have caught these types while doing the rebase. Now those are fixed.

I created a MR #58 to add some jobs including git message check using gitling and code style based on clang.

@dabrain34 dabrain34 merged commit 6dbc0cc into main Jun 16, 2025
7 checks passed
@zlatinski zlatinski deleted the vp9-decode-support branch June 16, 2025 20:42
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.

5 participants