[FFmpeg-cvslog] New commits on branch master

2022-03-15 Thread Git System
URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6f8b8e633205ab690a6a33b139f4e95828e4892f
Author: Vittorio Giovara 
Date:   Tue May 2 09:58:37 2017 -0400

mov: Implement spatial audio support

As defined by Google's Spatial Audio RFC.

Signed-off-by: Vittorio Giovara 
Signed-off-by: Anton Khirnov 
Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6358ec1ac4ccabccff20c7dfcb8bb2e1200f5f5
Author: Anton Khirnov 
Date:   Tue May 28 14:54:51 2019 +0200

opus: export mapping family 2 (Ambisonic) as Ambisonic layout

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=886847afa029cca3e10ceae2b2f5da0cf7a36d5c
Author: Vittorio Giovara 
Date:   Mon May 1 15:30:35 2017 -0400

channel_layout: add support for Ambisonic

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2f8ccca2fa94ce256ff77baa18f462c1abd8d2cc
Author: James Almer 
Date:   Wed Feb 23 23:58:34 2022 -0300

tools/target_{bsf,dec}_fuzzer: convert to new channel layout-API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f5ef91e02080316f50d606f5b0b0bb627ed7
Author: James Almer 
Date:   Thu Jan 20 17:47:51 2022 -0300

doc/examples: convert to new channel layout-API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50e9e11316064ecdee889b18a0b6681a248edcf4
Author: James Almer 
Date:   Thu Jan 20 16:38:44 2022 -0300

tools: convert to new channel layout-API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d532f474de2c9dc05e75a8bbb8fc57d11069a8f
Author: James Almer 
Date:   Thu Jan 20 16:32:30 2022 -0300

tests: convert to new channel layout-API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0995e1f1b31f6e937a1b527407ed3e850f138098
Author: James Almer 
Date:   Wed Jan 19 18:40:42 2022 -0300

ffplay: convert to new channel layout-API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8b885f2944d4fc748ca0efd8f99875950efe8aa
Author: James Almer 
Date:   Thu Sep 2 21:37:27 2021 -0300

ffprobe: convert to new channel layout-API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=987763ac35d3db8beb77e7c5e8426e1b265b2f95
Author: James Almer 
Date:   Thu Sep 2 21:04:30 2021 -0300

ffmpeg: convert to new channel layout-API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=53d60aafaf2649660bea6f1558dd54d50f6cf636
Author: James Almer 
Date:   Mon Dec 27 19:53:01 2021 -0300

avdevice/lavfi: remove call to deprecated function 
av_buffersink_get_channel_layout()

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f96db959c1235bb7079d354e09914a0a2608f62
Author: James Almer 
Date:   Tue Aug 31 11:03:14 2021 -0300

avfilter: convert to new channel layout API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a5896ec1f635ccf0d726f7ba7a06649ebeebf25
Author: James Almer 
Date:   Fri Aug 27 00:37:53 2021 -0300

swresample: convert to new channel layout API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2d6e7a2892445ceb14947ae7c959d55e34aba1f
Author: Vittorio Giovara 
Date:   Thu May 4 16:33:24 2017 -0400

lavf: Add non diegetic stream disposition flag

Signed-off-by: Vittorio Giovara 
Signed-off-by: Anton Khirnov 
Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5636972c7acb5a485e1759db478ded70ee9d3832
Author: Anton Khirnov 
Date:   Tue Jun 4 17:16:02 2019 +0200

lavc: drop temporary compat wrappers for channel layout API change

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfe86a761a969190ad93781ac5126e8c1742300f
Author: Anton Khirnov 
Date:   Tue May 7 07:20:32 2013 +0200

ws-snd1: convert to new channel layout API

Signed-off-by: Vittorio Giovara 
Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c933af4934fa7e1119b8d684d361b85530bfe31
Author: Anton Khirnov 
Date:   Tue Jun 4 13:03:50 2019 +0200

wma: convert to new channel layout API

Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=03ba5cf321e42e3a42c283ed717fc812b760e039
Author: Anton Khirnov 
Date:   Tue May 7 07:20:32 2013 +0200

wavpack: convert to new channel layout API

Signed-off-by: Vittorio Giovara 
Signed-off-by: James Almer 

URL:
http://git.videolan.org/gitweb

[FFmpeg-cvslog] avcodec/audiotoolboxenc: use the correct function name

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 15 10:18:53 
2022 -0300| [793c85bc4d31d6ac4512b93fa4945861b8e69790] | committer: James Almer

avcodec/audiotoolboxenc: use the correct function name

Signed-off-by: James Almer 

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

 libavcodec/audiotoolboxenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index ed7985b06a..74f7ff543f 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -186,7 +186,7 @@ static int remap_layout(AudioChannelLayout *layout, const 
AVChannelLayout *in_la
 for (i = 0; i < in_layout->nb_channels; i++) {
 int c, label;
 
-c = av_channel_layout_get_channel(in_layout, i);
+c = av_channel_layout_channel_from_index(in_layout, i);
 if (c < 0 || c >= 64)
 return AVERROR(EINVAL);
 label = get_channel_label(c);

___
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/audiotoolboxenc: Fix the use of FF_ARRAY_ELEMS

2022-03-15 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Tue Mar 15 
15:25:04 2022 +0200| [6383862ae2868470576f7e10e7b94733d88a595a] | committer: 
Martin Storsjö

avcodec/audiotoolboxenc: Fix the use of FF_ARRAY_ELEMS

Signed-off-by: Martin Storsjö 

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

 libavcodec/audiotoolboxenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 74f7ff543f..4f43d8e43b 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -220,7 +220,7 @@ static int get_aac_tag(const AVChannelLayout *in_layout)
 };
 int i;
 
-for (i = 0; i < FF_ARRAY_ELEMS; i++)
+for (i = 0; i < FF_ARRAY_ELEMS(map); i++)
 if (!av_channel_layout_compare(in_layout, &map[i].chl))
 return map[i].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/audiotoolboxenc: use the correct macros for standard channel layouts

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 15 10:26:40 
2022 -0300| [a02663d997c1fd7cb8b5456e57cbbcff6632283d] | committer: James Almer

avcodec/audiotoolboxenc: use the correct macros for standard channel layouts

Signed-off-by: James Almer 

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

 libavcodec/audiotoolboxenc.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 4f43d8e43b..2092b7a26a 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -204,19 +204,19 @@ static int get_aac_tag(const AVChannelLayout *in_layout)
 AVChannelLayout chl;
 int tag;
 } map[] = {
-{ AV_CH_LAYOUT_MONO,  kAudioChannelLayoutTag_Mono },
-{ AV_CH_LAYOUT_STEREO,kAudioChannelLayoutTag_Stereo },
-{ AV_CH_LAYOUT_QUAD,  
kAudioChannelLayoutTag_AAC_Quadraphonic },
-{ AV_CH_LAYOUT_OCTAGONAL, kAudioChannelLayoutTag_AAC_Octagonal 
},
-{ AV_CH_LAYOUT_SURROUND,  kAudioChannelLayoutTag_AAC_3_0 },
-{ AV_CH_LAYOUT_4POINT0,   kAudioChannelLayoutTag_AAC_4_0 },
-{ AV_CH_LAYOUT_5POINT0,   kAudioChannelLayoutTag_AAC_5_0 },
-{ AV_CH_LAYOUT_5POINT1,   kAudioChannelLayoutTag_AAC_5_1 },
-{ AV_CH_LAYOUT_6POINT0,   kAudioChannelLayoutTag_AAC_6_0 },
-{ AV_CH_LAYOUT_6POINT1,   kAudioChannelLayoutTag_AAC_6_1 },
-{ AV_CH_LAYOUT_7POINT0,   kAudioChannelLayoutTag_AAC_7_0 },
-{ AV_CH_LAYOUT_7POINT1_WIDE_BACK, kAudioChannelLayoutTag_AAC_7_1 },
-{ AV_CH_LAYOUT_7POINT1,   kAudioChannelLayoutTag_MPEG_7_1_C },
+{ AV_CHANNEL_LAYOUT_MONO,  kAudioChannelLayoutTag_Mono },
+{ AV_CHANNEL_LAYOUT_STEREO,kAudioChannelLayoutTag_Stereo },
+{ AV_CHANNEL_LAYOUT_QUAD,  
kAudioChannelLayoutTag_AAC_Quadraphonic },
+{ AV_CHANNEL_LAYOUT_OCTAGONAL, 
kAudioChannelLayoutTag_AAC_Octagonal },
+{ AV_CHANNEL_LAYOUT_SURROUND,  kAudioChannelLayoutTag_AAC_3_0 
},
+{ AV_CHANNEL_LAYOUT_4POINT0,   kAudioChannelLayoutTag_AAC_4_0 
},
+{ AV_CHANNEL_LAYOUT_5POINT0,   kAudioChannelLayoutTag_AAC_5_0 
},
+{ AV_CHANNEL_LAYOUT_5POINT1,   kAudioChannelLayoutTag_AAC_5_1 
},
+{ AV_CHANNEL_LAYOUT_6POINT0,   kAudioChannelLayoutTag_AAC_6_0 
},
+{ AV_CHANNEL_LAYOUT_6POINT1,   kAudioChannelLayoutTag_AAC_6_1 
},
+{ AV_CHANNEL_LAYOUT_7POINT0,   kAudioChannelLayoutTag_AAC_7_0 
},
+{ AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, kAudioChannelLayoutTag_AAC_7_1 
},
+{ AV_CHANNEL_LAYOUT_7POINT1,   
kAudioChannelLayoutTag_MPEG_7_1_C },
 };
 int 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".


[FFmpeg-cvslog] avcodec/dca_lbr: set nchannels

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 15 10:37:54 
2022 -0300| [739c96ba1a2cebca4194de4c9f914eb0dd514250] | committer: James Almer

avcodec/dca_lbr: set nchannels

Fixes warnings about uninitialized values

Signed-off-by: James Almer 

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

 libavcodec/dca_lbr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c
index 68f822ecfa..06c10b96f5 100644
--- a/libavcodec/dca_lbr.c
+++ b/libavcodec/dca_lbr.c
@@ -1730,6 +1730,7 @@ int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame 
*frame)
 const int8_t *reorder;
 uint64_t channel_mask = channel_layouts[ch_conf];
 
+nchannels = av_popcount64(channel_mask);
 avctx->sample_rate = s->sample_rate;
 avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
 avctx->bits_per_raw_sample = 0;

___
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/audiotoolboxenc: add missing AVCodec.ch_layouts

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 15 10:57:08 
2022 -0300| [f0be7c1057c8db35f71e02a59025316686ae7255] | committer: James Almer

avcodec/audiotoolboxenc: add missing AVCodec.ch_layouts

Signed-off-by: James Almer 

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

 libavcodec/audiotoolboxenc.c | 34 +++---
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 2092b7a26a..78ff45f972 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -610,7 +610,7 @@ static const AVOption options[] = {
 .version= LIBAVUTIL_VERSION_INT, \
 };
 
-#define FFAT_ENC(NAME, ID, PROFILES, ...) \
+#define FFAT_ENC(NAME, ID, PROFILES, CAPS, CHANNEL_LAYOUTS, CH_LAYOUTS) \
 FFAT_ENC_CLASS(NAME) \
 const AVCodec ff_##NAME##_at_encoder = { \
 .name   = #NAME "_at", \
@@ -624,7 +624,9 @@ static const AVOption options[] = {
 .flush  = ffat_encode_flush, \
 .priv_class = &ffat_##NAME##_enc_class, \
 .capabilities   = AV_CODEC_CAP_DELAY | \
-  AV_CODEC_CAP_ENCODER_FLUSH __VA_ARGS__, \
+  AV_CODEC_CAP_ENCODER_FLUSH CAPS, \
+.channel_layouts= CHANNEL_LAYOUTS, \
+.ch_layouts = CH_LAYOUTS, \
 .sample_fmts= (const enum AVSampleFormat[]) { \
 AV_SAMPLE_FMT_S16, \
 AV_SAMPLE_FMT_U8,  AV_SAMPLE_FMT_NONE \
@@ -634,6 +636,23 @@ static const AVOption options[] = {
 .wrapper_name   = "at", \
 };
 
+static const AVChannelLayout aac_at_ch_layouts[] = {
+AV_CHANNEL_LAYOUT_MONO,
+AV_CHANNEL_LAYOUT_STEREO,
+AV_CHANNEL_LAYOUT_SURROUND,
+AV_CHANNEL_LAYOUT_4POINT0,
+AV_CHANNEL_LAYOUT_5POINT0,
+AV_CHANNEL_LAYOUT_5POINT1,
+AV_CHANNEL_LAYOUT_6POINT0,
+AV_CHANNEL_LAYOUT_6POINT1,
+AV_CHANNEL_LAYOUT_7POINT0,
+AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK,
+AV_CHANNEL_LAYOUT_QUAD,
+AV_CHANNEL_LAYOUT_OCTAGONAL,
+{ 0 },
+};
+
+#if FF_API_OLD_CHANNEL_LAYOUT
 static const uint64_t aac_at_channel_layouts[] = {
 AV_CH_LAYOUT_MONO,
 AV_CH_LAYOUT_STEREO,
@@ -649,10 +668,11 @@ static const uint64_t aac_at_channel_layouts[] = {
 AV_CH_LAYOUT_OCTAGONAL,
 0,
 };
+#endif
 
-FFAT_ENC(aac,  AV_CODEC_ID_AAC,  aac_profiles, , 
.channel_layouts = aac_at_channel_layouts)
+FFAT_ENC(aac,  AV_CODEC_ID_AAC,  aac_profiles, , 
aac_at_channel_layouts, aac_at_ch_layouts)
 //FFAT_ENC(adpcm_ima_qt, AV_CODEC_ID_ADPCM_IMA_QT, NULL)
-FFAT_ENC(alac, AV_CODEC_ID_ALAC, NULL, | 
AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
-FFAT_ENC(ilbc, AV_CODEC_ID_ILBC, NULL)
-FFAT_ENC(pcm_alaw, AV_CODEC_ID_PCM_ALAW, NULL)
-FFAT_ENC(pcm_mulaw,AV_CODEC_ID_PCM_MULAW,NULL)
+FFAT_ENC(alac, AV_CODEC_ID_ALAC, NULL, | 
AV_CODEC_CAP_VARIABLE_FRAME_SIZE, NULL, NULL)
+FFAT_ENC(ilbc, AV_CODEC_ID_ILBC, NULL, , NULL, NULL)
+FFAT_ENC(pcm_alaw, AV_CODEC_ID_PCM_ALAW, NULL, , NULL, NULL)
+FFAT_ENC(pcm_mulaw,AV_CODEC_ID_PCM_MULAW,NULL, , NULL, NULL)

___
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] avfilter/af_sofalizer: fix getting speaker position

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 15 11:09:31 
2022 -0300| [55740299ef0ada6c91e6eee9596eb1a4a2d365af] | committer: James Almer

avfilter/af_sofalizer: fix getting speaker position

Signed-off-by: James Almer 

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

 libavfilter/af_sofalizer.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 524e6af395..f9c5fa2f2d 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -252,7 +252,7 @@ static int get_speaker_pos(AVFilterContext *ctx,
 AVChannelLayout *channel_layout = &ctx->inputs[0]->ch_layout;
 float azim[64] = { 0 };
 float elev[64] = { 0 };
-int m, ch, n_conv = ctx->inputs[0]->ch_layout.nb_channels; /* get no. 
input channels */
+int ch, n_conv = ctx->inputs[0]->ch_layout.nb_channels; /* get no. input 
channels */
 
 if (n_conv < 0 || n_conv > 64)
 return AVERROR(EINVAL);
@@ -263,8 +263,8 @@ static int get_speaker_pos(AVFilterContext *ctx,
 parse_speaker_pos(ctx);
 
 /* set speaker positions according to input channel configuration: */
-for (m = 0, ch = 0; ch < n_conv && m < 64; m++) {
-int chan = av_channel_layout_channel_from_index(channel_layout, m);
+for (ch = 0; ch < n_conv; ch++) {
+int chan = av_channel_layout_channel_from_index(channel_layout, ch);
 
 switch (chan) {
 case AV_CHAN_FRONT_LEFT:  azim[ch] =  30;  break;
@@ -303,9 +303,9 @@ static int get_speaker_pos(AVFilterContext *ctx,
 return AVERROR(EINVAL);
 }
 
-if (s->vspkrpos[m].set) {
-azim[ch] = s->vspkrpos[m].azim;
-elev[ch] = s->vspkrpos[m].elev;
+if (s->vspkrpos[ch].set) {
+azim[ch] = s->vspkrpos[ch].azim;
+elev[ch] = s->vspkrpos[ch].elev;
 }
 }
 

___
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] Bump minor versions after the channel layout changes

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 15 10:46:49 
2022 -0300| [cdba98bb80e2ab73d34659c610771b020afc6a77] | committer: James Almer

Bump minor versions after the channel layout changes

Forgotten in the respective commits adding new API.

Signed-off-by: James Almer 

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

 libavcodec/version.h| 2 +-
 libavfilter/version.h   | 2 +-
 libavformat/version.h   | 4 ++--
 libavutil/version.h | 2 +-
 libswresample/version.h | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavcodec/version.h b/libavcodec/version.h
index e8808cd3f7..10bf4a14e4 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  59
-#define LIBAVCODEC_VERSION_MINOR  23
+#define LIBAVCODEC_VERSION_MINOR  24
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 9a890c014f..95dd64d5b5 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFILTER_VERSION_MAJOR   8
-#define LIBAVFILTER_VERSION_MINOR  27
+#define LIBAVFILTER_VERSION_MINOR  28
 #define LIBAVFILTER_VERSION_MICRO 100
 
 
diff --git a/libavformat/version.h b/libavformat/version.h
index 44ea7c7c5d..6371371890 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,8 +32,8 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  59
-#define LIBAVFORMAT_VERSION_MINOR  18
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MINOR  19
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
diff --git a/libavutil/version.h b/libavutil/version.h
index f52913753d..d9d0e0564b 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  57
-#define LIBAVUTIL_VERSION_MINOR  23
+#define LIBAVUTIL_VERSION_MINOR  24
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/libswresample/version.h b/libswresample/version.h
index 61d0057cf5..e1610d 100644
--- a/libswresample/version.h
+++ b/libswresample/version.h
@@ -29,7 +29,7 @@
 #include "libavutil/version.h"
 
 #define LIBSWRESAMPLE_VERSION_MAJOR   4
-#define LIBSWRESAMPLE_VERSION_MINOR   4
+#define LIBSWRESAMPLE_VERSION_MINOR   5
 #define LIBSWRESAMPLE_VERSION_MICRO 100
 
 #define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, 
\

___
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] avfilter/af_afftdn: after sampling noise, set full parameters

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 09:44:51 
2022 +0100| [098528ec59ddfc4cf7ca7cf20a6519c03f611695] | committer: Paul B Mahol

avfilter/af_afftdn: after sampling noise, set full parameters

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

 libavfilter/af_afftdn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index 1941e55f93..b4a4b4fd65 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -1177,7 +1177,7 @@ static int output_frame(AVFilterLink *inlink, AVFrame *in)
 
 finish_sample_noise(s, dnch, sample_noise);
 set_noise_profile(s, dnch, sample_noise, 1);
-set_band_parameters(s, dnch);
+set_parameters(s, dnch, 1, 1);
 }
 s->sample_noise = 0;
 s->sample_noise_end = 0;

___
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] avfilter/af_afftdn: unbreak custom band noise option processing

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 10:28:44 
2022 +0100| [4a96baa2c8b8b2eaedd9169557cb2344f0660dd3] | committer: Paul B Mahol

avfilter/af_afftdn: unbreak custom band noise option processing

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

 libavfilter/af_afftdn.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index b4a4b4fd65..fb1e031cbf 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -564,18 +564,20 @@ static void read_custom_noise(AudioFFTDeNoiseContext *s, 
int ch)
 return;
 
 for (int i = 0; i < NB_PROFILE_BANDS; i++) {
+float noise;
+
 if (!(arg = av_strtok(p, "| ", &saveptr)))
 break;
 
 p = NULL;
 
-ret = av_sscanf(arg, "%f", &band_noise[i]);
+ret = av_sscanf(arg, "%f", &noise);
 if (ret != 1) {
 av_log(s, AV_LOG_ERROR, "Custom band noise must be float.\n");
 break;
 }
 
-band_noise[i] = av_clipd(band_noise[i], -24., 24.);
+band_noise[i] = av_clipd(noise, -24., 24.);
 }
 
 av_free(custom_noise_str);

___
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] avfilter/af_speechnorm: fix regression in channels option processing

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 15:34:57 
2022 +0100| [07c16cdd949dacbf9efa153a0748da88d63198f0] | committer: Paul B Mahol

avfilter/af_speechnorm: fix regression in channels option processing

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

 libavfilter/af_speechnorm.c | 24 +---
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/libavfilter/af_speechnorm.c b/libavfilter/af_speechnorm.c
index 0b46bec7b5..c9bd8d5cac 100644
--- a/libavfilter/af_speechnorm.c
+++ b/libavfilter/af_speechnorm.c
@@ -104,8 +104,8 @@ static const AVOption speechnorm_options[] = {
 { "r", "set the expansion raising amount", OFFSET(raise_amount), 
AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0.0, 1.0, FLAGS },
 { "fall", "set the compression raising amount", OFFSET(fall_amount), 
AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0.0, 1.0, FLAGS },
 { "f","set the compression raising amount", OFFSET(fall_amount), 
AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0.0, 1.0, FLAGS },
-{ "channels", "set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, INT64_MIN, INT64_MAX, FLAGS },
-{ "h","set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, INT64_MIN, INT64_MAX, FLAGS },
+{ "channels", "set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS },
+{ "h","set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS },
 { "invert", "set inverted filtering", OFFSET(invert), AV_OPT_TYPE_BOOL, 
{.i64=0}, 0, 1, FLAGS },
 { "i",  "set inverted filtering", OFFSET(invert), AV_OPT_TYPE_BOOL, 
{.i64=0}, 0, 1, FLAGS },
 { "link", "set linked channels filtering", OFFSET(link), AV_OPT_TYPE_BOOL, 
{.i64=0}, 0, 1, FLAGS },
@@ -462,6 +462,13 @@ static int activate(AVFilterContext *ctx)
 int ret, status;
 int64_t pts;
 
+ret = av_channel_layout_copy(&s->ch_layout, &inlink->ch_layout);
+if (ret < 0)
+return ret;
+if (strcmp(s->ch_layout_str, "all"))
+av_channel_layout_from_string(&s->ch_layout,
+  s->ch_layout_str);
+
 FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
 
 ret = filter_frame(ctx);
@@ -547,18 +554,6 @@ static int process_command(AVFilterContext *ctx, const 
char *cmd, const char *ar
 return 0;
 }
 
-static av_cold int init(AVFilterContext *ctx)
-{
-SpeechNormalizerContext *s = ctx->priv;
-int ret;
-
-if (strcmp(s->ch_layout_str, "all"))
-ret = av_channel_layout_from_string(&s->ch_layout,
-s->ch_layout_str);
-
-return ret;
-}
-
 static av_cold void uninit(AVFilterContext *ctx)
 {
 SpeechNormalizerContext *s = ctx->priv;
@@ -589,7 +584,6 @@ const AVFilter ff_af_speechnorm = {
 .priv_size   = sizeof(SpeechNormalizerContext),
 .priv_class  = &speechnorm_class,
 .activate= activate,
-.init= init,
 .uninit  = uninit,
 FILTER_INPUTS(inputs),
 FILTER_OUTPUTS(outputs),

___
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] avfilter/af_afftdn: use log10 instead to get noise levels

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 11:20:03 
2022 +0100| [26292d4b6b96fd8123774a94143b68c7d3c63448] | committer: Paul B Mahol

avfilter/af_afftdn: use log10 instead to get noise levels

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

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

diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index fb1e031cbf..f42243dd8b 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -974,7 +974,7 @@ static void finish_sample_noise(AudioFFTDeNoiseContext *s,
 dnch->noise_band_var[i] -= dnch->noise_band_avr[i] * 
dnch->noise_band_avr[i] +
dnch->noise_band_avi[i] * 
dnch->noise_band_avi[i];
 dnch->noise_band_auto_var[i] = dnch->noise_band_var[i];
-sample_noise[i] = (1.0 / C) * log(dnch->noise_band_var[i] / s->floor) 
- 100.0;
+sample_noise[i] = 10.0 * log10(dnch->noise_band_var[i] / s->floor) - 
100.0;
 }
 if (s->noise_band_count < NB_PROFILE_BANDS) {
 for (int i = s->noise_band_count; i < NB_PROFILE_BANDS; i++)
@@ -1091,7 +1091,7 @@ static void get_auto_noise_levels(AudioFFTDeNoiseContext 
*s,
 {
 if (s->noise_band_count > 0) {
 for (int i = 0; i < s->noise_band_count; i++) {
-levels[i] = (1.0 / C) * log(dnch->noise_band_auto_var[i] / 
s->floor) - 100.0;
+levels[i] = 10.0 * log10(dnch->noise_band_auto_var[i] / s->floor) 
- 100.0;
 }
 if (s->noise_band_count < NB_PROFILE_BANDS) {
 for (int i = s->noise_band_count; i < NB_PROFILE_BANDS; 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".


[FFmpeg-cvslog] avfilter/af_afftdn: refactor noise sampling

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 14:05:36 
2022 +0100| [bd5da8ad96a0fb925df656782e8f544c5ffc4a7b] | committer: Paul B Mahol

avfilter/af_afftdn: refactor noise sampling

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

 libavfilter/af_afftdn.c | 62 -
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index 0d24b4620a..b1b3402bf2 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -35,6 +35,13 @@
 #define SFM_FLAGS_SIZE (512)
 #define SFM_FLAGS_MASK (SFM_FLAGS_SIZE - 1)
 
+enum SampleNoiseModes {
+SAMPLE_NONE,
+SAMPLE_START,
+SAMPLE_STOP,
+NB_SAMPLEMODES
+};
+
 enum OutModes {
 IN_MODE,
 OUT_MODE,
@@ -124,8 +131,7 @@ typedef struct AudioFFTDeNoiseContext {
 
 int channels;
 int sample_noise;
-int sample_noise_start;
-int sample_noise_end;
+int sample_noise_mode;
 float   sample_rate;
 int buffer_length;
 int fft_length;
@@ -204,6 +210,13 @@ static const AVOption afftdn_options[] = {
 {  "average", "average",  0,   
AV_OPT_TYPE_CONST,  {.i64 = AVERAGE_LINK},  0,  0, AFR, "link" },
 { "band_multiplier", "set band multiplier",OFFSET(band_multiplier), 
AV_OPT_TYPE_FLOAT,{.dbl = 1.25},   0.2,5, AF  },
 { "bm",   "set band multiplier",   OFFSET(band_multiplier), 
AV_OPT_TYPE_FLOAT,{.dbl = 1.25},   0.2,5, AF  },
+{ "sample_noise", "set sample noise 
mode",OFFSET(sample_noise_mode),AV_OPT_TYPE_INT,{.i64 = SAMPLE_NONE},  0,  
NB_SAMPLEMODES-1, AFR, "sample" },
+{ "sn",   "set sample noise 
mode",OFFSET(sample_noise_mode),AV_OPT_TYPE_INT,{.i64 = SAMPLE_NONE},  0,  
NB_SAMPLEMODES-1, AFR, "sample" },
+{  "none","none", 0,   
AV_OPT_TYPE_CONST,  {.i64 = SAMPLE_NONE},   0,  0, AFR, "sample" },
+{  "start",   "start",0,   
AV_OPT_TYPE_CONST,  {.i64 = SAMPLE_START},  0,  0, AFR, "sample" },
+{  "begin",   "start",0,   
AV_OPT_TYPE_CONST,  {.i64 = SAMPLE_START},  0,  0, AFR, "sample" },
+{  "stop","stop", 0,   
AV_OPT_TYPE_CONST,  {.i64 = SAMPLE_STOP},   0,  0, AFR, "sample" },
+{  "end", "stop", 0,   
AV_OPT_TYPE_CONST,  {.i64 = SAMPLE_STOP},   0,  0, AFR, "sample" },
 { NULL }
 };
 
@@ -1155,13 +1168,13 @@ static int output_frame(AVFilterLink *inlink, AVFrame 
*in)
 }
 }
 
-if (s->sample_noise_start) {
+if (s->sample_noise_mode == SAMPLE_START) {
 for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) {
 DeNoiseChannel *dnch = &s->dnch[ch];
 
 init_sample_noise(dnch);
 }
-s->sample_noise_start = 0;
+s->sample_noise_mode = SAMPLE_NONE;
 s->sample_noise = 1;
 }
 
@@ -1173,7 +1186,7 @@ static int output_frame(AVFilterLink *inlink, AVFrame *in)
 }
 }
 
-if (s->sample_noise_end) {
+if (s->sample_noise_mode == SAMPLE_STOP) {
 for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) {
 DeNoiseChannel *dnch = &s->dnch[ch];
 double sample_noise[NB_PROFILE_BANDS];
@@ -1183,7 +1196,7 @@ static int output_frame(AVFilterLink *inlink, AVFrame *in)
 set_parameters(s, dnch, 1, 1);
 }
 s->sample_noise = 0;
-s->sample_noise_end = 0;
+s->sample_noise_mode = SAMPLE_NONE;
 }
 
 s->block_count++;
@@ -1297,36 +1310,23 @@ static int process_command(AVFilterContext *ctx, const 
char *cmd, const char *ar
char *res, int res_len, int flags)
 {
 AudioFFTDeNoiseContext *s = ctx->priv;
-int need_reset = 0;
 int ret = 0;
 
-if (!strcmp(cmd, "sample_noise") ||
-!strcmp(cmd, "sn")) {
-if (!strcmp(args, "start")) {
-s->sample_noise_start = 1;
-s->sample_noise_end = 0;
-} else if (!strcmp(args, "end") ||
-   !strcmp(args, "stop")) {
-s->sample_noise_start = 0;
-s->sample_noise_end = 1;
-}
-} else {
-ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
-if (ret < 0)
-return ret;
-need_reset = 1;
-}
+ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
+if (ret < 0)
+return ret;
 
-if (need_reset) {
-for (int ch = 0; ch < s->channels; ch++) {
-DeNoiseChannel *dnch = &s->dnch[ch];
+if (!strcmp(cmd, "sample_noise") || !strcmp(cmd, "sn"))
+return 0;
 
-dnch->noise_reduction = s->noise_reduction;
-dnch->noise_floor = s->noise_floor;
-dnch->residual_floor  = s->residual_floor;
+for (int ch

[FFmpeg-cvslog] avfilter/af_afftdn: do not hardcode vector size

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 13:15:07 
2022 +0100| [a2eb13c7e51bc98732de5e37412808045e86f1d9] | committer: Paul B Mahol

avfilter/af_afftdn: do not hardcode vector size

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

 libavfilter/af_afftdn.c | 35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index f42243dd8b..0d24b4620a 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -30,6 +30,7 @@
 #include "filters.h"
 
 #define C   (M_LN10 * 0.1)
+#define SOLVE_SIZE (5)
 #define NB_PROFILE_BANDS (15)
 #define SFM_FLAGS_SIZE (512)
 #define SFM_FLAGS_MASK (SFM_FLAGS_SIZE - 1)
@@ -152,10 +153,10 @@ typedef struct AudioFFTDeNoiseContext {
 
 int noise_band_edge[NB_PROFILE_BANDS + 2];
 int noise_band_count;
-double  matrix_a[25];
-double  vector_b[5];
-double  matrix_b[5 * NB_PROFILE_BANDS];
-double  matrix_c[5 * NB_PROFILE_BANDS];
+double  matrix_a[SOLVE_SIZE * SOLVE_SIZE];
+double  vector_b[SOLVE_SIZE];
+double  matrix_b[SOLVE_SIZE * NB_PROFILE_BANDS];
+double  matrix_c[SOLVE_SIZE * NB_PROFILE_BANDS];
 } AudioFFTDeNoiseContext;
 
 #define OFFSET(x) offsetof(AudioFFTDeNoiseContext, x)
@@ -267,19 +268,19 @@ static double 
process_get_band_noise(AudioFFTDeNoiseContext *s,
 if (band < NB_PROFILE_BANDS)
 return dnch->band_noise[band];
 
-for (int j = 0; j < 5; j++) {
+for (int j = 0; j < SOLVE_SIZE; j++) {
 sum = 0.0;
 for (int k = 0; k < NB_PROFILE_BANDS; k++)
 sum += s->matrix_b[i++] * dnch->band_noise[k];
 s->vector_b[j] = sum;
 }
 
-solve(s->matrix_a, s->vector_b, 5);
+solve(s->matrix_a, s->vector_b, SOLVE_SIZE);
 f = (0.5 * s->sample_rate) / s->band_centre[NB_PROFILE_BANDS-1];
 f = 15.0 + log(f / 1.5) / log(1.5);
 sum = 0.0;
 product = 1.0;
-for (int j = 0; j < 5; j++) {
+for (int j = 0; j < SOLVE_SIZE; j++) {
 sum += product * s->vector_b[j];
 product *= f;
 }
@@ -670,24 +671,24 @@ static int config_input(AVFilterLink *inlink)
 }
 }
 
-for (j = 0; j < 5; j++) {
-for (k = 0; k < 5; k++) {
-s->matrix_a[j + k * 5] = 0.0;
+for (j = 0; j < SOLVE_SIZE; j++) {
+for (k = 0; k < SOLVE_SIZE; k++) {
+s->matrix_a[j + k * SOLVE_SIZE] = 0.0;
 for (m = 0; m < NB_PROFILE_BANDS; m++)
-s->matrix_a[j + k * 5] += pow(m, j + k);
+s->matrix_a[j + k * SOLVE_SIZE] += pow(m, j + k);
 }
 }
 
-factor(s->matrix_a, 5);
+factor(s->matrix_a, SOLVE_SIZE);
 
 i = 0;
-for (j = 0; j < 5; j++)
+for (j = 0; j < SOLVE_SIZE; j++)
 for (k = 0; k < NB_PROFILE_BANDS; k++)
 s->matrix_b[i++] = pow(k, j);
 
 i = 0;
 for (j = 0; j < NB_PROFILE_BANDS; j++)
-for (k = 0; k < 5; k++)
+for (k = 0; k < SOLVE_SIZE; k++)
 s->matrix_c[i++] = pow(j, k);
 
 s->window = av_calloc(s->window_length, sizeof(*s->window));
@@ -997,17 +998,17 @@ static void set_noise_profile(AudioFFTDeNoiseContext *s,
 temp[m] = sample_noise[m];
 
 if (new_profile) {
-for (int m = 0; m < 5; m++) {
+for (int m = 0; m < SOLVE_SIZE; m++) {
 sum = 0.0;
 for (n = 0; n < NB_PROFILE_BANDS; n++)
 sum += s->matrix_b[i++] * temp[n];
 s->vector_b[m] = sum;
 }
-solve(s->matrix_a, s->vector_b, 5);
+solve(s->matrix_a, s->vector_b, SOLVE_SIZE);
 i = 0;
 for (int m = 0; m < NB_PROFILE_BANDS; m++) {
 sum = 0.0;
-for (n = 0; n < 5; n++)
+for (n = 0; n < SOLVE_SIZE; n++)
 sum += s->matrix_c[i++] * s->vector_b[n];
 temp[m] = sum;
 }

___
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] avfilter/af_dynaudnorm: fix regression with channels option processing

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 15:40:00 
2022 +0100| [9f81d12f87ef024b8ff7ce9c5eed4a6c211d62db] | committer: Paul B Mahol

avfilter/af_dynaudnorm: fix regression with channels option processing

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

 libavfilter/af_dynaudnorm.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index b46420d291..4fe1a9ce1b 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -129,17 +129,13 @@ AVFILTER_DEFINE_CLASS(dynaudnorm);
 static av_cold int init(AVFilterContext *ctx)
 {
 DynamicAudioNormalizerContext *s = ctx->priv;
-int ret = 0;
 
 if (!(s->filter_size & 1)) {
 av_log(ctx, AV_LOG_WARNING, "filter size %d is invalid. Changing to an 
odd value.\n", s->filter_size);
 s->filter_size |= 1;
 }
 
-if (strcmp(s->channels_to_filter, "all"))
-ret = av_channel_layout_from_string(&s->ch_layout, 
s->channels_to_filter);
-
-return ret;
+return 0;
 }
 
 static inline int frame_size(int sample_rate, int frame_len_msec)
@@ -852,6 +848,12 @@ static int activate(AVFilterContext *ctx)
 int ret = 0, status;
 int64_t pts;
 
+ret = av_channel_layout_copy(&s->ch_layout, &inlink->ch_layout);
+if (ret < 0)
+return ret;
+if (strcmp(s->channels_to_filter, "all"))
+av_channel_layout_from_string(&s->ch_layout, s->channels_to_filter);
+
 FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
 
 if (!s->eof) {

___
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] avfilter/af_biquads: fix regression with channels option processing

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 16:06:03 
2022 +0100| [5b59c072f503a448c7988d27e6e60ee8cf8cdf6d] | committer: Paul B Mahol

avfilter/af_biquads: fix regression with channels option processing

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

 libavfilter/af_biquads.c | 53 +---
 1 file changed, 28 insertions(+), 25 deletions(-)

diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 848d410b4d..9a3126c650 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -869,11 +869,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*buf)
 AVFilterLink *outlink = ctx->outputs[0];
 AVFrame *out_buf;
 ThreadData td;
-int ch;
+int ch, ret;
 
 if (s->bypass)
 return ff_filter_frame(outlink, buf);
 
+ret = av_channel_layout_copy(&s->ch_layout, &inlink->ch_layout);
+if (ret < 0)
+return ret;
+if (strcmp(s->ch_layout_str, "all"))
+av_channel_layout_from_string(&s->ch_layout,
+  s->ch_layout_str);
+
 if (av_frame_is_writable(buf)) {
 out_buf = buf;
 } else {
@@ -948,15 +955,11 @@ static const AVFilterPad outputs[] = {
 static av_cold int name_##_init(AVFilterContext *ctx)   \
 {   \
 BiquadsContext *s = ctx->priv;  \
-int ret;\
 s->filter_type = name_; \
-if (strcmp(s->ch_layout_str, "all"))\
-ret = av_channel_layout_from_string(&s->ch_layout,  \
-s->ch_layout_str);  \
-return ret; \
+return 0;   \
 }   \
  \
-const AVFilter ff_af_##name_ = {   \
+const AVFilter ff_af_##name_ = { \
 .name  = #name_, \
 .description   = NULL_IF_CONFIG_SMALL(description_), \
 .priv_class= &priv_class_##_class,   \
@@ -991,8 +994,8 @@ static const AVOption equalizer_options[] = {
 {"g","set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 
900, FLAGS},
 {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
 {"m",   "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
-{"channels", "set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, INT64_MIN, INT64_MAX, FLAGS},
-{"c","set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, INT64_MIN, INT64_MAX, FLAGS},
+{"channels", "set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS},
+{"c","set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS},
 {"normalize", "normalize coefficients", OFFSET(normalize), 
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
 {"n", "normalize coefficients", OFFSET(normalize), 
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
 {"transform", "set transform type", OFFSET(transform_type), 
AV_OPT_TYPE_INT, {.i64=0}, 0, NB_TTYPE-1, AF, "transform_type"},
@@ -1033,8 +1036,8 @@ static const AVOption bass_lowshelf_options[] = {
 {"p", "set number of poles", OFFSET(poles), AV_OPT_TYPE_INT, {.i64=2}, 
1, 2, AF},
 {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
 {"m",   "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
-{"channels", "set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, INT64_MIN, INT64_MAX, FLAGS},
-{"c","set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, INT64_MIN, INT64_MAX, FLAGS},
+{"channels", "set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS},
+{"c","set channels to filter", OFFSET(ch_layout_str), 
AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS},
 {"normalize", "normalize coefficients", OFFSET(normalize), 
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
 {"n", "normalize coefficients", OFFSET(normalize), 
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
 {"transform", "set transform type", OFFSET(transform_type), 
AV_OPT_TYPE_INT, {.i64=0}, 0, NB_TTYPE-1, AF, "transform_type"},
@@ -1082,8 +1085,8 @@ static const AVOption treble_highshelf_options[] = {
 {"p", "set number of poles", OFFSET(poles), AV_OPT_TYPE_INT, {.i64=2}, 
1, 2, AF},
 {"mix", "set mix", 

[FFmpeg-cvslog] avutil/channel_layout: Fix leak of string

2022-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Tue Mar 15 15:44:53 2022 +0100| [9e241bdffd310711c48799cb7a919df61488432c] | 
committer: Andreas Rheinhardt

avutil/channel_layout: Fix leak of string

Fixes memleaks in the channel_layout FATE-test.

Reviewed-by: James Almer 
Signed-off-by: Andreas Rheinhardt 

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

 libavutil/channel_layout.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index 05ed35c078..8cc4efe4cf 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -587,6 +587,7 @@ int av_channel_layout_from_string(AVChannelLayout 
*channel_layout,
 av_free(channel);
 av_free(chname);
 }
+av_free(chlist);
 
 return 0;
 }

___
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] avfilter/af_join: Don't use memcpy for overlapping regions

2022-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Tue Mar 15 15:58:35 2022 +0100| [ac7dc20a5d7b7b9174d4aeadc06b73583fa7c3a4] | 
committer: Andreas Rheinhardt

avfilter/af_join: Don't use memcpy for overlapping regions

Reported by ASAN as memcpy-param-overlap when running
the filter-join FATE-test.

Reviewed-by: Paul B Mahol 
Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
index 3e272d9161..6f01c6f70a 100644
--- a/libavfilter/af_join.c
+++ b/libavfilter/af_join.c
@@ -252,8 +252,8 @@ typedef struct ChannelList {
 static enum AVChannel channel_list_pop(ChannelList *chl, int idx)
 {
 enum AVChannel ret = chl->ch[idx];
-memcpy(chl->ch + idx, chl->ch + idx + 1,
-   (chl->nb_ch - idx - 1) * sizeof(*chl->ch));
+memmove(chl->ch + idx, chl->ch + idx + 1,
+(chl->nb_ch - idx - 1) * sizeof(*chl->ch));
 chl->nb_ch--;
 return ret;
 }

___
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] avfilter/af_biquads: fix possible leak on error

2022-03-15 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 15 16:21:18 
2022 +0100| [93a076db70b4addf3b1924fb6fc98343035564cb] | committer: Paul B Mahol

avfilter/af_biquads: fix possible leak on error

Recently introduced.

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

 libavfilter/af_biquads.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 9a3126c650..a1fe1ec72a 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -875,8 +875,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
 return ff_filter_frame(outlink, buf);
 
 ret = av_channel_layout_copy(&s->ch_layout, &inlink->ch_layout);
-if (ret < 0)
+if (ret < 0) {
+av_frame_free(&buf);
 return ret;
+}
 if (strcmp(s->ch_layout_str, "all"))
 av_channel_layout_from_string(&s->ch_layout,
   s->ch_layout_str);

___
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/codec_par: do not copy AVChannelLayout struct directly

2022-03-15 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Tue Mar 15 15:21:14 
2022 +0100| [ef2b3efd5153568989324f01de41ca19bf3afda1] | committer: Marton 
Balint

avcodec/codec_par: do not copy AVChannelLayout struct directly

Later we use av_channel_layout_copy, but that uninits the struct
unintentionally freeing the possibly allocated u.map pointer.

Signed-off-by: Marton Balint 

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

 libavcodec/codec_par.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/codec_par.c b/libavcodec/codec_par.c
index e4b329c838..abda649aa8 100644
--- a/libavcodec/codec_par.c
+++ b/libavcodec/codec_par.c
@@ -78,6 +78,7 @@ int avcodec_parameters_copy(AVCodecParameters *dst, const 
AVCodecParameters *src
 codec_parameters_reset(dst);
 memcpy(dst, src, sizeof(*dst));
 
+dst->ch_layout  = (AVChannelLayout){0};
 dst->extradata  = NULL;
 dst->extradata_size = 0;
 if (src->extradata) {

___
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] avfilter/buffersink: simplify parsing the input channel layout string

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 15 14:18:24 
2022 -0300| [f5d67469b0e15402a6323e2e657572db8d17f8fe] | committer: James Almer

avfilter/buffersink: simplify parsing the input channel layout string

And remove a stray comma in the list of supported separators.

Signed-off-by: James Almer 

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

 libavfilter/buffersink.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index b989473719..e269cf72d1 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -330,24 +330,22 @@ static int asink_query_formats(AVFilterContext *ctx)
"Conflicting ch_layouts and list of 
channel_counts/channel_layouts. Ignoring the former\n");
 else
 #endif
-while (cur && *cur) {
-char *chl = av_get_token(&cur, "|,");
-if (!chl)
-return AVERROR(ENOMEM);
-if (*cur)
-cur++;
-
-ret = av_channel_layout_from_string(&layout, chl);
+while (cur) {
+char *next = strchr(cur, '|');
+if (next)
+*next++ = 0;
+
+ret = av_channel_layout_from_string(&layout, cur);
 if (ret < 0) {
-av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout: 
%s.\n", chl);
-av_free(chl);
+av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout: 
%s.\n", cur);
 return ret;
 }
 ret = ff_add_channel_layout(&layouts, &layout);
 av_channel_layout_uninit(&layout);
-av_free(chl);
 if (ret < 0)
 return ret;
+
+cur = next;
 }
 }
 

___
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/hevc_refs: don't use the frame's AVBufferRef sizes when initializing planes

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar  8 10:55:00 
2022 -0300| [3a1597abd6c12308fbc2f4087d7c943166df] | committer: James Almer

avcodec/hevc_refs: don't use the frame's AVBufferRef sizes when initializing 
planes

Use the actual plane sizes instead.

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

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

 libavcodec/hevc_refs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index 35b8e5e696..fe18ca2b1d 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -401,9 +401,9 @@ static HEVCFrame *generate_missing_ref(HEVCContext *s, int 
poc)
 
 if (!s->avctx->hwaccel) {
 if (!s->ps.sps->pixel_shift) {
-for (i = 0; frame->frame->buf[i]; i++)
-memset(frame->frame->buf[i]->data, 1 << (s->ps.sps->bit_depth 
- 1),
-   frame->frame->buf[i]->size);
+for (i = 0; frame->frame->data[i]; i++)
+memset(frame->frame->data[i], 1 << (s->ps.sps->bit_depth - 1),
+   frame->frame->linesize[i] * 
AV_CEIL_RSHIFT(s->ps.sps->height, s->ps.sps->vshift[i]));
 } else {
 for (i = 0; frame->frame->data[i]; i++)
 for (y = 0; y < (s->ps.sps->height >> s->ps.sps->vshift[i]); 
y++) {

___
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] tests: Add fate-bsf-dv-error-marker

2022-03-15 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Mar 15 19:30:03 2022 +0100| [bf5099b12be3a82094580219fdf367dbe2a70d27] | 
committer: Michael Niedermayer

tests: Add fate-bsf-dv-error-marker

Signed-off-by: Michael Niedermayer 

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

 tests/Makefile | 1 +
 tests/fate/dvvideo.mak | 8 
 2 files changed, 9 insertions(+)

diff --git a/tests/Makefile b/tests/Makefile
index c4c31ae871..9f33394856 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -133,6 +133,7 @@ include $(SRC_PATH)/tests/fate/dfa.mak
 include $(SRC_PATH)/tests/fate/dnn.mak
 include $(SRC_PATH)/tests/fate/dnxhd.mak
 include $(SRC_PATH)/tests/fate/dpcm.mak
+include $(SRC_PATH)/tests/fate/dvvideo.mak
 include $(SRC_PATH)/tests/fate/ea.mak
 include $(SRC_PATH)/tests/fate/exif.mak
 include $(SRC_PATH)/tests/fate/ffmpeg.mak
diff --git a/tests/fate/dvvideo.mak b/tests/fate/dvvideo.mak
new file mode 100644
index 00..24e50ca357
--- /dev/null
+++ b/tests/fate/dvvideo.mak
@@ -0,0 +1,8 @@
+
+fate-bsf-dv-error-marker: CMD = md5 -i 
$(TARGET_SAMPLES)/dv/dvcprohd_720p50.mov -flags +bitexact -fflags +bitexact 
-c:v copy -bsf noise=100,dv_error_marker=color=blue -f avi
+fate-bsf-dv-error-marker: CMP = oneline
+fate-bsf-dv-error-marker: REF = 4e884d3e8045299d0d45ec920fa58a44
+FATE_DVVIDEO-$(call ALLYES, MOV_DEMUXER DV_ERROR_MARKER_BSF NOISE_BSF 
AVI_MUXER) += fate-bsf-dv-error-marker
+
+FATE_SAMPLES_FFMPEG += $(FATE_DVVIDEO-yes)
+fate-dvvideo: $(FATE_DVVIDEO-yes)

___
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] avutil/channel_layout: print channels using av_channel_name_bprint in av_channel_layout_describe_bprint

2022-03-15 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Tue Mar 15 20:43:50 
2022 +0100| [bd40375dd2573aa5ed08294957b6d2864b4dd250] | committer: Marton 
Balint

avutil/channel_layout: print channels using av_channel_name_bprint in 
av_channel_layout_describe_bprint

This reduces code duplication an allows printing AMBI%d channel names for
custom layouts for non-standard or partial ambisonic layouts.

Signed-off-by: Marton Balint 

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

 libavutil/channel_layout.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index 8cc4efe4cf..c60ccf368f 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -737,14 +737,10 @@ int av_channel_layout_describe_bprint(const 
AVChannelLayout *channel_layout,
 av_bprintf(bp, "%d channels (", channel_layout->nb_channels);
 for (i = 0; i < channel_layout->nb_channels; i++) {
 enum AVChannel ch = 
av_channel_layout_channel_from_index(channel_layout, i);
-const char *channel = get_channel_name(ch);
 
 if (i)
 av_bprintf(bp, "+");
-if (channel)
-av_bprintf(bp, "%s", channel);
-else
-av_bprintf(bp, "USR%d", ch);
+av_channel_name_bprint(bp, ch);
 if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM &&
 channel_layout->u.map[i].name[0])
 av_bprintf(bp, "@%s", channel_layout->u.map[i].name);

___
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] avutil/channel_layout: factorize ambisonic order detection

2022-03-15 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Tue Mar 15 20:16:31 
2022 +0100| [580f7b6c3ac4ee196c7a78641fe65da7a68b6971] | committer: Marton 
Balint

avutil/channel_layout: factorize ambisonic order detection

Signed-off-by: Marton Balint 

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

 libavutil/channel_layout.c | 39 +--
 1 file changed, 29 insertions(+), 10 deletions(-)

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index c60ccf368f..c61d612fd8 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 
+#include "avassert.h"
 #include "channel_layout.h"
 #include "bprint.h"
 #include "common.h"
@@ -644,11 +645,11 @@ int av_channel_layout_copy(AVChannelLayout *dst, const 
AVChannelLayout *src)
 }
 
 /**
- * If the custom layout is n-th order standard-order ambisonic, with optional
- * extra non-diegetic channels at the end, write its string description in bp.
- * Return a negative error code on error.
+ * If the layout is n-th order standard-order ambisonic, with optional
+ * extra non-diegetic channels at the end, return the order.
+ * Return a negative error code otherwise.
  */
-static int try_describe_ambisonic(AVBPrint *bp, const AVChannelLayout 
*channel_layout)
+static int ambisonic_order(const AVChannelLayout *channel_layout)
 {
 int i, highest_ambi, order;
 
@@ -657,16 +658,18 @@ static int try_describe_ambisonic(AVBPrint *bp, const 
AVChannelLayout *channel_l
 highest_ambi = channel_layout->nb_channels - 
av_popcount64(channel_layout->u.mask) - 1;
 else {
 const AVChannelCustom *map = channel_layout->u.map;
+av_assert0(channel_layout->order == AV_CHANNEL_ORDER_CUSTOM);
+
 for (i = 0; i < channel_layout->nb_channels; i++) {
 int is_ambi = CHAN_IS_AMBI(map[i].id);
 
 /* ambisonic following non-ambisonic */
 if (i > 0 && is_ambi && !CHAN_IS_AMBI(map[i - 1].id))
-return 0;
+return AVERROR(EINVAL);
 
 /* non-default ordering */
 if (is_ambi && map[i].id - AV_CHAN_AMBISONIC_BASE != i)
-return 0;
+return AVERROR(EINVAL);
 
 if (CHAN_IS_AMBI(map[i].id))
 highest_ambi = i;
@@ -674,17 +677,33 @@ static int try_describe_ambisonic(AVBPrint *bp, const 
AVChannelLayout *channel_l
 }
 /* no ambisonic channels*/
 if (highest_ambi < 0)
-return 0;
+return AVERROR(EINVAL);
 
 order = floor(sqrt(highest_ambi));
 /* incomplete order - some harmonics are missing */
 if ((order + 1) * (order + 1) != highest_ambi + 1)
+return AVERROR(EINVAL);
+
+return order;
+}
+
+/**
+ * If the custom layout is n-th order standard-order ambisonic, with optional
+ * extra non-diegetic channels at the end, write its string description in bp.
+ * Return a negative error code on error.
+ */
+static int try_describe_ambisonic(AVBPrint *bp, const AVChannelLayout 
*channel_layout)
+{
+int nb_ambi_channels;
+int order = ambisonic_order(channel_layout);
+if (order < 0)
 return 0;
 
 av_bprintf(bp, "ambisonic %d", order);
 
 /* extra channels present */
-if (highest_ambi < channel_layout->nb_channels - 1) {
+nb_ambi_channels = (order + 1) * (order + 1);
+if (nb_ambi_channels < channel_layout->nb_channels) {
 AVChannelLayout extra = { 0 };
 char buf[128];
 
@@ -696,12 +715,12 @@ static int try_describe_ambisonic(AVBPrint *bp, const 
AVChannelLayout *channel_l
 const AVChannelCustom *map = channel_layout->u.map;
 
 extra.order   = AV_CHANNEL_ORDER_CUSTOM;
-extra.nb_channels = channel_layout->nb_channels - highest_ambi - 1;
+extra.nb_channels = channel_layout->nb_channels - nb_ambi_channels;
 extra.u.map   = av_calloc(extra.nb_channels, 
sizeof(*extra.u.map));
 if (!extra.u.map)
 return AVERROR(ENOMEM);
 
-memcpy(extra.u.map, &map[highest_ambi + 1],
+memcpy(extra.u.map, &map[nb_ambi_channels],
sizeof(*extra.u.map) * extra.nb_channels);
 }
 

___
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] avutil/channel_layout: do not copy alloc new map for extra channel layout

2022-03-15 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Tue Mar 15 20:55:53 
2022 +0100| [ab7a929684c64182488b38312e3111ac53553efd] | committer: Marton 
Balint

avutil/channel_layout: do not copy alloc new map for extra channel layout

Also use av_channel_layout_bprint directly for describing channel layout for
extra channels.

Signed-off-by: Marton Balint 

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

 libavutil/channel_layout.c | 17 -
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index f107a2dbd8..3615a34d27 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -705,29 +705,20 @@ static int try_describe_ambisonic(AVBPrint *bp, const 
AVChannelLayout *channel_l
 nb_ambi_channels = (order + 1) * (order + 1);
 if (nb_ambi_channels < channel_layout->nb_channels) {
 AVChannelLayout extra = { 0 };
-char buf[128];
 
 if (channel_layout->order == AV_CHANNEL_ORDER_AMBISONIC) {
 extra.order   = AV_CHANNEL_ORDER_NATIVE;
 extra.nb_channels = av_popcount64(channel_layout->u.mask);
 extra.u.mask  = channel_layout->u.mask;
 } else {
-const AVChannelCustom *map = channel_layout->u.map;
-
 extra.order   = AV_CHANNEL_ORDER_CUSTOM;
 extra.nb_channels = channel_layout->nb_channels - nb_ambi_channels;
-extra.u.map   = av_calloc(extra.nb_channels, 
sizeof(*extra.u.map));
-if (!extra.u.map)
-return AVERROR(ENOMEM);
-
-memcpy(extra.u.map, &map[nb_ambi_channels],
-   sizeof(*extra.u.map) * extra.nb_channels);
+extra.u.map   = channel_layout->u.map + nb_ambi_channels;
 }
 
-av_channel_layout_describe(&extra, buf, sizeof(buf));
-av_channel_layout_uninit(&extra);
-
-av_bprintf(bp, "+%s", buf);
+av_bprint_chars(bp, '+', 1);
+av_channel_layout_describe_bprint(&extra, bp);
+/* Not calling uninit here on extra because we don't own the u.map 
pointer */
 }
 
 return 0;

___
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] avutil/channel_layout: fix av_channel_layout_describe_bprint with custom and ambisonic channels

2022-03-15 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Tue Mar 15 20:31:45 
2022 +0100| [92f27c6728fe08c36b3e09cc64421b8c7388634b] | committer: Marton 
Balint

avutil/channel_layout: fix av_channel_layout_describe_bprint with custom and 
ambisonic channels

bp->len cannot be used to detect if try_describe_ambisonic was successful
because the bprint buffer might contain other data as well.

Also describing an invalid ambisonic layout should not return 0 but
AVERROR(EINVAL) instead, so change try_describe_ambisonic to actually return
error on invalid ambisonics. This also allows us to fix the first issue.

Signed-off-by: Marton Balint 

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

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

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index c61d612fd8..f107a2dbd8 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -690,14 +690,14 @@ static int ambisonic_order(const AVChannelLayout 
*channel_layout)
 /**
  * If the custom layout is n-th order standard-order ambisonic, with optional
  * extra non-diegetic channels at the end, write its string description in bp.
- * Return a negative error code on error.
+ * Return a negative error code otherwise.
  */
 static int try_describe_ambisonic(AVBPrint *bp, const AVChannelLayout 
*channel_layout)
 {
 int nb_ambi_channels;
 int order = ambisonic_order(channel_layout);
 if (order < 0)
-return 0;
+return order;
 
 av_bprintf(bp, "ambisonic %d", order);
 
@@ -749,8 +749,8 @@ int av_channel_layout_describe_bprint(const AVChannelLayout 
*channel_layout,
 case AV_CHANNEL_ORDER_CUSTOM:
 if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM) {
 int res = try_describe_ambisonic(bp, channel_layout);
-if (res < 0 || bp->len)
-return res;
+if (res >= 0)
+return 0;
 }
 if (channel_layout->nb_channels)
 av_bprintf(bp, "%d channels (", channel_layout->nb_channels);

___
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] tools/target_dec_fuzzer: Fix build failure from channels API

2022-03-15 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Mar 15 23:34:44 2022 +0100| [9805a0004cbfc487934a7792ffe21b329336dc5c] | 
committer: James Almer

tools/target_dec_fuzzer: Fix build failure from channels API

Regression since 2f8ccca2fa94ce256ff77baa18f462c1abd8d2cc and surrounding 
commits

Signed-off-by: Michael Niedermayer 
Signed-off-by: James Almer 

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

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

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index eaa26b0e62..3bd1eff3ce 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -47,6 +47,7 @@
 
 #include "config.h"
 #include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
 #include "libavutil/cpu.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
@@ -273,7 +274,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 extradata_size = bytestream2_get_le32(&gbc);
 
 ctx->sample_rate= bytestream2_get_le32(&gbc) & 
0x7FFF;
-ctx->ch_layout.channels = 
(unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
+ctx->ch_layout.nb_channels  = 
(unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
 ctx->block_align= bytestream2_get_le32(&gbc) & 
0x7FFF;
 ctx->codec_tag  = bytestream2_get_le32(&gbc);
 if (c->codec_tags) {

___
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] avutil/channel_layout: remove duplicate stereo downmix entry

2022-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 15 22:54:41 
2022 -0300| [f2fe17c56d33bfc5bd04d804603036a4f935b69b] | committer: James Almer

avutil/channel_layout: remove duplicate stereo downmix entry

Signed-off-by: James Almer 

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

 libavutil/channel_layout.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index 3615a34d27..bc1c841ad8 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -169,7 +169,6 @@ struct channel_layout_name {
 static const struct channel_layout_name channel_layout_map[] = {
 { "mono",   AV_CHANNEL_LAYOUT_MONO},
 { "stereo", AV_CHANNEL_LAYOUT_STEREO  },
-{ "stereo", AV_CHANNEL_LAYOUT_STEREO_DOWNMIX  },
 { "2.1",AV_CHANNEL_LAYOUT_2POINT1 },
 { "3.0",AV_CHANNEL_LAYOUT_SURROUND},
 { "3.0(back)",  AV_CHANNEL_LAYOUT_2_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".