Re: [FFmpeg-devel] [PATCH] lavc/dxv: fix incorrect back-reference index calculation in DXT5 decoding

2024-02-04 Thread Connor Worley
Given that Paul is no longer a maintainer, can someone else please take a
look?

-- 
Connor Worley
___
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 v7 1/2] libavformat/dvdvideo: add DVD-Video demuxer powered by libdvdnav and libdvdread

2024-02-04 Thread Marth64
Sorry for the quick follow-up to v6, I wanted to get this update out now 
hopefully
before v6 is actually reviewed. v7 fixes a few documentation typos, options 
descriptions,
and log messages: nothing major. I also flattened this out to be a 2-patch set
with subtitle palette support.

This is the result of >1yr of research and I am now very satisfied with it's 
result.
I will not make any more changes at this point unless it is outcome from a 
review.
If the community decides to merge it, I am happy to continue to improve it with 
support for
seeking, probing, and tests.

Thank you so much,


Signed-off-by: Marth64 
---
 Changelog |2 +
 configure |8 +
 doc/demuxers.texi |  129 
 libavformat/Makefile  |1 +
 libavformat/allformats.c  |1 +
 libavformat/dvdvideodec.c | 1410 +
 6 files changed, 1551 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
+
 
 version 6.1:
 - libaribcaption decoder
diff --git a/configure b/configure
index 68f675a4bc..70c33ec96d 100755
--- a/configure
+++ b/configure
@@ -227,6 +227,8 @@ External library support:
   --enable-libdavs2enable AVS2 decoding via libdavs2 [no]
   --enable-libdc1394   enable IIDC-1394 grabbing using libdc1394
and libraw1394 [no]
+  --enable-libdvdnav   enable libdvdnav, needed for DVD demuxing [no]
+  --enable-libdvdread  enable libdvdread, needed for DVD demuxing [no]
   --enable-libfdk-aac  enable AAC de/encoding via libfdk-aac [no]
   --enable-libfliteenable flite (voice synthesis) support via libflite 
[no]
   --enable-libfontconfig   enable libfontconfig, useful for drawtext filter 
[no]
@@ -1806,6 +1808,8 @@ EXTERNAL_LIBRARY_GPL_LIST="
 frei0r
 libcdio
 libdavs2
+libdvdnav
+libdvdread
 librubberband
 libvidstab
 libx264
@@ -3520,6 +3524,8 @@ dts_demuxer_select="dca_parser"
 dtshd_demuxer_select="dca_parser"
 dv_demuxer_select="dvprofile"
 dv_muxer_select="dvprofile"
+dvdvideo_demuxer_select="mpegps_demuxer"
+dvdvideo_demuxer_deps="libdvdnav libdvdread"
 dxa_demuxer_select="riffdec"
 eac3_demuxer_select="ac3_parser"
 evc_demuxer_select="evc_frame_merge_bsf evc_parser"
@@ -6761,6 +6767,8 @@ enabled libdav1d  && require_pkg_config libdav1d 
"dav1d >= 0.5.0" "dav1d
 enabled libdavs2  && require_pkg_config libdavs2 "davs2 >= 1.6.0" 
davs2.h davs2_decoder_open
 enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 
dc1394/dc1394.h dc1394_new
 enabled libdrm&& check_pkg_config libdrm libdrm xf86drm.h 
drmGetVersion
+enabled libdvdnav && require_pkg_config libdvdnav "dvdnav >= 6.1.1" 
dvdnav/dvdnav.h dvdnav_open2
+enabled libdvdread&& require_pkg_config libdvdread "dvdread >= 6.1.2" 
dvdread/dvd_reader.h DVDOpen2 -ldvdread
 enabled libfdk_aac&& { check_pkg_config libfdk_aac fdk-aac 
"fdk-aac/aacenc_lib.h" aacEncOpen ||
{ require libfdk_aac fdk-aac/aacenc_lib.h 
aacEncOpen -lfdk-aac &&
  warn "using libfdk without pkg-config"; } }
diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index e4c5b560a6..ad0906f6ec 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -285,6 +285,135 @@ This demuxer accepts the following option:
 
 @end table
 
+@section dvdvideo
+
+DVD-Video demuxer, powered by libdvdnav and libdvdread.
+
+Can directly ingest DVD titles, specifically sequential PGCs,
+into a conversion pipeline. Menus and seeking are not supported at this time.
+
+Block devices (DVD drives), ISO files, and directory structures are accepted.
+Activate with @code{-f dvdvideo} in front of one of these inputs.
+
+Underlying playback is fully handled by libdvdnav, and structure parsing by 
libdvdread.
+ffmpeg must be built with GPL library support available as well as the switches
+@code{--enable-libdvdnav} and @code{--enable-libdvdread}.
+
+You will need to provide either the desired "title number" or exact PGC/PG 
coordinates.
+Many open-source DVD players and tools can aid in providing this information.
+If not specified, the demuxer will default to title 1 which works for many 
discs.
+However, due to the flexibility of DVD-Video, it is recommended to check 
manually.
+There are many discs that are authored strangely or with invalid headers.
+
+If the input is a real DVD drive, please note that there are some drives which 
may
+silently fail on reading bad sectors from the disc, returning random bits 
instead
+which is effectively corrupt data. This is especially prominent on aging or 
rotting discs.
+A second pass and integrity checks would 

[FFmpeg-devel] [PATCH v7 2/2] libavformat/dvdvideo: add DVD CLUT utilities and enable palette support

2024-02-04 Thread Marth64
DVD subtitle palettes, which are natively YUV, are currently carried as
a hex string in their respective subtitle streams and have
no concept of colorspace tagging. In fact, the convention is to convert
them to RGB prior to storage. Common players will only render
the palettes properly if they are stored as RGB. Even ffmpeg itself
expects this, and already does -in libavformat- the YUV-RGB conversions,
specifically in mov.c and movenc.c.

The point of this patch is to provide a consolidation of the code
that deals with creating the extradata as well as the RGB conversion.
That can then (1) enable usable palette support for DVD demuxer if it is merged
and (2) start the process of consolidating the related conversions in
MOV muxer/demuxer and eventually find a way to properly tag
the colorspace.


Signed-off-by: Marth64 
---
 doc/demuxers.texi |   5 ++
 libavformat/Makefile  |   2 +-
 libavformat/dvdclut.c | 104 ++
 libavformat/dvdclut.h |  37 ++
 libavformat/dvdvideodec.c |  14 +
 5 files changed, 161 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/dvdclut.c
 create mode 100644 libavformat/dvdclut.h

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index ad0906f6ec..9c666a29c1 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -390,6 +390,11 @@ often with junk data intended for controlling a real DVD 
player's
 buffering speed and with no other material data value.
 Default is 1, true.
 
+@item clut_rgb
+Output subtitle palettes (CLUTs) as RGB, required for Matroska and MP4.
+Disable to output the palette in its original YUV colorspace.
+Default is 1, true.
+
 @end table
 
 @subsection Examples
diff --git a/libavformat/Makefile b/libavformat/Makefile
index df69734877..8f17e43e49 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -192,7 +192,7 @@ OBJS-$(CONFIG_DTS_MUXER) += rawenc.o
 OBJS-$(CONFIG_DV_MUXER)  += dvenc.o
 OBJS-$(CONFIG_DVBSUB_DEMUXER)+= dvbsub.o rawdec.o
 OBJS-$(CONFIG_DVBTXT_DEMUXER)+= dvbtxt.o rawdec.o
-OBJS-$(CONFIG_DVDVIDEO_DEMUXER)  += dvdvideodec.o
+OBJS-$(CONFIG_DVDVIDEO_DEMUXER)  += dvdvideodec.o dvdclut.o
 OBJS-$(CONFIG_DXA_DEMUXER)   += dxa.o
 OBJS-$(CONFIG_EA_CDATA_DEMUXER)  += eacdata.o
 OBJS-$(CONFIG_EA_DEMUXER)+= electronicarts.o
diff --git a/libavformat/dvdclut.c b/libavformat/dvdclut.c
new file mode 100644
index 00..71fdda7925
--- /dev/null
+++ b/libavformat/dvdclut.c
@@ -0,0 +1,104 @@
+/*
+ * DVD-Video subpicture CLUT (Color Lookup Table) utilities
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/bprint.h"
+#include "libavutil/colorspace.h"
+#include "libavutil/intreadwrite.h"
+
+#include "avformat.h"
+#include "dvdclut.h"
+#include "internal.h"
+
+/* crop table for YUV to RGB subpicture palette conversion */
+#define FF_DVDCLUT_YUV_NEG_CROP_MAX1024
+#define times4(x)  x, x, x, x
+#define times256(x)
times4(times4(times4(times4(times4(x)
+
+const uint8_t ff_dvdclut_yuv_crop_tab[256 + 2 * FF_DVDCLUT_YUV_NEG_CROP_MAX] = 
{
+times256(0x00),
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,

[FFmpeg-devel] [PATCH 2/2] lavc/dxvenc: migrate DXT1 encoder to lavu hashtable

2024-02-04 Thread Connor Worley
Offers a modest performance gain due to the switch from naive linear
probling to robin hood.

Signed-off-by: Connor Worley 
---
 libavcodec/dxvenc.c | 121 +---
 1 file changed, 35 insertions(+), 86 deletions(-)

diff --git a/libavcodec/dxvenc.c b/libavcodec/dxvenc.c
index b274175689..e17b3b2c36 100644
--- a/libavcodec/dxvenc.c
+++ b/libavcodec/dxvenc.c
@@ -21,7 +21,7 @@
 
 #include 
 
-#include "libavutil/crc.h"
+#include "libavutil/hashtable.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/opt.h"
 
@@ -44,69 +44,6 @@ enum DXVTextureFormat {
 DXV_FMT_DXT1 = MKBETAG('D', 'X', 'T', '1'),
 };
 
-typedef struct HTEntry {
-uint32_t key;
-uint32_t pos;
-} HTEntry;
-
-static void ht_init(HTEntry *ht)
-{
-for (size_t i = 0; i < LOOKBACK_HT_ELEMS; i++) {
-ht[i].pos = -1;
-}
-}
-
-static uint32_t ht_lookup_and_upsert(HTEntry *ht, const AVCRC *hash_ctx,
-uint32_t key, uint32_t pos)
-{
-uint32_t ret = -1;
-size_t hash = av_crc(hash_ctx, 0, (uint8_t*), 4) % LOOKBACK_HT_ELEMS;
-for (size_t i = hash; i < hash + LOOKBACK_HT_ELEMS; i++) {
-size_t wrapped_index = i % LOOKBACK_HT_ELEMS;
-HTEntry *entry = [wrapped_index];
-if (entry->key == key || entry->pos == -1) {
-ret = entry->pos;
-entry->key = key;
-entry->pos = pos;
-break;
-}
-}
-return ret;
-}
-
-static void ht_delete(HTEntry *ht, const AVCRC *hash_ctx,
-  uint32_t key, uint32_t pos)
-{
-HTEntry *removed_entry = NULL;
-size_t removed_hash;
-size_t hash = av_crc(hash_ctx, 0, (uint8_t*), 4) % LOOKBACK_HT_ELEMS;
-
-for (size_t i = hash; i < hash + LOOKBACK_HT_ELEMS; i++) {
-size_t wrapped_index = i % LOOKBACK_HT_ELEMS;
-HTEntry *entry = [wrapped_index];
-if (entry->pos == -1)
-return;
-if (removed_entry) {
-size_t candidate_hash = av_crc(hash_ctx, 0, (uint8_t*)>key, 
4) % LOOKBACK_HT_ELEMS;
-if ((wrapped_index > removed_hash && (candidate_hash <= 
removed_hash || candidate_hash > wrapped_index)) ||
-(wrapped_index < removed_hash && (candidate_hash <= 
removed_hash && candidate_hash > wrapped_index))) {
-*removed_entry = *entry;
-entry->pos = -1;
-removed_entry = entry;
-removed_hash = wrapped_index;
-}
-} else if (entry->key == key) {
-if (entry->pos <= pos) {
-entry->pos = -1;
-removed_entry = entry;
-removed_hash = wrapped_index;
-} else {
-return;
-}
-}
-}
-}
-
 typedef struct DXVEncContext {
 AVClass *class;
 
@@ -123,10 +60,8 @@ typedef struct DXVEncContext {
 enum DXVTextureFormat tex_fmt;
 int (*compress_tex)(AVCodecContext *avctx);
 
-const AVCRC *crc_ctx;
-
-HTEntry color_lookback_ht[LOOKBACK_HT_ELEMS];
-HTEntry lut_lookback_ht[LOOKBACK_HT_ELEMS];
+AVHashtableContext color_ht;
+AVHashtableContext lut_ht;
 } DXVEncContext;
 
 /* Converts an index offset value to a 2-bit opcode and pushes it to a stream.
@@ -161,27 +96,32 @@ static int dxv_compress_dxt1(AVCodecContext *avctx)
 DXVEncContext *ctx = avctx->priv_data;
 PutByteContext *pbc = >pbc;
 uint32_t *value;
-uint32_t color, lut, idx, color_idx, lut_idx, prev_pos, state = 16, pos = 
2, op = 0;
+uint32_t color, lut, idx, color_idx, lut_idx, prev_pos, state = 16, pos = 
0, op = 0;
 
-ht_init(ctx->color_lookback_ht);
-ht_init(ctx->lut_lookback_ht);
+av_hashtable_clear(>color_ht);
+av_hashtable_clear(>lut_ht);
 
 bytestream2_put_le32(pbc, AV_RL32(ctx->tex_data));
+av_hashtable_set(>color_ht, ctx->tex_data, );
+pos++;
 bytestream2_put_le32(pbc, AV_RL32(ctx->tex_data + 4));
-
-ht_lookup_and_upsert(ctx->color_lookback_ht, ctx->crc_ctx, 
AV_RL32(ctx->tex_data), 0);
-ht_lookup_and_upsert(ctx->lut_lookback_ht, ctx->crc_ctx, 
AV_RL32(ctx->tex_data + 4), 1);
+av_hashtable_set(>lut_ht, ctx->tex_data + 4, );
+pos++;
 
 while (pos + 2 <= ctx->tex_size / 4) {
 idx = 0;
+color_idx = 0;
+lut_idx = 0;
 
 color = AV_RL32(ctx->tex_data + pos * 4);
-prev_pos = ht_lookup_and_upsert(ctx->color_lookback_ht, ctx->crc_ctx, 
color, pos);
-color_idx = prev_pos != -1 ? pos - prev_pos : 0;
+if (av_hashtable_get(>color_ht, , _pos))
+color_idx = pos - prev_pos;
+av_hashtable_set(>color_ht, , );
+
 if (pos >= LOOKBACK_WORDS) {
 uint32_t old_pos = pos - LOOKBACK_WORDS;
-uint32_t old_color = AV_RL32(ctx->tex_data + old_pos * 4);
-ht_delete(ctx->color_lookback_ht, ctx->crc_ctx, old_color, 
old_pos);
+if (av_hashtable_get(>color_ht, ctx->tex_data + old_pos * 4, 
_pos) && prev_pos <= old_pos)
+ 

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

2024-02-04 Thread Connor Worley
Signed-off-by: Connor Worley 
---
 libavutil/Makefile  |   2 +
 libavutil/hashtable.c   | 172 
 libavutil/hashtable.h   |  62 +
 libavutil/tests/hashtable.c | 104 ++
 4 files changed, 340 insertions(+)
 create mode 100644 libavutil/hashtable.c
 create mode 100644 libavutil/hashtable.h
 create mode 100644 libavutil/tests/hashtable.c

diff --git a/libavutil/Makefile b/libavutil/Makefile
index e7709b97d0..be75d464fc 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -138,6 +138,7 @@ OBJS = adler32.o
\
fixed_dsp.o  \
frame.o  \
hash.o   \
+   hashtable.o  \
hdr_dynamic_metadata.o   \
hdr_dynamic_vivid_metadata.o \
hmac.o   \
@@ -251,6 +252,7 @@ TESTPROGS = adler32 
\
 file\
 fifo\
 hash\
+hashtable   \
 hmac\
 hwdevice\
 integer \
diff --git a/libavutil/hashtable.c b/libavutil/hashtable.c
new file mode 100644
index 00..fb0f0aae99
--- /dev/null
+++ b/libavutil/hashtable.c
@@ -0,0 +1,172 @@
+/*
+ * Generic hashtable
+ * Copyright (C) 2024 Connor Worley 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+
+#include "error.h"
+#include "mem.h"
+#include "hashtable.h"
+#include "string.h"
+
+#define ENTRY_OCC(entry)   (entry)
+#define ENTRY_KEY(entry)   (ENTRY_OCC(entry) + 1)
+#define ENTRY_VAL(entry)   (ENTRY_KEY(entry) + ctx->key_size)
+#define ENTRY_PSL(entry) (size_t*) (ENTRY_VAL(entry) + ctx->val_size)
+
+#define KEYS_EQUAL(k1, k2) !memcmp(k1, k2, ctx->key_size)
+
+int av_hashtable_init(AVHashtableContext* ctx, size_t key_size, size_t 
val_size, size_t max_entries)
+{
+ctx->key_size = key_size;
+ctx->val_size = val_size;
+ctx->entry_size = 1 + key_size + val_size + sizeof(size_t);
+ctx->max_entries = max_entries;
+ctx->utilization = 0;
+ctx->crc = av_crc_get_table(AV_CRC_32_IEEE);
+if (!ctx->crc)
+return AVERROR_BUG;
+ctx->table = av_mallocz(ctx->entry_size * max_entries);
+if (!ctx->table)
+return AVERROR(ENOMEM);
+ctx->set_key = av_malloc(key_size);
+if (!ctx->set_key)
+return AVERROR(ENOMEM);
+ctx->set_val = av_malloc(key_size);
+if (!ctx->set_val)
+return AVERROR(ENOMEM);
+ctx->tmp_key = av_malloc(key_size);
+if (!ctx->tmp_key)
+return AVERROR(ENOMEM);
+ctx->tmp_val = av_malloc(val_size);
+if (!ctx->tmp_val)
+return AVERROR(ENOMEM);
+return 0;
+}
+
+static size_t hash_key(const AVHashtableContext* ctx, const void* key)
+{
+return av_crc(ctx->crc, 0, key, ctx->key_size) % ctx->max_entries;
+}
+
+int av_hashtable_get(const AVHashtableContext* ctx, const void* key, void* val)
+{
+size_t hash = hash_key(ctx, key);
+
+if (!ctx->utilization)
+return 0;
+
+for (size_t psl = 0; psl < ctx->max_entries; psl++) {
+size_t wrapped_index = (hash + psl) % ctx->max_entries;
+uint8_t *entry = ctx->table + wrapped_index * ctx->entry_size;
+if (!*ENTRY_OCC(entry) || *ENTRY_PSL(entry) < psl)
+return 0;
+if (KEYS_EQUAL(ENTRY_KEY(entry), key)) {
+memcpy(val, ENTRY_VAL(entry), ctx->val_size);
+return 1;
+}
+}
+return 0;
+}
+
+int av_hashtable_set(AVHashtableContext* ctx, const void* key, const void* val)

[FFmpeg-devel] [PATCH 2/2] avfilter/signature_lookup: Do not dereference NULL pointers after malloc failure

2024-02-04 Thread Michael Niedermayer
Fixes: CID 1403229 Dereference after null check

Signed-off-by: Michael Niedermayer 
---
 libavfilter/signature_lookup.c | 25 ++---
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c
index 86dd0c66754..6e45fde1b5a 100644
--- a/libavfilter/signature_lookup.c
+++ b/libavfilter/signature_lookup.c
@@ -37,6 +37,14 @@
 #define STATUS_END_REACHED 1
 #define STATUS_BEGIN_REACHED 2
 
+static void sll_free(MatchingInfo **sll)
+{
+while (*sll) {
+sll = &(*sll)->next;
+av_freep(sll);
+}
+}
+
 static void fill_l1distlut(uint8_t lut[])
 {
 int i, j, tmp_i, tmp_j,count;
@@ -290,6 +298,10 @@ static MatchingInfo* 
get_matching_parameters(AVFilterContext *ctx, SignatureCont
 av_log(ctx, AV_LOG_FATAL, "Could not allocate 
memory");
 c = c->next;
 }
+if (!c) {
+sll_free();
+goto error;
+}
 c->framerateratio = (i+1.0) / 30;
 c->score = hspace[i][j].score;
 c->offset = j-90;
@@ -305,6 +317,7 @@ static MatchingInfo* 
get_matching_parameters(AVFilterContext *ctx, SignatureCont
 }
 }
 }
+error:
 for (i = 0; i < MAX_FRAMERATE; i++) {
 av_freep([i]);
 }
@@ -520,16 +533,6 @@ static MatchingInfo evaluate_parameters(AVFilterContext 
*ctx, SignatureContext *
 return bestmatch;
 }
 
-static void sll_free(MatchingInfo *sll)
-{
-void *tmp;
-while (sll) {
-tmp = sll;
-sll = sll->next;
-av_freep();
-}
-}
-
 static MatchingInfo lookup_signatures(AVFilterContext *ctx, SignatureContext 
*sc, StreamContext *first, StreamContext *second, int mode)
 {
 CoarseSignature *cs, *cs2;
@@ -572,7 +575,7 @@ static MatchingInfo lookup_signatures(AVFilterContext *ctx, 
SignatureContext *sc
"ratio %f, offset %d, score %d, %d frames matching\n",
bestmatch.first->index, bestmatch.second->index,
bestmatch.framerateratio, bestmatch.offset, 
bestmatch.score, bestmatch.matchframes);
-sll_free(infos);
+sll_free();
 }
 } while (find_next_coarsecandidate(sc, second->coarsesiglist, , , 
0) && !bestmatch.whole);
 return bestmatch;
-- 
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".


[FFmpeg-devel] [PATCH 1/2] avcodec/ac3enc_template: add fbw_channels assert

2024-02-04 Thread Michael Niedermayer
fbw_channels must be > 0 as teh code is only run if cpl_enabled is set and that 
requires mode >= AC3_CHMODE_STEREO

CID 718138 Uninitialized scalar variable
assumes this assert to be false

Signed-off-by: Michael Niedermayer 
---
 libavcodec/ac3enc_template.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c
index ce9ef58a330..34d07cc9e5b 100644
--- a/libavcodec/ac3enc_template.c
+++ b/libavcodec/ac3enc_template.c
@@ -223,6 +223,8 @@ static void apply_channel_coupling(AC3EncodeContext *s)
 }
 }
 
+av_assert1(s->fbw_channels > 0);
+
 /* calculate final coupling coordinates, taking into account reusing of
coordinates in successive blocks */
 for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-- 
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] lavc/qsvenc: Add workaround for VP9 keyframe

2024-02-04 Thread Xiang, Haihao
On Vr, 2024-01-26 at 12:28 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> The runtime doesn't set the frame type to MFX_FRAMETYPE_IDR on the
> returned mfx bitstream for a keyframe, it set the frame type to
> MFX_FRAMETYPE_I only. This patch added workaround for VP9 keyframe to
> make the coded stream seekable.
> 
> Signed-off-by: Haihao Xiang 
> ---
>  libavcodec/qsvenc.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> index a0144b0760..c63b72e384 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -2578,9 +2578,11 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext
> *q,
>  if (qpkt.bs->FrameType & MFX_FRAMETYPE_IDR || qpkt.bs->FrameType &
> MFX_FRAMETYPE_xIDR) {
>  qpkt.pkt.flags |= AV_PKT_FLAG_KEY;
>  pict_type = AV_PICTURE_TYPE_I;
> -    } else if (qpkt.bs->FrameType & MFX_FRAMETYPE_I || qpkt.bs->FrameType
> & MFX_FRAMETYPE_xI)
> +    } else if (qpkt.bs->FrameType & MFX_FRAMETYPE_I || qpkt.bs->FrameType
> & MFX_FRAMETYPE_xI) {
> +    if (avctx->codec_id == AV_CODEC_ID_VP9)
> +    qpkt.pkt.flags |= AV_PKT_FLAG_KEY;
>  pict_type = AV_PICTURE_TYPE_I;
> -    else if (qpkt.bs->FrameType & MFX_FRAMETYPE_P || qpkt.bs->FrameType &
> MFX_FRAMETYPE_xP)
> +    } else if (qpkt.bs->FrameType & MFX_FRAMETYPE_P || qpkt.bs->FrameType
> & MFX_FRAMETYPE_xP)
>  pict_type = AV_PICTURE_TYPE_P;
>  else if (qpkt.bs->FrameType & MFX_FRAMETYPE_B || qpkt.bs->FrameType &
> MFX_FRAMETYPE_xB)
>  pict_type = AV_PICTURE_TYPE_B;

Will apply,

- Haihao


___
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/jpeg2000dec: support of 2 fields in 1 AVPacket

2024-02-04 Thread James Almer

On 2/3/2024 7:00 AM, Tomas Härdin wrote:

fre 2024-02-02 klockan 16:55 +0100 skrev Jerome Martinez:

Before this patch, the FFmpeg MXF parser correctly detects content
with
2 fields in 1 AVPacket as e.g. interlaced 720x486 but the FFmpeg JPEG
2000 decoder reads the JPEG 2000 SIZ header without understanding
that
the indicated height is the height of 1 field only so overwrites the
frame size info with e.g. 720x243, and also completely discards the
second frame, which lead to the decoding of only half of the stored
content as "progressive" 720x243 flagged interlaced.


Is the decoder really the right place to do this? Surely this happens
with more codecs than just j2k. Isnt it also a parser's job to do this
kind of stuff?


An AVParser must not split (or assemble) a packet in a form that is not 
meant to be encapsulated in a container.
If you need to split a packet into smaller portions, you need a 
bitstream filter. See {vp9_superframe,av1_frame}_split.




The logic that scans the packet for two SOI markers shouldn't be
necessary if the relevant information is carried over from the MXF
demuxer. It also makes the j2k decoder harder to ||ize. You might also
need the StoredF2Offset

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

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

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

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/d3d12va_decode: fix different 'const' qualifiers warning

2024-02-04 Thread Xiang, Haihao
On Wo, 2024-01-31 at 19:56 +0800, tong1.wu-at-intel@ffmpeg.org wrote:
> From: Tong Wu 
> 
> Signed-off-by: Tong Wu 
> ---
>  libavcodec/d3d12va_decode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c
> index f678b6f483..a615a3898b 100644
> --- a/libavcodec/d3d12va_decode.c
> +++ b/libavcodec/d3d12va_decode.c
> @@ -79,7 +79,7 @@ unsigned ff_d3d12va_get_surface_index(const AVCodecContext
> *avctx,
>  }
>  
>  fail:
> -    av_log(avctx, AV_LOG_WARNING, "Could not get surface index. Using 0
> instead.\n");
> +    av_log((AVCodecContext *)avctx, AV_LOG_WARNING, "Could not get surface
> index. Using 0 instead.\n");
>  return 0;
>  }
>  

Patchset LGTM, will apply.

- Haihao


___
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/d3d12va_vc1: add support for D3D12_VIDEO_DECODE_PROFILE_VC1_D2010 guid.

2024-02-04 Thread Xiang, Haihao
On Wo, 2024-01-31 at 19:30 +0800, Tong Wu wrote:
> From: Aleksoid 
> 
> The VC1_D2010 profile, also known as VC1_VLD2010, has the same functionality
> and specification as the VC1_D profile. Support for this profile serves only
> as a positive indication that the accelerator has been designed with awareness
> of the modifications specified in the August 2010 version of this
> specification.
> 
> Hardware accelerator drivers that expose support for this profile must not
> also expose the previously specified VC1_D GUID, unless the accelerator works
> properly with existing software decoders that use VC1_D and that do not
> incorporate
> the corrections added to the August 2010 version of this specification.
> 
> As a result, we could give VC1_VLD2010 a higher priority and initialize
> it first.
> 
> Signed-off-by: Aleksoid 
> Signed-off-by: Tong Wu 
> ---
>  libavcodec/d3d12va_vc1.c | 11 +--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/d3d12va_vc1.c b/libavcodec/d3d12va_vc1.c
> index 3aa2743107..110926be82 100644
> --- a/libavcodec/d3d12va_vc1.c
> +++ b/libavcodec/d3d12va_vc1.c
> @@ -164,12 +164,19 @@ static int d3d12va_vc1_end_frame(AVCodecContext *avctx)
>  
>  static int d3d12va_vc1_decode_init(AVCodecContext *avctx)
>  {
> +    int ret;
>  D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
> -    ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VC1;
> +    ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VC1_D2010;
>  
>  ctx->max_num_ref = 3;
>  
> -    return ff_d3d12va_decode_init(avctx);
> +    ret = ff_d3d12va_decode_init(avctx);
> +    if (ret < 0) {
> +    ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VC1;
> +    ret = ff_d3d12va_decode_init(avctx);
> +    }
> +
> +    return ret;
>  }
>  
>  #if CONFIG_WMV3_D3D12VA_HWACCEL

LGTM, will apply

- Haihao

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

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


Re: [FFmpeg-devel] [PATCH v2] doc/formats: clarify meaning of igndts as per definition in avformat.h

2024-02-04 Thread Stefano Sabatini
On date Sunday 2024-02-04 12:41:33 -0600, Marth64 wrote:
> This updates the documentation to be more clear about igndts,
> as per feedback in December variant of this patch (thank you)
> 
> Signed-off-by: Marth64 
> ---
>  doc/formats.texi | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/formats.texi b/doc/formats.texi
> index 640b23b790..69fc1457a4 100644
> --- a/doc/formats.texi
> +++ b/doc/formats.texi
> @@ -46,7 +46,8 @@ Enable fast, but inaccurate seeks for some formats.
>  @item genpts
>  Generate missing PTS if DTS is present.
>  @item igndts
> -Ignore DTS if PTS is set. Inert when nofillin is set.
> +Ignore DTS if PTS is also set. In case the PTS is set, the DTS value
> +is set to NOPTS. This is ignored when the @code{nofillin} flag is set.

LGTM, I'll apply in a few days if I see no comments, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] libavformat/matroskaenc: reformat options table indentation and descriptions

2024-02-04 Thread Stefano Sabatini
On date Sunday 2024-02-04 12:30:01 -0600, Marth64 wrote:
> matroskaenc options table has grown packed over time, and is now challenging
> to read. The purpose of this patch is to reformat the table, indentation-wise,
> and to make the capitalization/endings of each description at least 
> consistent.
> 
> I intend to sort the options in a follow-up patch, but wanted to phase
> this out to be easier to validate.
> 
> Signed-off-by: Marth64 
> ---
>  libavformat/matroskaenc.c | 42 ++-
>  1 file changed, 28 insertions(+), 14 deletions(-)

LGTM (but I'm no maintainer of matroskaenc).
___
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/jpeg2000dec: support of 2 fields in 1 AVPacket

2024-02-04 Thread Tomas Härdin
> > > > > The logic that scans the packet for two SOI markers shouldn't
> > > > > be
> > > > > necessary if the relevant information is carried over from
> > > > > the
> > > > > MXF
> > > > > demuxer.
> > > > 
> > > > As far as I know there is nothing in the MXF file saying where
> > > > is
> > > > the
> > > > second field in the packet, at which MXF metadata do you think?
> > > 
> > > Well, FrameLayout == SEPARATE_FIELDS, EditRate = 3/1001 and
> > > FieldDominance == 2. DisplayHeight is the field height as S377
> > > says
> > > it
> > > should be for SEPARATE_FIELDS.
> > 
> > It should also be said that what this patch effectively does is
> > silently convert SEPARATE_FIELDS to MIXED_FIELDS. What if I want to
> > transcode J2K to lower bitrate but keep it SEPARATE_FIELDS?
> 
> See attached table from SMPTE ST 422, which specifies wrapping of J2K
> in MXF.

Which entry in the table would the provided file correspond to? To me
it seems none of them fit. There's two fields, meaning two j2k
codestreams, in each corresponding essence element KLV packet (I think,
unless CP packets get reassembled somewhere else). Entry I2 seems
closest but it specifies FULL_FRAME. I1 is otherwise tempting, but
there SampleRate should equal the field rate whereas the file has
SampleRate = 3/1001.

Aside: I didn't realize one could use SampleRate like this, but Annex
G.2.2 is explicit about it.

I'm tempted to say this file has been muxed improperly. Too bad there's
no software or version information in the file. What made it?

/Tomas
___
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 v6] libavformat/dvdvideo: add DVD-Video demuxer powered by libdvdnav and libdvdread

2024-02-04 Thread Marth64
Gah, just realized a minor issue in the documentation only. The -clut_rgb
option documentation is meant for the accompanying subtitle patchset, and
can be ignored.
I'll remove it, but will buffer the update in case there is more feedback.

Thanks!

On Sun, Feb 4, 2024 at 6:06 PM Marth64  wrote:

> - Further improve documentation, logging, and indentation
> - Improve stream starting logic to be far more robust and not break GOPs
> - Resolve and remove timing workaround for chapter markers when starting
> after ch. 1
> - Fix sketchy error handling logic for certain edge case when NAV pack is
> missing
>
> Overall it's in pretty good working shape.
>
> Subtitle palette support remains in a separate patch set.
>
> Signed-off-by: Marth64 
> ---
>  Changelog |2 +
>  configure |8 +
>  doc/demuxers.texi |  135 
>  libavformat/Makefile  |1 +
>  libavformat/allformats.c  |1 +
>  libavformat/dvdvideodec.c | 1409 +
>  6 files changed, 1556 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
> +
>
>  version 6.1:
>  - libaribcaption decoder
> diff --git a/configure b/configure
> index 68f675a4bc..70c33ec96d 100755
> --- a/configure
> +++ b/configure
> @@ -227,6 +227,8 @@ External library support:
>--enable-libdavs2enable AVS2 decoding via libdavs2 [no]
>--enable-libdc1394   enable IIDC-1394 grabbing using libdc1394
> and libraw1394 [no]
> +  --enable-libdvdnav   enable libdvdnav, needed for DVD demuxing [no]
> +  --enable-libdvdread  enable libdvdread, needed for DVD demuxing [no]
>--enable-libfdk-aac  enable AAC de/encoding via libfdk-aac [no]
>--enable-libfliteenable flite (voice synthesis) support via
> libflite [no]
>--enable-libfontconfig   enable libfontconfig, useful for drawtext
> filter [no]
> @@ -1806,6 +1808,8 @@ EXTERNAL_LIBRARY_GPL_LIST="
>  frei0r
>  libcdio
>  libdavs2
> +libdvdnav
> +libdvdread
>  librubberband
>  libvidstab
>  libx264
> @@ -3520,6 +3524,8 @@ dts_demuxer_select="dca_parser"
>  dtshd_demuxer_select="dca_parser"
>  dv_demuxer_select="dvprofile"
>  dv_muxer_select="dvprofile"
> +dvdvideo_demuxer_select="mpegps_demuxer"
> +dvdvideo_demuxer_deps="libdvdnav libdvdread"
>  dxa_demuxer_select="riffdec"
>  eac3_demuxer_select="ac3_parser"
>  evc_demuxer_select="evc_frame_merge_bsf evc_parser"
> @@ -6761,6 +6767,8 @@ enabled libdav1d  && require_pkg_config
> libdav1d "dav1d >= 0.5.0" "dav1d
>  enabled libdavs2  && require_pkg_config libdavs2 "davs2 >= 1.6.0"
> davs2.h davs2_decoder_open
>  enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2
> dc1394/dc1394.h dc1394_new
>  enabled libdrm&& check_pkg_config libdrm libdrm xf86drm.h
> drmGetVersion
> +enabled libdvdnav && require_pkg_config libdvdnav "dvdnav >=
> 6.1.1" dvdnav/dvdnav.h dvdnav_open2
> +enabled libdvdread&& require_pkg_config libdvdread "dvdread >=
> 6.1.2" dvdread/dvd_reader.h DVDOpen2 -ldvdread
>  enabled libfdk_aac&& { check_pkg_config libfdk_aac fdk-aac
> "fdk-aac/aacenc_lib.h" aacEncOpen ||
> { require libfdk_aac fdk-aac/aacenc_lib.h
> aacEncOpen -lfdk-aac &&
>   warn "using libfdk without pkg-config";
> } }
> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> index e4c5b560a6..d8bc806ad5 100644
> --- a/doc/demuxers.texi
> +++ b/doc/demuxers.texi
> @@ -285,6 +285,141 @@ This demuxer accepts the following option:
>
>  @end table
>
> +@section dvdvideo
> +
> +DVD-Video demuxer, powered by libdvdnav and libdvdread.
> +
> +Can directly ingest DVD titles, specifically sequential PGCs,
> +into a conversion pipeline. Menus and seeking are not supported at this
> time.
> +
> +Block devices (DVD drives), ISO files, and directory structures are
> accepted.
> +Activate with @code{-f dvdvideo} in front of one of these inputs.
> +
> +Underlying playback is fully handled by libdvdnav, and structure parsing
> by libdvdread.
> +ffmpeg must be built with GPL library support available as well as the
> switches
> +@code{--enable-libdvdnav} and @code{--enable-libdvdread}.
> +
> +You will need to provide either the desired "title number" or exact
> PGC/PG coordinates.
> +Many open-source DVD players and tools can aid in providing this
> information.
> +If not specified, the demuxer will default to title 1 which works for
> many discs.
> +However, due to the flexibility of DVD-Video, it is recommended to check
> manually.
> +There are many discs that are authored strangely or with 

[FFmpeg-devel] [PATCH v6] libavformat/dvdvideo: add DVD-Video demuxer powered by libdvdnav and libdvdread

2024-02-04 Thread Marth64
- Further improve documentation, logging, and indentation
- Improve stream starting logic to be far more robust and not break GOPs
- Resolve and remove timing workaround for chapter markers when starting after 
ch. 1
- Fix sketchy error handling logic for certain edge case when NAV pack is 
missing

Overall it's in pretty good working shape.

Subtitle palette support remains in a separate patch set.

Signed-off-by: Marth64 
---
 Changelog |2 +
 configure |8 +
 doc/demuxers.texi |  135 
 libavformat/Makefile  |1 +
 libavformat/allformats.c  |1 +
 libavformat/dvdvideodec.c | 1409 +
 6 files changed, 1556 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
+
 
 version 6.1:
 - libaribcaption decoder
diff --git a/configure b/configure
index 68f675a4bc..70c33ec96d 100755
--- a/configure
+++ b/configure
@@ -227,6 +227,8 @@ External library support:
   --enable-libdavs2enable AVS2 decoding via libdavs2 [no]
   --enable-libdc1394   enable IIDC-1394 grabbing using libdc1394
and libraw1394 [no]
+  --enable-libdvdnav   enable libdvdnav, needed for DVD demuxing [no]
+  --enable-libdvdread  enable libdvdread, needed for DVD demuxing [no]
   --enable-libfdk-aac  enable AAC de/encoding via libfdk-aac [no]
   --enable-libfliteenable flite (voice synthesis) support via libflite 
[no]
   --enable-libfontconfig   enable libfontconfig, useful for drawtext filter 
[no]
@@ -1806,6 +1808,8 @@ EXTERNAL_LIBRARY_GPL_LIST="
 frei0r
 libcdio
 libdavs2
+libdvdnav
+libdvdread
 librubberband
 libvidstab
 libx264
@@ -3520,6 +3524,8 @@ dts_demuxer_select="dca_parser"
 dtshd_demuxer_select="dca_parser"
 dv_demuxer_select="dvprofile"
 dv_muxer_select="dvprofile"
+dvdvideo_demuxer_select="mpegps_demuxer"
+dvdvideo_demuxer_deps="libdvdnav libdvdread"
 dxa_demuxer_select="riffdec"
 eac3_demuxer_select="ac3_parser"
 evc_demuxer_select="evc_frame_merge_bsf evc_parser"
@@ -6761,6 +6767,8 @@ enabled libdav1d  && require_pkg_config libdav1d 
"dav1d >= 0.5.0" "dav1d
 enabled libdavs2  && require_pkg_config libdavs2 "davs2 >= 1.6.0" 
davs2.h davs2_decoder_open
 enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 
dc1394/dc1394.h dc1394_new
 enabled libdrm&& check_pkg_config libdrm libdrm xf86drm.h 
drmGetVersion
+enabled libdvdnav && require_pkg_config libdvdnav "dvdnav >= 6.1.1" 
dvdnav/dvdnav.h dvdnav_open2
+enabled libdvdread&& require_pkg_config libdvdread "dvdread >= 6.1.2" 
dvdread/dvd_reader.h DVDOpen2 -ldvdread
 enabled libfdk_aac&& { check_pkg_config libfdk_aac fdk-aac 
"fdk-aac/aacenc_lib.h" aacEncOpen ||
{ require libfdk_aac fdk-aac/aacenc_lib.h 
aacEncOpen -lfdk-aac &&
  warn "using libfdk without pkg-config"; } }
diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index e4c5b560a6..d8bc806ad5 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -285,6 +285,141 @@ This demuxer accepts the following option:
 
 @end table
 
+@section dvdvideo
+
+DVD-Video demuxer, powered by libdvdnav and libdvdread.
+
+Can directly ingest DVD titles, specifically sequential PGCs,
+into a conversion pipeline. Menus and seeking are not supported at this time.
+
+Block devices (DVD drives), ISO files, and directory structures are accepted.
+Activate with @code{-f dvdvideo} in front of one of these inputs.
+
+Underlying playback is fully handled by libdvdnav, and structure parsing by 
libdvdread.
+ffmpeg must be built with GPL library support available as well as the switches
+@code{--enable-libdvdnav} and @code{--enable-libdvdread}.
+
+You will need to provide either the desired "title number" or exact PGC/PG 
coordinates.
+Many open-source DVD players and tools can aid in providing this information.
+If not specified, the demuxer will default to title 1 which works for many 
discs.
+However, due to the flexibility of DVD-Video, it is recommended to check 
manually.
+There are many discs that are authored strangely or with invalid headers.
+
+If the input is a real DVD drive, please note that there are some drives which 
may
+silently fail on reading bad sectors from the disc, returning random bits 
instead
+which is effectively corrupt data. This is especially prominent on aging or 
rotting discs.
+A second pass and integrity checks would be needed to detect the corruption.
+This is not an ffmpeg issue.
+
+@subsection Background
+
+DVD-Video is not a directly accessible, linear container format in the
+traditional sense. Instead, 

Re: [FFmpeg-devel] [PATCH 0/2] Remove SDL2 output devices

2024-02-04 Thread Stefano Sabatini
On date Sunday 2024-02-04 10:02:31 +0100, J. Dekker wrote:
> With the addition of threading in ffmpeg.c, the SDL2 devices no longer have 
> the
> 'main' thread. This means that both the SDL2 and OpenGL output device are 
> broken
> in master. Rather than attempting to fix it, they should be removed instead as
> there are better alternatives for debugging or viewing streams.
> 
> The 'pipe:' output can be used with a real video player such as mpv, vlc, or
> even ffplay. For cases where the user was an application using the API they
> should supply their own renderer.
> 
> J. Dekker (2):
>   avdevice: remove sdl2 outdev
>   avdevice: remove OpenGL device

I am against this.

1. If at all, the devices should be deprecated and removed only after a
given timeframe, so users can switch to something else (you don't know
what they are using).

2. > With the addition of threading in ffmpeg.c, the SDL2 devices no longer 
have the
   > 'main' thread. 

This implies a misunderstanding of what these components are. If
they are broken with ffmpeg.c this is not a good reason to remove
them (ffmpeg.c is not the only user).

Also, it was already suggested some way to fix it, it's not like they
are "broken by design", it is just that the assumptions done
previuosly apply no more. Probably ffmpeg.c should not use the main
thread or make this selectable. If this cannot be supported in a given
OS, the feature should be disabled only for that OS.
___
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] avdevice/caca: Allow to list multiple dither option types at once

2024-02-04 Thread Stefano Sabatini
On date Sunday 2024-02-04 18:36:45 +0100, Andreas Rheinhardt wrote:
> This can be achieved by using AV_OPT_TYPE_FLAGS instead of
> AV_OPT_TYPE_STRING. It also avoids strcmp() when accessing
> the option.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavdevice/caca.c | 34 +-
>  1 file changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/libavdevice/caca.c b/libavdevice/caca.c
> index 6af1649137..c0e09cf6f7 100644
> --- a/libavdevice/caca.c
> +++ b/libavdevice/caca.c
> @@ -24,6 +24,13 @@
>  #include "libavformat/mux.h"
>  #include "avdevice.h"
>  

> +enum {
> +SHOW_ALGORITHMS  = 1 << 0,
> +SHOW_ANTIALIASES = 1 << 1,
> +SHOW_CHARSETS= 1 << 2,
> +SHOW_COLORS  = 1 << 3,
> +};

nit: LIST_ for consistency?

> +
>  typedef struct CACAContext {
>  AVClass *class;
>  AVFormatContext *ctx;
> @@ -38,7 +45,7 @@ typedef struct CACAContext {
>  char*charset, *color;
>  char*driver;
>  
> -char*list_dither;
> +int list_dither;
>  int list_drivers;
>  } CACAContext;
>  
> @@ -99,21 +106,14 @@ static int caca_write_header(AVFormatContext *s)
>  return AVERROR_EXIT;
>  }
>  if (c->list_dither) {
> -if (!strcmp(c->list_dither, "colors")) {
> +if (c->list_dither & SHOW_COLORS)
>  list_dither_color(c);
> -} else if (!strcmp(c->list_dither, "charsets")) {
> +if (c->list_dither & SHOW_CHARSETS)
>  list_dither_charset(c);
> -} else if (!strcmp(c->list_dither, "algorithms")) {
> +if (c->list_dither & SHOW_ALGORITHMS)
>  list_dither_algorithm(c);
> -} else if (!strcmp(c->list_dither, "antialiases")) {
> +if (c->list_dither & SHOW_ANTIALIASES)
>  list_dither_antialias(c);
> -} else {
> -av_log(s, AV_LOG_ERROR,
> -   "Invalid argument '%s', for 'list_dither' option\n"
> -   "Argument must be one of 'algorithms, 'antialiases', 
> 'charsets', 'colors'\n",
> -   c->list_dither);
> -return AVERROR(EINVAL);
> -}
>  return AVERROR_EXIT;
>  }
>  
> @@ -205,11 +205,11 @@ static const AVOption options[] = {
>  { "charset",  "set charset used to render output", OFFSET(charset), 
> AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
>  { "color","set color used to render output",   OFFSET(color),   
> AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
>  { "list_drivers", "list available drivers",  OFFSET(list_drivers), 
> AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, ENC },
> -{ "list_dither", "list available dither options", OFFSET(list_dither), 
> AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, ENC, "list_dither" },
> -{ "algorithms",   NULL, 0, AV_OPT_TYPE_CONST, {.str = "algorithms"}, 0, 
> 0, ENC, "list_dither" },
> -{ "antialiases",  NULL, 0, AV_OPT_TYPE_CONST, {.str = "antialiases"},0, 
> 0, ENC, "list_dither" },
> -{ "charsets", NULL, 0, AV_OPT_TYPE_CONST, {.str = "charsets"},   0, 
> 0, ENC, "list_dither" },
> -{ "colors",   NULL, 0, AV_OPT_TYPE_CONST, {.str = "colors"}, 0, 
> 0, ENC, "list_dither" },
> +{ "list_dither", "list available dither options", OFFSET(list_dither), 
> AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, INT_MAX, ENC, "list_dither" },
> +{ "algorithms",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = SHOW_ALGORITHMS }, 
>  0, 0, ENC, "list_dither" },
> +{ "antialiases",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = SHOW_ANTIALIASES 
> }, 0, 0, ENC, "list_dither" },
> +{ "charsets", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = SHOW_CHARSETS },   
>  0, 0, ENC, "list_dither" },
> +{ "colors",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = SHOW_COLORS }, 
>  0, 0, ENC, "list_dither" },
>  { NULL },
>  };

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

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


Re: [FFmpeg-devel] [PATCH v5 1/2] avfilter: add audio overlay filter

2024-02-04 Thread Stefano Sabatini
On date Thursday 2024-02-01 18:31:56 +0530, Harshit Karwal wrote:
> Co-authored-by: Paul B Mahol 
> Signed-off-by: Harshit Karwal 
> ---
>  doc/filters.texi  |  40 +++
>  libavfilter/Makefile  |   1 +
>  libavfilter/af_aoverlay.c | 548 ++
>  libavfilter/allfilters.c  |   1 +
>  4 files changed, 590 insertions(+)
>  create mode 100644 libavfilter/af_aoverlay.c
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 20c91bab3a..f36ad9a2fd 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -2779,6 +2779,46 @@ This filter supports the same commands as options, 
> excluding option @code{order}
>  
>  Pass the audio source unchanged to the output.
>  
> +@section aoverlay
> +
> +Replace a specified section of an audio stream with another input audio 
> stream.
> +
> +In case no @option{enable} for timeline editing is specified, the second 
> audio stream will
> +be output at sections of the first stream which have a gap in PTS 
> (Presentation TimeStamp) values
> +such that the output stream's PTS values are monotonous.
> +
> +This filter also supports linear cross fading when transitioning from one
> +input stream to another.
> +
> +The filter accepts the following options:
> +
> +@table @option
> +@item cf_duration
> +Set duration (in seconds) for cross fade between the inputs. Default value 
> is @code{100} milliseconds.
> +@end table
> +
> +@subsection Examples
> +
> +@itemize
> +@item
> +Replace the first stream with the second stream from @code{t=10} seconds to 
> @code{t=20} seconds:
> +@example
> +ffmpeg -i first.wav -i second.wav -filter_complex 
> "aoverlay=enable='between(t,10,20)'" output.wav
> +@end example
> +
> +@item
> +Do the same as above, but with crossfading for @code{2} seconds between the 
> streams:
> +@example
> +ffmpeg -i first.wav -i second.wav -filter_complex 
> "aoverlay=cf_duration=2:enable='between(t,10,20)'" output.wav
> +@end example
> +
> +@item
> +Introduce a PTS gap from @code{t=4} seconds to @code{t=8} seconds in the 
> first stream and output the second stream during this gap:
> +@example
> +ffmpeg -i first.wav -i second.wav -filter_complex 
> "[0]aselect='not(between(t,4,8))'[temp];[temp][1]aoverlay[out]" -map "[out]" 
> output.wav
> +@end example
> +@end itemize
> +
>  @section apad
>  
>  Pad the end of an audio stream with silence.
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index bba0219876..0f2b403441 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -81,6 +81,7 @@ OBJS-$(CONFIG_ANLMDN_FILTER) += af_anlmdn.o
>  OBJS-$(CONFIG_ANLMF_FILTER)  += af_anlms.o
>  OBJS-$(CONFIG_ANLMS_FILTER)  += af_anlms.o
>  OBJS-$(CONFIG_ANULL_FILTER)  += af_anull.o
> +OBJS-$(CONFIG_AOVERLAY_FILTER)   += af_aoverlay.o
>  OBJS-$(CONFIG_APAD_FILTER)   += af_apad.o
>  OBJS-$(CONFIG_APERMS_FILTER) += f_perms.o
>  OBJS-$(CONFIG_APHASER_FILTER)+= af_aphaser.o 
> generate_wave_table.o
> diff --git a/libavfilter/af_aoverlay.c b/libavfilter/af_aoverlay.c
> new file mode 100644
> index 00..8dd2d02951
> --- /dev/null
> +++ b/libavfilter/af_aoverlay.c
> @@ -0,0 +1,548 @@
> +/*
> + * Copyright (c) 2023 Harshit Karwal
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +
> +#include "libavutil/opt.h"
> +#include "libavutil/audio_fifo.h"
> +
> +#include "audio.h"
> +#include "avfilter.h"
> +#include "filters.h"
> +#include "internal.h"
> +
> +typedef struct AOverlayContext {
> +const AVClass *class;
> +AVFrame *main_input;
> +AVFrame *overlay_input;
> +int64_t pts;
> +int main_eof;
> +int overlay_eof;
> +
> +int default_mode;
> +int previous_samples;
> +int64_t pts_gap;
> +int64_t previous_pts;
> +int64_t pts_gap_start;
> +int64_t pts_gap_end;
> +
> +int is_disabled;
> +int nb_channels;
> +int crossfade_ready;
> +AVAudioFifo *main_sample_buffers;
> +AVAudioFifo *overlay_sample_buffers;
> +int64_t cf_duration;
> +int64_t cf_samples;
> +void (*crossfade_samples)(uint8_t **dst, uint8_t * const *cf0,
> +  uint8_t * const 

[FFmpeg-devel] [PATCH] avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple

2024-02-04 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavutil/thread.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/thread.h b/libavutil/thread.h
index fa74dd2ea7..2c00c7cc35 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -220,7 +220,13 @@ static inline int ff_thread_setname(const char *name)
 #if HAVE_PRCTL
 ret = AVERROR(prctl(PR_SET_NAME, name));
 #elif HAVE_PTHREAD_SETNAME_NP
+#if defined(__APPLE__)
+ret = AVERROR(pthread_setname_np(name));
+#elif defined(__NetBSD__)
+ret = AVERROR(pthread_setname_np(pthread_self(), "%s", name));
+#else
 ret = AVERROR(pthread_setname_np(pthread_self(), name));
+#endif
 #elif HAVE_PTHREAD_SET_NAME_NP
 pthread_set_name_np(pthread_self(), name);
 #else
-- 
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".


Re: [FFmpeg-devel] Sovereign Tech Fund

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

Le 4 février 2024 21:28:44 GMT+02:00, Michael Niedermayer 
 a écrit :
>On Sun, Feb 04, 2024 at 03:38:43PM +0100, Rémi Denis-Courmont wrote:
>> Hi,
>> 
>> Le 4 février 2024 14:41:15 GMT+01:00, Michael Niedermayer 
>>  a écrit :
>> >Hi
>> >
>> >As said on IRC, i thought people knew it, but ‘the same person as before’ 
>> >is Thilo.
>> >
>> >Ive updated the price design suggestion for the merge task, its 16€ / 
>> >commit limited to 50k€
>> >this comes from looking at pauls fork which has around 500 commits in 2 
>> >months thus
>> >250 commits per month, 12 months, and if we allocate 50k that end with 
>> >roughly 16€ / commit
>> >if activity stays equal.
>> 
>> It's very different if we're talking about librempeg or some other 
>> unspecified fork. I could make a fork that removes MMX et al, and claim that 
>> I'm merging a fork.
>
>There are so many reasons why this wouldnt work
>(first you would have to lie, i dont think you would,
> then it would not be left that way on the wiki,
> not being sent to STF that way
> and not being accepted by STF and more)
>
>But assuming one could get away with that in the short term
>Why would anyone do something like this to destroy our all opertunity
>to obtains grants in the future ?

I don't know. That was purely an example, and I prefer to be the fictional bad 
guy in my examples, so nobody else feels insulted. But you can't blame people 
for being distrustful when a proposal is brought forward on short deadlines 
even though it was privately known for months.


>> Indeed I don't think that a semiformal open-source community with a lot of 
>> strong and varied opinions will carry such dotting of all i's very 
>> effectively. That has been one of the arguments for delegating this to a 
>> contracting IT company rather than to FFmpeg-devel and SPI.
>
>If the FFmpeg team can make decissions about what to fund then we do not need
>any contracting IT company.

Let's face it: FFmpeg is not the healthiest of open-source communities as of 
now.  But that's not even relevant here: OSS communities are typically focused 
on development and maybe support and promotion, *not* HR and payroll, nor 
waterfall-style project management.

Ergo, there would be no shame in conceding that FFmpeg would suck at those 
tasks, and a company whose job those things essentially are would be more 
effective at it. And I'm not saying this out of self-interest, just  pragmatism 
(call it cynicism if you will).

>OTOH If the FFmpeg team is not able to make decissions, thats a far bigger
>problem and it needs to be understood and corrected

I don't think the technical development lists of an OSS community should 
concern themselves with funding matters. Well-funded foundations surely need to 
concern themselves with this, but they don't mix it with development. And 
FFmpeg is not sl well-funded in the first place.

> Because whoever controlls the income of developers
>effectively controlls the project.

As long as there are several parties involved, and a single trust doesn't 
dominate the GA and the TC, I don't see that as a major problem. Or rather, 
it's a lesser problem than loosing competent developers because they need to 
work on something else to earn their living.

>An emloyee has to do what she is being told be her employer. So if the main 
>developers
>become employees payed to work on FFmpeg that would hand FFmpeg to some CEO on 
>a
>silver plate,

20€ are not remotely enough for that to happen. You'd need 2-3 orders of 
magnitude larger investment, without competition, to get there at minimum.

So I don't see a risk here. But it's up to Thilo really, if he insists on going 
through SPI or not applying for STF at all.

>This would change FFmpeg from a Free software project to a commercial company.
>I do NOT agree to this, and i belive many others also do not agree.

I think a lot of people would rather get paid to work on Ffmpeg, and would in 
fact contribute more effectively if they were. And conversely, quite a few 
contributors seem to be acting for their commercial employer already.

Also, as a consultant or maybe an associate for FFlabs, it's a rather 
contradictory position for you to hold.
___
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 18/24] avutil: remove deprecated FF_API_PKT_DURATION

2024-02-04 Thread Andreas Rheinhardt
James Almer:
> Signed-off-by: James Almer 
> ---
>  doc/ffprobe.xsd  |   2 -
>  fftools/ffmpeg_filter.c  |   5 -
>  fftools/ffprobe.c|   6 -
>  libavcodec/decode.c  |   6 -
>  libavdevice/alsa_enc.c   |   7 -
>  libavdevice/pulse_audio_enc.c|   7 -
>  libavfilter/avfilter.c   |   5 -
>  libavfilter/buffersrc.c  |   7 -
>  libavfilter/vf_deshake_opencl.c  |   7 -
>  libavfilter/vf_drawtext.c|  15 -
>  libavfilter/vsrc_testsrc.c   |   5 -
>  libavformat/mux.c|   7 -
>  libavutil/frame.c|  10 -
>  libavutil/frame.h|  13 -
>  libavutil/version.h  |   1 -
>  tests/ref/fate/exif-image-embedded   |  44 ---
>  tests/ref/fate/exif-image-jpg|   2 -
>  tests/ref/fate/exif-image-tiff   |   2 -
>  tests/ref/fate/exif-image-webp   |   2 -
>  tests/ref/fate/ffprobe_compact   |  28 +-
>  tests/ref/fate/ffprobe_csv   |  28 +-
>  tests/ref/fate/ffprobe_default   |  28 --
>  tests/ref/fate/ffprobe_flat  |  28 --
>  tests/ref/fate/ffprobe_ini   |  28 --
>  tests/ref/fate/ffprobe_json  |  28 --
>  tests/ref/fate/ffprobe_xml   |  28 +-
>  tests/ref/fate/ffprobe_xsd   |  28 +-
>  tests/ref/fate/flcl1905  | 350 +--
>  tests/ref/fate/gaplessenc-itunes-to-ipod-aac |  32 +-
>  tests/ref/fate/gaplessenc-pcm-to-mov-aac |  32 +-
>  tests/ref/fate/gaplessinfo-itunes1   |  32 +-
>  tests/ref/fate/gaplessinfo-itunes2   |  32 +-
>  tests/ref/fate/h264-dts_5frames  |  10 -
>  tests/ref/fate/jpg-icc   |   2 -
>  tests/ref/fate/mov-zombie| 130 +++
>  tests/ref/fate/png-icc   |   2 -
>  tests/ref/fate/png-side-data |   2 -
>  37 files changed, 360 insertions(+), 641 deletions(-)
> 
> diff --git a/tests/ref/fate/png-icc b/tests/ref/fate/png-icc
> index 8927cb331a..417cbcb91d 100644
> --- a/tests/ref/fate/png-icc
> +++ b/tests/ref/fate/png-icc
> @@ -16,8 +16,6 @@ pkt_dts=0
>  pkt_dts_time=0.00
>  best_effort_timestamp=0
>  best_effort_timestamp_time=0.00
> -pkt_duration=1
> -pkt_duration_time=0.04
>  duration=1
>  duration_time=0.04
>  pkt_pos=0
> diff --git a/tests/ref/fate/png-side-data b/tests/ref/fate/png-side-data
> index 629971bd23..0d1f88ccb2 100644
> --- a/tests/ref/fate/png-side-data
> +++ b/tests/ref/fate/png-side-data
> @@ -8,8 +8,6 @@ pkt_dts=0
>  pkt_dts_time=0.00
>  best_effort_timestamp=0
>  best_effort_timestamp_time=0.00
> -pkt_duration=1
> -pkt_duration_time=0.04
>  duration=1
>  duration_time=0.04
>  pkt_pos=0

There is also a png-icc-parse fate-test that you have not updated (it is
only run when LCMS2 is enabled).

- 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 16/24] avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT

2024-02-04 Thread Andreas Rheinhardt
James Almer:
> Signed-off-by: James Almer 
> ---
> diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
> index b59d798f29..35b03078c8 100644
> --- a/libavutil/channel_layout.c
> +++ b/libavutil/channel_layout.c
> @@ -214,190 +214,6 @@ static const struct channel_layout_name 
> channel_layout_map[] = {
>  { "22.2",   AV_CHANNEL_LAYOUT_22POINT2,   },
>  };
>  
> -#if FF_API_OLD_CHANNEL_LAYOUT
> -FF_DISABLE_DEPRECATION_WARNINGS
> -static uint64_t get_channel_layout_single(const char *name, int name_len)
> -{
> -int i;
> -char *end;
> -int64_t layout;
> -
> -for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++) {
> -if (strlen(channel_layout_map[i].name) == name_len &&
> -!memcmp(channel_layout_map[i].name, name, name_len))
> -return channel_layout_map[i].layout.u.mask;
> -}
> -for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++)
> -if (channel_names[i].name &&
> -strlen(channel_names[i].name) == name_len &&
> -!memcmp(channel_names[i].name, name, name_len))
> -return (int64_t)1 << i;
> -
> -errno = 0;
> -i = strtol(name, , 10);
> -
> -if (!errno && (end + 1 - name == name_len && *end  == 'c'))
> -return av_get_default_channel_layout(i);
> -
> -errno = 0;
> -layout = strtoll(name, , 0);
> -if (!errno && end - name == name_len)
> -return FFMAX(layout, 0);
> -return 0;
> -}
> -
> -uint64_t av_get_channel_layout(const char *name)
> -{
> -const char *n, *e;
> -const char *name_end = name + strlen(name);
> -int64_t layout = 0, layout_single;
> -
> -for (n = name; n < name_end; n = e + 1) {
> -for (e = n; e < name_end && *e != '+' && *e != '|'; e++);
> -layout_single = get_channel_layout_single(n, e - n);
> -if (!layout_single)
> -return 0;
> -layout |= layout_single;
> -}
> -return layout;
> -}
> -
> -int av_get_extended_channel_layout(const char *name, uint64_t* 
> channel_layout, int* nb_channels)
> -{
> -int nb = 0;
> -char *end;
> -uint64_t layout = av_get_channel_layout(name);
> -
> -if (layout) {
> -*channel_layout = layout;
> -*nb_channels = av_get_channel_layout_nb_channels(layout);
> -return 0;
> -}
> -
> -nb = strtol(name, , 10);
> -if (!errno && *end  == 'C' && *(end + 1) == '\0' && nb > 0 && nb < 64) {
> -*channel_layout = 0;
> -*nb_channels = nb;
> -return 0;
> -}
> -
> -return AVERROR(EINVAL);
> -}
> -
> -void av_bprint_channel_layout(struct AVBPrint *bp,
> -  int nb_channels, uint64_t channel_layout)
> -{
> -int i;
> -
> -if (nb_channels <= 0)
> -nb_channels = av_get_channel_layout_nb_channels(channel_layout);
> -
> -for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++)
> -if (nb_channels== channel_layout_map[i].layout.nb_channels &&
> -channel_layout == channel_layout_map[i].layout.u.mask) {
> -av_bprintf(bp, "%s", channel_layout_map[i].name);
> -return;
> -}
> -
> -av_bprintf(bp, "%d channels", nb_channels);
> -if (channel_layout) {
> -int i, ch;
> -av_bprintf(bp, " (");
> -for (i = 0, ch = 0; i < 64; i++) {
> -if ((channel_layout & (UINT64_C(1) << i))) {
> -const char *name = get_channel_name(i);
> -if (name) {
> -if (ch > 0)
> -av_bprintf(bp, "+");
> -av_bprintf(bp, "%s", name);
> -}
> -ch++;
> -}
> -}
> -av_bprintf(bp, ")");
> -}
> -}
> -
> -void av_get_channel_layout_string(char *buf, int buf_size,
> -  int nb_channels, uint64_t channel_layout)
> -{
> -AVBPrint bp;
> -
> -av_bprint_init_for_buffer(, buf, buf_size);
> -av_bprint_channel_layout(, nb_channels, channel_layout);
> -}
> -
> -int av_get_channel_layout_nb_channels(uint64_t channel_layout)
> -{
> -return av_popcount64(channel_layout);
> -}
> -
> -int64_t av_get_default_channel_layout(int nb_channels) {
> -int i;
> -for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++)
> -if (nb_channels == channel_layout_map[i].layout.nb_channels)
> -return channel_layout_map[i].layout.u.mask;
> -return 0;
> -}
> -
> -int av_get_channel_layout_channel_index(uint64_t channel_layout,
> -uint64_t channel)
> -{
> -if (!(channel_layout & channel) ||
> -av_get_channel_layout_nb_channels(channel) != 1)
> -return AVERROR(EINVAL);
> -channel_layout &= channel - 1;
> -return av_get_channel_layout_nb_channels(channel_layout);
> -}
> -
> -const char *av_get_channel_name(uint64_t channel)
> -{
> -int i;
> -if (av_get_channel_layout_nb_channels(channel) != 1)
> -return 

Re: [FFmpeg-devel] [PATCH v2] lavu/thread: add support for setting thread name on *bsd and solaris

2024-02-04 Thread Marton Balint



On Wed, 31 Jan 2024, Brad Smith wrote:


On 2024-01-23 2:44 p.m., Brad Smith wrote:

 On 2024-01-16 1:25 a.m., Brad Smith wrote:

 On 2024-01-07 12:55 a.m., Brad Smith wrote:

 lavu/thread: add support for setting thread name on *bsd and solaris

 FreeBSD/DragonFly/Solaris use pthread_setname_np(). OpenBSD uses
 pthread_set_name_np().

 Signed-off-by: Brad Smith
 ---
   configure  | 10 ++
   libavutil/thread.h | 14 --
   2 files changed, 22 insertions(+), 2 deletions(-)

 diff --git a/configure b/configure
 index 0b5e83bd20..67660b6292 100755
 --- a/configure
 +++ b/configure
 @@ -2239,6 +2239,7 @@ HEADERS_LIST="
   opencv2_core_core_c_h
   OpenGL_gl3_h
   poll_h
 +    pthread_np_h
   sys_param_h
   sys_resource_h
   sys_select_h
 @@ -2341,6 +2342,8 @@ SYSTEM_FUNCS="
   posix_memalign
   prctl
   pthread_cancel
 +    pthread_set_name_np
 +    pthread_setname_np
   sched_getaffinity
   SecItemImport
   SetConsoleTextAttribute
 @@ -6523,6 +6526,7 @@ check_headers malloc.h
   check_headers mftransform.h
   check_headers net/udplite.h
   check_headers poll.h
 +check_headers pthread_np.h
   check_headers sys/param.h
   check_headers sys/resource.h
   check_headers sys/select.h
 @@ -6691,6 +6695,12 @@ if ! disabled pthreads && ! enabled w32threads &&
 ! enabled os2threads; then
   if enabled pthreads; then
   check_builtin sem_timedwait semaphore.h "sem_t *s;
 sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
   check_func pthread_cancel $pthreads_extralibs
 +    hdrs=pthread.h
 +    if enabled pthread_np_h; then
 +    hdrs="$hdrs pthread_np.h"
 +    fi
 +    check_lib pthread_set_name_np "$hdrs" pthread_set_name_np
 -lpthread
 +    check_lib pthread_setname_np "$hdrs" pthread_setname_np
 -lpthread
   fi
   fi
   diff --git a/libavutil/thread.h b/libavutil/thread.h
 index 2ded498c89..fa74dd2ea7 100644
 --- a/libavutil/thread.h
 +++ b/libavutil/thread.h
 @@ -26,6 +26,8 @@
     #if HAVE_PRCTL
   #include 
 +#elif (HAVE_PTHREAD_SETNAME_NP || HAVE_PTHREAD_SET_NAME_NP) &&
 HAVE_PTHREAD_NP_H
 +#include 
   #endif
     #include "error.h"
 @@ -213,11 +215,19 @@ static inline int ff_thread_once(char *control,
 void (*routine)(void))
     static inline int ff_thread_setname(const char *name)
   {
 +    int ret = 0;
 +
   #if HAVE_PRCTL
 -    return AVERROR(prctl(PR_SET_NAME, name));
 +    ret = AVERROR(prctl(PR_SET_NAME, name));
 +#elif HAVE_PTHREAD_SETNAME_NP
 +    ret = AVERROR(pthread_setname_np(pthread_self(), name));
 +#elif HAVE_PTHREAD_SET_NAME_NP
 +    pthread_set_name_np(pthread_self(), name);
 +#else
 +    ret = AVERROR(ENOSYS);
   #endif
   -    return AVERROR(ENOSYS);
 +    return ret;
   }
     #endif /* AVUTIL_THREAD_H */



 ping.


 ping.



ping.


Will apply.

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

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


Re: [FFmpeg-devel] Sovereign Tech Fund

2024-02-04 Thread Michael Niedermayer
On Sun, Feb 04, 2024 at 03:38:43PM +0100, Rémi Denis-Courmont wrote:
> Hi,
> 
> Le 4 février 2024 14:41:15 GMT+01:00, Michael Niedermayer 
>  a écrit :
> >Hi
> >
> >As said on IRC, i thought people knew it, but ‘the same person as before’ is 
> >Thilo.
> >
> >Ive updated the price design suggestion for the merge task, its 16€ / commit 
> >limited to 50k€
> >this comes from looking at pauls fork which has around 500 commits in 2 
> >months thus
> >250 commits per month, 12 months, and if we allocate 50k that end with 
> >roughly 16€ / commit
> >if activity stays equal.
> 
> It's very different if we're talking about librempeg or some other 
> unspecified fork. I could make a fork that removes MMX et al, and claim that 
> I'm merging a fork.

There are so many reasons why this wouldnt work
(first you would have to lie, i dont think you would,
 then it would not be left that way on the wiki,
 not being sent to STF that way
 and not being accepted by STF and more)

But assuming one could get away with that in the short term
Why would anyone do something like this to destroy our all opertunity
to obtains grants in the future ?


> 
> >The task has ATM no developer on it. If a developer adds himself, he can 
> >change teh task
> >and specify what he proposes to merge.
> >
> >I am totally perplexed why every dot on every i is such a big thing.
> 
> That is the whole point of a statement of work. And I agree that it's tedious 
> and possibly outright annoying...
> 
> Indeed I don't think that a semiformal open-source community with a lot of 
> strong and varied opinions will carry such dotting of all i's very 
> effectively. That has been one of the arguments for delegating this to a 
> contracting IT company rather than to FFmpeg-devel and SPI.

If the FFmpeg team can make decissions about what to fund then we do not need
any contracting IT company.

OTOH If the FFmpeg team is not able to make decissions, thats a far bigger
problem and it needs to be understood and corrected
But not only this

"delegating this to a contracting IT company" really means having a random
CEO make the decissions about FFmpeg instead of the GA or community.
It is unlikely this will be accepted by the GA. And if accepted it would
be the end of FFmpeg. We would have not even sold FFmpeg we would have given
it for free to some company. Because whoever controlls the income of developers
effectively controlls the project.
An emloyee has to do what she is being told be her employer. So if the main 
developers
become employees payed to work on FFmpeg that would hand FFmpeg to some CEO on a
silver plate,
This would change FFmpeg from a Free software project to a commercial company.
I do NOT agree to this, and i belive many others also do not agree.

I am happy if we can get people payed continuously from grants and other sources
but never should FFmpeg give up its autonomy

Also we have "a lot of strong and varied opinions" but IMHO that is not the 
problem here.
The problem is distrust.
Using an "contracting IT company" will make this worse, First
we will not agree on it and if we do, we will end with a fork, whoever is not
"friends" with the CEO of that company will leave.

SPI or a similar entity gives us the transparency where a group of people
who distrust each other can move forward without the need to trust a 3rd party
Everyone can add their entry to the wiki, everyone has the same rights to
edit it. Everyone elected the TC.

I dont think a failure of SPI-STF will result in the money going next time to
a contracting IT company.

We have the opertunity to move forward together here.
Or we can choose not to move forward
Or we can choose not to do it together
Thats fundamentally the choices. In a mathematical sense, there are no other 
choices

I favor moving forward together!

thx

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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


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

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


[FFmpeg-devel] [PATCH v2 5/5] avformat/mov_chan: add support for reading custom channel layouts when layout_tag == 0

2024-02-04 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/mov_chan.c | 99 +++---
 1 file changed, 54 insertions(+), 45 deletions(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index 6b206745b4..302639c332 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -377,23 +377,23 @@ static uint64_t mov_get_channel_layout(uint32_t tag, 
uint32_t bitmap)
 return layout_map[i].layout;
 }
 
-static uint64_t mov_get_channel_mask(uint32_t label)
+static enum AVChannel mov_get_channel_id(uint32_t label)
 {
 if (label == 0)
-return 0;
+return AV_CHAN_UNUSED;
 if (label <= 18)
-return 1U << (label - 1);
+return (label - 1);
 if (label == 35)
-return AV_CH_WIDE_LEFT;
+return AV_CHAN_WIDE_LEFT;
 if (label == 36)
-return AV_CH_WIDE_RIGHT;
+return AV_CHAN_WIDE_RIGHT;
 if (label == 37)
-return AV_CH_LOW_FREQUENCY_2;
+return AV_CHAN_LOW_FREQUENCY_2;
 if (label == 38)
-return AV_CH_STEREO_LEFT;
+return AV_CHAN_STEREO_LEFT;
 if (label == 39)
-return AV_CH_STEREO_RIGHT;
-return 0;
+return AV_CHAN_STEREO_RIGHT;
+return AV_CHAN_UNKNOWN;
 }
 
 static uint32_t mov_get_channel_label(enum AVChannel channel)
@@ -497,8 +497,8 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, 
AVStream *st,
  int64_t size)
 {
 uint32_t layout_tag, bitmap, num_descr;
-uint64_t label_mask, mask = 0;
-int i;
+int ret;
+AVChannelLayout *ch_layout = >codecpar->ch_layout;
 
 if (size < 12)
 return AVERROR_INVALIDDATA;
@@ -514,47 +514,56 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, 
AVStream *st,
 if (size < 12ULL + num_descr * 20ULL)
 return 0;
 
-label_mask = 0;
-for (i = 0; i < num_descr; i++) {
-uint32_t label;
-if (pb->eof_reached) {
-av_log(s, AV_LOG_ERROR,
-   "reached EOF while reading channel layout\n");
-return AVERROR_INVALIDDATA;
+if (layout_tag == 0) {
+int nb_channels = ch_layout->nb_channels ? ch_layout->nb_channels : 
num_descr;
+if (num_descr > nb_channels) {
+av_log(s, AV_LOG_WARNING, "got %d channel descriptions, capping to 
the number of channels %d\n",
+   num_descr, nb_channels);
+num_descr = nb_channels;
 }
-label = avio_rb32(pb);  // mChannelLabel
-avio_rb32(pb);  // mChannelFlags
-avio_rl32(pb);  // mCoordinates[0]
-avio_rl32(pb);  // mCoordinates[1]
-avio_rl32(pb);  // mCoordinates[2]
-size -= 20;
-if (layout_tag == 0) {
-uint64_t mask_incr = mov_get_channel_mask(label);
-if (mask_incr == 0 || mask_incr <= label_mask) {
-label_mask = 0;
-break;
+
+av_channel_layout_uninit(ch_layout);
+ret = av_channel_layout_custom_init(ch_layout, nb_channels);
+if (ret < 0)
+goto out;
+
+for (int i = 0; i < num_descr; i++) {
+uint32_t label;
+if (pb->eof_reached) {
+av_log(s, AV_LOG_ERROR,
+   "reached EOF while reading channel layout\n");
+return AVERROR_INVALIDDATA;
 }
-label_mask |= mask_incr;
+label = avio_rb32(pb);  // mChannelLabel
+avio_rb32(pb);  // mChannelFlags
+avio_rl32(pb);  // mCoordinates[0]
+avio_rl32(pb);  // mCoordinates[1]
+avio_rl32(pb);  // mCoordinates[2]
+size -= 20;
+ch_layout->u.map[i].id = mov_get_channel_id(label);
 }
-}
-if (layout_tag == 0) {
-if (label_mask)
-mask = label_mask;
-} else
-mask = mov_get_channel_layout(layout_tag, bitmap);
-
-if (mask) {
-if (!st->codecpar->ch_layout.nb_channels || av_popcount64(mask) == 
st->codecpar->ch_layout.nb_channels) {
-av_channel_layout_uninit(>codecpar->ch_layout);
-av_channel_layout_from_mask(>codecpar->ch_layout, mask);
-} else {
-av_log(s, AV_LOG_WARNING, "ignoring channel layout with %d 
channels because the real number of channels is %d\n",
-   av_popcount64(mask), st->codecpar->ch_layout.nb_channels);
+
+ret = av_channel_layout_retype(ch_layout, AV_CHANNEL_ORDER_NATIVE, 
AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS);
+if (ret < 0 && ret != AVERROR(ENOSYS))
+goto out;
+} else {
+uint64_t mask = mov_get_channel_layout(layout_tag, bitmap);
+if (mask) {
+if (!ch_layout->nb_channels || av_popcount64(mask) == 
ch_layout->nb_channels) {
+

[FFmpeg-devel] [PATCH v2 4/5] avutil/channel_layout: add av_channel_layout_retype()

2024-02-04 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 doc/APIchanges |   3 ++
 libavutil/channel_layout.c | 106 +
 libavutil/channel_layout.h |  40 ++
 libavutil/version.h|   2 +-
 4 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index cdb9b6a458..221fea30c2 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2024-02-xx - xx - lavu 58.38.100 - channel_layout.h
+  Add av_channel_layout_retype().
+
 2024-02-xx - xx - lavu 58.37.100 - channel_layout.h
   Add av_channel_layout_custom_init().
 
diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index 40e31e9d12..7f51c076dc 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -1036,3 +1036,109 @@ uint64_t av_channel_layout_subset(const AVChannelLayout 
*channel_layout,
 
 return ret;
 }
+
+static int64_t masked_description(AVChannelLayout *channel_layout, int 
start_channel)
+{
+uint64_t mask = 0;
+for (int i = start_channel; i < channel_layout->nb_channels; i++) {
+enum AVChannel ch = channel_layout->u.map[i].id;
+if (ch >= 0 && ch < 63 && mask < (1ULL << ch))
+mask |= (1ULL << ch);
+else
+return AVERROR(EINVAL);
+}
+return mask;
+}
+
+static int has_channel_names(AVChannelLayout *channel_layout)
+{
+if (channel_layout->order != AV_CHANNEL_ORDER_CUSTOM)
+return 0;
+for (int i = 0; i < channel_layout->nb_channels; i++)
+if (channel_layout->u.map[i].name[0])
+return 1;
+return 0;
+}
+
+int av_channel_layout_retype(AVChannelLayout *channel_layout, enum 
AVChannelOrder order, int flags)
+{
+int allow_lossy = !(flags & AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS);
+int lossy;
+
+if (!av_channel_layout_check(channel_layout))
+return AVERROR(EINVAL);
+
+if (channel_layout->order == order)
+return 0;
+
+switch (order) {
+case AV_CHANNEL_ORDER_UNSPEC: {
+int nb_channels = channel_layout->nb_channels;
+if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM) {
+lossy = 0;
+for (int i = 0; i < nb_channels; i++) {
+if (channel_layout->u.map[i].id != AV_CHAN_UNKNOWN || 
channel_layout->u.map[i].name[0]) {
+lossy = 1;
+break;
+}
+}
+} else {
+lossy = 1;
+}
+if (!lossy || allow_lossy) {
+av_channel_layout_uninit(channel_layout);
+channel_layout->order   = AV_CHANNEL_ORDER_UNSPEC;
+channel_layout->nb_channels = nb_channels;
+return lossy;
+}
+return AVERROR(ENOSYS);
+}
+case AV_CHANNEL_ORDER_NATIVE:
+if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM) {
+int64_t mask = masked_description(channel_layout, 0);
+if (mask < 0)
+return AVERROR(ENOSYS);
+lossy = has_channel_names(channel_layout);
+if (!lossy || allow_lossy) {
+av_channel_layout_uninit(channel_layout);
+av_channel_layout_from_mask(channel_layout, mask);
+return lossy;
+}
+}
+return AVERROR(ENOSYS);
+case AV_CHANNEL_ORDER_CUSTOM: {
+AVChannelLayout custom = { 0 };
+int ret = av_channel_layout_custom_init(, 
channel_layout->nb_channels);
+if (ret < 0)
+return ret;
+if (channel_layout->order != AV_CHANNEL_ORDER_UNSPEC)
+for (int i = 0; i < channel_layout->nb_channels; i++)
+custom.u.map[i].id = 
av_channel_layout_channel_from_index(channel_layout, i);
+av_channel_layout_uninit(channel_layout);
+*channel_layout = custom;
+return 0;
+}
+case AV_CHANNEL_ORDER_AMBISONIC:
+if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM) {
+int64_t mask;
+int nb_channels = channel_layout->nb_channels;
+int order = ambisonic_order(channel_layout);
+if (order < 0)
+return AVERROR(ENOSYS);
+mask = masked_description(channel_layout, (order + 1) * (order + 
1));
+if (mask < 0)
+return AVERROR(ENOSYS);
+lossy = has_channel_names(channel_layout);
+if (!lossy || allow_lossy) {
+av_channel_layout_uninit(channel_layout);
+channel_layout->order   = AV_CHANNEL_ORDER_AMBISONIC;
+channel_layout->nb_channels = nb_channels;
+channel_layout->u.mask  = mask;
+return lossy;
+}
+}
+return AVERROR(ENOSYS);
+default:
+return AVERROR(EINVAL);
+}
+}
diff --git a/libavutil/channel_layout.h 

[FFmpeg-devel] [PATCH v2 3/5] avutil/channel_layout: add av_channel_layout_custom_init()

2024-02-04 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 doc/APIchanges |  3 +++
 libavutil/channel_layout.c | 20 
 libavutil/channel_layout.h | 17 +
 libavutil/version.h|  4 ++--
 4 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 1f5724324a..cdb9b6a458 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2024-02-xx - xx - lavu 58.37.100 - channel_layout.h
+  Add av_channel_layout_custom_init().
+
 2024-02-04 - xx - lavc 60.39.100 - packet.h
   Add AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT.
 
diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index b59d798f29..40e31e9d12 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -398,6 +398,26 @@ int av_get_standard_channel_layout(unsigned index, 
uint64_t *layout,
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
+int av_channel_layout_custom_init(AVChannelLayout *channel_layout, int 
nb_channels)
+{
+AVChannelCustom *map;
+
+if (nb_channels <= 0)
+return AVERROR(EINVAL);
+
+map = av_calloc(nb_channels, sizeof(*channel_layout->u.map));
+if (!map)
+return AVERROR(ENOMEM);
+for (int i = 0; i < nb_channels; i++)
+map[i].id = AV_CHAN_UNKNOWN;
+
+channel_layout->order   = AV_CHANNEL_ORDER_CUSTOM;
+channel_layout->nb_channels = nb_channels;
+channel_layout->u.map   = map;
+
+return 0;
+}
+
 int av_channel_layout_from_mask(AVChannelLayout *channel_layout,
 uint64_t mask)
 {
diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index 8dc1a91401..dcc320cbfe 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -617,6 +617,23 @@ void av_channel_description_bprint(struct AVBPrint *bp, 
enum AVChannel channel_i
  */
 enum AVChannel av_channel_from_string(const char *name);
 
+/**
+ * Initialize a custom channel layout with the specified number of channels.
+ * The channel map will be allocated and the designation of all channels will
+ * be set to AV_CHAN_UNKNOWN.
+ *
+ * This is only a convenience helper function, a custom channel layout can also
+ * be constructed without using this.
+ *
+ * @param channel_layout the layout structure to be initialized
+ * @param nb_channels the number of channels
+ *
+ * @return 0 on success
+ * AVERROR(EINVAL) if the number of channels <= 0
+ * AVERROR(ENOMEM) if the channel map could not be allocated
+ */
+int av_channel_layout_custom_init(AVChannelLayout *channel_layout, int 
nb_channels);
+
 /**
  * Initialize a native channel layout from a bitmask indicating which channels
  * are present.
diff --git a/libavutil/version.h b/libavutil/version.h
index 772c4e209c..3b38f8f5da 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,8 +79,8 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  58
-#define LIBAVUTIL_VERSION_MINOR  36
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR  37
+#define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
-- 
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".


Re: [FFmpeg-devel] [PATCH] flv: fix stereo flag when writing PCMA/PCMU

2024-02-04 Thread Marton Balint




On Wed, 31 Jan 2024, aler9 wrote:


Hello again, i'm bumping this patch since currently it's impossible to
stream 16khz or stereo G711 tracks with RTMP, as these are always marked as
8khz, mono tracks.
Please consider merging. Thanks.


Will apply, thanks.

Marton




Il giorno dom 21 gen 2024 alle ore 16:16 Alessandro Ros 
ha scritto:


Currently, when writing PCMA or PCMU tracks with FLV or RTMP, the
stereo flag and sample rate flag inside RTMP audio messages are
overridden, making impossible to distinguish between mono and stereo
tracks. This patch fixes the issue by restoring the same flag mechanism
of all other codecs, that takes into consideration the right channel
count and sample rate.

Signed-off-by: Alessandro Ros 
---
 libavformat/flvenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 874560fac1..772d891136 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -208,10 +208,10 @@ error:
 flags |= FLV_CODECID_NELLYMOSER|
FLV_SAMPLESSIZE_16BIT;
 break;
 case AV_CODEC_ID_PCM_MULAW:
-flags = FLV_CODECID_PCM_MULAW | FLV_SAMPLERATE_SPECIAL |
FLV_SAMPLESSIZE_16BIT;
+flags |= FLV_CODECID_PCM_MULAW | FLV_SAMPLESSIZE_16BIT;
 break;
 case AV_CODEC_ID_PCM_ALAW:
-flags = FLV_CODECID_PCM_ALAW  | FLV_SAMPLERATE_SPECIAL |
FLV_SAMPLESSIZE_16BIT;
+flags |= FLV_CODECID_PCM_ALAW | FLV_SAMPLESSIZE_16BIT;
 break;
 case 0:
 flags |= par->codec_tag << 4;
--
2.34.1



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

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


___
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/d3d12va: Improve behaviour on missing decoder support

2024-02-04 Thread Mark Thompson

On 04/02/2024 16:57, Wu Jianhua wrote:

发件人: ffmpeg-devel  代表 Mark Thompson 

发送时间: 2024年2月4日 5:24
收件人: FFmpeg development discussions and patches
主题: [FFmpeg-devel] [PATCH] lavc/d3d12va: Improve behaviour on missing decoder 
support

Distinguish between a decoder being entirely missing and a decoder which
requires features which are not present in the incomplete implementation
in libavcodec and therefore can't be used.
---
   libavcodec/d3d12va_decode.c | 12 
   1 file changed, 8 insertions(+), 4 deletions(-)


LGTM. Thanks.

Applied.  Thank you!.

- 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".


[FFmpeg-devel] [PATCH v2] doc/formats: clarify meaning of igndts as per definition in avformat.h

2024-02-04 Thread Marth64
This updates the documentation to be more clear about igndts,
as per feedback in December variant of this patch (thank you)

Signed-off-by: Marth64 
---
 doc/formats.texi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/formats.texi b/doc/formats.texi
index 640b23b790..69fc1457a4 100644
--- a/doc/formats.texi
+++ b/doc/formats.texi
@@ -46,7 +46,8 @@ Enable fast, but inaccurate seeks for some formats.
 @item genpts
 Generate missing PTS if DTS is present.
 @item igndts
-Ignore DTS if PTS is set. Inert when nofillin is set.
+Ignore DTS if PTS is also set. In case the PTS is set, the DTS value
+is set to NOPTS. This is ignored when the @code{nofillin} flag is set.
 @item ignidx
 Ignore index.
 @item nobuffer
-- 
2.34.1

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

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


[FFmpeg-devel] [PATCH] libavformat/matroskaenc: reformat options table indentation and descriptions

2024-02-04 Thread Marth64
matroskaenc options table has grown packed over time, and is now challenging
to read. The purpose of this patch is to reformat the table, indentation-wise,
and to make the capitalization/endings of each description at least consistent.

I intend to sort the options in a follow-up patch, but wanted to phase
this out to be easier to validate.

Signed-off-by: Marth64 
---
 libavformat/matroskaenc.c | 42 ++-
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 1457a6890c..2668d1e009 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -3497,20 +3497,34 @@ static const AVCodecTag additional_subtitle_tags[] = {
 #define OFFSET(x) offsetof(MatroskaMuxContext, x)
 #define FLAGS AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
-{ "reserve_index_space", "Reserve a given amount of space (in bytes) at 
the beginning of the file for the index (cues).", OFFSET(reserve_cues_space), 
AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX,   FLAGS },
-{ "cues_to_front", "Move Cues (the index) to the front by shifting data if 
necessary", OFFSET(move_cues_to_front), AV_OPT_TYPE_BOOL, { .i64 = 0}, 0, 1, 
FLAGS },
-{ "cluster_size_limit",  "Store at most the provided amount of bytes in a 
cluster. ", OFFSET(cluster_size_limit), 
AV_OPT_TYPE_INT  , { .i64 = -1 }, -1, INT_MAX,   FLAGS },
-{ "cluster_time_limit",  "Store at most the provided number of 
milliseconds in a cluster.",   
OFFSET(cluster_time_limit), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, 
FLAGS },
-{ "dash", "Create a WebM file conforming to WebM DASH specification", 
OFFSET(is_dash), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
-{ "dash_track_number", "Track number for the DASH stream", 
OFFSET(dash_track_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
-{ "live", "Write files assuming it is a live stream.", OFFSET(is_live), 
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
-{ "allow_raw_vfw", "allow RAW VFW mode", OFFSET(allow_raw_vfw), 
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
-{ "flipped_raw_rgb", "Raw RGB bitmaps in VFW mode are stored bottom-up", 
OFFSET(flipped_raw_rgb), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
-{ "write_crc32", "write a CRC32 element inside every Level 1 element", 
OFFSET(write_crc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
-{ "default_mode", "Controls how a track's FlagDefault is inferred", 
OFFSET(default_mode), AV_OPT_TYPE_INT, { .i64 = DEFAULT_MODE_PASSTHROUGH }, 
DEFAULT_MODE_INFER, DEFAULT_MODE_PASSTHROUGH, FLAGS, "default_mode" },
-{ "infer", "For each track type, mark each track of disposition default as 
default; if none exists, mark the first track as default.", 0, 
AV_OPT_TYPE_CONST, { .i64 = DEFAULT_MODE_INFER }, 0, 0, FLAGS, "default_mode" },
-{ "infer_no_subs", "For each track type, mark each track of disposition 
default as default; for audio and video: if none exists, mark the first track 
as default.", 0, AV_OPT_TYPE_CONST, { .i64 = DEFAULT_MODE_INFER_NO_SUBS }, 0, 
0, FLAGS, "default_mode" },
-{ "passthrough", "Use the disposition flag as-is", 0, AV_OPT_TYPE_CONST, { 
.i64 = DEFAULT_MODE_PASSTHROUGH }, 0, 0, FLAGS, "default_mode" },
+{ "reserve_index_space", "Reserve a given amount of space (in bytes) at 
the beginning of the file for the index (cues)",
+ OFFSET(reserve_cues_space), AV_OPT_TYPE_INT,   { 
.i64 = 0 },   0,  INT_MAX,FLAGS },
+{ "cues_to_front",   "Move Cues (the index) to the front by shifting 
data if necessary",
+ OFFSET(move_cues_to_front), AV_OPT_TYPE_BOOL,  { 
.i64 = 0 },   0,  1,  FLAGS },
+{ "cluster_size_limit",  "Store at most the provided amount of bytes in a 
cluster",
+ OFFSET(cluster_size_limit), AV_OPT_TYPE_INT,   { 
.i64 = -1 },  -1, INT_MAX,FLAGS },
+{ "cluster_time_limit",  "Store at most the provided number of 
milliseconds in a cluster",
+ OFFSET(cluster_time_limit), AV_OPT_TYPE_INT64, { 
.i64 = -1 },  -1, INT64_MAX,  FLAGS },
+{ "dash","Create a WebM file conforming to WebM DASH 
specification",
+ OFFSET(is_dash),AV_OPT_TYPE_BOOL,  { 
.i64 = 0 },   0,  1,  FLAGS },
+{ "dash_track_number",   "Track number for the DASH stream",
+ OFFSET(dash_track_number),  AV_OPT_TYPE_INT,   { 
.i64 = 1 },   1,  INT_MAX,FLAGS },
+{ "live","Write files assuming it is a live stream",
+ OFFSET(is_live),AV_OPT_TYPE_BOOL,  { 
.i64 = 0 },   0,  1,  FLAGS },
+{ "allow_raw_vfw",   "Allow RAW VFW mode",
+ OFFSET(allow_raw_vfw),  AV_OPT_TYPE_BOOL,  

[FFmpeg-devel] [PATCH] avdevice/caca: Allow to list multiple dither option types at once

2024-02-04 Thread Andreas Rheinhardt
This can be achieved by using AV_OPT_TYPE_FLAGS instead of
AV_OPT_TYPE_STRING. It also avoids strcmp() when accessing
the option.

Signed-off-by: Andreas Rheinhardt 
---
 libavdevice/caca.c | 34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavdevice/caca.c b/libavdevice/caca.c
index 6af1649137..c0e09cf6f7 100644
--- a/libavdevice/caca.c
+++ b/libavdevice/caca.c
@@ -24,6 +24,13 @@
 #include "libavformat/mux.h"
 #include "avdevice.h"
 
+enum {
+SHOW_ALGORITHMS  = 1 << 0,
+SHOW_ANTIALIASES = 1 << 1,
+SHOW_CHARSETS= 1 << 2,
+SHOW_COLORS  = 1 << 3,
+};
+
 typedef struct CACAContext {
 AVClass *class;
 AVFormatContext *ctx;
@@ -38,7 +45,7 @@ typedef struct CACAContext {
 char*charset, *color;
 char*driver;
 
-char*list_dither;
+int list_dither;
 int list_drivers;
 } CACAContext;
 
@@ -99,21 +106,14 @@ static int caca_write_header(AVFormatContext *s)
 return AVERROR_EXIT;
 }
 if (c->list_dither) {
-if (!strcmp(c->list_dither, "colors")) {
+if (c->list_dither & SHOW_COLORS)
 list_dither_color(c);
-} else if (!strcmp(c->list_dither, "charsets")) {
+if (c->list_dither & SHOW_CHARSETS)
 list_dither_charset(c);
-} else if (!strcmp(c->list_dither, "algorithms")) {
+if (c->list_dither & SHOW_ALGORITHMS)
 list_dither_algorithm(c);
-} else if (!strcmp(c->list_dither, "antialiases")) {
+if (c->list_dither & SHOW_ANTIALIASES)
 list_dither_antialias(c);
-} else {
-av_log(s, AV_LOG_ERROR,
-   "Invalid argument '%s', for 'list_dither' option\n"
-   "Argument must be one of 'algorithms, 'antialiases', 
'charsets', 'colors'\n",
-   c->list_dither);
-return AVERROR(EINVAL);
-}
 return AVERROR_EXIT;
 }
 
@@ -205,11 +205,11 @@ static const AVOption options[] = {
 { "charset",  "set charset used to render output", OFFSET(charset), 
AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
 { "color","set color used to render output",   OFFSET(color),   
AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
 { "list_drivers", "list available drivers",  OFFSET(list_drivers), 
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, ENC },
-{ "list_dither", "list available dither options", OFFSET(list_dither), 
AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, ENC, "list_dither" },
-{ "algorithms",   NULL, 0, AV_OPT_TYPE_CONST, {.str = "algorithms"}, 0, 0, 
ENC, "list_dither" },
-{ "antialiases",  NULL, 0, AV_OPT_TYPE_CONST, {.str = "antialiases"},0, 0, 
ENC, "list_dither" },
-{ "charsets", NULL, 0, AV_OPT_TYPE_CONST, {.str = "charsets"},   0, 0, 
ENC, "list_dither" },
-{ "colors",   NULL, 0, AV_OPT_TYPE_CONST, {.str = "colors"}, 0, 0, 
ENC, "list_dither" },
+{ "list_dither", "list available dither options", OFFSET(list_dither), 
AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, INT_MAX, ENC, "list_dither" },
+{ "algorithms",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = SHOW_ALGORITHMS },  
0, 0, ENC, "list_dither" },
+{ "antialiases",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = SHOW_ANTIALIASES }, 
0, 0, ENC, "list_dither" },
+{ "charsets", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = SHOW_CHARSETS },
0, 0, ENC, "list_dither" },
+{ "colors",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = SHOW_COLORS },  
0, 0, ENC, "list_dither" },
 { NULL },
 };
 
-- 
2.34.1

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

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


[FFmpeg-devel] 回复: [PATCH] lavc/d3d12va: Improve behaviour on missing decoder support

2024-02-04 Thread Wu Jianhua
> 发件人: ffmpeg-devel  代表 Mark Thompson 
> 
> 发送时间: 2024年2月4日 5:24
> 收件人: FFmpeg development discussions and patches
> 主题: [FFmpeg-devel] [PATCH] lavc/d3d12va: Improve behaviour on missing decoder 
> support
> 
> Distinguish between a decoder being entirely missing and a decoder which
> requires features which are not present in the incomplete implementation
> in libavcodec and therefore can't be used.
> ---
>   libavcodec/d3d12va_decode.c | 12 
>   1 file changed, 8 insertions(+), 4 deletions(-)

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

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


[FFmpeg-devel] [PATCH] avutil/opt: Fix AV_OPT_TYPE_CONST default value

2024-02-04 Thread Andreas Rheinhardt
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.)

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 0908751752..d13b1ab504 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -93,7 +93,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 *den= ((AVRational *)dst)->den;
 return 0;
 case AV_OPT_TYPE_CONST:
-*num = o->default_val.dbl;
+*intnum = o->default_val.i64;
 return 0;
 }
 return AVERROR(EINVAL);
@@ -878,7 +878,7 @@ int av_opt_get(void *obj, const char *name, int 
search_flags, uint8_t **out_val)
 ret = snprintf(buf, sizeof(buf), "%d/%d", ((AVRational *)dst)->num, 
((AVRational *)dst)->den);
 break;
 case AV_OPT_TYPE_CONST:
-ret = snprintf(buf, sizeof(buf), "%f", o->default_val.dbl);
+ret = snprintf(buf, sizeof(buf), "%"PRId64, o->default_val.i64);
 break;
 case AV_OPT_TYPE_STRING:
 if (*(uint8_t **)dst) {
-- 
2.34.1

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

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


Re: [FFmpeg-devel] [PATCH 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias

2024-02-04 Thread Mark Thompson

On 02/02/2024 02:57, Lynne wrote:

Needed for AV1.


> From 81be215060a718fdc3d043847e8155ba56fcb431 Mon Sep 17 00:00:00 2001
> From: Lynne 
> Date: Fri, 2 Feb 2024 03:54:06 +0100
> Subject: [PATCH 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias
>
> Needed for AV1.
> ---
>  libavcodec/cbs_av1.h |  1 +
>  libavcodec/cbs_av1_syntax_template.c | 10 ++
>  2 files changed, 11 insertions(+)
>
> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
> index a5402f069d..cbb43ac810 100644
> --- a/libavcodec/cbs_av1.h
> +++ b/libavcodec/cbs_av1.h
> @@ -198,6 +198,7 @@ typedef struct AV1RawFrameHeader {
>  uint8_t refresh_frame_flags;
>  uint8_t allow_intrabc;
>  uint8_t ref_order_hint[AV1_NUM_REF_FRAMES];
> +uint8_t ref_frame_sign_bias[AV1_NUM_REF_FRAMES];

This isn't a syntax element so it shouldn't go in the syntax structure.  Put it 
in the context structure with other derived fields (the pointer is already 
available as priv where you want it).

>  uint8_t frame_refs_short_signaling;
>  uint8_t last_frame_idx;
>  uint8_t golden_frame_idx;
> diff --git a/libavcodec/cbs_av1_syntax_template.c 
b/libavcodec/cbs_av1_syntax_template.c
> index 3be1f2d30f..00e9a6d030 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -1572,6 +1572,16 @@ static int 
FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
>  }
>
>  if (!frame_is_intra) {
> +for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
> +if (seq->enable_order_hint) {
> +int idx = current->ref_frame_idx[i];
> +int hint = current->ref_order_hint[idx];
> +current->ref_frame_sign_bias[i] = 
cbs_av1_get_relative_dist(seq, hint,
> +
priv->order_hint) > 0;
> +} else {
> +infer(ref_frame_sign_bias[i], 0);
> +}
> +}
>  // Derive reference frame sign biases.
>  }
>
> --
> 2.43.0.381.gb435a96ce8

Please exactly follow the layout of the specification as far as possible, since 
that makes it much easier to assess whether it is correct.  It looks like the 
indexing is wrong?  (Note that LAST_FRAME == 1.)

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 v4 3/3] tests/fate/mov: add a test for reading and writing amve box

2024-02-04 Thread James Almer




On 2/4/2024 12:14 PM, Cosmin Stejerean via ffmpeg-devel wrote:

From: Cosmin Stejerean 

---
  tests/fate/mov.mak|  5 +
  tests/ref/fate/mov-read-amve  |  8 
  tests/ref/fate/mov-write-amve | 33 +
  3 files changed, 46 insertions(+)
  create mode 100644 tests/ref/fate/mov-read-amve
  create mode 100644 tests/ref/fate/mov-write-amve

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index f202f36d96..65854d1628 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -9,6 +9,7 @@ FATE_MOV = fate-mov-3elist \
 fate-mov-frag-encrypted \
 fate-mov-tenc-only-encrypted \
 fate-mov-invalid-elst-entry-count \
+   fate-mov-write-amve \
 fate-mov-gpmf-remux \
 fate-mov-440hz-10ms \
 fate-mov-ibi-elst-starts-b \
@@ -25,6 +26,7 @@ FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \
 fate-mov-zombie \
 fate-mov-init-nonkeyframe \
 fate-mov-displaymatrix \
+   fate-mov-read-amve \
 fate-mov-spherical-mono \
 fate-mov-guess-delay-1 \
 fate-mov-guess-delay-2 \
@@ -109,6 +111,9 @@ fate-mov-init-nonkeyframe: CMD = run 
ffprobe$(PROGSSUF)$(EXESUF) -show_packets -
  
  fate-mov-displaymatrix: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=display_aspect_ratio,sample_aspect_ratio:stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/displaymatrix.mov
  
+fate-mov-read-amve: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/amve.mov

+fate-mov-write-amve: CMD = transcode mov $(TARGET_SAMPLES)/mov/amve.mov mp4 "-c copy" "-c:v 
copy -t 0.5" "-show_entries stream_side_data_list"


The sample hasn't been uploaded to the fate suite. Where is it available?


+
  fate-mov-spherical-mono: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/spherical.mov
  
  fate-mov-gpmf-remux: CMD = md5 -i $(TARGET_SAMPLES)/mov/fake-gp-media-with-real-gpmf.mp4 -map 0 -c copy -fflags +bitexact -f mp4

diff --git a/tests/ref/fate/mov-read-amve b/tests/ref/fate/mov-read-amve
new file mode 100644
index 00..91d34d94dd
--- /dev/null
+++ b/tests/ref/fate/mov-read-amve
@@ -0,0 +1,8 @@
+[STREAM]
+[SIDE_DATA]
+side_data_type=Ambient viewing environment
+ambient_illuminance=314/1
+ambient_light_x=15635/5
+ambient_light_y=16450/5
+[/SIDE_DATA]
+[/STREAM]
diff --git a/tests/ref/fate/mov-write-amve b/tests/ref/fate/mov-write-amve
new file mode 100644
index 00..115cdbd9f0
--- /dev/null
+++ b/tests/ref/fate/mov-write-amve
@@ -0,0 +1,33 @@
+850c56be1114aa21a2e41bd4ea3da144 *tests/data/fate/mov-write-amve.mp4
+23677 tests/data/fate/mov-write-amve.mp4
+#extradata 0:   49, 0x7f8d1145
+#tb 0: 1/15360
+#media_type 0: video
+#codec_id 0: h264
+#dimensions 0: 640x360
+#sar 0: 0/1
+0,  -1024,  0,  512,11849, 0xf21aa1d0
+0,   -512,   2048,  512, 1572, 0xf0c41b68, F=0x0
+0,  0,   1024,  512,  347, 0x9b8daabf, F=0x0
+0,512,512,  512,  195, 0x557e58db, F=0x0
+0,   1024,   1536,  512,  134, 0x423541b4, F=0x0
+0,   1536,   3072,  512, 1454, 0xe5a2cdad, F=0x0
+0,   2048,   2560,  512,  168, 0xd0ef5402, F=0x0
+0,   2560,   5120,  512, 1395, 0x603eb602, F=0x0
+0,   3072,   4096,  512,  304, 0x69cc92a6, F=0x0
+0,   3584,   3584,  512,  145, 0x3f1a4462, F=0x0
+0,   4096,   4608,  512,  154, 0x953851d1, F=0x0
+0,   4608,   5632,  512,  876, 0xad65ace7, F=0x0
+0,   5120,   7680,  512,  742, 0x6b6d689f, F=0x0
+0,   5632,   6656,  512,  177, 0xa4f2573b, F=0x0
+0,   6144,   6144,  512,  101, 0xb0722d2b, F=0x0
+0,   6656,   7168,  512,  105, 0x1f6033ed, F=0x0
+0,   7168,   9728,  512,  589, 0xcd912063, F=0x0
+[STREAM]
+[SIDE_DATA]
+side_data_type=Ambient viewing environment
+ambient_illuminance=314/1
+ambient_light_x=15635/5
+ambient_light_y=16450/5
+[/SIDE_DATA]
+[/STREAM]

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

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


Re: [FFmpeg-devel] [PATCH v4 1/3] avcodec: add ambient viewing environment packet side data.

2024-02-04 Thread Marton Balint




On Sun, 4 Feb 2024, Cosmin Stejerean via ffmpeg-devel wrote:


From: Damiano Galassi 

---
doc/APIchanges| 3 +++
fftools/ffprobe.c | 3 +++
libavcodec/avpacket.c | 1 +
libavcodec/decode.c   | 1 +
libavcodec/packet.h   | 9 -
libavcodec/version.h  | 2 +-
6 files changed, 17 insertions(+), 2 deletions(-)




int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx,
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 2c57d262c6..bb28e7d62a 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -331,7 +331,14 @@ enum AVPacketSideDataType {
 * If its value becomes huge, some code using it
 * needs to be updated as it assumes it to be smaller than other limits.
 */
-AV_PKT_DATA_NB
+AV_PKT_DATA_NB,
+
+/**
+ * Ambient viewing environment metadata, as defined by H.274.. This 
metadata
+ * should be associated with a video stream and contains data in the form
+ * of the AVAmbientViewingEnvironment struct.
+*/
+AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT
};


AV_PKT_DATA_NB has to be kept the last.

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

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


[FFmpeg-devel] [PATCH v4 3/3] tests/fate/mov: add a test for reading and writing amve box

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel
From: Cosmin Stejerean 

---
 tests/fate/mov.mak|  5 +
 tests/ref/fate/mov-read-amve  |  8 
 tests/ref/fate/mov-write-amve | 33 +
 3 files changed, 46 insertions(+)
 create mode 100644 tests/ref/fate/mov-read-amve
 create mode 100644 tests/ref/fate/mov-write-amve

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index f202f36d96..65854d1628 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -9,6 +9,7 @@ FATE_MOV = fate-mov-3elist \
fate-mov-frag-encrypted \
fate-mov-tenc-only-encrypted \
fate-mov-invalid-elst-entry-count \
+   fate-mov-write-amve \
fate-mov-gpmf-remux \
fate-mov-440hz-10ms \
fate-mov-ibi-elst-starts-b \
@@ -25,6 +26,7 @@ FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \
fate-mov-zombie \
fate-mov-init-nonkeyframe \
fate-mov-displaymatrix \
+   fate-mov-read-amve \
fate-mov-spherical-mono \
fate-mov-guess-delay-1 \
fate-mov-guess-delay-2 \
@@ -109,6 +111,9 @@ fate-mov-init-nonkeyframe: CMD = run 
ffprobe$(PROGSSUF)$(EXESUF) -show_packets -
 
 fate-mov-displaymatrix: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
stream=display_aspect_ratio,sample_aspect_ratio:stream_side_data_list 
-select_streams v -v 0 $(TARGET_SAMPLES)/mov/displaymatrix.mov
 
+fate-mov-read-amve: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/amve.mov
+fate-mov-write-amve: CMD = transcode mov $(TARGET_SAMPLES)/mov/amve.mov mp4 
"-c copy" "-c:v copy -t 0.5" "-show_entries stream_side_data_list"
+
 fate-mov-spherical-mono: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/spherical.mov
 
 fate-mov-gpmf-remux: CMD = md5 -i 
$(TARGET_SAMPLES)/mov/fake-gp-media-with-real-gpmf.mp4 -map 0 -c copy -fflags 
+bitexact -f mp4
diff --git a/tests/ref/fate/mov-read-amve b/tests/ref/fate/mov-read-amve
new file mode 100644
index 00..91d34d94dd
--- /dev/null
+++ b/tests/ref/fate/mov-read-amve
@@ -0,0 +1,8 @@
+[STREAM]
+[SIDE_DATA]
+side_data_type=Ambient viewing environment
+ambient_illuminance=314/1
+ambient_light_x=15635/5
+ambient_light_y=16450/5
+[/SIDE_DATA]
+[/STREAM]
diff --git a/tests/ref/fate/mov-write-amve b/tests/ref/fate/mov-write-amve
new file mode 100644
index 00..115cdbd9f0
--- /dev/null
+++ b/tests/ref/fate/mov-write-amve
@@ -0,0 +1,33 @@
+850c56be1114aa21a2e41bd4ea3da144 *tests/data/fate/mov-write-amve.mp4
+23677 tests/data/fate/mov-write-amve.mp4
+#extradata 0:   49, 0x7f8d1145
+#tb 0: 1/15360
+#media_type 0: video
+#codec_id 0: h264
+#dimensions 0: 640x360
+#sar 0: 0/1
+0,  -1024,  0,  512,11849, 0xf21aa1d0
+0,   -512,   2048,  512, 1572, 0xf0c41b68, F=0x0
+0,  0,   1024,  512,  347, 0x9b8daabf, F=0x0
+0,512,512,  512,  195, 0x557e58db, F=0x0
+0,   1024,   1536,  512,  134, 0x423541b4, F=0x0
+0,   1536,   3072,  512, 1454, 0xe5a2cdad, F=0x0
+0,   2048,   2560,  512,  168, 0xd0ef5402, F=0x0
+0,   2560,   5120,  512, 1395, 0x603eb602, F=0x0
+0,   3072,   4096,  512,  304, 0x69cc92a6, F=0x0
+0,   3584,   3584,  512,  145, 0x3f1a4462, F=0x0
+0,   4096,   4608,  512,  154, 0x953851d1, F=0x0
+0,   4608,   5632,  512,  876, 0xad65ace7, F=0x0
+0,   5120,   7680,  512,  742, 0x6b6d689f, F=0x0
+0,   5632,   6656,  512,  177, 0xa4f2573b, F=0x0
+0,   6144,   6144,  512,  101, 0xb0722d2b, F=0x0
+0,   6656,   7168,  512,  105, 0x1f6033ed, F=0x0
+0,   7168,   9728,  512,  589, 0xcd912063, F=0x0
+[STREAM]
+[SIDE_DATA]
+side_data_type=Ambient viewing environment
+ambient_illuminance=314/1
+ambient_light_x=15635/5
+ambient_light_y=16450/5
+[/SIDE_DATA]
+[/STREAM]
-- 
2.42.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 v4 2/3] avformat/mov: add support for 'amve' ambient viewing environment box. As defined in ISOBMFF (ISO/IEC 14496-12) document.

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel
From: Damiano Galassi 

Co-Authored-By: Cosmin Stejerean 
---
 libavformat/dump.c   | 15 +
 libavformat/isom.h   |  3 +++
 libavformat/mov.c| 35 +++
 libavformat/movenc.c | 50 ++--
 4 files changed, 92 insertions(+), 11 deletions(-)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index aff51b43f6..add38914f2 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -28,6 +28,7 @@
 #include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "libavutil/mastering_display_metadata.h"
+#include "libavutil/ambient_viewing_environment.h"
 #include "libavutil/dovi_meta.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
@@ -379,6 +380,17 @@ static void dump_content_light_metadata(void *ctx, const 
AVPacketSideData *sd,
metadata->MaxCLL, metadata->MaxFALL);
 }
 
+static void dump_ambient_viewing_environment_metadata(void *ctx, const 
AVPacketSideData *sd)
+{
+const AVAmbientViewingEnvironment *ambient =
+(const AVAmbientViewingEnvironment *)sd->data;
+av_log(ctx, AV_LOG_INFO, "Ambient Viewing Environment, "
+   "ambient_illuminance=%f, ambient_light_x=%f, ambient_light_y=%f",
+   av_q2d(ambient->ambient_illuminance),
+   av_q2d(ambient->ambient_light_x),
+   av_q2d(ambient->ambient_light_y));
+}
+
 static void dump_spherical(void *ctx, const AVCodecParameters *par,
const AVPacketSideData *sd, int log_level)
 {
@@ -513,6 +525,9 @@ static void dump_sidedata(void *ctx, const AVStream *st, 
const char *indent,
 av_log(ctx, log_level, "SMPTE ST 12-1:2014: ");
 dump_s12m_timecode(ctx, st, sd, log_level);
 break;
+case AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT:
+dump_ambient_viewing_environment_metadata(ctx, sd);
+break;
 default:
 av_log(ctx, log_level, "unknown side data type %d "
"(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size);
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 77221d06e4..a4cca4c798 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -29,6 +29,7 @@
 
 #include "libavutil/encryption_info.h"
 #include "libavutil/mastering_display_metadata.h"
+#include "libavutil/ambient_viewing_environment.h"
 #include "libavutil/spherical.h"
 #include "libavutil/stereo3d.h"
 
@@ -249,6 +250,8 @@ typedef struct MOVStreamContext {
 AVMasteringDisplayMetadata *mastering;
 AVContentLightMetadata *coll;
 size_t coll_size;
+AVAmbientViewingEnvironment *ambient;
+size_t ambient_size;
 
 uint32_t format;
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5fae777adb..42b0135987 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6039,6 +6039,31 @@ static int mov_read_clli(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return 0;
 }
 
+static int mov_read_amve(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+MOVStreamContext *sc;
+const int illuminance_den = 1;
+const int ambient_den = 5;
+if (c->fc->nb_streams < 1)
+return AVERROR_INVALIDDATA;
+sc = c->fc->streams[c->fc->nb_streams - 1]->priv_data;
+if (atom.size < 6) {
+av_log(c->fc, AV_LOG_ERROR, "Empty Ambient Viewing Environment Info 
box\n");
+return AVERROR_INVALIDDATA;
+}
+if (sc->ambient){
+av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicate AMVE\n");
+return 0;
+}
+sc->ambient = av_ambient_viewing_environment_alloc(>ambient_size);
+if (!sc->ambient)
+return AVERROR(ENOMEM);
+sc->ambient->ambient_illuminance  = av_make_q(avio_rb32(pb), 
illuminance_den);
+sc->ambient->ambient_light_x = av_make_q(avio_rb16(pb), ambient_den);
+sc->ambient->ambient_light_y = av_make_q(avio_rb16(pb), ambient_den);
+return 0;
+}
+
 static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 AVStream *st;
@@ -8215,6 +8240,7 @@ static const MOVParseTableEntry mov_default_parse_table[] 
= {
 { MKTAG('i','s','p','e'), mov_read_ispe },
 { MKTAG('i','p','r','p'), mov_read_iprp },
 { MKTAG('i','i','n','f'), mov_read_iinf },
+{ MKTAG('a','m','v','e'), mov_read_amve }, /* ambient viewing environment box 
*/
 { 0, NULL }
 };
 
@@ -8680,6 +8706,7 @@ static void mov_free_stream_context(AVFormatContext *s, 
AVStream *st)
 av_freep(>spherical);
 av_freep(>mastering);
 av_freep(>coll);
+av_freep(>ambient);
 }
 
 static int mov_read_close(AVFormatContext *s)
@@ -9072,6 +9099,14 @@ static int mov_read_header(AVFormatContext *s)
 
 sc->coll = NULL;
 }
+if (sc->ambient) {
+if (!av_packet_side_data_add(>codecpar->coded_side_data, 
>codecpar->nb_coded_side_data,
+ 
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,
+ (uint8_t *) sc->ambient, 
sc->ambient_size, 0))

[FFmpeg-devel] [PATCH v4 1/3] avcodec: add ambient viewing environment packet side data.

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel
From: Damiano Galassi 

---
 doc/APIchanges| 3 +++
 fftools/ffprobe.c | 3 +++
 libavcodec/avpacket.c | 1 +
 libavcodec/decode.c   | 1 +
 libavcodec/packet.h   | 9 -
 libavcodec/version.h  | 2 +-
 6 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index e477ed78e0..1f5724324a 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2024-02-04 - xx - lavc 60.39.100 - packet.h
+  Add AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT.
+
 2023-11-xx - xx - lavfi 9.16.100 - buffersink.h buffersrc.h
   Add av_buffersink_get_colorspace and av_buffersink_get_color_range.
   Add AVBufferSrcParameters.color_space and AVBufferSrcParameters.color_range.
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index f33e2471cb..aa1153e709 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2392,6 +2392,9 @@ static void print_pkt_side_data(WriterContext *w,
 AVContentLightMetadata *metadata = (AVContentLightMetadata 
*)sd->data;
 print_int("max_content", metadata->MaxCLL);
 print_int("max_average", metadata->MaxFALL);
+} else if (sd->type == AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT) {
+print_ambient_viewing_environment(
+w, (const AVAmbientViewingEnvironment *)sd->data);
 } else if (sd->type == AV_PKT_DATA_DYNAMIC_HDR10_PLUS) {
 AVDynamicHDRPlus *metadata = (AVDynamicHDRPlus *)sd->data;
 print_dynamic_hdr10_plus(w, metadata);
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 0f8c9b77ae..e118bbaad1 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -301,6 +301,7 @@ const char *av_packet_side_data_name(enum 
AVPacketSideDataType type)
 case AV_PKT_DATA_DOVI_CONF:  return "DOVI configuration 
record";
 case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 12-1:2014 
timecode";
 case AV_PKT_DATA_DYNAMIC_HDR10_PLUS: return "HDR10+ Dynamic 
Metadata (SMPTE 2094-40)";
+case AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT:return "Ambient viewing 
environment";
 case AV_PKT_DATA_IAMF_MIX_GAIN_PARAM:return "IAMF Mix Gain 
Parameter Data";
 case AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM:   return "IAMF Demixing Info 
Parameter Data";
 case AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM: return "IAMF Recon Gain Info 
Parameter Data";
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 2cfb3fcf97..da6446d879 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1434,6 +1434,7 @@ static const struct {
 { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
 { AV_PKT_DATA_ICC_PROFILE,AV_FRAME_DATA_ICC_PROFILE },
 { AV_PKT_DATA_DYNAMIC_HDR10_PLUS, AV_FRAME_DATA_DYNAMIC_HDR_PLUS },
+{ 
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT
 },
 };
 
 int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx,
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 2c57d262c6..bb28e7d62a 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -331,7 +331,14 @@ enum AVPacketSideDataType {
  * If its value becomes huge, some code using it
  * needs to be updated as it assumes it to be smaller than other limits.
  */
-AV_PKT_DATA_NB
+AV_PKT_DATA_NB,
+
+/**
+ * Ambient viewing environment metadata, as defined by H.274.. This 
metadata
+ * should be associated with a video stream and contains data in the form
+ * of the AVAmbientViewingEnvironment struct.
+*/
+AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT
 };
 
 #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 0fae3d06d3..f2f14eaed1 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #include "version_major.h"
 
-#define LIBAVCODEC_VERSION_MINOR  38
+#define LIBAVCODEC_VERSION_MINOR  39
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
2.42.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 v4 0/3] avformat/mov: add support for 'amve' ambient viewing environment

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel
From: Cosmin Stejerean 

Version 4 resolves feedback from v3 by moving new side data field in
packet.h to the end for ABI compatibility, bumping the minor API
version for lavc, adding APIChanges entry, using -c:v in the FATE
test, cleaning up formatting in avformat/movenc and renaming
rescale_mdcv to rescale since it is now shared rather than mdcv
specific.

Cosmin Stejerean (1):
  tests/fate/mov: add a test for reading and writing amve box

Damiano Galassi (2):
  avcodec: add ambient viewing environment packet side data.
  avformat/mov: add support for 'amve' ambient viewing environment box.
As defined in ISOBMFF (ISO/IEC 14496-12) document.

 doc/APIchanges|  3 +++
 fftools/ffprobe.c |  3 +++
 libavcodec/avpacket.c |  1 +
 libavcodec/decode.c   |  1 +
 libavcodec/packet.h   |  9 ++-
 libavcodec/version.h  |  2 +-
 libavformat/dump.c| 15 +++
 libavformat/isom.h|  3 +++
 libavformat/mov.c | 35 
 libavformat/movenc.c  | 50 +++
 tests/fate/mov.mak|  5 
 tests/ref/fate/mov-read-amve  |  8 ++
 tests/ref/fate/mov-write-amve | 33 +++
 13 files changed, 155 insertions(+), 13 deletions(-)
 create mode 100644 tests/ref/fate/mov-read-amve
 create mode 100644 tests/ref/fate/mov-write-amve

-- 
2.42.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 0/2] Remove SDL2 output devices

2024-02-04 Thread Marton Balint



On Sun, 4 Feb 2024, Rémi Denis-Courmont wrote:




Le 4 février 2024 11:11:12 GMT+01:00, Marton Balint  a écrit :

Actually they work here on a linux box with OpenSuse 15.5. So even if they
are broken on some setups, they are not broken everywhere, or not more broken 
than they used to be.


No. They were always broken in terms of the design, and they are more 
technically broken than before because the threading rework exposed the design 
bugs from within fftools.

No sane application would use this. If it doesn't even work in fftools, it 
should be removed.


As I wrote earlier, it works for me.




Also, poper deprecation is needed here, since not only the CLI tools might use 
these. Especially since there is no drop-in replacement.


First it's not what would be considered an API. The removal shouldn't break 
source compatibility, so deprecation won't get us anything here. Where would 
you even put the deprecation guards?


See what Anton did with the BKTR device.



And then deprecation only makes sense if it can be fixed. Nobody has come 
forward with a practical solution to make it work, probably because there is 
not one, at least on MacOS.


See Michael's suggestions with the thread safety flag.

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

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


[FFmpeg-devel] [PATCH] lavc/aarch64/fdct: add neon-optimized fdct for aarch64

2024-02-04 Thread Ramiro Polla
The code is imported from libjpeg-turbo-3.0.1. The neon registers used
have been changed to avoid modifying v8-v15.
---
 libavcodec/aarch64/Makefile   |   2 +
 libavcodec/aarch64/fdct.h |  26 ++
 libavcodec/aarch64/fdctdsp_init_aarch64.c |  39 +++
 libavcodec/aarch64/fdctdsp_neon.S | 369 ++
 libavcodec/avcodec.h  |   1 +
 libavcodec/fdctdsp.c  |   4 +-
 libavcodec/fdctdsp.h  |   2 +
 libavcodec/options_table.h|   1 +
 libavcodec/tests/aarch64/dct.c|   2 +
 9 files changed, 445 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/aarch64/fdct.h
 create mode 100644 libavcodec/aarch64/fdctdsp_init_aarch64.c
 create mode 100644 libavcodec/aarch64/fdctdsp_neon.S

diff --git a/libavcodec/aarch64/Makefile b/libavcodec/aarch64/Makefile
index beb6a02f5f..eebccbe4a5 100644
--- a/libavcodec/aarch64/Makefile
+++ b/libavcodec/aarch64/Makefile
@@ -1,4 +1,5 @@
 # subsystems
+OBJS-$(CONFIG_FDCTDSP)  += aarch64/fdctdsp_init_aarch64.o
 OBJS-$(CONFIG_FMTCONVERT)   += aarch64/fmtconvert_init.o
 OBJS-$(CONFIG_H264CHROMA)   += aarch64/h264chroma_init_aarch64.o
 OBJS-$(CONFIG_H264DSP)  += aarch64/h264dsp_init_aarch64.o
@@ -35,6 +36,7 @@ ARMV8-OBJS-$(CONFIG_VIDEODSP)   += aarch64/videodsp.o
 
 # subsystems
 NEON-OBJS-$(CONFIG_AAC_DECODER) += aarch64/sbrdsp_neon.o
+NEON-OBJS-$(CONFIG_FDCTDSP) += aarch64/fdctdsp_neon.o
 NEON-OBJS-$(CONFIG_FMTCONVERT)  += aarch64/fmtconvert_neon.o
 NEON-OBJS-$(CONFIG_H264CHROMA)  += aarch64/h264cmc_neon.o
 NEON-OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_neon.o  
\
diff --git a/libavcodec/aarch64/fdct.h b/libavcodec/aarch64/fdct.h
new file mode 100644
index 00..0901b53a83
--- /dev/null
+++ b/libavcodec/aarch64/fdct.h
@@ -0,0 +1,26 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AARCH64_FDCT_H
+#define AVCODEC_AARCH64_FDCT_H
+
+#include 
+
+void ff_fdct_neon(int16_t *block);
+
+#endif /* AVCODEC_AARCH64_FDCT_H */
diff --git a/libavcodec/aarch64/fdctdsp_init_aarch64.c 
b/libavcodec/aarch64/fdctdsp_init_aarch64.c
new file mode 100644
index 00..59d91bc8fc
--- /dev/null
+++ b/libavcodec/aarch64/fdctdsp_init_aarch64.c
@@ -0,0 +1,39 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/fdctdsp.h"
+#include "fdct.h"
+
+av_cold void ff_fdctdsp_init_aarch64(FDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+int cpu_flags = av_get_cpu_flags();
+
+if (have_neon(cpu_flags)) {
+if (!high_bit_depth) {
+if (avctx->dct_algo == FF_DCT_AUTO ||
+avctx->dct_algo == FF_DCT_NEON) {
+c->fdct = ff_fdct_neon;
+}
+}
+}
+}
diff --git a/libavcodec/aarch64/fdctdsp_neon.S 
b/libavcodec/aarch64/fdctdsp_neon.S
new file mode 100644
index 00..978c8d3002
--- /dev/null
+++ b/libavcodec/aarch64/fdctdsp_neon.S
@@ -0,0 +1,369 @@
+/*
+ * Armv8 Neon optimizations for libjpeg-turbo
+ *
+ * Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies).
+ *  All Rights Reserved.
+ * Author:  Siarhei Siamashka 
+ * Copyright (C) 2013-2014, Linaro Limited.  All Rights 

Re: [FFmpeg-devel] Sovereign Tech Fund

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

Le 4 février 2024 14:41:15 GMT+01:00, Michael Niedermayer 
 a écrit :
>Hi
>
>As said on IRC, i thought people knew it, but ‘the same person as before’ is 
>Thilo.
>
>Ive updated the price design suggestion for the merge task, its 16€ / commit 
>limited to 50k€
>this comes from looking at pauls fork which has around 500 commits in 2 months 
>thus
>250 commits per month, 12 months, and if we allocate 50k that end with roughly 
>16€ / commit
>if activity stays equal.

It's very different if we're talking about librempeg or some other unspecified 
fork. I could make a fork that removes MMX et al, and claim that I'm merging a 
fork.

>The task has ATM no developer on it. If a developer adds himself, he can 
>change teh task
>and specify what he proposes to merge.
>
>I am totally perplexed why every dot on every i is such a big thing.

That is the whole point of a statement of work. And I agree that it's tedious 
and possibly outright annoying...

Indeed I don't think that a semiformal open-source community with a lot of 
strong and varied opinions will carry such dotting of all i's very effectively. 
That has been one of the arguments for delegating this to a contracting IT 
company rather than to FFmpeg-devel and SPI.

>We are doing GSoC for a decade and noone cared about voting about anything in 
>it.

Again, I don't think it's a fair comparison. GSoC rules are a given set by 
Google. Maintenance is not allowed nor are vague broadly defined tasks. Also 
the mentor payment is not really a proper compensation, nor is it intended to 
be.

>The difference here is FFmpeg developers are benefiting from the money.

That's a pretty major difference.

>We send an application and a scope of work.

That's exactly why we need to have a precise scope of work to vote on this.
___
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] avcodec/libaomdec: print libaomdec version in verbose level

2024-02-04 Thread James Almer
info level will be too noisy if several instances of the decoder are fired
at the same time, as will be the case with tiled AVIF.

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

diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 695d901051..69eec8b089 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -48,7 +48,7 @@ static av_cold int aom_init(AVCodecContext *avctx,
 .threads = FFMIN(avctx->thread_count ? avctx->thread_count : 
av_cpu_count(), 16)
 };
 
-av_log(avctx, AV_LOG_INFO, "%s\n", aom_codec_version_str());
+av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_version_str());
 av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_build_config());
 
 if (aom_codec_dec_init(>decoder, iface, , 0) != AOM_CODEC_OK) {
-- 
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 1/2] avcodec/libdav1d: print libdav1d version in verbose level

2024-02-04 Thread James Almer
info level will be too noisy if several instances of the decoder are fired
at the same time, as will be the case with tiled AVIF.

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

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 11cdbca274..78a5c63bf4 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -215,7 +215,7 @@ static av_cold int libdav1d_init(AVCodecContext *c)
 #endif
 int res;
 
-av_log(c, AV_LOG_INFO, "libdav1d %s\n", dav1d_version());
+av_log(c, AV_LOG_VERBOSE, "libdav1d %s\n", dav1d_version());
 
 dav1d_default_settings();
 s.logger.cookie = c;
-- 
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] avfilter/fifo: Remove (a)fifo filters

2024-02-04 Thread Andreas Rheinhardt
Obsolete since 4ca1fb9d2a91757c8c4c34dd456abf340e3f765f.

Signed-off-by: Andreas Rheinhardt 
---
 doc/filters.texi |   9 ---
 libavfilter/Makefile |   1 -
 libavfilter/allfilters.c |   2 -
 libavfilter/fifo.c   | 165 ---
 4 files changed, 177 deletions(-)
 delete mode 100644 libavfilter/fifo.c

diff --git a/doc/filters.texi b/doc/filters.texi
index b9b539acee..e0436a5755 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -14122,15 +14122,6 @@ For example:
 ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
 @end example
 
-@section fifo, afifo
-
-Buffer input images and send them when they are requested.
-
-It is mainly useful when auto-inserted by the libavfilter
-framework.
-
-It does not take parameters.
-
 @section fillborders
 
 Fill borders of the input video, without changing video stream dimensions.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index bba0219876..f6c1d641d6 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -16,7 +16,6 @@ OBJS = allfilters.o   
  \
colorspace.o \
ccfifo.o \
drawutils.o  \
-   fifo.o   \
formats.o\
framepool.o  \
framequeue.o \
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index af84aa3d97..149bf50997 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -611,8 +611,6 @@ extern  const AVFilter ff_asrc_abuffer;
 extern  const AVFilter ff_vsrc_buffer;
 extern  const AVFilter ff_asink_abuffer;
 extern  const AVFilter ff_vsink_buffer;
-extern const AVFilter ff_af_afifo;
-extern const AVFilter ff_vf_fifo;
 
 #include "libavfilter/filter_list.c"
 
diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
deleted file mode 100644
index 1c7be88ae1..00
--- a/libavfilter/fifo.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FIFO buffering filter
- */
-
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "internal.h"
-
-typedef struct Buf {
-AVFrame *frame;
-struct Buf *next;
-} Buf;
-
-typedef struct FifoContext {
-Buf  root;
-Buf *last;   ///< last buffered frame
-
-/**
- * When a specific number of output samples is requested, the partial
- * buffer is stored here
- */
-AVFrame *out;
-int allocated_samples;  ///< number of samples out was allocated for
-} FifoContext;
-
-static av_cold int init(AVFilterContext *ctx)
-{
-FifoContext *s = ctx->priv;
-s->last = >root;
-
-return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-FifoContext *s = ctx->priv;
-Buf *buf, *tmp;
-
-for (buf = s->root.next; buf; buf = tmp) {
-tmp = buf->next;
-av_frame_free(>frame);
-av_free(buf);
-}
-
-av_frame_free(>out);
-}
-
-static int add_to_queue(AVFilterLink *inlink, AVFrame *frame)
-{
-FifoContext *s = inlink->dst->priv;
-
-s->last->next = av_mallocz(sizeof(Buf));
-if (!s->last->next) {
-av_frame_free();
-return AVERROR(ENOMEM);
-}
-
-s->last = s->last->next;
-s->last->frame = frame;
-
-return 0;
-}
-
-static void queue_pop(FifoContext *s)
-{
-Buf *tmp = s->root.next->next;
-if (s->last == s->root.next)
-s->last = >root;
-av_freep(>root.next);
-s->root.next = tmp;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-FifoContext *s = outlink->src->priv;
-int ret = 0;
-
-if (!s->root.next) {
-if ((ret = ff_request_frame(outlink->src->inputs[0])) < 0)
-return ret;
-if (!s->root.next)
-return 0;
-}
-ret = ff_filter_frame(outlink, s->root.next->frame);
-queue_pop(s);
-return ret;
-}
-

Re: [FFmpeg-devel] Sovereign Tech Fund

2024-02-04 Thread Michael Niedermayer
Hi

On Sun, Feb 04, 2024 at 11:02:30AM +0100, J. Dekker wrote:
> 
> 
> On Sun, Feb 4, 2024, at 10:49, Rémi Denis-Courmont wrote:
> > Hi,
> >
> > I don't believe it is appropriate to hold the vote before Derek's 
> > question is addressed.
> >
> > We don't really know what we're voting on here.
> >
> > Le 1 février 2024 20:22:14 GMT+01:00, Derek Buitenhuis 
> >  a écrit :
> >>On 1/31/2024 9:44 PM, Derek Buitenhuis wrote:
> >>> On 1/30/2024 1:48 AM, Michael Niedermayer wrote:
>  https://trac.ffmpeg.org/wiki/SponsoringPrograms/STF/2024
> >>> 
> >>> Not to derail this fine thread, but what forks does the Merge Forks
> >>> project refer to?
> >>
> >>I do not believe this has been answered.
> >>
> >>- Derek
> 
> 
> The vote is unclear for me and also it was not explained who ‘the same person 
> as before’ is, no reply or answer to this either. Hope Michael can clear this 
> up.

As said on IRC, i thought people knew it, but ‘the same person as before’ is 
Thilo.

Ive updated the price design suggestion for the merge task, its 16€ / commit 
limited to 50k€
this comes from looking at pauls fork which has around 500 commits in 2 months 
thus
250 commits per month, 12 months, and if we allocate 50k that end with roughly 
16€ / commit
if activity stays equal.

The task has ATM no developer on it. If a developer adds himself, he can change 
teh task
and specify what he proposes to merge.

I am totally perplexed why every dot on every i is such a big thing.

We are doing GSoC for a decade and noone cared about voting about anything in 
it.
The difference here is FFmpeg developers are benefiting from the money.

Neither GSoC nor STF binds the GA or FFmpeg to accept bad code. Have you thought
about this ? where would that come from ?

We send an application and a scope of work
FFmpeg is no legal entity we cant sign anything binding.
The developers doing the work can sign some binding text, that text might read
ill implement X and get Y payed, or i spend X hours working on Y and get Z paid.
If a devleoper signs "i will push this to ffmpeg" thats on the developer and her
problem if it gets rejected or reverted.

GSoC doesnt do this and i dont think any sane person would sign this, I myself
on consulting jobs generall point out to customers that i can do work X but 
cannot
gurantee acceptance in FFmpeg as sometimes things get rejected for hard to 
predict
reasons.

thx

[...]

thx
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.


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

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


[FFmpeg-devel] [PATCH] lavc/d3d12va: Improve behaviour on missing decoder support

2024-02-04 Thread Mark Thompson

Distinguish between a decoder being entirely missing and a decoder which
requires features which are not present in the incomplete implementation
in libavcodec and therefore can't be used.
---
 libavcodec/d3d12va_decode.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c
index f678b6f483..9bb8db1690 100644
--- a/libavcodec/d3d12va_decode.c
+++ b/libavcodec/d3d12va_decode.c
@@ -239,10 +239,14 @@ static int d3d12va_create_decoder(AVCodecContext *avctx)

 DX_CHECK(ID3D12VideoDevice_CheckFeatureSupport(device_hwctx->video_device, 
D3D12_FEATURE_VIDEO_DECODE_SUPPORT,
, sizeof(feature)));
-if (!(feature.SupportFlags & D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED) ||
-!(feature.DecodeTier >= D3D12_VIDEO_DECODE_TIER_2)) {
-av_log(avctx, AV_LOG_ERROR, "D3D12 decoder doesn't support on this 
device\n");
-return AVERROR(EINVAL);
+if (!(feature.SupportFlags & D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED)) {
+av_log(avctx, AV_LOG_ERROR, "D3D12 video decode is not supported on this 
device.\n");
+return AVERROR(ENOSYS);
+}
+if (!(feature.DecodeTier >= D3D12_VIDEO_DECODE_TIER_2)) {
+av_log(avctx, AV_LOG_ERROR, "D3D12 video decode on this device requires 
tier %d support, "
+   "but it is not implemented.\n", feature.DecodeTier);
+return AVERROR_PATCHWELCOME;
 }

 desc = (D3D12_VIDEO_DECODER_DESC) {
--
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 0/2] Remove SDL2 output devices

2024-02-04 Thread Michael Niedermayer
On Sun, Feb 04, 2024 at 10:02:31AM +0100, J. Dekker wrote:
> With the addition of threading in ffmpeg.c, the SDL2 devices no longer have 
> the
> 'main' thread. This means that both the SDL2 and OpenGL output device are 
> broken
> in master. Rather than attempting to fix it, they should be removed instead as
> there are better alternatives for debugging or viewing streams.

> 
> The 'pipe:' output can be used with a real video player such as mpv, vlc, or
> even ffplay. For cases where the user was an application using the API they
> should supply their own renderer.

we should point to our tools (ffplay in this case) first and foremost.

Also if they can be used, an example is needed in the documentation. This
could be in place of the removed device

Alternatively, a flag could be added to devices that specifies that they need
to be called from the main thread

This flag could switch tools which want to support this into single threaded
mode, if it doesnt fit naturally in their architecture.
While tools not supporting it could simply fail with a "unsupported" message

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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 00/24] Major library version bump

2024-02-04 Thread James Almer

On 1/28/2024 9:31 AM, Anton Khirnov wrote:

Quoting James Almer (2024-01-25 14:43:23)

As the subject states, this set removes deprecated API scheduled for removal
in the past year, since the last major bump.


So what is the actual rule you used for deciding what to remove and what
to postpone?

Everything except

   avfilter: remove deprecated FF_API_LIBPLACEBO_OPTS

would match the "deprecated in 2 major releases" rule that's been
suggested a few times before.


Anything at least a year old and already deprecated in 5.1, i think, but 
i may have messed up somewhere.
I can skip the libplacebo one if that's what "deprecated in 2 major 
releases" requires.

___
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 3/3] tests/fate/mov: add a test for reading and writing amve box

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel


> On Feb 4, 2024, at 13:44, James Almer  wrote:
> 
> On 2/4/2024 8:16 AM, Cosmin Stejerean via ffmpeg-devel wrote:
>> From: Cosmin Stejerean 
>> 
>> ---
>>  tests/fate/mov.mak|  5 +
>>  tests/ref/fate/mov-read-amve  |  8 
>>  tests/ref/fate/mov-write-amve | 33 +
>>  3 files changed, 46 insertions(+)
>>  create mode 100644 tests/ref/fate/mov-read-amve
>>  create mode 100644 tests/ref/fate/mov-write-amve
>> 
>> diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
>> index f202f36d96..ebad6ff2f4 100644
>> --- a/tests/fate/mov.mak
>> +++ b/tests/fate/mov.mak
>> @@ -9,6 +9,7 @@ FATE_MOV = fate-mov-3elist \
>> fate-mov-frag-encrypted \
>> fate-mov-tenc-only-encrypted \
>> fate-mov-invalid-elst-entry-count \
>> +   fate-mov-write-amve \
>> fate-mov-gpmf-remux \
>> fate-mov-440hz-10ms \
>> fate-mov-ibi-elst-starts-b \
>> @@ -25,6 +26,7 @@ FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \
>> fate-mov-zombie \
>> fate-mov-init-nonkeyframe \
>> fate-mov-displaymatrix \
>> +   fate-mov-read-amve \
>> fate-mov-spherical-mono \
>> fate-mov-guess-delay-1 \
>> fate-mov-guess-delay-2 \
>> @@ -109,6 +111,9 @@ fate-mov-init-nonkeyframe: CMD = run 
>> ffprobe$(PROGSSUF)$(EXESUF) -show_packets -
>> 
>>  fate-mov-displaymatrix: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
>> stream=display_aspect_ratio,sample_aspect_ratio:stream_side_data_list 
>> -select_streams v -v 0 $(TARGET_SAMPLES)/mov/displaymatrix.mov
>> 
>> +fate-mov-read-amve: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
>> stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/amve.mov
> 
> There's no need for this test if you add the other. The writing one
> succeeding means the box was read and propagated from the input file.
> 

That is true, although if the writing fails the read test will still succeed 
and help point to an error in writing. But if we don't want the extra test I 
can delete it.


>> +fate-mov-write-amve: CMD = transcode mov $(TARGET_SAMPLES)/mov/amve.mov mp4 
>> "-c copy" "-c copy -t 0.5" "-show_entries stream_side_data_list"
> 
> -c:v

Will fix.

- Cosmin
___
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 3/3] tests/fate/mov: add a test for reading and writing amve box

2024-02-04 Thread James Almer

On 2/4/2024 8:16 AM, Cosmin Stejerean via ffmpeg-devel wrote:

From: Cosmin Stejerean 

---
  tests/fate/mov.mak|  5 +
  tests/ref/fate/mov-read-amve  |  8 
  tests/ref/fate/mov-write-amve | 33 +
  3 files changed, 46 insertions(+)
  create mode 100644 tests/ref/fate/mov-read-amve
  create mode 100644 tests/ref/fate/mov-write-amve

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index f202f36d96..ebad6ff2f4 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -9,6 +9,7 @@ FATE_MOV = fate-mov-3elist \
 fate-mov-frag-encrypted \
 fate-mov-tenc-only-encrypted \
 fate-mov-invalid-elst-entry-count \
+   fate-mov-write-amve \
 fate-mov-gpmf-remux \
 fate-mov-440hz-10ms \
 fate-mov-ibi-elst-starts-b \
@@ -25,6 +26,7 @@ FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \
 fate-mov-zombie \
 fate-mov-init-nonkeyframe \
 fate-mov-displaymatrix \
+   fate-mov-read-amve \
 fate-mov-spherical-mono \
 fate-mov-guess-delay-1 \
 fate-mov-guess-delay-2 \
@@ -109,6 +111,9 @@ fate-mov-init-nonkeyframe: CMD = run 
ffprobe$(PROGSSUF)$(EXESUF) -show_packets -
  
  fate-mov-displaymatrix: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=display_aspect_ratio,sample_aspect_ratio:stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/displaymatrix.mov
  
+fate-mov-read-amve: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/amve.mov


There's no need for this test if you add the other. The writing one 
succeeding means the box was read and propagated from the input file.



+fate-mov-write-amve: CMD = transcode mov $(TARGET_SAMPLES)/mov/amve.mov mp4 "-c copy" "-c 
copy -t 0.5" "-show_entries stream_side_data_list"


-c:v


+
  fate-mov-spherical-mono: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/spherical.mov
  
  fate-mov-gpmf-remux: CMD = md5 -i $(TARGET_SAMPLES)/mov/fake-gp-media-with-real-gpmf.mp4 -map 0 -c copy -fflags +bitexact -f mp4

diff --git a/tests/ref/fate/mov-read-amve b/tests/ref/fate/mov-read-amve
new file mode 100644
index 00..91d34d94dd
--- /dev/null
+++ b/tests/ref/fate/mov-read-amve
@@ -0,0 +1,8 @@
+[STREAM]
+[SIDE_DATA]
+side_data_type=Ambient viewing environment
+ambient_illuminance=314/1
+ambient_light_x=15635/5
+ambient_light_y=16450/5
+[/SIDE_DATA]
+[/STREAM]
diff --git a/tests/ref/fate/mov-write-amve b/tests/ref/fate/mov-write-amve
new file mode 100644
index 00..115cdbd9f0
--- /dev/null
+++ b/tests/ref/fate/mov-write-amve
@@ -0,0 +1,33 @@
+850c56be1114aa21a2e41bd4ea3da144 *tests/data/fate/mov-write-amve.mp4
+23677 tests/data/fate/mov-write-amve.mp4
+#extradata 0:   49, 0x7f8d1145
+#tb 0: 1/15360
+#media_type 0: video
+#codec_id 0: h264
+#dimensions 0: 640x360
+#sar 0: 0/1
+0,  -1024,  0,  512,11849, 0xf21aa1d0
+0,   -512,   2048,  512, 1572, 0xf0c41b68, F=0x0
+0,  0,   1024,  512,  347, 0x9b8daabf, F=0x0
+0,512,512,  512,  195, 0x557e58db, F=0x0
+0,   1024,   1536,  512,  134, 0x423541b4, F=0x0
+0,   1536,   3072,  512, 1454, 0xe5a2cdad, F=0x0
+0,   2048,   2560,  512,  168, 0xd0ef5402, F=0x0
+0,   2560,   5120,  512, 1395, 0x603eb602, F=0x0
+0,   3072,   4096,  512,  304, 0x69cc92a6, F=0x0
+0,   3584,   3584,  512,  145, 0x3f1a4462, F=0x0
+0,   4096,   4608,  512,  154, 0x953851d1, F=0x0
+0,   4608,   5632,  512,  876, 0xad65ace7, F=0x0
+0,   5120,   7680,  512,  742, 0x6b6d689f, F=0x0
+0,   5632,   6656,  512,  177, 0xa4f2573b, F=0x0
+0,   6144,   6144,  512,  101, 0xb0722d2b, F=0x0
+0,   6656,   7168,  512,  105, 0x1f6033ed, F=0x0
+0,   7168,   9728,  512,  589, 0xcd912063, F=0x0
+[STREAM]
+[SIDE_DATA]
+side_data_type=Ambient viewing environment
+ambient_illuminance=314/1
+ambient_light_x=15635/5
+ambient_light_y=16450/5
+[/SIDE_DATA]
+[/STREAM]

___
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 2/3] avformat/mov: add support for 'amve' ambient viewing environment box. As defined in ISOBMFF (ISO/IEC 14496-12) document.

2024-02-04 Thread James Almer

On 2/4/2024 8:16 AM, Cosmin Stejerean via ffmpeg-devel wrote:

From: Damiano Galassi 

Co-Authored-By: Cosmin Stejerean 
---
  libavformat/dump.c   | 15 +++
  libavformat/isom.h   |  3 +++
  libavformat/mov.c| 35 +++
  libavformat/movenc.c | 30 ++
  4 files changed, 83 insertions(+)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index aff51b43f6..add38914f2 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -28,6 +28,7 @@
  #include "libavutil/intreadwrite.h"
  #include "libavutil/log.h"
  #include "libavutil/mastering_display_metadata.h"
+#include "libavutil/ambient_viewing_environment.h"
  #include "libavutil/dovi_meta.h"
  #include "libavutil/mathematics.h"
  #include "libavutil/opt.h"
@@ -379,6 +380,17 @@ static void dump_content_light_metadata(void *ctx, const 
AVPacketSideData *sd,
 metadata->MaxCLL, metadata->MaxFALL);
  }
  
+static void dump_ambient_viewing_environment_metadata(void *ctx, const AVPacketSideData *sd)

+{
+const AVAmbientViewingEnvironment *ambient =
+(const AVAmbientViewingEnvironment *)sd->data;
+av_log(ctx, AV_LOG_INFO, "Ambient Viewing Environment, "
+   "ambient_illuminance=%f, ambient_light_x=%f, ambient_light_y=%f",
+   av_q2d(ambient->ambient_illuminance),
+   av_q2d(ambient->ambient_light_x),
+   av_q2d(ambient->ambient_light_y));
+}
+
  static void dump_spherical(void *ctx, const AVCodecParameters *par,
 const AVPacketSideData *sd, int log_level)
  {
@@ -513,6 +525,9 @@ static void dump_sidedata(void *ctx, const AVStream *st, 
const char *indent,
  av_log(ctx, log_level, "SMPTE ST 12-1:2014: ");
  dump_s12m_timecode(ctx, st, sd, log_level);
  break;
+case AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT:
+dump_ambient_viewing_environment_metadata(ctx, sd);
+break;
  default:
  av_log(ctx, log_level, "unknown side data type %d "
 "(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size);
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 77221d06e4..a4cca4c798 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -29,6 +29,7 @@
  
  #include "libavutil/encryption_info.h"

  #include "libavutil/mastering_display_metadata.h"
+#include "libavutil/ambient_viewing_environment.h"
  #include "libavutil/spherical.h"
  #include "libavutil/stereo3d.h"
  
@@ -249,6 +250,8 @@ typedef struct MOVStreamContext {

  AVMasteringDisplayMetadata *mastering;
  AVContentLightMetadata *coll;
  size_t coll_size;
+AVAmbientViewingEnvironment *ambient;
+size_t ambient_size;
  
  uint32_t format;
  
diff --git a/libavformat/mov.c b/libavformat/mov.c

index 5fae777adb..42b0135987 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6039,6 +6039,31 @@ static int mov_read_clli(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
  return 0;
  }
  
+static int mov_read_amve(MOVContext *c, AVIOContext *pb, MOVAtom atom)

+{
+MOVStreamContext *sc;
+const int illuminance_den = 1;
+const int ambient_den = 5;
+if (c->fc->nb_streams < 1)
+return AVERROR_INVALIDDATA;
+sc = c->fc->streams[c->fc->nb_streams - 1]->priv_data;
+if (atom.size < 6) {
+av_log(c->fc, AV_LOG_ERROR, "Empty Ambient Viewing Environment Info 
box\n");
+return AVERROR_INVALIDDATA;
+}
+if (sc->ambient){
+av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicate AMVE\n");
+return 0;
+}
+sc->ambient = av_ambient_viewing_environment_alloc(>ambient_size);
+if (!sc->ambient)
+return AVERROR(ENOMEM);
+sc->ambient->ambient_illuminance  = av_make_q(avio_rb32(pb), 
illuminance_den);
+sc->ambient->ambient_light_x = av_make_q(avio_rb16(pb), ambient_den);
+sc->ambient->ambient_light_y = av_make_q(avio_rb16(pb), ambient_den);
+return 0;
+}
+
  static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
  {
  AVStream *st;
@@ -8215,6 +8240,7 @@ static const MOVParseTableEntry mov_default_parse_table[] 
= {
  { MKTAG('i','s','p','e'), mov_read_ispe },
  { MKTAG('i','p','r','p'), mov_read_iprp },
  { MKTAG('i','i','n','f'), mov_read_iinf },
+{ MKTAG('a','m','v','e'), mov_read_amve }, /* ambient viewing environment box 
*/
  { 0, NULL }
  };
  
@@ -8680,6 +8706,7 @@ static void mov_free_stream_context(AVFormatContext *s, AVStream *st)

  av_freep(>spherical);
  av_freep(>mastering);
  av_freep(>coll);
+av_freep(>ambient);
  }
  
  static int mov_read_close(AVFormatContext *s)

@@ -9072,6 +9099,14 @@ static int mov_read_header(AVFormatContext *s)
  
  sc->coll = NULL;

  }
+if (sc->ambient) {
+if (!av_packet_side_data_add(>codecpar->coded_side_data, 
>codecpar->nb_coded_side_data,
+ 

Re: [FFmpeg-devel] [PATCH v3 1/3] avcodec: add ambient viewing environment packet side data.

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel


> On Feb 4, 2024, at 12:45, Anton Khirnov  wrote:
> 
> Quoting Cosmin Stejerean via ffmpeg-devel (2024-02-04 12:16:53)
>> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
>> index 2c57d262c6..215b1c9970 100644
>> --- a/libavcodec/packet.h
>> +++ b/libavcodec/packet.h
>> @@ -299,6 +299,13 @@ enum AVPacketSideDataType {
>>  */
>> AV_PKT_DATA_DYNAMIC_HDR10_PLUS,
>> 
>> +/**
>> + * Ambient viewing environment metadata, as defined by H.274.. This 
>> metadata
>> + * should be associated with a video stream and contains data in the 
>> form
>> + * of the AVAmbientViewingEnvironment struct.
>> +*/
>> +AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,
> 
> New entries must be added at the end, otherwise this breaks ABI.
> 
> It also needs a minor lavc bump and an APIchanges entry.
> 

Will address in the next version.
___
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 1/3] avcodec: add ambient viewing environment packet side data.

2024-02-04 Thread Anton Khirnov
Quoting Cosmin Stejerean via ffmpeg-devel (2024-02-04 12:16:53)
> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> index 2c57d262c6..215b1c9970 100644
> --- a/libavcodec/packet.h
> +++ b/libavcodec/packet.h
> @@ -299,6 +299,13 @@ enum AVPacketSideDataType {
>   */
>  AV_PKT_DATA_DYNAMIC_HDR10_PLUS,
>  
> +/**
> + * Ambient viewing environment metadata, as defined by H.274.. This 
> metadata
> + * should be associated with a video stream and contains data in the form
> + * of the AVAmbientViewingEnvironment struct.
> +*/
> +AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,

New entries must be added at the end, otherwise this breaks ABI.

It also needs a minor lavc bump and an APIchanges entry.

-- 
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 0/2] Remove SDL2 output devices

2024-02-04 Thread Rémi Denis-Courmont


Le 4 février 2024 10:02:31 GMT+01:00, "J. Dekker"  a écrit :
>With the addition of threading in ffmpeg.c, the SDL2 devices no longer have the
>'main' thread. This means that both the SDL2 and OpenGL output device are 
>broken
>in master. Rather than attempting to fix it, they should be removed instead as
>there are better alternatives for debugging or viewing streams.

This is as agreed after discussed in yesterday's technical meeting. So 
obviously I support this patchset.
___
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 0/2] Remove SDL2 output devices

2024-02-04 Thread Rémi Denis-Courmont


Le 4 février 2024 11:11:12 GMT+01:00, Marton Balint  a écrit :
>Actually they work here on a linux box with OpenSuse 15.5. So even if they
>are broken on some setups, they are not broken everywhere, or not more broken 
>than they used to be.

No. They were always broken in terms of the design, and they are more 
technically broken than before because the threading rework exposed the design 
bugs from within fftools.

No sane application would use this. If it doesn't even work in fftools, it 
should be removed.

>Also, poper deprecation is needed here, since not only the CLI tools might use 
>these. Especially since there is no drop-in replacement.

First it's not what would be considered an API. The removal shouldn't break 
source compatibility, so deprecation won't get us anything here. Where would 
you even put the deprecation guards?

And then deprecation only makes sense if it can be fixed. Nobody has come 
forward with a practical solution to make it work, probably because there is 
not one, at least on MacOS.

>> The 'pipe:' output can be used with a real video player such as mpv, vlc, or
>> even ffplay. For cases where the user was an application using the API they
>> should supply their own renderer.
>
>Yeah, but I never liked when people piped uncompressed data... Not everything 
>that the devices support can be serialized, it is extra CPU, latency of the 
>receiving app reading from pipe is a question...

That sounds pretty minor problems for something that's purely meant for 
testing, and well, at least piping works.

>I'd be a lot more happy with this if we'd offer some replacement which has no 
>issues. Maybe a libplacebo based outdev.

That's orthogonal, and you're welcome to provide patches. But AFAICT, any video 
output device would suffer the same problems on the same platforms. You simply 
can't treat video output as a generic pipeline component, at least on Windows 
and especially MacOS.
___
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 v3 3/3] tests/fate/mov: add a test for reading and writing amve box

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel
From: Cosmin Stejerean 

---
 tests/fate/mov.mak|  5 +
 tests/ref/fate/mov-read-amve  |  8 
 tests/ref/fate/mov-write-amve | 33 +
 3 files changed, 46 insertions(+)
 create mode 100644 tests/ref/fate/mov-read-amve
 create mode 100644 tests/ref/fate/mov-write-amve

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index f202f36d96..ebad6ff2f4 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -9,6 +9,7 @@ FATE_MOV = fate-mov-3elist \
fate-mov-frag-encrypted \
fate-mov-tenc-only-encrypted \
fate-mov-invalid-elst-entry-count \
+   fate-mov-write-amve \
fate-mov-gpmf-remux \
fate-mov-440hz-10ms \
fate-mov-ibi-elst-starts-b \
@@ -25,6 +26,7 @@ FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \
fate-mov-zombie \
fate-mov-init-nonkeyframe \
fate-mov-displaymatrix \
+   fate-mov-read-amve \
fate-mov-spherical-mono \
fate-mov-guess-delay-1 \
fate-mov-guess-delay-2 \
@@ -109,6 +111,9 @@ fate-mov-init-nonkeyframe: CMD = run 
ffprobe$(PROGSSUF)$(EXESUF) -show_packets -
 
 fate-mov-displaymatrix: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
stream=display_aspect_ratio,sample_aspect_ratio:stream_side_data_list 
-select_streams v -v 0 $(TARGET_SAMPLES)/mov/displaymatrix.mov
 
+fate-mov-read-amve: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/amve.mov
+fate-mov-write-amve: CMD = transcode mov $(TARGET_SAMPLES)/mov/amve.mov mp4 
"-c copy" "-c copy -t 0.5" "-show_entries stream_side_data_list"
+
 fate-mov-spherical-mono: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
stream_side_data_list -select_streams v -v 0 $(TARGET_SAMPLES)/mov/spherical.mov
 
 fate-mov-gpmf-remux: CMD = md5 -i 
$(TARGET_SAMPLES)/mov/fake-gp-media-with-real-gpmf.mp4 -map 0 -c copy -fflags 
+bitexact -f mp4
diff --git a/tests/ref/fate/mov-read-amve b/tests/ref/fate/mov-read-amve
new file mode 100644
index 00..91d34d94dd
--- /dev/null
+++ b/tests/ref/fate/mov-read-amve
@@ -0,0 +1,8 @@
+[STREAM]
+[SIDE_DATA]
+side_data_type=Ambient viewing environment
+ambient_illuminance=314/1
+ambient_light_x=15635/5
+ambient_light_y=16450/5
+[/SIDE_DATA]
+[/STREAM]
diff --git a/tests/ref/fate/mov-write-amve b/tests/ref/fate/mov-write-amve
new file mode 100644
index 00..115cdbd9f0
--- /dev/null
+++ b/tests/ref/fate/mov-write-amve
@@ -0,0 +1,33 @@
+850c56be1114aa21a2e41bd4ea3da144 *tests/data/fate/mov-write-amve.mp4
+23677 tests/data/fate/mov-write-amve.mp4
+#extradata 0:   49, 0x7f8d1145
+#tb 0: 1/15360
+#media_type 0: video
+#codec_id 0: h264
+#dimensions 0: 640x360
+#sar 0: 0/1
+0,  -1024,  0,  512,11849, 0xf21aa1d0
+0,   -512,   2048,  512, 1572, 0xf0c41b68, F=0x0
+0,  0,   1024,  512,  347, 0x9b8daabf, F=0x0
+0,512,512,  512,  195, 0x557e58db, F=0x0
+0,   1024,   1536,  512,  134, 0x423541b4, F=0x0
+0,   1536,   3072,  512, 1454, 0xe5a2cdad, F=0x0
+0,   2048,   2560,  512,  168, 0xd0ef5402, F=0x0
+0,   2560,   5120,  512, 1395, 0x603eb602, F=0x0
+0,   3072,   4096,  512,  304, 0x69cc92a6, F=0x0
+0,   3584,   3584,  512,  145, 0x3f1a4462, F=0x0
+0,   4096,   4608,  512,  154, 0x953851d1, F=0x0
+0,   4608,   5632,  512,  876, 0xad65ace7, F=0x0
+0,   5120,   7680,  512,  742, 0x6b6d689f, F=0x0
+0,   5632,   6656,  512,  177, 0xa4f2573b, F=0x0
+0,   6144,   6144,  512,  101, 0xb0722d2b, F=0x0
+0,   6656,   7168,  512,  105, 0x1f6033ed, F=0x0
+0,   7168,   9728,  512,  589, 0xcd912063, F=0x0
+[STREAM]
+[SIDE_DATA]
+side_data_type=Ambient viewing environment
+ambient_illuminance=314/1
+ambient_light_x=15635/5
+ambient_light_y=16450/5
+[/SIDE_DATA]
+[/STREAM]
-- 
2.42.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 v3 2/3] avformat/mov: add support for 'amve' ambient viewing environment box. As defined in ISOBMFF (ISO/IEC 14496-12) document.

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel
From: Damiano Galassi 

Co-Authored-By: Cosmin Stejerean 
---
 libavformat/dump.c   | 15 +++
 libavformat/isom.h   |  3 +++
 libavformat/mov.c| 35 +++
 libavformat/movenc.c | 30 ++
 4 files changed, 83 insertions(+)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index aff51b43f6..add38914f2 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -28,6 +28,7 @@
 #include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "libavutil/mastering_display_metadata.h"
+#include "libavutil/ambient_viewing_environment.h"
 #include "libavutil/dovi_meta.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
@@ -379,6 +380,17 @@ static void dump_content_light_metadata(void *ctx, const 
AVPacketSideData *sd,
metadata->MaxCLL, metadata->MaxFALL);
 }
 
+static void dump_ambient_viewing_environment_metadata(void *ctx, const 
AVPacketSideData *sd)
+{
+const AVAmbientViewingEnvironment *ambient =
+(const AVAmbientViewingEnvironment *)sd->data;
+av_log(ctx, AV_LOG_INFO, "Ambient Viewing Environment, "
+   "ambient_illuminance=%f, ambient_light_x=%f, ambient_light_y=%f",
+   av_q2d(ambient->ambient_illuminance),
+   av_q2d(ambient->ambient_light_x),
+   av_q2d(ambient->ambient_light_y));
+}
+
 static void dump_spherical(void *ctx, const AVCodecParameters *par,
const AVPacketSideData *sd, int log_level)
 {
@@ -513,6 +525,9 @@ static void dump_sidedata(void *ctx, const AVStream *st, 
const char *indent,
 av_log(ctx, log_level, "SMPTE ST 12-1:2014: ");
 dump_s12m_timecode(ctx, st, sd, log_level);
 break;
+case AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT:
+dump_ambient_viewing_environment_metadata(ctx, sd);
+break;
 default:
 av_log(ctx, log_level, "unknown side data type %d "
"(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size);
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 77221d06e4..a4cca4c798 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -29,6 +29,7 @@
 
 #include "libavutil/encryption_info.h"
 #include "libavutil/mastering_display_metadata.h"
+#include "libavutil/ambient_viewing_environment.h"
 #include "libavutil/spherical.h"
 #include "libavutil/stereo3d.h"
 
@@ -249,6 +250,8 @@ typedef struct MOVStreamContext {
 AVMasteringDisplayMetadata *mastering;
 AVContentLightMetadata *coll;
 size_t coll_size;
+AVAmbientViewingEnvironment *ambient;
+size_t ambient_size;
 
 uint32_t format;
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5fae777adb..42b0135987 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6039,6 +6039,31 @@ static int mov_read_clli(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return 0;
 }
 
+static int mov_read_amve(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+MOVStreamContext *sc;
+const int illuminance_den = 1;
+const int ambient_den = 5;
+if (c->fc->nb_streams < 1)
+return AVERROR_INVALIDDATA;
+sc = c->fc->streams[c->fc->nb_streams - 1]->priv_data;
+if (atom.size < 6) {
+av_log(c->fc, AV_LOG_ERROR, "Empty Ambient Viewing Environment Info 
box\n");
+return AVERROR_INVALIDDATA;
+}
+if (sc->ambient){
+av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicate AMVE\n");
+return 0;
+}
+sc->ambient = av_ambient_viewing_environment_alloc(>ambient_size);
+if (!sc->ambient)
+return AVERROR(ENOMEM);
+sc->ambient->ambient_illuminance  = av_make_q(avio_rb32(pb), 
illuminance_den);
+sc->ambient->ambient_light_x = av_make_q(avio_rb16(pb), ambient_den);
+sc->ambient->ambient_light_y = av_make_q(avio_rb16(pb), ambient_den);
+return 0;
+}
+
 static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 AVStream *st;
@@ -8215,6 +8240,7 @@ static const MOVParseTableEntry mov_default_parse_table[] 
= {
 { MKTAG('i','s','p','e'), mov_read_ispe },
 { MKTAG('i','p','r','p'), mov_read_iprp },
 { MKTAG('i','i','n','f'), mov_read_iinf },
+{ MKTAG('a','m','v','e'), mov_read_amve }, /* ambient viewing environment box 
*/
 { 0, NULL }
 };
 
@@ -8680,6 +8706,7 @@ static void mov_free_stream_context(AVFormatContext *s, 
AVStream *st)
 av_freep(>spherical);
 av_freep(>mastering);
 av_freep(>coll);
+av_freep(>ambient);
 }
 
 static int mov_read_close(AVFormatContext *s)
@@ -9072,6 +9099,14 @@ static int mov_read_header(AVFormatContext *s)
 
 sc->coll = NULL;
 }
+if (sc->ambient) {
+if (!av_packet_side_data_add(>codecpar->coded_side_data, 
>codecpar->nb_coded_side_data,
+ 
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,
+ (uint8_t *) sc->ambient, 
sc->ambient_size, 0))
+

[FFmpeg-devel] [PATCH v3 1/3] avcodec: add ambient viewing environment packet side data.

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel
From: Damiano Galassi 

---
 fftools/ffprobe.c | 3 +++
 libavcodec/avpacket.c | 1 +
 libavcodec/decode.c   | 1 +
 libavcodec/packet.h   | 7 +++
 4 files changed, 12 insertions(+)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index f33e2471cb..aa1153e709 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2392,6 +2392,9 @@ static void print_pkt_side_data(WriterContext *w,
 AVContentLightMetadata *metadata = (AVContentLightMetadata 
*)sd->data;
 print_int("max_content", metadata->MaxCLL);
 print_int("max_average", metadata->MaxFALL);
+} else if (sd->type == AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT) {
+print_ambient_viewing_environment(
+w, (const AVAmbientViewingEnvironment *)sd->data);
 } else if (sd->type == AV_PKT_DATA_DYNAMIC_HDR10_PLUS) {
 AVDynamicHDRPlus *metadata = (AVDynamicHDRPlus *)sd->data;
 print_dynamic_hdr10_plus(w, metadata);
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 0f8c9b77ae..e118bbaad1 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -301,6 +301,7 @@ const char *av_packet_side_data_name(enum 
AVPacketSideDataType type)
 case AV_PKT_DATA_DOVI_CONF:  return "DOVI configuration 
record";
 case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 12-1:2014 
timecode";
 case AV_PKT_DATA_DYNAMIC_HDR10_PLUS: return "HDR10+ Dynamic 
Metadata (SMPTE 2094-40)";
+case AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT:return "Ambient viewing 
environment";
 case AV_PKT_DATA_IAMF_MIX_GAIN_PARAM:return "IAMF Mix Gain 
Parameter Data";
 case AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM:   return "IAMF Demixing Info 
Parameter Data";
 case AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM: return "IAMF Recon Gain Info 
Parameter Data";
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 2cfb3fcf97..da6446d879 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1434,6 +1434,7 @@ static const struct {
 { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
 { AV_PKT_DATA_ICC_PROFILE,AV_FRAME_DATA_ICC_PROFILE },
 { AV_PKT_DATA_DYNAMIC_HDR10_PLUS, AV_FRAME_DATA_DYNAMIC_HDR_PLUS },
+{ 
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT
 },
 };
 
 int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx,
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 2c57d262c6..215b1c9970 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -299,6 +299,13 @@ enum AVPacketSideDataType {
  */
 AV_PKT_DATA_DYNAMIC_HDR10_PLUS,
 
+/**
+ * Ambient viewing environment metadata, as defined by H.274.. This 
metadata
+ * should be associated with a video stream and contains data in the form
+ * of the AVAmbientViewingEnvironment struct.
+*/
+AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,
+
 /**
  * IAMF Mix Gain Parameter Data associated with the audio frame. This 
metadata
  * is in the form of the AVIAMFParamDefinition struct and contains 
information
-- 
2.42.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 v3 0/3] avformat/mov: add support for 'amve' ambient viewing environment box

2024-02-04 Thread Cosmin Stejerean via ffmpeg-devel
From: Cosmin Stejerean 

This rebases the previous patch series from Damiano Galassi after the
packet side data changes and adds FATE tests for both reading and
writing amve

Cosmin Stejerean (1):
  tests/fate/mov: add a test for reading and writing amve box

Damiano Galassi (2):
  avcodec: add ambient viewing environment packet side data.
  avformat/mov: add support for 'amve' ambient viewing environment box.
As defined in ISOBMFF (ISO/IEC 14496-12) document.

 fftools/ffprobe.c |  3 +++
 libavcodec/avpacket.c |  1 +
 libavcodec/decode.c   |  1 +
 libavcodec/packet.h   |  7 +++
 libavformat/dump.c| 15 +++
 libavformat/isom.h|  3 +++
 libavformat/mov.c | 35 +++
 libavformat/movenc.c  | 30 ++
 tests/fate/mov.mak|  5 +
 tests/ref/fate/mov-read-amve  |  8 
 tests/ref/fate/mov-write-amve | 33 +
 11 files changed, 141 insertions(+)
 create mode 100644 tests/ref/fate/mov-read-amve
 create mode 100644 tests/ref/fate/mov-write-amve

-- 
2.42.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 v2 2/2] fate/video: add DXV3 HQ tests

2024-02-04 Thread Connor Worley
Samples have been added to fate-suite and this series is ready to be merged.

-- 
Connor Worley
___
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 v9 2/6] avcodec/webp: separate VP8 decoding

2024-02-04 Thread Thilo Borgmann via ffmpeg-devel



On 03.02.24 14:53, Andreas Rheinhardt wrote:

Thilo Borgmann via ffmpeg-devel:

Am 28.01.24 um 11:29 schrieb Anton Khirnov:

Quoting Thilo Borgmann via ffmpeg-devel (2024-01-25 16:39:19)

Am 25.01.24 um 11:04 schrieb Anton Khirnov:

Quoting Thilo Borgmann via ffmpeg-devel (2023-12-31 13:30:14)

---
    libavcodec/webp.c | 50
+--
    1 file changed, 44 insertions(+), 6 deletions(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 4fd107aa0c..58a20b73da 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -194,6 +194,7 @@ typedef struct WebPContext {
    AVFrame *alpha_frame;   /* AVFrame for alpha
data decompressed from VP8L */
    AVPacket *pkt;  /* AVPacket to be passed
to the underlying VP8 decoder */
    AVCodecContext *avctx;  /* parent AVCodecContext */
+    AVCodecContext *avctx_vp8;  /* wrapper context for VP8
decoder */


Nested codec contexts are in general highly undesirable and should be
avoided whenever possible.


AFAICT we do it that way in the other codecs as well (cri, ftr, imm5,
tdsc, tiff). So what do you suggest to do to avoid having it nested?


Integrating the two decoders directly, as is done now.

With nesting it is very tricky to handle all the corner cases properly,
especially passing through all the options to the innner decoder, like
direct rendering, other user callbacks, etc. It should only be done as a
last resort and there should be a strong argument to do it this way.


IIUC that was what the patch still did some some versions ago.
It brought us the data races in animated files, decoupling the decoder
solving the issue.



If one keeps the codecs integrated, then one needs at the very least
change the check for whether to call ff_thread_finish_setup() as I did:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-January/320490.html
This will not be enough: E.g. changing the dimensions in VP8 code and
then reverting that change in WebP (as has been done in the earlier
version of your patch which made me propose that these decoders should
be separated) will have to be avoided.


I've a version of the animated webp decoder with coupled vp8 decoder 
doing that size change and tsan is happy for me.


I had the impression ff_thread_finish_setup() blew it in the past which 
is now avoided - am I wrong? Once your patches landed I'll post v10 and 
we can check that again.


-Thilo
___
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] avcodec/vp8: Enforce key-frame only for WebP

2024-02-04 Thread Thilo Borgmann via ffmpeg-devel




On 03.02.24 14:57, Andreas Rheinhardt wrote:

Andreas Rheinhardt:

VP8-in-WebP only uses key frame encoding (see [1]), yet this
is currently not enforced. This commit does so in order to
make output reproducible with frame-threading as the VP8 decoder's
update_thread_context is not called at all when using decoding
VP8-in-WebP (as this is unnecessary for key frame-only streams).

[1]: https://developers.google.com/speed/webp/docs/riff_container

Signed-off-by: Andreas Rheinhardt 
---
  libavcodec/vp8.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 83c60adeb0..7972775a1c 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2665,7 +2665,11 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame 
*rframe, int *got_frame,
  if (ret < 0)
  goto err;
  
-if (s->actually_webp) {

+if (!is_vp7 && s->actually_webp) {
+// VP8 in WebP is supposed to be intra-only. Enforce this here
+// to ensure that output is reproducible with frame-threading.
+if (!s->keyframe)
+return AVERROR_INVALIDDATA;
  // avctx->pix_fmt already set in caller.
  } else if (!is_vp7 && s->pix_fmt == AV_PIX_FMT_NONE) {
  s->pix_fmt = get_pixel_format(s);


Will apply this patchset tomorrow unless there are objections.


Works as expected for me for a coupled version of the animated webp 
decoder which can follow-up.


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

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


Re: [FFmpeg-devel] [RFC] Vote STF/SPI 2024-02

2024-02-04 Thread Paul B Mahol
On Sun, Feb 4, 2024 at 1:42 AM Michael Niedermayer 
wrote:

> On Sat, Feb 03, 2024 at 04:37:54AM +0100, Michael Niedermayer wrote:
> > On Thu, Feb 01, 2024 at 05:29:26AM +0100, Michael Niedermayer wrote:
> > > Hi all
> > >
> > > To do the STF/SPI thing properly, and make sure we do what the
> Community wants.
> > > We should do this vote: (unless lots of people reply and say we should
> skip the vote)
> > > (i am also CCing jonatan to make sure the option in the vote actually
> ask the GA the
> > >  right question)
> > >
> > > The vote description will be as follows:
> > > The STF/SPI has suggested us to submit an Application / Scope of work
> before their february meeting.
> > > There are about 2 weeks left.
> > > The minimum grant is 150 000 €
> > > The next STF meeting is expected to be in may. If we submit in
> february and are not selected
> > > we can probably try again in may. Which would increase our chances
> > > If we do not submit in february we can probably submit in may.
> > > There is no guarantee that money will be available in may, for example
> between october 2023
> > > and february 2024 no funds where available AFAIK.
> > > Wiki page is here:
> https://trac.ffmpeg.org/wiki/SponsoringPrograms/STF/2024
> > >
> > >
> > > Option A. The Application and Scope of Work from the WIKI shall be
> submitted to STF/SPI before the february 2024 meeting, disagreements in it
> shall be decided by the TC. To achieve continuity, submission shall be done
> by the same person as previous if possible.
> > >
> > > Option B. No Application and Scope of Work shall be submitted in
> february 2024
> > >
> > >
> > > This is a RFC, so if you see errors in it please suggest changes
> >
> > I intend to start the vote in teh next 24h or so.
>
> Vote started, you should have received a mail if you are in the GA
> and you should not have received a mail if you are not in the GA
> 50 mails where sent and there are 50 in the script output.
> I hope that no messup happened in this vote
>
> Please Vote!
>

Never vote for dead project. Controlled by money.


>
> thx
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The bravest are surely those who have the clearest vision
> of what is before them, glory and danger alike, and yet
> notwithstanding go out to meet it. -- Thucydides
> ___
> 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 0/2] Remove SDL2 output devices

2024-02-04 Thread Marton Balint




On Sun, 4 Feb 2024, J. Dekker wrote:


With the addition of threading in ffmpeg.c, the SDL2 devices no longer have the
'main' thread. This means that both the SDL2 and OpenGL output device are broken
in master. Rather than attempting to fix it, they should be removed instead as
there are better alternatives for debugging or viewing streams.


Actually they work here on a linux box with OpenSuse 15.5. So even if they
are broken on some setups, they are not broken everywhere, or not more 
broken than they used to be.


Also, poper deprecation is needed here, since not only the CLI tools might 
use these. Especially since there is no drop-in replacement.




The 'pipe:' output can be used with a real video player such as mpv, vlc, or
even ffplay. For cases where the user was an application using the API they
should supply their own renderer.


Yeah, but I never liked when people piped uncompressed data... Not 
everything that the devices support can be serialized, it is extra CPU, 
latency of the receiving app reading from pipe is a question...


I'd be a lot more happy with this if we'd offer some replacement which has 
no issues. Maybe a libplacebo based outdev.


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

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


Re: [FFmpeg-devel] Sovereign Tech Fund

2024-02-04 Thread Paul B Mahol
On Sun, Feb 4, 2024 at 11:03 AM J. Dekker  wrote:

>
>
> On Sun, Feb 4, 2024, at 10:49, Rémi Denis-Courmont wrote:
> > Hi,
> >
> > I don't believe it is appropriate to hold the vote before Derek's
> > question is addressed.
> >
> > We don't really know what we're voting on here.
> >
> > Le 1 février 2024 20:22:14 GMT+01:00, Derek Buitenhuis
> >  a écrit :
> >>On 1/31/2024 9:44 PM, Derek Buitenhuis wrote:
> >>> On 1/30/2024 1:48 AM, Michael Niedermayer wrote:
>  https://trac.ffmpeg.org/wiki/SponsoringPrograms/STF/2024
> >>>
> >>> Not to derail this fine thread, but what forks does the Merge Forks
> >>> project refer to?
> >>
> >>I do not believe this has been answered.
> >>
> >>- Derek
>
>
> The vote is unclear for me and also it was not explained who ‘the same
> person as before’ is, no reply or answer to this either. Hope Michael can
> clear this up.
>
> - jd
>


FFmpeg project is dead.


> ___
> 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 0/2] Remove SDL2 output devices

2024-02-04 Thread Paul B Mahol
FFmpeg project leader never left, it is still Michael.
But now there are his minions like Anton and others.

FFmpeg is already dead project.
___
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] Sovereign Tech Fund

2024-02-04 Thread J. Dekker


On Sun, Feb 4, 2024, at 10:49, Rémi Denis-Courmont wrote:
> Hi,
>
> I don't believe it is appropriate to hold the vote before Derek's 
> question is addressed.
>
> We don't really know what we're voting on here.
>
> Le 1 février 2024 20:22:14 GMT+01:00, Derek Buitenhuis 
>  a écrit :
>>On 1/31/2024 9:44 PM, Derek Buitenhuis wrote:
>>> On 1/30/2024 1:48 AM, Michael Niedermayer wrote:
 https://trac.ffmpeg.org/wiki/SponsoringPrograms/STF/2024
>>> 
>>> Not to derail this fine thread, but what forks does the Merge Forks
>>> project refer to?
>>
>>I do not believe this has been answered.
>>
>>- Derek


The vote is unclear for me and also it was not explained who ‘the same person 
as before’ is, no reply or answer to this either. Hope Michael can clear this 
up.

- jd
___
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] Sovereign Tech Fund

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

I don't believe it is appropriate to hold the vote before Derek's question is 
addressed.

We don't really know what we're voting on here.



Le 1 février 2024 20:22:14 GMT+01:00, Derek Buitenhuis 
 a écrit :
>On 1/31/2024 9:44 PM, Derek Buitenhuis wrote:
>> On 1/30/2024 1:48 AM, Michael Niedermayer wrote:
>>> https://trac.ffmpeg.org/wiki/SponsoringPrograms/STF/2024
>> 
>> Not to derail this fine thread, but what forks does the Merge Forks
>> project refer to?
>
>I do not believe this has been answered.
>
>- 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".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH v2 2/2] avcodec/pngenc: write cLLi and mDVc chunks

2024-02-04 Thread Leo Izen
These chunks contain the Content Light Level Information and the
Mastering Display Color Volume information that FFmpeg already supports
as AVFrameSideData. This patch adds support for the png encoder to save
this metadata as the corresponding chunks in the PNG stream.

Signed-off-by: Leo Izen 
---
 libavcodec/pngenc.c | 32 +---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index f0650962d2..50689cb50c 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -32,6 +32,7 @@
 #include "libavutil/crc.h"
 #include "libavutil/csp.h"
 #include "libavutil/libm.h"
+#include "libavutil/mastering_display_metadata.h"
 #include "libavutil/opt.h"
 #include "libavutil/rational.h"
 #include "libavutil/stereo3d.h"
@@ -294,8 +295,9 @@ static int png_write_row(AVCodecContext *avctx, const 
uint8_t *data, int size)
 return 0;
 }
 
-#define AV_WB32_PNG(buf, n) AV_WB32(buf, lrint((n) * 10))
-#define AV_WB32_PNG_D(buf, d) AV_WB32_PNG(buf, av_q2d(d))
+#define PNG_LRINT(d, divisor) lrint((d) * (divisor))
+#define PNG_Q2D(q, divisor) PNG_LRINT(av_q2d(q), (divisor))
+#define AV_WB32_PNG_D(buf, q) AV_WB32(buf, PNG_Q2D(q, 10))
 static int png_get_chrm(enum AVColorPrimaries prim,  uint8_t *buf)
 {
 const AVColorPrimariesDesc *desc = av_csp_primaries_desc_from_id(prim);
@@ -320,7 +322,7 @@ static int png_get_gama(enum AVColorTransferCharacteristic 
trc, uint8_t *buf)
 if (gamma <= 1e-6)
 return 0;
 
-AV_WB32_PNG(buf, 1.0 / gamma);
+AV_WB32(buf, PNG_LRINT(1.0 / gamma, 10));
 return 1;
 }
 
@@ -437,6 +439,30 @@ static int encode_headers(AVCodecContext *avctx, const 
AVFrame *pict)
 png_write_chunk(>bytestream, MKTAG('c', 'I', 'C', 'P'), s->buf, 4);
 }
 
+side_data = av_frame_get_side_data(pict, 
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL);
+if (side_data) {
+AVContentLightMetadata *clli = (AVContentLightMetadata *) 
side_data->data;
+AV_WB32(s->buf, clli->MaxCLL * 1);
+AV_WB32(s->buf + 4, clli->MaxFALL * 1);
+png_write_chunk(>bytestream, MKTAG('c', 'L', 'L', 'i'), s->buf, 8);
+}
+
+side_data = av_frame_get_side_data(pict, 
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA);
+if (side_data) {
+AVMasteringDisplayMetadata *mdvc = (AVMasteringDisplayMetadata *) 
side_data->data;
+if (mdvc->has_luminance && mdvc->has_primaries) {
+for (int i = 0; i < 3; i++) {
+AV_WB16(s->buf + 2*i, PNG_Q2D(mdvc->display_primaries[i][0], 
5));
+AV_WB16(s->buf + 2*i + 2, 
PNG_Q2D(mdvc->display_primaries[i][1], 5));
+}
+AV_WB16(s->buf + 12, PNG_Q2D(mdvc->white_point[0], 5));
+AV_WB16(s->buf + 14, PNG_Q2D(mdvc->white_point[1], 5));
+AV_WB32(s->buf + 16, PNG_Q2D(mdvc->max_luminance, 1));
+AV_WB32(s->buf + 20, PNG_Q2D(mdvc->min_luminance, 1));
+png_write_chunk(>bytestream, MKTAG('m', 'D', 'V', 'c'), s->buf, 
24);
+}
+}
+
 if (png_get_chrm(pict->color_primaries, s->buf))
 png_write_chunk(>bytestream, MKTAG('c', 'H', 'R', 'M'), s->buf, 32);
 if (png_get_gama(pict->color_trc, s->buf))
-- 
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 v2 1/2] avcodec/pngdec: read cLLi and mDVc chunks

2024-02-04 Thread Leo Izen
These chunks contain the Content Light Level Information and the
Mastering Display Color Volume information that FFmpeg already supports
as AVFrameSideData. This patch adds support for the png decoder to read
these chunks if present and attach the corresponding side data to the
decoded frame.

Signed-off-by: Leo Izen 
---
 libavcodec/pngdec.c | 63 +
 1 file changed, 63 insertions(+)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index d1aae4c70e..026da30c25 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -29,6 +29,7 @@
 #include "libavutil/csp.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/mastering_display_metadata.h"
 #include "libavutil/pixfmt.h"
 #include "libavutil/rational.h"
 #include "libavutil/stereo3d.h"
@@ -81,6 +82,14 @@ typedef struct PNGDecContext {
 enum AVColorPrimaries cicp_primaries;
 enum AVColorTransferCharacteristic cicp_trc;
 enum AVColorRange cicp_range;
+int have_clli;
+uint32_t clli_max;
+uint32_t clli_avg;
+int have_mdvc;
+uint16_t mdvc_primaries[3][2];
+uint16_t mdvc_white_point[2];
+uint32_t mdvc_max_lum;
+uint32_t mdvc_min_lum;
 
 enum PNGHeaderState hdr_state;
 enum PNGImageState pic_state;
@@ -731,6 +740,36 @@ static int populate_avctx_color_fields(AVCodecContext 
*avctx, AVFrame *frame)
 if (!s->has_trns && s->significant_bits > 0)
 avctx->bits_per_raw_sample = s->significant_bits;
 
+if (s->have_clli) {
+AVContentLightMetadata *clli =
+av_content_light_metadata_create_side_data(frame);
+if (!clli)
+return AVERROR(ENOMEM);
+/*
+ * 0.0001 divisor value
+ * see: https://www.w3.org/TR/png-3/#cLLi-chunk
+ */
+clli->MaxCLL = s->clli_max / 1;
+clli->MaxFALL = s->clli_avg / 1;
+}
+
+if (s->have_mdvc) {
+AVMasteringDisplayMetadata *mdvc =
+av_mastering_display_metadata_create_side_data(frame);
+if (!mdvc)
+return AVERROR(ENOMEM);
+mdvc->has_primaries = 1;
+for (int i = 0; i < 3; i++) {
+mdvc->display_primaries[i][0] = av_make_q(s->mdvc_primaries[i][0], 
5);
+mdvc->display_primaries[i][1] = av_make_q(s->mdvc_primaries[i][1], 
5);
+}
+mdvc->white_point[0] = av_make_q(s->mdvc_white_point[0], 5);
+mdvc->white_point[1] = av_make_q(s->mdvc_white_point[1], 5);
+mdvc->has_luminance = 1;
+mdvc->max_luminance = av_make_q(s->mdvc_max_lum, 1);
+mdvc->min_luminance = av_make_q(s->mdvc_min_lum, 1);
+}
+
 return 0;
 }
 
@@ -1508,6 +1547,30 @@ static int decode_frame_common(AVCodecContext *avctx, 
PNGDecContext *s,
 
 break;
 }
+case MKTAG('c', 'L', 'L', 'i'):
+if (bytestream2_get_bytes_left(_chunk) != 8) {
+av_log(avctx, AV_LOG_WARNING, "Invalid cLLi chunk size: %d\n", 
bytestream2_get_bytes_left(_chunk));
+break;
+}
+s->have_clli = 1;
+s->clli_max = bytestream2_get_be32u(_chunk);
+s->clli_avg = bytestream2_get_be32u(_chunk);
+break;
+case MKTAG('m', 'D', 'V', 'c'):
+if (bytestream2_get_bytes_left(_chunk) != 24) {
+av_log(avctx, AV_LOG_WARNING, "Invalid mDVc chunk size: %d\n", 
bytestream2_get_bytes_left(_chunk));
+break;
+}
+s->have_mdvc = 1;
+for (int i = 0; i < 3; i++) {
+s->mdvc_primaries[i][0] = bytestream2_get_be16u(_chunk);
+s->mdvc_primaries[i][1] = bytestream2_get_be16u(_chunk);
+}
+s->mdvc_white_point[0] = bytestream2_get_be16u(_chunk);
+s->mdvc_white_point[1] = bytestream2_get_be16u(_chunk);
+s->mdvc_max_lum = bytestream2_get_be32u(_chunk);
+s->mdvc_min_lum = bytestream2_get_be32u(_chunk);
+break;
 case MKTAG('I', 'E', 'N', 'D'):
 if (!(s->pic_state & PNG_ALLIMAGE))
 av_log(avctx, AV_LOG_ERROR, "IEND without all image\n");
-- 
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 v2 0/2] PNG cLLi and mDVc chunk support

2024-02-04 Thread Leo Izen
This adds support for cLLi and mDVc chunks in the PNG specification[1].

[1]: https://www.w3.org/TR/png-3/

Changes from v1:
- fix regression in cHRM writing, causing fate failure

Leo Izen (2):
  avcodec/pngdec: read cLLi and mDVc chunks
  avcodec/pngenc: write cLLi and mDVc chunks

 libavcodec/pngdec.c | 63 +
 libavcodec/pngenc.c | 32 ---
 2 files changed, 92 insertions(+), 3 deletions(-)

-- 
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 0/2] Remove SDL2 output devices

2024-02-04 Thread Anton Khirnov
Quoting Zhao Zhili (2024-02-04 10:19:11)
> > On Feb 4, 2024, at 17:02, J. Dekker  wrote:
> > 
> > With the addition of threading in ffmpeg.c, the SDL2 devices no longer have 
> > the
> > 'main' thread. This means that both the SDL2 and OpenGL output device are 
> > broken
> > in master. Rather than attempting to fix it, they should be removed instead 
> > as
> > there are better alternatives for debugging or viewing streams.
> 
> Please note they are broken only with fftools, they work as before when used 
> as libavdevice
> in theory.

In other words, unlike any normal muxer, they are broken for any
multithreaded caller and always have been.

-- 
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 0/2] Remove SDL2 output devices

2024-02-04 Thread Anton Khirnov
Quoting J. Dekker (2024-02-04 10:02:31)
> With the addition of threading in ffmpeg.c, the SDL2 devices no longer have 
> the
> 'main' thread. This means that both the SDL2 and OpenGL output device are 
> broken
> in master. Rather than attempting to fix it, they should be removed instead as
> there are better alternatives for debugging or viewing streams.
> 
> The 'pipe:' output can be used with a real video player such as mpv, vlc, or
> even ffplay. For cases where the user was an application using the API they
> should supply their own renderer.

I am in favor of this.

Even when they did "work", they were toys unsuitable for any serious
use.

-- 
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 0/2] Remove SDL2 output devices

2024-02-04 Thread Zhao Zhili



> On Feb 4, 2024, at 17:02, J. Dekker  wrote:
> 
> With the addition of threading in ffmpeg.c, the SDL2 devices no longer have 
> the
> 'main' thread. This means that both the SDL2 and OpenGL output device are 
> broken
> in master. Rather than attempting to fix it, they should be removed instead as
> there are better alternatives for debugging or viewing streams.

Please note they are broken only with fftools, they work as before when used as 
libavdevice
in theory. Please take this into consideration. I have no use case by myself.

> 
> The 'pipe:' output can be used with a real video player such as mpv, vlc, or
> even ffplay. For cases where the user was an application using the API they
> should supply their own renderer.
> 
> J. Dekker (2):
>  avdevice: remove sdl2 outdev
>  avdevice: remove OpenGL device
> 
> MAINTAINERS  |3 -
> configure|   16 -
> doc/outdevs.texi |  105 ---
> libavdevice/Makefile |2 -
> libavdevice/alldevices.c |2 -
> libavdevice/opengl_enc.c | 1313 --
> libavdevice/sdl2.c   |  370 ---
> 7 files changed, 1811 deletions(-)
> delete mode 100644 libavdevice/opengl_enc.c
> delete mode 100644 libavdevice/sdl2.c
> 
> -- 
> 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 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/wavenc: use strtoull for UMID conversion

2024-02-04 Thread Gyan Doshi




On 2024-02-02 03:34 pm, Gyan Doshi wrote:



On 2024-01-29 10:30 am, Gyan Doshi wrote:

Existing use of strtoll can lead to ERANGE errors leading to incorrect
storage of UMID.


Plan to push tomorrow.


Pushed as 7375a6ca7b4a4b223a71f85a772c64a34e60eabe

Regards,
Gyan

___
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/nutenc: Fix indentation

2024-02-04 Thread Anton Khirnov
Quoting Leo Izen (2024-02-04 08:20:55)
> 
> If we're changing this block of code anyway, could we possibly replace 
> this line:
> 
>  if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 
> /*unused*/, pkt->dts)) < 0)
>  goto fail;
> 
> With something like this?
> 
> ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts);
> if (ret < 0)
>  goto fail;
> 
> It's a bit cleaner.

I much prefer not to mix whitespace and other changes, it breaks
color-moved, ignore-all-space and similar.

-- 
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".


[FFmpeg-devel] [PATCH 2/2] avdevice: remove OpenGL device

2024-02-04 Thread J. Dekker
Signed-off-by: J. Dekker 
---
 MAINTAINERS  |1 -
 configure|   15 -
 doc/outdevs.texi |   39 --
 libavdevice/Makefile |1 -
 libavdevice/alldevices.c |1 -
 libavdevice/opengl_enc.c | 1313 --
 6 files changed, 1370 deletions(-)
 delete mode 100644 libavdevice/opengl_enc.c

diff --git a/MAINTAINERS b/MAINTAINERS
index baead5d270..c816be66ed 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -290,7 +290,6 @@ libavdevice
   iec61883.cGeorg Lippitsch
   lavfi Stefano Sabatini
   libdc1394.c   Roman Shaposhnik
-  opengl_enc.c  Lukasz Marek
   pulse_audio_enc.c Lukasz Marek
   v4l2.cGiorgio Vazzana
   vfwcap.c  Ramiro Polla
diff --git a/configure b/configure
index c4eebab14f..d97b9eedcc 100755
--- a/configure
+++ b/configure
@@ -317,7 +317,6 @@ External library support:
   --enable-libmysofa   enable libmysofa, needed for sofalizer filter [no]
   --enable-openal  enable OpenAL 1.1 capture support [no]
   --enable-opencl  enable OpenCL processing [no]
-  --enable-opengl  enable OpenGL rendering [no]
   --enable-openssl enable openssl, needed for https support
if gnutls, libtls or mbedtls is not used [no]
   --enable-pocketsphinxenable PocketSphinx, needed for asr filter [no]
@@ -1917,7 +1916,6 @@ EXTERNAL_LIBRARY_LIST="
 lv2
 mediacodec
 openal
-opengl
 openssl
 pocketsphinx
 vapoursynth
@@ -2237,7 +2235,6 @@ HEADERS_LIST="
 machine_ioctl_meteor_h
 malloc_h
 opencv2_core_core_c_h
-OpenGL_gl3_h
 poll_h
 sys_param_h
 sys_resource_h
@@ -3629,8 +3626,6 @@ lavfi_indev_deps="avfilter"
 libcdio_indev_deps="libcdio"
 libdc1394_indev_deps="libdc1394"
 openal_indev_deps="openal"
-opengl_outdev_deps="opengl"
-opengl_outdev_suggest="sdl2"
 oss_indev_deps_any="sys_soundcard_h"
 oss_outdev_deps_any="sys_soundcard_h"
 pulse_indev_deps="libpulse"
@@ -6952,12 +6947,6 @@ enabled opencl&& { check_pkg_config opencl 
OpenCL CL/cl.h clEnqueueN
  { test_cpp_condition "OpenCL/cl.h" 
"defined(CL_VERSION_1_2)" ||
test_cpp_condition "CL/cl.h" 
"defined(CL_VERSION_1_2)" ||
die "ERROR: opencl must be installed and 
version must be 1.2 or compatible"; }
-enabled opengl&& { check_lib opengl GL/glx.h glXGetProcAddress 
"-lGL" ||
-   check_lib opengl windows.h wglGetProcAddress 
"-lopengl32 -lgdi32" ||
-   check_lib opengl OpenGL/gl3.h glGetError 
"-Wl,-framework,OpenGL" ||
-   check_lib opengl ES2/gl.h glGetError 
"-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
-   die "ERROR: opengl not found."
- }
 enabled omx_rpi   && { test_code cc OMX_Core.h 
OMX_IndexConfigBrcmVideoRequestIFrame ||
{ ! enabled cross_compile &&
  add_cflags -isystem/opt/vc/include/IL &&
@@ -7708,10 +7697,6 @@ enabled zoompan_filter  && prepend avfilter_deps 
"swscale"
 
 enabled lavfi_indev && prepend avdevice_deps "avfilter"
 
-#FIXME
-enabled_any opengl_outdev && enabled sdl2 &&
-add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
-
 enabled opus_decoder&& prepend avcodec_deps "swresample"
 
 # reorder the items at var $1 to align with the items order at var $2 .
diff --git a/doc/outdevs.texi b/doc/outdevs.texi
index d3b9199463..86c78f31b7 100644
--- a/doc/outdevs.texi
+++ b/doc/outdevs.texi
@@ -301,45 +301,6 @@ ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev 
/dev/fb0
 
 See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
 
-@section opengl
-OpenGL output device.
-
-To enable this output device you need to configure FFmpeg with 
@code{--enable-opengl}.
-
-This output device allows one to render to OpenGL context.
-Context may be provided by application or default SDL window is created.
-
-When device renders to external context, application must implement handlers 
for following messages:
-@code{AV_DEV_TO_APP_CREATE_WINDOW_BUFFER} - create OpenGL context on current 
thread.
-@code{AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER} - make OpenGL context current.
-@code{AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER} - swap buffers.
-@code{AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER} - destroy OpenGL context.
-Application is also required to inform a device about current resolution by 
sending @code{AV_APP_TO_DEV_WINDOW_SIZE} message.
-
-@subsection Options
-@table @option
-
-@item background
-Set background color. Black is a default.
-@item no_window
-Disables default SDL window when set to non-zero value.
-Application must provide OpenGL context 

[FFmpeg-devel] [PATCH 1/2] avdevice: remove sdl2 outdev

2024-02-04 Thread J. Dekker
Signed-off-by: J. Dekker 
---
 MAINTAINERS  |   2 -
 configure|   3 +-
 doc/outdevs.texi |  66 ---
 libavdevice/Makefile |   1 -
 libavdevice/alldevices.c |   1 -
 libavdevice/sdl2.c   | 370 ---
 6 files changed, 1 insertion(+), 442 deletions(-)
 delete mode 100644 libavdevice/sdl2.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 4677931211..baead5d270 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -292,8 +292,6 @@ libavdevice
   libdc1394.c   Roman Shaposhnik
   opengl_enc.c  Lukasz Marek
   pulse_audio_enc.c Lukasz Marek
-  sdl   Stefano Sabatini
-  sdl2.cJosh de Kock
   v4l2.cGiorgio Vazzana
   vfwcap.c  Ramiro Polla
   xv.c  Lukasz Marek
diff --git a/configure b/configure
index 68f675a4bc..c4eebab14f 100755
--- a/configure
+++ b/configure
@@ -3635,7 +3635,6 @@ oss_indev_deps_any="sys_soundcard_h"
 oss_outdev_deps_any="sys_soundcard_h"
 pulse_indev_deps="libpulse"
 pulse_outdev_deps="libpulse"
-sdl2_outdev_deps="sdl2"
 sndio_indev_deps="sndio"
 sndio_outdev_deps="sndio"
 v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
@@ -7710,7 +7709,7 @@ enabled zoompan_filter  && prepend avfilter_deps 
"swscale"
 enabled lavfi_indev && prepend avdevice_deps "avfilter"
 
 #FIXME
-enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
+enabled_any opengl_outdev && enabled sdl2 &&
 add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
 
 enabled opus_decoder&& prepend avcodec_deps "swresample"
diff --git a/doc/outdevs.texi b/doc/outdevs.texi
index f0484bbf8f..d3b9199463 100644
--- a/doc/outdevs.texi
+++ b/doc/outdevs.texi
@@ -406,72 +406,6 @@ Play a file on default device on default server:
 ffmpeg  -i INPUT -f pulse "stream name"
 @end example
 
-@section sdl
-
-SDL (Simple DirectMedia Layer) output device.
-
-"sdl2" can be used as alias for "sdl".
-
-This output device allows one to show a video stream in an SDL
-window. Only one SDL window is allowed per application, so you can
-have only one instance of this output device in an application.
-
-To enable this output device you need libsdl installed on your system
-when configuring your build.
-
-For more information about SDL, check:
-@url{http://www.libsdl.org/}
-
-@subsection Options
-
-@table @option
-
-@item window_borderless
-Set SDL window border off.
-Default value is 0 (enable window border).
-
-@item window_enable_quit
-Enable quit action (using window button or keyboard key)
-when non-zero value is provided.
-Default value is 1 (enable quit action).
-
-@item window_fullscreen
-Set fullscreen mode when non-zero value is provided.
-Default value is zero.
-
-@item window_size
-Set the SDL window size, can be a string of the form
-@var{width}x@var{height} or a video size abbreviation.
-If not specified it defaults to the size of the input video,
-downscaled according to the aspect ratio.
-
-@item window_title
-Set the SDL window title, if not specified default to the filename
-specified for the output device.
-
-@item window_x
-@item window_y
-Set the position of the window on the screen.
-@end table
-
-@subsection Interactive commands
-
-The window created by the device can be controlled through the
-following interactive commands.
-
-@table @key
-@item q, ESC
-Quit the device immediately.
-@end table
-
-@subsection Examples
-
-The following command shows the @command{ffmpeg} output is an
-SDL window, forcing its size to the qcif format:
-@example
-ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL 
output"
-@end example
-
 @section sndio
 
 sndio audio output device.
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index c30449201d..26b2339ae1 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -42,7 +42,6 @@ OBJS-$(CONFIG_PULSE_INDEV)   += pulse_audio_dec.o 
\
 pulse_audio_common.o timefilter.o
 OBJS-$(CONFIG_PULSE_OUTDEV)  += pulse_audio_enc.o \
 pulse_audio_common.o
-OBJS-$(CONFIG_SDL2_OUTDEV)   += sdl2.o
 OBJS-$(CONFIG_SNDIO_INDEV)   += sndio_dec.o sndio.o
 OBJS-$(CONFIG_SNDIO_OUTDEV)  += sndio_enc.o sndio.o
 OBJS-$(CONFIG_V4L2_INDEV)+= v4l2.o v4l2-common.o timefilter.o
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index 8a90fcb5d7..9215be7214 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -46,7 +46,6 @@ extern const AVInputFormat  ff_oss_demuxer;
 extern const FFOutputFormat ff_oss_muxer;
 extern const AVInputFormat  ff_pulse_demuxer;
 extern const FFOutputFormat ff_pulse_muxer;
-extern const FFOutputFormat ff_sdl2_muxer;
 extern const AVInputFormat  ff_sndio_demuxer;
 

[FFmpeg-devel] [PATCH 0/2] Remove SDL2 output devices

2024-02-04 Thread J. Dekker
With the addition of threading in ffmpeg.c, the SDL2 devices no longer have the
'main' thread. This means that both the SDL2 and OpenGL output device are broken
in master. Rather than attempting to fix it, they should be removed instead as
there are better alternatives for debugging or viewing streams.

The 'pipe:' output can be used with a real video player such as mpv, vlc, or
even ffplay. For cases where the user was an application using the API they
should supply their own renderer.

J. Dekker (2):
  avdevice: remove sdl2 outdev
  avdevice: remove OpenGL device

 MAINTAINERS  |3 -
 configure|   16 -
 doc/outdevs.texi |  105 ---
 libavdevice/Makefile |2 -
 libavdevice/alldevices.c |2 -
 libavdevice/opengl_enc.c | 1313 --
 libavdevice/sdl2.c   |  370 ---
 7 files changed, 1811 deletions(-)
 delete mode 100644 libavdevice/opengl_enc.c
 delete mode 100644 libavdevice/sdl2.c

-- 
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".