* [FFmpeg-devel] [PATCH 1/2] lavu/tx: add missing prints for the type of dctI/dstI @ 2023-09-06 4:19 Lynne [not found] ` <Ndchl_G--3-9@lynne.ee-NdchpZh----9> 0 siblings, 1 reply; 3+ messages in thread From: Lynne @ 2023-09-06 4:19 UTC (permalink / raw) To: Ffmpeg Devel [-- Attachment #1: Type: text/plain, Size: 81 bytes --] Forgot to add the new types to the print, currently they fallback to "unknown". [-- Attachment #2: 0001-lavu-tx-add-missing-prints-for-the-type-of-dctI-dstI.patch --] [-- Type: text/x-diff, Size: 1423 bytes --] From 439f1e881313ef63ecb8e8e264f4847d6612619d Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> Date: Sun, 3 Sep 2023 16:47:53 +0200 Subject: [PATCH 1/2] lavu/tx: add missing prints for the type of dctI/dstI --- libavutil/tx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavutil/tx.c b/libavutil/tx.c index e9826e6107..24b2015b44 100644 --- a/libavutil/tx.c +++ b/libavutil/tx.c @@ -578,12 +578,18 @@ static void print_type(AVBPrint *bp, enum AVTXType type) type == AV_TX_FLOAT_FFT ? "fft_float" : type == AV_TX_FLOAT_MDCT ? "mdct_float" : type == AV_TX_FLOAT_RDFT ? "rdft_float" : + type == AV_TX_FLOAT_DCT_I ? "dctI_float" : + type == AV_TX_FLOAT_DST_I ? "dstI_float" : type == AV_TX_DOUBLE_FFT ? "fft_double" : type == AV_TX_DOUBLE_MDCT ? "mdct_double" : type == AV_TX_DOUBLE_RDFT ? "rdft_double" : + type == AV_TX_DOUBLE_DCT_I ? "dctI_double" : + type == AV_TX_DOUBLE_DST_I ? "dstI_double" : type == AV_TX_INT32_FFT ? "fft_int32" : type == AV_TX_INT32_MDCT ? "mdct_int32" : type == AV_TX_INT32_RDFT ? "rdft_int32" : + type == AV_TX_INT32_DCT_I ? "dctI_int32" : + type == AV_TX_INT32_DST_I ? "dstI_int32" : "unknown"); } -- 2.40.1 [-- Attachment #3: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <Ndchl_G--3-9@lynne.ee-NdchpZh----9>]
* [FFmpeg-devel] [PATCH 2/2] vulkan_decode: convert max level from vulkan to av for comparisons [not found] ` <Ndchl_G--3-9@lynne.ee-NdchpZh----9> @ 2023-09-06 4:21 ` Lynne [not found] ` <NdciLba--3-9@lynne.ee-NdciOcd----9> 1 sibling, 0 replies; 3+ messages in thread From: Lynne @ 2023-09-06 4:21 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1: Type: text/plain, Size: 558 bytes --] The spec finally clarified the meaning of the field to: > maxLevelIdc is a StdVideoH264LevelIdc value specifying the maximum H.264 level supported by the profile, where enum constant STD_VIDEO_H264_LEVEL_IDC_<major>_<minor> identifies H.264 level <major>.<minor> as defined in section A.3 of the ITU-T H.264 Specification.1 Annoyingly, we have to convert it to an IDC value to compare it. Mesa commit: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24649 Only mesa currently uses the IDC value, all other drivers use the enum. Patch attached. [-- Attachment #2: 0002-vulkan_decode-convert-max-level-from-vulkan-to-av-fo.patch --] [-- Type: text/x-diff, Size: 4021 bytes --] From eea4b14917083ad1a8881e2793bdc045869d5b15 Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> Date: Wed, 6 Sep 2023 06:15:32 +0200 Subject: [PATCH 2/2] vulkan_decode: convert max level from vulkan to av for comparisons --- libavcodec/vulkan_decode.c | 4 ++-- libavcodec/vulkan_video.c | 45 ++++++++++++++++++++++++++++++++++++++ libavcodec/vulkan_video.h | 7 ++++++ 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c index 1b2ff0045d..d97abe8896 100644 --- a/libavcodec/vulkan_decode.c +++ b/libavcodec/vulkan_decode.c @@ -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; diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c index 9a363aab02..236aa124bb 100644 --- a/libavcodec/vulkan_video.c +++ b/libavcodec/vulkan_video.c @@ -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; diff --git a/libavcodec/vulkan_video.h b/libavcodec/vulkan_video.h index 183ce89bf0..b28e3fe0bd 100644 --- a/libavcodec/vulkan_video.h +++ b/libavcodec/vulkan_video.h @@ -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; -- 2.40.1 [-- Attachment #3: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <NdciLba--3-9@lynne.ee-NdciOcd----9>]
* Re: [FFmpeg-devel] [PATCH 2/2] vulkan_decode: convert max level from vulkan to av for comparisons [not found] ` <NdciLba--3-9@lynne.ee-NdciOcd----9> @ 2023-09-08 4:59 ` Lynne 0 siblings, 0 replies; 3+ messages in thread From: Lynne @ 2023-09-08 4:59 UTC (permalink / raw) To: FFmpeg development discussions and patches Sep 6, 2023, 06:21 by dev@lynne.ee: > The spec finally clarified the meaning of the field to: > >> maxLevelIdc is a StdVideoH264LevelIdc value specifying the maximum H.264 level supported by the profile, where enum constant STD_VIDEO_H264_LEVEL_IDC_<major>_<minor> identifies H.264 level <major>.<minor> as defined in section A.3 of the ITU-T H.264 Specification.1 >> > > Annoyingly, we have to convert it to an IDC value to compare it. > Mesa commit: > https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24649 > Only mesa currently uses the IDC value, all other drivers use the enum. > > Patch attached. > Pushed. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-08 4:59 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-09-06 4:19 [FFmpeg-devel] [PATCH 1/2] lavu/tx: add missing prints for the type of dctI/dstI Lynne [not found] ` <Ndchl_G--3-9@lynne.ee-NdchpZh----9> 2023-09-06 4:21 ` [FFmpeg-devel] [PATCH 2/2] vulkan_decode: convert max level from vulkan to av for comparisons Lynne [not found] ` <NdciLba--3-9@lynne.ee-NdciOcd----9> 2023-09-08 4:59 ` Lynne
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git