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 | 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 | 84 | static const FFVulkanDecodeDescriptor *get_codecdesc(enum AVCodecID codec_id) |
| 72 | 85 | { |
| 73 | 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 | 97 | VkStructureType profile_struct_type = |
| 85 | 98 | codec_id == AV_CODEC_ID_H264 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR : |
| 86 | 99 | codec_id == AV_CODEC_ID_HEVC ? VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR : |
| 100 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 87 | 101 | codec_id == AV_CODEC_ID_VP9 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_PROFILE_INFO_KHR : |
| 102 | +#endif | |
| 88 | 103 | codec_id == AV_CODEC_ID_AV1 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR : |
| 89 | 104 | VK_STRUCTURE_TYPE_MAX_ENUM; |
| 90 | 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 | 709 | const FFVulkanDecodeDescriptor *vk_desc, |
| 695 | 710 | VkVideoDecodeH264CapabilitiesKHR *h264_caps, |
| 696 | 711 | VkVideoDecodeH265CapabilitiesKHR *h265_caps, |
| 712 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 697 | 713 | VkVideoDecodeVP9CapabilitiesKHR *vp9_caps, |
| 714 | +#endif | |
| 698 | 715 | VkVideoDecodeAV1CapabilitiesKHR *av1_caps, |
| 699 | 716 | VkVideoCapabilitiesKHR *caps, |
| 700 | 717 | VkVideoDecodeCapabilitiesKHR *dec_caps, |
| @@ -706,7 +723,9 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, · 5 unmodified lines | ||
| 706 | 723 | |
| 707 | 724 | VkVideoDecodeH264ProfileInfoKHR *h264_profile = &prof->h264_profile; |
| 708 | 725 | VkVideoDecodeH265ProfileInfoKHR *h265_profile = &prof->h265_profile; |
| 726 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 709 | 727 | VkVideoDecodeVP9ProfileInfoKHR *vp9_profile = &prof->vp9_profile; |
| 728 | +#endif | |
| 710 | 729 | VkVideoDecodeAV1ProfileInfoKHR *av1_profile = &prof->av1_profile; |
| 711 | 730 | |
| 712 | 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 | 751 | usage->pNext = h265_profile; |
| 733 | 752 | h265_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; |
| 734 | 753 | h265_profile->stdProfileIdc = cur_profile; |
| 754 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 735 | 755 | } else if (avctx->codec_id == AV_CODEC_ID_VP9) { |
| 736 | 756 | dec_caps->pNext = vp9_caps; |
| 737 | 757 | usage->pNext = vp9_profile; |
| 738 | 758 | vp9_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_PROFILE_INFO_KHR; |
| 739 | 759 | vp9_profile->stdProfile = cur_profile; |
| 760 | +#endif | |
| 740 | 761 | } else if (avctx->codec_id == AV_CODEC_ID_AV1) { |
| 741 | 762 | dec_caps->pNext = av1_caps; |
| 742 | 763 | usage->pNext = av1_profile; |
| @@ -797,9 +818,11 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ · 54 unmodified lines | ||
| 797 | 818 | VkVideoDecodeH265CapabilitiesKHR h265_caps = { |
| 798 | 819 | .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR, |
| 799 | 820 | }; |
| 821 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 800 | 822 | VkVideoDecodeVP9CapabilitiesKHR vp9_caps = { |
| 801 | 823 | .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_CAPABILITIES_KHR, |
| 802 | 824 | }; |
| 825 | +#endif | |
| 803 | 826 | VkVideoDecodeAV1CapabilitiesKHR av1_caps = { |
| 804 | 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 | 843 | cur_profile = avctx->profile; |
| 821 | 844 | base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : |
| 822 | 845 | avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN : |
| 846 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 823 | 847 | avctx->codec_id == AV_CODEC_ID_VP9 ? STD_VIDEO_VP9_PROFILE_0 : |
| 848 | +#endif | |
| 824 | 849 | avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_PROFILE_MAIN : |
| 825 | 850 | 0; |
| 826 | 851 | |
| 827 | 852 | ret = vulkan_setup_profile(avctx, prof, hwctx, vk, vk_desc, |
| 828 | 853 | &h264_caps, |
| 829 | 854 | &h265_caps, |
| 855 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 830 | 856 | &vp9_caps, |
| 857 | +#endif | |
| 831 | 858 | &av1_caps, |
| 832 | 859 | caps, |
| 833 | 860 | dec_caps, |
| @@ -844,7 +871,9 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ · 10 unmodified lines | ||
| 844 | 871 | ret = vulkan_setup_profile(avctx, prof, hwctx, vk, vk_desc, |
| 845 | 872 | &h264_caps, |
| 846 | 873 | &h265_caps, |
| 874 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 847 | 875 | &vp9_caps, |
| 876 | +#endif | |
| 848 | 877 | &av1_caps, |
| 849 | 878 | caps, |
| 850 | 879 | dec_caps, |
| @@ -871,7 +900,9 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ · 20 unmodified lines | ||
| 871 | 900 | |
| 872 | 901 | max_level = avctx->codec_id == AV_CODEC_ID_H264 ? ff_vk_h264_level_to_av(h264_caps.maxLevelIdc) : |
| 873 | 902 | avctx->codec_id == AV_CODEC_ID_H265 ? ff_vk_h265_level_to_av(h265_caps.maxLevelIdc) : |
| 903 | +#if CONFIG_VP9_VULKAN_HWACCEL | |
| 874 | 904 | avctx->codec_id == AV_CODEC_ID_VP9 ? vp9_caps.maxLevel : |
| 905 | +#endif | |
| 875 | 906 | avctx->codec_id == AV_CODEC_ID_AV1 ? av1_caps.maxLevel : |
| 876 | 907 | 0; |
| 877 | 908 | |
| @@ -35,16 +35,6 @@ typedef struct FFVulkanDecodeDescriptor { · 34 unmodified lines | ||
| 35 | 35 | VkExtensionProperties ext_props; |
| 36 | 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 | 38 | typedef struct FFVulkanDecodeShared { |
| 49 | 39 | FFVulkanContext s; |
| 50 | 40 | FFVkVideoCommon common; |