1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #ifndef AVCODEC_VULKAN_VIDEO_H
20 #define AVCODEC_VULKAN_VIDEO_H
21
24
25 #include <vk_video/vulkan_video_codecs_common.h>
26
27 #define CODEC_VER_MAJ(ver) (ver >> 22)
28 #define CODEC_VER_MIN(ver) ((ver >> 12) & ((1 << 10) - 1))
29 #define CODEC_VER_PAT(ver) (ver & ((1 << 12) - 1))
30 #define CODEC_VER(ver) CODEC_VER_MAJ(ver), CODEC_VER_MIN(ver), CODEC_VER_PAT(ver)
31
36
38
44 } FFVkVideoCommon;
45
46 /**
47 * Get pixfmt from a Vulkan format.
48 */
50
51 /**
52 * Get aspect bits which include all planes from a VkFormat.
53 */
55
56 /**
57 * Get Vulkan's chroma subsampling from a pixfmt descriptor.
58 */
60
61 /**
62 * Get Vulkan's bit depth from an [8:12] integer.
63 */
65
66 /**
67 * Convert level from Vulkan to AV.
68 */
71
75
76 /**
77 * Convert profile from/to AV to Vulkan
78 */
82
83 /**
84 * Creates image views for video frames.
85 */
87 VkImageView *view, VkImageAspectFlags *aspect,
89
90 /**
91 * Initialize video session, allocating and binding necessary memory.
92 */
94 FFVkVideoCommon *common,
95 VkVideoSessionCreateInfoKHR *session_create);
96
97 /**
98 * Free video session and required resources.
99 */
101
102 #endif /* AVCODEC_VULKAN_VIDEO_H */