Re: [FFmpeg-devel] [PATCH 1/3] doc/community: Vote in the interest of the project (first part of Antons proposal)

2024-03-03 Thread Rémi Denis-Courmont
Le sunnuntaina 3. maaliskuuta 2024, 4.53.01 EET Michael Niedermayer a écrit :
> On Mon, Feb 26, 2024 at 11:44:36PM +0100, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer 
> > ---
> > 
> >  doc/community.texi | 2 ++
> >  1 file changed, 2 insertions(+)
> 
> I intend to apply the patchset tomorrow if there are no objections

You can't have a strict rule ("must") requiring something vague ("best for the 
project").

What is best for the project tomorrow may differ from today. What is best for 
the project w.r.t. Linux distributions may differ from that w.r.t. Windows 
users. What is best for long term maintainability and sustainability of the 
project does not align with the best publicity and functionality in the short 
term. It is also inherently both subjective and unknowable.

This sentence just creates fodder for future accusations of bad faith, 
hypocrisy, misjudgement against TC decisions. While the sentence is meaning 
well, it adds absolutely nothing of value.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/3] doc/community: Vote in the interest of the project (first part of Antons proposal)

2024-03-03 Thread Andreas Rheinhardt
Michael Niedermayer:
> On Mon, Feb 26, 2024 at 11:44:36PM +0100, Michael Niedermayer wrote:
>> Signed-off-by: Michael Niedermayer 
>> ---
>>  doc/community.texi | 2 ++
>>  1 file changed, 2 insertions(+)
> 
> I intend to apply the patchset tomorrow if there are no objections
> 
> thx
> 

Gyan sent an alternative proposal which counts as objection.

- 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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/3] doc/community: Conflict of interest recusal requirement (Similar to mid part of Antons proposal)

2024-03-03 Thread Rémi Denis-Courmont
Le tiistaina 27. helmikuuta 2024, 0.44.37 EET Michael Niedermayer a écrit :
> Signed-off-by: Michael Niedermayer 
> ---
>  doc/community.texi | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/doc/community.texi b/doc/community.texi
> index 8a38c6aca0..fc22a8fa61 100644
> --- a/doc/community.texi
> +++ b/doc/community.texi
> @@ -84,6 +84,9 @@ If the TC thinks it needs the input from the larger
> community, the TC can call f
> 
>  Each TC member must vote on such decision according to what is, in their
> view, best for the project.
> 
> +If a TC member is aware of a conflict of interest with regards to the case,
> they must announce it
> +and recuse themselves from the TC discussion and vote.

It looks like the meaning and intent do not match up here. I would expect 
something like either of:

* If a TC member is aware of being in a conflict of interest with regards to 
the case, they must announce it and recuse themselves from the TC discussion 
and vote.

* If a TC member is aware of a conflict of interest with regards to the case, 
they must announce it and the conflicted TC member(s) must recuse themselves 
from the TC discussion and vote.

But either way this leaves open what you do if somebody outside the TC asserts 
a conflict of interest against a TC member, or worse, if a conflict of interest 
is asserted post-facto. So in the end, while this rule seems well-meaning and 
agreeable, I don't see how you can avoid having conflicted TC member vote. 
Consequently, this should be a strong recommendation rather than a strict 
rule.

Again, the effective way to work-around this problem is to keep a large and 
diverse enough TC membership to offset the one or few hypothetical dishonest 
votes.

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v2] avformat/dvdvideodec: fix -pgc and -pg options

2024-03-03 Thread Marth64
Rebased on top of recently merged fixes (should apply correctly now).

In merged DVD patch, -pgc and -pg options were broken. While these are
rather advanced options, they are the only means to get content for
some strangely authored discs.

Signed-off-by: Marth64 
---
 libavformat/dvdvideodec.c | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c
index 7f4ecf2b61..b83ae0c2a5 100644
--- a/libavformat/dvdvideodec.c
+++ b/libavformat/dvdvideodec.c
@@ -507,11 +507,12 @@ static int dvdvideo_play_next_ps_block(AVFormatContext 
*s, DVDVideoPlaybackState
 state->celln, e_cell->cellN, 
is_cell_promising);
 
 if (!state->in_ps && !state->in_pgc) {
-if (cur_title == c->opt_title   &&
-cur_ptt == c->opt_chapter_start &&
-cur_pgcn == state->pgcn &&
-cur_pgn == state->entry_pgn &&
+if (cur_title == c->opt_title&&
+(c->opt_pgc || cur_ptt == c->opt_chapter_start)  &&
+cur_pgcn == state->pgcn  &&
+cur_pgn == state->entry_pgn  &&
 is_cell_promising) {
+
 state->in_pgc = 1;
 }
 
@@ -1254,19 +1255,21 @@ static int dvdvideo_read_header(AVFormatContext *s)
 }
 
 if (c->opt_pgc) {
-if (c->opt_pg == 0)
+if (c->opt_pg == 0) {
 av_log(s, AV_LOG_ERROR, "Invalid coordinates. If -pgc is set, -pg 
must be set too.\n");
-else if (c->opt_chapter_start > 1 || c->opt_chapter_end > 0 || 
c->opt_preindex)
+
+return AVERROR(EINVAL);
+} else if (c->opt_chapter_start > 1 || c->opt_chapter_end > 0 || 
c->opt_preindex) {
 av_log(s, AV_LOG_ERROR, "-pgc is not compatible with the -preindex 
or "
 "-chapter_start/-chapter_end options\n");
-
-return AVERROR(EINVAL);
+return AVERROR(EINVAL);
+}
 }
 
 if ((ret = dvdvideo_ifo_open(s)) < 0)
 return ret;
 
-if (c->opt_preindex && (ret = dvdvideo_chapters_setup_preindex(s)) < 0)
+if (!c->opt_pgc && c->opt_preindex && (ret = 
dvdvideo_chapters_setup_preindex(s)) < 0)
 return ret;
 
 if ((ret = dvdvideo_play_open(s, &c->play_state)) < 0   ||
@@ -1276,7 +1279,7 @@ static int dvdvideo_read_header(AVFormatContext *s)
 (ret = dvdvideo_subp_stream_add_all(s)) < 0)
 return ret;
 
-if (!c->opt_preindex)
+if (!c->opt_pgc && !c->opt_preindex)
 return dvdvideo_chapters_setup_simple(s);
 
 return 0;
-- 
2.34.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] FFmpeg 7.0 blocking issues

2024-03-03 Thread Sebastian Ramacher
On 2024-03-02 20:39:08 -0500, Sean McGovern wrote:
> On Sat, Mar 2, 2024, 18:19 Michael Niedermayer 
> wrote:
> 
> > On Sun, Mar 03, 2024 at 12:06:14AM +0100, Sebastian Ramacher wrote:
> > > On 2024-03-02 23:55:38 +0100, Michael Niedermayer wrote:
> > > > On Tue, Jan 23, 2024 at 08:22:41PM +0100, Michael Niedermayer wrote:
> > > > > Hi all
> > > > >
> > > > > As it was a little difficult for me to not loose track of what is
> > > > > blocking a release. I suggest that for all release blocking issues
> > > > > open a ticket and set Blocking to 7.0
> > > > > that way this:
> > > > > https://trac.ffmpeg.org/query?blocking=~7.0
> > > > >
> > > > > or for the ones not closed:
> > > > >
> > https://trac.ffmpeg.org/query?status=new&status=open&status=reopened&blocking=~7.0
> > > > >
> > > > > will list all blocking issues
> > > > >
> > > > > Ive added one, for testing that, i intend to add more if i see
> > something
> > > > >
> > > > > What is blocking? (IMHO)
> > > > > * regressions (unless its non possible to fix before release)
> > > > > * crashes
> > > > > * security issues
> > > > > * data loss
> > > > > * privacy issues
> > > > > * anything the commuity agrees should be in the release
> > > >
> > > > We still have 3 blocking issues on trac
> > > >
> > > > do people want me to wait or ignore them and branch ?
> > > > Iam not sure when the exact deadline is but if we keep waiting
> > > > we will not get into ubuntu 24.04 LTS
> > >
> > > 24.04 is past feature freeze, so it's too late for that.
> >
> > we should aim earlier in the future then.
> >
> >
> 
> LTS is only every 2 years, yes?

Yes

> How do we make sure this doesn't happen in 2026? How much of a gap is there
> between feature freeze and release?

Not involved in Ubuntu, so that's from past experience: feature
freeze is usually about two months before the release.

So here's the catch: Debian's timeline also needs to be taken into
account. If the ffmpeg release does not involve the removal of deprecated API 
and
a SONAME bump, then the time from ffmpeg to release to upload to Debian
unstable and then import in Ubuntu is short. In this case, I am sure
that I could convince Ubuntu maintainers to import it even during
feature freeze.

But with SONAME bumps and changes in the API, it takes a lot more time
to work through the high number of ffmpeg reverse dependencies. In that
case, plan a release at least 6 months before an Ubuntu LTS release.

We usually have to rely on upstream maintainers to adopt to the
changes and that take times. Many moons ago Anton helped with providing
patches, but for the last couple of API changes it took some months from
"dear maintainer, here is ffmpeg X for testing, please fix the build of
your package" to actually doing all uploads and rebuilds. For example,
the transition to ffmpeg 6.0 was started in July 2023 and was done in
December 2023.

Cheers
-- 
Sebastian Ramacher
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] Changelog: restore new line

2024-03-03 Thread Marth64
A new line was removed in a1304272c3a0ef7c3d77c702dd466b3f11bf300f
which breaks consistency in between versions.

Signed-off-by: Marth64 
---
 Changelog | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Changelog b/Changelog
index fedad5782c..f388d41b02 100644
--- a/Changelog
+++ b/Changelog
@@ -31,6 +31,7 @@ version :
 - removed deprecated ffmpeg CLI options -psnr and -map_channel
 - DVD-Video demuxer, powered by libdvdnav and libdvdread
 
+
 version 6.1:
 - libaribcaption decoder
 - Playdate video decoder and demuxer
-- 
2.34.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/vvcdec: check pred flag to fix undefined beavhiours

2024-03-03 Thread Frank Plowman
On 03/03/2024 03:31, Nuo Mi wrote:
> libavcodec/vvc/vvc_inter.c:823:18: runtime error: signed integer overflow: 
> 1426128896 + 1426128896 cannot be represented in type 'int'
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
> libavcodec/vvc/vvc_inter.c:823:18
> ---
>  libavcodec/vvc/vvc_inter.c | 15 +--
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/vvc/vvc_inter.c b/libavcodec/vvc/vvc_inter.c
> index d5be32aa14..48c566b097 100644
> --- a/libavcodec/vvc/vvc_inter.c
> +++ b/libavcodec/vvc/vvc_inter.c
> @@ -816,13 +816,16 @@ static void derive_affine_mvc(MvField *mvc, const 
> VVCFrameContext *fc, const MvF
>  const int hs = fc->ps.sps->hshift[1];
>  const int vs = fc->ps.sps->vshift[1];
>  const MvField* mv2 = ff_vvc_get_mvf(fc, x0 + hs * sbw, y0 + vs * sbh);
> +
>  *mvc = *mv;
> -mvc->mv[0].x += mv2->mv[0].x;
> -mvc->mv[0].y += mv2->mv[0].y;
> -mvc->mv[1].x += mv2->mv[1].x;
> -mvc->mv[1].y += mv2->mv[1].y;
> -ff_vvc_round_mv(mvc->mv + 0, 0, 1);
> -ff_vvc_round_mv(mvc->mv + 1, 0, 1);
> +for (int i = L0; i <= L1; i++) {
> +PredFlag mask = 1 << i;
> +if (mv2->pred_flag & mask) {
> +mvc->mv[i].x += mv2->mv[i].x;
> +mvc->mv[i].y += mv2->mv[i].y;
> +ff_vvc_round_mv(mvc->mv + i, 0, 1);
> +}
> +}
>  }
>  
>  static void pred_affine_blk(VVCLocalContext *lc)

LGTM.  I happened to have a minimal case which reproduces this handy,
and the patch removes the error.

-- 
Frank
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/3] avcodec/vulkan_video: Don't use sparse table

2024-03-03 Thread 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 
---
 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;
@@ -,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

[FFmpeg-devel] [PATCH 2/3] avcodec/vulkan: Make FFVkCodecMap decoder-only

2024-03-03 Thread 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 
---
 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= 0x0100, /* 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,
-   0x0100 /* TODO fix this */
-},
-};
-
 #define ASPECT_2PLANE (VK_IMAGE_ASPECT_PLAN

[FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table

2024-03-03 Thread 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 
---
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= 0x0100, /* 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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 14/38] lavu/opt: factor per-type dispatch out of av_opt_set()

2024-03-03 Thread Anton Khirnov
Quoting Anton Khirnov (2024-03-01 17:07:22)
> Quoting Michael Niedermayer (2024-02-23 23:50:10)
> > Hi Anton
> > 
> > On Fri, Feb 23, 2024 at 02:58:36PM +0100, Anton Khirnov wrote:
> > > Will be useful in following commits.
> > > ---
> > 
> > breaks:
> > 
> > ./ffmpeg -y -request_channel_layout 3 -i 
> > bug/401/mlp_5point1_downmixof6channel.mlp -bitexact 
> > file-2-mlp_5point1_downmixof6channel.wav
> > 
> > [mlp @ 0x55690e23ff80] Error setting option request_channel_layout to value 
> > 3.
> > [mlp @ 0x55690e23ed00] Failed to open codec in avformat_find_stream_info
> > [mlp @ 0x55690e23ff80] Error setting option request_channel_layout to value 
> > 3.
> > Input #0, mlp, from 'bug/401/mlp_5point1_downmixof6channel.mlp':
> >   Duration: N/A, start: 0.00, bitrate: N/A
> >   Stream #0:0: Audio: mlp, 48000 Hz, 5.1, s32 (24 bit)
> > [mlp @ 0x55690e257900] Error setting option request_channel_layout to value 
> > 3.
> > [aist#0:0/mlp @ 0x55690e254dc0] [dec:mlp @ 0x55690e256f40] Error while 
> > opening decoder: Invalid argument
> > [aost#0:0/pcm_s16le @ 0x55690e255a80] Error initializing a simple 
> > filtergraph
> > Error opening output file file-2-mlp_5point1_downmixof6channel.wav.
> > Error opening output files: Invalid argument
> > 
> > i suspect this isnt specific to the file but i can provide it if it
> > doesnt reproduce with a other file
> 
> Cannot reproduce with another mlp or 5.1 ac3 file.

Cannot reproduce with your sample either. Are you sure you're using the
right code? It's branch 'avoption_list' in my tree.

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] FFmpeg 7.0 blocking issues

2024-03-03 Thread James Almer

On 3/3/2024 4:35 AM, Jean-Baptiste Kempf wrote:


n Sat, 2 Mar 2024, at 23:55, Michael Niedermayer wrote:

On Tue, Jan 23, 2024 at 08:22:41PM +0100, Michael Niedermayer wrote:

Hi all

As it was a little difficult for me to not loose track of what is
blocking a release. I suggest that for all release blocking issues
open a ticket and set Blocking to 7.0
that way this:
https://trac.ffmpeg.org/query?blocking=~7.0

or for the ones not closed:
https://trac.ffmpeg.org/query?status=new&status=open&status=reopened&blocking=~7.0

will list all blocking issues

Ive added one, for testing that, i intend to add more if i see something

What is blocking? (IMHO)
* regressions (unless its non possible to fix before release)
* crashes
* security issues
* data loss
* privacy issues
* anything the commuity agrees should be in the release


We still have 3 blocking issues on trac

do people want me to wait or ignore them and branch ?


I think you can branch soon.
However, those 3 bugs are quite important, tbh.


The side data bug depends on an AVOption change, which needs to happen 
alongside the major bump, and afair we wanted 7.0 happen after said bump.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table

2024-03-03 Thread Lynne
Mar 3, 2024, 12:35 by andreas.rheinha...@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 
> ---
> 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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/vulkan_decode: Un-sparse extensions table

2024-03-03 Thread Andreas Rheinhardt
Lynne:
> Mar 3, 2024, 12:35 by andreas.rheinha...@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 
>> ---
>> 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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/vvcdec: fix undefined behaviours for derive_affine_mvc

2024-03-03 Thread Nuo Mi
libavcodec/vvc/vvc_inter.c:823:18: runtime error: signed integer overflow: 
1426128896 + 1426128896 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
libavcodec/vvc/vvc_inter.c:823:18

Suggested-by: Andreas Rheinhardt 
---
 libavcodec/vvc/vvc_inter.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vvc/vvc_inter.c b/libavcodec/vvc/vvc_inter.c
index d5be32aa14..c5629f7f6f 100644
--- a/libavcodec/vvc/vvc_inter.c
+++ b/libavcodec/vvc/vvc_inter.c
@@ -817,10 +817,13 @@ static void derive_affine_mvc(MvField *mvc, const 
VVCFrameContext *fc, const MvF
 const int vs = fc->ps.sps->vshift[1];
 const MvField* mv2 = ff_vvc_get_mvf(fc, x0 + hs * sbw, y0 + vs * sbh);
 *mvc = *mv;
-mvc->mv[0].x += mv2->mv[0].x;
-mvc->mv[0].y += mv2->mv[0].y;
-mvc->mv[1].x += mv2->mv[1].x;
-mvc->mv[1].y += mv2->mv[1].y;
+
+// Due to different pred_flag, one of the motion vectors may have an 
invalid value.
+// Cast them to an unsigned type to avoid undefined behavior.
+mvc->mv[0].x += (unsigned int)mv2->mv[0].x;
+mvc->mv[0].y += (unsigned int)mv2->mv[0].y;
+mvc->mv[1].x += (unsigned int)mv2->mv[1].x;
+mvc->mv[1].y += (unsigned int)mv2->mv[1].y;
 ff_vvc_round_mv(mvc->mv + 0, 0, 1);
 ff_vvc_round_mv(mvc->mv + 1, 0, 1);
 }
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/vvcdec: check pred flag to fix undefined beavhiours

2024-03-03 Thread Nuo Mi
On Sun, Mar 3, 2024 at 2:43 PM Andreas Rheinhardt <
andreas.rheinha...@outlook.com> wrote:

> Nuo Mi:
> > libavcodec/vvc/vvc_inter.c:823:18: runtime error: signed integer
> overflow: 1426128896 + 1426128896 cannot be represented in type 'int'
> > SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
> libavcodec/vvc/vvc_inter.c:823:18
> > ---
> >  libavcodec/vvc/vvc_inter.c | 15 +--
> >  1 file changed, 9 insertions(+), 6 deletions(-)
> >
> > diff --git a/libavcodec/vvc/vvc_inter.c b/libavcodec/vvc/vvc_inter.c
> > index d5be32aa14..48c566b097 100644
> > --- a/libavcodec/vvc/vvc_inter.c
> > +++ b/libavcodec/vvc/vvc_inter.c
> > @@ -816,13 +816,16 @@ static void derive_affine_mvc(MvField *mvc, const
> VVCFrameContext *fc, const MvF
> >  const int hs = fc->ps.sps->hshift[1];
> >  const int vs = fc->ps.sps->vshift[1];
> >  const MvField* mv2 = ff_vvc_get_mvf(fc, x0 + hs * sbw, y0 + vs *
> sbh);
> > +
> >  *mvc = *mv;
> > -mvc->mv[0].x += mv2->mv[0].x;
> > -mvc->mv[0].y += mv2->mv[0].y;
> > -mvc->mv[1].x += mv2->mv[1].x;
> > -mvc->mv[1].y += mv2->mv[1].y;
> > -ff_vvc_round_mv(mvc->mv + 0, 0, 1);
> > -ff_vvc_round_mv(mvc->mv + 1, 0, 1);
> > +for (int i = L0; i <= L1; i++) {
> > +PredFlag mask = 1 << i;
> > +if (mv2->pred_flag & mask) {
> > +mvc->mv[i].x += mv2->mv[i].x;
> > +mvc->mv[i].y += mv2->mv[i].y;
> > +ff_vvc_round_mv(mvc->mv + i, 0, 1);
> > +}
> > +}
> >  }
> >
> >  static void pred_affine_blk(VVCLocalContext *lc)
>
> This adds branches; the UB alone could also be fixed/suppressed with
> casting to unsigned. Would the latter cause any problems or are the
> values set here unused lateron?
>
It will not be used later.
sent a new patch based on your suggestion.
thank you

>
> - 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-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] fftools/ffprobe: Print dispositions generically

2024-03-03 Thread James Almer

On 3/2/2024 4:37 PM, Andreas Rheinhardt wrote:

Signed-off-by: Andreas Rheinhardt 
---
  fftools/ffprobe.c | 39 +++
  1 file changed, 15 insertions(+), 24 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index ea225f14ab..ac6b92f5d6 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3039,6 +3039,18 @@ static int read_packets(WriterContext *w, InputFile 
*ifile)
  return ret;
  }
  
+static void print_dispositions(WriterContext *w, uint32_t disposition, SectionID section_id)

+{
+writer_print_section_header(w, NULL, section_id);
+for (int i = 0; i < sizeof(disposition) * CHAR_BIT; i++) {
+const char *disposition_str = av_disposition_to_string(1U << i);
+
+if (disposition_str)
+print_int(disposition_str, !!(disposition & (1U << i)));
+}
+writer_print_section_footer(w);
+}
+
  static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int 
stream_idx, InputStream *ist, int in_program)
  {
  AVStream *stream = ist->st;
@@ -3215,31 +3227,10 @@ static int show_stream(WriterContext *w, 
AVFormatContext *fmt_ctx, int stream_id
  }
  
  /* Print disposition information */

-#define PRINT_DISPOSITION(flagname, name) do {\
-print_int(name, !!(stream->disposition & AV_DISPOSITION_##flagname)); \
-} while (0)
-
  if (do_show_stream_disposition) {
-writer_print_section_header(w, NULL, in_program ? 
SECTION_ID_PROGRAM_STREAM_DISPOSITION : SECTION_ID_STREAM_DISPOSITION);
-PRINT_DISPOSITION(DEFAULT,  "default");
-PRINT_DISPOSITION(DUB,  "dub");
-PRINT_DISPOSITION(ORIGINAL, "original");
-PRINT_DISPOSITION(COMMENT,  "comment");
-PRINT_DISPOSITION(LYRICS,   "lyrics");
-PRINT_DISPOSITION(KARAOKE,  "karaoke");
-PRINT_DISPOSITION(FORCED,   "forced");
-PRINT_DISPOSITION(HEARING_IMPAIRED, "hearing_impaired");
-PRINT_DISPOSITION(VISUAL_IMPAIRED,  "visual_impaired");
-PRINT_DISPOSITION(CLEAN_EFFECTS,"clean_effects");
-PRINT_DISPOSITION(ATTACHED_PIC, "attached_pic");
-PRINT_DISPOSITION(TIMED_THUMBNAILS, "timed_thumbnails");
-PRINT_DISPOSITION(NON_DIEGETIC, "non_diegetic");
-PRINT_DISPOSITION(CAPTIONS, "captions");
-PRINT_DISPOSITION(DESCRIPTIONS, "descriptions");
-PRINT_DISPOSITION(METADATA, "metadata");
-PRINT_DISPOSITION(DEPENDENT,"dependent");
-PRINT_DISPOSITION(STILL_IMAGE,  "still_image");
-writer_print_section_footer(w);
+print_dispositions(w, stream->disposition,
+   in_program ? SECTION_ID_PROGRAM_STREAM_DISPOSITION
+  : SECTION_ID_STREAM_DISPOSITION);
  }
  
  if (do_show_stream_tags)


LGTM.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/3] lavc/vp8dsp: R-V V put_bilin_h

2024-03-03 Thread Rémi Denis-Courmont
Le perjantaina 23. helmikuuta 2024, 16.45.46 EET flow gg a écrit :
> 

Looks like this needs rebasing, or otherwise does not apply.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/4] lavc/vp9dsp: R-V V ipred dc

2024-03-03 Thread Rémi Denis-Courmont
Le sunnuntaina 3. maaliskuuta 2024, 3.59.00 EET flow gg a écrit :
> updated a little improve in this reply

As noted eaerlier, I don't understand why you have two size parameters. It 
seems that \size is always either the same as (1 << (\size2 - 1)) a.k.a. ((1 
<< \size2) / 2), or unused. The assembler *can* compute arithmetic constants.

Similarly, you can use \restore as a truth value directly: `.if \restore`.

FWIW, it seems that you could just as well include func/endfunc inside the 
macros.

-- 
レミ・デニ-クールモン
http://www.remlab.net/



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/x86/vvc/vvcdsp_init: fix linking error when configuring with --disable-ssse3 --disable-optimizations options

2024-03-03 Thread Nuo Mi
Thank you, Jianhua.
This patch mixes many things.
Could you help split it into smaller, more atomic patches?
For example, one for moving code blocks and another for fixing
--disable-ssse3.

On Fri, Mar 1, 2024 at 1:42 AM  wrote:

> From: Wu Jianhua 
>
> Signed-off-by: Wu Jianhua 
> ---
>  libavcodec/x86/vvc/vvcdsp_init.c | 115 ++-
>  1 file changed, 82 insertions(+), 33 deletions(-)
>
> diff --git a/libavcodec/x86/vvc/vvcdsp_init.c
> b/libavcodec/x86/vvc/vvcdsp_init.c
> index 0d2c683f0f..9ae84bda48 100644
> --- a/libavcodec/x86/vvc/vvcdsp_init.c
> +++ b/libavcodec/x86/vvc/vvcdsp_init.c
> @@ -31,9 +31,67 @@
>  #include "libavcodec/vvc/vvcdsp.h"
>  #include "libavcodec/x86/h26x/h2656dsp.h"
>
> +#define PUT_PROTOTYPE(name, depth, opt) \
> +void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const
> uint8_t *src, ptrdiff_t srcstride, int height, const int8_t *hf, const
> int8_t *vf, int width);
> +
> +#define PUT_PROTOTYPES(name, bitd, opt) \
> +PUT_PROTOTYPE(name##2,   bitd, opt) \
> +PUT_PROTOTYPE(name##4,   bitd, opt) \
> +PUT_PROTOTYPE(name##8,   bitd, opt) \
> +PUT_PROTOTYPE(name##12,  bitd, opt) \
> +PUT_PROTOTYPE(name##16,  bitd, opt) \
> +PUT_PROTOTYPE(name##24,  bitd, opt) \
> +PUT_PROTOTYPE(name##32,  bitd, opt) \
> +PUT_PROTOTYPE(name##48,  bitd, opt) \
> +PUT_PROTOTYPE(name##64,  bitd, opt) \
> +PUT_PROTOTYPE(name##128, bitd, opt)
> +
> +#define PUT_BPC_PROTOTYPES(name, opt) \
> +PUT_PROTOTYPES(name,  8, opt) \
> +PUT_PROTOTYPES(name, 10, opt) \
> +PUT_PROTOTYPES(name, 12, opt)
> +
> +#define PUT_TAP_PROTOTYPES(n, opt) \
> +PUT_BPC_PROTOTYPES(n##tap_h,  opt) \
> +PUT_BPC_PROTOTYPES(n##tap_v,  opt) \
> +PUT_BPC_PROTOTYPES(n##tap_hv, opt)
> +
> +PUT_BPC_PROTOTYPES(pixels, sse4)
> +PUT_BPC_PROTOTYPES(pixels, avx2)
> +
> +PUT_TAP_PROTOTYPES(4, sse4)
> +PUT_TAP_PROTOTYPES(8, sse4)
> +PUT_TAP_PROTOTYPES(4, avx2)
> +PUT_TAP_PROTOTYPES(8, avx2)
> +
> +#define bf(fn, bd,  opt) fn##_##bd##_##opt
> +#define BF(fn, bpc, opt) fn##_##bpc##bpc_##opt
> +
> +#define AVG_BPC_PROTOTYPES(bpc, opt)
>\
> +void BF(ff_vvc_avg, bpc, opt)(uint8_t *dst, ptrdiff_t dst_stride,
> \
> +const int16_t *src0, const int16_t *src1, intptr_t width, intptr_t
> height, intptr_t pixel_max);  \
> +void BF(ff_vvc_w_avg, bpc, opt)(uint8_t *dst, ptrdiff_t dst_stride,
> \
> +const int16_t *src0, const int16_t *src1, intptr_t width, intptr_t
> height,   \
> +intptr_t denom, intptr_t w0, intptr_t w1,  intptr_t o0, intptr_t o1,
> intptr_t pixel_max);
> +
> +#define AVG_PROTOTYPES(bd, opt)
> \
> +void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,
>\
> +const int16_t *src0, const int16_t *src1, int width, int height);
> \
> +void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,
>\
> +const int16_t *src0, const int16_t *src1, int width, int height,
>\
> +int denom, int w0, int w1, int o0, int o1);
> +
> +AVG_BPC_PROTOTYPES( 8, avx2)
> +AVG_BPC_PROTOTYPES(16, avx2)
> +
> +AVG_PROTOTYPES( 8, avx2)
> +AVG_PROTOTYPES(10, avx2)
> +AVG_PROTOTYPES(12, avx2)
> +
>  #if ARCH_X86_64
> +#if HAVE_SSE4_EXTERNAL
>  #define FW_PUT(name, depth, opt) \
> -static void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst,
> const uint8_t *src, ptrdiff_t srcstride, \
> +void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const
> uint8_t *src, ptrdiff_t srcstride,\
>   int height, const int8_t
> *hf, const int8_t *vf, int width)\
>  {
>   \
>  ff_h2656_put_## name ## _ ## depth ## _##opt(dst, 2 * MAX_PB_SIZE,
> src, srcstride, height, hf, vf, width); \
> @@ -69,7 +127,9 @@ static void ff_vvc_put_ ## name ## _ ## depth ##
> _##opt(int16_t *dst, const uint
>  FW_PUT_SSE4( 8)
>  FW_PUT_SSE4(10)
>  FW_PUT_SSE4(12)
> +#endif
>
> +#if HAVE_AVX2_EXTERNAL
>  #define FW_PUT_TAP_AVX2(n, bitd)\
>  FW_PUT(n ## tap_h32,   bitd, avx2)  \
>  FW_PUT(n ## tap_h64,   bitd, avx2)  \
> @@ -105,6 +165,25 @@ FW_PUT_AVX2(12)
>  FW_PUT_16BPC_AVX2(10)
>  FW_PUT_16BPC_AVX2(12)
>
> +#define AVG_FUNCS(bpc, bd, opt)
>\
> +void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,
>   \
> +const int16_t *src0, const int16_t *src1, int width, int height)
>   \
> +{
>\
> +BF(ff_vvc_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height,
> (1 << bd)  - 1);   \
> +}
>\
> +void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,
>   \
> +const in

Re: [FFmpeg-devel] [PATCH 15/38] lavu/opt: add array options

2024-03-03 Thread Anton Khirnov
Quoting Marton Balint (2024-02-26 20:38:46)
> The more I think about it, it is actually a broader problem.
> 
> You are changing the semantics of existing AV_OPT_TYPE_xxx types. So 
> previously an option with AV_OPT_TYPE_STRING used to have default value in 
> default_val.str. After your patch, it will be either default_val.str, or 
> default_val.str[1], based on if it is an array or not.
> 
> I think the API user safely assumed that if the option type is known to 
> him, he will always find the default value in the relevant default_val 
> field. It is actually a bigger issue for an array of AV_OPT_TYPE_INT, 
> because previously to get the default value AVOption->default_val.i64 was 
> used, and now .str[1] should be instead...

In my view the semantics of default_val (and offset) are only defined
when declaring options on your own object, not when accessing those
fields when declared by some other code. I also see no good reason for
any user to read these fields.

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/3] lavc/vp8dsp: R-V V put_bilin_h

2024-03-03 Thread flow gg
Sorry since I did not send the emails all at once, so cannot apply all 4
patches together with git am *.patch. Instead, it needs to first apply the
patch with 'git am '[PATCH] lavc/vp8dsp: R-V V put_vp8_pixels'', and then
apply the patches 1-3 in the series with 'git am *.patch'.

Rémi Denis-Courmont  于2024年3月3日周日 22:39写道:

> Le perjantaina 23. helmikuuta 2024, 16.45.46 EET flow gg a écrit :
> >
>
> Looks like this needs rebasing, or otherwise does not apply.
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/4] lavc/vp9dsp: R-V V ipred dc

2024-03-03 Thread flow gg
> As noted eaerlier, I don't understand why you have two size parameters. It
seems that \size is always either the same as (1 << (\size2 - 1)) a.k.a. ((1
<< \size2) / 2), or unused. The assembler *can* compute arithmetic
constants.

Thanks , I didn't know that before

> Similarly, you can use \restore as a truth value directly: `.if \restore`.

Okay

FWIW, it seems that you could just as well include func/endfunc inside the
macros.

Do you mean to generate func/endfunc using macros?

Rémi Denis-Courmont  于2024年3月3日周日 22:46写道:

> Le sunnuntaina 3. maaliskuuta 2024, 3.59.00 EET flow gg a écrit :
> > updated a little improve in this reply
>
> As noted eaerlier, I don't understand why you have two size parameters. It
> seems that \size is always either the same as (1 << (\size2 - 1)) a.k.a.
> ((1
> << \size2) / 2), or unused. The assembler *can* compute arithmetic
> constants.
>
> Similarly, you can use \restore as a truth value directly: `.if \restore`.
>
> FWIW, it seems that you could just as well include func/endfunc inside the
> macros.
>
> --
> レミ・デニ-クールモン
> http://www.remlab.net/
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_showinfo: add AVFilmGrainAOMParams support

2024-03-03 Thread Stefano Sabatini
On date Tuesday 2024-02-27 14:43:12 +0100, Niklas Haas wrote:
> From: Niklas Haas 
> 

> For my own testing purposes.

You can drop "my own".

> ---
>  libavfilter/vf_showinfo.c | 42 +--
>  1 file changed, 40 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
> index 309de28df91..830170363bc 100644
> --- a/libavfilter/vf_showinfo.c
> +++ b/libavfilter/vf_showinfo.c
> @@ -462,8 +462,46 @@ static void 
> dump_sei_film_grain_params_metadata(AVFilterContext *ctx, const AVFr
>  
>  switch (fgp->type) {
>  case AV_FILM_GRAIN_PARAMS_NONE:
> -case AV_FILM_GRAIN_PARAMS_AV1:
> -return;
> +break;
> +case AV_FILM_GRAIN_PARAMS_AV1: {
> +const AVFilmGrainAOMParams *aom = &fgp->codec.aom;
> +const int num_ar_coeffs_y = 2 * aom->ar_coeff_lag * 
> (aom->ar_coeff_lag + 1);
> +const int num_ar_coeffs_uv = num_ar_coeffs_y + !!aom->num_y_points;
> +av_log(ctx, AV_LOG_INFO, "y_points={ ");

> +for (int i = 0; i < aom->num_y_points; i++)
> +av_log(ctx, AV_LOG_INFO, "{%d, %d} ", aom->y_points[i][0], 
> aom->y_points[i][1]);

nit++: other instances make use of () to delimit vector values

> +av_log(ctx, AV_LOG_INFO, "}; chroma_scaling_from_luma=%d; ", 
> aom->chroma_scaling_from_luma);
> +for (int uv = 0; uv < 2; uv++) {
> +av_log(ctx, AV_LOG_INFO, "uv_points[%d]={ ", uv);
> +for (int i = 0; i < aom->num_uv_points[uv]; i++)
> +av_log(ctx, AV_LOG_INFO, "{%d %d} ", 
> aom->uv_points[uv][i][0], aom->uv_points[uv][i][1]);
> +av_log(ctx, AV_LOG_INFO, "}; ");
> +}
> +av_log(ctx, AV_LOG_INFO, "scaling_shift=%d; ", aom->scaling_shift);
> +av_log(ctx, AV_LOG_INFO, "ar_coeff_lag=%d; ", aom->ar_coeff_lag);

nit: using "," seems more consistent with other instances, here and below

> +if (num_ar_coeffs_y) {
> +av_log(ctx, AV_LOG_INFO, "ar_coeffs_y={ ");
> +for (int i = 0; i < num_ar_coeffs_y; i++)
> +av_log(ctx, AV_LOG_INFO, "%d ", aom->ar_coeffs_y[i]);
> +av_log(ctx, AV_LOG_INFO, "}; ");
> +}
> +for (int uv = 0; num_ar_coeffs_uv && uv < 2; uv++) {
> +av_log(ctx, AV_LOG_INFO, "ar_coeffs_uv[%d]={ ", uv);
> +for (int i = 0; i < num_ar_coeffs_uv; i++)
> +av_log(ctx, AV_LOG_INFO, "%d ", aom->ar_coeffs_uv[uv][i]);
> +av_log(ctx, AV_LOG_INFO, "}; ");
> +}
> +av_log(ctx, AV_LOG_INFO, "ar_coeff_shift=%d; ", aom->ar_coeff_shift);
> +av_log(ctx, AV_LOG_INFO, "grain_scale_shift=%d; ", 
> aom->grain_scale_shift);
> +for (int uv = 0; uv < 2; uv++) {
> +av_log(ctx, AV_LOG_INFO, "uv_mult[%d] = %d; ", uv, 
> aom->uv_mult[uv]);
> +av_log(ctx, AV_LOG_INFO, "uv_mult_luma[%d] = %d; ", uv, 
> aom->uv_mult_luma[uv]);
> +av_log(ctx, AV_LOG_INFO, "uv_offset[%d] = %d; ", uv, 
> aom->uv_offset[uv]);
> +}
> +av_log(ctx, AV_LOG_INFO, "overlap_flag=%d; ", aom->overlap_flag);
> +av_log(ctx, AV_LOG_INFO, "limit_output_range=%d; ", 
> aom->limit_output_range);
> +break;
> +}
>  case AV_FILM_GRAIN_PARAMS_H274: {
>  const AVFilmGrainH274Params *h274 = &fgp->codec.h274;
>  const char *color_range_str = 
> av_color_range_name(h274->color_range);
> -- 

LGTM otherwise (and no need to send another patch).

Unrelated note: probably we should define a serialization method at
the library level, then we might employ the same code to display the
information here and in ffprobe (this was the work proposed by
Nicolas).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 15/38] lavu/opt: add array options

2024-03-03 Thread Diederick C. Niehorster
On Sun, Mar 3, 2024 at 3:55 PM Anton Khirnov  wrote:

> Quoting Marton Balint (2024-02-26 20:38:46)
> > The more I think about it, it is actually a broader problem.
> >
> > You are changing the semantics of existing AV_OPT_TYPE_xxx types. So
> > previously an option with AV_OPT_TYPE_STRING used to have default value
> in
> > default_val.str. After your patch, it will be either default_val.str, or
> > default_val.str[1], based on if it is an array or not.
> >
> > I think the API user safely assumed that if the option type is known to
> > him, he will always find the default value in the relevant default_val
> > field. It is actually a bigger issue for an array of AV_OPT_TYPE_INT,
> > because previously to get the default value AVOption->default_val.i64
> was
> > used, and now .str[1] should be instead...
>
> In my view the semantics of default_val (and offset) are only defined
> when declaring options on your own object, not when accessing those
> fields when declared by some other code. I also see no good reason for
> any user to read these fields.
>

I disagree. Here an example: for a GUI using some part of ffmpeg and
wanting to give the user some control over the ffmpeg operation, it would
not be strange to be able to set options and either indicate which values
are default, or have a "reset to defaults" button. I have written such a
thing (not yet opensourced).

Also the ffmpeg CLI has the ability to print the options and their defaults
for a component. Can this still be done?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 15/38] lavu/opt: add array options

2024-03-03 Thread James Almer

On 3/3/2024 12:53 PM, Diederick C. Niehorster wrote:

On Sun, Mar 3, 2024 at 3:55 PM Anton Khirnov  wrote:


Quoting Marton Balint (2024-02-26 20:38:46)

The more I think about it, it is actually a broader problem.

You are changing the semantics of existing AV_OPT_TYPE_xxx types. So
previously an option with AV_OPT_TYPE_STRING used to have default value

in

default_val.str. After your patch, it will be either default_val.str, or
default_val.str[1], based on if it is an array or not.

I think the API user safely assumed that if the option type is known to
him, he will always find the default value in the relevant default_val
field. It is actually a bigger issue for an array of AV_OPT_TYPE_INT,
because previously to get the default value AVOption->default_val.i64

was

used, and now .str[1] should be instead...


In my view the semantics of default_val (and offset) are only defined
when declaring options on your own object, not when accessing those
fields when declared by some other code. I also see no good reason for
any user to read these fields.



I disagree. Here an example: for a GUI using some part of ffmpeg and
wanting to give the user some control over the ffmpeg operation, it would
not be strange to be able to set options and either indicate which values
are default, or have a "reset to defaults" button. I have written such a
thing (not yet opensourced).


There's av_opt_set_defaults() to set default values, then 
av_opt_is_set_to_default() and av_opt_is_set_to_default_by_name() to 
check if an option is already set to the default value.


What Anton said is that the user has no need to access the fields 
directly when there are helpers explicitly documented for this purpose.




Also the ffmpeg CLI has the ability to print the options and their defaults
for a component. Can this still be done?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: add AVFilmGrainParams printing

2024-03-03 Thread Stefano Sabatini
On date Tuesday 2024-02-27 14:43:13 +0100, Niklas Haas wrote:
> From: Niklas Haas 
> 
> So we can add a FATE test for this.
> ---
>  fftools/ffprobe.c | 118 ++
>  1 file changed, 118 insertions(+)

Looks good to me, probably you can add an entry to the Changelog to
advertise the new feature.

Thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/2] avutil/tests/opt: test negative values for INT and INT64 types

2024-03-03 Thread Stefano Sabatini
On date Tuesday 2024-02-27 10:59:46 -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libavutil/tests/opt.c | 11 +--
>  tests/ref/fate/opt| 35 ++-
>  2 files changed, 39 insertions(+), 7 deletions(-)
> 
> diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c
> index e2582cc93d..a914d0359a 100644
> --- a/libavutil/tests/opt.c
> +++ b/libavutil/tests/opt.c
> @@ -66,7 +66,7 @@ typedef struct TestContext {
>  #define TEST_FLAG_MU   04
>  
>  static const AVOption test_options[]= {
> -{"num","set num",OFFSET(num),
> AV_OPT_TYPE_INT,{ .i64 = 0 },  0,   100, 
> 1 },
> +{"num","set num",OFFSET(num),
> AV_OPT_TYPE_INT,{ .i64 = 0 }, -1,   100, 
> 1 },
>  {"toggle", "set toggle", OFFSET(toggle), 
> AV_OPT_TYPE_INT,{ .i64 = 1 },  0, 1, 
> 1 },
>  {"rational",   "set rational",   OFFSET(rational),   
> AV_OPT_TYPE_RATIONAL,   { .dbl = 1 },  0,10, 
> 1 },
>  {"string", "set string", OFFSET(string), 
> AV_OPT_TYPE_STRING, { .str = "default" },   CHAR_MIN,  CHAR_MAX, 
> 1 },
> @@ -85,7 +85,7 @@ static const AVOption test_options[]= {
>  {"bin","set binary value",   OFFSET(binary), 
> AV_OPT_TYPE_BINARY, { .str="62696e00" },   0, 0, 
> 1 },
>  {"bin1",   "set binary value",   OFFSET(binary1),
> AV_OPT_TYPE_BINARY, { .str=NULL }, 0, 0, 
> 1 },
>  {"bin2",   "set binary value",   OFFSET(binary2),
> AV_OPT_TYPE_BINARY, { .str="" },   0, 0, 
> 1 },
> -{"num64",  "set num 64bit",  OFFSET(num64),  
> AV_OPT_TYPE_INT64,  { .i64 = 1 },  0,   100, 
> 1 },
> +{"num64",  "set num 64bit",  OFFSET(num64),  
> AV_OPT_TYPE_INT64,  { .i64 = 1 }, -1,   100, 
> 1 },
>  {"flt","set float",  OFFSET(flt),
> AV_OPT_TYPE_FLOAT,  { .dbl = 1.0 / 3 },0,   100, 
> 1 },
>  {"dbl","set double", OFFSET(dbl),
> AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 / 3 },0,   100, 
> 1 },
>  {"bool1",  "set boolean value",  OFFSET(bool1),  
> AV_OPT_TYPE_BOOL,   { .i64 = -1 },-1, 1, 
> 1 },
> @@ -285,10 +285,17 @@ int main(void)
>  "bin=boguss",
>  "bin=111",
>  "bin=",
> +"num=bogus",
> +"num=44",
> +"num=44.4",
> +"num=-1",
> +"num=-2",
> +"num=101",
>  "num64=bogus",
>  "num64=44",
>  "num64=44.4",
>  "num64=-1",
> +"num64=-2",
>  "num64=101",
>  "flt=bogus",
>  "flt=2",
> diff --git a/tests/ref/fate/opt b/tests/ref/fate/opt
> index 832f9cc8a9..2da155aa2b 100644
> --- a/tests/ref/fate/opt
> +++ b/tests/ref/fate/opt
> @@ -18,7 +18,7 @@ num64=1
>  flt=0.33
>  dbl=0.33
>  TestContext AVOptions:
> -  -num   E.. set num (from 0 to 100) 
> (default 0)
> +  -num   E.. set num (from -1 to 100) 
> (default 0)
>-toggleE.. set toggle (from 0 to 1) 
> (default 1)
>-rational E.. set rational (from 0 to 10) 
> (default 1/1)
>-string E.. set string (default "default")
> @@ -37,7 +37,7 @@ TestContext AVOptions:
>-binE.. set binary value
>-bin1   E.. set binary value
>-bin2   E.. set binary value
> -  -num64   E.. set num 64bit (from 0 to 100) 
> (default 1)
> +  -num64   E.. set num 64bit (from -1 to 100) 
> (default 1)
>-flt E.. set float (from 0 to 100) 
> (default 0.33)
>-dblE.. set double (from 0 to 100) 
> (default 0.33)
>-bool1 E.. set boolean value (default 
> auto)
> @@ -312,6 +312,28 @@ Error 'bin=111'
>  Setting options string 'bin='
>  Setting entry with key 'bin' to value ''
>  OK'bin='
> +Setting options string 'num=bogus'
> +Setting entry with key 'num' to value 'bogus'
> +Undefined constant or missing '(' in 'bogus'
> +Unable to parse option value "bogus"
> +Error 'num=bogus'
> +Setting options string 'num=44'
> +Setting entry with key 'num' to value '44'
> +OK'num=44'
> +Setting options string 'num=44.4'
> +Setting entry with key 'num' to value '44.4'
> +OK'num=44.4'
> +Setting options string 'num=-1'
>

Re: [FFmpeg-devel] [PATCH 2/2] avutil/opt: add an unsigned option type

2024-03-03 Thread Stefano Sabatini
On date Tuesday 2024-02-27 10:59:47 -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libavutil/opt.c   | 20 
>  libavutil/opt.h   |  1 +
>  libavutil/tests/opt.c |  9 +
>  tests/ref/fate/opt| 32 ++--
>  4 files changed, 60 insertions(+), 2 deletions(-)

Use case?

> diff --git a/libavutil/opt.c b/libavutil/opt.c
> index 0681b19896..45d6aa5849 100644
> --- a/libavutil/opt.c
> +++ b/libavutil/opt.c
> @@ -72,6 +72,9 @@ static int read_number(const AVOption *o, const void *dst, 
> double *num, int *den
>  case AV_OPT_TYPE_INT:
>  *intnum = *(int *)dst;
>  return 0;
> +case AV_OPT_TYPE_UINT:
> +*intnum = *(unsigned *)dst;
> +return 0;
>  #if FF_API_OLD_CHANNEL_LAYOUT
>  FF_DISABLE_DEPRECATION_WARNINGS
>  case AV_OPT_TYPE_CHANNEL_LAYOUT:
> @@ -130,6 +133,9 @@ static int write_number(void *obj, const AVOption *o, 
> void *dst, double num, int
>  case AV_OPT_TYPE_INT:
>  *(int *)dst = llrint(num / den) * intnum;
>  break;
> +case AV_OPT_TYPE_UINT:
> +*(unsigned *)dst = llrint(num / den) * intnum;
> +break;
>  case AV_OPT_TYPE_DURATION:
>  #if FF_API_OLD_CHANNEL_LAYOUT
>  FF_DISABLE_DEPRECATION_WARNINGS
> @@ -231,6 +237,7 @@ static int set_string(void *obj, const AVOption *o, const 
> char *val, uint8_t **d
>opt->type == AV_OPT_TYPE_UINT64 || \
>opt->type == AV_OPT_TYPE_CONST || \
>opt->type == AV_OPT_TYPE_FLAGS || \
> +  opt->type == AV_OPT_TYPE_UINT  || \
>opt->type == AV_OPT_TYPE_INT) \
>   ? opt->default_val.i64 \
>   : opt->default_val.dbl)
> @@ -529,6 +536,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  return set_string_binary(obj, o, val, dst);
>  case AV_OPT_TYPE_FLAGS:
>  case AV_OPT_TYPE_INT:
> +case AV_OPT_TYPE_UINT:
>  case AV_OPT_TYPE_INT64:
>  case AV_OPT_TYPE_UINT64:
>  case AV_OPT_TYPE_FLOAT:
> @@ -871,6 +879,9 @@ int av_opt_get(void *obj, const char *name, int 
> search_flags, uint8_t **out_val)
>  case AV_OPT_TYPE_INT:
>  ret = snprintf(buf, sizeof(buf), "%d", *(int *)dst);
>  break;
> +case AV_OPT_TYPE_UINT:
> +ret = snprintf(buf, sizeof(buf), "%u", *(unsigned int *)dst);
> +break;
>  case AV_OPT_TYPE_INT64:
>  ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t *)dst);
>  break;
> @@ -1276,6 +1287,9 @@ static void opt_list(void *obj, void *av_log_obj, const 
> char *unit,
>  case AV_OPT_TYPE_INT:
>  av_log(av_log_obj, AV_LOG_INFO, "%-12s ", "");
>  break;
> +case AV_OPT_TYPE_UINT:
> +av_log(av_log_obj, AV_LOG_INFO, "%-12s ", "");
> +break;
>  case AV_OPT_TYPE_INT64:
>  av_log(av_log_obj, AV_LOG_INFO, "%-12s ", "");
>  break;
> @@ -1358,6 +1372,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  if (av_opt_query_ranges(&r, obj, opt->name, AV_OPT_SEARCH_FAKE_OBJ) 
> >= 0) {
>  switch (opt->type) {
>  case AV_OPT_TYPE_INT:
> +case AV_OPT_TYPE_UINT:
>  case AV_OPT_TYPE_INT64:
>  case AV_OPT_TYPE_UINT64:
>  case AV_OPT_TYPE_DOUBLE:
> @@ -1405,6 +1420,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  av_log(av_log_obj, AV_LOG_INFO, "%s", buf);
>  break;
>  }
> +case AV_OPT_TYPE_UINT:
>  case AV_OPT_TYPE_INT:
>  case AV_OPT_TYPE_UINT64:
>  case AV_OPT_TYPE_INT64: {
> @@ -1490,6 +1506,7 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
>  case AV_OPT_TYPE_BOOL:
>  case AV_OPT_TYPE_FLAGS:
>  case AV_OPT_TYPE_INT:
> +case AV_OPT_TYPE_UINT:
>  case AV_OPT_TYPE_INT64:
>  case AV_OPT_TYPE_UINT64:
>  case AV_OPT_TYPE_DURATION:
> @@ -1858,6 +1875,7 @@ static int opt_size(enum AVOptionType type)
>  switch(type) {
>  case AV_OPT_TYPE_BOOL:
>  case AV_OPT_TYPE_INT:
> +case AV_OPT_TYPE_UINT:
>  case AV_OPT_TYPE_FLAGS:
>  return sizeof(int);
>  case AV_OPT_TYPE_DURATION:
> @@ -1997,6 +2015,7 @@ int av_opt_query_ranges_default(AVOptionRanges 
> **ranges_arg, void *obj, const ch
>  switch (field->type) {
>  case AV_OPT_TYPE_BOOL:
>  case AV_OPT_TYPE_INT:
> +case AV_OPT_TYPE_UINT:
>  case AV_OPT_TYPE_INT64:
>  case AV_OPT_TYPE_UINT64:
>  case AV_OPT_TYPE_PIXEL_FMT:
> @@ -2089,6 +2108,7 @@ int av_opt_is_set_to_default(void *obj, const AVOption 
> *o)
>  case AV_OPT_TYPE_PIXEL_FMT:
>  case AV_OPT_TYPE_SAMPLE_FMT:
>  case AV_OPT_TYPE_INT:
> +case AV_OPT_TYPE_UINT:
>  #if FF_API_OLD_CHANNEL_LAYOUT
>  FF_D

Re: [FFmpeg-devel] [PATCH] web: Add spi.txt

2024-03-03 Thread Stefano Sabatini
On date Tuesday 2024-02-27 20:01:26 +0100, Michael Niedermayer wrote:
> This explains how to request refunds and what can be funded by SPI
> 
> Co-Author: Stefano Sabatini 
> ---
>  Makefile   |  2 +-
>  src/spi| 98 ++
>  src/spi_js |  0
>  src/spi_title  |  1 +
>  src/template_head2 |  1 +
>  5 files changed, 101 insertions(+), 1 deletion(-)
>  create mode 100644 src/spi
>  create mode 100644 src/spi_js
>  create mode 100644 src/spi_title
> 
> diff --git a/Makefile b/Makefile
> index 0686e44..dd681e4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,7 +1,7 @@
>  # ffmpeg.org HTML generation from source files
>  
>  SRCS = about bugreports consulting contact donations documentation download \
> -   olddownload index legal shame security archive
> +   olddownload index legal shame security spi archive
>  
>  HTML_TARGETS  = $(addsuffix .html,$(addprefix htdocs/,$(SRCS)))
>  
> diff --git a/src/spi b/src/spi
> new file mode 100644
> index 000..8fffc7f
> --- /dev/null
> +++ b/src/spi
> @@ -0,0 +1,98 @@
> +
> +SPI (Software in the Public Interest) is a non-profit corporation
> +registered in the state of New York founded to act as a fiscal sponsor
> +for organizations that develop open source software and hardware. For
> +details check here:
> +https://www.spi-inc.org/";>www.spi-inc.org
> +
> +
> +
> +FFmpeg is an SPI associated project and donations can be collected and
> +handled by SPI on behalf of FFmpeg. For details about the association
> +check here:
> + href="https://www.spi-inc.org/projects/ffmpeg/";>www.spi-inc.org/projects/ffmpeg/
> +
> +
> +
> +
> +How to request refunds from SPI:
> +
> +Send a mail to ffmpeg-devel with the [REFUND-REQUEST] tag and a short
> +description of the refund topic in the subject.
> +
> +
> +
> +In the mail, you also need to provide the amount to be refunded, with
> +a short description of how the money was spent.
> +
> +
> +
> +There is no need and is not recommeded to send receipts when sending
> +the refund request on the ffmpeg-devel mailing-list, but they are
> +usually needed later when the request is approved and the refund
> +request is sent to SPI:
> + href="https://www.spi-inc.org/treasurer/reimbursement-form/";>www.spi-inc.org/treasurer/reimbursement-form
> +
> +
> +
> +What can be payed by SPI:
> +

> +FFmpeg money collected at SPI can be used for any purpose which is in line 
> with
> +501(c)3 nonprofit rules, and within our mission (Free & OSS software).

Free & Open Source software?

> +
> +
> +
> +In practice we frequently payed for travel and hardware.
> +For other refund expenses or sponsorships, it is recommended to

> +discuss them beforehand on ffmpeg-devel. If there is a community
> +agreement on their approval, the current FFmpeg liaison will followup
> +to get an approval on the SPI side.
> +
> +
> +
> +
> +Funding active development by SPI:
> +
> +The texts below have been taken from multiple replies FFmpeg has
> +received from SPI, they have been edited
> +so that "I" was replaced by "SPI" in some cases.)
> +
> +
> +Paying for development *does* require substantial
> +additional paperwork, but it is not prohibited.
> +
> +
> +Several SPI projects pay contractors for development
> +efforts.  SPI needs a contract in place which describes the work to be
> +done.  There are also various things SPI needs to check about the potential
> +contractors(e.g. are they a US person or not, as with GSoC mentor payments;

contractors_(

> +are they really a contractor and not a employee).
> +
> +
> +SPI can't deal with employment at the moment because that involves a
> +lot of work, like health insurance, tax withholding, etc.  Contractors
> +are easier because they have to take care of that themselves; Whether
> +someone is a contractor vs employee depends on various factors (that
> +of course are different in every country) and can be disputed (see
> +e.g. the debate about whether Uber drivers are employees); SPI has a
> +questionnaire about their circumstances.
> +
> +
> +Unfortunately, there's no one-size-fits all when dealing with

one-size-fits-all ?

> +contractors, especially without knowing the contributor's country.
> +

> +
> +SPI does have some contract templates which depends on the contractors
> +country. In case of US, Australia, France and a couple others
> +countries, SPI can easily provide them, otherwise SPI would need to
> +ask their attorney to draft one, which would take some time

add missing "."

> +
> +
> +Also, SPI has two models, MSA (which transfers ownership) and CSA (which
> +grants a license instead). SPI usually sends the MSA (it's better for most
> +purposes), but for development purposes, some projects prefer that the
> +contractor retains ownership rights.

Probably it's good to expand MSA (Master Service Agreements) and CSA
(Continued Service Agreements) in their first occurrence.

> +
> +
> +
> +
> diff --git a/src/spi_js b/src/spi_js
> new 

Re: [FFmpeg-devel] [PATCH 1/2] doc/ffprobe.xsd: add frameSideDatumType entry

2024-03-03 Thread Stefano Sabatini
On date Wednesday 2024-02-28 14:23:49 +0100, Niklas Haas wrote:
> From: Niklas Haas 
> 
> Frame-level side data attributes are printed with the same key/value
> structure as packet-level side data attributes, but this is not
> reflected in the XSD.
> ---
>  doc/ffprobe.xsd | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
> index 23d97ed11ab..5d17b5d9b90 100644
> --- a/doc/ffprobe.xsd
> +++ b/doc/ffprobe.xsd
> @@ -162,6 +162,7 @@
>
>  
> minOccurs="0" maxOccurs="1"/>
> +   minOccurs="0" maxOccurs="unbounded"/>
>  
>  
>  
> @@ -169,6 +170,11 @@
>  
>
>  
> +  
> +
> +
> +  
> +
>
>  
> minOccurs="0" maxOccurs="unbounded"/>

LGTM, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] doc/ffprobe.xsd: add and

2024-03-03 Thread Stefano Sabatini
On date Wednesday 2024-02-28 14:23:50 +0100, Niklas Haas wrote:
> From: Niklas Haas 
> 
> Originally introduced for dovi side data printing, but not properly
> reflected in the xsd.
> ---
>  doc/ffprobe.xsd | 26 ++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
> index 5d17b5d9b90..49771dd1482 100644
> --- a/doc/ffprobe.xsd
> +++ b/doc/ffprobe.xsd
> @@ -162,6 +162,7 @@
>
>  
> minOccurs="0" maxOccurs="1"/>
> +   type="ffprobe:frameSideDataComponentList" minOccurs="0" maxOccurs="1"/>
> minOccurs="0" maxOccurs="unbounded"/>
>  
>  
> @@ -185,6 +186,31 @@
>  
>
>  
> +  
> +
> +   type="ffprobe:frameSideDataComponentType" minOccurs="0" 
> maxOccurs="unbounded"/>
> +
> +  
> +
> +  
> +
> +   minOccurs="0" maxOccurs="1"/>
> +   minOccurs="0" maxOccurs="unbounded"/>
> +
> +  
> +

> +  
> +
> +   minOccurs="0" maxOccurs="unbounded"/>
  

as you already spotted, this should be name="piece"

> +
> +  
> +
> +  
> +
> +   minOccurs="0" maxOccurs="unbounded"/>
> +
> +  
> +
>
>   fixed="subtitle" use="required"/>
>  

Looks good to me otherwise, thanks.

Unrelated note: we should add an xmllint test to spot all these kind
of issues.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3] avcodec/jpeg2000dec: support of 2 fields in 1 AVPacket

2024-03-03 Thread Jerome Martinez

On 01/03/2024 23:29, Tomas Härdin wrote:

sön 2024-02-25 klockan 05:14 +0100 skrev Jerome Martinez:
[...]

I also needed to add a dedicated AVStream field for saying that the
decoder is able to manage this functionality (and is needed there).

What is the added value to call the decoder twice from decode.c
rather
than recursive call (or a master function in the decoder calling the
current function twice, if preferred) inside the decoder only?

We get support for all codecs that can do SEPARATE_FIELDS in MXF,
rather than a half measure that only supports j2k, that we'd have to
fix later anyway.


I personally don't understand how, because in both cases we need a 
decoder aware about this feature (for the stride during decoding), 
anyway if you think that it will be useful in the future for another 
codec which would have separate fields, I warned about the issues I see 
in practice and it does not matter to me that it is done the way you 
want, my goal being that the upstream FFmpeg, rather than only my build, 
does not trash half of a frame (current behavior), however it is done.




[...]
I didn't find specifications for the essence label UL corresponding

ULs aren't for specifying interlacing type (though I wouldn't be
surprised if there's a mapping that misuse them for that)



In practice for MXF jp2k the store method is provided by the UL (byte 15 
of the essence container label), it is in the specs and all the other 
items (frame layout, sample rate, edit rate, aspect ratio) alone don't 
provide enough information (and are often buggy), I did not decide about 
that.


About other formats and if it should not depend on the UL, I did not 
find any information about separate fields, difficult for me to prove 
that something does not exist, could you indicate another spec 
specifying differently separate fields?


In practice and as far as I know, we currently have only jp2k with 2 
completely separate codestreams in MXF, so I implemented in my patch for 
all existing specifications (and files) I am aware about, i.e. 1.




[...]


but if it appears would be only a matter of mapping the MXF signaling
to
the new AVStream field and supporting the feature in the decoders
(even
if we implement the idea of calling the decoder twice, the decoder
needs
to be expanded for this feature).

So in other words putting it into every decoder for which there exists
an MXF mapping for SEPARATE_FIELDS, rather than doing it properly?



As said above, I am not convinced that calling the decoder twice from 
decode.c (or similar) is properly doing things, but if you think that 
this is properly done if it is done this way, fine for me.


Patch v3 contains all the requested changes (MXF config propagation to 
the decoder, calling the decoder twice), is there anything else in this 
patch proposal preventing it to be applied?


Jérôme
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/8 v2] fftools/ffprobe: add support for Stream Groups

2024-03-03 Thread James Almer
Signed-off-by: James Almer 
---
 doc/ffprobe.xsd   |   1 +
 fftools/ffprobe.c | 145 --
 tests/ref/fate/cavs-demux |   2 +-
 tests/ref/fate/ffprobe_compact|   2 +-
 tests/ref/fate/ffprobe_csv|   2 +-
 tests/ref/fate/ffprobe_default|   1 +
 tests/ref/fate/ffprobe_flat   |   1 +
 tests/ref/fate/ffprobe_ini|   1 +
 tests/ref/fate/ffprobe_json   |   1 +
 tests/ref/fate/ffprobe_xml|   2 +-
 tests/ref/fate/ffprobe_xsd|   2 +-
 tests/ref/fate/flv-demux  |   2 +-
 tests/ref/fate/gapless-mp3-side-data  |   2 +-
 .../ref/fate/mov-mp4-disposition-mpegts-remux |   3 +
 tests/ref/fate/mov-mp4-ttml-dfxp  |   3 +
 tests/ref/fate/mov-mp4-ttml-stpp  |   3 +
 tests/ref/fate/oggopus-demux  |   2 +-
 tests/ref/fate/ts-demux   |   2 +-
 tests/ref/fate/ts-opus-demux  |   2 +-
 tests/ref/fate/ts-small-demux |   2 +-
 tests/ref/fate/ts-timed-id3-demux |   2 +-
 21 files changed, 160 insertions(+), 23 deletions(-)

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 23d97ed11a..08f2909c02 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -305,6 +305,7 @@
 
 
 
+
 
 
 
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index ac6b92f5d6..548c5e0948 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -112,8 +112,10 @@ static int do_show_format  = 0;
 static int do_show_frames  = 0;
 static int do_show_packets = 0;
 static int do_show_programs = 0;
+static int do_show_stream_groups = 0;
 static int do_show_streams = 0;
 static int do_show_stream_disposition = 0;
+static int do_show_stream_group_disposition = 0;
 static int do_show_data= 0;
 static int do_show_program_version  = 0;
 static int do_show_library_versions = 0;
@@ -126,6 +128,7 @@ static int do_show_chapter_tags = 0;
 static int do_show_format_tags = 0;
 static int do_show_frame_tags = 0;
 static int do_show_program_tags = 0;
+static int do_show_stream_group_tags = 0;
 static int do_show_stream_tags = 0;
 static int do_show_packet_tags = 0;
 
@@ -159,7 +162,7 @@ static int find_stream_info  = 1;
 
 /* section structure definition */
 
-#define SECTION_MAX_NB_CHILDREN 10
+#define SECTION_MAX_NB_CHILDREN 11
 
 typedef enum {
 SECTION_ID_NONE = -1,
@@ -203,6 +206,14 @@ typedef enum {
 SECTION_ID_PROGRAM_TAGS,
 SECTION_ID_PROGRAM_VERSION,
 SECTION_ID_PROGRAMS,
+SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION,
+SECTION_ID_STREAM_GROUP_STREAM_TAGS,
+SECTION_ID_STREAM_GROUP,
+SECTION_ID_STREAM_GROUP_STREAMS,
+SECTION_ID_STREAM_GROUP_STREAM,
+SECTION_ID_STREAM_GROUP_DISPOSITION,
+SECTION_ID_STREAM_GROUP_TAGS,
+SECTION_ID_STREAM_GROUPS,
 SECTION_ID_ROOT,
 SECTION_ID_STREAM,
 SECTION_ID_STREAM_DISPOSITION,
@@ -285,8 +296,16 @@ static struct section sections[] = {
 [SECTION_ID_PROGRAM_TAGS] =   { SECTION_ID_PROGRAM_TAGS, 
"tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", 
.unique_name = "program_tags" },
 [SECTION_ID_PROGRAM_VERSION] ={ SECTION_ID_PROGRAM_VERSION, 
"program_version", 0, { -1 } },
 [SECTION_ID_PROGRAMS] =   { SECTION_ID_PROGRAMS, 
"programs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM, -1 } },
+[SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION] = { 
SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, "disposition", 0, { -1 }, 
.unique_name = "stream_group_stream_disposition" },
+[SECTION_ID_STREAM_GROUP_STREAM_TAGS] ={ 
SECTION_ID_STREAM_GROUP_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, 
{ -1 }, .element_name = "tag", .unique_name = "stream_group_stream_tags" },
+[SECTION_ID_STREAM_GROUP] ={ SECTION_ID_STREAM_GROUP, 
"stream_group", 0, { SECTION_ID_STREAM_GROUP_TAGS, 
SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAMS, -1 } },
+[SECTION_ID_STREAM_GROUP_STREAMS] ={ 
SECTION_ID_STREAM_GROUP_STREAMS, "streams", SECTION_FLAG_IS_ARRAY, { 
SECTION_ID_STREAM_GROUP_STREAM, -1 }, .unique_name = "stream_group_streams" },
+[SECTION_ID_STREAM_GROUP_STREAM] = { 
SECTION_ID_STREAM_GROUP_STREAM, "stream", 0, { 
SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, 
SECTION_ID_STREAM_GROUP_STREAM_TAGS, -1 }, .unique_name = "stream_group_stream" 
},
+[SECTION_ID_STREAM_GROUP_DISPOSITION] ={ 
SECTION_ID_STREAM_GROUP_DISPOSITION, "disposition", 0, { -1 }, .unique_name = 
"stream_group_disposition" },
+[SECTION_ID_STREAM_GROUP_TAGS] =   { 
SECTION_ID_STREAM_GROUP_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, 
.element_name = "tag", .unique_name = "stream_group_tags" },
+[SECTION_ID_STREAM_GROUPS] =   { SECTION_ID_STREAM_GROUPS, 
"str

[FFmpeg-devel] [PATCH 2/8] fftools/ffprobe: print some basic Tile Grid Stream Group parameters

2024-03-03 Thread James Almer
Signed-off-by: James Almer 
---
 fftools/ffprobe.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 548c5e0948..fef2a37d4c 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3367,7 +3367,15 @@ static void print_stream_group_params(WriterContext *w, 
AVStreamGroup *stg)
 else if (stg->type == AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION)
 print_str("type", "IAMF Mix Presentation");
 else if (stg->type == AV_STREAM_GROUP_PARAMS_TILE_GRID) {
+AVStreamGroupTileGrid *tile_grid = stg->params.tile_grid;
 print_str("type", "Tile Grid");
+print_int("nb_tiles",  tile_grid->nb_tiles);
+print_int("coded_width",   tile_grid->coded_width);
+print_int("coded_height",  tile_grid->coded_height);
+print_int("horizontal_offset", tile_grid->horizontal_offset);
+print_int("vertical_offset",   tile_grid->vertical_offset);
+print_int("width", tile_grid->width);
+print_int("height",tile_grid->height);
 } else
 print_str_opt("type", "unknown");
 }
-- 
2.44.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 3/8] fate/iamf: print stream group information

2024-03-03 Thread James Almer
Signed-off-by: James Almer 
---
 tests/fate/iamf.mak |  8 ++--
 tests/ref/fate/iamf-5_1_4   | 60 +
 tests/ref/fate/iamf-7_1_4   | 68 +
 tests/ref/fate/iamf-ambisonic_1 | 44 +
 tests/ref/fate/iamf-stereo  | 20 ++
 5 files changed, 196 insertions(+), 4 deletions(-)

diff --git a/tests/fate/iamf.mak b/tests/fate/iamf.mak
index 8b0de7f4b2..2257580871 100644
--- a/tests/fate/iamf.mak
+++ b/tests/fate/iamf.mak
@@ -4,7 +4,7 @@ fate-iamf-stereo: SRC = 
$(TARGET_PATH)/tests/data/asynth-44100-2.wav
 fate-iamf-stereo: CMD = transcode wav $(SRC) iamf " \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-stereo \
   -/stream_group 
$(TARGET_PATH)/tests/data/streamgroups/mix_presentation-stereo \
-  -streamid 0:0 -c:a flac -t 1" "-c:a copy -map 0"
+  -streamid 0:0 -c:a flac -t 1" "-c:a copy -map 0" "-show_entries 
stream_group=index,id,nb_streams,type:stream_group_stream=index,id"
 
 FATE_IAMF += fate-iamf-5_1_4
 fate-iamf-5_1_4: tests/data/asynth-44100-10.wav 
tests/data/filtergraphs/iamf_5_1_4 tests/data/streamgroups/audio_element-5_1_4 
tests/data/streamgroups/mix_presentation-5_1_4
@@ -13,7 +13,7 @@ fate-iamf-5_1_4: CMD = transcode wav $(SRC) iamf 
"-auto_conversion_filters \
   -/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_5_1_4 \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-5_1_4 \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-5_1_4 
\
-  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 
-streamid 5:5 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map 
[TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0"
+  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 
-streamid 5:5 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map 
[TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" "-show_entries 
stream_group=index,id,nb_streams,type:stream_group_stream=index,id"
 
 FATE_IAMF += fate-iamf-7_1_4
 fate-iamf-7_1_4: tests/data/asynth-44100-12.wav 
tests/data/filtergraphs/iamf_7_1_4 tests/data/streamgroups/audio_element-7_1_4 
tests/data/streamgroups/mix_presentation-7_1_4
@@ -22,7 +22,7 @@ fate-iamf-7_1_4: CMD = transcode wav $(SRC) iamf 
"-auto_conversion_filters \
   -/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_7_1_4 \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-7_1_4 \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-7_1_4 
\
-  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 
-streamid 5:5 -streamid 6:6 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] 
-map [SIDE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0"
+  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 
-streamid 5:5 -streamid 6:6 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] 
-map [SIDE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" 
"-show_entries 
stream_group=index,id,nb_streams,type:stream_group_stream=index,id"
 
 FATE_IAMF += fate-iamf-ambisonic_1
 fate-iamf-ambisonic_1: tests/data/asynth-44100-4.wav 
tests/data/filtergraphs/iamf_ambisonic_1 
tests/data/streamgroups/audio_element-ambisonic_1 
tests/data/streamgroups/mix_presentation-ambisonic_1
@@ -31,7 +31,7 @@ fate-iamf-ambisonic_1: CMD = transcode wav $(SRC) iamf 
"-auto_conversion_filters
   -/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_ambisonic_1 \
   -/stream_group 
$(TARGET_PATH)/tests/data/streamgroups/audio_element-ambisonic_1 \
   -/stream_group 
$(TARGET_PATH)/tests/data/streamgroups/mix_presentation-ambisonic_1 \
-  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -map [MONO0] -map 
[MONO1] -map [MONO2] -map [MONO3] -c:a flac -t 1" "-c:a copy -map 0"
+  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -map [MONO0] -map 
[MONO1] -map [MONO2] -map [MONO3] -c:a flac -t 1" "-c:a copy -map 0" 
"-show_entries 
stream_group=index,id,nb_streams,type:stream_group_stream=index,id"
 
 FATE_IAMF-$(call TRANSCODE, FLAC, IAMF, WAV_DEMUXER PCM_S16LE_DECODER) += 
$(FATE_IAMF)
 
diff --git a/tests/ref/fate/iamf-5_1_4 b/tests/ref/fate/iamf-5_1_4
index e6eb356ff0..daa9653006 100644
--- a/tests/ref/fate/iamf-5_1_4
+++ b/tests/ref/fate/iamf-5_1_4
@@ -96,3 +96,63 @@ c447cbbc8943cfb751fdf1145a094250 
*tests/data/fate/iamf-5_1_4.iamf
 3,  41472,  41472, 4608,  923, 0xa7225edf
 4,  41472,  41472, 4608,  926, 0xc26a5eae
 5,  41472,  41472, 4608,  926, 0xc26a5eae
+[STREAM_GROUP]
+index=0
+id=0x1
+nb_streams=6
+type=IAMF Audio Element
+[STREAM]
+index=0
+id=0x0
+[/STREAM]
+[STREAM]
+index=1
+id=0x1
+[/STREAM]
+[STREAM]
+index=2
+id=0x2
+[/STREAM]
+[STREAM]
+index=3
+id=0x3
+[/STREAM]
+[STREAM]
+index=4
+id=0x4
+[/STREAM]
+[STREAM]
+index=5
+id=0x5
+[/STREAM]
+[/STREAM_GROUP]
+[STREAM_GROUP]
+index=1
+id=0x2
+nb_streams=6
+

[FFmpeg-devel] [PATCH 4/8] avformat/mov: fix setting disposition for the first iamf stream

2024-03-03 Thread James Almer
st->disposition will be overwritten with disposition later in the function.

Signed-off-by: James Almer 
---
 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index e07f2a1ada..7a09017020 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -946,7 +946,7 @@ static int mov_read_iacb(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 
 if (!i && !j) {
 if (audio_element->layers[0].substream_count != 1)
-st->disposition &= ~AV_DISPOSITION_DEFAULT;
+disposition &= ~AV_DISPOSITION_DEFAULT;
 stream = st;
 } else
 stream = avformat_new_stream(c->fc, NULL);
-- 
2.44.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 5/8] fate/mov: print stream group information for iamf tests

2024-03-03 Thread James Almer
Signed-off-by: James Almer 
---
 tests/fate/mov.mak  |  12 +-
 tests/ref/fate/mov-mp4-iamf-5_1_4   | 318 +
 tests/ref/fate/mov-mp4-iamf-7_1_4   | 362 
 tests/ref/fate/mov-mp4-iamf-ambisonic_1 | 230 +++
 tests/ref/fate/mov-mp4-iamf-stereo  |  98 +++
 5 files changed, 1016 insertions(+), 4 deletions(-)

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 535647c474..de0e654532 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -211,7 +211,8 @@ fate-mov-mp4-iamf-stereo: SRC = 
$(TARGET_PATH)/tests/data/asynth-44100-2.wav
 fate-mov-mp4-iamf-stereo: CMD = transcode wav $(SRC) mp4 " \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-stereo \
   -/stream_group 
$(TARGET_PATH)/tests/data/streamgroups/mix_presentation-stereo \
-  -streamid 0:0 -c:a flac -t 1" "-c:a copy -map 0"
+  -streamid 0:0 -c:a flac -t 1" "-c:a copy -map 0" \
+  "-show_entries 
stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
 
 FATE_MOV_FFMPEG-$(call TRANSCODE, FLAC, MOV, WAV_DEMUXER PCM_S16LE_DECODER) += 
fate-mov-mp4-iamf-5_1_4
 fate-mov-mp4-iamf-5_1_4: tests/data/asynth-44100-10.wav 
tests/data/filtergraphs/iamf_5_1_4 tests/data/streamgroups/audio_element-5_1_4 
tests/data/streamgroups/mix_presentation-5_1_4
@@ -220,7 +221,8 @@ fate-mov-mp4-iamf-5_1_4: CMD = transcode wav $(SRC) mp4 
"-auto_conversion_filter
   -/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_5_1_4 \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-5_1_4 \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-5_1_4 
\
-  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 
-streamid 5:5 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map 
[TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0"
+  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 
-streamid 5:5 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map 
[TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" \
+  "-show_entries 
stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
 
 FATE_MOV_FFMPEG-$(call TRANSCODE, FLAC, MOV, WAV_DEMUXER PCM_S16LE_DECODER) += 
fate-mov-mp4-iamf-7_1_4
 fate-mov-mp4-iamf-7_1_4: tests/data/asynth-44100-12.wav 
tests/data/filtergraphs/iamf_7_1_4 tests/data/streamgroups/audio_element-7_1_4 
tests/data/streamgroups/mix_presentation-7_1_4
@@ -229,7 +231,8 @@ fate-mov-mp4-iamf-7_1_4: CMD = transcode wav $(SRC) mp4 
"-auto_conversion_filter
   -/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_7_1_4 \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-7_1_4 \
   -/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-7_1_4 
\
-  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 
-streamid 5:5 -streamid 6:6 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] 
-map [SIDE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0"
+  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 
-streamid 5:5 -streamid 6:6 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] 
-map [SIDE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" 
\
+  "-show_entries 
stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
 
 FATE_MOV_FFMPEG-$(call TRANSCODE, FLAC, MOV, WAV_DEMUXER PCM_S16LE_DECODER) += 
fate-mov-mp4-iamf-ambisonic_1
 fate-mov-mp4-iamf-ambisonic_1: tests/data/asynth-44100-4.wav 
tests/data/filtergraphs/iamf_ambisonic_1 
tests/data/streamgroups/audio_element-ambisonic_1 
tests/data/streamgroups/mix_presentation-ambisonic_1
@@ -238,7 +241,8 @@ fate-mov-mp4-iamf-ambisonic_1: CMD = transcode wav $(SRC) 
mp4 "-auto_conversion_
   -/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_ambisonic_1 \
   -/stream_group 
$(TARGET_PATH)/tests/data/streamgroups/audio_element-ambisonic_1 \
   -/stream_group 
$(TARGET_PATH)/tests/data/streamgroups/mix_presentation-ambisonic_1 \
-  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -map [MONO0] -map 
[MONO1] -map [MONO2] -map [MONO3] -c:a flac -t 1" "-c:a copy -map 0"
+  -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -map [MONO0] -map 
[MONO1] -map [MONO2] -map [MONO3] -c:a flac -t 1" "-c:a copy -map 0" \
+  "-show_entries 
stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
 
 FATE_FFMPEG += $(FATE_MOV_FFMPEG-yes)
 
diff --git a/tests/ref/fate/mov-mp4-iamf-5_1_4 
b/tests/ref/fate/mov-mp4-iamf-5_1_4
index 2f29a83cf4..fde95296eb 100644
--- a/tests/ref/fate/mov-mp4-iamf-5_1_4
+++ b/tests/ref/fate/mov-mp4-iamf-5_1_4
@@ -96,3 +96,321 @@
 3,  4

[FFmpeg-devel] [PATCH 6/8] avformat/mov: don't mark an item referenced by a grid as dependent if it's the primary item

2024-03-03 Thread James Almer
If it's the primary item, then it's expected to be ready for presentation even
outside of the grid it belongs to.

Signed-off-by: James Almer 
---
 libavformat/mov.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7a09017020..f0e98f38b5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -9443,7 +9443,8 @@ static int mov_parse_tiles(AVFormatContext *s)
 if (err < 0 && err != AVERROR(EEXIST))
 return err;
 
-st->disposition |= AV_DISPOSITION_DEPENDENT;
+if (item->item_id != mov->primary_item_id)
+st->disposition |= AV_DISPOSITION_DEPENDENT;
 break;
 }
 
-- 
2.44.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 7/8] fate/mov: print stream group information for avif/heic tests

2024-03-03 Thread James Almer
Signed-off-by: James Almer 
---
 tests/fate-run.sh |  13 ++
 tests/fate/mov.mak|  12 +-
 .../ref/fate/mov-heic-demux-still-image-grid  | 133 --
 .../ref/fate/mov-heic-demux-still-image-iovl  |  81 +--
 4 files changed, 215 insertions(+), 24 deletions(-)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 7a7344e645..2de560354f 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -272,6 +272,19 @@ transcode(){
 run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tencfile || 
return
 }
 
+stream_demux(){
+src_fmt=$1
+srcfile=$2
+src_opts=$3
+enc_opts=$4
+ffprobe_opts=$5
+tsrcfile=$(target_path $srcfile)
+ffmpeg $DEC_OPTS -f $src_fmt $src_opts -i $tsrcfile $ENC_OPTS $FLAGS 
$enc_opts \
+-f framecrc - || return
+test -z "$ffprobe_opts" || \
+run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tsrcfile || 
return
+}
+
 stream_remux(){
 src_fmt=$1
 srcfile=$2
diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index de0e654532..9d0bdd0078 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -161,13 +161,17 @@ FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, HEVC, 
HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-multiple-items
 fate-mov-heic-demux-still-image-multiple-items: CMD = framemd5 -i 
$(TARGET_SAMPLES)/heif-conformance/C003.heic -c:v copy -map 0
 
-FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \
+# heic demuxing - still image with multiple items in a grid.
+FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER 
HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-grid
-fate-mov-heic-demux-still-image-grid: CMD = framemd5 -i 
$(TARGET_SAMPLES)/heif-conformance/C007.heic -c:v copy -map 0:g:0
+fate-mov-heic-demux-still-image-grid: CMD = stream_demux mov 
$(TARGET_SAMPLES)/heif-conformance/C007.heic "" "-c:v copy -map 0:g:0" \
+  "-show_entries 
stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
 
-FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \
+# heic demuxing - still image with multiple items in an overlay canvas.
+FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER 
HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-iovl
-fate-mov-heic-demux-still-image-iovl: CMD = framemd5 -i 
$(TARGET_SAMPLES)/heif-conformance/C015.heic -c:v copy -map 0:g:0
+fate-mov-heic-demux-still-image-iovl: CMD = stream_demux mov 
$(TARGET_SAMPLES)/heif-conformance/C015.heic "" "-c:v copy -map 0:g:0" \
+  "-show_entries 
stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
 
 # Resulting remux should have:
 # 1. first audio stream with AV_DISPOSITION_HEARING_IMPAIRED
diff --git a/tests/ref/fate/mov-heic-demux-still-image-grid 
b/tests/ref/fate/mov-heic-demux-still-image-grid
index 6fde8fff28..b15ce91e1a 100644
--- a/tests/ref/fate/mov-heic-demux-still-image-grid
+++ b/tests/ref/fate/mov-heic-demux-still-image-grid
@@ -1,10 +1,7 @@
-#format: frame checksums
-#version: 2
-#hash: MD5
-#extradata 0, 100, 5444bf01e03182c73ae957179d560f4d
-#extradata 1, 100, 5444bf01e03182c73ae957179d560f4d
-#extradata 2, 100, 5444bf01e03182c73ae957179d560f4d
-#extradata 3, 100, 5444bf01e03182c73ae957179d560f4d
+#extradata 0:  100, 0xee3e15e9
+#extradata 1:  100, 0xee3e15e9
+#extradata 2:  100, 0xee3e15e9
+#extradata 3:  100, 0xee3e15e9
 #tb 0: 1/1
 #media_type 0: video
 #codec_id 0: hevc
@@ -25,8 +22,120 @@
 #codec_id 3: hevc
 #dimensions 3: 1280x720
 #sar 3: 0/1
-#stream#, dts,pts, duration, size, hash
-0,  0,  0,1,   111554, 03ceabfab39afd2e2e796b9362111f32
-1,  0,  0,1,   111481, e5db978adbe4de7ee50fe73abc39fcfa
-2,  0,  0,1,   111451, 08700213113cadbb6628ecb8253c1c2a
-3,  0,  0,1,   111353, 5de942e14c848e5e22fad5d88fb13776
+0,  0,  0,1,   111554, 0xa0679859
+1,  0,  0,1,   111481, 0xc5386eaf
+2,  0,  0,1,   111451, 0xdbde88de
+3,  0,  0,1,   111353, 0x26435c8c
+[STREAM_GROUP]
+index=0
+id=0x3f1
+nb_streams=4
+type=Tile Grid
+DISPOSITION:default=1
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:non_diegetic=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION

[FFmpeg-devel] [PATCH 8/8] fate/mov: use framecrc for the remaining avif/heic tests

2024-03-03 Thread James Almer
Put them in sync with the other tests.

Signed-off-by: James Almer 
---
 tests/fate/mov.mak| 21 ++-
 .../fate/mov-avif-demux-still-image-1-item|  8 ++-
 .../mov-avif-demux-still-image-multiple-items |  8 ++-
 .../fate/mov-heic-demux-still-image-1-item|  8 ++-
 .../mov-heic-demux-still-image-multiple-items | 12 ---
 5 files changed, 21 insertions(+), 36 deletions(-)

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 9d0bdd0078..e5e372d062 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -143,23 +143,24 @@ fate-mov-mp4-ttml-stpp: CMD = transcode srt 
$(TARGET_SAMPLES)/sub/SubRip_capabil
 fate-mov-mp4-ttml-dfxp: CMD = transcode srt 
$(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt mp4 "-map 0:s -c:s ttml 
-time_base:s 1:1000 -tag:s dfxp -strict unofficial" "-map 0 -c copy" "-of json 
-show_entries 
packet:stream=index,codec_type,codec_tag_string,codec_tag,codec_name,time_base,start_time,duration_ts,duration,nb_frames,nb_read_packets:stream_tags"
 
 # avif demuxing - still image with 1 item.
-FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, AV1, AV1_PARSER) \
+FATE_MOV_FFMPEG_SAMPLES-$(call FRAMECRC, MOV, AV1, AV1_PARSER) \
+= fate-mov-avif-demux-still-image-1-item
-fate-mov-avif-demux-still-image-1-item: CMD = framemd5 -c:v av1 -i 
$(TARGET_SAMPLES)/avif/still_image.avif -c:v copy
+fate-mov-avif-demux-still-image-1-item: CMD = framecrc -c:v av1 -i 
$(TARGET_SAMPLES)/avif/still_image.avif -c:v copy
 
-# avif demuxing - still image with multiple items. only the primary item will 
be
-# parsed.
-FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, AV1, AV1_PARSER) \
+# avif demuxing - still image with multiple items.
+FATE_MOV_FFMPEG_SAMPLES-$(call FRAMECRC, MOV, AV1, AV1_PARSER) \
+= fate-mov-avif-demux-still-image-multiple-items
-fate-mov-avif-demux-still-image-multiple-items: CMD = framemd5 -c:v av1 -i 
$(TARGET_SAMPLES)/avif/still_image_exif.avif -c:v copy
+fate-mov-avif-demux-still-image-multiple-items: CMD = framecrc -c:v av1 -i 
$(TARGET_SAMPLES)/avif/still_image_exif.avif -c:v copy
 
-FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \
+# heic demuxing - still image with 1 item.
+FATE_MOV_FFMPEG_SAMPLES-$(call FRAMECRC, MOV, HEVC, HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-1-item
-fate-mov-heic-demux-still-image-1-item: CMD = framemd5 -i 
$(TARGET_SAMPLES)/heif-conformance/C002.heic -c:v copy
+fate-mov-heic-demux-still-image-1-item: CMD = framecrc -i 
$(TARGET_SAMPLES)/heif-conformance/C002.heic -c:v copy
 
-FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \
+# heic demuxing - still image with multiple items.
+FATE_MOV_FFMPEG_SAMPLES-$(call FRAMECRC, MOV, HEVC, HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-multiple-items
-fate-mov-heic-demux-still-image-multiple-items: CMD = framemd5 -i 
$(TARGET_SAMPLES)/heif-conformance/C003.heic -c:v copy -map 0
+fate-mov-heic-demux-still-image-multiple-items: CMD = framecrc -i 
$(TARGET_SAMPLES)/heif-conformance/C003.heic -c:v copy -map 0
 
 # heic demuxing - still image with multiple items in a grid.
 FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER 
HEVC_PARSER) \
diff --git a/tests/ref/fate/mov-avif-demux-still-image-1-item 
b/tests/ref/fate/mov-avif-demux-still-image-1-item
index 1ead593caa..0108877d10 100644
--- a/tests/ref/fate/mov-avif-demux-still-image-1-item
+++ b/tests/ref/fate/mov-avif-demux-still-image-1-item
@@ -1,11 +1,7 @@
-#format: frame checksums
-#version: 2
-#hash: MD5
-#extradata 0,   4, b24b71499a8480fa4469bcbcba2140aa
+#extradata 0:4, 0x021c008d
 #tb 0: 1/1
 #media_type 0: video
 #codec_id 0: av1
 #dimensions 0: 352x288
 #sar 0: 0/1
-#stream#, dts,pts, duration, size, hash
-0,  0,  0,1,36265, 235b0c6e389c4084845981e08d60db04
+0,  0,  0,1,36265, 0x6c8c9941
diff --git a/tests/ref/fate/mov-avif-demux-still-image-multiple-items 
b/tests/ref/fate/mov-avif-demux-still-image-multiple-items
index 1ead593caa..0108877d10 100644
--- a/tests/ref/fate/mov-avif-demux-still-image-multiple-items
+++ b/tests/ref/fate/mov-avif-demux-still-image-multiple-items
@@ -1,11 +1,7 @@
-#format: frame checksums
-#version: 2
-#hash: MD5
-#extradata 0,   4, b24b71499a8480fa4469bcbcba2140aa
+#extradata 0:4, 0x021c008d
 #tb 0: 1/1
 #media_type 0: video
 #codec_id 0: av1
 #dimensions 0: 352x288
 #sar 0: 0/1
-#stream#, dts,pts, duration, size, hash
-0,  0,  0,1,36265, 235b0c6e389c4084845981e08d60db04
+0,  0,  0,1,36265, 0x6c8c9941
diff --git a/tests/ref/fate/mov-heic-demux-still-image-1-item 
b/tests/ref/fate/mov-heic-demux-still-image-1-item
index c850c1ff9c..63ee5e492e 100644
--- a/tests/ref/fate/mov-heic-demux-st

[FFmpeg-devel] [PATCH 1/8] avutil/vulkan: Don't autoinclude vulkan_loader.h

2024-03-03 Thread Andreas Rheinhardt
Only include it where necessary.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/vulkan_decode.c  | 1 +
 libavfilter/vulkan_filter.c | 1 +
 libavutil/vulkan.c  | 1 -
 libavutil/vulkan.h  | 1 -
 4 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 5def908a21..2448ee99ec 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -21,6 +21,7 @@
 #include "vulkan_decode.h"
 #include "config_components.h"
 #include "libavutil/avassert.h"
+#include "libavutil/vulkan_loader.h"
 
 #if CONFIG_H264_VULKAN_HWACCEL
 extern const VkExtensionProperties ff_vk_dec_h264_ext;
diff --git a/libavfilter/vulkan_filter.c b/libavfilter/vulkan_filter.c
index c77415d1be..d3dc2fdacb 100644
--- a/libavfilter/vulkan_filter.c
+++ b/libavfilter/vulkan_filter.c
@@ -19,6 +19,7 @@
  */
 
 #include "vulkan_filter.h"
+#include "libavutil/vulkan_loader.h"
 
 int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s,
   AVBufferRef *frames_ref,
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index bf8456b06d..76b61dcaaa 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -21,7 +21,6 @@
 #include "avassert.h"
 
 #include "vulkan.h"
-#include "vulkan_loader.h"
 
 const VkComponentMapping ff_comp_identity_map = {
 .r = VK_COMPONENT_SWIZZLE_IDENTITY,
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h
index a5e78760d7..184d58ff5c 100644
--- a/libavutil/vulkan.h
+++ b/libavutil/vulkan.h
@@ -29,7 +29,6 @@
 #include "hwcontext.h"
 #include "vulkan_functions.h"
 #include "hwcontext_vulkan.h"
-#include "vulkan_loader.h"
 
 /* GLSL management macros */
 #define INDENT(N) INDENT_##N
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 2/8] avutil/vulkan_loader: Avoid redundant strings and relocations

2024-03-03 Thread Andreas Rheinhardt
There are three possible names for the functions requested;
they only differ in an extension: "", "EXT" or "KHR".
Yet vk_load_info contained pointers to all these strings.
This is wasteful and this commit changes it to avoid
the latter two strings. This saves 6353B of strings,
1776 B of .data.rel.ro as well as 5328 B due to the removed
relocations (corresponding to 2 * 111 removed pointers)
in lavc/vulkan_decode.o alone (ff_vk_load_functions()
is inlined in lavfi/vulkan_filter.c, lavu/hwcontext_vulkan.c
and lavc_vulkan_decode.c, so the savings are three times
this for shared builds; for static builds, the number may
be smaller depending upon whether strings are deduplicated).

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/vulkan_loader.h | 25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h
index f88722f28f..07b6316089 100644
--- a/libavutil/vulkan_loader.h
+++ b/libavutil/vulkan_loader.h
@@ -19,6 +19,9 @@
 #ifndef AVUTIL_VULKAN_LOADER_H
 #define AVUTIL_VULKAN_LOADER_H
 
+#include 
+
+#include "avassert.h"
 #include "vulkan_functions.h"
 
 /* Macro to turn a function name into a loader struct */
@@ -28,7 +31,7 @@
 req_dev, \
 offsetof(FFVulkanFunctions, name),   \
 ext_flag,\
-{ "vk"#name, "vk"#name"EXT", "vk"#name"KHR" }\
+"vk"#name,   \
 },
 
 static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions,
@@ -98,7 +101,7 @@ static inline int ff_vk_load_functions(AVHWDeviceContext 
*ctx,
 int req_dev;
 size_t struct_offset;
 FFVulkanExtensions ext_flag;
-const char *names[3];
+const char *name;
 } vk_load_info[] = {
 FN_LIST(PFN_LOAD_INFO)
 #ifdef _WIN32
@@ -108,6 +111,8 @@ static inline int ff_vk_load_functions(AVHWDeviceContext 
*ctx,
 
 for (int i = 0; i < FF_ARRAY_ELEMS(vk_load_info); i++) {
 const struct FunctionLoadInfo *load = &vk_load_info[i];
+static const char extensions[][4] = { "", "EXT", "KHR" };
+const char *name = load->name;
 PFN_vkVoidFunction fn;
 
 if (load->req_dev  && !has_dev)
@@ -115,15 +120,19 @@ static inline int ff_vk_load_functions(AVHWDeviceContext 
*ctx,
 if (load->req_inst && !has_inst)
 continue;
 
-for (int j = 0; j < FF_ARRAY_ELEMS(load->names); j++) {
-const char *name = load->names[j];
+for (int j = 0; j < FF_ARRAY_ELEMS(extensions); j++) {
+char ext_name[128];
+av_unused int n;
+
+n = snprintf(ext_name, sizeof(ext_name), "%s%s", name, 
extensions[j]);
+av_assert1(n < sizeof(ext_name));
 
 if (load->req_dev)
-fn = vk->GetDeviceProcAddr(hwctx->act_dev, name);
+fn = vk->GetDeviceProcAddr(hwctx->act_dev, ext_name);
 else if (load->req_inst)
-fn = hwctx->get_proc_addr(hwctx->inst, name);
+fn = hwctx->get_proc_addr(hwctx->inst, ext_name);
 else
-fn = hwctx->get_proc_addr(NULL, name);
+fn = hwctx->get_proc_addr(NULL, ext_name);
 
 if (fn)
 break;
@@ -131,7 +140,7 @@ static inline int ff_vk_load_functions(AVHWDeviceContext 
*ctx,
 
 if (!fn && ((extensions_mask &~ FF_VK_EXT_NO_FLAG) & load->ext_flag)) {
 av_log(ctx, AV_LOG_ERROR, "Loader error, function \"%s\" indicated 
"
-   "as supported, but got NULL function pointer!\n", 
load->names[0]);
+   "as supported, but got NULL function pointer!\n", name);
 return AVERROR_EXTERNAL;
 }
 
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 3/8] avutil/vulkan_loader: Use smaller types

2024-03-03 Thread Andreas Rheinhardt
Saves 16B per entry here (four of these 16 bytes are padding);
leads to 1776 B of savings in each file that uses
ff_vk_load_functions().

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/vulkan_loader.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h
index 07b6316089..37ce339e1d 100644
--- a/libavutil/vulkan_loader.h
+++ b/libavutil/vulkan_loader.h
@@ -97,9 +97,9 @@ static inline int ff_vk_load_functions(AVHWDeviceContext *ctx,
 AVVulkanDeviceContext *hwctx = ctx->hwctx;
 
 static const struct FunctionLoadInfo {
-int req_inst;
-int req_dev;
-size_t struct_offset;
+char req_inst;
+char req_dev;
+uint16_t struct_offset;
 FFVulkanExtensions ext_flag;
 const char *name;
 } vk_load_info[] = {
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 4/8] avutil/vulkan_loader: Avoid relocations for strings

2024-03-03 Thread Andreas Rheinhardt
To do so, concatenate all the names together to one big string
name1\0name2\0lastname\0\0. This avoids the pointer in
the FunctionLoadInfo structure and thereby moves vk_load_info
into .rodata (and makes it smaller by 888B).

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/vulkan_loader.h | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h
index 37ce339e1d..f9e739e1e3 100644
--- a/libavutil/vulkan_loader.h
+++ b/libavutil/vulkan_loader.h
@@ -31,7 +31,6 @@
 req_dev, \
 offsetof(FFVulkanFunctions, name),   \
 ext_flag,\
-"vk"#name,   \
 },
 
 static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions,
@@ -101,18 +100,26 @@ static inline int ff_vk_load_functions(AVHWDeviceContext 
*ctx,
 char req_dev;
 uint16_t struct_offset;
 FFVulkanExtensions ext_flag;
-const char *name;
 } vk_load_info[] = {
 FN_LIST(PFN_LOAD_INFO)
 #ifdef _WIN32
 FN_LIST_WIN32(PFN_LOAD_INFO)
 #endif
 };
+// Concatenate the names to avoid relocations. The resulting string
+// will end with \0\0
+#define FUNC_NAME(req_inst, req_dev, ext_flag, name) "vk"#name"\0"
+const char *name =
+FN_LIST(FUNC_NAME)
+#ifdef _WIN32
+FN_LIST_WIN32(FUNC_NAME)
+#endif
+;
+#undef FUNC_NAME
 
-for (int i = 0; i < FF_ARRAY_ELEMS(vk_load_info); i++) {
+for (int i = 0; i < FF_ARRAY_ELEMS(vk_load_info); name += strlen(name) + 
1, i++) {
 const struct FunctionLoadInfo *load = &vk_load_info[i];
 static const char extensions[][4] = { "", "EXT", "KHR" };
-const char *name = load->name;
 PFN_vkVoidFunction fn;
 
 if (load->req_dev  && !has_dev)
@@ -146,6 +153,7 @@ static inline int ff_vk_load_functions(AVHWDeviceContext 
*ctx,
 
 *(PFN_vkVoidFunction *)((uint8_t *)vk + load->struct_offset) = fn;
 }
+av_assert1(*name == '\0');
 
 return 0;
 }
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 5/8] avutil/vulkan: Avoid shadowing

2024-03-03 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/vulkan.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 76b61dcaaa..4392a77d6c 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -1308,13 +1308,15 @@ void ff_vk_frame_barrier(FFVulkanContext *s, 
FFVkExecContext *e,
  VkImageLayoutnew_layout,
  uint32_t new_qf)
 {
-int i, found;
+int found = -1;
 AVVkFrame *vkf = (AVVkFrame *)pic->data[0];
 const int nb_images = ff_vk_count_images(vkf);
-for (i = 0; i < e->nb_frame_deps; i++)
-if (e->frame_deps[i]->data[0] == pic->data[0])
+for (int i = 0; i < e->nb_frame_deps; i++)
+if (e->frame_deps[i]->data[0] == pic->data[0]) {
+if (e->frame_update[i])
+found = i;
 break;
-found = (i < e->nb_frame_deps) && (e->frame_update[i]) ? i : -1;
+}
 
 for (int i = 0; i < nb_images; i++) {
 bar[*nb_bar] = (VkImageMemoryBarrier2) {
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 6/8] avutil/vulkan: Make ff_vk_set_descriptor_image() static

2024-03-03 Thread Andreas Rheinhardt
Only used in vulkan.c.

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/vulkan.c | 11 ++-
 libavutil/vulkan.h |  3 ---
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 4392a77d6c..c725634fef 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -1659,9 +1659,10 @@ int ff_vk_set_descriptor_sampler(FFVulkanContext *s, 
FFVulkanPipeline *pl,
 return 0;
 }
 
-int ff_vk_set_descriptor_image(FFVulkanContext *s, FFVulkanPipeline *pl,
-   FFVkExecContext *e, int set, int bind, int offs,
-   VkImageView view, VkImageLayout layout, 
VkSampler sampler)
+static int vk_set_descriptor_image(FFVulkanContext *s, FFVulkanPipeline *pl,
+   FFVkExecContext *e, int set, int bind, int 
offs,
+   VkImageView view, VkImageLayout layout,
+   VkSampler sampler)
 {
 FFVulkanDescriptorSet *desc_set = &pl->desc_set[set];
 VkDescriptorGetInfoEXT desc_get_info = {
@@ -1758,8 +1759,8 @@ void ff_vk_update_descriptor_img_array(FFVulkanContext 
*s, FFVulkanPipeline *pl,
 const int nb_planes = av_pix_fmt_count_planes(hwfc->sw_format);
 
 for (int i = 0; i < nb_planes; i++)
-ff_vk_set_descriptor_image(s, pl, e, set, binding, i,
-   views[i], layout, sampler);
+vk_set_descriptor_image(s, pl, e, set, binding, i,
+views[i], layout, sampler);
 }
 
 void ff_vk_update_push_exec(FFVulkanContext *s, FFVkExecContext *e,
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h
index 184d58ff5c..c04a43e278 100644
--- a/libavutil/vulkan.h
+++ b/libavutil/vulkan.h
@@ -485,9 +485,6 @@ void ff_vk_exec_bind_pipeline(FFVulkanContext *s, 
FFVkExecContext *e,
 int ff_vk_set_descriptor_sampler(FFVulkanContext *s, FFVulkanPipeline *pl,
  FFVkExecContext *e, int set, int bind, int 
offs,
  VkSampler *sampler);
-int ff_vk_set_descriptor_image(FFVulkanContext *s, FFVulkanPipeline *pl,
-   FFVkExecContext *e, int set, int bind, int offs,
-   VkImageView view, VkImageLayout layout, 
VkSampler sampler);
 int ff_vk_set_descriptor_buffer(FFVulkanContext *s, FFVulkanPipeline *pl,
 FFVkExecContext *e, int set, int bind, int 
offs,
 VkDeviceAddress addr, VkDeviceSize len, 
VkFormat fmt);
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 7/8] avutil/vulkan: Remove unused ff_vk_set_descriptor_sampler()

2024-03-03 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/vulkan.c | 27 ---
 libavutil/vulkan.h |  4 
 2 files changed, 31 deletions(-)

diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index c725634fef..67b9526255 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -1632,33 +1632,6 @@ static inline void update_set_descriptor(FFVulkanContext 
*s, FFVkExecContext *e,
 vk->GetDescriptorEXT(s->hwctx->act_dev, desc_get_info, desc_size, desc);
 }
 
-int ff_vk_set_descriptor_sampler(FFVulkanContext *s, FFVulkanPipeline *pl,
- FFVkExecContext *e, int set, int bind, int 
offs,
- VkSampler *sampler)
-{
-FFVulkanDescriptorSet *desc_set = &pl->desc_set[set];
-VkDescriptorGetInfoEXT desc_get_info = {
-.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT,
-.type = desc_set->binding[bind].descriptorType,
-};
-
-switch (desc_get_info.type) {
-case VK_DESCRIPTOR_TYPE_SAMPLER:
-desc_get_info.data.pSampler = sampler;
-break;
-default:
-av_log(s, AV_LOG_ERROR, "Invalid descriptor type at set %i binding %i: 
%i!\n",
-   set, bind, desc_get_info.type);
-return AVERROR(EINVAL);
-break;
-};
-
-update_set_descriptor(s, e, desc_set, bind, offs, &desc_get_info,
-  s->desc_buf_props.samplerDescriptorSize);
-
-return 0;
-}
-
 static int vk_set_descriptor_image(FFVulkanContext *s, FFVulkanPipeline *pl,
FFVkExecContext *e, int set, int bind, int 
offs,
VkImageView view, VkImageLayout layout,
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h
index c04a43e278..15d954fcb8 100644
--- a/libavutil/vulkan.h
+++ b/libavutil/vulkan.h
@@ -481,10 +481,6 @@ int ff_vk_exec_pipeline_register(FFVulkanContext *s, 
FFVkExecPool *pool,
 void ff_vk_exec_bind_pipeline(FFVulkanContext *s, FFVkExecContext *e,
   FFVulkanPipeline *pl);
 
-/* Update sampler/image/buffer descriptors. e may be NULL for read-only 
descriptors. */
-int ff_vk_set_descriptor_sampler(FFVulkanContext *s, FFVulkanPipeline *pl,
- FFVkExecContext *e, int set, int bind, int 
offs,
- VkSampler *sampler);
 int ff_vk_set_descriptor_buffer(FFVulkanContext *s, FFVulkanPipeline *pl,
 FFVkExecContext *e, int set, int bind, int 
offs,
 VkDeviceAddress addr, VkDeviceSize len, 
VkFormat fmt);
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 8/8] avutil/vulkan: Move functions only used by lavfi to it

2024-03-03 Thread Andreas Rheinhardt
lavu/vulkan.c is duplicated into lavfi, lavc and lavu,
yet lots of functions in it are only used by lavfi.
This commit moves them to lavfi, saving 6544B of .text
from both lavc and lavu as well as some .rodata and
.data.rel.ro (in total 7880B each for lavc and lavu).

Signed-off-by: Andreas Rheinhardt 
---
One could also move this stuff to new files; e.g. both the shader
and pipeline parts could be moved into files of their own
which would then only be compiled for lavfi.

 libavfilter/vulkan_filter.c  | 764 +++
 libavfilter/vulkan_filter.h  | 177 
 libavfilter/vulkan_glslang.c |   1 +
 libavfilter/vulkan_shaderc.c |   1 +
 libavutil/vulkan.c   | 760 --
 libavutil/vulkan.h   | 176 
 6 files changed, 943 insertions(+), 936 deletions(-)

diff --git a/libavfilter/vulkan_filter.c b/libavfilter/vulkan_filter.c
index d3dc2fdacb..c354087dbc 100644
--- a/libavfilter/vulkan_filter.c
+++ b/libavfilter/vulkan_filter.c
@@ -19,6 +19,10 @@
  */
 
 #include "vulkan_filter.h"
+#include "libavutil/bprint.h"
+#include "libavutil/buffer.h"
+#include "libavutil/mem.h"
+#include "libavutil/pixdesc.h"
 #include "libavutil/vulkan_loader.h"
 
 int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s,
@@ -457,3 +461,763 @@ fail:
 ff_vk_exec_discard_deps(vkctx, exec);
 return err;
 }
+
+static void free_data_buf(void *opaque, uint8_t *data)
+{
+FFVulkanContext *ctx = opaque;
+FFVkBuffer *buf = (FFVkBuffer *)data;
+ff_vk_free_buf(ctx, buf);
+av_free(data);
+}
+
+static AVBufferRef *alloc_data_buf(void *opaque, size_t size)
+{
+AVBufferRef *ref;
+uint8_t *buf = av_mallocz(size);
+if (!buf)
+return NULL;
+
+ref = av_buffer_create(buf, size, free_data_buf, opaque, 0);
+if (!ref)
+av_free(buf);
+return ref;
+}
+
+int ff_vk_get_pooled_buffer(FFVulkanContext *ctx, AVBufferPool **buf_pool,
+AVBufferRef **buf, VkBufferUsageFlags usage,
+void *create_pNext, size_t size,
+VkMemoryPropertyFlagBits mem_props)
+{
+int err;
+AVBufferRef *ref;
+FFVkBuffer *data;
+
+if (!(*buf_pool)) {
+*buf_pool = av_buffer_pool_init2(sizeof(FFVkBuffer), ctx,
+ alloc_data_buf, NULL);
+if (!(*buf_pool))
+return AVERROR(ENOMEM);
+}
+
+*buf = ref = av_buffer_pool_get(*buf_pool);
+if (!ref)
+return AVERROR(ENOMEM);
+
+data = (FFVkBuffer *)ref->data;
+data->stage = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT;
+data->access = VK_ACCESS_2_NONE;
+
+if (data->size >= size)
+return 0;
+
+ff_vk_free_buf(ctx, data);
+memset(data, 0, sizeof(*data));
+
+av_log(ctx, AV_LOG_DEBUG, "Allocating buffer of %"SIZE_SPECIFIER" bytes 
for pool %p\n",
+   size, *buf_pool);
+
+err = ff_vk_create_buf(ctx, data, size,
+   create_pNext, NULL, usage,
+   mem_props);
+if (err < 0) {
+av_buffer_unref(&ref);
+return err;
+}
+
+if (mem_props & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
+err = ff_vk_map_buffer(ctx, data, &data->mapped_mem, 0);
+if (err < 0) {
+av_buffer_unref(&ref);
+return err;
+}
+}
+
+return 0;
+}
+
+int ff_vk_add_push_constant(FFVulkanPipeline *pl, int offset, int size,
+VkShaderStageFlagBits stage)
+{
+VkPushConstantRange *pc;
+
+pl->push_consts = av_realloc_array(pl->push_consts, 
sizeof(*pl->push_consts),
+   pl->push_consts_num + 1);
+if (!pl->push_consts)
+return AVERROR(ENOMEM);
+
+pc = &pl->push_consts[pl->push_consts_num++];
+memset(pc, 0, sizeof(*pc));
+
+pc->stageFlags = stage;
+pc->offset = offset;
+pc->size = size;
+
+return 0;
+}
+
+int ff_vk_init_sampler(FFVulkanContext *s, VkSampler *sampler,
+   int unnorm_coords, VkFilter filt)
+{
+VkResult ret;
+FFVulkanFunctions *vk = &s->vkfn;
+
+VkSamplerCreateInfo sampler_info = {
+.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
+.magFilter = filt,
+.minFilter = sampler_info.magFilter,
+.mipmapMode = unnorm_coords ? VK_SAMPLER_MIPMAP_MODE_NEAREST :
+  VK_SAMPLER_MIPMAP_MODE_LINEAR,
+.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
+.addressModeV = sampler_info.addressModeU,
+.addressModeW = sampler_info.addressModeU,
+.anisotropyEnable = VK_FALSE,
+.compareOp = VK_COMPARE_OP_NEVER,
+.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK,
+.unnormalizedCoordinates = unnorm_coords,
+};
+
+ret = vk->CreateSampler(s->hwctx->act_dev, &sampler_info,
+s->hwctx->alloc, sampler);
+if (ret != VK_SUCCESS) {

Re: [FFmpeg-devel] [PATCH 1/4] avcodec/lpc: Don't use AAC defines directly

2024-03-03 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> It leads to defines for the AAC decoder being included
> outside of the AAC decoder.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/aac_defines.h | 11 +--
>  libavcodec/aacdec_fixed.c|  2 +-
>  libavcodec/aacdec_template.c |  2 +-
>  libavcodec/lpc.h | 27 ++-
>  4 files changed, 29 insertions(+), 13 deletions(-)
> 
> diff --git a/libavcodec/aac_defines.h b/libavcodec/aac_defines.h
> index 59528f1f0d..8765939731 100644
> --- a/libavcodec/aac_defines.h
> +++ b/libavcodec/aac_defines.h
> @@ -71,7 +71,15 @@ typedef int AAC_SIGNE;
>((int64_t)(y) * (z)) + \
>  0x4000) >> 31)
>  #define AAC_HALF_SUM(x, y)  (((x) >> 1) + ((y) >> 1))
> -#define AAC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))
> +
> +#ifdef LPC_USE_FIXED
> +#error aac_defines.h must be included before lpc.h for fixed point decoder
> +#endif
> +
> +#define LPC_USE_FIXED 1
> +#define LPC_MUL26(x, y) AAC_MUL26((x), (y))
> +#define LPC_FIXR(x) FIXR(x)
> +#define LPC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))
>  
>  #else
>  
> @@ -103,7 +111,6 @@ typedef unsignedAAC_SIGNE;
> (c) * (d) - (e) * (f))
>  #define AAC_MSUB31_V3(x, y, z)((x) - (y)) * (z)
>  #define AAC_HALF_SUM(x, y)  ((x) + (y)) * 0.5f
> -#define AAC_SRA_R(x, y) (x)
>  
>  #endif /* USE_FIXED */
>  
> diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
> index 57d3fc8bab..08343bf157 100644
> --- a/libavcodec/aacdec_fixed.c
> +++ b/libavcodec/aacdec_fixed.c
> @@ -66,7 +66,6 @@
>  #include "avcodec.h"
>  #include "codec_internal.h"
>  #include "get_bits.h"
> -#include "lpc.h"
>  #include "kbdwin.h"
>  #include "sinewin_fixed_tablegen.h"
>  
> @@ -76,6 +75,7 @@
>  #include "aacdectab.h"
>  #include "adts_header.h"
>  #include "cbrt_data.h"
> +#include "lpc.h"
>  #include "sbr.h"
>  #include "aacsbr.h"
>  #include "mpeg4audio.h"
> diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
> index 72c6e206a6..fb3a954aad 100644
> --- a/libavcodec/aacdec_template.c
> +++ b/libavcodec/aacdec_template.c
> @@ -2516,7 +2516,7 @@ static void apply_tns(INTFLOAT coef_param[1024], 
> TemporalNoiseShaping *tns,
>  continue;
>  
>  // tns_decode_coef
> -AAC_RENAME(compute_lpc_coefs)(tns->coef[w][filt], order, lpc, 0, 
> 0, 0);
> +compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0);
>  
>  start = ics->swb_offset[FFMIN(bottom, mmm)];
>  end   = ics->swb_offset[FFMIN(   top, mmm)];
> diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h
> index 0200baea5c..907fab7508 100644
> --- a/libavcodec/lpc.h
> +++ b/libavcodec/lpc.h
> @@ -26,7 +26,6 @@
>  #include 
>  #include "libavutil/avassert.h"
>  #include "libavutil/lls.h"
> -#include "aac_defines.h"
>  
>  #define ORDER_METHOD_EST 0
>  #define ORDER_METHOD_2LEVEL  1
> @@ -117,10 +116,20 @@ void ff_lpc_init_x86(LPCContext *s);
>   */
>  void ff_lpc_end(LPCContext *s);
>  
> -#if USE_FIXED
> +#ifndef LPC_USE_FIXED
> +#define LPC_USE_FIXED 0
> +#endif
> +
> +#if LPC_USE_FIXED
>  typedef int LPC_TYPE;
>  typedef unsigned LPC_TYPE_U;
>  #else
> +#ifndef LPC_SRA_R
> +#define LPC_SRA_R(x, y) (x)
> +#define LPC_MUL26(x, y) ((x) * (y))
> +#define LPC_FIXR(x) ((float)(x))
> +#endif
> +
>  #ifdef LPC_USE_DOUBLE
>  typedef double LPC_TYPE;
>  typedef double LPC_TYPE_U;
> @@ -145,7 +154,7 @@ static inline void compute_ref_coefs(const LPC_TYPE 
> *autoc, int max_order,
>  gen0[i] = gen1[i] = autoc[i + 1];
>  
>  err= autoc[0];
> -ref[0] = -gen1[0] / ((USE_FIXED || err) ? err : 1);
> +ref[0] = -gen1[0] / ((LPC_USE_FIXED || err) ? err : 1);
>  err   +=  gen1[0] * ref[0];
>  if (error)
>  error[0] = err;
> @@ -154,7 +163,7 @@ static inline void compute_ref_coefs(const LPC_TYPE 
> *autoc, int max_order,
>  gen1[j] = gen1[j + 1] + ref[i - 1] * gen0[j];
>  gen0[j] = gen1[j + 1] * ref[i - 1] + gen0[j];
>  }
> -ref[i] = -gen1[0] / ((USE_FIXED || err) ? err : 1);
> +ref[i] = -gen1[0] / ((LPC_USE_FIXED || err) ? err : 1);
>  err   +=  gen1[0] * ref[i];
>  if (error)
>  error[i] = err;
> @@ -165,7 +174,7 @@ static inline void compute_ref_coefs(const LPC_TYPE 
> *autoc, int max_order,
>   * Levinson-Durbin recursion.
>   * Produce LPC coefficients from autocorrelation data.
>   */
> -static inline int AAC_RENAME(compute_lpc_coefs)(const LPC_TYPE *autoc, int 
> max_order,
> +static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order,
>  LPC_TYPE *lpc, int lpc_stride, int fail,
>  int normalize)
>  {
> @@ -182,7 +191,7 @@ static inline int AAC_RENAME(compute_lpc_coefs)(const 
> LPC_TYPE *autoc, in

[FFmpeg-devel] Inquiry Regarding "Update SITI Filter to Match with Latest Specification" Project and Qualification Task

2024-03-03 Thread Divyansh Khatri
I hope this message finds you well. My name is Divyansh, and I am reaching
out to express my interest in the project titled "Update SITI Filter to
Match with Latest Specification" listed in Ideas list of FFmpeg 2024 GSOC(
link

).
I would appreciate a mentor's guidance regarding the qualification task
mentioned in the project description, I would like your advice on selecting
an appropriate bug to fix in the existing filter and how can I start
working on it for my GSOC proposal for FFmpeg?

Best regards
Divyansh
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 7/8 v2] fate/mov: print stream group information for avif/heic tests

2024-03-03 Thread James Almer
Signed-off-by: James Almer 
---
 tests/fate-run.sh |  13 ++
 tests/fate/mov.mak|  12 +-
 .../ref/fate/mov-heic-demux-still-image-grid  | 140 --
 .../ref/fate/mov-heic-demux-still-image-iovl  |  88 ++-
 4 files changed, 229 insertions(+), 24 deletions(-)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 7a7344e645..2de560354f 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -272,6 +272,19 @@ transcode(){
 run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tencfile || 
return
 }
 
+stream_demux(){
+src_fmt=$1
+srcfile=$2
+src_opts=$3
+enc_opts=$4
+ffprobe_opts=$5
+tsrcfile=$(target_path $srcfile)
+ffmpeg $DEC_OPTS -f $src_fmt $src_opts -i $tsrcfile $ENC_OPTS $FLAGS 
$enc_opts \
+-f framecrc - || return
+test -z "$ffprobe_opts" || \
+run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tsrcfile || 
return
+}
+
 stream_remux(){
 src_fmt=$1
 srcfile=$2
diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index de0e654532..e1d45e495f 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -161,13 +161,17 @@ FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, HEVC, 
HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-multiple-items
 fate-mov-heic-demux-still-image-multiple-items: CMD = framemd5 -i 
$(TARGET_SAMPLES)/heif-conformance/C003.heic -c:v copy -map 0
 
-FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \
+# heic demuxing - still image with multiple items in a grid.
+FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER 
HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-grid
-fate-mov-heic-demux-still-image-grid: CMD = framemd5 -i 
$(TARGET_SAMPLES)/heif-conformance/C007.heic -c:v copy -map 0:g:0
+fate-mov-heic-demux-still-image-grid: CMD = stream_demux mov 
$(TARGET_SAMPLES)/heif-conformance/C007.heic "" "-c:v copy -map 0:g:0" \
+  "-show_entries 
stream_group=index,id,nb_streams,type,nb_tiles,coded_width,coded_height,horizontal_offset,vertical_offset,width,height:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
 
-FATE_MOV_FFMPEG_SAMPLES-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \
+# heic demuxing - still image with multiple items in an overlay canvas.
+FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER 
HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-iovl
-fate-mov-heic-demux-still-image-iovl: CMD = framemd5 -i 
$(TARGET_SAMPLES)/heif-conformance/C015.heic -c:v copy -map 0:g:0
+fate-mov-heic-demux-still-image-iovl: CMD = stream_demux mov 
$(TARGET_SAMPLES)/heif-conformance/C015.heic "" "-c:v copy -map 0:g:0" \
+  "-show_entries 
stream_group=index,id,nb_streams,type,nb_tiles,coded_width,coded_height,horizontal_offset,vertical_offset,width,height:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
 
 # Resulting remux should have:
 # 1. first audio stream with AV_DISPOSITION_HEARING_IMPAIRED
diff --git a/tests/ref/fate/mov-heic-demux-still-image-grid 
b/tests/ref/fate/mov-heic-demux-still-image-grid
index 6fde8fff28..df82c3254a 100644
--- a/tests/ref/fate/mov-heic-demux-still-image-grid
+++ b/tests/ref/fate/mov-heic-demux-still-image-grid
@@ -1,10 +1,7 @@
-#format: frame checksums
-#version: 2
-#hash: MD5
-#extradata 0, 100, 5444bf01e03182c73ae957179d560f4d
-#extradata 1, 100, 5444bf01e03182c73ae957179d560f4d
-#extradata 2, 100, 5444bf01e03182c73ae957179d560f4d
-#extradata 3, 100, 5444bf01e03182c73ae957179d560f4d
+#extradata 0:  100, 0xee3e15e9
+#extradata 1:  100, 0xee3e15e9
+#extradata 2:  100, 0xee3e15e9
+#extradata 3:  100, 0xee3e15e9
 #tb 0: 1/1
 #media_type 0: video
 #codec_id 0: hevc
@@ -25,8 +22,127 @@
 #codec_id 3: hevc
 #dimensions 3: 1280x720
 #sar 3: 0/1
-#stream#, dts,pts, duration, size, hash
-0,  0,  0,1,   111554, 03ceabfab39afd2e2e796b9362111f32
-1,  0,  0,1,   111481, e5db978adbe4de7ee50fe73abc39fcfa
-2,  0,  0,1,   111451, 08700213113cadbb6628ecb8253c1c2a
-3,  0,  0,1,   111353, 5de942e14c848e5e22fad5d88fb13776
+0,  0,  0,1,   111554, 0xa0679859
+1,  0,  0,1,   111481, 0xc5386eaf
+2,  0,  0,1,   111451, 0xdbde88de
+3,  0,  0,1,   111353, 0x26435c8c
+[STREAM_GROUP]
+index=0
+id=0x3f1
+nb_streams=4
+type=Tile Grid
+nb_tiles=4
+coded_width=2560
+coded_height=1440
+horizontal_offset=0
+vertical_offset=0
+width=2560
+height=1440
+DISPOSITION:default=1
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:

[FFmpeg-devel] [PATCH] doc/demuxers: emphasize that DVD demuxer does not do decryption

2024-03-03 Thread Marth64
Signed-off-by: Marth64 
---
 doc/demuxers.texi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 905828d852..f4bac8f3b3 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -295,6 +295,9 @@ into a conversion pipeline. Menus and seeking are not 
supported at this time.
 Block devices (DVD drives), ISO files, and directory structures are accepted.
 Activate with @code{-f dvdvideo} in front of one of these inputs.
 
+This demuxer does NOT have decryption code of any kind. You are on your own
+working with encrypted DVDs, and should not expect support on the matter.
+
 Underlying playback is handled by libdvdnav, and structure parsing by 
libdvdread.
 FFmpeg must be built with GPL library support available as well as the
 configure switches @code{--enable-libdvdnav} and @code{--enable-libdvdread}.
-- 
2.34.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 15/38] lavu/opt: add array options

2024-03-03 Thread Marton Balint



On Sun, 3 Mar 2024, James Almer wrote:


On 3/3/2024 12:53 PM, Diederick C. Niehorster wrote:

 On Sun, Mar 3, 2024 at 3:55 PM Anton Khirnov  wrote:


 Quoting Marton Balint (2024-02-26 20:38:46)

 The more I think about it, it is actually a broader problem.

 You are changing the semantics of existing AV_OPT_TYPE_xxx types. So
 previously an option with AV_OPT_TYPE_STRING used to have default value

 in

 default_val.str. After your patch, it will be either default_val.str, or
 default_val.str[1], based on if it is an array or not.

 I think the API user safely assumed that if the option type is known to
 him, he will always find the default value in the relevant default_val
 field. It is actually a bigger issue for an array of AV_OPT_TYPE_INT,
 because previously to get the default value AVOption->default_val.i64

 was

 used, and now .str[1] should be instead...


 In my view the semantics of default_val (and offset) are only defined
 when declaring options on your own object, not when accessing those
 fields when declared by some other code. I also see no good reason for
 any user to read these fields.



 I disagree. Here an example: for a GUI using some part of ffmpeg and
 wanting to give the user some control over the ffmpeg operation, it would
 not be strange to be able to set options and either indicate which values
 are default, or have a "reset to defaults" button. I have written such a
 thing (not yet opensourced).


There's av_opt_set_defaults() to set default values, then 
av_opt_is_set_to_default() and av_opt_is_set_to_default_by_name() to check if 
an option is already set to the default value.


What Anton said is that the user has no need to access the fields directly 
when there are helpers explicitly documented for this purpose.


The AVOption struct is public, and the default_val field is public too. 
There is nothing that warns the user not to access it. The fact that there 
are helper functions does not change this.


But it is not the default values that is a problem. The semantic change is 
the problem. I could have had a code which iterates through every AVOption 
of an object and prints the values with type AV_OPT_TYPE_INT. Your change 
will suddently break that, because arrays will also have the type of 
AV_OPT_TYPE_INT.


So can you please introduce a new option type for arrays?

Thanks,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] web: Add spi.txt

2024-03-03 Thread Michael Niedermayer
On Sun, Mar 03, 2024 at 05:36:41PM +0100, Stefano Sabatini wrote:
> On date Tuesday 2024-02-27 20:01:26 +0100, Michael Niedermayer wrote:
> > This explains how to request refunds and what can be funded by SPI
> > 
> > Co-Author: Stefano Sabatini 
> > ---
> >  Makefile   |  2 +-
> >  src/spi| 98 ++
> >  src/spi_js |  0
> >  src/spi_title  |  1 +
> >  src/template_head2 |  1 +
> >  5 files changed, 101 insertions(+), 1 deletion(-)
> >  create mode 100644 src/spi
> >  create mode 100644 src/spi_js
> >  create mode 100644 src/spi_title
> > 
> > diff --git a/Makefile b/Makefile
> > index 0686e44..dd681e4 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1,7 +1,7 @@
> >  # ffmpeg.org HTML generation from source files
> >  
> >  SRCS = about bugreports consulting contact donations documentation 
> > download \
> > -   olddownload index legal shame security archive
> > +   olddownload index legal shame security spi archive
> >  
> >  HTML_TARGETS  = $(addsuffix .html,$(addprefix htdocs/,$(SRCS)))
> >  
> > diff --git a/src/spi b/src/spi
> > new file mode 100644
> > index 000..8fffc7f
> > --- /dev/null
> > +++ b/src/spi
> > @@ -0,0 +1,98 @@
> > +
> > +SPI (Software in the Public Interest) is a non-profit corporation
> > +registered in the state of New York founded to act as a fiscal sponsor
> > +for organizations that develop open source software and hardware. For
> > +details check here:
> > +https://www.spi-inc.org/";>www.spi-inc.org
> > +
> > +
> > +
> > +FFmpeg is an SPI associated project and donations can be collected and
> > +handled by SPI on behalf of FFmpeg. For details about the association
> > +check here:
> > + > href="https://www.spi-inc.org/projects/ffmpeg/";>www.spi-inc.org/projects/ffmpeg/
> > +
> > +
> > +
> > +
> > +How to request refunds from SPI:
> > +
> > +Send a mail to ffmpeg-devel with the [REFUND-REQUEST] tag and a short
> > +description of the refund topic in the subject.
> > +
> > +
> > +
> > +In the mail, you also need to provide the amount to be refunded, with
> > +a short description of how the money was spent.
> > +
> > +
> > +
> > +There is no need and is not recommeded to send receipts when sending
> > +the refund request on the ffmpeg-devel mailing-list, but they are
> > +usually needed later when the request is approved and the refund
> > +request is sent to SPI:
> > + > href="https://www.spi-inc.org/treasurer/reimbursement-form/";>www.spi-inc.org/treasurer/reimbursement-form
> > +
> > +
> > +
> > +What can be payed by SPI:
> > +
> 
> > +FFmpeg money collected at SPI can be used for any purpose which is in line 
> > with
> > +501(c)3 nonprofit rules, and within our mission (Free & OSS software).
> 
> Free & Open Source software?
> 
> > +
> > +
> > +
> > +In practice we frequently payed for travel and hardware.
> > +For other refund expenses or sponsorships, it is recommended to
> 
> > +discuss them beforehand on ffmpeg-devel. If there is a community
> > +agreement on their approval, the current FFmpeg liaison will followup
> > +to get an approval on the SPI side.
> > +
> > +
> > +
> > +
> > +Funding active development by SPI:
> > +
> > +The texts below have been taken from multiple replies FFmpeg has
> > +received from SPI, they have been edited
> > +so that "I" was replaced by "SPI" in some cases.)
> > +
> > +
> > +Paying for development *does* require substantial
> > +additional paperwork, but it is not prohibited.
> > +
> > +
> > +Several SPI projects pay contractors for development
> > +efforts.  SPI needs a contract in place which describes the work to be
> > +done.  There are also various things SPI needs to check about the potential
> > +contractors(e.g. are they a US person or not, as with GSoC mentor payments;
> 
> contractors_(
> 
> > +are they really a contractor and not a employee).
> > +
> > +
> > +SPI can't deal with employment at the moment because that involves a
> > +lot of work, like health insurance, tax withholding, etc.  Contractors
> > +are easier because they have to take care of that themselves; Whether
> > +someone is a contractor vs employee depends on various factors (that
> > +of course are different in every country) and can be disputed (see
> > +e.g. the debate about whether Uber drivers are employees); SPI has a
> > +questionnaire about their circumstances.
> > +
> > +
> > +Unfortunately, there's no one-size-fits all when dealing with
> 
> one-size-fits-all ?
> 
> > +contractors, especially without knowing the contributor's country.
> > +
> 
> > +
> > +SPI does have some contract templates which depends on the contractors
> > +country. In case of US, Australia, France and a couple others
> > +countries, SPI can easily provide them, otherwise SPI would need to
> > +ask their attorney to draft one, which would take some time
> 
> add missing "."
> 
> > +
> > +
> > +Also, SPI has two models, MSA (which transfers ownership) and CSA (which
> > +grants a license ins

Re: [FFmpeg-devel] [PATCH] web: Add spi.txt

2024-03-03 Thread Lynne
Mar 3, 2024, 22:08 by mich...@niedermayer.cc:

> On Sun, Mar 03, 2024 at 05:36:41PM +0100, Stefano Sabatini wrote:
>
>> On date Tuesday 2024-02-27 20:01:26 +0100, Michael Niedermayer wrote:
>> > This explains how to request refunds and what can be funded by SPI
>> > 
>> > Co-Author: Stefano Sabatini 
>> > ---
>> >  Makefile   |  2 +-
>> >  src/spi| 98 ++
>> >  src/spi_js |  0
>> >  src/spi_title  |  1 +
>> >  src/template_head2 |  1 +
>> >  5 files changed, 101 insertions(+), 1 deletion(-)
>> >  create mode 100644 src/spi
>> >  create mode 100644 src/spi_js
>> >  create mode 100644 src/spi_title
>> > 
>> > diff --git a/Makefile b/Makefile
>> > index 0686e44..dd681e4 100644
>> > --- a/Makefile
>> > +++ b/Makefile
>> > @@ -1,7 +1,7 @@
>> >  # ffmpeg.org HTML generation from source files
>> > 
>> >  SRCS = about bugreports consulting contact donations documentation 
>> > download \
>> > -   olddownload index legal shame security archive
>> > +   olddownload index legal shame security spi archive
>> > 
>> >  HTML_TARGETS  = $(addsuffix .html,$(addprefix htdocs/,$(SRCS)))
>> > 
>> > diff --git a/src/spi b/src/spi
>> > new file mode 100644
>> > index 000..8fffc7f
>> > --- /dev/null
>> > +++ b/src/spi
>> > @@ -0,0 +1,98 @@
>> > +
>> > +SPI (Software in the Public Interest) is a non-profit corporation
>> > +registered in the state of New York founded to act as a fiscal sponsor
>> > +for organizations that develop open source software and hardware. For
>> > +details check here:
>> > +https://www.spi-inc.org/";>www.spi-inc.org
>> > +
>> > +
>> > +
>> > +FFmpeg is an SPI associated project and donations can be collected and
>> > +handled by SPI on behalf of FFmpeg. For details about the association
>> > +check here:
>> > +> > href="https://www.spi-inc.org/projects/ffmpeg/";>www.spi-inc.org/projects/ffmpeg/
>> > +
>> > +
>> > +
>> > +
>> > +How to request refunds from SPI:
>> > +
>> > +Send a mail to ffmpeg-devel with the [REFUND-REQUEST] tag and a short
>> > +description of the refund topic in the subject.
>> > +
>> > +
>> > +
>> > +In the mail, you also need to provide the amount to be refunded, with
>> > +a short description of how the money was spent.
>> > +
>> > +
>> > +
>> > +There is no need and is not recommeded to send receipts when sending
>> > +the refund request on the ffmpeg-devel mailing-list, but they are
>> > +usually needed later when the request is approved and the refund
>> > +request is sent to SPI:
>> > +> > href="https://www.spi-inc.org/treasurer/reimbursement-form/";>www.spi-inc.org/treasurer/reimbursement-form
>> > +
>> > +
>> > +
>> > +What can be payed by SPI:
>> > +
>>
>> > +FFmpeg money collected at SPI can be used for any purpose which is in 
>> > line with
>> > +501(c)3 nonprofit rules, and within our mission (Free & OSS software).
>>
>> Free & Open Source software?
>>
>> > +
>> > +
>> > +
>> > +In practice we frequently payed for travel and hardware.
>> > +For other refund expenses or sponsorships, it is recommended to
>>
>> > +discuss them beforehand on ffmpeg-devel. If there is a community
>> > +agreement on their approval, the current FFmpeg liaison will followup
>> > +to get an approval on the SPI side.
>> > +
>> > +
>> > +
>> > +
>> > +Funding active development by SPI:
>> > +
>> > +The texts below have been taken from multiple replies FFmpeg has
>> > +received from SPI, they have been edited
>> > +so that "I" was replaced by "SPI" in some cases.)
>> > +
>> > +
>> > +Paying for development *does* require substantial
>> > +additional paperwork, but it is not prohibited.
>> > +
>> > +
>> > +Several SPI projects pay contractors for development
>> > +efforts.  SPI needs a contract in place which describes the work to be
>> > +done.  There are also various things SPI needs to check about the 
>> > potential
>> > +contractors(e.g. are they a US person or not, as with GSoC mentor 
>> > payments;
>>
>> contractors_(
>>
>> > +are they really a contractor and not a employee).
>> > +
>> > +
>> > +SPI can't deal with employment at the moment because that involves a
>> > +lot of work, like health insurance, tax withholding, etc.  Contractors
>> > +are easier because they have to take care of that themselves; Whether
>> > +someone is a contractor vs employee depends on various factors (that
>> > +of course are different in every country) and can be disputed (see
>> > +e.g. the debate about whether Uber drivers are employees); SPI has a
>> > +questionnaire about their circumstances.
>> > +
>> > +
>> > +Unfortunately, there's no one-size-fits all when dealing with
>>
>> one-size-fits-all ?
>>
>> > +contractors, especially without knowing the contributor's country.
>> > +
>>
>> > +
>> > +SPI does have some contract templates which depends on the contractors
>> > +country. In case of US, Australia, France and a couple others
>> > +countries, SPI can easily provide them, otherwise SPI would need to
>> > +ask their 

Re: [FFmpeg-devel] [PATCH] web: Add spi.txt

2024-03-03 Thread Michael Niedermayer
On Sun, Mar 03, 2024 at 10:29:59PM +0100, Lynne wrote:
> Mar 3, 2024, 22:08 by mich...@niedermayer.cc:
> 
> > On Sun, Mar 03, 2024 at 05:36:41PM +0100, Stefano Sabatini wrote:
> >
> >> On date Tuesday 2024-02-27 20:01:26 +0100, Michael Niedermayer wrote:
> >> > This explains how to request refunds and what can be funded by SPI
> >> > 
> >> > Co-Author: Stefano Sabatini 
> >> > ---
> >> >  Makefile   |  2 +-
> >> >  src/spi| 98 ++
> >> >  src/spi_js |  0
> >> >  src/spi_title  |  1 +
> >> >  src/template_head2 |  1 +
> >> >  5 files changed, 101 insertions(+), 1 deletion(-)
> >> >  create mode 100644 src/spi
> >> >  create mode 100644 src/spi_js
> >> >  create mode 100644 src/spi_title
> >> > 
> >> > diff --git a/Makefile b/Makefile
> >> > index 0686e44..dd681e4 100644
> >> > --- a/Makefile
> >> > +++ b/Makefile
> >> > @@ -1,7 +1,7 @@
> >> >  # ffmpeg.org HTML generation from source files
> >> > 
> >> >  SRCS = about bugreports consulting contact donations documentation 
> >> > download \
> >> > -   olddownload index legal shame security archive
> >> > +   olddownload index legal shame security spi archive
> >> > 
> >> >  HTML_TARGETS  = $(addsuffix .html,$(addprefix htdocs/,$(SRCS)))
> >> > 
> >> > diff --git a/src/spi b/src/spi
> >> > new file mode 100644
> >> > index 000..8fffc7f
> >> > --- /dev/null
> >> > +++ b/src/spi
> >> > @@ -0,0 +1,98 @@
> >> > +
> >> > +SPI (Software in the Public Interest) is a non-profit corporation
> >> > +registered in the state of New York founded to act as a fiscal sponsor
> >> > +for organizations that develop open source software and hardware. For
> >> > +details check here:
> >> > +https://www.spi-inc.org/";>www.spi-inc.org
> >> > +
> >> > +
> >> > +
> >> > +FFmpeg is an SPI associated project and donations can be collected and
> >> > +handled by SPI on behalf of FFmpeg. For details about the association
> >> > +check here:
> >> > + >> > href="https://www.spi-inc.org/projects/ffmpeg/";>www.spi-inc.org/projects/ffmpeg/
> >> > +
> >> > +
> >> > +
> >> > +
> >> > +How to request refunds from SPI:
> >> > +
> >> > +Send a mail to ffmpeg-devel with the [REFUND-REQUEST] tag and a short
> >> > +description of the refund topic in the subject.
> >> > +
> >> > +
> >> > +
> >> > +In the mail, you also need to provide the amount to be refunded, with
> >> > +a short description of how the money was spent.
> >> > +
> >> > +
> >> > +
> >> > +There is no need and is not recommeded to send receipts when sending
> >> > +the refund request on the ffmpeg-devel mailing-list, but they are
> >> > +usually needed later when the request is approved and the refund
> >> > +request is sent to SPI:
> >> > + >> > href="https://www.spi-inc.org/treasurer/reimbursement-form/";>www.spi-inc.org/treasurer/reimbursement-form
> >> > +
> >> > +
> >> > +
> >> > +What can be payed by SPI:
> >> > +
> >>
> >> > +FFmpeg money collected at SPI can be used for any purpose which is in 
> >> > line with
> >> > +501(c)3 nonprofit rules, and within our mission (Free & OSS software).
> >>
> >> Free & Open Source software?
> >>
> >> > +
> >> > +
> >> > +
> >> > +In practice we frequently payed for travel and hardware.
> >> > +For other refund expenses or sponsorships, it is recommended to
> >>
> >> > +discuss them beforehand on ffmpeg-devel. If there is a community
> >> > +agreement on their approval, the current FFmpeg liaison will followup
> >> > +to get an approval on the SPI side.
> >> > +
> >> > +
> >> > +
> >> > +
> >> > +Funding active development by SPI:
> >> > +
> >> > +The texts below have been taken from multiple replies FFmpeg has
> >> > +received from SPI, they have been edited
> >> > +so that "I" was replaced by "SPI" in some cases.)
> >> > +
> >> > +
> >> > +Paying for development *does* require substantial
> >> > +additional paperwork, but it is not prohibited.
> >> > +
> >> > +
> >> > +Several SPI projects pay contractors for development
> >> > +efforts.  SPI needs a contract in place which describes the work to be
> >> > +done.  There are also various things SPI needs to check about the 
> >> > potential
> >> > +contractors(e.g. are they a US person or not, as with GSoC mentor 
> >> > payments;
> >>
> >> contractors_(
> >>
> >> > +are they really a contractor and not a employee).
> >> > +
> >> > +
> >> > +SPI can't deal with employment at the moment because that involves a
> >> > +lot of work, like health insurance, tax withholding, etc.  Contractors
> >> > +are easier because they have to take care of that themselves; Whether
> >> > +someone is a contractor vs employee depends on various factors (that
> >> > +of course are different in every country) and can be disputed (see
> >> > +e.g. the debate about whether Uber drivers are employees); SPI has a
> >> > +questionnaire about their circumstances.
> >> > +
> >> > +
> >> > +Unfortunately, there's no one-size-fits all when dealing with
> >>
> >> one-size-fits-all ?
> >

Re: [FFmpeg-devel] [PATCH 1/4] avcodec/lpc: Don't use AAC defines directly

2024-03-03 Thread Lynne
Mar 3, 2024, 19:43 by andreas.rheinha...@outlook.com:

> Andreas Rheinhardt:
>
>> It leads to defines for the AAC decoder being included
>> outside of the AAC decoder.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>  libavcodec/aac_defines.h | 11 +--
>>  libavcodec/aacdec_fixed.c|  2 +-
>>  libavcodec/aacdec_template.c |  2 +-
>>  libavcodec/lpc.h | 27 ++-
>>  4 files changed, 29 insertions(+), 13 deletions(-)
>>
>> diff --git a/libavcodec/aac_defines.h b/libavcodec/aac_defines.h
>> index 59528f1f0d..8765939731 100644
>> --- a/libavcodec/aac_defines.h
>> +++ b/libavcodec/aac_defines.h
>> @@ -71,7 +71,15 @@ typedef int AAC_SIGNE;
>>  ((int64_t)(y) * (z)) + \
>>  0x4000) >> 31)
>>  #define AAC_HALF_SUM(x, y)  (((x) >> 1) + ((y) >> 1))
>> -#define AAC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))
>> +
>> +#ifdef LPC_USE_FIXED
>> +#error aac_defines.h must be included before lpc.h for fixed point decoder
>> +#endif
>> +
>> +#define LPC_USE_FIXED 1
>> +#define LPC_MUL26(x, y) AAC_MUL26((x), (y))
>> +#define LPC_FIXR(x) FIXR(x)
>> +#define LPC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))
>>  
>>  #else
>>  
>> @@ -103,7 +111,6 @@ typedef unsignedAAC_SIGNE;
>>  (c) * (d) - (e) * (f))
>>  #define AAC_MSUB31_V3(x, y, z)((x) - (y)) * (z)
>>  #define AAC_HALF_SUM(x, y)  ((x) + (y)) * 0.5f
>> -#define AAC_SRA_R(x, y) (x)
>>  
>>  #endif /* USE_FIXED */
>>  
>> diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
>> index 57d3fc8bab..08343bf157 100644
>> --- a/libavcodec/aacdec_fixed.c
>> +++ b/libavcodec/aacdec_fixed.c
>> @@ -66,7 +66,6 @@
>>  #include "avcodec.h"
>>  #include "codec_internal.h"
>>  #include "get_bits.h"
>> -#include "lpc.h"
>>  #include "kbdwin.h"
>>  #include "sinewin_fixed_tablegen.h"
>>  
>> @@ -76,6 +75,7 @@
>>  #include "aacdectab.h"
>>  #include "adts_header.h"
>>  #include "cbrt_data.h"
>> +#include "lpc.h"
>>  #include "sbr.h"
>>  #include "aacsbr.h"
>>  #include "mpeg4audio.h"
>> diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
>> index 72c6e206a6..fb3a954aad 100644
>> --- a/libavcodec/aacdec_template.c
>> +++ b/libavcodec/aacdec_template.c
>> @@ -2516,7 +2516,7 @@ static void apply_tns(INTFLOAT coef_param[1024], 
>> TemporalNoiseShaping *tns,
>>  continue;
>>  
>>  // tns_decode_coef
>> -AAC_RENAME(compute_lpc_coefs)(tns->coef[w][filt], order, lpc, 
>> 0, 0, 0);
>> +compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0);
>>  
>>  start = ics->swb_offset[FFMIN(bottom, mmm)];
>>  end   = ics->swb_offset[FFMIN(   top, mmm)];
>> diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h
>> index 0200baea5c..907fab7508 100644
>> --- a/libavcodec/lpc.h
>> +++ b/libavcodec/lpc.h
>> @@ -26,7 +26,6 @@
>>  #include 
>>  #include "libavutil/avassert.h"
>>  #include "libavutil/lls.h"
>> -#include "aac_defines.h"
>>  
>>  #define ORDER_METHOD_EST 0
>>  #define ORDER_METHOD_2LEVEL  1
>> @@ -117,10 +116,20 @@ void ff_lpc_init_x86(LPCContext *s);
>>  */
>>  void ff_lpc_end(LPCContext *s);
>>  
>> -#if USE_FIXED
>> +#ifndef LPC_USE_FIXED
>> +#define LPC_USE_FIXED 0
>> +#endif
>> +
>> +#if LPC_USE_FIXED
>>  typedef int LPC_TYPE;
>>  typedef unsigned LPC_TYPE_U;
>>  #else
>> +#ifndef LPC_SRA_R
>> +#define LPC_SRA_R(x, y) (x)
>> +#define LPC_MUL26(x, y) ((x) * (y))
>> +#define LPC_FIXR(x) ((float)(x))
>> +#endif
>> +
>>  #ifdef LPC_USE_DOUBLE
>>  typedef double LPC_TYPE;
>>  typedef double LPC_TYPE_U;
>> @@ -145,7 +154,7 @@ static inline void compute_ref_coefs(const LPC_TYPE 
>> *autoc, int max_order,
>>  gen0[i] = gen1[i] = autoc[i + 1];
>>  
>>  err= autoc[0];
>> -ref[0] = -gen1[0] / ((USE_FIXED || err) ? err : 1);
>> +ref[0] = -gen1[0] / ((LPC_USE_FIXED || err) ? err : 1);
>>  err   +=  gen1[0] * ref[0];
>>  if (error)
>>  error[0] = err;
>> @@ -154,7 +163,7 @@ static inline void compute_ref_coefs(const LPC_TYPE 
>> *autoc, int max_order,
>>  gen1[j] = gen1[j + 1] + ref[i - 1] * gen0[j];
>>  gen0[j] = gen1[j + 1] * ref[i - 1] + gen0[j];
>>  }
>> -ref[i] = -gen1[0] / ((USE_FIXED || err) ? err : 1);
>> +ref[i] = -gen1[0] / ((LPC_USE_FIXED || err) ? err : 1);
>>  err   +=  gen1[0] * ref[i];
>>  if (error)
>>  error[i] = err;
>> @@ -165,7 +174,7 @@ static inline void compute_ref_coefs(const LPC_TYPE 
>> *autoc, int max_order,
>>  * Levinson-Durbin recursion.
>>  * Produce LPC coefficients from autocorrelation data.
>>  */
>> -static inline int AAC_RENAME(compute_lpc_coefs)(const LPC_TYPE *autoc, int 
>> max_order,
>> +static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order,
>>  LPC_TYPE *lpc, int lpc_stride, int fail,
>>  int normalize)
>>  {
>> @@ -182,7 +191,7 @@ static inline int AAC_RENAME(compute_lpc_coefs)(const 
>> LPC_TYPE *autoc, int max_o
>>  return -1;
>>  
>>  for(i=0; i> -LPC_TYPE r = AAC_SRA_R(-autoc[i], 5);
>> +LPC_TYPE r = LPC_SRA_R(-autoc[i], 5);
>

Re: [FFmpeg-devel] [PATCH 8/8] avutil/vulkan: Move functions only used by lavfi to it

2024-03-03 Thread Lynne
Mar 3, 2024, 19:42 by andreas.rheinha...@outlook.com:

> lavu/vulkan.c is duplicated into lavfi, lavc and lavu,
> yet lots of functions in it are only used by lavfi.
> This commit moves them to lavfi, saving 6544B of .text
> from both lavc and lavu as well as some .rodata and
> .data.rel.ro (in total 7880B each for lavc and lavu).
>
> Signed-off-by: Andreas Rheinhardt 
> ---
> One could also move this stuff to new files; e.g. both the shader
> and pipeline parts could be moved into files of their own
> which would then only be compiled for lavfi.
>
>  libavfilter/vulkan_filter.c  | 764 +++
>  libavfilter/vulkan_filter.h  | 177 
>  libavfilter/vulkan_glslang.c |   1 +
>  libavfilter/vulkan_shaderc.c |   1 +
>  libavutil/vulkan.c   | 760 --
>  libavutil/vulkan.h   | 176 
>  6 files changed, 943 insertions(+), 936 deletions(-)
>

Patchset LGTM, except, sadly, the last commit.
We will need to implement shader-based film grain
application as Intel hardware does not support it,
so most of the functions will be used.
Also, a GSoC project I have to implement shader-based
encoders also depends on this code.

6k is a lot, but anyone serious about weight should
be using LTO, which would get rid of it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [RFC] clarifying the TC conflict of interest rule

2024-03-03 Thread Anton Khirnov
Quoting Michael Niedermayer (2024-03-03 03:49:33)
> Hi
> 
> On Fri, Mar 01, 2024 at 06:33:12PM +0100, Anton Khirnov wrote:
> > Hi all,
> > it seems the discussion died down,
> 
> There are patches pending, which i will apply soon if no objections
> have been raised.

I object to these patches. This way of hijacking discussion is just
rude.

> And noone owns law texts.

These patches are not law texts, they are documentation. Authorship and
copyright apply to them, same as to code.

> Everyone can propose any derivation
> of anothers suggestion. Thats the idea behind evolution and improvment
> and the idea behind finding and dicussing variations.

But the problem is not about ownership, but rather about telling people
"stop discussing here and instead go to some other thread and comment on
those other patches".

There seems to be a wide consensus that we have a fundamental
disagreement here and the best way to resolve it is through a vote. It
also seems to me that you keep trying to derail the vote, for unclear
reasons.

> Please add the vote options: (I belive this gives the people a more
> complete set of choices)

Why do you feel you need to bestow all these options upon "the people"?
If "the people" wanted these options, they would have asked for them.
Again, it seems like you are trying to derail the vote.

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 1/5] avcodec/parser: merge packets from the same frame

2024-03-03 Thread Michael Niedermayer
On Fri, Mar 01, 2024 at 02:39:19PM +0100, Nicolas Gaullier wrote:
> The mpegts demuxer splits packets according to its max_packet_size.
> This currently fills the AVCodecParserContext s->cur_frame_* arrays with
> kind of 'empty' entries: no pts/dts.
> This patch merges these entries, so the parser behaviour is independent
> from the demuxer settings.
> This patch is required for the following patch which will fetch 'past'
> timestamps from past cur_frames.
> 
> Signed-off-by: Nicolas Gaullier 
> ---
>  libavcodec/parser.c | 4 
>  1 file changed, 4 insertions(+)

Breaks fate-seek-lavf-as


--- ./tests/ref/seek/lavf-asf   2024-02-28 23:42:14.743496132 +0100
+++ tests/data/fate/seek-lavf-asf   2024-03-03 23:06:08.850893410 +0100
@@ -1,53 +0,0 @@
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st:-1 flags:0  ts:-1.00
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st:-1 flags:1  ts: 1.894167
-ret: 0 st: 1 flags:1 dts: 0.47 pts: 0.47 pos: 147893 size:   
209
-ret: 0 st: 0 flags:0  ts: 0.788000
-ret: 0 st: 1 flags:1 dts: 0.47 pts: 0.47 pos: 147893 size:   
209
-ret: 0 st: 0 flags:1  ts:-0.317000
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st: 1 flags:0  ts: 2.577000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330293 size:   
209
-ret: 0 st: 1 flags:1  ts: 1.471000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330293 size:   
209
-ret: 0 st:-1 flags:0  ts: 0.365002
-ret: 0 st: 1 flags:1 dts: 0.47 pts: 0.47 pos: 147893 size:   
209
-ret: 0 st:-1 flags:1  ts:-0.740831
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st: 0 flags:0  ts: 2.153000
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301493 size:   
209
-ret: 0 st: 0 flags:1  ts: 1.048000
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301493 size:   
209
-ret: 0 st: 1 flags:0  ts:-0.058000
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st: 1 flags:1  ts: 2.836000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330293 size:   
209
-ret: 0 st:-1 flags:0  ts: 1.730004
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301493 size:   
209
-ret: 0 st:-1 flags:1  ts: 0.624171
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st: 0 flags:0  ts:-0.482000
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st: 0 flags:1  ts: 2.413000
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301493 size:   
209
-ret: 0 st: 1 flags:0  ts: 1.307000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330293 size:   
209
-ret: 0 st: 1 flags:1  ts: 0.201000
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st:-1 flags:0  ts:-0.904994
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st:-1 flags:1  ts: 1.989173
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301493 size:   
209
-ret: 0 st: 0 flags:0  ts: 0.883000
-ret: 0 st: 1 flags:1 dts: 0.47 pts: 0.47 pos: 147893 size:   
209
-ret: 0 st: 0 flags:1  ts:-0.222000
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
-ret: 0 st: 1 flags:0  ts: 2.672000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330293 size:   
209
-ret: 0 st: 1 flags:1  ts: 1.566000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330293 size:   
209
-ret: 0 st:-1 flags:0  ts: 0.460008
-ret: 0 st: 1 flags:1 dts: 0.47 pts: 0.47 pos: 147893 size:   
209
-ret: 0 st:-1 flags:1  ts:-0.645825
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:693 size:   
208
Test seek-lavf-asf failed. Look at tests/data/fate/seek-lavf-asf.err for 
details.
[asf @ 0x5623c91f8280] asf_read_pts failed
[asf @ 0x5623c91f8280] asf_read_pts failed
[asf @ 0x5623c91f8280] asf_read_pts failed
[asf @ 0x5623c91f8280] asf_read_pts failed
[asf @ 0x5623c91f8280] asf_read_pts failed
[asf @ 0x5623c91f8280] asf_read_pts failed
[asf @ 0x5623c91f8280] asf_read_pts failed
[asf @ 0x5623c91f8280] asf_read_pts failed
Assertion pkt->pos == asf_st->packet_pos failed at libavformat/asfdec_f.c:1478
Aborted (core dumped)
threads=1
tests/Makefile:318: recipe for target 'fate-seek-lavf-asf' failed
make: *** [fate-seek-lavf-asf] Error 134

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he 

[FFmpeg-devel] [PATCH] avformat/options: Deprecate av_fmt_ctx_get_duration_estimation_method()

2024-03-03 Thread Andreas Rheinhardt
Forgotten in b7785d10b00c88029d8af7dbddac09ab0d6f2b7f.

Signed-off-by: Andreas Rheinhardt 
---
 doc/APIchanges  | 4 
 libavformat/avformat.h  | 4 
 libavformat/options.c   | 2 ++
 libavformat/version_major.h | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index 7d46ebb006..a72ec3553e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2024-03-03 - xx - lavf 60.xx.100 - avformat.h
+  Deprecate av_fmt_ctx_get_duration_estimation_method().
+  The relevant field is public and needs no getter to access.
+
 2024-02-28 - xx - swr   4.14.100 - swresample.h
   swr_convert() now accepts arrays of const pointers (to input and output).
 
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index f4506f4cf1..af064b4dbb 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2008,12 +2008,16 @@ typedef struct AVFormatContext {
  */
 void av_format_inject_global_side_data(AVFormatContext *s);
 
+#if FF_API_GET_DUR_ESTIMATE_METHOD
 /**
  * Returns the method used to set ctx->duration.
  *
  * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or 
AVFMT_DURATION_FROM_BITRATE.
+ * @deprecated duration_estimation_method is public and can be read directly.
  */
+attribute_deprecated
 enum AVDurationEstimationMethod 
av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx);
+#endif
 
 /**
  * @defgroup lavf_core Core functions
diff --git a/libavformat/options.c b/libavformat/options.c
index cd7e4cea9c..0b3e9775d9 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -198,10 +198,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
 return s;
 }
 
+#if FF_API_GET_DUR_ESTIMATE_METHOD
 enum AVDurationEstimationMethod 
av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx)
 {
 return ctx->duration_estimation_method;
 }
+#endif
 
 const AVClass *avformat_get_class(void)
 {
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 224fdacf23..c488188344 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -50,6 +50,7 @@
 #define FF_API_ALLOW_FLUSH  (LIBAVFORMAT_VERSION_MAJOR < 61)
 #define FF_API_AVSTREAM_SIDE_DATA   (LIBAVFORMAT_VERSION_MAJOR < 61)
 
+#define FF_API_GET_DUR_ESTIMATE_METHOD  (LIBAVFORMAT_VERSION_MAJOR < 62)
 
 #define FF_API_R_FRAME_RATE1
 
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] fftools/cmdutils: Inline print_error()

2024-03-03 Thread Andreas Rheinhardt
It is only used by ffprobe (once) and ffplay (twice);
inlining it avoids including it unnecessarily into ffmpeg.

Signed-off-by: Andreas Rheinhardt 
---
 fftools/cmdutils.c | 5 -
 fftools/cmdutils.h | 5 -
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 3d613a4018..008949a39d 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -895,11 +895,6 @@ do {   
\
 return 0;
 }
 
-void print_error(const char *filename, int err)
-{
-av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, av_err2str(err));
-}
-
 int read_yesno(void)
 {
 int c = getchar();
diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h
index 69e253c6ef..86428b3fa4 100644
--- a/fftools/cmdutils.h
+++ b/fftools/cmdutils.h
@@ -395,7 +395,10 @@ int setup_find_stream_info_opts(AVFormatContext *s,
  *
  * @see av_strerror()
  */
-void print_error(const char *filename, int err);
+static inline void print_error(const char *filename, int err)
+{
+av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, av_err2str(err));
+}
 
 /**
  * Print the program banner to stderr. The banner contents depend on the
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v4 1/2] lavu/hashtable: create generic robin hood hash table

2024-03-03 Thread Connor Worley
Any objections to this patchset?

On Sat, Feb 24, 2024 at 12:06 PM Connor Worley 
wrote:

> Signed-off-by: Connor Worley 
> ---
>  libavutil/Makefile  |   2 +
>  libavutil/hashtable.c   | 192 
>  libavutil/hashtable.h   |  40 
>  libavutil/tests/hashtable.c | 110 +
>  4 files changed, 344 insertions(+)
>  create mode 100644 libavutil/hashtable.c
>  create mode 100644 libavutil/hashtable.h
>  create mode 100644 libavutil/tests/hashtable.c
>
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index e7709b97d0..be75d464fc 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -138,6 +138,7 @@ OBJS = adler32.o
>   \
> fixed_dsp.o  \
> frame.o  \
> hash.o   \
> +   hashtable.o  \
> hdr_dynamic_metadata.o   \
> hdr_dynamic_vivid_metadata.o \
> hmac.o   \
> @@ -251,6 +252,7 @@ TESTPROGS = adler32
>  \
>  file\
>  fifo\
>  hash\
> +hashtable   \
>  hmac\
>  hwdevice\
>  integer \
> diff --git a/libavutil/hashtable.c b/libavutil/hashtable.c
> new file mode 100644
> index 00..155a264665
> --- /dev/null
> +++ b/libavutil/hashtable.c
> @@ -0,0 +1,192 @@
> +/*
> + * Generic hashtable
> + * Copyright (C) 2024 Connor Worley 
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
> + */
> +
> +#include 
> +#include 
> +
> +#include "crc.h"
> +#include "error.h"
> +#include "mem.h"
> +#include "hashtable.h"
> +
> +#define ALIGN _Alignof(size_t)
> +
> +struct AVHashtableContext {
> +size_t key_size;
> +size_t key_size_aligned;
> +size_t val_size;
> +size_t val_size_aligned;
> +size_t entry_size;
> +size_t max_entries;
> +size_t utilization;
> +const AVCRC *crc;
> +uint8_t *table;
> +uint8_t *swapbuf;
> +};
> +
> +#define ENTRY_PSL(entry) (entry)
> +#define ENTRY_OCC(entry) (ENTRY_PSL(entry) + FFALIGN(sizeof(size_t),
> ALIGN))
> +#define ENTRY_KEY(entry) (ENTRY_OCC(entry) + FFALIGN(sizeof(size_t),
> ALIGN))
> +#define ENTRY_VAL(entry) (ENTRY_KEY(entry) + ctx->key_size_aligned)
> +
> +#define KEYS_EQUAL(k1, k2) !memcmp(k1, k2, ctx->key_size)
> +
> +int av_hashtable_alloc(struct AVHashtableContext **ctx, size_t key_size,
> size_t val_size, size_t max_entries)
> +{
> +struct AVHashtableContext *res = av_malloc(sizeof(struct
> AVHashtableContext));
> +if (!res)
> +return AVERROR(ENOMEM);
> +res->key_size = key_size;
> +res->key_size_aligned = FFALIGN(key_size, ALIGN);
> +res->val_size = val_size;
> +res->val_size_aligned = FFALIGN(val_size, ALIGN);
> +res->entry_size = FFALIGN(sizeof(size_t), ALIGN)
> ++ FFALIGN(sizeof(size_t), ALIGN)
> ++ res->key_size_aligned
> ++ res->val_size_aligned;
> +res->max_entries = max_entries;
> +res->utilization = 0;
> +res->crc = av_crc_get_table(AV_CRC_32_IEEE);
> +if (!res->crc) {
> +av_hashtable_freep(&res);
> +return AVERROR_BUG;
> +}
> +res->table = av_calloc(res->max_entries, res->entry_size);
> +if (!res->table) {
> +av_hashtable_freep(&res);
> +return AVERROR(ENOMEM);
> +}
> +res->swapbuf = av_calloc(2, res->key_size_aligned +
> res->val_size_aligned);
> +if (!res->swapbuf) {
> +av_hashtable_freep(&res);
> +return AVERROR(ENOMEM);
> +}
> +*ctx = 

Re: [FFmpeg-devel] [RFC] clarifying the TC conflict of interest rule

2024-03-03 Thread Michael Niedermayer
On Sun, Mar 03, 2024 at 10:57:43PM +0100, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2024-03-03 03:49:33)
> > Hi
> > 
> > On Fri, Mar 01, 2024 at 06:33:12PM +0100, Anton Khirnov wrote:
> > > Hi all,
> > > it seems the discussion died down,
> > 
> > There are patches pending, which i will apply soon if no objections
> > have been raised.
> 
> I object to these patches. This way of hijacking discussion is just
> rude.
> 
> > And noone owns law texts.
> 
> These patches are not law texts, they are documentation. Authorship and
> copyright apply to them, same as to code.
> 
> > Everyone can propose any derivation
> > of anothers suggestion. Thats the idea behind evolution and improvment
> > and the idea behind finding and dicussing variations.
> 
> But the problem is not about ownership, but rather about telling people
> "stop discussing here and instead go to some other thread and comment on
> those other patches".
> 
> There seems to be a wide consensus that we have a fundamental
> disagreement here and the best way to resolve it is through a vote. It
> also seems to me that you keep trying to derail the vote, for unclear
> reasons.

The vote started as you want TC members (like yourself) to be able to
vote on their own disagreements.
I think thats not a good idea, thats where we dissagree.

But instead of asking this in a vote (which you could have done)
you pair it with the addition of good changes
and then when i want to add these changes you call it "hijacking discussion", 
"rude."
and "copyright apply to them"
and litterally object to your own change. So it can stay paired in the vote
with the change you want.

Again the changes you want to add / that are in the patches i did send
should be discussed and applied through consensus, iam sure there is wide
consensus to add them in some form.

OTOH I do not know how many people want TC members to be able to vote on
their own disagreements. Some people do want this yes, some people do not
want this.


>
> > Please add the vote options: (I belive this gives the people a more
> > complete set of choices)
>
> Why do you feel you need to bestow all these options upon "the people"?

The point of a vote is to find out what the people want.
The word democracy means
government by the people. especially : rule of the majority. : a government
in which the supreme power is vested in the people and exercised by them

For this they need to have the choice.

Normally we discuss disagreements, try to find consensus and move that way
but here you disregard this and try to push forward with a vote while
blocking your exact own text in one of the 3 patches that your vote
would add.

I hope very much that people even if they agree with the change vote
against it because what you do here is not how democracy should work.
And i dont think the future will be pretty if this style is accepted.
Expect everyone to do this with many changes YOU do not want in.

items should not be paired to get disputed things through. The Community
should be able to decide on the items independantly of each other


> If "the people" wanted these options, they would have asked for them.
> Again, it seems like you are trying to derail the vote.

If you pair things in a vote that others disagree you will have to
accept that some unpaired choices will appear too

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [RFC] clarifying the TC conflict of interest rule

2024-03-03 Thread Michael Niedermayer
On Mon, Mar 04, 2024 at 12:36:21AM +0100, Michael Niedermayer wrote:
> On Sun, Mar 03, 2024 at 10:57:43PM +0100, Anton Khirnov wrote:
> > Quoting Michael Niedermayer (2024-03-03 03:49:33)
[...]
> >
> > > Please add the vote options: (I belive this gives the people a more
> > > complete set of choices)
> >
> > Why do you feel you need to bestow all these options upon "the people"?
> 
> The point of a vote is to find out what the people want.
> The word democracy means
> government by the people. especially : rule of the majority. : a government
> in which the supreme power is vested in the people and exercised by them
> 
> For this they need to have the choice.
> 
> Normally we discuss disagreements, try to find consensus and move that way
> but here you disregard this and try to push forward with a vote while
> blocking your exact own text in one of the 3 patches that your vote
> would add.
> 

> I hope very much that people even if they agree with the change vote
> against it because what you do here is not how democracy should work.

I didnt word this well.
what i meant is people should vote in favor of the option
they favor (no matter what that is)

But if they are presented with a vote that tries to take away their choice
to funnel them into some other option, they should not accept this.

Alot of real world politics do exactly that
have many unrelated things stuffed in a law that then can only all be
passed or rejected together.
This shouldnt be that way in real world politcs and it also shouldnt be
done in FOSS.

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/3] doc/community: Vote in the interest of the project (first part of Antons proposal)

2024-03-03 Thread Michael Niedermayer
On Sun, Mar 03, 2024 at 10:05:49AM +0200, Rémi Denis-Courmont wrote:
> Le sunnuntaina 3. maaliskuuta 2024, 4.53.01 EET Michael Niedermayer a écrit :
> > On Mon, Feb 26, 2024 at 11:44:36PM +0100, Michael Niedermayer wrote:
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > > 
> > >  doc/community.texi | 2 ++
> > >  1 file changed, 2 insertions(+)
> > 
> > I intend to apply the patchset tomorrow if there are no objections
> 
> You can't have a strict rule ("must") requiring something vague ("best for 
> the 
> project").

please see at the end of my reply


> 
> What is best for the project tomorrow may differ from today.

yes


> What is best for
> the project w.r.t. Linux distributions may differ from that w.r.t. Windows 
> users.

yes


> What is best for long term maintainability and sustainability of the
> project does not align with the best publicity and functionality in the short 
> term.

yes


> It is also inherently both subjective and unknowable.

we need to be precisse here.
"what is best for the project" is both subjective and unknowable, yes
but
"in their view" is for the decission maker not unknowable, i would
instead very much hope they know what their view is.


> 
> This sentence just creates fodder for future accusations of bad faith, 
> hypocrisy, misjudgement against TC decisions. While the sentence is meaning 
> well, it adds absolutely nothing of value.

This is standard
(now i dont know why googles first link ended up in australia but ok)

https://www5.austlii.edu.au/au/legis/cth/consol_act/ca2001172/s181.html

"
Good faith--directors and other officers
(1)  A director or other officer of a corporation must exercise 
their powers and discharge their duties:
(a)  in good faith in the best interests of the 
corporation; and
(b)  for a proper purpose.
"

This uses "must", and thats actual law

IMO its perfectly reasonable to expect committee members to act in the best
interrest of FFmpeg.
Theres no "should" here, theres a "must" here
It should be clear to every adult that oppinions can widely differ and
that what one considers to be the best interrest will commonly be
different from someone else on another day.

Still theres a big difference between "should" act in the best interrest and
"must" act in teh best interrest.

with "should" someone could just not do it and we will see this.
People will not act against their own interrest unless they are required
to.

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/3] doc/community: Conflict of interest recusal requirement (Similar to mid part of Antons proposal)

2024-03-03 Thread Michael Niedermayer
On Sun, Mar 03, 2024 at 10:19:03AM +0200, Rémi Denis-Courmont wrote:
> Le tiistaina 27. helmikuuta 2024, 0.44.37 EET Michael Niedermayer a écrit :
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  doc/community.texi | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/doc/community.texi b/doc/community.texi
> > index 8a38c6aca0..fc22a8fa61 100644
> > --- a/doc/community.texi
> > +++ b/doc/community.texi
> > @@ -84,6 +84,9 @@ If the TC thinks it needs the input from the larger
> > community, the TC can call f
> > 
> >  Each TC member must vote on such decision according to what is, in their
> > view, best for the project.
> > 
> > +If a TC member is aware of a conflict of interest with regards to the case,
> > they must announce it
> > +and recuse themselves from the TC discussion and vote.
> 
> It looks like the meaning and intent do not match up here. I would expect 
> something like either of:
> 

> * If a TC member is aware of being in a conflict of interest with regards to 
> the case, they must announce it and recuse themselves from the TC discussion 
> and vote.

This was the intended meaning, i will update my patch


[...]

> Again, the effective way to work-around this problem is to keep a large and 
> diverse enough TC membership to offset the one or few hypothetical dishonest 
> votes.

This doesnt work. The set of people is very specific, and they will always be
representatives of the community so when 60% of the community works for
companies which would benefit by FFmpeg not competing. There
would be no realistic way to have a committee that wasnt also 60% affected
by this. And for this we need a clear rule.

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Nations do behave wisely once they have exhausted all other alternatives. 
-- Abba Eban


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [RFC] clarifying the TC conflict of interest rule

2024-03-03 Thread Michael Niedermayer
On Sun, Mar 03, 2024 at 03:49:33AM +0100, Michael Niedermayer wrote:
[...]

> +If a TC member is aware of a conflict of interest with regards to the case, 
> they must announce it
> +and recuse themselves from the TC discussion and vote.

please replace this in my proposal by this (as it clearer states what the 
intend is)

> * If a TC member is aware of being in a conflict of interest with regards to 
> the case, they must announce it
> and recuse themselves from the TC discussion and vote.

(also as you can see we have active discussions here, the vote is IMHO
 premature)

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Never trust a computer, one day, it may think you are the virus. -- Compn


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [GSOC]Inquiry Regarding "Update SITI Filter to Match with Latest Specification" Project and Qualification Task

2024-03-03 Thread Divyansh Khatri
I hope this message finds you well. My name is Divyansh, and I am reaching
out to express my interest in the project titled "Update SITI Filter to
Match with Latest Specification" listed in Ideas list of FFmpeg 2024 GSOC(
link

).
I would appreciate a mentor's guidance regarding the qualification task
mentioned in the project description, I would like your advice on selecting
an appropriate bug to fix in the existing filter and how can I start
working on it for my GSOC proposal for FFmpeg?

Best regards
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/mediacodecenc: Add a hint message to use nv12 pix_fmt

2024-03-03 Thread Zhao Zhili
From: Zhao Zhili 

---
 libavcodec/mediacodecenc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 086b545590..984014f1b1 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -319,6 +319,9 @@ static av_cold int mediacodec_init(AVCodecContext *avctx)
 ret = ff_AMediaCodec_configure(s->codec, format, s->window, NULL, ret);
 if (ret) {
 av_log(avctx, AV_LOG_ERROR, "MediaCodec configure failed, %s\n", 
av_err2str(ret));
+if (avctx->pix_fmt == AV_PIX_FMT_YUV420P)
+av_log(avctx, AV_LOG_ERROR, "Please try -pix_fmt nv12, some 
devices don't "
+"support yuv420p as encoder input 
format.\n");
 goto bailout;
 }
 
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".