* [FFmpeg-devel] [PATCH 1/3] avcodec/vulkan_video: Don't use sparse table
@ 2024-03-03 11:35 Andreas Rheinhardt
2024-03-03 11:37 ` [FFmpeg-devel] [PATCH 2/3] avcodec/vulkan: Make FFVkCodecMap decoder-only Andreas Rheinhardt
2024-03-03 11:37 ` [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table Andreas Rheinhardt
0 siblings, 2 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2024-03-03 11:35 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
ff_vk_codec_map currently is an array indexed by AVCodecID;
it has AV_CODEC_ID_FIRST_AUDIO (= 65536) entries, but uses
only three of them; only 24B of 1MiB were actually used
This commit fixes this by adding an AVCodecID field to the table
and making it non-sparse.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vulkan_decode.c | 17 ++++++++++++++---
libavcodec/vulkan_video.c | 11 +++++++----
libavcodec/vulkan_video.h | 6 ++----
3 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index fdbcbb450a..5def908a21 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -20,6 +20,7 @@
#include "vulkan_video.h"
#include "vulkan_decode.h"
#include "config_components.h"
+#include "libavutil/avassert.h"
#if CONFIG_H264_VULKAN_HWACCEL
extern const VkExtensionProperties ff_vk_dec_h264_ext;
@@ -43,6 +44,15 @@ static const VkExtensionProperties *dec_ext[] = {
#endif
};
+static const FFVkCodecMap *get_codecmap(enum AVCodecID codec_id)
+{
+ for (size_t i = 0; i < FF_ARRAY_ELEMS(ff_vk_codec_map); i++)
+ if (ff_vk_codec_map[i].codec_id == codec_id)
+ return &ff_vk_codec_map[i];
+ av_assert1(!"unreachable");
+ return NULL;
+}
+
static const VkVideoProfileInfoKHR *get_video_profile(FFVulkanDecodeShared *ctx, enum AVCodecID codec_id)
{
const VkVideoProfileListInfoKHR *profile_list;
@@ -737,7 +747,7 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
{
VkResult ret;
int max_level, base_profile, cur_profile;
- const struct FFVkCodecMap *vk_codec = &ff_vk_codec_map[avctx->codec_id];
+ const FFVkCodecMap *vk_codec = get_codecmap(avctx->codec_id);
AVHWFramesContext *frames = (AVHWFramesContext *)frames_ref->data;
AVHWDeviceContext *device = (AVHWDeviceContext *)frames->device_ref->data;
AVVulkanDeviceContext *hwctx = device->hwctx;
@@ -1111,6 +1121,7 @@ int ff_vk_decode_init(AVCodecContext *avctx)
FFVulkanContext *s;
FFVulkanFunctions *vk;
const VkVideoProfileInfoKHR *profile;
+ const FFVkCodecMap *vk_codec;
VkVideoDecodeH264SessionParametersCreateInfoKHR h264_params = {
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR,
@@ -1167,9 +1178,9 @@ int ff_vk_decode_init(AVCodecContext *avctx)
/* Create queue context */
qf = ff_vk_qf_init(s, &ctx->qf, VK_QUEUE_VIDEO_DECODE_BIT_KHR);
+ vk_codec = get_codecmap(avctx->codec_id);
/* Check for support */
- if (!(s->video_props[qf].videoCodecOperations &
- ff_vk_codec_map[avctx->codec_id].decode_op)) {
+ if (!(s->video_props[qf].videoCodecOperations & vk_codec->decode_op)) {
av_log(avctx, AV_LOG_ERROR, "Decoding %s not supported on the given "
"queue family %i!\n", avcodec_get_name(avctx->codec_id), qf);
return AVERROR(EINVAL);
diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
index fb20315db4..a87df52871 100644
--- a/libavcodec/vulkan_video.c
+++ b/libavcodec/vulkan_video.c
@@ -20,20 +20,23 @@
#include "vulkan_video.h"
-const FFVkCodecMap ff_vk_codec_map[AV_CODEC_ID_FIRST_AUDIO] = {
- [AV_CODEC_ID_H264] = {
+const FFVkCodecMap ff_vk_codec_map[3] = {
+ {
+ .codec_id = AV_CODEC_ID_H264,
0,
0,
FF_VK_EXT_VIDEO_DECODE_H264,
VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR,
},
- [AV_CODEC_ID_HEVC] = {
+ {
+ .codec_id = AV_CODEC_ID_HEVC,
0,
0,
FF_VK_EXT_VIDEO_DECODE_H265,
VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR
},
- [AV_CODEC_ID_AV1] = {
+ {
+ .codec_id = AV_CODEC_ID_AV1,
0,
0,
FF_VK_EXT_VIDEO_DECODE_AV1,
diff --git a/libavcodec/vulkan_video.h b/libavcodec/vulkan_video.h
index 51f44dd543..b06e369abd 100644
--- a/libavcodec/vulkan_video.h
+++ b/libavcodec/vulkan_video.h
@@ -32,6 +32,7 @@
#define CODEC_VER(ver) CODEC_VER_MAJ(ver), CODEC_VER_MIN(ver), CODEC_VER_PAT(ver)
typedef struct FFVkCodecMap {
+ enum AVCodecID codec_id;
FFVulkanExtensions encode_extension;
VkVideoCodecOperationFlagBitsKHR encode_op;
FFVulkanExtensions decode_extension;
@@ -46,10 +47,7 @@ typedef struct FFVkVideoSession {
AVBufferPool *buf_pool;
} FFVkVideoCommon;
-/**
- * Index is codec_id.
- */
-extern const FFVkCodecMap ff_vk_codec_map[AV_CODEC_ID_FIRST_AUDIO];
+extern const FFVkCodecMap ff_vk_codec_map[3];
/**
* Get pixfmt from a Vulkan format.
--
2.40.1
_______________________________________________
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH 2/3] avcodec/vulkan: Make FFVkCodecMap decoder-only
2024-03-03 11:35 [FFmpeg-devel] [PATCH 1/3] avcodec/vulkan_video: Don't use sparse table Andreas Rheinhardt
@ 2024-03-03 11:37 ` Andreas Rheinhardt
2024-03-03 11:37 ` [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table Andreas Rheinhardt
1 sibling, 0 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2024-03-03 11:37 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
All the fields of FFVkCodecMap are either decoder-only
or encoder-only (with the latter being unused and unset for now).
This commit therefore makes this struct decoder-only and
moves it to vulkan_decode.c.
Also use designated initializers while just at it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vulkan_decode.c | 38 +++++++++++++++++++++++++++++++-------
libavcodec/vulkan_video.c | 26 --------------------------
libavcodec/vulkan_video.h | 11 -----------
3 files changed, 31 insertions(+), 44 deletions(-)
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 5def908a21..b80415a019 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -22,6 +22,30 @@
#include "config_components.h"
#include "libavutil/avassert.h"
+typedef struct VkCodecMap {
+ enum AVCodecID codec_id;
+ FFVulkanExtensions decode_extension;
+ VkVideoCodecOperationFlagBitsKHR decode_op;
+} VkCodecMap;
+
+static const VkCodecMap vk_codec_map[] = {
+ {
+ .codec_id = AV_CODEC_ID_H264,
+ .decode_extension = FF_VK_EXT_VIDEO_DECODE_H264,
+ .decode_op = VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR,
+ },
+ {
+ .codec_id = AV_CODEC_ID_HEVC,
+ .decode_extension = FF_VK_EXT_VIDEO_DECODE_H265,
+ .decode_op = VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR,
+ },
+ {
+ .codec_id = AV_CODEC_ID_AV1,
+ .decode_extension = FF_VK_EXT_VIDEO_DECODE_AV1,
+ .decode_op = 0x01000000, /* TODO fix this */
+ },
+};
+
#if CONFIG_H264_VULKAN_HWACCEL
extern const VkExtensionProperties ff_vk_dec_h264_ext;
#endif
@@ -44,11 +68,11 @@ static const VkExtensionProperties *dec_ext[] = {
#endif
};
-static const FFVkCodecMap *get_codecmap(enum AVCodecID codec_id)
+static const VkCodecMap *get_codecmap(enum AVCodecID codec_id)
{
- for (size_t i = 0; i < FF_ARRAY_ELEMS(ff_vk_codec_map); i++)
- if (ff_vk_codec_map[i].codec_id == codec_id)
- return &ff_vk_codec_map[i];
+ for (size_t i = 0; i < FF_ARRAY_ELEMS(vk_codec_map); i++)
+ if (vk_codec_map[i].codec_id == codec_id)
+ return &vk_codec_map[i];
av_assert1(!"unreachable");
return NULL;
}
@@ -670,7 +694,7 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx,
FFVulkanDecodeProfileData *prof,
AVVulkanDeviceContext *hwctx,
FFVulkanFunctions *vk,
- const struct FFVkCodecMap *vk_codec,
+ const VkCodecMap *vk_codec,
VkVideoDecodeH264CapabilitiesKHR *h264_caps,
VkVideoDecodeH265CapabilitiesKHR *h265_caps,
VkVideoDecodeAV1CapabilitiesMESA *av1_caps,
@@ -747,7 +771,7 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
{
VkResult ret;
int max_level, base_profile, cur_profile;
- const FFVkCodecMap *vk_codec = get_codecmap(avctx->codec_id);
+ const VkCodecMap *vk_codec = get_codecmap(avctx->codec_id);
AVHWFramesContext *frames = (AVHWFramesContext *)frames_ref->data;
AVHWDeviceContext *device = (AVHWDeviceContext *)frames->device_ref->data;
AVVulkanDeviceContext *hwctx = device->hwctx;
@@ -1121,7 +1145,7 @@ int ff_vk_decode_init(AVCodecContext *avctx)
FFVulkanContext *s;
FFVulkanFunctions *vk;
const VkVideoProfileInfoKHR *profile;
- const FFVkCodecMap *vk_codec;
+ const VkCodecMap *vk_codec;
VkVideoDecodeH264SessionParametersCreateInfoKHR h264_params = {
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR,
diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
index a87df52871..799ac7ee7c 100644
--- a/libavcodec/vulkan_video.c
+++ b/libavcodec/vulkan_video.c
@@ -16,34 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "codec_id.h"
-
#include "vulkan_video.h"
-const FFVkCodecMap ff_vk_codec_map[3] = {
- {
- .codec_id = AV_CODEC_ID_H264,
- 0,
- 0,
- FF_VK_EXT_VIDEO_DECODE_H264,
- VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR,
- },
- {
- .codec_id = AV_CODEC_ID_HEVC,
- 0,
- 0,
- FF_VK_EXT_VIDEO_DECODE_H265,
- VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR
- },
- {
- .codec_id = AV_CODEC_ID_AV1,
- 0,
- 0,
- FF_VK_EXT_VIDEO_DECODE_AV1,
- 0x01000000 /* TODO fix this */
- },
-};
-
#define ASPECT_2PLANE (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT)
#define ASPECT_3PLANE (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT | VK_IMAGE_ASPECT_PLANE_2_BIT)
diff --git a/libavcodec/vulkan_video.h b/libavcodec/vulkan_video.h
index b06e369abd..bb69e920bb 100644
--- a/libavcodec/vulkan_video.h
+++ b/libavcodec/vulkan_video.h
@@ -19,7 +19,6 @@
#ifndef AVCODEC_VULKAN_VIDEO_H
#define AVCODEC_VULKAN_VIDEO_H
-#include "codec_id.h"
#include "vulkan.h"
#include <vk_video/vulkan_video_codecs_common.h>
@@ -31,14 +30,6 @@
#define CODEC_VER_PAT(ver) (ver & ((1 << 12) - 1))
#define CODEC_VER(ver) CODEC_VER_MAJ(ver), CODEC_VER_MIN(ver), CODEC_VER_PAT(ver)
-typedef struct FFVkCodecMap {
- enum AVCodecID codec_id;
- FFVulkanExtensions encode_extension;
- VkVideoCodecOperationFlagBitsKHR encode_op;
- FFVulkanExtensions decode_extension;
- VkVideoCodecOperationFlagBitsKHR decode_op;
-} FFVkCodecMap;
-
typedef struct FFVkVideoSession {
VkVideoSessionKHR session;
VkDeviceMemory *mem;
@@ -47,8 +38,6 @@ typedef struct FFVkVideoSession {
AVBufferPool *buf_pool;
} FFVkVideoCommon;
-extern const FFVkCodecMap ff_vk_codec_map[3];
-
/**
* Get pixfmt from a Vulkan format.
*/
--
2.40.1
_______________________________________________
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table
2024-03-03 11:35 [FFmpeg-devel] [PATCH 1/3] avcodec/vulkan_video: Don't use sparse table Andreas Rheinhardt
2024-03-03 11:37 ` [FFmpeg-devel] [PATCH 2/3] avcodec/vulkan: Make FFVkCodecMap decoder-only Andreas Rheinhardt
@ 2024-03-03 11:37 ` Andreas Rheinhardt
2024-03-03 13:03 ` Lynne
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Rheinhardt @ 2024-03-03 11:37 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Only three of the 226 (== AV_CODEC_ID_AV1) entries
have been used. Unsparsing this table is especially
important given that this array lives in .data.rel.ro.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Instead of parallel tables, one could also merge VkCodecMap and
VkExtensionProperties (i.e. putting one of the latter inside
the former) if preferred.
libavcodec/vulkan_decode.c | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index b80415a019..121ed40f40 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -28,22 +28,29 @@ typedef struct VkCodecMap {
VkVideoCodecOperationFlagBitsKHR decode_op;
} VkCodecMap;
+/* The following table and dec_ext below are supposed to be parallel. */
static const VkCodecMap vk_codec_map[] = {
+#if CONFIG_H264_VULKAN_HWACCEL
{
.codec_id = AV_CODEC_ID_H264,
.decode_extension = FF_VK_EXT_VIDEO_DECODE_H264,
.decode_op = VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR,
},
+#endif
+#if CONFIG_HEVC_VULKAN_HWACCEL
{
.codec_id = AV_CODEC_ID_HEVC,
.decode_extension = FF_VK_EXT_VIDEO_DECODE_H265,
.decode_op = VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR,
},
+#endif
+#if CONFIG_AV1_VULKAN_HWACCEL
{
.codec_id = AV_CODEC_ID_AV1,
.decode_extension = FF_VK_EXT_VIDEO_DECODE_AV1,
.decode_op = 0x01000000, /* TODO fix this */
},
+#endif
};
#if CONFIG_H264_VULKAN_HWACCEL
@@ -58,16 +65,19 @@ extern const VkExtensionProperties ff_vk_dec_av1_ext;
static const VkExtensionProperties *dec_ext[] = {
#if CONFIG_H264_VULKAN_HWACCEL
- [AV_CODEC_ID_H264] = &ff_vk_dec_h264_ext,
+ &ff_vk_dec_h264_ext,
#endif
#if CONFIG_HEVC_VULKAN_HWACCEL
- [AV_CODEC_ID_HEVC] = &ff_vk_dec_hevc_ext,
+ &ff_vk_dec_hevc_ext,
#endif
#if CONFIG_AV1_VULKAN_HWACCEL
- [AV_CODEC_ID_AV1] = &ff_vk_dec_av1_ext,
+ &ff_vk_dec_av1_ext,
#endif
};
+_Static_assert(FF_ARRAY_ELEMS(dec_ext) == FF_ARRAY_ELEMS(vk_codec_map),
+ "dec_ext and vk_codec_map out-of-sync");
+
static const VkCodecMap *get_codecmap(enum AVCodecID codec_id)
{
for (size_t i = 0; i < FF_ARRAY_ELEMS(vk_codec_map); i++)
@@ -77,6 +87,11 @@ static const VkCodecMap *get_codecmap(enum AVCodecID codec_id)
return NULL;
}
+static const VkExtensionProperties *get_extension(const VkCodecMap *vk_codec)
+{
+ return dec_ext[vk_codec - vk_codec_map];
+}
+
static const VkVideoProfileInfoKHR *get_video_profile(FFVulkanDecodeShared *ctx, enum AVCodecID codec_id)
{
const VkVideoProfileListInfoKHR *profile_list;
@@ -772,6 +787,7 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
VkResult ret;
int max_level, base_profile, cur_profile;
const VkCodecMap *vk_codec = get_codecmap(avctx->codec_id);
+ const VkExtensionProperties *extension = get_extension(vk_codec);
AVHWFramesContext *frames = (AVHWFramesContext *)frames_ref->data;
AVHWDeviceContext *device = (AVHWDeviceContext *)frames->device_ref->data;
AVVulkanDeviceContext *hwctx = device->hwctx;
@@ -890,10 +906,10 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
caps->maxActiveReferencePictures);
av_log(avctx, AV_LOG_VERBOSE, " Codec header name: '%s' (driver), '%s' (compiled)\n",
caps->stdHeaderVersion.extensionName,
- dec_ext[avctx->codec_id]->extensionName);
+ extension->extensionName);
av_log(avctx, AV_LOG_VERBOSE, " Codec header version: %i.%i.%i (driver), %i.%i.%i (compiled)\n",
CODEC_VER(caps->stdHeaderVersion.specVersion),
- CODEC_VER(dec_ext[avctx->codec_id]->specVersion));
+ CODEC_VER(extension->specVersion));
av_log(avctx, AV_LOG_VERBOSE, " Decode modes:%s%s%s\n",
dec_caps->flags ? "" :
" invalid",
@@ -1221,7 +1237,7 @@ int ff_vk_decode_init(AVCodecContext *avctx)
session_create.maxActiveReferencePictures = ctx->caps.maxActiveReferencePictures;
session_create.pictureFormat = s->hwfc->format[0];
session_create.referencePictureFormat = session_create.pictureFormat;
- session_create.pStdHeaderVersion = dec_ext[avctx->codec_id];
+ session_create.pStdHeaderVersion = get_extension(vk_codec);
session_create.pVideoProfile = profile;
/* Create decode exec context for this specific main thread.
--
2.40.1
_______________________________________________
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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table
2024-03-03 11:37 ` [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table Andreas Rheinhardt
@ 2024-03-03 13:03 ` Lynne
2024-03-03 13:08 ` Andreas Rheinhardt
2024-03-07 0:36 ` Andreas Rheinhardt
0 siblings, 2 replies; 6+ messages in thread
From: Lynne @ 2024-03-03 13:03 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Mar 3, 2024, 12:35 by andreas.rheinhardt@outlook.com:
> Only three of the 226 (== AV_CODEC_ID_AV1) entries
> have been used. Unsparsing this table is especially
> important given that this array lives in .data.rel.ro.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> Instead of parallel tables, one could also merge VkCodecMap and
> VkExtensionProperties (i.e. putting one of the latter inside
> the former) if preferred.
>
> libavcodec/vulkan_decode.c | 28 ++++++++++++++++++++++------
> 1 file changed, 22 insertions(+), 6 deletions(-)
>
LGTM on commits 1 and 3.
Would you mind keeping the designated initializers from
commit 2 but still keeping it into vulkan_video.c?
Would save on needing to deduplicate it in the future.
_______________________________________________
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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table
2024-03-03 13:03 ` Lynne
@ 2024-03-03 13:08 ` Andreas Rheinhardt
2024-03-07 0:36 ` Andreas Rheinhardt
1 sibling, 0 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2024-03-03 13:08 UTC (permalink / raw)
To: ffmpeg-devel
Lynne:
> Mar 3, 2024, 12:35 by andreas.rheinhardt@outlook.com:
>
>> Only three of the 226 (== AV_CODEC_ID_AV1) entries
>> have been used. Unsparsing this table is especially
>> important given that this array lives in .data.rel.ro.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> Instead of parallel tables, one could also merge VkCodecMap and
>> VkExtensionProperties (i.e. putting one of the latter inside
>> the former) if preferred.
>>
>> libavcodec/vulkan_decode.c | 28 ++++++++++++++++++++++------
>> 1 file changed, 22 insertions(+), 6 deletions(-)
>>
>
> LGTM on commits 1 and 3.
> Would you mind keeping the designated initializers from
> commit 2 but still keeping it into vulkan_video.c?
> Would save on needing to deduplicate it in the future.
Deduplicate? There are no common fields for decoding and encoding in
FFVkCodecMap.
- Andreas
_______________________________________________
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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table
2024-03-03 13:03 ` Lynne
2024-03-03 13:08 ` Andreas Rheinhardt
@ 2024-03-07 0:36 ` Andreas Rheinhardt
1 sibling, 0 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2024-03-07 0:36 UTC (permalink / raw)
To: ffmpeg-devel
Lynne:
> Mar 3, 2024, 12:35 by andreas.rheinhardt@outlook.com:
>
>> Only three of the 226 (== AV_CODEC_ID_AV1) entries
>> have been used. Unsparsing this table is especially
>> important given that this array lives in .data.rel.ro.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> Instead of parallel tables, one could also merge VkCodecMap and
>> VkExtensionProperties (i.e. putting one of the latter inside
>> the former) if preferred.
>>
>> libavcodec/vulkan_decode.c | 28 ++++++++++++++++++++++------
>> 1 file changed, 22 insertions(+), 6 deletions(-)
>>
>
> LGTM on commits 1 and 3.
> Would you mind keeping the designated initializers from
> commit 2 but still keeping it into vulkan_video.c?
> Would save on needing to deduplicate it in the future.
I still don't know what you mean by "deduplicating" them in the future.
Anyway, I have now implemented the approach outlined in the comment
above: https://ffmpeg.org/pipermail/ffmpeg-devel/2024-March/322893.html
- Andreas
_______________________________________________
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] 6+ messages in thread
end of thread, other threads:[~2024-03-07 0:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-03 11:35 [FFmpeg-devel] [PATCH 1/3] avcodec/vulkan_video: Don't use sparse table Andreas Rheinhardt
2024-03-03 11:37 ` [FFmpeg-devel] [PATCH 2/3] avcodec/vulkan: Make FFVkCodecMap decoder-only Andreas Rheinhardt
2024-03-03 11:37 ` [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table Andreas Rheinhardt
2024-03-03 13:03 ` Lynne
2024-03-03 13:08 ` Andreas Rheinhardt
2024-03-07 0:36 ` Andreas Rheinhardt
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