Module: Mesa
Branch: main
Commit: 8243145f02c94315de898102f741edfb340c01b3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8243145f02c94315de898102f741edfb340c01b3

Author: Dave Airlie <airl...@redhat.com>
Date:   Wed Oct 25 15:10:08 2023 +1000

vulkan/video: add a h265 level translator.

This just converts the protocol level to the spec level encoding.

Reviewed-by: Hyunjun Ko <zz...@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>

---

 src/vulkan/runtime/vk_video.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/vulkan/runtime/vk_video.c b/src/vulkan/runtime/vk_video.c
index 95e6354a52c..436183623c3 100644
--- a/src/vulkan/runtime/vk_video.c
+++ b/src/vulkan/runtime/vk_video.c
@@ -1357,4 +1357,13 @@ vk_video_get_h265_nal_unit(StdVideoH265PictureType 
pic_type, bool irap_pic_flag)
    return 0;
 }
 
+static const uint8_t vk_video_h265_levels[] = {10, 20, 21, 30, 31, 40, 41, 50, 
51, 52, 60, 61, 62};
+
+static uint8_t
+vk_video_get_h265_level(StdVideoH265LevelIdc level)
+{
+   assert(level <= STD_VIDEO_H265_LEVEL_IDC_6_2);
+   return vk_video_h265_levels[level];
+}
+
 #endif

Reply via email to