The attached patchset is all the common code changes that my Vulkan patchset needs. In total lines of code, this part has 425 additions and 131 deletions. Most of that is additions to HEVC parsing. Excluding them, the patchset is 200 lines of code added, which is manageable. Apart from the parser changes, the following other changes have been made to the API: AVHWAccel.free_frame_priv exists due to Vulkan's way of using VkImageView objects to wrap VkImage objects, which we need to free once they're no longer in use. Every other API uses the direct objects in decoding, but with Vulkan, they have to be represented by other objects. We also use it to free the slice offsets buffer. AVHWAccel.flush exists due to Vulkan keeping decoder state, despite being stateless in theory. The decoder has to be notified of flushes in order to reset decoding slots and other data it needs, such as motion vectors and reference lists for AV1. Otherwise, inferring whether a flush has happened can be codec dependent, and hacky. hwaccel_params_buf exists due to Vulkan's way of compiling SPS/PPS data into objects, making updating expensive. The change allows for hardware to only upload new parameters if they have been changed. It's insignificant for H264 and AV1, but HEVC's structures can reach 114 megabytes of data that has to be uploaded, for a specially crafted input, which is enough to DDOS an ingest. The data is set and managed by the hwaccel, but does need to be synchronized between different decoding threads, which this patch performs. Finally, the HWACCEL_CAP_THREAD_SAFE flag is added due to Vulkan being actually threadsafe, and requiring no serialization. It does work and it does actually make a difference, on average, it can increase performance by 20% for an average B-frame using HEVC stream, depending on the number of threads and the number of decode queues. While hardware decoders are fast in general, certain vendors such as AMD can choke up while playing 8k video, and this patch can significantly help increase throughput. In context, the changes can be viewed here: https://github.com/cyanreg/FFmpeg/tree/vulkan The rest of the whole patchset is either rewrites, filter code, or the actual hardware accel code. The patchset will not be pushed standalone, but as part of the greater Vulkan patchset. 31 patches attached.