Skip to content

H.264 picture buffer state management seems to go wrong #72

@charlie-ht

Description

@charlie-ht

This test file seems to expose a bug in the H.264 picture management code,

I can get the clip to decode "correctly" by using this workaround,

diff --git a/vk_video_decoder/libs/NvVideoParser/src/VulkanH264Parser.cpp b/vk_video_decoder/libs/NvVideoParser/src/VulkanH264Parser.cpp
index 6b08277..91813db 100644
--- a/vk_video_decoder/libs/NvVideoParser/src/VulkanH264Parser.cpp
+++ b/vk_video_decoder/libs/NvVideoParser/src/VulkanH264Parser.cpp
@@ -2888,7 +2888,7 @@ void VulkanH264Decoder::dpb_picture_start(pic_parameter_set_s *pps, slice_header
         iCur = MAX_DPB_SIZE;
         // initialize DPB frame buffer
         cur = &dpb[iCur];
-        if (cur->state != 0)
+        if (cur->pPicBuf != nullptr /* cur->state != 0 */)
         {
             output_picture(iCur, dpb[iCur].state);
         }

But I get pictures not supposed to be presented with this workaround. I'm unsure where in the picture management code something goes wrong exactly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions