[FFmpeg-cvslog] tests/fate/filter-audio.mak: add test for atempo audio filter

2024-07-03 Thread Rajiv Harlalka
ffmpeg | branch: master | Rajiv Harlalka  | Thu Mar 
21 13:53:29 2024 +0530| [fc446eea05b9bc7de9a3c6b56dae8255bb5c5b5d] | committer: 
Anton Khirnov

tests/fate/filter-audio.mak: add test for atempo audio filter

Signed-off-by: Rajiv Harlalka 
Signed-off-by: Anton Khirnov 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc446eea05b9bc7de9a3c6b56dae8255bb5c5b5d
---

 tests/fate/filter-audio.mak  |  3 ++
 tests/ref/fate/filter-atempo | 70 
 2 files changed, 73 insertions(+)

diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 3f22db1e05..8120620afe 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -412,6 +412,9 @@ fate-filter-hdcd-s32p: CMD = md5 -i $(SRC) -af hdcd -f s32le
 fate-filter-hdcd-s32p: CMP = oneline
 fate-filter-hdcd-s32p: REF = 0c5513e83eedaa10ab6fac9ddc173cf5
 
+FATE_AFILTER_SAMPLES-$(call FILTERDEMDECENCMUX, ATEMPO, WAV, PCM_S16LE, 
PCM_S16LE, WAV) += fate-filter-atempo
+fate-filter-atempo: CMD = framecrc -i 
$(TARGET_PATH)/tests/data/asynth-44100-1.wav -af "atempo=2.0" -ar 44100
+
 FATE_AFILTER-yes += fate-filter-formats
 fate-filter-formats: libavfilter/tests/formats$(EXESUF)
 fate-filter-formats: CMD = run libavfilter/tests/formats$(EXESUF)
diff --git a/tests/ref/fate/filter-atempo b/tests/ref/fate/filter-atempo
new file mode 100644
index 00..abedfcd618
--- /dev/null
+++ b/tests/ref/fate/filter-atempo
@@ -0,0 +1,70 @@
+#tb 0: 1/44100
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 44100
+#channel_layout_name 0: mono
+0,  0,  0, 2048, 4096, 0x9c4dffa9
+0,   2048,   2048, 2048, 4096, 0x3a11f3f6
+0,   4096,   4096, 2048, 4096, 0x9835f5a5
+0,   6144,   6144, 2048, 4096, 0x7fe7e8ab
+0,   8192,   8192, 2048, 4096, 0x9450f26b
+0,  10240,  10240, 2048, 4096, 0x8f95ff6a
+0,  12288,  12288, 2048, 4096, 0xc9deebab
+0,  14336,  14336, 2048, 4096, 0x0229ec6c
+0,  16384,  16384, 2048, 4096, 0xb1b00a8c
+0,  18432,  18432, 2048, 4096, 0x43e7f197
+0,  20480,  20480, 2048, 4096, 0x60580ec1
+0,  22528,  22528, 2048, 4096, 0x1a4f084c
+0,  24576,  24576, 2048, 4096, 0x70d20213
+0,  26624,  26624, 2048, 4096, 0xaf9afc70
+0,  28672,  28672, 2048, 4096, 0x1212df6f
+0,  30720,  30720, 2048, 4096, 0x37a8f35a
+0,  32768,  32768, 2048, 4096, 0x4730f0ee
+0,  34816,  34816, 2048, 4096, 0x1fe1efd8
+0,  36864,  36864, 2048, 4096, 0xdfc4149e
+0,  38912,  38912, 2048, 4096, 0xe288ffd1
+0,  40960,  40960, 2048, 4096, 0xee7b0829
+0,  43008,  43008, 2048, 4096, 0xb20df4aa
+0,  45056,  45056, 2048, 4096, 0x0564f254
+0,  47104,  47104, 2048, 4096, 0x92daf362
+0,  49152,  49152, 2048, 4096, 0xaab3f18b
+0,  51200,  51200, 2048, 4096, 0xe2bdfcb4
+0,  53248,  53248, 2048, 4096, 0x706adab4
+0,  55296,  55296, 2048, 4096, 0x141a075b
+0,  57344,  57344, 2048, 4096, 0x87aad71f
+0,  59392,  59392, 2048, 4096, 0xfafd0233
+0,  61440,  61440, 2048, 4096, 0x74b1cb64
+0,  63488,  63488, 2048, 4096, 0x9ffee659
+0,  65536,  65536, 2048, 4096, 0x50dde96c
+0,  67584,  67584, 2048, 4096, 0xa4f5fc36
+0,  69632,  69632, 2048, 4096, 0xd40ff139
+0,  71680,  71680, 2048, 4096, 0xe93fe12a
+0,  73728,  73728, 2048, 4096, 0x747f05da
+0,  75776,  75776, 2048, 4096, 0x902601d7
+0,  77824,  77824, 2048, 4096, 0xee871089
+0,  79872,  79872, 2048, 4096, 0x8fba09ee
+0,  81920,  81920, 2048, 4096, 0x832afdea
+0,  83968,  83968, 2048, 4096, 0x7224ec15
+0,  86016,  86016, 2048, 4096, 0xf7def9f4
+0,  88064,  88064, 2048, 4096, 0x3c8af149
+0,  90112,  90112, 2048, 4096, 0x1dc1dfcf
+0,  92160,  92160, 2048, 4096, 0x8ef51140
+0,  94208,  94208, 2048, 4096, 0x4b200588
+0,  96256,  96256, 2048, 4096, 0x29e9be20
+0,  98304,  98304, 2048, 4096, 0x8298f08a
+0, 100352, 100352, 2048, 4096, 0xae5ef3b3
+0, 102400, 102400, 2048, 4096, 0xa76cfbe3
+0, 104448, 104448, 2048, 4096, 0xf784fdb0
+0, 106496, 106496, 2048, 4096, 0xea70f93e
+0, 108544, 108544, 2048, 4096, 0xea5ffc00
+0, 110592, 110592, 2048, 4096, 0x6c2f0350
+0, 112640, 112640, 2048, 4096, 0x5f94cf81
+0, 114688, 114688, 2048, 4096, 0x2f28fda2
+0, 116736, 116736, 2048, 4096, 

[FFmpeg-cvslog] fftools/ffmpeg_mux_init: apply encoder options manually

2024-07-03 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Tue Apr  9 
14:11:12 2024 +0200| [9a7686e5458dad8d40b3b3f70f6a19530933468e] | committer: 
Anton Khirnov

fftools/ffmpeg_mux_init: apply encoder options manually

Do not pass an options dictionary to the avcodec_open2() in enc_open().

This is cleaner and more robust, as previously various bits of code
would try to interpret the contents of the options dictionary, with
varying degrees of correctness. Now they can just access the encoder
AVCodecContext directly.

Cf. 372c78dd42f2b1ca743473b9c32fad71c65919e0 - analogous change for
decoding.

A non-progressive field order is now written on the container level in
interlaced ProRes encoding tests.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a7686e5458dad8d40b3b3f70f6a19530933468e
---

 fftools/ffmpeg_enc.c| 18 ++--
 fftools/ffmpeg_mux_init.c   | 66 +++--
 tests/ref/vsynth/vsynth1-prores_444_int |  2 +-
 tests/ref/vsynth/vsynth1-prores_int |  2 +-
 tests/ref/vsynth/vsynth2-prores_444_int |  2 +-
 tests/ref/vsynth/vsynth2-prores_int |  2 +-
 tests/ref/vsynth/vsynth3-prores_444_int |  2 +-
 tests/ref/vsynth/vsynth3-prores_int |  2 +-
 tests/ref/vsynth/vsynth_lena-prores_444_int |  2 +-
 tests/ref/vsynth/vsynth_lena-prores_int |  2 +-
 10 files changed, 47 insertions(+), 53 deletions(-)

diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 928114c20f..c1c8aa0e78 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -307,16 +307,10 @@ int enc_open(void *opaque, const AVFrame *frame)
 if (ost->bitexact)
 enc_ctx->flags |= AV_CODEC_FLAG_BITEXACT;
 
-if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
-av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
+if (enc->capabilities & AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE)
+enc_ctx->flags |= AV_CODEC_FLAG_COPY_OPAQUE;
 
-if (enc->capabilities & AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE) {
-ret = av_dict_set(&ost->encoder_opts, "flags", "+copy_opaque", 
AV_DICT_MULTIKEY);
-if (ret < 0)
-return ret;
-}
-
-av_dict_set(&ost->encoder_opts, "flags", "+frame_duration", 
AV_DICT_MULTIKEY);
+enc_ctx->flags |= AV_CODEC_FLAG_FRAME_DURATION;
 
 ret = hw_device_setup_for_encode(ost, frame ? frame->hw_frames_ctx : NULL);
 if (ret < 0) {
@@ -325,7 +319,7 @@ int enc_open(void *opaque, const AVFrame *frame)
 return ret;
 }
 
-if ((ret = avcodec_open2(ost->enc_ctx, enc, &ost->encoder_opts)) < 0) {
+if ((ret = avcodec_open2(ost->enc_ctx, enc, NULL)) < 0) {
 if (ret != AVERROR_EXPERIMENTAL)
 av_log(ost, AV_LOG_ERROR, "Error while opening encoder - maybe "
"incorrect parameters such as bit_rate, rate, width or 
height.\n");
@@ -337,10 +331,6 @@ int enc_open(void *opaque, const AVFrame *frame)
 if (ost->enc_ctx->frame_size)
 frame_samples = ost->enc_ctx->frame_size;
 
-ret = check_avoptions(ost->encoder_opts);
-if (ret < 0)
-return ret;
-
 if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000 &&
 ost->enc_ctx->codec_id != AV_CODEC_ID_CODEC2 /* don't complain about 
700 bit/s modes */)
 av_log(ost, AV_LOG_WARNING, "The bitrate parameter is set too low."
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index da68d1e5f0..cd413e0b7b 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -711,14 +711,10 @@ static int new_stream_video(Muxer *mux, const 
OptionsContext *o,
 /* two pass mode */
 MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st);
 if (do_pass) {
-if (do_pass & 1) {
+if (do_pass & 1)
 video_enc->flags |= AV_CODEC_FLAG_PASS1;
-av_dict_set(&ost->encoder_opts, "flags", "+pass1", 
AV_DICT_APPEND);
-}
-if (do_pass & 2) {
+if (do_pass & 2)
 video_enc->flags |= AV_CODEC_FLAG_PASS2;
-av_dict_set(&ost->encoder_opts, "flags", "+pass2", 
AV_DICT_APPEND);
-}
 }
 
 MATCH_PER_STREAM_OPT(passlogfiles, str, ost->logfile_prefix, oc, st);
@@ -740,7 +736,10 @@ static int new_stream_video(Muxer *mux, const 
OptionsContext *o,
DEFAULT_PASS_LOGFILENAME_PREFIX,
  ost_idx);
 if (!strcmp(ost->enc_ctx->codec->name, "libx264") || 
!strcmp(ost->enc_ctx->codec->name, "libvvenc")) {
-av_dict_set(&ost->encoder_opts, "stats", logfilename, 
AV_DICT_DONT_OVERWRITE);
+if (av_opt_is_set_to_default_by_name(ost->enc_ctx, "stats",
+ AV_OPT_SEARCH_CHILDREN) > 
0)
+av_opt_set(ost->enc_ctx, "stats", logfilename,
+   AV_OPT_SEARCH_CHILDREN);
 } else {
 if (vi

[FFmpeg-cvslog] fftools/ffmpeg_mux_init: make encoder_opts local to ost_add()

2024-07-03 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Tue Apr  9 
14:30:28 2024 +0200| [901f7e3f72fe6005a6fd340882511346e00350b2] | committer: 
Anton Khirnov

fftools/ffmpeg_mux_init: make encoder_opts local to ost_add()

It is no longer needed after this function returns.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=901f7e3f72fe6005a6fd340882511346e00350b2
---

 fftools/ffmpeg.h  |  2 --
 fftools/ffmpeg_mux.c  |  1 -
 fftools/ffmpeg_mux_init.c | 71 ++-
 3 files changed, 40 insertions(+), 34 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index e4c8561325..d173475621 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -586,8 +586,6 @@ typedef struct OutputStream {
 FilterGraph  *fg_simple;
 OutputFilter *filter;
 
-AVDictionary *encoder_opts;
-
 char *attachment_filename;
 
 /* stats */
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 80572d7b36..71ff9b45ab 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -812,7 +812,6 @@ static void ost_free(OutputStream **post)
 av_packet_free(&ms->bsf_pkt);
 
 av_packet_free(&ms->pkt);
-av_dict_free(&ost->encoder_opts);
 
 av_freep(&ost->kf.pts);
 av_expr_free(ost->kf.pexpr);
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index cd413e0b7b..899ee6046f 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -905,7 +905,7 @@ static int new_stream_subtitle(Muxer *mux, const 
OptionsContext *o,
 return 0;
 }
 
-static int streamcopy_init(const Muxer *mux, OutputStream *ost)
+static int streamcopy_init(const Muxer *mux, OutputStream *ost, AVDictionary 
**encoder_opts)
 {
 MuxStream   *ms = ms_from_ost(ost);
 
@@ -928,7 +928,7 @@ static int streamcopy_init(const Muxer *mux, OutputStream 
*ost)
 
 ret = avcodec_parameters_to_context(codec_ctx, ist->par);
 if (ret >= 0)
-ret = av_opt_set_dict(codec_ctx, &ost->encoder_opts);
+ret = av_opt_set_dict(codec_ctx, encoder_opts);
 if (ret < 0) {
 av_log(ost, AV_LOG_FATAL,
"Error setting up codec context options.\n");
@@ -1039,6 +1039,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, 
enum AVMediaType type,
 OutputStream *ost;
 const AVCodec *enc;
 AVStream *st;
+AVDictionary *encoder_opts = NULL;
 int ret = 0, keep_pix_fmt = 0, autoscale = 1;
 int threads_manual = 0;
 AVRational enc_tb = { 0, 0 };
@@ -1160,10 +1161,10 @@ static int ost_add(Muxer *mux, const OptionsContext *o, 
enum AVMediaType type,
 const char *enc_time_base = NULL;
 
 ret = filter_codec_opts(o->g->codec_opts, enc->codec_id,
-oc, st, enc->codec, &ost->encoder_opts,
+oc, st, enc->codec, &encoder_opts,
 &mux->enc_opts_used);
 if (ret < 0)
-return ret;
+goto fail;
 
 MATCH_PER_STREAM_OPT(presets, str, preset, oc, st);
 
@@ -1187,7 +1188,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, 
enum AVMediaType type,
 break;
 }
 *arg++ = 0;
-av_dict_set(&ost->encoder_opts, buf, arg, 
AV_DICT_DONT_OVERWRITE);
+av_dict_set(&encoder_opts, buf, arg, AV_DICT_DONT_OVERWRITE);
 } while (!s->eof_reached);
 av_bprint_finalize(&bprint, NULL);
 avio_closep(&s);
@@ -1195,7 +1196,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, 
enum AVMediaType type,
 if (ret) {
 av_log(ost, AV_LOG_FATAL,
"Preset %s specified, but could not be opened.\n", preset);
-return ret;
+goto fail;
 }
 
 MATCH_PER_STREAM_OPT(enc_stats_pre, str, enc_stats_pre, oc, st);
@@ -1207,7 +1208,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, 
enum AVMediaType type,
 
 ret = enc_stats_init(ost, &ost->enc_stats_pre, 1, enc_stats_pre, 
format);
 if (ret < 0)
-return ret;
+goto fail;
 }
 
 MATCH_PER_STREAM_OPT(enc_stats_post, str, enc_stats_post, oc, st);
@@ -1219,7 +1220,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, 
enum AVMediaType type,
 
 ret = enc_stats_init(ost, &ost->enc_stats_post, 0, enc_stats_post, 
format);
 if (ret < 0)
-return ret;
+goto fail;
 }
 
 MATCH_PER_STREAM_OPT(mux_stats, str, mux_stats, oc, st);
@@ -1231,7 +1232,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, 
enum AVMediaType type,
 
 ret = enc_stats_init(ost, &ms->stats, 0, mux_stats, format);
 if (ret < 0)
-return ret;
+goto fail;
 }
 
 MATCH_PER_STREAM_OPT(enc_time_bases, str, enc_time_base, oc, st);
@@ -1253,7 +1254,8 @@ static int ost_a

[FFmpeg-cvslog] fftools/ffmpeg: rewrite checking whether codec AVOptions have been used

2024-07-03 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Tue Apr  9 
12:56:46 2024 +0200| [f1664aabb18b2d726c3c0c0b7fa8202f3b52b8da] | committer: 
Anton Khirnov

fftools/ffmpeg: rewrite checking whether codec AVOptions have been used

Share the code between encoding and decoding. Instead of checking every
stream's options dictionary (which is also used for other purposes),
track all used options in a dedicated dictionary.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1664aabb18b2d726c3c0c0b7fa8202f3b52b8da
---

 fftools/cmdutils.c| 17 +-
 fftools/cmdutils.h|  4 +++-
 fftools/ffmpeg.c  | 50 ++
 fftools/ffmpeg.h  |  4 +++-
 fftools/ffmpeg_demux.c| 50 ++
 fftools/ffmpeg_mux.c  |  1 +
 fftools/ffmpeg_mux.h  |  3 +++
 fftools/ffmpeg_mux_init.c | 56 +--
 fftools/ffmpeg_opt.c  | 18 ---
 fftools/ffplay.c  |  2 +-
 fftools/ffprobe.c |  2 +-
 11 files changed, 91 insertions(+), 116 deletions(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index a504acb3e4..9b18cf5e4d 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -986,7 +986,7 @@ int check_stream_specifier(AVFormatContext *s, AVStream 
*st, const char *spec)
 
 int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
   AVFormatContext *s, AVStream *st, const AVCodec *codec,
-  AVDictionary **dst)
+  AVDictionary **dst, AVDictionary **opts_used)
 {
 AVDictionary*ret = NULL;
 const AVDictionaryEntry *t = NULL;
@@ -1013,6 +1013,7 @@ int filter_codec_opts(const AVDictionary *opts, enum 
AVCodecID codec_id,
 while (t = av_dict_iterate(opts, t)) {
 const AVClass *priv_class;
 char *p = strchr(t->key, ':');
+int used = 0;
 
 /* check stream specification in opt name */
 if (p) {
@@ -1030,15 +1031,21 @@ int filter_codec_opts(const AVDictionary *opts, enum 
AVCodecID codec_id,
 !codec ||
 ((priv_class = codec->priv_class) &&
  av_opt_find(&priv_class, t->key, NULL, flags,
- AV_OPT_SEARCH_FAKE_OBJ)))
+ AV_OPT_SEARCH_FAKE_OBJ))) {
 av_dict_set(&ret, t->key, t->value, 0);
-else if (t->key[0] == prefix &&
+used = 1;
+} else if (t->key[0] == prefix &&
  av_opt_find(&cc, t->key + 1, NULL, flags,
- AV_OPT_SEARCH_FAKE_OBJ))
+ AV_OPT_SEARCH_FAKE_OBJ)) {
 av_dict_set(&ret, t->key + 1, t->value, 0);
+used = 1;
+}
 
 if (p)
 *p = ':';
+
+if (used && opts_used)
+av_dict_set(opts_used, t->key, "", 0);
 }
 
 *dst = ret;
@@ -1063,7 +1070,7 @@ int setup_find_stream_info_opts(AVFormatContext *s,
 
 for (int i = 0; i < s->nb_streams; i++) {
 ret = filter_codec_opts(codec_opts, s->streams[i]->codecpar->codec_id,
-s, s->streams[i], NULL, &opts[i]);
+s, s->streams[i], NULL, &opts[i], NULL);
 if (ret < 0)
 goto fail;
 }
diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h
index 2125f791d0..14340dff7d 100644
--- a/fftools/cmdutils.h
+++ b/fftools/cmdutils.h
@@ -371,11 +371,13 @@ int check_stream_specifier(AVFormatContext *s, AVStream 
*st, const char *spec);
  * @param codec The particular codec for which the options should be filtered.
  *  If null, the default one is looked up according to the codec 
id.
  * @param dst a pointer to the created dictionary
+ * @param opts_used if non-NULL, every option stored in dst is also stored 
here,
+ *  with specifiers preserved
  * @return a non-negative number on success, a negative error code on failure
  */
 int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
   AVFormatContext *s, AVStream *st, const AVCodec *codec,
-  AVDictionary **dst);
+  AVDictionary **dst, AVDictionary **opts_used);
 
 /**
  * Setup AVCodecContext options for avformat_find_stream_info().
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 8674c4d250..00ab1cce51 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -474,6 +474,56 @@ const FrameData *packet_data_c(AVPacket *pkt)
 return ret < 0 ? NULL : (const FrameData*)pkt->opaque_ref->data;
 }
 
+int check_avoptions_used(const AVDictionary *opts, const AVDictionary 
*opts_used,
+ void *logctx, int decode)
+{
+const AVClass  *class = avcodec_get_class();
+const AVClass *fclass = avformat_get_class();
+
+const int flag = decode ? AV_OPT_FLAG_DECODING_PARAM :
+  AV_OPT_FLAG_ENCODING_PARAM;
+const AVDictionaryEntry *e = N

[FFmpeg-cvslog] fftools/ffmpeg_opt: add missing codec type to some options

2024-07-03 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Jul  2 16:35:37 
2024 -0300| [d241edc2b45f6865b1acea1ab54216359d68a64f] | committer: James Almer

fftools/ffmpeg_opt: add missing codec type to some options

Reviewed-by: Anton Khirnov 
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d241edc2b45f6865b1acea1ab54216359d68a64f
---

 fftools/ffmpeg_opt.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index b256fc9372..97585e4dfa 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1477,9 +1477,6 @@ const OptionDef options[] = {
 { "bitexact",   OPT_TYPE_BOOL, OPT_EXPERT | OPT_OFFSET | 
OPT_OUTPUT | OPT_INPUT,
 { .off = OFFSET(bitexact) },
 "bitexact mode" },
-{ "apad",   OPT_TYPE_STRING, OPT_PERSTREAM | OPT_EXPERT | 
OPT_OUTPUT,
-{ .off = OFFSET(apad) },
-"audio pad", "" },
 { "dts_delta_threshold",OPT_TYPE_FLOAT, OPT_EXPERT,
 { &dts_delta_threshold },
 "timestamp discontinuity delta threshold", "threshold" },
@@ -1708,10 +1705,10 @@ const OptionDef options[] = {
 { "hwaccels",   OPT_TYPE_FUNC,   OPT_EXIT | OPT_EXPERT,
 { .func_arg = show_hwaccels },
 "show available HW acceleration methods" },
-{ "autorotate", OPT_TYPE_BOOL,   OPT_PERSTREAM | 
OPT_EXPERT | OPT_INPUT,
+{ "autorotate", OPT_TYPE_BOOL,   OPT_VIDEO | OPT_PERSTREAM 
| OPT_EXPERT | OPT_INPUT,
 { .off = OFFSET(autorotate) },
 "automatically insert correct rotate filters" },
-{ "autoscale",  OPT_TYPE_BOOL,   OPT_PERSTREAM | 
OPT_EXPERT | OPT_OUTPUT,
+{ "autoscale",  OPT_TYPE_BOOL,   OPT_VIDEO | OPT_PERSTREAM 
| OPT_EXPERT | OPT_OUTPUT,
 { .off = OFFSET(autoscale) },
 "automatically insert a scale filter at the end of the filter graph" },
 { "fix_sub_duration_heartbeat", OPT_TYPE_BOOL,   OPT_VIDEO | OPT_EXPERT | 
OPT_PERSTREAM | OPT_OUTPUT,
@@ -1744,6 +1741,9 @@ const OptionDef options[] = {
 { "ab",   OPT_TYPE_FUNC,OPT_AUDIO | OPT_FUNC_ARG | 
OPT_PERFILE | OPT_OUTPUT,
 { .func_arg = opt_bitrate },
 "alias for -b:a (select bitrate for audio streams)", "bitrate" },
+{ "apad", OPT_TYPE_STRING,  OPT_AUDIO | OPT_PERSTREAM | 
OPT_EXPERT | OPT_OUTPUT,
+{ .off = OFFSET(apad) },
+"audio pad", "" },
 { "atag", OPT_TYPE_FUNC,OPT_AUDIO | OPT_FUNC_ARG  | 
OPT_EXPERT | OPT_PERFILE | OPT_OUTPUT | OPT_HAS_CANON,
 { .func_arg = opt_old2new },
 "force audio tag/fourcc", "fourcc/tag",

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

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


[FFmpeg-cvslog] avcodec/pngdec: fix mDCv typo

2024-07-03 Thread Leo Izen
ffmpeg | branch: master | Leo Izen  | Tue Jul  2 09:24:18 
2024 -0400| [c1af34c25bd48a547930094fd60e5458dd1c6d9b] | committer: Leo Izen

avcodec/pngdec: fix mDCv typo

When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct. See other
files such as av1dec.c which uses mdcv.

Typo originally introduced in c7a57b0f70f8d1574aa0f0dbe98db85d8ac91c76.

Signed-off-by: Leo Izen 
Reported-by: Ramiro Polla 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c1af34c25bd48a547930094fd60e5458dd1c6d9b
---

 libavcodec/pngdec.c | 53 +++--
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 1c910e6a5b..180806e5e1 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -86,11 +86,12 @@ typedef struct PNGDecContext {
 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;
+/* Mastering Display Color Volume */
+int have_mdcv;
+uint16_t mdcv_primaries[3][2];
+uint16_t mdcv_white_point[2];
+uint32_t mdcv_max_lum;
+uint32_t mdcv_min_lum;
 
 enum PNGHeaderState hdr_state;
 enum PNGImageState pic_state;
@@ -763,24 +764,24 @@ static int populate_avctx_color_fields(AVCodecContext 
*avctx, AVFrame *frame)
 }
 }
 
-if (s->have_mdvc) {
-AVMasteringDisplayMetadata *mdvc;
+if (s->have_mdcv) {
+AVMasteringDisplayMetadata *mdcv;
 
-ret = ff_decode_mastering_display_new(avctx, frame, &mdvc);
+ret = ff_decode_mastering_display_new(avctx, frame, &mdcv);
 if (ret < 0)
 return ret;
 
-if (mdvc) {
-mdvc->has_primaries = 1;
+if (mdcv) {
+mdcv->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);
+mdcv->display_primaries[i][0] = 
av_make_q(s->mdcv_primaries[i][0], 5);
+mdcv->display_primaries[i][1] = 
av_make_q(s->mdcv_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);
+mdcv->white_point[0] = av_make_q(s->mdcv_white_point[0], 5);
+mdcv->white_point[1] = av_make_q(s->mdcv_white_point[1], 5);
+mdcv->has_luminance = 1;
+mdcv->max_luminance = av_make_q(s->mdcv_max_lum, 1);
+mdcv->min_luminance = av_make_q(s->mdcv_min_lum, 1);
 }
 }
 
@@ -1571,20 +1572,20 @@ static int decode_frame_common(AVCodecContext *avctx, 
PNGDecContext *s,
 s->clli_max = bytestream2_get_be32u(&gb_chunk);
 s->clli_avg = bytestream2_get_be32u(&gb_chunk);
 break;
-case MKTAG('m', 'D', 'V', 'c'):
+case MKTAG('m', 'D', 'C', 'v'):
 if (bytestream2_get_bytes_left(&gb_chunk) != 24) {
-av_log(avctx, AV_LOG_WARNING, "Invalid mDVc chunk size: %d\n", 
bytestream2_get_bytes_left(&gb_chunk));
+av_log(avctx, AV_LOG_WARNING, "Invalid mDCv chunk size: %d\n", 
bytestream2_get_bytes_left(&gb_chunk));
 break;
 }
-s->have_mdvc = 1;
+s->have_mdcv = 1;
 for (int i = 0; i < 3; i++) {
-s->mdvc_primaries[i][0] = bytestream2_get_be16u(&gb_chunk);
-s->mdvc_primaries[i][1] = bytestream2_get_be16u(&gb_chunk);
+s->mdcv_primaries[i][0] = bytestream2_get_be16u(&gb_chunk);
+s->mdcv_primaries[i][1] = bytestream2_get_be16u(&gb_chunk);
 }
-s->mdvc_white_point[0] = bytestream2_get_be16u(&gb_chunk);
-s->mdvc_white_point[1] = bytestream2_get_be16u(&gb_chunk);
-s->mdvc_max_lum = bytestream2_get_be32u(&gb_chunk);
-s->mdvc_min_lum = bytestream2_get_be32u(&gb_chunk);
+s->mdcv_white_point[0] = bytestream2_get_be16u(&gb_chunk);
+s->mdcv_white_point[1] = bytestream2_get_be16u(&gb_chunk);
+s->mdcv_max_lum = bytestream2_get_be32u(&gb_chunk);
+s->mdcv_min_lum = bytestream2_get_be32u(&gb_chunk);
 break;
 case MKTAG('I', 'E', 'N', 'D'):
 if (!(s->pic_state & PNG_ALLIMAGE))

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https:/

[FFmpeg-cvslog] avcodec/pngenc: fix mDCv typo

2024-07-03 Thread Leo Izen
ffmpeg | branch: master | Leo Izen  | Tue Jul  2 09:39:01 
2024 -0400| [d69e52252320011f094292e7398645614f9dfe96] | committer: Leo Izen

avcodec/pngenc: fix mDCv typo

When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct.

Typo originally introduced in 78949041417caaef0c82b2b23d7defdd88aa2378.

Signed-off-by: Leo Izen 
Reported-by: Ramiro Polla 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d69e52252320011f094292e7398645614f9dfe96
---

 libavcodec/pngenc.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 89c3d5b83e..7ae16fa2c5 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -450,17 +450,17 @@ static int encode_headers(AVCodecContext *avctx, const 
AVFrame *pict)
 
 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) {
+AVMasteringDisplayMetadata *mdcv = (AVMasteringDisplayMetadata *) 
side_data->data;
+if (mdcv->has_luminance && mdcv->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 + 2*i, PNG_Q2D(mdcv->display_primaries[i][0], 
5));
+AV_WB16(s->buf + 2*i + 2, 
PNG_Q2D(mdcv->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(&s->bytestream, MKTAG('m', 'D', 'V', 'c'), s->buf, 
24);
+AV_WB16(s->buf + 12, PNG_Q2D(mdcv->white_point[0], 5));
+AV_WB16(s->buf + 14, PNG_Q2D(mdcv->white_point[1], 5));
+AV_WB32(s->buf + 16, PNG_Q2D(mdcv->max_luminance, 1));
+AV_WB32(s->buf + 20, PNG_Q2D(mdcv->min_luminance, 1));
+png_write_chunk(&s->bytestream, MKTAG('m', 'D', 'C', 'v'), s->buf, 
24);
 }
 }
 

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

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


[FFmpeg-cvslog] avcodec/pngdec: fix mDCv typo

2024-07-03 Thread Leo Izen
ffmpeg | branch: release/7.0 | Leo Izen  | Tue Jul  2 
09:24:18 2024 -0400| [5ce0c378966f6bc328f643549cad288ab1d3a163] | committer: 
Leo Izen

avcodec/pngdec: fix mDCv typo

When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct. See other
files such as av1dec.c which uses mdcv.

Typo originally introduced in c7a57b0f70f8d1574aa0f0dbe98db85d8ac91c76.

Signed-off-by: Leo Izen 
Reported-by: Ramiro Polla 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ce0c378966f6bc328f643549cad288ab1d3a163
---

 libavcodec/pngdec.c | 53 +++--
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 90c286eb83..625102 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -85,11 +85,12 @@ typedef struct PNGDecContext {
 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;
+/* Mastering Display Color Volume */
+int have_mdcv;
+uint16_t mdcv_primaries[3][2];
+uint16_t mdcv_white_point[2];
+uint32_t mdcv_max_lum;
+uint32_t mdcv_min_lum;
 
 enum PNGHeaderState hdr_state;
 enum PNGImageState pic_state;
@@ -762,24 +763,24 @@ static int populate_avctx_color_fields(AVCodecContext 
*avctx, AVFrame *frame)
 }
 }
 
-if (s->have_mdvc) {
-AVMasteringDisplayMetadata *mdvc;
+if (s->have_mdcv) {
+AVMasteringDisplayMetadata *mdcv;
 
-ret = ff_decode_mastering_display_new(avctx, frame, &mdvc);
+ret = ff_decode_mastering_display_new(avctx, frame, &mdcv);
 if (ret < 0)
 return ret;
 
-if (mdvc) {
-mdvc->has_primaries = 1;
+if (mdcv) {
+mdcv->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);
+mdcv->display_primaries[i][0] = 
av_make_q(s->mdcv_primaries[i][0], 5);
+mdcv->display_primaries[i][1] = 
av_make_q(s->mdcv_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);
+mdcv->white_point[0] = av_make_q(s->mdcv_white_point[0], 5);
+mdcv->white_point[1] = av_make_q(s->mdcv_white_point[1], 5);
+mdcv->has_luminance = 1;
+mdcv->max_luminance = av_make_q(s->mdcv_max_lum, 1);
+mdcv->min_luminance = av_make_q(s->mdcv_min_lum, 1);
 }
 }
 
@@ -1569,20 +1570,20 @@ static int decode_frame_common(AVCodecContext *avctx, 
PNGDecContext *s,
 s->clli_max = bytestream2_get_be32u(&gb_chunk);
 s->clli_avg = bytestream2_get_be32u(&gb_chunk);
 break;
-case MKTAG('m', 'D', 'V', 'c'):
+case MKTAG('m', 'D', 'C', 'v'):
 if (bytestream2_get_bytes_left(&gb_chunk) != 24) {
-av_log(avctx, AV_LOG_WARNING, "Invalid mDVc chunk size: %d\n", 
bytestream2_get_bytes_left(&gb_chunk));
+av_log(avctx, AV_LOG_WARNING, "Invalid mDCv chunk size: %d\n", 
bytestream2_get_bytes_left(&gb_chunk));
 break;
 }
-s->have_mdvc = 1;
+s->have_mdcv = 1;
 for (int i = 0; i < 3; i++) {
-s->mdvc_primaries[i][0] = bytestream2_get_be16u(&gb_chunk);
-s->mdvc_primaries[i][1] = bytestream2_get_be16u(&gb_chunk);
+s->mdcv_primaries[i][0] = bytestream2_get_be16u(&gb_chunk);
+s->mdcv_primaries[i][1] = bytestream2_get_be16u(&gb_chunk);
 }
-s->mdvc_white_point[0] = bytestream2_get_be16u(&gb_chunk);
-s->mdvc_white_point[1] = bytestream2_get_be16u(&gb_chunk);
-s->mdvc_max_lum = bytestream2_get_be32u(&gb_chunk);
-s->mdvc_min_lum = bytestream2_get_be32u(&gb_chunk);
+s->mdcv_white_point[0] = bytestream2_get_be16u(&gb_chunk);
+s->mdcv_white_point[1] = bytestream2_get_be16u(&gb_chunk);
+s->mdcv_max_lum = bytestream2_get_be32u(&gb_chunk);
+s->mdcv_min_lum = bytestream2_get_be32u(&gb_chunk);
 break;
 case MKTAG('I', 'E', 'N', 'D'):
 if (!(s->pic_state & PNG_ALLIMAGE))

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
h

[FFmpeg-cvslog] avcodec/pngenc: fix mDCv typo

2024-07-03 Thread Leo Izen
ffmpeg | branch: release/7.0 | Leo Izen  | Tue Jul  2 
09:39:01 2024 -0400| [89a85efbf1f708e8eb9170d89ec49c065a066cee] | committer: 
Leo Izen

avcodec/pngenc: fix mDCv typo

When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct.

Typo originally introduced in 78949041417caaef0c82b2b23d7defdd88aa2378.

Signed-off-by: Leo Izen 
Reported-by: Ramiro Polla 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=89a85efbf1f708e8eb9170d89ec49c065a066cee
---

 libavcodec/pngenc.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 28d645ea48..e4c6bdc563 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -449,17 +449,17 @@ static int encode_headers(AVCodecContext *avctx, const 
AVFrame *pict)
 
 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) {
+AVMasteringDisplayMetadata *mdcv = (AVMasteringDisplayMetadata *) 
side_data->data;
+if (mdcv->has_luminance && mdcv->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 + 2*i, PNG_Q2D(mdcv->display_primaries[i][0], 
5));
+AV_WB16(s->buf + 2*i + 2, 
PNG_Q2D(mdcv->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(&s->bytestream, MKTAG('m', 'D', 'V', 'c'), s->buf, 
24);
+AV_WB16(s->buf + 12, PNG_Q2D(mdcv->white_point[0], 5));
+AV_WB16(s->buf + 14, PNG_Q2D(mdcv->white_point[1], 5));
+AV_WB32(s->buf + 16, PNG_Q2D(mdcv->max_luminance, 1));
+AV_WB32(s->buf + 20, PNG_Q2D(mdcv->min_luminance, 1));
+png_write_chunk(&s->bytestream, MKTAG('m', 'D', 'C', 'v'), s->buf, 
24);
 }
 }
 

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

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


[FFmpeg-cvslog] lavc/vc1dsp: fuse multiply-adds in R-V V inv_trans_4

2024-07-03 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Sun Jun 30 
14:15:33 2024 +0300| [78e1565f847588cb3d34d1a920902fb253d9c03c] | committer: 
Rémi Denis-Courmont

lavc/vc1dsp: fuse multiply-adds in R-V V inv_trans_4

T-Head C908 (cycles):before   after
vc1dsp.vc1_inv_trans_4x4_rvv_i32: 128.0   120.0
vc1dsp.vc1_inv_trans_4x8_rvv_i32: 244.0   240.0
vc1dsp.vc1_inv_trans_8x4_rvv_i32: 239.2   235.2

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=78e1565f847588cb3d34d1a920902fb253d9c03c
---

 libavcodec/riscv/vc1dsp_rvv.S | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/libavcodec/riscv/vc1dsp_rvv.S b/libavcodec/riscv/vc1dsp_rvv.S
index 9d85377cec..8c127c7644 100644
--- a/libavcodec/riscv/vc1dsp_rvv.S
+++ b/libavcodec/riscv/vc1dsp_rvv.S
@@ -194,14 +194,12 @@ func ff_vc1_inv_trans_4_rvv, zve32x
 li  t4, 22
 vmul.vx v10, v2, t3
 li  t2, 10
-vmul.vx v14, v1, t4
+vmul.vx v26, v1, t4
+vmul.vx v27, v3, t4
 vadd.vv v24, v8, v10  # t1
 vsub.vv v25, v8, v10  # t2
-vmul.vx v16, v3, t2
-vmul.vx v18, v3, t4
-vmul.vx v20, v1, t2
-vadd.vv v26, v14, v16 # t3
-vsub.vv v27, v18, v20 # t4
+vmacc.vx v26, t2, v3  # t3
+vnmsac.vx v27, t2, v1 # t4
 vwadd.vv  v8, v24, v26
 vwsub.vv  v10, v25, v27
 vwadd.vv  v12, v25, v27

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

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


[FFmpeg-cvslog] lavc/vc1dsp: fuse multiply-adds in R-V V inv_trans_8

2024-07-03 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Sun Jun 30 
14:15:33 2024 +0300| [4a2de380b7c27f4542af03fdf91d913fabe091fc] | committer: 
Rémi Denis-Courmont

lavc/vc1dsp: fuse multiply-adds in R-V V inv_trans_8

T-Head C908 (cycles) before   after
vc1dsp.vc1_inv_trans_4x8_rvv_i32: 240.0   228.0
vc1dsp.vc1_inv_trans_8x4_rvv_i32: 235.2   224.2
vc1dsp.vc1_inv_trans_8x8_rvv_i32: 340.7   327.2

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a2de380b7c27f4542af03fdf91d913fabe091fc
---

 libavcodec/riscv/vc1dsp_rvv.S | 63 +++
 1 file changed, 27 insertions(+), 36 deletions(-)

diff --git a/libavcodec/riscv/vc1dsp_rvv.S b/libavcodec/riscv/vc1dsp_rvv.S
index 8c127c7644..d8b62579aa 100644
--- a/libavcodec/riscv/vc1dsp_rvv.S
+++ b/libavcodec/riscv/vc1dsp_rvv.S
@@ -116,55 +116,46 @@ endfunc
 .variant_cc ff_vc1_inv_trans_8_rvv
 func ff_vc1_inv_trans_8_rvv, zve32x
 li  t4, 12
-vsll.vi v18, v6, 4
+vsll.vi v14, v6, 4
 li  t2, 6
-vmul.vx v8, v0, t4
+vsll.vi v12, v2, 4
 li  t5, 15
-vmul.vx v10, v4, t4
+vmul.vx v8, v0, t4
 li  t3, 9
 # t[2..5] = [6 9 12 15]
-vsll.vi v12, v2, 4
-vmul.vx v14, v6, t2
+vmul.vx v10, v4, t4
 vmul.vx v16, v2, t2
-vadd.vv v26, v12, v14 # t3
+vmacc.vx  v12, t2, v6  # t3
+vnmsac.vx v14, t2, v2 # -t4
 vadd.vv v24, v8, v10  # t1
 vsub.vv v25, v8, v10  # t2
-vsub.vv v27, v16, v18 # t4
-vadd.vv v28, v24, v26 # t5
-vsub.vv v31, v24, v26 # t8
-vadd.vv v29, v25, v27 # t6
-vsub.vv v30, v25, v27 # t7
+vadd.vv v28, v24, v12 # t5
+vsub.vv v31, v24, v12 # t8
+vsub.vv v29, v25, v14 # t6
+vadd.vv v30, v25, v14 # t7
 vsll.vi v20, v1, 4
-vmul.vx v21, v3, t5
-vmul.vx v22, v5, t3
-vsll.vi v23, v7, 2
-vadd.vv v20, v20, v21
-vadd.vv v22, v22, v23
+vsll.vi v22, v7, 2
+vmacc.vx  v20, t5, v3
+vmacc.vx  v22, t3, v5
 vsll.vi v21, v3, 2
+vsll.vi v23, v5, 4
 vadd.vv v24, v20, v22 # t1
-vmul.vx v20, v1, t5
-vsll.vi v22, v5, 4
-vmul.vx v23, v7, t3
-vsub.vv v20, v20, v21
-vadd.vv v22, v22, v23
-vsll.vi v21, v3, 4
-vsub.vv v25, v20, v22 # t2
-vmul.vx v20, v1, t3
+vnmsac.vx v21, t5, v1
+vmacc.vx  v23, t3, v7
+vsll.vi v20, v3, 4
 vsll.vi v22, v5, 2
-vmul.vx v23, v7, t5
-vsub.vv v20, v20, v21
-vadd.vv v22, v22, v23
-vmul.vx v21, v3, t3
-vadd.vv v26, v20, v22 # t3
-vsll.vi v20, v1, 2
-vmul.vx v22, v5, t5
+vadd.vv v25, v21, v23 # -t2
+vnmsac.vx v20, t3, v1
+vmacc.vx v22, t5, v7
+vsll.vi v21, v1, 2
 vsll.vi v23, v7, 4
-vsub.vv v20, v20, v21
-vsub.vv v22, v22, v23
-vadd.vv v27, v20, v22 # t4
+vsub.vv v26, v22, v20 # t3
+vnmsac.vx v21, t3, v3
+vnmsac.vx v23, t5, v5
 srlit2, t1, 2
 vwadd.vv  v8, v28, v24
-vwadd.vv  v10, v29, v25
+vwsub.vv  v10, v29, v25
+vsub.vv v27, v21, v23 # t4
 vwadd.vv  v12, v30, v26
 vwadd.vv  v14, v31, v27
 beqzt2, 1f # faster than 4x add t2=zero
@@ -174,7 +165,7 @@ func ff_vc1_inv_trans_8_rvv, zve32x
 1:
 vwsub.vv  v16, v31, v27
 vwsub.vv  v18, v30, v26
-vwsub.vv  v20, v29, v25
+vwadd.vv  v20, v29, v25
 vwsub.vv  v22, v28, v24
 vnclip.wx v0, v8, t1
 vnclip.wx v1, v10, t1

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

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


[FFmpeg-cvslog] avformat/mov: add more checks for infe atom size

2024-07-03 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Jun 30 23:40:22 
2024 -0300| [cf7e2c5e055b6ad4dc629fcfadb40208d164c94c] | committer: James Almer

avformat/mov: add more checks for infe atom size

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cf7e2c5e055b6ad4dc629fcfadb40208d164c94c
---

 libavformat/mov.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index f07eab4d90..b4402d2bba 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8484,6 +8484,8 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, 
MOVAtom atom, int idx)
 version = avio_r8(pb);
 avio_rb24(pb);  // flags.
 size -= 4;
+if (size < 0)
+return AVERROR_INVALIDDATA;
 
 if (version < 2) {
 avpriv_report_missing_feature(c->fc, "infe version < 2");
@@ -8495,6 +8497,8 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, 
MOVAtom atom, int idx)
 avio_rb16(pb); // item_protection_index
 item_type = avio_rl32(pb);
 size -= 8;
+if (size < 1)
+return AVERROR_INVALIDDATA;
 
 av_bprint_init(&item_name, 0, AV_BPRINT_SIZE_UNLIMITED);
 ret = ff_read_string_to_bprint_overwrite(pb, &item_name, size);

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

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


[FFmpeg-cvslog] avformat/mov: check extent_offset calculation for overflow

2024-07-03 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Jun 30 23:40:20 
2024 -0300| [a9a5d000aa14fc1caa535de4649a67e5a209435d] | committer: James Almer

avformat/mov: check extent_offset calculation for overflow

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9a5d000aa14fc1caa535de4649a67e5a209435d
---

 libavformat/mov.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index d31fb23f27..e8b7420fc7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8456,7 +8456,8 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 }
 for (int j = 0; j < extent_count; j++) {
 if (rb_size(pb, &extent_offset, offset_size) < 0 ||
-rb_size(pb, &extent_length, length_size) < 0)
+rb_size(pb, &extent_length, length_size) < 0 ||
+base_offset > INT64_MAX - extent_offset)
 return AVERROR_INVALIDDATA;
 if (offset_type == 1)
 c->heif_item[i].is_idat_relative = 1;

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

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


[FFmpeg-cvslog] avformat/mov: check that iloc offset values fit on an int64_t

2024-07-03 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Jun 30 23:40:19 
2024 -0300| [c49898a6b15a11a953620c588422c004cb826d15] | committer: James Almer

avformat/mov: check that iloc offset values fit on an int64_t

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c49898a6b15a11a953620c588422c004cb826d15
---

 libavformat/mov.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index a3951a6942..d31fb23f27 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8362,7 +8362,7 @@ static int mov_read_SAND(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return 0;
 }
 
-static int rb_size(AVIOContext *pb, uint64_t* value, int size)
+static int rb_size(AVIOContext *pb, int64_t *value, int size)
 {
 if (size == 0)
 *value = 0;
@@ -8372,9 +8372,11 @@ static int rb_size(AVIOContext *pb, uint64_t* value, int 
size)
 *value = avio_rb16(pb);
 else if (size == 4)
 *value = avio_rb32(pb);
-else if (size == 8)
+else if (size == 8) {
 *value = avio_rb64(pb);
-else
+if (*value < 0)
+return -1;
+} else
 return -1;
 return size;
 }

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

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


[FFmpeg-cvslog] avformat/mov: check for EOF inside the infe list parsing loop

2024-07-03 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Jun 30 23:40:21 
2024 -0300| [235ba14cc0e294d62e4fba58229f935c5551671a] | committer: James Almer

avformat/mov: check for EOF inside the infe list parsing loop

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=235ba14cc0e294d62e4fba58229f935c5551671a
---

 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index e8b7420fc7..f07eab4d90 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8554,6 +8554,8 @@ static int mov_read_iinf(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 for (i = 0; i < entry_count; i++) {
 MOVAtom infe;
 
+if (avio_feof(pb))
+return AVERROR_INVALIDDATA;
 infe.size = avio_rb32(pb) - 8;
 infe.type = avio_rl32(pb);
 ret = mov_read_infe(c, pb, infe, i);

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

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