Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
398467f5
Unverified
Commit
398467f5
authored
Sep 06, 2023
by
Lynne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vulkan_decode: convert max level from vulkan to av for comparisons
parent
00e77fd2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
2 deletions
+54
-2
vulkan_decode.c
libavcodec/vulkan_decode.c
+2
-2
vulkan_video.c
libavcodec/vulkan_video.c
+45
-0
vulkan_video.h
libavcodec/vulkan_video.h
+7
-0
No files found.
libavcodec/vulkan_decode.c
View file @
398467f5
...
...
@@ -837,8 +837,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
return
AVERROR_EXTERNAL
;
}
max_level
=
avctx
->
codec_id
==
AV_CODEC_ID_H264
?
h264_caps
.
maxLevelIdc
:
avctx
->
codec_id
==
AV_CODEC_ID_H265
?
h265_caps
.
maxLevelIdc
:
max_level
=
avctx
->
codec_id
==
AV_CODEC_ID_H264
?
ff_vk_h264_level_to_av
(
h264_caps
.
maxLevelIdc
)
:
avctx
->
codec_id
==
AV_CODEC_ID_H265
?
ff_vk_h265_level_to_av
(
h265_caps
.
maxLevelIdc
)
:
avctx
->
codec_id
==
AV_CODEC_ID_AV1
?
av1_caps
.
maxLevelIdc
:
0
;
...
...
libavcodec/vulkan_video.c
View file @
398467f5
...
...
@@ -154,6 +154,51 @@ VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth)
return
VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR
;
}
int
ff_vk_h264_level_to_av
(
StdVideoH264LevelIdc
level
)
{
switch
(
level
)
{
case
STD_VIDEO_H264_LEVEL_IDC_1_0
:
return
10
;
case
STD_VIDEO_H264_LEVEL_IDC_1_1
:
return
11
;
case
STD_VIDEO_H264_LEVEL_IDC_1_2
:
return
12
;
case
STD_VIDEO_H264_LEVEL_IDC_1_3
:
return
13
;
case
STD_VIDEO_H264_LEVEL_IDC_2_0
:
return
20
;
case
STD_VIDEO_H264_LEVEL_IDC_2_1
:
return
21
;
case
STD_VIDEO_H264_LEVEL_IDC_2_2
:
return
22
;
case
STD_VIDEO_H264_LEVEL_IDC_3_0
:
return
30
;
case
STD_VIDEO_H264_LEVEL_IDC_3_1
:
return
31
;
case
STD_VIDEO_H264_LEVEL_IDC_3_2
:
return
32
;
case
STD_VIDEO_H264_LEVEL_IDC_4_0
:
return
40
;
case
STD_VIDEO_H264_LEVEL_IDC_4_1
:
return
41
;
case
STD_VIDEO_H264_LEVEL_IDC_4_2
:
return
42
;
case
STD_VIDEO_H264_LEVEL_IDC_5_0
:
return
50
;
case
STD_VIDEO_H264_LEVEL_IDC_5_1
:
return
51
;
case
STD_VIDEO_H264_LEVEL_IDC_5_2
:
return
52
;
case
STD_VIDEO_H264_LEVEL_IDC_6_0
:
return
60
;
case
STD_VIDEO_H264_LEVEL_IDC_6_1
:
return
61
;
default:
case
STD_VIDEO_H264_LEVEL_IDC_6_2
:
return
62
;
}
}
int
ff_vk_h265_level_to_av
(
StdVideoH265LevelIdc
level
)
{
switch
(
level
)
{
case
STD_VIDEO_H265_LEVEL_IDC_1_0
:
return
10
;
case
STD_VIDEO_H265_LEVEL_IDC_2_0
:
return
20
;
case
STD_VIDEO_H265_LEVEL_IDC_2_1
:
return
21
;
case
STD_VIDEO_H265_LEVEL_IDC_3_0
:
return
30
;
case
STD_VIDEO_H265_LEVEL_IDC_3_1
:
return
31
;
case
STD_VIDEO_H265_LEVEL_IDC_4_0
:
return
40
;
case
STD_VIDEO_H265_LEVEL_IDC_4_1
:
return
41
;
case
STD_VIDEO_H265_LEVEL_IDC_5_0
:
return
50
;
case
STD_VIDEO_H265_LEVEL_IDC_5_1
:
return
51
;
case
STD_VIDEO_H265_LEVEL_IDC_6_0
:
return
60
;
case
STD_VIDEO_H265_LEVEL_IDC_6_1
:
return
61
;
default:
case
STD_VIDEO_H265_LEVEL_IDC_6_2
:
return
62
;
}
}
static
void
free_data_buf
(
void
*
opaque
,
uint8_t
*
data
)
{
FFVulkanContext
*
ctx
=
opaque
;
...
...
libavcodec/vulkan_video.h
View file @
398467f5
...
...
@@ -71,6 +71,13 @@ VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc(const AVPixFm
*/
VkVideoComponentBitDepthFlagBitsKHR
ff_vk_depth_from_av_depth
(
int
depth
);
/**
* Convert level from Vulkan to AV.
*/
int
ff_vk_h264_level_to_av
(
StdVideoH264LevelIdc
level
);
int
ff_vk_h265_level_to_av
(
StdVideoH265LevelIdc
level
);
typedef
struct
FFVkVideoBuffer
{
FFVkBuffer
buf
;
uint8_t
*
mem
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment