Re: [FFmpeg-devel] [PATCH] avformat: add a disposition field to AVStreamGroup

2024-02-12 Thread Anton Khirnov
Quoting James Almer (2024-02-11 00:09:02)
> The existing (and upcoming) available group types are meant to combine several
> streams for presentation, with the result being treated as if it was a stream
> itself.

Only some group types have that semantics. I'd prefer to either
* move disposition to group-specific struct
* explicitly document with group types this fields is meaningful for

-- 
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] avutil/opt: Fix AV_OPT_TYPE_CONST default value

2024-02-12 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2024-02-04 17:54:35)
> It uses the int64_t instead of the double member.
> 
> (This code can currently not be reached: av_opt_get() calls
> av_opt_find2() with NULL as unit in which case AV_OPT_TYPE_CONST
> options are never returned, leading av_opt_get() to always
> return AVERROR_OPTION_NOT_FOUND when searching for AV_OPT_TYPE_CONST*.
> For the same reason the code read_number() will never be called
> from get_number() when searching for an option of type
> AV_OPT_TYPE_CONST. The other callers of read_number() also only
> call it with types other than AV_OPT_TYPE_CONST.)

Is there a reason you're not disabling that code with an assert instead?

-- 
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-cvslog] lavf/assenc: normalize line endings to \n

2024-02-12 Thread Martin Storsjö

On Mon, 12 Feb 2024, rcombs wrote:


ffmpeg | branch: master | rcombs  | Sun Jan 28 14:27:17 2024 
-0800| [7bf1b9b35769b37684dd2f18a54f01d852a540c8] | committer: rcombs

lavf/assenc: normalize line endings to \n

Previously, we produced output with either \r\n or mixed line endings.
This was undesirable unto itself, but also made working with patches affecting
FATE output particularly challenging, especially via the mailing list.

Everything that consumes the SSA/ASS format is line-ending-agnostic,
so \n is selected to simplify git/ML usage in FATE.

Extra \r characters at the end of a packet are dropped. These are always
ignored by the renderer anyway.


http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7bf1b9b35769b37684dd2f18a54f01d852a540c8

---

.gitattributes  |   1 -
libavformat/assenc.c|  22 ++--
tests/ref/fate/sub-aqtitle  |  94 
tests/ref/fate/sub-ass-to-ass-transcode | 124 ++---
tests/ref/fate/sub-cc   |  32 +++---
tests/ref/fate/sub-cc-realtime  |  44 
tests/ref/fate/sub-cc-scte20|  34 +++---
tests/ref/fate/sub-charenc  | 128 +++---
tests/ref/fate/sub-jacosub  |  50 -
tests/ref/fate/sub-microdvd |  48 -
tests/ref/fate/sub-movtext  |  34 +++---
tests/ref/fate/sub-mpl2 |  36 +++
tests/ref/fate/sub-mpsub|  70 ++--
tests/ref/fate/sub-mpsub-frames |  32 +++---
tests/ref/fate/sub-pjs  |  34 +++---
tests/ref/fate/sub-realtext |  38 +++
tests/ref/fate/sub-sami |  46 
tests/ref/fate/sub-sami2| 186 
tests/ref/fate/sub-srt  | 102 +-
tests/ref/fate/sub-srt-badsyntax|  48 -
tests/ref/fate/sub-ssa-to-ass-remux | 168 ++---
tests/ref/fate/sub-stl  |  62 +--
tests/ref/fate/sub-subviewer|  34 +++---
tests/ref/fate/sub-subviewer1   |  48 -
tests/ref/fate/sub-vplayer  |  34 +++---
tests/ref/fate/sub-webvtt   |  58 +-
tests/ref/fate/sub-webvtt2  |  52 -
27 files changed, 831 insertions(+), 828 deletions(-)

diff --git a/.gitattributes b/.gitattributes
index 5a19b963b6..a900528e47 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1 @@
*.pnm -diff -text
-tests/ref/fate/sub-scc eol=crlf


This change seems to have had a tricky effect on the 
tests/ref/fate/sub-scc file. Previously, when checked out, users got the 
file with CRLF newlines. When updating to this git commit, or past it, 
that file remains untouched, with CRLF still present, and the 
fate-sub-scc test fails. If one does "rm tests/ref/fate/sub-scc; git 
checkout tests/ref/fate/sub-scc", then the file does get restored with LR 
newlines, and the test passes.


It's easy to do this change manually in the source checkout of a fate 
runner, but I'm not sure how easily we get all fate instances fixed that 
way - currently this test is failing in most of them.


// Martin

___
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-cvslog] lavf/assenc: normalize line endings to \n

2024-02-12 Thread Hendrik Leppkes
On Mon, Feb 12, 2024 at 11:22 AM Martin Storsjö  wrote:
> >
> > diff --git a/.gitattributes b/.gitattributes
> > index 5a19b963b6..a900528e47 100644
> > --- a/.gitattributes
> > +++ b/.gitattributes
> > @@ -1,2 +1 @@
> > *.pnm -diff -text
> > -tests/ref/fate/sub-scc eol=crlf
>
> This change seems to have had a tricky effect on the
> tests/ref/fate/sub-scc file. Previously, when checked out, users got the
> file with CRLF newlines. When updating to this git commit, or past it,
> that file remains untouched, with CRLF still present, and the
> fate-sub-scc test fails. If one does "rm tests/ref/fate/sub-scc; git
> checkout tests/ref/fate/sub-scc", then the file does get restored with LR
> newlines, and the test passes.
>
> It's easy to do this change manually in the source checkout of a fate
> runner, but I'm not sure how easily we get all fate instances fixed that
> way - currently this test is failing in most of them.
>

Can this be fixed by restoring the .gitattribute entry but with eol=lf?
Not sure if Git would reset the file then.

- Hendrik
___
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] avformat/matroska: Add support for A_ATRAC/AT1

2024-02-12 Thread Andreas Rheinhardt
asivery via ffmpeg-devel:
> I apologize for not having responded earlier.
> I've attached the updated patch.
> 
> 
> From 68c77320954e44a7f02e95537fc9a6436da7549c Mon Sep 17 00:00:00 2001
> From: asivery 
> Date: Sun, 11 Feb 2024 23:13:07 +0100
> Subject: [PATCH] avformat/matroska: Add support for A_ATRAC/AT1
> 
> Signed-off-by: asivery 
> ---

Send your patch either via git send-email or as an attachment; if you
have comments for your patch (that are not supposed to be part of the
eventual commit and not its commit message), then put them here, in
between the --- and the affected files.

>  libavformat/matroska.c| 1 +
>  libavformat/matroskadec.c | 8 
>  libavformat/matroskaenc.c | 1 +
>  3 files changed, 10 insertions(+)
> 
> diff --git a/libavformat/matroska.c b/libavformat/matroska.c
> index 5878594e68..ae9ecc8207 100644
> --- a/libavformat/matroska.c
> +++ b/libavformat/matroska.c
> @@ -53,6 +53,7 @@ const CodecTags ff_mkv_codec_tags[]={
>  {"A_REAL/ATRC"  , AV_CODEC_ID_ATRAC3},
>  {"A_REAL/COOK"  , AV_CODEC_ID_COOK},
>  {"A_REAL/SIPR"  , AV_CODEC_ID_SIPR},
> +{"A_ATRAC/AT1"  , AV_CODEC_ID_ATRAC1},

This audio part of this list is ordered by the Matroska CodecID (i.e.
the string on the left). Please keep it that way.

>  {"A_TRUEHD" , AV_CODEC_ID_TRUEHD},
>  {"A_TTA1"   , AV_CODEC_ID_TTA},
>  {"A_VORBIS" , AV_CODEC_ID_VORBIS},
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index 8f000f86be..1bb6e8605a 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -2779,6 +2779,14 @@ static int mka_parse_audio_codec(MatroskaTrack *track, 
> AVCodecParameters *par,
>  return AVERROR(ENOMEM);
>  break;
>  }
> +case AV_CODEC_ID_ATRAC1:
> +/* ATRAC1 uses a constant frame size.
> + * Typical ATRAC1 streams are either mono or stereo.
> + * At most, ATRAC1 was used to store 8 channels of audio. */
> +if (track->audio.channels > 8)
> +return AVERROR_INVALIDDATA;
> +par->block_align = track->audio.channels * 212;
> +break;
>  case AV_CODEC_ID_FLAC:
>  if (track->codec_priv.size) {
>  ret = matroska_parse_flac(s, track, extradata_offset);
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 1457a6890c..aa25657f8f 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -3483,6 +3483,7 @@ static const AVCodecTag additional_audio_tags[] = {
>  { AV_CODEC_ID_QDM2,  0x },
>  { AV_CODEC_ID_RA_144,0x },
>  { AV_CODEC_ID_TRUEHD,0x },
> +{ AV_CODEC_ID_ATRAC1,0x },

Please keep this list sorted alphabetically.

>  { AV_CODEC_ID_NONE,  0x }
>  };
>  

___
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] Require compilers to support C11.

2024-02-12 Thread Anton Khirnov
Any more comments on this?

Anyone opposed to this going to master this week?

-- 
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-cvslog] lavf/assenc: normalize line endings to \n

2024-02-12 Thread Martin Storsjö

On Mon, 12 Feb 2024, Hendrik Leppkes wrote:


On Mon, Feb 12, 2024 at 11:22 AM Martin Storsjö  wrote:

>
> diff --git a/.gitattributes b/.gitattributes
> index 5a19b963b6..a900528e47 100644
> --- a/.gitattributes
> +++ b/.gitattributes
> @@ -1,2 +1 @@
> *.pnm -diff -text
> -tests/ref/fate/sub-scc eol=crlf

This change seems to have had a tricky effect on the
tests/ref/fate/sub-scc file. Previously, when checked out, users got the
file with CRLF newlines. When updating to this git commit, or past it,
that file remains untouched, with CRLF still present, and the
fate-sub-scc test fails. If one does "rm tests/ref/fate/sub-scc; git
checkout tests/ref/fate/sub-scc", then the file does get restored with LR
newlines, and the test passes.

It's easy to do this change manually in the source checkout of a fate
runner, but I'm not sure how easily we get all fate instances fixed that
way - currently this test is failing in most of them.



Can this be fixed by restoring the .gitattribute entry but with eol=lf?
Not sure if Git would reset the file then.


No, that doesn't seem to make any difference. Not sure if there are any 
other straightforward/elegant fixes, short of renaming the file, which I 
guess would require renaming the test itself.


// Martin
___
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] Require compilers to support C11.

2024-02-12 Thread James Almer

On 2/12/2024 8:04 AM, Anton Khirnov wrote:

Any more comments on this?

Anyone opposed to this going to master this week?


Michael said his machines needed updating gcc for c17. Wait to see if 
that still applies to c11.

___
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: ***UNCHECKED*** [FFmpeg-devel] [PATCH] avformat: add a disposition field to AVStreamGroup

2024-02-12 Thread James Almer


bincZSp7HNnyk.bin
Description: PGP/MIME version identification


encrypted.asc
Description: OpenPGP encrypted message
___
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] avformat: add a disposition field to AVStreamGroup

2024-02-12 Thread James Almer

On 2/12/2024 6:10 AM, Anton Khirnov wrote:

Quoting James Almer (2024-02-11 00:09:02)

The existing (and upcoming) available group types are meant to combine several
streams for presentation, with the result being treated as if it was a stream
itself.


Only some group types have that semantics. I'd prefer to either
* move disposition to group-specific struct


Can't do this because the iamf groups use a lavu struct that's not 
exclusive to the stream group API.



* explicitly document with group types this fields is meaningful for


This is ok.

(resent because for some bizarre reason the first email was encrypted).
___
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] avformat: add a disposition field to AVStreamGroup

2024-02-12 Thread James Almer
The existing (and upcoming) available group types are meant to combine several
streams for presentation, with the result being treated as if it was a stream
itself.
For example, a file could export two stream groups of the same type with one of
them as the "default".

Signed-off-by: James Almer 
---
 libavformat/avformat.h | 10 +
 libavformat/dump.c | 85 +++---
 libavformat/options.c  | 45 +++---
 3 files changed, 81 insertions(+), 59 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 5d0fe82250..e3daf4a107 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1093,6 +1093,16 @@ typedef struct AVStreamGroup {
  * Freed by libavformat in avformat_free_context().
  */
 AVStream **streams;
+
+/**
+ * Stream group disposition - a combination of AV_DISPOSITION_* flags.
+ * This field currently applies to all defined AVStreamGroupParamsType.
+ *
+ * - demuxing: set by libavformat when creating the group or in
+ * avformat_find_stream_info().
+ * - muxing: may be set by the caller before avformat_write_header().
+ */
+int disposition;
 } AVStreamGroup;
 
 struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 9d37179bb7..9bf1695d96 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -538,6 +538,46 @@ static void dump_sidedata(void *ctx, const AVStream *st, 
const char *indent,
 }
 }
 
+static void dump_disposition(int disposition, int log_level)
+{
+if (disposition & AV_DISPOSITION_DEFAULT)
+av_log(NULL, log_level, " (default)");
+if (disposition & AV_DISPOSITION_DUB)
+av_log(NULL, log_level, " (dub)");
+if (disposition & AV_DISPOSITION_ORIGINAL)
+av_log(NULL, log_level, " (original)");
+if (disposition & AV_DISPOSITION_COMMENT)
+av_log(NULL, log_level, " (comment)");
+if (disposition & AV_DISPOSITION_LYRICS)
+av_log(NULL, log_level, " (lyrics)");
+if (disposition & AV_DISPOSITION_KARAOKE)
+av_log(NULL, log_level, " (karaoke)");
+if (disposition & AV_DISPOSITION_FORCED)
+av_log(NULL, log_level, " (forced)");
+if (disposition & AV_DISPOSITION_HEARING_IMPAIRED)
+av_log(NULL, log_level, " (hearing impaired)");
+if (disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
+av_log(NULL, log_level, " (visual impaired)");
+if (disposition & AV_DISPOSITION_CLEAN_EFFECTS)
+av_log(NULL, log_level, " (clean effects)");
+if (disposition & AV_DISPOSITION_ATTACHED_PIC)
+av_log(NULL, log_level, " (attached pic)");
+if (disposition & AV_DISPOSITION_TIMED_THUMBNAILS)
+av_log(NULL, log_level, " (timed thumbnails)");
+if (disposition & AV_DISPOSITION_CAPTIONS)
+av_log(NULL, log_level, " (captions)");
+if (disposition & AV_DISPOSITION_DESCRIPTIONS)
+av_log(NULL, log_level, " (descriptions)");
+if (disposition & AV_DISPOSITION_METADATA)
+av_log(NULL, log_level, " (metadata)");
+if (disposition & AV_DISPOSITION_DEPENDENT)
+av_log(NULL, log_level, " (dependent)");
+if (disposition & AV_DISPOSITION_STILL_IMAGE)
+av_log(NULL, log_level, " (still image)");
+if (disposition & AV_DISPOSITION_NON_DIEGETIC)
+av_log(NULL, log_level, " (non-diegetic)");
+}
+
 /* "user interface" functions */
 static void dump_stream_format(const AVFormatContext *ic, int i,
int group_index, int index, int is_output,
@@ -620,42 +660,7 @@ static void dump_stream_format(const AVFormatContext *ic, 
int i,
 print_fps(1 / av_q2d(st->time_base), "tbn", log_level);
 }
 
-if (st->disposition & AV_DISPOSITION_DEFAULT)
-av_log(NULL, log_level, " (default)");
-if (st->disposition & AV_DISPOSITION_DUB)
-av_log(NULL, log_level, " (dub)");
-if (st->disposition & AV_DISPOSITION_ORIGINAL)
-av_log(NULL, log_level, " (original)");
-if (st->disposition & AV_DISPOSITION_COMMENT)
-av_log(NULL, log_level, " (comment)");
-if (st->disposition & AV_DISPOSITION_LYRICS)
-av_log(NULL, log_level, " (lyrics)");
-if (st->disposition & AV_DISPOSITION_KARAOKE)
-av_log(NULL, log_level, " (karaoke)");
-if (st->disposition & AV_DISPOSITION_FORCED)
-av_log(NULL, log_level, " (forced)");
-if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
-av_log(NULL, log_level, " (hearing impaired)");
-if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
-av_log(NULL, log_level, " (visual impaired)");
-if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
-av_log(NULL, log_level, " (clean effects)");
-if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
-av_log(NULL, log_level, " (attached pic)");
-if (st->disposition & AV_DISPOSITION_TIMED_THUMBNAILS)
-av_log(NULL, log_level, "

Re: [FFmpeg-devel] [PATCH 1/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread James Almer

On 2/6/2024 10:05 AM, James Almer wrote:

Signed-off-by: James Almer 
---
Now reading decriptors from extradata, plus a setting to ensure any descriptors
present inband are omitted has been added.

  doc/bitstream_filters.texi|  16 +
  libavcodec/bitstream_filters.c|   1 +
  libavcodec/bsf/Makefile   |   1 +
  libavcodec/bsf/iamf_frame_split_bsf.c | 887 ++
  4 files changed, 905 insertions(+)
  create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c


Will apply the set soon if there are no objections.
___
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] avformat/libsrt: Fix srt:// URL parsing

2024-02-12 Thread Ingo Oppermann
Add missing NULL check and use ff_urldecode for string query
parameters.

Signed-off-by: Ingo Oppermann 
---
 libavformat/libsrt.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index cd8f5b1e7d..d549aea1f7 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -32,6 +32,7 @@
 #include "network.h"
 #include "os_support.h"
 #include "url.h"
+#include "urldecode.h"
 
 /* This is for MPEG-TS and it's a default SRTO_PAYLOADSIZE for SRTT_LIVE (8 TS 
packets) */
 #ifndef SRT_LIVE_DEFAULT_PAYLOAD_SIZE
@@ -547,7 +548,11 @@ static int libsrt_open(URLContext *h, const char *uri, int 
flags)
 }
 if (av_find_info_tag(buf, sizeof(buf), "passphrase", p)) {
 av_freep(&s->passphrase);
-s->passphrase = av_strndup(buf, strlen(buf));
+s->passphrase = ff_urldecode(buf, 1);
+if (!s->passphrase) {
+ret = AVERROR(ENOMEM);
+goto err;
+}
 }
 #if SRT_VERSION_VALUE >= 0x010302
 if (av_find_info_tag(buf, sizeof(buf), "enforced_encryption", p)) {
@@ -632,7 +637,7 @@ static int libsrt_open(URLContext *h, const char *uri, int 
flags)
 }
 if (av_find_info_tag(buf, sizeof(buf), "streamid", p)) {
 av_freep(&s->streamid);
-s->streamid = av_strdup(buf);
+s->streamid = ff_urldecode(buf, 1);
 if (!s->streamid) {
 ret = AVERROR(ENOMEM);
 goto err;
@@ -640,7 +645,7 @@ static int libsrt_open(URLContext *h, const char *uri, int 
flags)
 }
 if (av_find_info_tag(buf, sizeof(buf), "smoother", p)) {
 av_freep(&s->smoother);
-s->smoother = av_strdup(buf);
+s->smoother = ff_urldecode(buf, 1);
 if(!s->smoother) {
 ret = AVERROR(ENOMEM);
 goto err;
@@ -671,6 +676,7 @@ static int libsrt_open(URLContext *h, const char *uri, int 
flags)
 err:
 av_freep(&s->smoother);
 av_freep(&s->streamid);
+av_freep(&s->passphrase);
 srt_cleanup();
 return ret;
 }
-- 
2.39.3 (Apple Git-145)

___
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-02-12 Thread Derek Buitenhuis
On 2/9/2024 3:32 AM, Michael Niedermayer wrote:
> please make sure its marked on the bug tracker so it shows up here:
> 
> https://trac.ffmpeg.org/query?status=new&status=open&status=reopened&blocking=~7.0
> 
> thx

Done: https://trac.ffmpeg.org/ticket/10857

- Derek
___
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 v13 1/2] libavformat: add DVD-Video demuxer, powered by libdvdnav and libdvdread

2024-02-12 Thread Stefano Sabatini
On date Sunday 2024-02-11 12:09:16 -0600, Marth64 wrote:
> No critical changes since v12.
> - Removes unused context variable
> - Removes unnecessary if statement
> - Whitespace cleanup
> - Rebase with master
> 
> Signed-off-by: Marth64 
> ---
>  Changelog |2 +
>  configure |8 +
>  doc/demuxers.texi |  130 
>  libavformat/Makefile  |1 +
>  libavformat/allformats.c  |1 +
>  libavformat/dvdvideodec.c | 1418 +
>  6 files changed, 1560 insertions(+)
>  create mode 100644 libavformat/dvdvideodec.c
> 
> diff --git a/Changelog b/Changelog
> index c5fb21d198..88653bc6d3 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -24,6 +24,8 @@ version :
>  - ffmpeg CLI options may now be used as -/opt , which is equivalent
>to -opt >
>  - showinfo bitstream filter
> +- DVD-Video demuxer, powered by libdvdnav and libdvdread
> +

No more comments from me, I think this is already good enough and can
go in. Further tweaks/cleanups/fixes can be applied on top.

Thanks Marth64 for the cool contribution!!

PS I won't be available in the next week or so, so I won't be able to
push this, or I'll push when I'll be back if this was not done already
and there are no further comments.
___
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 v13 1/2] libavformat: add DVD-Video demuxer, powered by libdvdnav and libdvdread

2024-02-12 Thread Marth64
Thank you Stefano for your patience and reviews. I am working on
refinements that can go in after initial patch. Cheers

On Mon, Feb 12, 2024 at 09:47 Stefano Sabatini  wrote:

> On date Sunday 2024-02-11 12:09:16 -0600, Marth64 wrote:
> > No critical changes since v12.
> > - Removes unused context variable
> > - Removes unnecessary if statement
> > - Whitespace cleanup
> > - Rebase with master
> >
> > Signed-off-by: Marth64 
> > ---
> >  Changelog |2 +
> >  configure |8 +
> >  doc/demuxers.texi |  130 
> >  libavformat/Makefile  |1 +
> >  libavformat/allformats.c  |1 +
> >  libavformat/dvdvideodec.c | 1418 +
> >  6 files changed, 1560 insertions(+)
> >  create mode 100644 libavformat/dvdvideodec.c
> >
> > diff --git a/Changelog b/Changelog
> > index c5fb21d198..88653bc6d3 100644
> > --- a/Changelog
> > +++ b/Changelog
> > @@ -24,6 +24,8 @@ version :
> >  - ffmpeg CLI options may now be used as -/opt , which is
> equivalent
> >to -opt >
> >  - showinfo bitstream filter
> > +- DVD-Video demuxer, powered by libdvdnav and libdvdread
> > +
>
> No more comments from me, I think this is already good enough and can
> go in. Further tweaks/cleanups/fixes can be applied on top.
>
> Thanks Marth64 for the cool contribution!!
>
> PS I won't be available in the next week or so, so I won't be able to
> push this, or I'll push when I'll be back if this was not done already
> and there are no further comments.
>
___
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 v1] avcodec/h2645_parse: Don't treat 0x000002 as a start code and truncate

2024-02-12 Thread Mattias Wadman
According to ITU-T H.265 7.4.2.1 this byte sequence should not appear in a
NAL unit but in practice in rare cases it seems it does, possibly due to buggy
encoders. Other players like VLC and Quicktime seem to be fine with it.

Currently when this sequence is found it is treated as if the next start code
has been found and the NAL unit gets truncated.

This change limits the code to only look for first start code 0x001 or
first escape 0x03.

Sadly i can't share the original source file with the issue but the first
80 bytes of the NAL unit looks like this:

   │00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f│0123456789abcdef│
0x0│00 00 00 01 02 01 d0 bc 57 a1 b8 44 70 01 00 0b│W..Dp...│
0x00010│80 2e 00 c2 6c ec 3e b9 e3 03 fb 91 2e d2 43 cb│l.>...C.│
0x00020│1d 2c 00 00 02 00 02 00 5c 93 72 6f 31 76 18 00│.,..\.ro1v..│
0x00030│08 38 aa b1 4c 33 3f fd 08 cb 77 9b d4 3c db 02│.8..L3?...w..<..│
0x00040│a2 04 73 15 75 de 3b c4 67 c0 8f ca ad 31 f1 99│..s.u.;.g1..│
---
 libavcodec/h2645_parse.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 28db465059..d54bdd53c2 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -40,8 +40,9 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
 
 nal->skipped_bytes = 0;
 #define STARTCODE_TEST  \
-if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
-if (src[i + 2] != 3 && src[i + 2] != 0) {   \
+   if (i + 2 < length && src[i + 1] == 0 && \
+   (src[i + 2] == 3 || src[i + 2] == 1)) {  \
+if (src[i + 2] == 1) {  \
 /* startcode, so we must be past the end */ \
 length = i; \
 }   \
-- 
2.43.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".


Re: [FFmpeg-devel] [PATCH 1/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread Andreas Rheinhardt
James Almer:
> On 2/6/2024 10:05 AM, James Almer wrote:
>> Signed-off-by: James Almer 
>> ---
>> Now reading decriptors from extradata, plus a setting to ensure any
>> descriptors
>> present inband are omitted has been added.
>>
>>   doc/bitstream_filters.texi    |  16 +
>>   libavcodec/bitstream_filters.c    |   1 +
>>   libavcodec/bsf/Makefile   |   1 +
>>   libavcodec/bsf/iamf_frame_split_bsf.c | 887 ++
>>   4 files changed, 905 insertions(+)
>>   create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c
> 
> Will apply the set soon if there are no objections.

I still object to the BSF in #1 existing as it just duplicates parsing
code into lavc and lavf. And the issue with creating new framings for
stuff for which no framing except raw data can't exist is still there.

- 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 1/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread James Almer

On 2/12/2024 1:40 PM, Andreas Rheinhardt wrote:

James Almer:

On 2/6/2024 10:05 AM, James Almer wrote:

Signed-off-by: James Almer 
---
Now reading decriptors from extradata, plus a setting to ensure any
descriptors
present inband are omitted has been added.

   doc/bitstream_filters.texi    |  16 +
   libavcodec/bitstream_filters.c    |   1 +
   libavcodec/bsf/Makefile   |   1 +
   libavcodec/bsf/iamf_frame_split_bsf.c | 887 ++
   4 files changed, 905 insertions(+)
   create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c


Will apply the set soon if there are no objections.


I still object to the BSF in #1 existing as it just duplicates parsing
code into lavc and lavf. And the issue with creating new framings for
stuff for which no framing except raw data can't exist is still there.


I insist on using the split bsf, but i can try to remove the merge one 
and do that within lavf, to avoid creating packets with OBU framing.

___
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/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread Andreas Rheinhardt
James Almer:
> On 2/12/2024 1:40 PM, Andreas Rheinhardt wrote:
>> James Almer:
>>> On 2/6/2024 10:05 AM, James Almer wrote:
 Signed-off-by: James Almer 
 ---
 Now reading decriptors from extradata, plus a setting to ensure any
 descriptors
 present inband are omitted has been added.

    doc/bitstream_filters.texi    |  16 +
    libavcodec/bitstream_filters.c    |   1 +
    libavcodec/bsf/Makefile   |   1 +
    libavcodec/bsf/iamf_frame_split_bsf.c | 887
 ++
    4 files changed, 905 insertions(+)
    create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c
>>>
>>> Will apply the set soon if there are no objections.
>>
>> I still object to the BSF in #1 existing as it just duplicates parsing
>> code into lavc and lavf. And the issue with creating new framings for
>> stuff for which no framing except raw data can't exist is still there.
> 
> I insist on using the split bsf, but i can try to remove the merge one
> and do that within lavf, to avoid creating packets with OBU framing.

Why is splitting not simply done inside lavf (and inside the demuxer,
not the generic code in demux.c)? What is the advantage of that? Do such
packets as the split bsf expects exist somewhere in the wild outside of
isobmff files?

- 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 1/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread James Almer



On 2/12/2024 2:04 PM, Andreas Rheinhardt wrote:

James Almer:

On 2/12/2024 1:40 PM, Andreas Rheinhardt wrote:

James Almer:

On 2/6/2024 10:05 AM, James Almer wrote:

Signed-off-by: James Almer 
---
Now reading decriptors from extradata, plus a setting to ensure any
descriptors
present inband are omitted has been added.

    doc/bitstream_filters.texi    |  16 +
    libavcodec/bitstream_filters.c    |   1 +
    libavcodec/bsf/Makefile   |   1 +
    libavcodec/bsf/iamf_frame_split_bsf.c | 887
++
    4 files changed, 905 insertions(+)
    create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c


Will apply the set soon if there are no objections.


I still object to the BSF in #1 existing as it just duplicates parsing
code into lavc and lavf. And the issue with creating new framings for
stuff for which no framing except raw data can't exist is still there.


I insist on using the split bsf, but i can try to remove the merge one
and do that within lavf, to avoid creating packets with OBU framing.


Why is splitting not simply done inside lavf (and inside the demuxer,
not the generic code in demux.c)? What is the advantage of that?


Not making a mess in mov.c's read_packet() from reiterated calls because 
one Track Sample has packets for several AVStreams.


 Do such

packets as the split bsf expects exist somewhere in the wild outside of
isobmff files?


Sure, it's raw iamf. Other containers may also support it in the future, 
like Matroska, mpegs and the like.




- 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 1/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread Andreas Rheinhardt
James Almer:
> 
> 
> On 2/12/2024 2:04 PM, Andreas Rheinhardt wrote:
>> James Almer:
>>> On 2/12/2024 1:40 PM, Andreas Rheinhardt wrote:
 James Almer:
> On 2/6/2024 10:05 AM, James Almer wrote:
>> Signed-off-by: James Almer 
>> ---
>> Now reading decriptors from extradata, plus a setting to ensure any
>> descriptors
>> present inband are omitted has been added.
>>
>>     doc/bitstream_filters.texi    |  16 +
>>     libavcodec/bitstream_filters.c    |   1 +
>>     libavcodec/bsf/Makefile   |   1 +
>>     libavcodec/bsf/iamf_frame_split_bsf.c | 887
>> ++
>>     4 files changed, 905 insertions(+)
>>     create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c
>
> Will apply the set soon if there are no objections.

 I still object to the BSF in #1 existing as it just duplicates parsing
 code into lavc and lavf. And the issue with creating new framings for
 stuff for which no framing except raw data can't exist is still there.
>>>
>>> I insist on using the split bsf, but i can try to remove the merge one
>>> and do that within lavf, to avoid creating packets with OBU framing.
>>
>> Why is splitting not simply done inside lavf (and inside the demuxer,
>> not the generic code in demux.c)? What is the advantage of that?
> 
> Not making a mess in mov.c's read_packet() from reiterated calls because
> one Track Sample has packets for several AVStreams.

Mess? All you would need to do is add a check at the beginning of
read_packet whether there are any more packets buffered. If so, return
them, if not, read new data.
(I consider adding bsfs to the demuxing code to be at least a bit messy
and not worth it unless there were several users of this.)

> 
>  Do such
>> packets as the split bsf expects exist somewhere in the wild outside of
>> isobmff files?
> 
> Sure, it's raw iamf. Other containers may also support it in the future,
> like Matroska, mpegs and the like.
> 

I don't see any reason why we should any of this framing outside of lavf
(i.e. it should be treated like e.g. Matroska's wavpack framing and
repacked inside the (de)muxer).

- 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] avformat/matroska: Add support for A_ATRAC/AT1

2024-02-12 Thread asivery via ffmpeg-devel
I've attached the updated patch. Both new entries are now placed in an 
alphabetically correct way in their appropriate lists.

On Monday, February 12th, 2024 at 11:53 AM, Andreas Rheinhardt 
 wrote:

> asivery via ffmpeg-devel:
> 
> > I apologize for not having responded earlier.
> > I've attached the updated patch.
> > 
> > From 68c77320954e44a7f02e95537fc9a6436da7549c Mon Sep 17 00:00:00 2001
> > From: asivery asiv...@protonmail.com
> > Date: Sun, 11 Feb 2024 23:13:07 +0100
> > Subject: [PATCH] avformat/matroska: Add support for A_ATRAC/AT1
> > 
> > Signed-off-by: asivery asiv...@protonmail.com
> > ---
> 
> 
> Send your patch either via git send-email or as an attachment; if you
> have comments for your patch (that are not supposed to be part of the
> eventual commit and not its commit message), then put them here, in
> between the --- and the affected files.
> 
> > libavformat/matroska.c | 1 +
> > libavformat/matroskadec.c | 8 
> > libavformat/matroskaenc.c | 1 +
> > 3 files changed, 10 insertions(+)
> > 
> > diff --git a/libavformat/matroska.c b/libavformat/matroska.c
> > index 5878594e68..ae9ecc8207 100644
> > --- a/libavformat/matroska.c
> > +++ b/libavformat/matroska.c
> > @@ -53,6 +53,7 @@ const CodecTags ff_mkv_codec_tags[]={
> > {"A_REAL/ATRC" , AV_CODEC_ID_ATRAC3},
> > {"A_REAL/COOK" , AV_CODEC_ID_COOK},
> > {"A_REAL/SIPR" , AV_CODEC_ID_SIPR},
> > + {"A_ATRAC/AT1" , AV_CODEC_ID_ATRAC1},
> 
> 
> This audio part of this list is ordered by the Matroska CodecID (i.e.
> the string on the left). Please keep it that way.
> 
> > {"A_TRUEHD" , AV_CODEC_ID_TRUEHD},
> > {"A_TTA1" , AV_CODEC_ID_TTA},
> > {"A_VORBIS" , AV_CODEC_ID_VORBIS},
> > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> > index 8f000f86be..1bb6e8605a 100644
> > --- a/libavformat/matroskadec.c
> > +++ b/libavformat/matroskadec.c
> > @@ -2779,6 +2779,14 @@ static int mka_parse_audio_codec(MatroskaTrack 
> > *track, AVCodecParameters par,
> > return AVERROR(ENOMEM);
> > break;
> > }
> > + case AV_CODEC_ID_ATRAC1:
> > + / ATRAC1 uses a constant frame size.
> > + * Typical ATRAC1 streams are either mono or stereo.
> > + * At most, ATRAC1 was used to store 8 channels of audio. */
> > + if (track->audio.channels > 8)
> > + return AVERROR_INVALIDDATA;
> > + par->block_align = track->audio.channels * 212;
> > + break;
> > case AV_CODEC_ID_FLAC:
> > if (track->codec_priv.size) {
> > ret = matroska_parse_flac(s, track, extradata_offset);
> > diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> > index 1457a6890c..aa25657f8f 100644
> > --- a/libavformat/matroskaenc.c
> > +++ b/libavformat/matroskaenc.c
> > @@ -3483,6 +3483,7 @@ static const AVCodecTag additional_audio_tags[] = {
> > { AV_CODEC_ID_QDM2, 0x },
> > { AV_CODEC_ID_RA_144, 0x },
> > { AV_CODEC_ID_TRUEHD, 0x },
> > + { AV_CODEC_ID_ATRAC1, 0x },
> 
> 
> Please keep this list sorted alphabetically.
> 
> > { AV_CODEC_ID_NONE, 0x }
> > };
> 
> 
> ___
> 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".From a530931ebba6638b095720c222b72d2f3d5b0bd1 Mon Sep 17 00:00:00 2001
From: asivery 
Date: Mon, 12 Feb 2024 19:01:32 +0100
Subject: [PATCH] avformat/matroska: Add support for A_ATRAC/AT1

Signed-off-by: asivery 
---
 libavformat/matroska.c| 1 +
 libavformat/matroskadec.c | 8 
 libavformat/matroskaenc.c | 1 +
 3 files changed, 10 insertions(+)

diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 5878594e68..d0ecfbeb6a 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -28,6 +28,7 @@ const CodecTags ff_mkv_codec_tags[]={
 {"A_AAC", AV_CODEC_ID_AAC},
 {"A_AC3", AV_CODEC_ID_AC3},
 {"A_ALAC"   , AV_CODEC_ID_ALAC},
+{"A_ATRAC/AT1"  , AV_CODEC_ID_ATRAC1},
 {"A_DTS", AV_CODEC_ID_DTS},
 {"A_EAC3"   , AV_CODEC_ID_EAC3},
 {"A_FLAC"   , AV_CODEC_ID_FLAC},
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 8f000f86be..5d3d18a146 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2779,6 +2779,14 @@ static int mka_parse_audio_codec(MatroskaTrack *track, AVCodecParameters *par,
 return AVERROR(ENOMEM);
 break;
 }
+case AV_CODEC_ID_ATRAC1:
+/* ATRAC1 uses a constant frame size.
+ * Typical ATRAC1 streams are either mono or stereo.
+ * At most, ATRAC1 was used to store 8 channels of audio. */
+if (track->audio.channels > 8)
+return AVERROR_INVALIDDATA;
+par->block_align = track->audio.channels * 212;
+break;
 case AV_CODEC_ID_FLAC:
 if (track->codec_priv.size) {
 ret = matroska_parse_flac(s, track, extradata_offset);
diff --git a/libavfor

Re: [FFmpeg-devel] [PATCH 1/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread James Almer

On 2/12/2024 2:28 PM, Andreas Rheinhardt wrote:

James Almer:



On 2/12/2024 2:04 PM, Andreas Rheinhardt wrote:

James Almer:

On 2/12/2024 1:40 PM, Andreas Rheinhardt wrote:

James Almer:

On 2/6/2024 10:05 AM, James Almer wrote:

Signed-off-by: James Almer 
---
Now reading decriptors from extradata, plus a setting to ensure any
descriptors
present inband are omitted has been added.

     doc/bitstream_filters.texi    |  16 +
     libavcodec/bitstream_filters.c    |   1 +
     libavcodec/bsf/Makefile   |   1 +
     libavcodec/bsf/iamf_frame_split_bsf.c | 887
++
     4 files changed, 905 insertions(+)
     create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c


Will apply the set soon if there are no objections.


I still object to the BSF in #1 existing as it just duplicates parsing
code into lavc and lavf. And the issue with creating new framings for
stuff for which no framing except raw data can't exist is still there.


I insist on using the split bsf, but i can try to remove the merge one
and do that within lavf, to avoid creating packets with OBU framing.


Why is splitting not simply done inside lavf (and inside the demuxer,
not the generic code in demux.c)? What is the advantage of that?


Not making a mess in mov.c's read_packet() from reiterated calls because
one Track Sample has packets for several AVStreams.


Mess? All you would need to do is add a check at the beginning of
read_packet whether there are any more packets buffered. If so, return
them, if not, read new data.


Buffered where? Internally in the demuxer?


(I consider adding bsfs to the demuxing code to be at least a bit messy
and not worth it unless there were several users of this.)



  Do such

packets as the split bsf expects exist somewhere in the wild outside of
isobmff files?


Sure, it's raw iamf. Other containers may also support it in the future,
like Matroska, mpegs and the like.



I don't see any reason why we should any of this framing outside of lavf
(i.e. it should be treated like e.g. Matroska's wavpack framing and
repacked inside the (de)muxer).

- 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 1/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread Andreas Rheinhardt
James Almer:
> On 2/12/2024 2:28 PM, Andreas Rheinhardt wrote:
>> James Almer:
>>>
>>>
>>> On 2/12/2024 2:04 PM, Andreas Rheinhardt wrote:
 James Almer:
> On 2/12/2024 1:40 PM, Andreas Rheinhardt wrote:
>> James Almer:
>>> On 2/6/2024 10:05 AM, James Almer wrote:
 Signed-off-by: James Almer 
 ---
 Now reading decriptors from extradata, plus a setting to ensure any
 descriptors
 present inband are omitted has been added.

  doc/bitstream_filters.texi    |  16 +
  libavcodec/bitstream_filters.c    |   1 +
  libavcodec/bsf/Makefile   |   1 +
  libavcodec/bsf/iamf_frame_split_bsf.c | 887
 ++
  4 files changed, 905 insertions(+)
  create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c
>>>
>>> Will apply the set soon if there are no objections.
>>
>> I still object to the BSF in #1 existing as it just duplicates
>> parsing
>> code into lavc and lavf. And the issue with creating new framings for
>> stuff for which no framing except raw data can't exist is still
>> there.
>
> I insist on using the split bsf, but i can try to remove the merge one
> and do that within lavf, to avoid creating packets with OBU framing.

 Why is splitting not simply done inside lavf (and inside the demuxer,
 not the generic code in demux.c)? What is the advantage of that?
>>>
>>> Not making a mess in mov.c's read_packet() from reiterated calls because
>>> one Track Sample has packets for several AVStreams.
>>
>> Mess? All you would need to do is add a check at the beginning of
>> read_packet whether there are any more packets buffered. If so, return
>> them, if not, read new data.
> 
> Buffered where? Internally in the demuxer?
> 

That's it: We add a new function (may be an inline wrapper for
avpriv_packet_list_put()) for demuxers to append multiple packets to the
raw_packet_buffer queue in a single read_packet call. That way the
ordinary (already existing) logic in ff_read_frame() will take care of
everything.

- 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 1/4] checkasm/rv34dsp: add rv34_inv_transform_dc test

2024-02-12 Thread Rémi Denis-Courmont
Le perjantaina 2. helmikuuta 2024, 2.47.16 EET flow gg a écrit :
> It seems to be caused by movd m0, r1d in libavcodec/x86/rv34dsp.asm? I'm
> not quite sure.

If it affects only MMX and neither SSE nor AVX, add a patch to remove the 
offending code altogether.

It's ridiculous to hold checkasm tests off because of broken legacy code.

-- 
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 4/4] lavc/rv34dsp: R-V V rv34_idct_dc_add

2024-02-12 Thread Rémi Denis-Courmont
Le keskiviikkona 31. tammikuuta 2024, 19.58.55 EET flow gg a écrit :
> Fixed the rv32 break in this reply

It looks like widening add would avoid the sign extension.

Although you'd need as many instructions, since V lacks signed to unsigned 
clipping.

-- 
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 2/2] lavc/blockdsp: R-V V clear_blocks

2024-02-12 Thread Rémi Denis-Courmont
Le perjantaina 2. helmikuuta 2024, 3.14.39 EET flow gg a écrit :
> Ok, updated it in the reply

Sorry I meant directive, not macro. .rept is just fine here.

-- 
レミ・デニ-クールモン
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] lavc/vp8dsp: R-V V vp8_idct_dc_add

2024-02-12 Thread Rémi Denis-Courmont
Hi,

I think you cna use vwadd here?

-- 
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 2/3] lavc/vp8dsp: R-V V vp8_idct_dc_add4y

2024-02-12 Thread Rémi Denis-Courmont
Hi,

To avoid repeating the code, you can either use .repr or .irp. You can even 
use assembler conditionals to elide the redundant code on the last iteration.

-- 
レミ・デニ-クールモン
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/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread James Almer

On 2/12/2024 3:24 PM, Andreas Rheinhardt wrote:

James Almer:

On 2/12/2024 2:28 PM, Andreas Rheinhardt wrote:

James Almer:



On 2/12/2024 2:04 PM, Andreas Rheinhardt wrote:

James Almer:

On 2/12/2024 1:40 PM, Andreas Rheinhardt wrote:

James Almer:

On 2/6/2024 10:05 AM, James Almer wrote:

Signed-off-by: James Almer 
---
Now reading decriptors from extradata, plus a setting to ensure any
descriptors
present inband are omitted has been added.

  doc/bitstream_filters.texi    |  16 +
  libavcodec/bitstream_filters.c    |   1 +
  libavcodec/bsf/Makefile   |   1 +
  libavcodec/bsf/iamf_frame_split_bsf.c | 887
++
  4 files changed, 905 insertions(+)
  create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c


Will apply the set soon if there are no objections.


I still object to the BSF in #1 existing as it just duplicates
parsing
code into lavc and lavf. And the issue with creating new framings for
stuff for which no framing except raw data can't exist is still
there.


I insist on using the split bsf, but i can try to remove the merge one
and do that within lavf, to avoid creating packets with OBU framing.


Why is splitting not simply done inside lavf (and inside the demuxer,
not the generic code in demux.c)? What is the advantage of that?


Not making a mess in mov.c's read_packet() from reiterated calls because
one Track Sample has packets for several AVStreams.


Mess? All you would need to do is add a check at the beginning of
read_packet whether there are any more packets buffered. If so, return
them, if not, read new data.


Buffered where? Internally in the demuxer?



That's it: We add a new function (may be an inline wrapper for
avpriv_packet_list_put()) for demuxers to append multiple packets to the
raw_packet_buffer queue in a single read_packet call. That way the
ordinary (already existing) logic in ff_read_frame() will take care of
everything.


ff_read_packet() fills some fields on the AVPackets returned by 
iformat->read_packet() before buffering them in raw_packet_buffer. 
Doesn't look like the demuxer should be put things in raw_packet_buffer 
on its own.

___
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/7 v4] avcodec: add an Immersive Audio Model and Formats frame split bsf

2024-02-12 Thread Andreas Rheinhardt
James Almer:
> On 2/12/2024 3:24 PM, Andreas Rheinhardt wrote:
>> James Almer:
>>> On 2/12/2024 2:28 PM, Andreas Rheinhardt wrote:
 James Almer:
>
>
> On 2/12/2024 2:04 PM, Andreas Rheinhardt wrote:
>> James Almer:
>>> On 2/12/2024 1:40 PM, Andreas Rheinhardt wrote:
 James Almer:
> On 2/6/2024 10:05 AM, James Almer wrote:
>> Signed-off-by: James Almer 
>> ---
>> Now reading decriptors from extradata, plus a setting to
>> ensure any
>> descriptors
>> present inband are omitted has been added.
>>
>>   doc/bitstream_filters.texi    |  16 +
>>   libavcodec/bitstream_filters.c    |   1 +
>>   libavcodec/bsf/Makefile   |   1 +
>>   libavcodec/bsf/iamf_frame_split_bsf.c | 887
>> ++
>>   4 files changed, 905 insertions(+)
>>   create mode 100644 libavcodec/bsf/iamf_frame_split_bsf.c
>
> Will apply the set soon if there are no objections.

 I still object to the BSF in #1 existing as it just duplicates
 parsing
 code into lavc and lavf. And the issue with creating new
 framings for
 stuff for which no framing except raw data can't exist is still
 there.
>>>
>>> I insist on using the split bsf, but i can try to remove the
>>> merge one
>>> and do that within lavf, to avoid creating packets with OBU framing.
>>
>> Why is splitting not simply done inside lavf (and inside the demuxer,
>> not the generic code in demux.c)? What is the advantage of that?
>
> Not making a mess in mov.c's read_packet() from reiterated calls
> because
> one Track Sample has packets for several AVStreams.

 Mess? All you would need to do is add a check at the beginning of
 read_packet whether there are any more packets buffered. If so, return
 them, if not, read new data.
>>>
>>> Buffered where? Internally in the demuxer?
>>>
>>
>> That's it: We add a new function (may be an inline wrapper for
>> avpriv_packet_list_put()) for demuxers to append multiple packets to the
>> raw_packet_buffer queue in a single read_packet call. That way the
>> ordinary (already existing) logic in ff_read_frame() will take care of
>> everything.
> 
> ff_read_packet() fills some fields on the AVPackets returned by
> iformat->read_packet() before buffering them in raw_packet_buffer.
> Doesn't look like the demuxer should be put things in raw_packet_buffer
> on its own.

Yes, I noticed that a bit after writing my mail. It means this thing
will not be inline. (And as long as it is done by an explicit function
in demux.[ch], it is not the demuxer who does this on its own.)

- 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 1/5] avutil/channel_layout: change AV_CHAN_SILENCE to AV_CHAN_UNUSED in the docs

2024-02-12 Thread Marton Balint
It got renamed during the API design phase.

Signed-off-by: Marton Balint 
---
 libavutil/channel_layout.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index 7ee5333ea8..b8bff6f365 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -119,7 +119,7 @@ enum AVChannelOrder {
 /**
  * The channel order does not correspond to any other predefined order and
  * is stored as an explicit map. For example, this could be used to support
- * layouts with 64 or more channels, or with empty/skipped 
(AV_CHAN_SILENCE)
+ * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_UNUSED)
  * channels at arbitrary positions.
  */
 AV_CHANNEL_ORDER_CUSTOM,
-- 
2.35.3

___
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/5] avutil/channel_layout: add AV_CHANNEL_ORDER_NB

2024-02-12 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavutil/channel_layout.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index b8bff6f365..db0c005e87 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -146,6 +146,10 @@ enum AVChannelOrder {
  * as defined in AmbiX format $ 2.1.
  */
 AV_CHANNEL_ORDER_AMBISONIC,
+/**
+ * Number of channel orders, not part of ABI/API
+ */
+AV_CHANNEL_ORDER_NB
 };
 
 
-- 
2.35.3

___
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/5] avutil/tests/channel_layout: add tests for av_channel_order_retype

2024-02-12 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavutil/tests/channel_layout.c | 63 
 tests/ref/fate/channel_layout| 27 ++
 2 files changed, 90 insertions(+)

diff --git a/libavutil/tests/channel_layout.c b/libavutil/tests/channel_layout.c
index c537e7e710..d83839700c 100644
--- a/libavutil/tests/channel_layout.c
+++ b/libavutil/tests/channel_layout.c
@@ -24,6 +24,7 @@
 
 #include "libavutil/bprint.h"
 #include "libavutil/channel_layout.h"
+#include "libavutil/error.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem.h"
 
@@ -112,6 +113,53 @@ static void channel_layout_from_string(AVChannelLayout 
*layout,
 av_bprintf(bp, "fail");
 }
 
+static const char* channel_order_names[AV_CHANNEL_ORDER_NB]  = {"UNSPEC", 
"NATIVE", "CUSTOM", "AMBI"};
+
+static void describe_type(AVBPrint *bp, AVChannelLayout *layout)
+{
+if (layout->order >= 0 && layout->order < AV_CHANNEL_ORDER_NB) {
+av_bprintf(bp, "%-6s (", channel_order_names[layout->order]);
+av_channel_layout_describe_bprint(layout, bp);
+av_bprintf(bp, ")");
+} else {
+av_bprintf(bp, "???");
+}
+}
+
+static const char *channel_layout_retype(AVChannelLayout *layout, AVBPrint 
*bp, const char *channel_layout)
+{
+av_channel_layout_uninit(layout);
+av_bprint_clear(bp);
+if (!av_channel_layout_from_string(layout, channel_layout) &&
+av_channel_layout_check(layout)) {
+describe_type(bp, layout);
+for (int i = 0; i < AV_CHANNEL_ORDER_NB; i++) {
+int ret;
+AVChannelLayout copy = {0};
+av_bprintf(bp, "\n ");
+if (av_channel_layout_copy(©, layout) < 0)
+return "nomem";
+ret = av_channel_layout_retype(©, i, 0);
+if (ret < 0 && (copy.order != layout->order || 
av_channel_layout_compare(©, layout)))
+av_bprintf(bp, "failed to keep existing layout on failure ");
+if (ret >= 0 && copy.order != i)
+av_bprintf(bp, "returned success but did not change order ");
+if (ret == AVERROR(ENOSYS)) {
+av_bprintf(bp, " != %s", channel_order_names[i]);
+} else if (ret < 0) {
+av_bprintf(bp, "FAIL");
+} else {
+av_bprintf(bp, " %s ", ret ? "~~" : "==");
+describe_type(bp, ©);
+}
+av_channel_layout_uninit(©);
+}
+} else {
+av_bprintf(bp, "fail");
+}
+return bp->str;
+}
+
 #define CHANNEL_NAME(x)\
 channel_name(&bp, (x));
 
@@ -437,5 +485,20 @@ int main(void)
 av_channel_layout_uninit(&layout2);
 av_bprint_finalize(&bp, NULL);
 
+printf("\nTesting av_channel_layout_retype\n");
+{
+const char* layouts[] = {
+"FL@Boo",
+"stereo",
+"FR+FL",
+"ambisonic 2+stereo",
+"2C",
+NULL
+};
+for (int i = 0; layouts[i]; i++) {
+printf("With \"%s\": %s\n", layouts[i], 
channel_layout_retype(&layout, &bp, layouts[i]));
+}
+}
+
 return 0;
 }
diff --git a/tests/ref/fate/channel_layout b/tests/ref/fate/channel_layout
index ab9bee947b..1d1f1cb082 100644
--- a/tests/ref/fate/channel_layout
+++ b/tests/ref/fate/channel_layout
@@ -185,3 +185,30 @@ On "ambisonic 2+stereo" layout with 11:
-1
 Testing av_channel_layout_subset
 On "ambisonic 2+stereo" layout with AV_CH_LAYOUT_STEREO:  0x3
 On "ambisonic 2+stereo" layout with AV_CH_LAYOUT_QUAD:0x3
+
+Testing av_channel_layout_retype
+With "FL@Boo": CUSTOM (1 channels (FL@Boo))
+  ~~ UNSPEC (1 channels)
+  ~~ NATIVE (1 channels (FL))
+  == CUSTOM (1 channels (FL@Boo))
+  != AMBI
+With "stereo": NATIVE (stereo)
+  ~~ UNSPEC (2 channels)
+  == NATIVE (stereo)
+  == CUSTOM (2 channels (FL+FR))
+  != AMBI
+With "FR+FL": CUSTOM (2 channels (FR+FL))
+  ~~ UNSPEC (2 channels)
+  != NATIVE
+  == CUSTOM (2 channels (FR+FL))
+  != AMBI
+With "ambisonic 2+stereo": AMBI   (ambisonic 2+stereo)
+  ~~ UNSPEC (11 channels)
+  != NATIVE
+  == CUSTOM (ambisonic 2+2 channels (FL+FR))
+  == AMBI   (ambisonic 2+stereo)
+With "2C": UNSPEC (2 channels)
+  == UNSPEC (2 channels)
+  != NATIVE
+  == CUSTOM (2 channels (USR768+USR768))
+  != AMBI
-- 
2.35.3

___
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/5] avformat/mov: factorize reading the main part of the chnl atom to mov_chan

2024-02-12 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/mov.c  | 58 +++--
 libavformat/mov_chan.c | 59 ++
 libavformat/mov_chan.h | 10 +++
 3 files changed, 73 insertions(+), 54 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 42b0135987..52436d71d6 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -953,9 +953,8 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 static int mov_read_chnl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 int64_t end = av_sat_add64(avio_tell(pb), atom.size);
-int stream_structure;
 int version, flags;
-int ret = 0;
+int ret;
 AVStream *st;
 
 if (c->fc->nb_streams < 1)
@@ -971,58 +970,9 @@ static int mov_read_chnl(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return AVERROR_INVALIDDATA;
 }
 
-stream_structure = avio_r8(pb);
-
-// stream carries channels
-if (stream_structure & 1) {
-int layout = avio_r8(pb);
-
-av_log(c->fc, AV_LOG_TRACE, "'chnl' layout %d\n", layout);
-if (!layout) {
-uint8_t *positions = 
av_malloc(st->codecpar->ch_layout.nb_channels);
-
-if (!positions)
-return AVERROR(ENOMEM);
-for (int i = 0; i < st->codecpar->ch_layout.nb_channels; i++) {
-int speaker_pos = avio_r8(pb);
-
-av_log(c->fc, AV_LOG_TRACE, "speaker_position %d\n", 
speaker_pos);
-if (speaker_pos == 126) { // explicit position
-avpriv_request_sample(c->fc, "explicit position");
-av_freep(&positions);
-return AVERROR_PATCHWELCOME;
-} else {
-positions[i] = speaker_pos;
-}
-}
-
-ret = ff_mov_get_layout_from_channel_positions(positions,
-st->codecpar->ch_layout.nb_channels,
-&st->codecpar->ch_layout);
-av_freep(&positions);
-if (ret) {
-av_log(c->fc, AV_LOG_ERROR,
-"get channel layout from speaker positions failed, 
%s\n",
-av_err2str(ret));
-return ret;
-}
-} else {
-uint64_t omitted_channel_map = avio_rb64(pb);
-
-if (omitted_channel_map) {
-avpriv_request_sample(c->fc, "omitted_channel_map 0x%" PRIx64 
" != 0",
-  omitted_channel_map);
-return AVERROR_PATCHWELCOME;
-}
-ff_mov_get_channel_layout_from_config(layout, 
&st->codecpar->ch_layout);
-}
-}
-
-// stream carries objects
-if (stream_structure & 2) {
-int obj_count = avio_r8(pb);
-av_log(c->fc, AV_LOG_TRACE, "'chnl' with object_count %d\n", 
obj_count);
-}
+ret = ff_mov_read_chnl(c->fc, pb, st);
+if (ret < 0)
+return ret;
 
 if (avio_tell(pb) != end) {
 av_log(c->fc, AV_LOG_WARNING, "skip %" PRId64 " bytes of unknown data 
inside chnl\n",
diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index 79768bc210..cce9d7a697 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -863,3 +863,62 @@ error:
 av_channel_layout_uninit(layout);
 return ret;
 }
+
+int ff_mov_read_chnl(AVFormatContext *s, AVIOContext *pb, AVStream *st)
+{
+int stream_structure = avio_r8(pb);
+int ret;
+
+// stream carries channels
+if (stream_structure & 1) {
+int layout = avio_r8(pb);
+
+av_log(s, AV_LOG_TRACE, "'chnl' layout %d\n", layout);
+if (!layout) {
+uint8_t *positions = 
av_malloc(st->codecpar->ch_layout.nb_channels);
+
+if (!positions)
+return AVERROR(ENOMEM);
+for (int i = 0; i < st->codecpar->ch_layout.nb_channels; i++) {
+int speaker_pos = avio_r8(pb);
+
+av_log(s, AV_LOG_TRACE, "speaker_position %d\n", speaker_pos);
+if (speaker_pos == 126) { // explicit position
+avpriv_request_sample(s, "explicit position");
+av_freep(&positions);
+return AVERROR_PATCHWELCOME;
+} else {
+positions[i] = speaker_pos;
+}
+}
+
+ret = ff_mov_get_layout_from_channel_positions(positions,
+st->codecpar->ch_layout.nb_channels,
+&st->codecpar->ch_layout);
+av_freep(&positions);
+if (ret) {
+av_log(s, AV_LOG_ERROR,
+"get channel layout from speaker positions failed, 
%s\n",
+av_err2str(ret));
+return ret;
+}
+} else {
+uint64_t omitted_channel_map = avio_rb64(pb);
+
+if (omitted_channel_map) {
+avpriv_requ

[FFmpeg-devel] [PATCH 5/5] avformat/mov: rework ff_mov_read_chnl

2024-02-12 Thread Marton Balint
A lot of changes and fixes to channel layout parsing, notably
- get rid of dynamic allocation of channel positions
- signal unimplemented speaker positions as unknown instead of failure, but
  warn the user about it
- native order, and that a single channel only appears once was always assumed
  for less than 64 channels, obviously this was incorrect

Signed-off-by: Marton Balint 
---
 libavformat/mov_chan.c | 106 ++---
 libavformat/mov_chan.h |   6 ---
 2 files changed, 26 insertions(+), 86 deletions(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index cce9d7a697..3e186b0837 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -804,66 +804,6 @@ int ff_mov_get_channel_positions_from_layout(const 
AVChannelLayout *layout,
 return 0;
 }
 
-int ff_mov_get_layout_from_channel_positions(const uint8_t *position, int 
position_num,
- AVChannelLayout *layout)
-{
-int ret;
-enum AVChannel channel;
-
-av_channel_layout_uninit(layout);
-
-if (position_num <= 63) {
-layout->order = AV_CHANNEL_ORDER_NATIVE;
-layout->nb_channels = position_num;
-for (int i = 0; i < position_num; i++) {
-if (position[i] >= FF_ARRAY_ELEMS(iso_channel_position)) {
-ret = AVERROR_PATCHWELCOME;
-goto error;
-}
-
-channel = iso_channel_position[position[i]];
-// unsupported layout
-if (channel == AV_CHAN_NONE) {
-ret = AVERROR_PATCHWELCOME;
-goto error;
-}
-
-layout->u.mask |= 1ULL << channel;
-}
-} else {
-layout->order = AV_CHANNEL_ORDER_CUSTOM;
-layout->nb_channels = position_num;
-layout->u.map = av_calloc(position_num, sizeof(*layout->u.map));
-if (!layout->u.map) {
-ret = AVERROR(ENOMEM);
-goto error;
-}
-
-for (int i = 0; i < position_num; i++) {
-if (position[i] >= FF_ARRAY_ELEMS(iso_channel_position)) {
-ret = AVERROR_PATCHWELCOME;
-goto error;
-}
-
-channel = iso_channel_position[position[i]];
-// unsupported layout
-if (channel == AV_CHAN_NONE) {
-ret = AVERROR_PATCHWELCOME;
-goto error;
-}
-
-layout->u.map[i].id = channel;
-}
-}
-
-
-return 0;
-
-error:
-av_channel_layout_uninit(layout);
-return ret;
-}
-
 int ff_mov_read_chnl(AVFormatContext *s, AVIOContext *pb, AVStream *st)
 {
 int stream_structure = avio_r8(pb);
@@ -875,33 +815,39 @@ int ff_mov_read_chnl(AVFormatContext *s, AVIOContext *pb, 
AVStream *st)
 
 av_log(s, AV_LOG_TRACE, "'chnl' layout %d\n", layout);
 if (!layout) {
-uint8_t *positions = 
av_malloc(st->codecpar->ch_layout.nb_channels);
+AVChannelLayout *ch_layout = &st->codecpar->ch_layout;
+int nb_channels = ch_layout->nb_channels;
+
+av_channel_layout_uninit(ch_layout);
+ret = av_channel_layout_custom_init(ch_layout, nb_channels);
+if (ret < 0)
+return ret;
 
-if (!positions)
-return AVERROR(ENOMEM);
-for (int i = 0; i < st->codecpar->ch_layout.nb_channels; i++) {
+for (int i = 0; i < nb_channels; i++) {
 int speaker_pos = avio_r8(pb);
+enum AVChannel channel;
+
+if (speaker_pos == 126) // explicit position
+avio_skip(pb, 3);   // azimuth, elevation
 
-av_log(s, AV_LOG_TRACE, "speaker_position %d\n", speaker_pos);
-if (speaker_pos == 126) { // explicit position
-avpriv_request_sample(s, "explicit position");
-av_freep(&positions);
-return AVERROR_PATCHWELCOME;
-} else {
-positions[i] = speaker_pos;
+if (speaker_pos >= FF_ARRAY_ELEMS(iso_channel_position))
+channel = AV_CHAN_NONE;
+else
+channel = iso_channel_position[speaker_pos];
+
+if (channel == AV_CHAN_NONE) {
+av_log(s, AV_LOG_WARNING, "speaker position %d is not 
implemented\n", speaker_pos);
+channel = AV_CHAN_UNKNOWN;
 }
+
+ch_layout->u.map[i].id = channel;
 }
 
-ret = ff_mov_get_layout_from_channel_positions(positions,
-st->codecpar->ch_layout.nb_channels,
-&st->codecpar->ch_layout);
-av_freep(&positions);
-if (ret) {
-av_log(s, AV_LOG_ERROR,
-"get channel layout from speaker positions failed, 
%s\n",
-av_err2str(ret));
+ret = av_channel

Re: [FFmpeg-devel] [PATCH 01/23] avutil/hwcontext_opencl: Use proper OpenCLFramesContext

2024-02-12 Thread Mark Thompson

On 12/02/2024 00:01, Andreas Rheinhardt wrote:

The currently used pointer when unmapping DXVA2 and D3D11
actually points to an OpenCLDeviceContext.

Signed-off-by: Andreas Rheinhardt 
---
1. I'd appreciate testing of this.


DXVA2 mapping tested and working on AMD.  D3D11 mapping doesn't work on AMD for 
unrelated reasons.

D3D11 mapping tested and working on Intel.  DXVA2 didn't work on that test 
machine at all (old laptop, I think Nvidia was causing the problem).


2. Most of the patches in this patchset can be applied immediately;
only those two patches that remove AVHWDeviceInternal and
AVHWFramesInternal need to be applied at the bump.

  libavutil/hwcontext_opencl.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
index 247834aaf6..c1764ed098 100644
--- a/libavutil/hwcontext_opencl.c
+++ b/libavutil/hwcontext_opencl.c
@@ -2346,7 +2346,7 @@ static void opencl_unmap_from_dxva2(AVHWFramesContext 
*dst_fc,
  {
  AVOpenCLFrameDescriptor*desc = hwmap->priv;
  OpenCLDeviceContext *device_priv = dst_fc->device_ctx->internal->priv;
-OpenCLFramesContext *frames_priv = dst_fc->device_ctx->internal->priv;
+OpenCLFramesContext *frames_priv = dst_fc->internal->priv;
  cl_event event;
  cl_int cle;
  
@@ -2511,7 +2511,7 @@ static void opencl_unmap_from_d3d11(AVHWFramesContext *dst_fc,

  {
  AVOpenCLFrameDescriptor*desc = hwmap->priv;
  OpenCLDeviceContext *device_priv = dst_fc->device_ctx->internal->priv;
-OpenCLFramesContext *frames_priv = dst_fc->device_ctx->internal->priv;
+OpenCLFramesContext *frames_priv = dst_fc->internal->priv;
  cl_event event;
  cl_int cle;
  


LGTM, good spot.

Thanks,

- Mark
___
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/5] avutil/channel_layout: change AV_CHAN_SILENCE to AV_CHAN_UNUSED in the docs

2024-02-12 Thread James Almer

On 2/12/2024 6:15 PM, Marton Balint wrote:

It got renamed during the API design phase.

Signed-off-by: Marton Balint 
---
  libavutil/channel_layout.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index 7ee5333ea8..b8bff6f365 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -119,7 +119,7 @@ enum AVChannelOrder {
  /**
   * The channel order does not correspond to any other predefined order and
   * is stored as an explicit map. For example, this could be used to 
support
- * layouts with 64 or more channels, or with empty/skipped 
(AV_CHAN_SILENCE)
+ * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_UNUSED)
   * channels at arbitrary positions.
   */
  AV_CHANNEL_ORDER_CUSTOM,


Good catch, LGTM. This should be backported too.
___
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] lavc/bsf: add a showinfo filter

2024-02-12 Thread Alexander Strasser via ffmpeg-devel
On 2024-01-29 19:42 +0100, Anton Khirnov wrote:
[...]
> --- a/doc/bitstream_filters.texi
> +++ b/doc/bitstream_filters.texi
> @@ -887,6 +887,10 @@ For example, to set PTS equal to DTS (not recommended if 
> B-frames are involved):
>  ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
>  @end example
>
> +@section showinfo
> +Log basic packet information. Mainly useful for testing, debugging,
> +and development.
> +

Maybe it's a good idea to state something about the stability of
the output format. I assume it's to be treated like other logging
and is not expected to stay stable. Not sure how much it helps to
state it clearly, but it can't hurt IMHO.


[...]
> --- /dev/null
> +++ b/libavcodec/bsf/showinfo.c
[...]
> +static int showinfo_filter(AVBSFContext *ctx, AVPacket *pkt)
> +{
> +ShowinfoContext *priv = ctx->priv_data;
> +
> +while (1) {
> +int ret;
> +
> +ret = ff_bsf_get_packet_ref(ctx, pkt);
> +if (ret < 0)
> +return ret;
> +
> +av_log(ctx, AV_LOG_INFO,
> +   "n:%7"PRIu64" "
> +   "size:%7d "
> +   "pts:%s pt:%s "
> +   "dts:%s dt:%s "
> +   "ds:%"PRId64" d:%s "
> +   "\n",
> +   priv->nb_packets, pkt->size,
> +   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, 
> &ctx->time_base_in),
> +   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, 
> &ctx->time_base_in),
> +   pkt->duration, av_ts2timestr(pkt->duration, 
> &ctx->time_base_in));
> +
> +priv->nb_packets++;
> +
> +return 0;
> +}
> +}

It's late here and I surely must be missing something. Anyway,
why do we use a while loop here?


Best regards,
  Alexander

[...]
___
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] lavc/libvpxenc: add screen-content-mode option

2024-02-12 Thread James Zern via ffmpeg-devel
On Sat, Feb 10, 2024 at 12:22 AM Dariusz Marcinkiewicz via
ffmpeg-devel  wrote:
>
> This exposes VP8E_SET_SCREEN_CONTENT_MODE option from libvpx.
>
> Co-authored-by: Erik Språng 
> Signed-off-by: Dariusz Marcinkiewicz 
> ---
>  doc/encoders.texi  |  3 +++
>  libavcodec/libvpxenc.c | 11 +++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index c9fe6d6143..0868aa66db 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -2150,6 +2150,9 @@ of quality.
>  Set a change threshold on blocks below which they will be skipped by the
>  encoder.
>
> +@item screen-content-mode
> +Screen content mode, one of: off (0), screen (1), screen with more 
> aggressive rate control (2).
> +

Move this above 'VP9-specific options' and add a section for VP8. Also
reword this to '...one of: 0 (off), 1 (screen), ...'. The parameter is
an integer so should list that first, similar to aq-mode.

>  @item slices (@emph{token-parts})
>  Note that FFmpeg's @option{slices} option gives the total number of 
> partitions,
>  while @command{vpxenc}'s @option{token-parts} is given as
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 80988a2608..0d507beaae 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -102,6 +102,7 @@ typedef struct VPxEncoderContext {
>  #define VP8F_AUTO_ALT_REF0x0002 ///< Enable automatic alternate 
> reference frame generation
>
>  int auto_alt_ref;
> +int screen_content_mode;
>

Move this above '// VP9-only' and add '// VP8-only'.

> [...]
> @@ -1946,6 +1956,7 @@ static const AVOption vp8_options[] = {
>  { "auto-alt-ref","Enable use of alternate reference "
>   "frames (2-pass only)",
> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE},
>  { "cpu-used","Quality/Speed ratio modifier",
> OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE},
> +{ "screen-content-mode", "Encoder screen content mode", 
> OFFSET(screen_content_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE, 
> "screen_content_mode"},

Remove the last item, "screen_content_mode". This no longer describes
a group of options.
___
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] x86: Remove MMX assembly rv34_inv_transform_dc in rv34dsp

2024-02-12 Thread flow gg
checkasm in [FFmpeg-devel] [PATCH 1/4] checkasm/rv34dsp: add
rv34_inv_transform_dc test
From 1aa51d60def8d4313c1b11a50528662ec832530e Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Tue, 13 Feb 2024 08:41:20 +0800
Subject: [PATCH] x86: Remove MMX assembly rv34_inv_transform_dc in rv34dsp

This asm will cause checkasm to fail.
---
 libavcodec/x86/rv34dsp.asm| 12 
 libavcodec/x86/rv34dsp_init.c |  2 --
 2 files changed, 14 deletions(-)

diff --git a/libavcodec/x86/rv34dsp.asm b/libavcodec/x86/rv34dsp.asm
index f29bfd715c..82704843e6 100644
--- a/libavcodec/x86/rv34dsp.asm
+++ b/libavcodec/x86/rv34dsp.asm
@@ -44,18 +44,6 @@ SECTION .text
 sar%1, 10
 %endmacro
 
-INIT_MMX mmxext
-cglobal rv34_idct_dc_noround, 1, 2, 0
-movsx   r1, word [r0]
-IDCT_DC_NOROUND r1
-movdm0, r1d
-pshufw  m0, m0, 0
-movq[r0+ 0], m0
-movq[r0+ 8], m0
-movq[r0+16], m0
-movq[r0+24], m0
-RET
-
 ; Load coeffs and perform row transform
 ; Output: coeffs in mm[0467], rounder in mm5
 %macro ROW_TRANSFORM  1
diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c
index caa5c2d653..b865201cd2 100644
--- a/libavcodec/x86/rv34dsp_init.c
+++ b/libavcodec/x86/rv34dsp_init.c
@@ -25,7 +25,6 @@
 #include "libavcodec/rv34dsp.h"
 
 void ff_rv34_idct_dc_mmxext(int16_t *block);
-void ff_rv34_idct_dc_noround_mmxext(int16_t *block);
 void ff_rv34_idct_dc_add_sse2(uint8_t *dst, ptrdiff_t stride, int dc);
 void ff_rv34_idct_dc_add_sse4(uint8_t *dst, ptrdiff_t stride, int dc);
 void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
@@ -35,7 +34,6 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
 int cpu_flags = av_get_cpu_flags();
 
 if (EXTERNAL_MMXEXT(cpu_flags)) {
-c->rv34_inv_transform_dc = ff_rv34_idct_dc_noround_mmxext;
 c->rv34_idct_add = ff_rv34_idct_add_mmxext;
 }
 if (EXTERNAL_SSE2(cpu_flags))
-- 
2.43.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 2/2] lavc/vulkan_av1: port to the new stable API

2024-02-12 Thread Benjamin Cheng via ffmpeg-devel
On Sun Feb 11, 2024 at 10:15 AM EST, Lynne wrote:
> From: Lynne 
> Date: Fri, 19 Jan 2024 10:49:02 +1000
> Subject: [PATCH v4 2/2] lavc/vulkan_av1: port to the new stable API
> 
> Most of this patch was written by Dave Airlie ,
> with some additions by me.
> ---
>  configure |   4 +-
>  libavcodec/Makefile   |   3 +-
>  libavcodec/av1.h  |   2 +
>  libavcodec/vulkan_av1.c   | 477 ++
>  libavcodec/vulkan_decode.c|  24 +-
>  libavcodec/vulkan_decode.h|   2 +-
>  libavcodec/vulkan_video.c |   2 +-
>  libavcodec/vulkan_video.h |   2 -
>  libavcodec/vulkan_video_codec_av1std.h| 403 ---
>  libavcodec/vulkan_video_codec_av1std_decode.h |  36 --
>  libavutil/hwcontext_vulkan.c  |   2 +-
>  libavutil/vulkan_functions.h  |   2 +-
>  libavutil/vulkan_loader.h |   2 +-
>  13 files changed, 277 insertions(+), 684 deletions(-)
>  delete mode 100644 libavcodec/vulkan_video_codec_av1std.h
>  delete mode 100644 libavcodec/vulkan_video_codec_av1std_decode.h
> 
> diff --git a/configure b/configure
> index f72533b7d2..9a3a451115 100755
> --- a/configure
> +++ b/configure
> @@ -7225,8 +7225,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h 
> libcrystalhd/libcrystalhd_if.
>   "in maintaining it."
>  
>  if enabled vulkan; then
> -check_pkg_config_header_only vulkan "vulkan >= 1.3.255" 
> "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
> -check_cpp_condition vulkan "vulkan/vulkan.h" 
> "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 
> 255)"
> +check_pkg_config_header_only vulkan "vulkan >= 1.3.277" 
> "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
> +check_cpp_condition vulkan "vulkan/vulkan.h" 
> "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 
> 277)"
>  fi
>  
>  if disabled vulkan; then
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 470d7cb9b1..581415f3b7 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -1262,7 +1262,6 @@ SKIPHEADERS+= %_tablegen.h  
> \
>aacenc_quantization.h \
>aacenc_quantization_misc.h\
>bitstream_template.h  \
> -  vulkan_video_codec_av1std.h   \
>$(ARCH)/vpx_arith.h  \
>  
>  SKIPHEADERS-$(CONFIG_AMF)  += amfenc.h
> @@ -1285,7 +1284,7 @@ SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
>  SKIPHEADERS-$(CONFIG_VAAPI)+= vaapi_decode.h vaapi_hevc.h 
> vaapi_encode.h
>  SKIPHEADERS-$(CONFIG_VDPAU)+= vdpau.h vdpau_internal.h
>  SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h
> -SKIPHEADERS-$(CONFIG_VULKAN)   += vulkan.h vulkan_video.h 
> vulkan_decode.h vulkan_video_codec_av1std_decode.h
> +SKIPHEADERS-$(CONFIG_VULKAN)   += vulkan.h vulkan_video.h 
> vulkan_decode.h
>  SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h 
> v4l2_m2m.h
>  SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h
>  
> diff --git a/libavcodec/av1.h b/libavcodec/av1.h
> index 8704bc41c1..18d5fa9e7f 100644
> --- a/libavcodec/av1.h
> +++ b/libavcodec/av1.h
> @@ -121,6 +121,8 @@ enum {
>  AV1_DIV_LUT_NUM   = 257,
>  
>  AV1_MAX_LOOP_FILTER = 63,
> +
> +AV1_RESTORATION_TILESIZE_MAX = 256,
>  };
>  
>  
> diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c
> index 9730e4b08d..641ee3e4bf 100644
> --- a/libavcodec/vulkan_av1.c
> +++ b/libavcodec/vulkan_av1.c
> @@ -31,22 +31,36 @@ const VkExtensionProperties ff_vk_dec_av1_ext = {
>  typedef struct AV1VulkanDecodePicture {
>  FFVulkanDecodePicture   vp;
>  
> -/* Workaround for a spec issue.
> - *Can be removed once no longer needed, and threading can be enabled. */
> +/* TODO: investigate if this can be removed to make decoding completely
> + * independent. */
>  FFVulkanDecodeContext  *dec;
>  
> -StdVideoAV1MESATiletiles[MAX_TILES];
> -StdVideoAV1MESATileListtile_list;
> -const uint32_t*tile_offsets;
> +uint32_t tile_count;
> +uint32_t tile_sizes[MAX_TILES];
> +const uint32_t *tile_offsets;
>  
>  /* Current picture */
> -VkVideoDecodeAV1DpbSlotInfoMESAvkav1_ref;
> -StdVideoAV1MESAFrameHeader av1_frame_header;
> -VkVideoDecodeAV1PictureInfoMESAav1_pic_info;
> +StdVideoDecodeAV1ReferenceInfo std_ref;
> +VkVideoDecodeAV1DpbSlotInfoKHR vkav1_ref;
> +uint16_t width_in_sbs_minus1[64];
> +uint16_t height_in_sbs_minus1[64];
> +uint1

Re: [FFmpeg-devel] [PATCH 2/2] lavc/blockdsp: R-V V clear_blocks

2024-02-12 Thread flow gg
ok, updated it in the reply

Rémi Denis-Courmont  于2024年2月13日周二 03:49写道:

> Le perjantaina 2. helmikuuta 2024, 3.14.39 EET flow gg a écrit :
> > Ok, updated it in the reply
>
> Sorry I meant directive, not macro. .rept is just fine here.
>
> --
> レミ・デニ-クールモン
> 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".
>
From 4af8c6a732197727e2d0e3b7a734a243031f4a81 Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Thu, 1 Feb 2024 15:41:09 +0800
Subject: [PATCH] lavc/blockdsp: R-V V clear_blocks

C908:
blockdsp.clear_blocks_c: 128.2
blockdsp.clear_blocks_rvv_i64: 102.5
---
 libavcodec/riscv/blockdsp_init.c |  2 ++
 libavcodec/riscv/blockdsp_rvv.S  | 13 +
 2 files changed, 15 insertions(+)

diff --git a/libavcodec/riscv/blockdsp_init.c b/libavcodec/riscv/blockdsp_init.c
index 5370418687..59b2f9d47b 100644
--- a/libavcodec/riscv/blockdsp_init.c
+++ b/libavcodec/riscv/blockdsp_init.c
@@ -26,6 +26,7 @@
 #include "libavcodec/blockdsp.h"
 
 void ff_clear_block_rvv(int16_t *block);
+void ff_clear_blocks_rvv(int16_t *block);
 
 av_cold void ff_blockdsp_init_riscv(BlockDSPContext *c)
 {
@@ -34,6 +35,7 @@ av_cold void ff_blockdsp_init_riscv(BlockDSPContext *c)
 
 if (flags & AV_CPU_FLAG_RVV_I64 && ff_get_rv_vlenb() >= 16) {
 c->clear_block = ff_clear_block_rvv;
+c->clear_blocks = ff_clear_blocks_rvv;
 }
 #endif
 }
diff --git a/libavcodec/riscv/blockdsp_rvv.S b/libavcodec/riscv/blockdsp_rvv.S
index e85697613a..8bb00bb467 100644
--- a/libavcodec/riscv/blockdsp_rvv.S
+++ b/libavcodec/riscv/blockdsp_rvv.S
@@ -27,3 +27,16 @@ func ff_clear_block_rvv, zve64x
 
 ret
 endfunc
+
+func ff_clear_blocks_rvv, zve64x
+vsetivli  zero, 16, e64, m8, ta, ma
+vmv.v.i   v0, 0
+
+.rept 5
+vse64.v   v0, (a0)
+addi  a0, a0, 128
+.endr
+vse64.v   v0, (a0)
+
+ret
+endfunc
-- 
2.43.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] avfilter/vf_signature: Dont crash on no frames

2024-02-12 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavfilter/vf_signature.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index 4896e8f2c11..53ed413a4ce 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -384,6 +384,9 @@ static int xml_export(AVFilterContext *ctx, StreamContext 
*sc, const char* filen
 FILE* f;
 unsigned int pot3[5] = { 3*3*3*3, 3*3*3, 3*3, 3, 1 };
 
+if (!sc->coarseend->last)
+return AVERROR(EINVAL); // No frames ?
+
 f = avpriv_fopen_utf8(filename, "w");
 if (!f) {
 int err = AVERROR(EINVAL);
-- 
2.17.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 4/4] lavc/rv34dsp: R-V V rv34_idct_dc_add

2024-02-12 Thread flow gg
I tested this in '[FFmpeg-devel] [PATCH] lavc/vc1dsp: R-V V inv_trans'. The
logic here is the same, using vext can reduce vset, making it a bit faster

Rémi Denis-Courmont  于2024年2月13日周二 03:46写道:

> Le keskiviikkona 31. tammikuuta 2024, 19.58.55 EET flow gg a écrit :
> > Fixed the rv32 break in this reply
>
> It looks like widening add would avoid the sign extension.
>
> Although you'd need as many instructions, since V lacks signed to unsigned
> clipping.
>
> --
> 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/3] lavc/vp8dsp: R-V V vp8_idct_dc_add

2024-02-12 Thread flow gg
xxx_idct_dc_add is quite similar because vext can reduce vset, so it is a
bit faster than using vwadd. This was tested when '[FFmpeg-devel] [PATCH]
lavc/vc1dsp: R-V V inv_trans'

Rémi Denis-Courmont  于2024年2月13日周二 03:53写道:

> Hi,
>
> I think you cna use vwadd here?
>
> --
> 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".


[FFmpeg-devel] [PATCH] avcodec/vvcdec: frame_context_setup, set fc->ref to NULL

2024-02-12 Thread Nuo Mi
fc->ref points to an old VVCFrame, which cannot be used after 
frame_context_setup.
This prevents crashes in decode_nal_units-->ff_vvc_report_frame_finished.

Signed-off-by: Frank Plowman 
---
 libavcodec/vvc/vvcdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c
index 8163b5ecb6..e88e746de4 100644
--- a/libavcodec/vvc/vvcdec.c
+++ b/libavcodec/vvc/vvcdec.c
@@ -594,6 +594,8 @@ static int frame_context_setup(VVCFrameContext *fc, 
VVCContext *s)
 {
 int ret;
 
+fc->ref = NULL;
+
 // copy refs from the last frame
 if (s->nb_frames && s->nb_fcs > 1) {
 VVCFrameContext *prev = get_frame_context(s, fc, -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 2/3] lavc/vp8dsp: R-V V vp8_idct_dc_add4y

2024-02-12 Thread flow gg
Okay, updated it in the reply

Rémi Denis-Courmont  于2024年2月13日周二 03:54写道:

> Hi,
>
> To avoid repeating the code, you can either use .repr or .irp. You can
> even
> use assembler conditionals to elide the redundant code on the last
> iteration.
>
> --
> レミ・デニ-クールモン
> 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".
>
From d44e7ec0950ddb431aa75992cfa12d7687d39514 Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Fri, 2 Feb 2024 12:50:07 +0800
Subject: [PATCH 2/3] lavc/vp8dsp: R-V V vp8_idct_dc_add4y

c908:
vp8_idct_dc_add4y_c: 368.5
vp8_idct_dc_add4y_rvv_i32: 134.5
---
 libavcodec/riscv/vp8dsp_init.c |  2 ++
 libavcodec/riscv/vp8dsp_rvv.S  | 16 
 2 files changed, 18 insertions(+)

diff --git a/libavcodec/riscv/vp8dsp_init.c b/libavcodec/riscv/vp8dsp_init.c
index ab020070eb..6615d3d440 100644
--- a/libavcodec/riscv/vp8dsp_init.c
+++ b/libavcodec/riscv/vp8dsp_init.c
@@ -26,6 +26,7 @@
 #include "libavcodec/vp8dsp.h"
 
 void ff_vp8_idct_dc_add_rvv(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
+void ff_vp8_idct_dc_add4y_rvv(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
 
 av_cold void ff_vp8dsp_init_riscv(VP8DSPContext *c)
 {
@@ -34,6 +35,7 @@ av_cold void ff_vp8dsp_init_riscv(VP8DSPContext *c)
 
 if (flags & AV_CPU_FLAG_RVV_I32 && ff_get_rv_vlenb() >= 16) {
 c->vp8_idct_dc_add = ff_vp8_idct_dc_add_rvv;
+c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_rvv;
 }
 #endif
 }
diff --git a/libavcodec/riscv/vp8dsp_rvv.S b/libavcodec/riscv/vp8dsp_rvv.S
index 8609b79937..a5a22188c1 100644
--- a/libavcodec/riscv/vp8dsp_rvv.S
+++ b/libavcodec/riscv/vp8dsp_rvv.S
@@ -36,9 +36,25 @@
 vsse32.v  v0, (a0), a2
 .endm
 
+.macro vp8_idct_dc_addy
+vp8_idct_dc_add
+addi  a0, a0, 4
+addi  a1, a1, 32
+.endm
+
 func ff_vp8_idct_dc_add_rvv, zve32x
 vsetivli  zero, 4, e8, mf4, ta, ma
 vp8_idct_dc_add
 
 ret
 endfunc
+
+func ff_vp8_idct_dc_add4y_rvv, zve32x
+vsetivli  zero, 4, e8, mf4, ta, ma
+.rept 3
+vp8_idct_dc_addy
+.endr
+vp8_idct_dc_add
+
+ret
+endfunc
-- 
2.43.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 1/4] checkasm/rv34dsp: add rv34_inv_transform_dc test

2024-02-12 Thread flow gg
I sended  "[FFmpeg-devel] [PATCH] x86: Remove MMX assembly
rv34_inv_transform_dc in rv34dsp"

Rémi Denis-Courmont  于2024年2月13日周二 03:37写道:

> Le perjantaina 2. helmikuuta 2024, 2.47.16 EET flow gg a écrit :
> > It seems to be caused by movd m0, r1d in libavcodec/x86/rv34dsp.asm? I'm
> > not quite sure.
>
> If it affects only MMX and neither SSE nor AVX, add a patch to remove the
> offending code altogether.
>
> It's ridiculous to hold checkasm tests off because of broken legacy code.
>
> --
> 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 v3] Require compilers to support C11.

2024-02-12 Thread Michael Niedermayer
On Mon, Feb 12, 2024 at 08:52:14AM -0300, James Almer wrote:
> On 2/12/2024 8:04 AM, Anton Khirnov wrote:
> > Any more comments on this?
> > 
> > Anyone opposed to this going to master this week?
> 
> Michael said his machines needed updating gcc for c17. Wait to see if that
> still applies to c11.

I didnt see a problem with C11 when i tested it last time but i didnt
test all cross build environments i have, ill do that now/soon

thanks alot for asking though!

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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] avcodec/hevcdsp: Offset ff_hevc_.pel_filters to simplify addressing

2024-02-12 Thread Nuo Mi
On Mon, Feb 12, 2024 at 5:48 AM Christophe Gisquet <
christophe.gisq...@gmail.com> wrote:

> Le dim. 11 févr. 2024 à 12:37, Nuo Mi  a écrit :
> > > -DECLARE_ALIGNED(16, const int8_t, ff_hevc_qpel_filters)[3][16] = {
> > > +DECLARE_ALIGNED(16, const int8_t, ff_hevc_qpel_filters)[4][16] = {
> > >
> > Do you know why this is [4][16]? [4][8] should suffice.
>
> Probably so that all coefficient banks are aligned. Another use for it
> is you can directly use the address in some instruction instead of
> using/wasting a reg for holding the data.
>

Hi Christophe,
Thank you for the explanation.
However, epel (chroma) did not adhere to this. X86 doesn't require this
either since VVC didn't do it.
It's a bit odd that only some architectures and luma need this
I'll revisit this when I determine which architecture needs it and leave a
comment in the code accordingly.

>
> --
> Christophe Gisquet
> ___
> 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] avcodec/hevcdsp: Offset ff_hevc_.pel_filters to simplify addressing

2024-02-12 Thread Nuo Mi
On Sun, Feb 11, 2024 at 4:21 PM Andreas Rheinhardt <
andreas.rheinha...@outlook.com> wrote:

> Besides simplifying address computations (it saves 432B of .text
> in hevcdsp.o alone here) it also fixes undefined behaviour that
> occurs if mx or my are 0 (happens when the filters are unused)
> because they lead to an array index of -1 in the old code.
> This happens in the checkasm-hevc_pel FATE-test.
>
> Signed-off-by: Andreas Rheinhardt 
>
> Thank you, Andreas,

Hi all,
If there are no objections, I'll merge it tomorrow.
___
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] vvcdec: Mark as experimental

2024-02-12 Thread Nuo Mi
On Fri, Feb 9, 2024 at 11:54 AM Nuo Mi  wrote:

>
>
> On Fri, Feb 9, 2024 at 2:16 AM Kieran Kunhya  wrote:
>
>> On Thu, 8 Feb 2024 at 06:01, Nuo Mi  wrote:
>>
>> > On Thu, Feb 8, 2024 at 6:55 AM Kieran Kunhya  wrote:
>> >
>> > > On Wed, 7 Feb 2024 at 22:06, Paul B Mahol  wrote:
>> > >
>> > > > On Wed, Feb 7, 2024 at 10:13 PM Kieran Kunhya 
>> wrote:
>> > > >
>> > > > > $subj
>> > > > >
>> > > > > As discussed at FOSDEM.
>>
> If there are no objections, I'll push it tomorrow.
thank you, Kieran and Paul.
___
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] lavc/vvc: Check fc->ref contains valid reference

2024-02-12 Thread Nuo Mi
On Fri, Feb 9, 2024 at 6:46 AM Frank Plowman  wrote:

>
>
> On 08/02/2024 21:50, Lynne wrote:
> > Feb 8, 2024, 22:16 by p...@frankplowman.com:
> >
> >> From: Frank Plowman 
> >>
> >> Depending on where exactly decode_nal_unit failed, it is possible that
> >> fc->ref holds a VVCFrame which has had ff_vvc_unref_frame called on it
> >> and not yet had ref_frame called on it.  In this case, fc->ref most of
> >> the fields of fc->ref are NULL and attempting to call
> >> ff_vvc_report_frame_finished on it will result in a null dereference.
> >>
> >> Patch fixes the error described above by checking fc->ref has not only
> >> been allocated, but also references a valid AVFrame before attempting to
> >> call ff_vvc_report_frame_finished on it.
> >>
> >> Signed-off-by: Frank Plowman 
> >> ---
> >>  libavcodec/vvc/vvcdec.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c
> >> index 8163b5ecb6..246ee79299 100644
> >> --- a/libavcodec/vvc/vvcdec.c
> >> +++ b/libavcodec/vvc/vvcdec.c
> >> @@ -820,7 +820,7 @@ static int decode_nal_units(VVCContext *s,
> VVCFrameContext *fc, AVPacket *avpkt)
> >>  return 0;
> >>
> >>  fail:
> >> -if (fc->ref)
> >> +if (fc->ref && fc->ref->frame->buf[0])
> >>  ff_vvc_report_frame_finished(fc->ref);
> >>  return ret;
> >>  }
> >>
> >
> > In general, for other codecs, if a reference does not exist,
> > we simply allocate it and pretend it existed and was correctly decoded.
> > This has better resilience against corrupt bitstreams or just bad muxing,
> > and yields an (maybe corrupt) output, which is better than nothing.
> >
> > Is this not possible for VVC?
>
> I think the naming is confusing here.  fc->ref is a pointer to the
> VVCFrame currently being decoded.
>
HI Lynee,
the name is from hevc. I do not like it either, but so many functions
copied from hevc will use it. ...

Hi Frank,
Please try https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=10775
thank you

>
> --
> 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 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 v5] lavc/libvpxenc: add screen-content-mode option

2024-02-12 Thread Dariusz Marcinkiewicz via ffmpeg-devel
This exposes VP8E_SET_SCREEN_CONTENT_MODE option from libvpx.

Co-authored-by: Erik Språng 
Signed-off-by: Dariusz Marcinkiewicz 
---
 doc/encoders.texi  |  6 ++
 libavcodec/libvpxenc.c | 13 +
 libavcodec/version.h   |  2 +-
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index c9fe6d6143..13a7084512 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2237,6 +2237,12 @@ the two temporal layer 2 frames within the temporal 
period.
 @end table
 @end table
 
+@item VP8-specific options
+@table @option
+@item screen-content-mode
+Screen content mode, one of: (0) off, (1) screen, (2) screen with more 
aggressive rate control.
+@end table
+
 @item VP9-specific options
 @table @option
 @item lossless
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 80988a2608..8f765f2dc4 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -121,6 +121,9 @@ typedef struct VPxEncoderContext {
 int *ts_layer_flags;
 int current_temporal_idx;
 
+// VP8-only
+int screen_content_mode;
+
 // VP9-only
 int lossless;
 int tile_columns;
@@ -164,6 +167,7 @@ static const char *const ctlidstr[] = {
 [VP8E_SET_MAX_INTRA_BITRATE_PCT] = "VP8E_SET_MAX_INTRA_BITRATE_PCT",
 [VP8E_SET_SHARPNESS]   = "VP8E_SET_SHARPNESS",
 [VP8E_SET_TEMPORAL_LAYER_ID]   = "VP8E_SET_TEMPORAL_LAYER_ID",
+[VP8E_SET_SCREEN_CONTENT_MODE] = "VP8E_SET_SCREEN_CONTENT_MODE",
 #if CONFIG_LIBVPX_VP9_ENCODER
 [VP9E_SET_LOSSLESS]= "VP9E_SET_LOSSLESS",
 [VP9E_SET_TILE_COLUMNS]= "VP9E_SET_TILE_COLUMNS",
@@ -1262,6 +1266,14 @@ static av_cold int vpx_init(AVCodecContext *avctx,
 #endif
 }
 #endif
+if (avctx->codec_id == AV_CODEC_ID_VP8 && ctx->screen_content_mode >= 0) {
+if (ctx->screen_content_mode == 2 && ctx->is_alpha) {
+av_log(avctx, AV_LOG_ERROR,
+   "Transparency encoding with screen mode with aggressive 
rate control not supported\n");
+return AVERROR(EINVAL);
+}
+codecctl_int(avctx, VP8E_SET_SCREEN_CONTENT_MODE, 
ctx->screen_content_mode);
+}
 
 av_log(avctx, AV_LOG_DEBUG, "Using deadline: %d\n", ctx->deadline);
 
@@ -1946,6 +1958,7 @@ static const AVOption vp8_options[] = {
 { "auto-alt-ref","Enable use of alternate reference "
  "frames (2-pass only)",
OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE},
 { "cpu-used","Quality/Speed ratio modifier",
OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE},
+{ "screen-content-mode", "Encoder screen content mode", 
OFFSET(screen_content_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE},
 LEGACY_OPTIONS
 { NULL }
 };
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f2f14eaed1..ecdbc51c74 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
 #include "version_major.h"
 
 #define LIBAVCODEC_VERSION_MINOR  39
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
-- 
2.43.0.687.g38aa6559b0-goog

___
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/2] avdevice: deprecate opengl outdev

2024-02-12 Thread J. Dekker
Signed-off-by: J. Dekker 
---

These devices are fundamentally broken and usecases should be switched
away from output devices in general. Discussion in the thread tended towards
deprecation rather than immediate removal to give time for users to figure out
the best alternatives for their usecase.

 libavdevice/opengl_enc.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index b2ac6eb16a..0c81ccc1c4 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -224,6 +224,8 @@ typedef struct OpenGLContext {
 int picture_height;///< Rendered height
 int window_width;
 int window_height;
+
+int warned;
 } OpenGLContext;
 
 static const struct OpenGLFormatDesc {
@@ -1060,6 +1062,14 @@ static av_cold int opengl_write_header(AVFormatContext 
*h)
 AVStream *st;
 int ret;
 
+if (!opengl->warned) {
+av_log(opengl, AV_LOG_WARNING,
+"The opengl output device is deprecated. For monitoring purposes 
in ffmpeg you can output to a file or use pipes and a video player.\n"
+"Example: ffmpeg -i input.mkv -f nut - | ffplay \n"
+);
+opengl->warned = 1;
+}
+
 if (h->nb_streams != 1 ||
 par->codec_type != AVMEDIA_TYPE_VIDEO ||
 (par->codec_id != AV_CODEC_ID_WRAPPED_AVFRAME && par->codec_id != 
AV_CODEC_ID_RAWVIDEO)) {
-- 
2.43.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 2/2] avdevice: deprecate sdl outdev

2024-02-12 Thread J. Dekker
Signed-off-by: J. Dekker 
---
 libavdevice/sdl2.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c
index 342a253dc0..6a6751e40f 100644
--- a/libavdevice/sdl2.c
+++ b/libavdevice/sdl2.c
@@ -51,6 +51,7 @@ typedef struct {
 SDL_Rect texture_rect;
 
 int inited;
+int warned;
 } SDLContext;
 
 static const struct sdl_texture_format_entry {
@@ -165,6 +166,14 @@ static int sdl2_write_header(AVFormatContext *s)
 int i, ret = 0;
 int flags  = 0;
 
+if (!sdl->warned) {
+av_log(sdl, AV_LOG_WARNING,
+"The sdl output device is deprecated. For monitoring purposes in 
ffmpeg you can output to a file or use pipes and a video player.\n"
+"Example: ffmpeg -i input.mkv -f nut - | ffplay \n"
+);
+sdl->warned = 1;
+}
+
 if (!sdl->window_title)
 sdl->window_title = av_strdup(s->url);
 
-- 
2.43.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".