The struct is not referenced anywhere else.
Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -68,6 +68,19 @@ static const FFVulkanDecodeDescriptor *dec_descs[] = { · 67 unmodified lines | |||
| 68 | #endif | 68 | #endif |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | typedef struct FFVulkanDecodeProfileData { | ||
| 72 | VkVideoDecodeH264ProfileInfoKHR h264_profile; | ||
| 73 | VkVideoDecodeH265ProfileInfoKHR h265_profile; | ||
| 74 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 75 | VkVideoDecodeVP9ProfileInfoKHR vp9_profile; | ||
| 76 | #endif | ||
| 77 | VkVideoDecodeAV1ProfileInfoKHR av1_profile; | ||
| 78 | |||
| 79 | VkVideoDecodeUsageInfoKHR usage; | ||
| 80 | VkVideoProfileInfoKHR profile; | ||
| 81 | VkVideoProfileListInfoKHR profile_list; | ||
| 82 | } FFVulkanDecodeProfileData; | ||
| 83 | |||
| 71 | static const FFVulkanDecodeDescriptor *get_codecdesc(enum AVCodecID codec_id) | 84 | static const FFVulkanDecodeDescriptor *get_codecdesc(enum AVCodecID codec_id) |
| 72 | { | 85 | { |
| 73 | for (size_t i = 0; i < FF_ARRAY_ELEMS(dec_descs); i++) | 86 | for (size_t i = 0; i < FF_ARRAY_ELEMS(dec_descs); i++) |
| @@ -84,7 +97,9 @@ static const VkVideoProfileInfoKHR *get_video_profile(FFVulkanDecodeShared *ctx, · 10 unmodified lines | |||
| 84 | VkStructureType profile_struct_type = | 97 | VkStructureType profile_struct_type = |
| 85 | codec_id == AV_CODEC_ID_H264 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR : | 98 | codec_id == AV_CODEC_ID_H264 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR : |
| 86 | codec_id == AV_CODEC_ID_HEVC ? VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR : | 99 | codec_id == AV_CODEC_ID_HEVC ? VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR : |
| 100 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 87 | codec_id == AV_CODEC_ID_VP9 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_PROFILE_INFO_KHR : | 101 | codec_id == AV_CODEC_ID_VP9 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_PROFILE_INFO_KHR : |
| 102 | #endif | ||
| 88 | codec_id == AV_CODEC_ID_AV1 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR : | 103 | codec_id == AV_CODEC_ID_AV1 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR : |
| 89 | VK_STRUCTURE_TYPE_MAX_ENUM; | 104 | VK_STRUCTURE_TYPE_MAX_ENUM; |
| 90 | if (profile_struct_type == VK_STRUCTURE_TYPE_MAX_ENUM) | 105 | if (profile_struct_type == VK_STRUCTURE_TYPE_MAX_ENUM) |
| @@ -694,7 +709,9 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, · 603 unmodified lines | |||
| 694 | const FFVulkanDecodeDescriptor *vk_desc, | 709 | const FFVulkanDecodeDescriptor *vk_desc, |
| 695 | VkVideoDecodeH264CapabilitiesKHR *h264_caps, | 710 | VkVideoDecodeH264CapabilitiesKHR *h264_caps, |
| 696 | VkVideoDecodeH265CapabilitiesKHR *h265_caps, | 711 | VkVideoDecodeH265CapabilitiesKHR *h265_caps, |
| 712 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 697 | VkVideoDecodeVP9CapabilitiesKHR *vp9_caps, | 713 | VkVideoDecodeVP9CapabilitiesKHR *vp9_caps, |
| 714 | #endif | ||
| 698 | VkVideoDecodeAV1CapabilitiesKHR *av1_caps, | 715 | VkVideoDecodeAV1CapabilitiesKHR *av1_caps, |
| 699 | VkVideoCapabilitiesKHR *caps, | 716 | VkVideoCapabilitiesKHR *caps, |
| 700 | VkVideoDecodeCapabilitiesKHR *dec_caps, | 717 | VkVideoDecodeCapabilitiesKHR *dec_caps, |
| @@ -706,7 +723,9 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, · 5 unmodified lines | |||
| 706 | 723 | ||
| 707 | VkVideoDecodeH264ProfileInfoKHR *h264_profile = &prof->h264_profile; | 724 | VkVideoDecodeH264ProfileInfoKHR *h264_profile = &prof->h264_profile; |
| 708 | VkVideoDecodeH265ProfileInfoKHR *h265_profile = &prof->h265_profile; | 725 | VkVideoDecodeH265ProfileInfoKHR *h265_profile = &prof->h265_profile; |
| 726 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 709 | VkVideoDecodeVP9ProfileInfoKHR *vp9_profile = &prof->vp9_profile; | 727 | VkVideoDecodeVP9ProfileInfoKHR *vp9_profile = &prof->vp9_profile; |
| 728 | #endif | ||
| 710 | VkVideoDecodeAV1ProfileInfoKHR *av1_profile = &prof->av1_profile; | 729 | VkVideoDecodeAV1ProfileInfoKHR *av1_profile = &prof->av1_profile; |
| 711 | 730 | ||
| 712 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); | 731 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); |
| @@ -732,11 +751,13 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, · 19 unmodified lines | |||
| 732 | usage->pNext = h265_profile; | 751 | usage->pNext = h265_profile; |
| 733 | h265_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; | 752 | h265_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; |
| 734 | h265_profile->stdProfileIdc = cur_profile; | 753 | h265_profile->stdProfileIdc = cur_profile; |
| 754 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 735 | } else if (avctx->codec_id == AV_CODEC_ID_VP9) { | 755 | } else if (avctx->codec_id == AV_CODEC_ID_VP9) { |
| 736 | dec_caps->pNext = vp9_caps; | 756 | dec_caps->pNext = vp9_caps; |
| 737 | usage->pNext = vp9_profile; | 757 | usage->pNext = vp9_profile; |
| 738 | vp9_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_PROFILE_INFO_KHR; | 758 | vp9_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_PROFILE_INFO_KHR; |
| 739 | vp9_profile->stdProfile = cur_profile; | 759 | vp9_profile->stdProfile = cur_profile; |
| 760 | #endif | ||
| 740 | } else if (avctx->codec_id == AV_CODEC_ID_AV1) { | 761 | } else if (avctx->codec_id == AV_CODEC_ID_AV1) { |
| 741 | dec_caps->pNext = av1_caps; | 762 | dec_caps->pNext = av1_caps; |
| 742 | usage->pNext = av1_profile; | 763 | usage->pNext = av1_profile; |
| @@ -797,9 +818,11 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ · 54 unmodified lines | |||
| 797 | VkVideoDecodeH265CapabilitiesKHR h265_caps = { | 818 | VkVideoDecodeH265CapabilitiesKHR h265_caps = { |
| 798 | .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR, | 819 | .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR, |
| 799 | }; | 820 | }; |
| 821 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 800 | VkVideoDecodeVP9CapabilitiesKHR vp9_caps = { | 822 | VkVideoDecodeVP9CapabilitiesKHR vp9_caps = { |
| 801 | .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_CAPABILITIES_KHR, | 823 | .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_CAPABILITIES_KHR, |
| 802 | }; | 824 | }; |
| 825 | #endif | ||
| 803 | VkVideoDecodeAV1CapabilitiesKHR av1_caps = { | 826 | VkVideoDecodeAV1CapabilitiesKHR av1_caps = { |
| 804 | .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR, | 827 | .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR, |
| 805 | }; | 828 | }; |
| @@ -820,14 +843,18 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ · 14 unmodified lines | |||
| 820 | cur_profile = avctx->profile; | 843 | cur_profile = avctx->profile; |
| 821 | base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : | 844 | base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : |
| 822 | avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN : | 845 | avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN : |
| 846 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 823 | avctx->codec_id == AV_CODEC_ID_VP9 ? STD_VIDEO_VP9_PROFILE_0 : | 847 | avctx->codec_id == AV_CODEC_ID_VP9 ? STD_VIDEO_VP9_PROFILE_0 : |
| 848 | #endif | ||
| 824 | avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_PROFILE_MAIN : | 849 | avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_PROFILE_MAIN : |
| 825 | 0; | 850 | 0; |
| 826 | 851 | ||
| 827 | ret = vulkan_setup_profile(avctx, prof, hwctx, vk, vk_desc, | 852 | ret = vulkan_setup_profile(avctx, prof, hwctx, vk, vk_desc, |
| 828 | &h264_caps, | 853 | &h264_caps, |
| 829 | &h265_caps, | 854 | &h265_caps, |
| 855 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 830 | &vp9_caps, | 856 | &vp9_caps, |
| 857 | #endif | ||
| 831 | &av1_caps, | 858 | &av1_caps, |
| 832 | caps, | 859 | caps, |
| 833 | dec_caps, | 860 | dec_caps, |
| @@ -844,7 +871,9 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ · 10 unmodified lines | |||
| 844 | ret = vulkan_setup_profile(avctx, prof, hwctx, vk, vk_desc, | 871 | ret = vulkan_setup_profile(avctx, prof, hwctx, vk, vk_desc, |
| 845 | &h264_caps, | 872 | &h264_caps, |
| 846 | &h265_caps, | 873 | &h265_caps, |
| 874 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 847 | &vp9_caps, | 875 | &vp9_caps, |
| 876 | #endif | ||
| 848 | &av1_caps, | 877 | &av1_caps, |
| 849 | caps, | 878 | caps, |
| 850 | dec_caps, | 879 | dec_caps, |
| @@ -871,7 +900,9 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ · 20 unmodified lines | |||
| 871 | 900 | ||
| 872 | max_level = avctx->codec_id == AV_CODEC_ID_H264 ? ff_vk_h264_level_to_av(h264_caps.maxLevelIdc) : | 901 | max_level = avctx->codec_id == AV_CODEC_ID_H264 ? ff_vk_h264_level_to_av(h264_caps.maxLevelIdc) : |
| 873 | avctx->codec_id == AV_CODEC_ID_H265 ? ff_vk_h265_level_to_av(h265_caps.maxLevelIdc) : | 902 | avctx->codec_id == AV_CODEC_ID_H265 ? ff_vk_h265_level_to_av(h265_caps.maxLevelIdc) : |
| 903 | #if CONFIG_VP9_VULKAN_HWACCEL | ||
| 874 | avctx->codec_id == AV_CODEC_ID_VP9 ? vp9_caps.maxLevel : | 904 | avctx->codec_id == AV_CODEC_ID_VP9 ? vp9_caps.maxLevel : |
| 905 | #endif | ||
| 875 | avctx->codec_id == AV_CODEC_ID_AV1 ? av1_caps.maxLevel : | 906 | avctx->codec_id == AV_CODEC_ID_AV1 ? av1_caps.maxLevel : |
| 876 | 0; | 907 | 0; |
| 877 | 908 | ||
| @@ -35,16 +35,6 @@ typedef struct FFVulkanDecodeDescriptor { · 34 unmodified lines | |||
| 35 | VkExtensionProperties ext_props; | 35 | VkExtensionProperties ext_props; |
| 36 | } FFVulkanDecodeDescriptor; | 36 | } FFVulkanDecodeDescriptor; |
| 37 | 37 | ||
| 38 | typedef struct FFVulkanDecodeProfileData { | ||
| 39 | VkVideoDecodeH264ProfileInfoKHR h264_profile; | ||
| 40 | VkVideoDecodeH265ProfileInfoKHR h265_profile; | ||
| 41 | VkVideoDecodeVP9ProfileInfoKHR vp9_profile; | ||
| 42 | VkVideoDecodeAV1ProfileInfoKHR av1_profile; | ||
| 43 | VkVideoDecodeUsageInfoKHR usage; | ||
| 44 | VkVideoProfileInfoKHR profile; | ||
| 45 | VkVideoProfileListInfoKHR profile_list; | ||
| 46 | } FFVulkanDecodeProfileData; | ||
| 47 | |||
| 48 | typedef struct FFVulkanDecodeShared { | 38 | typedef struct FFVulkanDecodeShared { |
| 49 | FFVulkanContext s; | 39 | FFVulkanContext s; |
| 50 | FFVkVideoCommon common; | 40 | FFVkVideoCommon common; |