Re: [FFmpeg-devel] [PATCH v2] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread Carl Eugen Hoyos


> Am 07.11.2019 um 02:23 schrieb lance.lmw...@gmail.com:
> 
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
> libavformat/wavdec.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
> index 52194f54ef..109c931a22 100644
> --- a/libavformat/wavdec.c
> +++ b/libavformat/wavdec.c
> @@ -149,7 +149,8 @@ static int wav_probe(const AVProbeData *p)
> 
> static void handle_stream_probing(AVStream *st)
> {
> -if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE) {
> +if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE &&
> +st->codecpar->sample_rate <= 0 && st->codecpar->channels <= 0) {

Doesn’t this break dca detection?

As said, you have to fix this issue in the mp3 probe function.

> st->request_probe = AVPROBE_SCORE_EXTENSION;
> st->probe_packets = FFMIN(st->probe_packets, 32);

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

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

Re: [FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread Limin Wang
On Wed, Nov 06, 2019 at 08:21:56PM +0100, Carl Eugen Hoyos wrote:
> Am Mi., 6. Nov. 2019 um 12:21 Uhr schrieb Limin Wang :
> >
> > On Wed, Nov 06, 2019 at 11:18:10AM +0100, Carl Eugen Hoyos wrote:
> > > Am Mi., 6. Nov. 2019 um 10:01 Uhr schrieb :
> > > >
> > > > From: Limin Wang 
> > > >
> > > > Signed-off-by: Limin Wang 
> > > > ---
> > > >  libavformat/utils.c | 3 +--
> > > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > >
> > > > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > > > index 8196442dd1..8381498e2b 100644
> > > > --- a/libavformat/utils.c
> > > > +++ b/libavformat/utils.c
> > > > @@ -367,8 +367,7 @@ static int 
> > > > set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
> > > > fmt->name, score);
> > > >  for (i = 0; fmt_id_type[i].name; i++) {
> > > >  if (!strcmp(fmt->name, fmt_id_type[i].name)) {
> > > > -if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> > > > -st->codecpar->sample_rate)
> > > > +if (st->codecpar->sample_rate)
> > > >  continue;
> > >
> > > I believe the correct fix is to change the mp3 probe function so that it
> > > does not return a score of 51 for the pcm pattern of ff ff e8 ff ff ff e8 
> > > ff...
> >
> > It has been detected as pcm
> 
> There is no pcm detection in FFmpeg (it is hard iiuc), and the content
> does not get detected as pcm but mp3 / mp1.
It's detected as wav and get the pcm codec, but if it's AV_CODEC_ID_PCM_S16LE, 
it'll request
probe again, see my updated patch. I add a checking to prove it.

> 
> > and have get the valid audio sample rate, why we detect it
> > again here?
> 
> How else can you rule out dca audio?

got it, haven't used dca audio before.

> 
> > I have run fate testing with the patch and haven't find any broken 
> > condition.
> 
> fate cannot test for all possible code paths.


> 
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH v2] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavformat/wavdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 52194f54ef..109c931a22 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -149,7 +149,8 @@ static int wav_probe(const AVProbeData *p)
 
 static void handle_stream_probing(AVStream *st)
 {
-if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE) {
+if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE &&
+st->codecpar->sample_rate <= 0 && st->codecpar->channels <= 0) {
 st->request_probe = AVPROBE_SCORE_EXTENSION;
 st->probe_packets = FFMIN(st->probe_packets, 32);
 }
-- 
2.21.0

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

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

Re: [FFmpeg-devel] [PATCH 1/2] configure: select missing rdft for several filters

2019-11-06 Thread Lou Logan
On Wed, Nov 6, 2019, at 3:37 PM, Carl Eugen Hoyos wrote:
>
> You could add the additional information to the commit messages...

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

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

Re: [FFmpeg-devel] [PATCH 1/2] configure: select missing rdft for several filters

2019-11-06 Thread Carl Eugen Hoyos
Am Mi., 6. Nov. 2019 um 20:52 Uhr schrieb Lou Logan :
>
> afir, sinc, superequalizer, surround
>
> Signed-off-by: Lou Logan 

You could add the additional information to the commit messages...

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

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

[FFmpeg-devel] [PATCH] avcodec/libvpxdec.c,cosmetics: bpp -> bpc

2019-11-06 Thread James Zern
Signed-off-by: James Zern 
---
 libavcodec/libvpxdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 1ae2361167..1063c546b0 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -288,7 +288,7 @@ static int vpx_decode(AVCodecContext *avctx,
  img->d_h != img_alpha->d_h ||
  img->bit_depth != img_alpha->bit_depth)) {
 av_log(avctx, AV_LOG_ERROR,
-   "Video dimensions %dx%d@%dbpp differ from alpha dimensions 
%dx%d@%dbpp\n",
+   "Video dimensions %dx%d@%dbpc differ from alpha dimensions 
%dx%d@%dbpc\n",
img->d_w, img->d_h, img->bit_depth,
img_alpha->d_w, img_alpha->d_h, img_alpha->bit_depth);
 return AVERROR_INVALIDDATA;
-- 
2.24.0.432.g9d3f5f5b63-goog

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

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

Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec/libvpxdec: reject video and alpha dimension mismatches

2019-11-06 Thread James Zern
On Wed, Nov 6, 2019 at 2:21 AM Carl Eugen Hoyos  wrote:
>
> Am Mi., 6. Nov. 2019 um 08:28 Uhr schrieb Marton Balint :
> > [...]
> > +if (ctx->has_alpha_channel &&
> > +(img->d_w != img_alpha->d_w ||
> > + img->d_h != img_alpha->d_h ||
> > + img->bit_depth != img_alpha->bit_depth)) {
> > +av_log(avctx, AV_LOG_ERROR,
> > +   "Video dimensions %dx%d@%dbpp differ from alpha 
> > dimensions %dx%d@%dbpp\n",
> > +   img->d_w, img->d_h, img->bit_depth,
> > +   img_alpha->d_w, img_alpha->d_h, img_alpha->bit_depth);
> > +return AVERROR_INVALIDDATA;
>
> Shouldn't this be "bpc" instead of "bpp"?
>

I tend to use them interchangeably, but bpc may be more precise here.
I sent a patch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] Reimbursement request

2019-11-06 Thread Tomas Härdin
tis 2019-10-29 klockan 16:34 +0800 skrev Steven Liu:
> Hi,
> I'm requesting the reimbursement of travel expenses for the Google
> Mentor Summit.
> I mentored the Derain project, more details can be found in [1].
> 
> 
> Flight  (CNY) ¥ 7062.00
> One night hotel (CNY) ¥ 632.00
> 
> Total   (CNY)  ¥  7694.00
> Total   (USD)  ≈$  1089.54
> 
> CNY to USD conversion done according to the UnionPay Banks [2]
> on 29st Oct (1 USD = 7.0617 CNY).
> 
> [1] - 
> https://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2019/Results
> [2] - http://www.safe.gov.cn/safe/rmbhlzjj/index.html

Sounds OK to me, assuming there's receipts and all that. Don't know
what Paul is on about..

/Tomas

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

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

Re: [FFmpeg-devel] Add support to a PCM audio codec (Win)

2019-11-06 Thread Tomas Härdin
tis 2019-11-05 klockan 20:45 +0100 skrev cumdacon:
> Hi to all dev!
> 
> FFmpeg on Windows32;
> request of full audio codec support
> pcm_s16be
> into a container MP4.
> 
> LOG:
> [mp4 @ 00a5f840] Could not find tag for codec pcm_s16be in stream #1,
> codec not currently supported in container

.mp4 does not support raw PCM audio. Use .mov instead, or transcode to
mp3 or aac

/Tomas

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

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

Re: [FFmpeg-devel] [PATCH 4/8] avformat/mxfdec: cleanup on "essence prior to first PartitionPack"

2019-11-06 Thread Tomas Härdin
tor 2019-10-31 klockan 18:58 +0100 skrev Michael Niedermayer:
> Fixes: memleak
> Fixes: 18473/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-
> 5738557074833408
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mxfdec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index 397f820b3f..f3b1b704f9 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -3199,7 +3199,8 @@ static int mxf_read_header(AVFormatContext *s)
>  
>  if (!mxf->current_partition) {
>  av_log(mxf->fc, AV_LOG_ERROR, "found essence prior
> to first PartitionPack\n");
> -return AVERROR_INVALIDDATA;
> +ret = AVERROR_INVALIDDATA;
> +goto fail;

Should be OK. I'd add a comment around mxf_read_sync() why we don't
goto fail there (since no metadata sets will have been parsed yet)

I also see now that mxf_read_header() calls mxf_read_close(), so the
comment in my last mail can be ignored. But again, maybe add a comment?

/Tomas

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

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

Re: [FFmpeg-devel] [PATCH 5/8] avformat/mxfdec: Clear metadata_sets_count in mxf_read_close()

2019-11-06 Thread Tomas Härdin
tor 2019-10-31 klockan 18:58 +0100 skrev Michael Niedermayer:
> This avoids problems if the function is called twice
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mxfdec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index f3b1b704f9..68a670154b 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -3582,6 +3582,7 @@ static int mxf_read_close(AVFormatContext *s)
>  for (i = 0; i < mxf->metadata_sets_count; i++) {
>  mxf_free_metadataset(mxf->metadata_sets + i, 1);
>  }
> +mxf->metadata_sets_count = 0;
>  av_freep(&mxf->partitions);
>  av_freep(&mxf->metadata_sets);
>  av_freep(&mxf->aesc);

Looks OK, but I'd work out why close() is called twice

/Tomas

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

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

[FFmpeg-devel] [PATCH] avcodec/arm/mlpdsp: add missing dependency for truehd

2019-11-06 Thread Aman Gupta
From: Aman Gupta 

Signed-off-by: Aman Gupta 
---
 libavcodec/arm/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile
index e656011c3c..c99e8e1bd1 100644
--- a/libavcodec/arm/Makefile
+++ b/libavcodec/arm/Makefile
@@ -43,6 +43,7 @@ OBJS-$(CONFIG_HEVC_DECODER)+= 
arm/hevcdsp_init_arm.o
 OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o
 OBJS-$(CONFIG_RV40_DECODER)+= arm/rv40dsp_init_arm.o
 OBJS-$(CONFIG_SBC_ENCODER) += arm/sbcdsp_init_arm.o
+OBJS-$(CONFIG_TRUEHD_DECODER)  += arm/mlpdsp_init_arm.o
 OBJS-$(CONFIG_VORBIS_DECODER)  += arm/vorbisdsp_init_arm.o
 OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_init_arm.o
 OBJS-$(CONFIG_VP9_DECODER) += arm/vp9dsp_init_10bpp_arm.o   \
@@ -61,6 +62,7 @@ ARMV5TE-OBJS-$(CONFIG_VIDEODSP)+= 
arm/videodsp_init_armv5te.o   \
 
 # decoders/encoders
 ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o
+ARMV5TE-OBJS-$(CONFIG_TRUEHD_DECODER)  += arm/mlpdsp_armv5te.o
 
 
 # ARMv6 optimizations
@@ -83,6 +85,7 @@ ARMV6-OBJS-$(CONFIG_VP8DSP)+= arm/vp8_armv6.o 
  \
 # decoders/encoders
 ARMV6-OBJS-$(CONFIG_MLP_DECODER)   += arm/mlpdsp_armv6.o
 ARMV6-OBJS-$(CONFIG_SBC_ENCODER)   += arm/sbcdsp_armv6.o
+ARMV6-OBJS-$(CONFIG_TRUEHD_DECODER)+= arm/mlpdsp_armv6.o
 
 
 # VFP optimizations
-- 
2.20.1

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

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

[FFmpeg-devel] [PATCH 1/2] configure: select missing rdft for several filters

2019-11-06 Thread Lou Logan
afir, sinc, superequalizer, surround

Signed-off-by: Lou Logan 
---
For afir fft is replaced with rdft as:
rdft_select="fft"

Fixes:

afir
/usr/bin/ld: libavfilter/libavfilter.a(af_afir.o): in function `fir_quantum':
af_afir.c:(.text+0x573): undefined reference to `av_rdft_calc'
/usr/bin/ld: af_afir.c:(.text+0x7cd): undefined reference to `av_rdft_calc'
/usr/bin/ld: libavfilter/libavfilter.a(af_afir.o): in function `init_segment':
af_afir.c:(.text+0x1b6e): undefined reference to `av_rdft_init'
/usr/bin/ld: af_afir.c:(.text+0x1baa): undefined reference to `av_rdft_init'
/usr/bin/ld: libavfilter/libavfilter.a(af_afir.o): in function `convert_coeffs':
af_afir.c:(.text+0x2652): undefined reference to `av_rdft_calc'
/usr/bin/ld: libavfilter/libavfilter.a(af_afir.o): in function `uninit_segment':
af_afir.c:(.text+0x31f2): undefined reference to `av_rdft_end'
/usr/bin/ld: af_afir.c:(.text+0x3248): undefined reference to `av_rdft_end'

sinc
/usr/bin/ld: libavfilter/libavfilter.a(asrc_sinc.o): in function `fir_to_phase':
asrc_sinc.c:(.text+0xd88): undefined reference to `av_rdft_end'
/usr/bin/ld: asrc_sinc.c:(.text+0xd98): undefined reference to `av_rdft_end'
/usr/bin/ld: asrc_sinc.c:(.text+0xdd5): undefined reference to `av_rdft_init'
/usr/bin/ld: asrc_sinc.c:(.text+0xdfe): undefined reference to `av_rdft_init'
/usr/bin/ld: asrc_sinc.c:(.text+0xe59): undefined reference to `av_rdft_calc'
/usr/bin/ld: asrc_sinc.c:(.text+0x115d): undefined reference to `av_rdft_calc'
/usr/bin/ld: asrc_sinc.c:(.text+0x124c): undefined reference to `av_rdft_calc'
/usr/bin/ld: asrc_sinc.c:(.text+0x1447): undefined reference to `av_rdft_calc'
/usr/bin/ld: libavfilter/libavfilter.a(asrc_sinc.o): in function 
`config_output':
asrc_sinc.c:(.text+0x1d6f): undefined reference to `av_rdft_end'
/usr/bin/ld: asrc_sinc.c:(.text+0x1d7f): undefined reference to `av_rdft_end'
/usr/bin/ld: libavfilter/libavfilter.a(asrc_sinc.o): in function `uninit':
asrc_sinc.c:(.text+0x1dee): undefined reference to `av_rdft_end'
/usr/bin/ld: asrc_sinc.c:(.text+0x1dfe): undefined reference to `av_rdft_end'

superequalizer
/usr/bin/ld: libavfilter/libavfilter.a(af_superequalizer.o): in function 
`equ_init':
af_superequalizer.c:(.text+0x574): undefined reference to `av_rdft_init'
/usr/bin/ld: af_superequalizer.c:(.text+0x58e): undefined reference to 
`av_rdft_init'
/usr/bin/ld: libavfilter/libavfilter.a(af_superequalizer.o): in function 
`make_fir':
af_superequalizer.c:(.text+0x86b): undefined reference to `av_rdft_calc'
/usr/bin/ld: libavfilter/libavfilter.a(af_superequalizer.o): in function 
`filter_frame':
af_superequalizer.c:(.text+0xa51): undefined reference to `av_rdft_calc'
/usr/bin/ld: af_superequalizer.c:(.text+0xc1f): undefined reference to 
`av_rdft_calc'
/usr/bin/ld: libavfilter/libavfilter.a(af_superequalizer.o): in function 
`uninit':
af_superequalizer.c:(.text+0x1134): undefined reference to `av_rdft_end'
/usr/bin/ld: af_superequalizer.c:(.text+0x1147): undefined reference to 
`av_rdft_end'
superequalizer_filter_select="rdft"

surround
/usr/bin/ld: libavfilter/libavfilter.a(af_surround.o): in function 
`config_input':
af_surround.c:(.text+0x1825): undefined reference to `av_rdft_init'
/usr/bin/ld: libavfilter/libavfilter.a(af_surround.o): in function 
`config_output':
af_surround.c:(.text+0x1e73): undefined reference to `av_rdft_init'
/usr/bin/ld: libavfilter/libavfilter.a(af_surround.o): in function 
`fft_channel':
af_surround.c:(.text+0xaae2): undefined reference to `av_rdft_calc'
/usr/bin/ld: libavfilter/libavfilter.a(af_surround.o): in function 
`ifft_channel':
af_surround.c:(.text+0xab79): undefined reference to `av_rdft_calc'
/usr/bin/ld: libavfilter/libavfilter.a(af_surround.o): in function `uninit':
af_surround.c:(.text+0xb301): undefined reference to `av_rdft_end'
/usr/bin/ld: af_surround.c:(.text+0xb340): undefined reference to `av_rdft_end'

---
 configure | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index f0be66ec8e..6cdc420afa 100755
--- a/configure
+++ b/configure
@@ -3437,7 +3437,7 @@ afftdn_filter_select="fft"
 afftfilt_filter_deps="avcodec"
 afftfilt_filter_select="fft"
 afir_filter_deps="avcodec"
-afir_filter_select="fft"
+afir_filter_select="rdft"
 amovie_filter_deps="avcodec avformat"
 aresample_filter_deps="swresample"
 asr_filter_deps="pocketsphinx"
@@ -3545,6 +3545,7 @@ showspectrum_filter_select="fft"
 showspectrumpic_filter_deps="avcodec"
 showspectrumpic_filter_select="fft"
 signature_filter_deps="gpl avcodec avformat"
+sinc_filter_select="rdft"
 smartblur_filter_deps="gpl swscale"
 sobel_opencl_filter_deps="opencl"
 sofalizer_filter_deps="libmysofa avcodec"
@@ -3559,6 +3560,8 @@ stereo3d_filter_deps="gpl"
 subtitles_filter_deps="avformat avcodec libass"
 super2xsai_filter_deps="gpl"
 pixfmts_super2xsai_test_deps="super2xsai_filter"
+superequalizer_filter_select="rdft"
+surround_filter_select="rdft"
 tinterlace_filter_deps="gpl"
 tinterlace_merge_test_deps="tinterlace_filter"
 t

[FFmpeg-devel] [PATCH 2/2] avfilter/Makefile: add missing framesync dependency to bm3d & mix filters

2019-11-06 Thread Lou Logan
Signed-off-by: Lou Logan 
---
bm3d
/usr/bin/ld: libavfilter/libavfilter.a(vf_bm3d.o): in function `activate':
vf_bm3d.c:(.text+0x3100): undefined reference to `ff_framesync_activate'
/usr/bin/ld: libavfilter/libavfilter.a(vf_bm3d.o): in function `process_frame':
vf_bm3d.c:(.text+0x3182): undefined reference to `ff_framesync_get_frame'
/usr/bin/ld: vf_bm3d.c:(.text+0x31ac): undefined reference to 
`ff_framesync_get_frame'
/usr/bin/ld: libavfilter/libavfilter.a(vf_bm3d.o): in function `config_output':
vf_bm3d.c:(.text+0x36fe): undefined reference to `ff_framesync_init'
/usr/bin/ld: vf_bm3d.c:(.text+0x37c1): undefined reference to 
`ff_framesync_configure'
/usr/bin/ld: libavfilter/libavfilter.a(vf_bm3d.o): in function `uninit':
vf_bm3d.c:(.text+0x383a): undefined reference to `ff_framesync_uninit'

mix
/usr/bin/ld: libavfilter/libavfilter.a(vf_mix.o): in function `process_frame':
vf_mix.c:(.text+0x954): undefined reference to `ff_framesync_get_frame'
/usr/bin/ld: libavfilter/libavfilter.a(vf_mix.o): in function `config_output':
vf_mix.c:(.text+0xd2c): undefined reference to `ff_framesync_init'
/usr/bin/ld: vf_mix.c:(.text+0xe77): undefined reference to 
`ff_framesync_configure'
/usr/bin/ld: libavfilter/libavfilter.a(vf_mix.o): in function `uninit':
vf_mix.c:(.text+0xeba): undefined reference to `ff_framesync_uninit'
/usr/bin/ld: libavfilter/libavfilter.a(vf_mix.o): in function `activate':
vf_mix.c:(.text+0xf8a): undefined reference to `ff_framesync_activate'
---
 libavfilter/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 2080eed559..ec2ed4a8e7 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -169,7 +169,7 @@ OBJS-$(CONFIG_BITPLANENOISE_FILTER)  += 
vf_bitplanenoise.o
 OBJS-$(CONFIG_BLACKDETECT_FILTER)+= vf_blackdetect.o
 OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o
 OBJS-$(CONFIG_BLEND_FILTER)  += vf_blend.o framesync.o
-OBJS-$(CONFIG_BM3D_FILTER)   += vf_bm3d.o
+OBJS-$(CONFIG_BM3D_FILTER)   += vf_bm3d.o framesync.o
 OBJS-$(CONFIG_BOXBLUR_FILTER)+= vf_boxblur.o boxblur.o
 OBJS-$(CONFIG_BOXBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \
 opencl/avgblur.o boxblur.o
@@ -303,7 +303,7 @@ OBJS-$(CONFIG_MESTIMATE_FILTER)  += 
vf_mestimate.o motion_estimation
 OBJS-$(CONFIG_METADATA_FILTER)   += f_metadata.o
 OBJS-$(CONFIG_MIDEQUALIZER_FILTER)   += vf_midequalizer.o framesync.o
 OBJS-$(CONFIG_MINTERPOLATE_FILTER)   += vf_minterpolate.o 
motion_estimation.o
-OBJS-$(CONFIG_MIX_FILTER)+= vf_mix.o
+OBJS-$(CONFIG_MIX_FILTER)+= vf_mix.o framesync.o
 OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o
 OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o
 OBJS-$(CONFIG_NLMEANS_FILTER)+= vf_nlmeans.o
-- 
2.24.0

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

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

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_opt: Fix mixed declarations and code

2019-11-06 Thread Michael Niedermayer
On Wed, Nov 06, 2019 at 08:08:27PM +0100, Carl Eugen Hoyos wrote:
> Am Mi., 6. Nov. 2019 um 13:18 Uhr schrieb Andreas Rheinhardt
> :
> >
> > Introduced in ed3c317d.
> >
> > Signed-off-by: Andreas Rheinhardt 
> > ---
> >  fftools/ffmpeg_opt.c | 6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> > index af9a9a6acb..f4ccf3f65e 100644
> > --- a/fftools/ffmpeg_opt.c
> > +++ b/fftools/ffmpeg_opt.c
> > @@ -3008,9 +3008,10 @@ static int opt_old2new(void *optctx, const char 
> > *opt, const char *arg)
> >  {
> >  OptionsContext *o = optctx;
> >  char *s = av_asprintf("%s:%c", opt + 1, *opt);
> > +int ret;
> 
> Shouldn't the new declarations be above the call to av_asprintf()?

will apply with that change

thx

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

Elect your leaders based on what they did after the last election, not
based on what they say before an election.



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

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

Re: [FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread Carl Eugen Hoyos
Am Mi., 6. Nov. 2019 um 12:01 Uhr schrieb Limin Wang :
>
> On Wed, Nov 06, 2019 at 11:30:41AM +0100, Hendrik Leppkes wrote:
> > On Wed, Nov 6, 2019 at 10:01 AM  wrote:
> > >
> > > From: Limin Wang 
> > >
> > > Signed-off-by: Limin Wang 
> > > ---
> > >  libavformat/utils.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > > index 8196442dd1..8381498e2b 100644
> > > --- a/libavformat/utils.c
> > > +++ b/libavformat/utils.c
> > > @@ -367,8 +367,7 @@ static int set_codec_from_probe_data(AVFormatContext 
> > > *s, AVStream *st,
> > > fmt->name, score);
> > >  for (i = 0; fmt_id_type[i].name; i++) {
> > >  if (!strcmp(fmt->name, fmt_id_type[i].name)) {
> > > -if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> > > -st->codecpar->sample_rate)
> > > +if (st->codecpar->sample_rate)
> > >  continue;
> > >  if (st->request_probe > score &&
> > >  st->codecpar->codec_id != fmt_id_type[i].id)
> >
> > This change seems wrong, as you are practically rejecting probing of
> > any audio now, since those would get a sample rate.
>
> By the old logic, I assume sample_rate > 0 means the audio has been detected,
> so don't probe the data again.

If sample_rate > 0 then do not consider non-audio codecs for auto-detection.

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

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

Re: [FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread Carl Eugen Hoyos
Am Mi., 6. Nov. 2019 um 12:21 Uhr schrieb Limin Wang :
>
> On Wed, Nov 06, 2019 at 11:18:10AM +0100, Carl Eugen Hoyos wrote:
> > Am Mi., 6. Nov. 2019 um 10:01 Uhr schrieb :
> > >
> > > From: Limin Wang 
> > >
> > > Signed-off-by: Limin Wang 
> > > ---
> > >  libavformat/utils.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > > index 8196442dd1..8381498e2b 100644
> > > --- a/libavformat/utils.c
> > > +++ b/libavformat/utils.c
> > > @@ -367,8 +367,7 @@ static int set_codec_from_probe_data(AVFormatContext 
> > > *s, AVStream *st,
> > > fmt->name, score);
> > >  for (i = 0; fmt_id_type[i].name; i++) {
> > >  if (!strcmp(fmt->name, fmt_id_type[i].name)) {
> > > -if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> > > -st->codecpar->sample_rate)
> > > +if (st->codecpar->sample_rate)
> > >  continue;
> >
> > I believe the correct fix is to change the mp3 probe function so that it
> > does not return a score of 51 for the pcm pattern of ff ff e8 ff ff ff e8 
> > ff...
>
> It has been detected as pcm

There is no pcm detection in FFmpeg (it is hard iiuc), and the content
does not get detected as pcm but mp3 / mp1.

> and have get the valid audio sample rate, why we detect it
> again here?

How else can you rule out dca audio?

> I have run fate testing with the patch and haven't find any broken condition.

fate cannot test for all possible code paths.

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

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

Re: [FFmpeg-devel] [PATCH v3] avdevice/v4l2: Remove av_assert0 when format not supported

2019-11-06 Thread Michael Niedermayer
On Wed, Nov 06, 2019 at 11:44:50AM +0100, Nicolas George wrote:
> Andriy Gelman (12019-11-04):
> > From: Andriy Gelman 
> > 
> > Before this commit an av_assert0 would fail if a v4l2 device did not
> > support a target format.
> > For example,
> > ./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts -
> > would signal an abort if /dev/video0 did not support h264.
> > 
> > The new behaviour is to return an AVERROR(EINVAL) error code. An
> > av_assert0 has been added to verify this return.
> > 
> > Fixes #6629
> > 
> > Signed-off-by: Andriy Gelman 
> > ---
> >  libavdevice/v4l2.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> > index 446a243cf8..365bacd771 100644
> > --- a/libavdevice/v4l2.c
> > +++ b/libavdevice/v4l2.c
> > @@ -811,7 +811,8 @@ static int device_try_init(AVFormatContext *ctx,
> >  }
> >  
> >  *codec_id = ff_fmt_v4l2codec(*desired_format);
> > -av_assert0(*codec_id != AV_CODEC_ID_NONE);
> > +if (*codec_id == AV_CODEC_ID_NONE)
> > +av_assert0(ret == AVERROR(EINVAL));
> >  return ret;
> >  }
> >  
> 
> This version is fine by me, thanks. But I do not maintain this file.

will apply

thanks

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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

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

Re: [FFmpeg-devel] [PATCH v1] avfilter/vf_vaguedenoiser: use fabsf() instead of FFABS()

2019-11-06 Thread Carl Eugen Hoyos
Am Mi., 6. Nov. 2019 um 12:04 Uhr schrieb Limin Wang :
>
> On Wed, Nov 06, 2019 at 11:11:08AM +0100, Carl Eugen Hoyos wrote:
> > Am Mi., 6. Nov. 2019 um 10:31 Uhr schrieb :
> > >
> > > From: Limin Wang 
> > >
> > > Signed-off-by: Limin Wang 
> > > ---
> > >  libavfilter/vf_vaguedenoiser.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/libavfilter/vf_vaguedenoiser.c 
> > > b/libavfilter/vf_vaguedenoiser.c
> > > index a68f7626e6..75a58c363b 100644
> > > --- a/libavfilter/vf_vaguedenoiser.c
> > > +++ b/libavfilter/vf_vaguedenoiser.c
> > > @@ -335,7 +335,7 @@ static void hard_thresholding(float *block, const int 
> > > width, const int height,
> > >
> > >  for (y = 0; y < height; y++) {
> > >  for (x = 0; x < width; x++) {
> > > -if (FFABS(block[x]) <= threshold)
> > > +if (fabsf(block[x]) <= threshold)
> > >  block[x] *= frac;
> > >  }
> > >  block += stride;
> > > @@ -359,7 +359,7 @@ static void soft_thresholding(float *block, const int 
> > > width, const int height, c
> > >  for (y = 0; y < height; y++) {
> > >  const int x0 = (y < h) ? w : 0;
> > >  for (x = x0; x < width; x++) {
> > > -const float temp = FFABS(block[x]);
> > > +const float temp = fabsf(block[x]);
> > >  if (temp <= threshold)
> > >  block[x] *= frac;
> > >  else
> > > @@ -380,7 +380,7 @@ static void qian_thresholding(float *block, const int 
> > > width, const int height,
> > >
> > >  for (y = 0; y < height; y++) {
> > >  for (x = 0; x < width; x++) {
> > > -const float temp = FFABS(block[x]);
> > > +const float temp = fabsf(block[x]);
> > >  if (temp <= threshold) {
> > >  block[x] *= frac;
> > >  } else {
> >
> > Please add a sentence to the commit message that explains why this
> > change is a good idea.
>
> block is float type, so I think it's better to use fabsf, isn't right?

Looking at the definition of FFABS(), I don't think this is correct.

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

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

Re: [FFmpeg-devel] [PATCH v1] avfilter/vf_vaguedenoiser: use fabsf() instead of FFABS()

2019-11-06 Thread Paul B Mahol
Pointless change.

On 11/6/19, Limin Wang  wrote:
> On Wed, Nov 06, 2019 at 11:11:08AM +0100, Carl Eugen Hoyos wrote:
>> Am Mi., 6. Nov. 2019 um 10:31 Uhr schrieb :
>> >
>> > From: Limin Wang 
>> >
>> > Signed-off-by: Limin Wang 
>> > ---
>> >  libavfilter/vf_vaguedenoiser.c | 6 +++---
>> >  1 file changed, 3 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/libavfilter/vf_vaguedenoiser.c
>> > b/libavfilter/vf_vaguedenoiser.c
>> > index a68f7626e6..75a58c363b 100644
>> > --- a/libavfilter/vf_vaguedenoiser.c
>> > +++ b/libavfilter/vf_vaguedenoiser.c
>> > @@ -335,7 +335,7 @@ static void hard_thresholding(float *block, const
>> > int width, const int height,
>> >
>> >  for (y = 0; y < height; y++) {
>> >  for (x = 0; x < width; x++) {
>> > -if (FFABS(block[x]) <= threshold)
>> > +if (fabsf(block[x]) <= threshold)
>> >  block[x] *= frac;
>> >  }
>> >  block += stride;
>> > @@ -359,7 +359,7 @@ static void soft_thresholding(float *block, const
>> > int width, const int height, c
>> >  for (y = 0; y < height; y++) {
>> >  const int x0 = (y < h) ? w : 0;
>> >  for (x = x0; x < width; x++) {
>> > -const float temp = FFABS(block[x]);
>> > +const float temp = fabsf(block[x]);
>> >  if (temp <= threshold)
>> >  block[x] *= frac;
>> >  else
>> > @@ -380,7 +380,7 @@ static void qian_thresholding(float *block, const
>> > int width, const int height,
>> >
>> >  for (y = 0; y < height; y++) {
>> >  for (x = 0; x < width; x++) {
>> > -const float temp = FFABS(block[x]);
>> > +const float temp = fabsf(block[x]);
>> >  if (temp <= threshold) {
>> >  block[x] *= frac;
>> >  } else {
>>
>> Please add a sentence to the commit message that explains why this
>> change is a good idea.
>
> block is float type, so I think it's better to use fabsf, isn't right?
>
>>
>> Carl Eugen
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_opt: Fix mixed declarations and code

2019-11-06 Thread Carl Eugen Hoyos
Am Mi., 6. Nov. 2019 um 13:18 Uhr schrieb Andreas Rheinhardt
:
>
> Introduced in ed3c317d.
>
> Signed-off-by: Andreas Rheinhardt 
> ---
>  fftools/ffmpeg_opt.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> index af9a9a6acb..f4ccf3f65e 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -3008,9 +3008,10 @@ static int opt_old2new(void *optctx, const char *opt, 
> const char *arg)
>  {
>  OptionsContext *o = optctx;
>  char *s = av_asprintf("%s:%c", opt + 1, *opt);
> +int ret;

Shouldn't the new declarations be above the call to av_asprintf()?

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

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

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_opt: Fix mixed declarations and code

2019-11-06 Thread Michael Niedermayer
On Wed, Nov 06, 2019 at 01:18:16PM +0100, Andreas Rheinhardt wrote:
> Introduced in ed3c317d.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  fftools/ffmpeg_opt.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

will apply

thx

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

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


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

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

Re: [FFmpeg-devel] [PATCH] avcodec/extract_extradata_bsf: fix typo in comments

2019-11-06 Thread Michael Niedermayer
On Wed, Nov 06, 2019 at 01:03:43PM +0530, Gyan wrote:
> 
> 
> On 06-11-2019 12:30 pm, leozhang wrote:
> >Signed-off-by: leozhang 
> >---
> >  libavcodec/extract_extradata_bsf.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/libavcodec/extract_extradata_bsf.c 
> >b/libavcodec/extract_extradata_bsf.c
> >index 17e5deb..ff111de 100644
> >--- a/libavcodec/extract_extradata_bsf.c
> >+++ b/libavcodec/extract_extradata_bsf.c
> >@@ -38,10 +38,10 @@ typedef struct ExtractExtradataContext {
> >  int (*extract)(AVBSFContext *ctx, AVPacket *pkt,
> > uint8_t **data, int *size);
> >-/* AV1 specifc fields */
> >+/* AV1 specific fields */
> >  AV1Packet av1_pkt;
> >-/* H264/HEVC specifc fields */
> >+/* H264/HEVC specific fields */
> >  H2645Packet h2645_pkt;
> >  /* AVOptions */
> 
> LGTM.

will apply

thx

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

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


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

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

Re: [FFmpeg-devel] [PATCH] avcodec/dvenc: support encoding dvcprohd

2019-11-06 Thread Michael Niedermayer
On Wed, Nov 06, 2019 at 08:54:50AM -0800, Baptiste Coudurier wrote:
> Hey Michael,
> 
> > On Nov 4, 2019, at 12:43 PM, Michael Niedermayer  
> > wrote:
> > 
> > On Sat, Nov 02, 2019 at 12:06:19PM -0700, Baptiste Coudurier wrote:
> >> ---
> >> libavcodec/dv.h   |   1 +
> >> libavcodec/dvenc.c| 555 +-
> > 
> >> tests/fate/vcodec.mak |  14 +-
> > 
> > here are the corresponding ref files i get:
> > they are the same on x86-64/32, mingw 32/64 arm & mips (qemu)
> > 
> > new file mode 100644
> > index 00..b81141f340
> > --- /dev/null
> > +++ b/tests/ref/vsynth/vsynth1-dv-fhd
> > @@ -0,0 +1,4 @@
> > +74315a8678d12c7f592c02990dc8952d *tests/data/fate/vsynth1-dv-fhd.dv
> > +2880 tests/data/fate/vsynth1-dv-fhd.dv
> > +c95b309bc128b162e5c8241374eb66a9 
> > *tests/data/fate/vsynth1-dv-fhd.out.rawvideo
> > +stddev:2.53 PSNR: 40.03 MAXDIFF:   35 bytes:  7603200/  7603200
> > diff --git a/tests/ref/vsynth/vsynth1-dv-hd b/tests/ref/vsynth/vsynth1-dv-hd
> > new file mode 100644
> > index 00..c964b083b3
> > --- /dev/null
> > +++ b/tests/ref/vsynth/vsynth1-dv-hd
> > @@ -0,0 +1,4 @@
> > +12c07ee20aa824dc0ed589336647b195 *tests/data/fate/vsynth1-dv-hd.dv
> > +1440 tests/data/fate/vsynth1-dv-hd.dv
> > +dbeb55cfe3ed47d25cbe4e0b45d9bb00 
> > *tests/data/fate/vsynth1-dv-hd.out.rawvideo
> > +stddev:   53.33 PSNR: 13.59 MAXDIFF:  238 bytes:  7603200/  7603200
> > diff --git a/tests/ref/vsynth/vsynth2-dv-fhd 
> > b/tests/ref/vsynth/vsynth2-dv-fhd
> > new file mode 100644
> > index 00..948bf2269f
> > --- /dev/null
> > +++ b/tests/ref/vsynth/vsynth2-dv-fhd
> > @@ -0,0 +1,4 @@
> > +1f96ce7c1a5f09ec9d30c51c7271cf77 *tests/data/fate/vsynth2-dv-fhd.dv
> > +2880 tests/data/fate/vsynth2-dv-fhd.dv
> > +cff30e2430730522bf67c6d94cf1352e 
> > *tests/data/fate/vsynth2-dv-fhd.out.rawvideo
> > +stddev:1.16 PSNR: 46.82 MAXDIFF:   21 bytes:  7603200/  7603200
> > diff --git a/tests/ref/vsynth/vsynth2-dv-hd b/tests/ref/vsynth/vsynth2-dv-hd
> > new file mode 100644
> > index 00..2dce36b94b
> > --- /dev/null
> > +++ b/tests/ref/vsynth/vsynth2-dv-hd
> > @@ -0,0 +1,4 @@
> > +095db978dd76f36d5706c96f6dac65bd *tests/data/fate/vsynth2-dv-hd.dv
> > +1440 tests/data/fate/vsynth2-dv-hd.dv
> > +a1c690626f90e0c79b1247ee560540ef 
> > *tests/data/fate/vsynth2-dv-hd.out.rawvideo
> > +stddev:   79.63 PSNR: 10.11 MAXDIFF:  240 bytes:  7603200/  7603200
> > diff --git a/tests/ref/vsynth/vsynth3-dv-fhd 
> > b/tests/ref/vsynth/vsynth3-dv-fhd
> > new file mode 100644
> > index 00..08ca9ef889
> > --- /dev/null
> > +++ b/tests/ref/vsynth/vsynth3-dv-fhd
> > @@ -0,0 +1,4 @@
> > +5b8b7f1dc31d7076af891e94c2e88c06 *tests/data/fate/vsynth3-dv-fhd.dv
> > +2880 tests/data/fate/vsynth3-dv-fhd.dv
> > +a038ad7c3c09f776304ef7accdea9c74 
> > *tests/data/fate/vsynth3-dv-fhd.out.rawvideo
> > +stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:86700/86700
> > diff --git a/tests/ref/vsynth/vsynth3-dv-hd b/tests/ref/vsynth/vsynth3-dv-hd
> > new file mode 100644
> > index 00..a42f4b4bb3
> > --- /dev/null
> > +++ b/tests/ref/vsynth/vsynth3-dv-hd
> > @@ -0,0 +1,4 @@
> > +c05f2a66f9a5090e016d24373c657fd2 *tests/data/fate/vsynth3-dv-hd.dv
> > +1440 tests/data/fate/vsynth3-dv-hd.dv
> > +938db8c6ca3bc2d2a64d0f481960efd3 
> > *tests/data/fate/vsynth3-dv-hd.out.rawvideo
> > +stddev:   62.24 PSNR: 12.25 MAXDIFF:  218 bytes:86700/86700
> > diff --git a/tests/ref/vsynth/vsynth_lena-dv-fhd 
> > b/tests/ref/vsynth/vsynth_lena-dv-fhd
> > new file mode 100644
> > index 00..51a4505011
> > --- /dev/null
> > +++ b/tests/ref/vsynth/vsynth_lena-dv-fhd
> > @@ -0,0 +1,4 @@
> > +3a33e512f8b3f4213477c98d4e7e2559 *tests/data/fate/vsynth_lena-dv-fhd.dv
> > +2880 tests/data/fate/vsynth_lena-dv-fhd.dv
> > +b97e0a057202359ef93f2ec0b9fdfec4 
> > *tests/data/fate/vsynth_lena-dv-fhd.out.rawvideo
> > +stddev:1.03 PSNR: 47.80 MAXDIFF:   14 bytes:  7603200/  7603200
> > diff --git a/tests/ref/vsynth/vsynth_lena-dv-hd 
> > b/tests/ref/vsynth/vsynth_lena-dv-hd
> > new file mode 100644
> > index 00..c682c9eb2c
> > --- /dev/null
> > +++ b/tests/ref/vsynth/vsynth_lena-dv-hd
> > @@ -0,0 +1,4 @@
> > +4f289998e497e473a1522006bc6b3b74 *tests/data/fate/vsynth_lena-dv-hd.dv
> > +1440 tests/data/fate/vsynth_lena-dv-hd.dv
> > +96e4669d6941c4366e6f599d77061d97 
> > *tests/data/fate/vsynth_lena-dv-hd.out.rawvideo
> > +stddev:   54.07 PSNR: 13.47 MAXDIFF:  199 bytes:  7603200/  7603200
> 

> Thanks! I actually merged the muxer change in the same patch so that we don’t 
> create bad .dv files with HD.
> Let me know if that’s fine.

as libavformat and libavcodec are seperate entities with their own version
numbers (and also are packaged seperatly in some distributions)
it is possible that libavcodec is updated without libavformat
(libavformat couldnt be as it would have a dependancy on libavcodec pulling
 the matching version in)
 
so the situation of a newer libavcodec is alway

Re: [FFmpeg-devel] [PATCH 1/4] configure: select mdct for dca encoder

2019-11-06 Thread Lou Logan
On Tue, Nov 5, 2019, at 1:58 PM, Carl Eugen Hoyos wrote:
>
> Set lgtm.

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

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

Re: [FFmpeg-devel] [PATCH V3] avfilter/vf_dnn_processing: add a generic filter for image proccessing with dnn networks

2019-11-06 Thread Pedro Arthur
Hi,

Em qui., 31 de out. de 2019 às 05:39, Guo, Yejun 
escreveu:

> This filter accepts all the dnn networks which do image processing.
> Currently, frame with formats rgb24 and bgr24 are supported. Other
> formats such as gray and YUV will be supported next. The dnn network
> can accept data in float32 or uint8 format. And the dnn network can
> change frame size.
>
> The following is a python script to halve the value of the first
> channel of the pixel. It demos how to setup and execute dnn model
> with python+tensorflow. It also generates .pb file which will be
> used by ffmpeg.
>
> import tensorflow as tf
> import numpy as np
> import scipy.misc
> in_img = scipy.misc.imread('in.bmp')
> in_img = in_img.astype(np.float32)/255.0
> in_data = in_img[np.newaxis, :]
> filter_data = np.array([0.5, 0, 0, 0, 1., 0, 0, 0,
> 1.]).reshape(1,1,3,3).astype(np.float32)
> filter = tf.Variable(filter_data)
> x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
> y = tf.nn.conv2d(x, filter, strides=[1, 1, 1, 1], padding='VALID',
> name='dnn_out')
> sess=tf.Session()
> sess.run(tf.global_variables_initializer())
> output = sess.run(y, feed_dict={x: in_data})
> graph_def = tf.graph_util.convert_variables_to_constants(sess,
> sess.graph_def, ['dnn_out'])
> tf.train.write_graph(graph_def, '.', 'halve_first_channel.pb',
> as_text=False)
> output = output * 255.0
> output = output.astype(np.uint8)
> scipy.misc.imsave("out.bmp", np.squeeze(output))
>
> To do the same thing with ffmpeg:
> - generate halve_first_channel.pb with the above script
> - generate halve_first_channel.model with tools/python/convert.py
> - try with following commands
>   ./ffmpeg -i input.jpg -vf
> dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=native
> -y out.native.png
>   ./ffmpeg -i input.jpg -vf
> dnn_processing=model=halve_first_channel.pb:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=tensorflow
> -y out.tf.png
>
It would be great if you could transform the above steps in a fate test,
that way one can automatically ensure the filter is always working properly.


>
> Signed-off-by: Guo, Yejun 
> ---
>  configure   |   1 +
>  doc/filters.texi|  44 ++
>  libavfilter/Makefile|   1 +
>  libavfilter/allfilters.c|   1 +
>  libavfilter/vf_dnn_processing.c | 331
> 
>  5 files changed, 378 insertions(+)
>  create mode 100644 libavfilter/vf_dnn_processing.c
>
> diff --git a/configure b/configure
> index 875b77f..4b3964d 100755
> --- a/configure
> +++ b/configure
> @@ -3463,6 +3463,7 @@ derain_filter_select="dnn"
>  deshake_filter_select="pixelutils"
>  deshake_opencl_filter_deps="opencl"
>  dilation_opencl_filter_deps="opencl"
> +dnn_processing_filter_select="dnn"
>  drawtext_filter_deps="libfreetype"
>  drawtext_filter_suggest="libfontconfig libfribidi"
>  elbg_filter_deps="avcodec"
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 9d387be..15771ab 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -8928,6 +8928,50 @@ ffmpeg -i INPUT -f lavfi -i
> nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2
>  @end example
>  @end itemize
>
> +@section dnn_processing
> +
> +Do image processing with deep neural networks. Currently only AVFrame
> with RGB24
> +and BGR24 are supported, more formats will be added later.
> +
> +The filter accepts the following options:
> +
> +@table @option
> +@item dnn_backend
> +Specify which DNN backend to use for model loading and execution. This
> option accepts
> +the following values:
> +
> +@table @samp
> +@item native
> +Native implementation of DNN loading and execution.
> +
> +@item tensorflow
> +TensorFlow backend. To enable this backend you
> +need to install the TensorFlow for C library (see
> +@url{https://www.tensorflow.org/install/install_c}) and configure FFmpeg
> with
> +@code{--enable-libtensorflow}
> +@end table
> +
> +Default value is @samp{native}.
> +
> +@item model
> +Set path to model file specifying network architecture and its parameters.
> +Note that different backends use different file formats. TensorFlow and
> native
> +backend can load files for only its format.
> +
> +Native model file (.model) can be generated from TensorFlow model file
> (.pb) by using tools/python/convert.py
> +
> +@item input
> +Set the input name of the dnn network.
> +
> +@item output
> +Set the output name of the dnn network.
> +
> +@item fmt
> +Set the pixel format for the Frame. Allowed values are
> @code{AV_PIX_FMT_RGB24}, and @code{AV_PIX_FMT_BGR24}.
> +Default value is @code{AV_PIX_FMT_RGB24}.
> +
> +@end table
> +
>  @section drawbox
>
>  Draw a colored box on the input image.
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 2080eed..3eff398 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -223,6 +223,7 @@ OBJS-$(CONFIG_DILATION_FILTER)   +=
> vf_neighbor.o
>  OBJS-$(CONFIG_DILATION_OP

Re: [FFmpeg-devel] [PATCH] avcodec/dvenc: support encoding dvcprohd

2019-11-06 Thread Baptiste Coudurier
Hey Michael,

> On Nov 4, 2019, at 12:43 PM, Michael Niedermayer  
> wrote:
> 
> On Sat, Nov 02, 2019 at 12:06:19PM -0700, Baptiste Coudurier wrote:
>> ---
>> libavcodec/dv.h   |   1 +
>> libavcodec/dvenc.c| 555 +-
> 
>> tests/fate/vcodec.mak |  14 +-
> 
> here are the corresponding ref files i get:
> they are the same on x86-64/32, mingw 32/64 arm & mips (qemu)
> 
> new file mode 100644
> index 00..b81141f340
> --- /dev/null
> +++ b/tests/ref/vsynth/vsynth1-dv-fhd
> @@ -0,0 +1,4 @@
> +74315a8678d12c7f592c02990dc8952d *tests/data/fate/vsynth1-dv-fhd.dv
> +2880 tests/data/fate/vsynth1-dv-fhd.dv
> +c95b309bc128b162e5c8241374eb66a9 *tests/data/fate/vsynth1-dv-fhd.out.rawvideo
> +stddev:2.53 PSNR: 40.03 MAXDIFF:   35 bytes:  7603200/  7603200
> diff --git a/tests/ref/vsynth/vsynth1-dv-hd b/tests/ref/vsynth/vsynth1-dv-hd
> new file mode 100644
> index 00..c964b083b3
> --- /dev/null
> +++ b/tests/ref/vsynth/vsynth1-dv-hd
> @@ -0,0 +1,4 @@
> +12c07ee20aa824dc0ed589336647b195 *tests/data/fate/vsynth1-dv-hd.dv
> +1440 tests/data/fate/vsynth1-dv-hd.dv
> +dbeb55cfe3ed47d25cbe4e0b45d9bb00 *tests/data/fate/vsynth1-dv-hd.out.rawvideo
> +stddev:   53.33 PSNR: 13.59 MAXDIFF:  238 bytes:  7603200/  7603200
> diff --git a/tests/ref/vsynth/vsynth2-dv-fhd b/tests/ref/vsynth/vsynth2-dv-fhd
> new file mode 100644
> index 00..948bf2269f
> --- /dev/null
> +++ b/tests/ref/vsynth/vsynth2-dv-fhd
> @@ -0,0 +1,4 @@
> +1f96ce7c1a5f09ec9d30c51c7271cf77 *tests/data/fate/vsynth2-dv-fhd.dv
> +2880 tests/data/fate/vsynth2-dv-fhd.dv
> +cff30e2430730522bf67c6d94cf1352e *tests/data/fate/vsynth2-dv-fhd.out.rawvideo
> +stddev:1.16 PSNR: 46.82 MAXDIFF:   21 bytes:  7603200/  7603200
> diff --git a/tests/ref/vsynth/vsynth2-dv-hd b/tests/ref/vsynth/vsynth2-dv-hd
> new file mode 100644
> index 00..2dce36b94b
> --- /dev/null
> +++ b/tests/ref/vsynth/vsynth2-dv-hd
> @@ -0,0 +1,4 @@
> +095db978dd76f36d5706c96f6dac65bd *tests/data/fate/vsynth2-dv-hd.dv
> +1440 tests/data/fate/vsynth2-dv-hd.dv
> +a1c690626f90e0c79b1247ee560540ef *tests/data/fate/vsynth2-dv-hd.out.rawvideo
> +stddev:   79.63 PSNR: 10.11 MAXDIFF:  240 bytes:  7603200/  7603200
> diff --git a/tests/ref/vsynth/vsynth3-dv-fhd b/tests/ref/vsynth/vsynth3-dv-fhd
> new file mode 100644
> index 00..08ca9ef889
> --- /dev/null
> +++ b/tests/ref/vsynth/vsynth3-dv-fhd
> @@ -0,0 +1,4 @@
> +5b8b7f1dc31d7076af891e94c2e88c06 *tests/data/fate/vsynth3-dv-fhd.dv
> +2880 tests/data/fate/vsynth3-dv-fhd.dv
> +a038ad7c3c09f776304ef7accdea9c74 *tests/data/fate/vsynth3-dv-fhd.out.rawvideo
> +stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:86700/86700
> diff --git a/tests/ref/vsynth/vsynth3-dv-hd b/tests/ref/vsynth/vsynth3-dv-hd
> new file mode 100644
> index 00..a42f4b4bb3
> --- /dev/null
> +++ b/tests/ref/vsynth/vsynth3-dv-hd
> @@ -0,0 +1,4 @@
> +c05f2a66f9a5090e016d24373c657fd2 *tests/data/fate/vsynth3-dv-hd.dv
> +1440 tests/data/fate/vsynth3-dv-hd.dv
> +938db8c6ca3bc2d2a64d0f481960efd3 *tests/data/fate/vsynth3-dv-hd.out.rawvideo
> +stddev:   62.24 PSNR: 12.25 MAXDIFF:  218 bytes:86700/86700
> diff --git a/tests/ref/vsynth/vsynth_lena-dv-fhd 
> b/tests/ref/vsynth/vsynth_lena-dv-fhd
> new file mode 100644
> index 00..51a4505011
> --- /dev/null
> +++ b/tests/ref/vsynth/vsynth_lena-dv-fhd
> @@ -0,0 +1,4 @@
> +3a33e512f8b3f4213477c98d4e7e2559 *tests/data/fate/vsynth_lena-dv-fhd.dv
> +2880 tests/data/fate/vsynth_lena-dv-fhd.dv
> +b97e0a057202359ef93f2ec0b9fdfec4 
> *tests/data/fate/vsynth_lena-dv-fhd.out.rawvideo
> +stddev:1.03 PSNR: 47.80 MAXDIFF:   14 bytes:  7603200/  7603200
> diff --git a/tests/ref/vsynth/vsynth_lena-dv-hd 
> b/tests/ref/vsynth/vsynth_lena-dv-hd
> new file mode 100644
> index 00..c682c9eb2c
> --- /dev/null
> +++ b/tests/ref/vsynth/vsynth_lena-dv-hd
> @@ -0,0 +1,4 @@
> +4f289998e497e473a1522006bc6b3b74 *tests/data/fate/vsynth_lena-dv-hd.dv
> +1440 tests/data/fate/vsynth_lena-dv-hd.dv
> +96e4669d6941c4366e6f599d77061d97 
> *tests/data/fate/vsynth_lena-dv-hd.out.rawvideo
> +stddev:   54.07 PSNR: 13.47 MAXDIFF:  199 bytes:  7603200/  7603200

Thanks! I actually merged the muxer change in the same patch so that we don’t 
create bad .dv files with HD.
Let me know if that’s fine.
I found a workaround for compilation on macOS Catalina finally so I added the 
fate ref files.

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

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

Re: [FFmpeg-devel] [PATCH] avcodec/dvdec: correctly set interlaced and tff

2019-11-06 Thread Baptiste Coudurier

> On Nov 2, 2019, at 12:00 PM, Baptiste Coudurier 
>  wrote:
> 
> On Wed, Sep 11, 2019 at 1:29 PM Baptiste Coudurier 
> mailto:baptiste.coudur...@gmail.com>> wrote:
> Hey Carl,
> 
>> On Sep 11, 2019, at 12:38 PM, Carl Eugen Hoyos > > wrote:
>> 
>> Am Mi., 11. Sept. 2019 um 21:31 Uhr schrieb Baptiste Coudurier
>> mailto:baptiste.coudur...@gmail.com>>:
>>> 
>>> ---
>>> libavcodec/dvdec.c | 13 ++---
>>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>> 
>>> diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
>>> index 4345cd9e29..cfa0fb9905 100644
>>> --- a/libavcodec/dvdec.c
>>> +++ b/libavcodec/dvdec.c
>>> @@ -592,12 +592,19 @@ static int dvvideo_decode_frame(AVCodecContext 
>>> *avctx, void *data,
>>> 
>>> if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
>>> return ret;
>>> -frame.f->interlaced_frame = 1;
>>> -frame.f->top_field_first  = 0;
>>> 
>>> /* Determine the codec's field order from the packet */
>>> if ( *vsc_pack == dv_video_control ) {
>>> -frame.f->top_field_first = !(vsc_pack[3] & 0x40);
>>> +if (avctx->height == 720) {
>>> +frame.f->interlaced_frame = 0;
>>> +frame.f->top_field_first = 0;
>>> +} else if (avctx->height == 1080) {
>>> +frame.f->interlaced_frame = 1;
>>> +frame.f->top_field_first = (vsc_pack[3] & 0x40) == 0x40;
>>> +} else {
>>> +frame.f->interlaced_frame = (vsc_pack[3] & 0x10) == 0x10;
>>> +frame.f->top_field_first = !(vsc_pack[3] & 0x40);
>> 
>> Does this fix ticket #5092?
> Will apply

Applied

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

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

[FFmpeg-devel] [PATCH] avcodec/dvenc: support encoding and muxing dvcprohd

2019-11-06 Thread Baptiste Coudurier
---
 libavcodec/dv.h |   1 +
 libavcodec/dvenc.c  | 555 
 libavformat/dvenc.c |  48 ++-
 tests/fate/vcodec.mak   |  14 +-
 tests/ref/vsynth/vsynth1-dv-fhd |   4 +
 tests/ref/vsynth/vsynth1-dv-hd  |   4 +
 tests/ref/vsynth/vsynth2-dv-fhd |   4 +
 tests/ref/vsynth/vsynth2-dv-hd  |   4 +
 tests/ref/vsynth/vsynth3-dv-fhd |   4 +
 tests/ref/vsynth/vsynth3-dv-hd  |   4 +
 10 files changed, 560 insertions(+), 82 deletions(-)
 create mode 100644 tests/ref/vsynth/vsynth1-dv-fhd
 create mode 100644 tests/ref/vsynth/vsynth1-dv-hd
 create mode 100644 tests/ref/vsynth/vsynth2-dv-fhd
 create mode 100644 tests/ref/vsynth/vsynth2-dv-hd
 create mode 100644 tests/ref/vsynth/vsynth3-dv-fhd
 create mode 100644 tests/ref/vsynth/vsynth3-dv-hd

diff --git a/libavcodec/dv.h b/libavcodec/dv.h
index 7ef5b7c552..0205d72347 100644
--- a/libavcodec/dv.h
+++ b/libavcodec/dv.h
@@ -83,6 +83,7 @@ enum dv_pack_type {
 
 #define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10)
 #define DV_PROFILE_IS_1080i50(p) (((p)->video_stype == 0x14) && ((p)->dsf == 
1))
+#define DV_PROFILE_IS_1080i60(p) (((p)->video_stype == 0x14) && ((p)->dsf == 
0))
 #define DV_PROFILE_IS_720p50(p)  (((p)->video_stype == 0x18) && ((p)->dsf == 
1))
 
 /**
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index ce2fc75daa..3afeb5ebb8 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -60,10 +60,7 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
 ff_dv_print_profiles(avctx, AV_LOG_ERROR);
 return AVERROR(EINVAL);
 }
-if (avctx->height > 576) {
-av_log(avctx, AV_LOG_ERROR, "DVCPRO HD encoding is not supported.\n");
-return AVERROR_PATCHWELCOME;
-}
+
 ret = ff_dv_init_dynamic_tables(s, s->sys);
 if (ret < 0) {
 av_log(avctx, AV_LOG_ERROR, "Error initializing work tables.\n");
@@ -90,6 +87,7 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
 }
 
 /* bit budget for AC only in 5 MBs */
+static const int vs_total_ac_bits_hd = (68 * 6 + 52*2) * 5;
 static const int vs_total_ac_bits = (100 * 4 + 68 * 2) * 5;
 static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
 
@@ -158,6 +156,11 @@ typedef struct EncBlockInfo {
 uint8_t  sign[64];
 uint8_t  partial_bit_count;
 uint32_t partial_bit_buffer; /* we can't use uint16_t here */
+/* used by DV100 only: a copy of the weighted and classified but
+   not-yet-quantized AC coefficients. This is necessary for
+   re-quantizing at different steps. */
+int16_t  save[64];
+int  min_qlevel; /* DV100 only: minimum qlevel (for AC coefficients 
>255) */
 } EncBlockInfo;
 
 static av_always_inline PutBitContext *dv_encode_ac(EncBlockInfo *bi,
@@ -243,13 +246,123 @@ static const int dv_weight_248[64] = {
 170627, 170627, 153560, 153560, 165371, 165371, 144651, 144651,
 };
 
-static av_always_inline int dv_init_enc_block(EncBlockInfo *bi, uint8_t *data,
-  ptrdiff_t linesize,
-  DVVideoContext *s, int bias)
+/* setting this to 1 results in a faster codec but
+ * somewhat lower image quality */
+#define DV100_SACRIFICE_QUALITY_FOR_SPEED 1
+#define DV100_ENABLE_FINER 1
+
+/* pack combination of QNO and CNO into a single 8-bit value */
+#define DV100_MAKE_QLEVEL(qno,cno) ((qno<<2) | (cno))
+#define DV100_QLEVEL_QNO(qlevel) (qlevel>>2)
+#define DV100_QLEVEL_CNO(qlevel) (qlevel&0x3)
+
+#define DV100_NUM_QLEVELS 31
+
+/* The quantization step is determined by a combination of QNO and
+   CNO. We refer to these combinations as "qlevels" (this term is our
+   own, it's not mentioned in the spec). We use CNO, a multiplier on
+   the quantization step, to "fill in the gaps" between quantization
+   steps associated with successive values of QNO. e.g. there is no
+   QNO for a quantization step of 10, but we can use QNO=5 CNO=1 to
+   get the same result. The table below encodes combinations of QNO
+   and CNO in order of increasing quantization coarseness. */
+static const uint8_t dv100_qlevels[DV100_NUM_QLEVELS] = {
+DV100_MAKE_QLEVEL( 1,0), //  1*1= 1
+DV100_MAKE_QLEVEL( 1,0), //  1*1= 1
+DV100_MAKE_QLEVEL( 2,0), //  2*1= 2
+DV100_MAKE_QLEVEL( 3,0), //  3*1= 3
+DV100_MAKE_QLEVEL( 4,0), //  4*1= 4
+DV100_MAKE_QLEVEL( 5,0), //  5*1= 5
+DV100_MAKE_QLEVEL( 6,0), //  6*1= 6
+DV100_MAKE_QLEVEL( 7,0), //  7*1= 7
+DV100_MAKE_QLEVEL( 8,0), //  8*1= 8
+DV100_MAKE_QLEVEL( 5,1), //  5*2=10
+DV100_MAKE_QLEVEL( 6,1), //  6*2=12
+DV100_MAKE_QLEVEL( 7,1), //  7*2=14
+DV100_MAKE_QLEVEL( 9,0), // 16*1=16
+DV100_MAKE_QLEVEL(10,0), // 18*1=18
+DV100_MAKE_QLEVEL(11,0), // 20*1=20
+DV100_MAKE_QLEVEL(12,0), // 22*1=22
+DV100_MAKE_QLEVEL(13,0), // 24*1=24
+DV100_MAKE_QLEVEL(14,0), // 28*1=28
+DV100_MAKE_QLEVEL( 9,1), // 16*2=32
+DV100_MAKE_QLEVEL(10,1), // 18*2=36
+DV100_MAKE_QLEVEL(11,1), /

Re: [FFmpeg-devel] [PATCH] avcodec/dvdec: correctly decode bottom mb row in 1080i field mode

2019-11-06 Thread Baptiste Coudurier

> On Nov 2, 2019, at 11:07 PM, Carl Eugen Hoyos  wrote:
> 
> Am Sa., 2. Nov. 2019 um 20:02 Uhr schrieb Baptiste Coudurier
> :
>> 
>> On Wed, Sep 11, 2019 at 12:29 PM Baptiste Coudurier <
>> baptiste.coudur...@gmail.com> wrote:
>> 
>>> ---
>>> libavcodec/dv.h|  2 ++
>>> libavcodec/dvdec.c | 90 +++---
>>> 2 files changed, 72 insertions(+), 20 deletions(-)
>>> 
>>> diff --git a/libavcodec/dv.h b/libavcodec/dv.h
>>> index 0e97bb200e..7ef5b7c552 100644
>>> --- a/libavcodec/dv.h
>>> +++ b/libavcodec/dv.h
>>> @@ -31,6 +31,7 @@
>>> #include "dv_profile.h"
>>> #include "me_cmp.h"
>>> #include "vlc.h"
>>> +#include "idctdsp.h"
>>> 
>>> typedef struct DVwork_chunk {
>>> uint16_t buf_offset;
>>> @@ -52,6 +53,7 @@ typedef struct DVVideoContext {
>>> me_cmp_func ildct_cmp;
>>> DVwork_chunk work_chunks[4 * 12 * 27];
>>> uint32_t idct_factor[2 * 4 * 16 * 64];
>>> +IDCTDSPContext idsp;
>>> 
>>> int quant_deadzone;
>>> } DVVideoContext;
>>> diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
>>> index 89864f2edc..4345cd9e29 100644
>>> --- a/libavcodec/dvdec.c
>>> +++ b/libavcodec/dvdec.c
>>> @@ -45,7 +45,6 @@
>>> #include "dv_profile_internal.h"
>>> #include "dvdata.h"
>>> #include "get_bits.h"
>>> -#include "idctdsp.h"
>>> #include "internal.h"
>>> #include "put_bits.h"
>>> #include "simple_idct.h"
>>> @@ -177,24 +176,22 @@ static void dv_init_weight_tables(DVVideoContext
>>> *ctx, const AVDVProfile *d)
>>> static av_cold int dvvideo_decode_init(AVCodecContext *avctx)
>>> {
>>> DVVideoContext *s = avctx->priv_data;
>>> -IDCTDSPContext idsp;
>>> int i;
>>> 
>>> -memset(&idsp,0, sizeof(idsp));
>>> -ff_idctdsp_init(&idsp, avctx);
>>> +ff_idctdsp_init(&s->idsp, avctx);
>>> 
>>> for (i = 0; i < 64; i++)
>>> -s->dv_zigzag[0][i] = idsp.idct_permutation[ff_zigzag_direct[i]];
>>> +s->dv_zigzag[0][i] =
>>> s->idsp.idct_permutation[ff_zigzag_direct[i]];
>>> 
>>> if (avctx->lowres){
>>> for (i = 0; i < 64; i++){
>>> int j = ff_dv_zigzag248_direct[i];
>>> -s->dv_zigzag[1][i] = idsp.idct_permutation[(j & 7) + (j & 8)
>>> * 4 + (j & 48) / 2];
>>> +s->dv_zigzag[1][i] = s->idsp.idct_permutation[(j & 7) + (j &
>>> 8) * 4 + (j & 48) / 2];
>>> }
>>> }else
>>> memcpy(s->dv_zigzag[1], ff_dv_zigzag248_direct,
>>> sizeof(s->dv_zigzag[1]));
>>> 
>>> -s->idct_put[0] = idsp.idct_put;
>>> +s->idct_put[0] = s->idsp.idct_put;
>>> s->idct_put[1] = ff_simple_idct248_put;
>>> 
>>> return ff_dvvideo_init(avctx);
>>> @@ -272,6 +269,49 @@ static inline void bit_copy(PutBitContext *pb,
>>> GetBitContext *gb)
>>> put_bits(pb, bits_left, get_bits(gb, bits_left));
>>> }
>>> 
>>> +static av_always_inline void put_block_8x4(int16_t *block, uint8_t
>>> *restrict p, int stride)
>>> +{
>>> +int i, j;
>>> +const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
>>> +
>>> +for (i = 0; i < 4; i++) {
>>> +for (j = 0; j < 8; j++)
>>> +p[j] = cm[block[j]];
>>> +block += 8;
>>> +p += stride;
>>> +}
>>> +}
>>> +
>>> +static void dv100_idct_put_last_row_field_chroma(DVVideoContext *s,
>>> uint8_t *data,
>>> + int stride, int16_t
>>> *blocks)
>>> +{
>>> +s->idsp.idct(blocks + 0*64);
>>> +s->idsp.idct(blocks + 1*64);
>>> +
>>> +put_block_8x4(blocks+0*64,   data,  stride<<1);
>>> +put_block_8x4(blocks+0*64 + 4*8, data + 8,  stride<<1);
>>> +put_block_8x4(blocks+1*64,   data + stride, stride<<1);
>>> +put_block_8x4(blocks+1*64 + 4*8, data + 8 + stride, stride<<1);
>>> +}
>>> +
>>> +static void dv100_idct_put_last_row_field_luma(DVVideoContext *s, uint8_t
>>> *data,
>>> +   int stride, int16_t
>>> *blocks)
>>> +{
>>> +s->idsp.idct(blocks + 0*64);
>>> +s->idsp.idct(blocks + 1*64);
>>> +s->idsp.idct(blocks + 2*64);
>>> +s->idsp.idct(blocks + 3*64);
>>> +
>>> +put_block_8x4(blocks+0*64,   data,   stride<<1);
>>> +put_block_8x4(blocks+0*64 + 4*8, data + 16,  stride<<1);
>>> +put_block_8x4(blocks+1*64,   data + 8,   stride<<1);
>>> +put_block_8x4(blocks+1*64 + 4*8, data + 24,  stride<<1);
>>> +put_block_8x4(blocks+2*64,   data + stride,  stride<<1);
>>> +put_block_8x4(blocks+2*64 + 4*8, data + 16 + stride, stride<<1);
>>> +put_block_8x4(blocks+3*64,   data + 8  + stride, stride<<1);
>>> +put_block_8x4(blocks+3*64 + 4*8, data + 24 + stride, stride<<1);
>>> +}
>>> +
>>> /* mb_x and mb_y are in units of 8 pixels */
>>> static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
>>> {
>>> @@ -443,14 +483,18 @@ retry:
>>> }
>>> y_ptr= s->frame->data[0] +
>>>((mb_y * s->frame->linesize[0] + mb_x) <<
>>> log2_blocksize);
>>> -linesize = s->fram

Re: [FFmpeg-devel] [PATCH] lavf/movenc: Replace dts by pts to calculate duration

2019-11-06 Thread Michael Niedermayer
On Wed, Nov 06, 2019 at 10:36:11AM +0800, manuelyuan wrote:
> From: Mengyang Yuan 
> 
> In this case, the input video is of dynamic frame rate and we don't want to
> duplicate or drop frames, but the output video duration calculated by DTS is
> incorrect, I solved it by using PTS.
> There are many UGC videos with dynamic frame rates, which are represented by
> PTS jumps. After transcoding with ffmpeg -vsync 0 or -vsync 2, the output
> video duration becomes longer.By reading the code of x264/encoder/encoder.c,
> I found that in order to predict the B frame, x264 needs to ensure that there
> are enough reference frames when DTS = 0, so the DTS of these reference frames
> will subtract the cache time. However, the cache time includes the part of PTS
> jumps, which results in the abnormal small DTS.
> 
> Signed-off-by: Mengyang Yuan 
> ---
>  libavformat/movenc.c | 23 ++-
>  libavformat/movenc.h |  2 ++
>  2 files changed, 16 insertions(+), 9 deletions(-)

this breaks make fate / changes checksums
if the changes are intended, the references would need to be updated
with the patch doing the change

make: *** [fate-lavf-mp4] Error 1
make: *** [fate-lavf-mov] Error 1
make: *** [fate-binsub-movtextenc] Error 1
make: *** [fate-movenc] Error 1

thanks

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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


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

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

Re: [FFmpeg-devel] [PATCH] avformat/movenc: Support for variable timescale in mov containers

2019-11-06 Thread Michael Niedermayer
On Wed, Nov 06, 2019 at 11:41:15AM +, Kevin Wheatley wrote:
> On Tue, Nov 5, 2019 at 4:52 PM Michael Niedermayer
>  wrote:
> > Assuming this doesnt violate any specifications and assuming that
> > it works with all players.
> > Then it would make sense to select this value automatically based
> > on the stream timestamps or timebases.
> > maybe there could be still a -mov_timescale but with an option for
> > "auto" to autoselect a small one which allows accurate representation
> > of most streams
> 
> Michael,
> 
> thanks for the feedback, I did consider this, but I am not that
> familiar with the code base of FFmpeg to know what the 'right' data
> fields to use are and at what point during the initialisation process
> of the movenc code it is valid to use them.
> 
> There certainly seams to be a number of points at which the code tries
> to compute a lowest common multiple in the general FFmpeg code and a
> number of fields representing timebases, frame rates etc.
> 

> If somebody can help point me at what I should use, then I'm happy to
> add something to automatically determine something.

AVStream.time_base or track->timescale or the fields it is set from 
the code setting it should be a starting point for this.

The lowest common multiple will not work alone.
Because its unbounded and can exceed any limit even 64bit integers
easily

what is simple and might work is to simply write a simple brute force
implementation, just try all values from 500 to 2000 
thats within a factor of 2 of the current default
its only 1500 cases to try with no optimizations so speed should be
a non issue. But this can surely be optimized ...
The case to select could then be the one that can represent most
streams accurately.


> 
> In terms of the specification, the Apple documentation certainly
> recommends the use of 600 on p221 of
> https://developer.apple.com/standards/qtff-2001.pdf for most integer
> frame rates, but as the following section in that document says this
> does not work for 23.976 or 29.97.
> 
> For newer frame rates like 48 and any other number of 'new' content
> types, those number fail so whilst  I'd suggest using the Apple number
> for the well used rates, I guess a computation would be needed for
> other things.
> 
> Finally what about the default behaviour, would it be the old use a
> fixed setting or would we change the default to be automatic with the
> option of explicitly passing in 1000 to mimic the previous behaviour
> if required (plus any updates to fate to account for the change).

i would leave the default for now. So we change one thing at a time
once this had a bit of testing the default should be changed to auto
probably

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri


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

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

Re: [FFmpeg-devel] [PATCH 19/23] avformat/matroskaenc: Improve mimetype search

2019-11-06 Thread Andreas Rheinhardt
James Almer:
> On 11/5/2019 11:49 PM, Andreas Rheinhardt wrote:
>> Use the mime_types of the corresponding AVCodecDescriptor instead of own
>> arrays. The former are more encompassing.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>  libavcodec/codec_desc.c   |  1 +
>>  libavformat/matroskaenc.c | 14 +++---
>>  2 files changed, 4 insertions(+), 11 deletions(-)
>>
>> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
>> index 0602ecb1b5..837b09e7f4 100644
>> --- a/libavcodec/codec_desc.c
>> +++ b/libavcodec/codec_desc.c
>> @@ -3020,6 +3020,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
>>  .name  = "text",
>>  .long_name = NULL_IF_CONFIG_SMALL("raw UTF-8 text"),
>>  .props = AV_CODEC_PROP_TEXT_SUB,
>> +.mime_types= MT("text/plain"),
>>  },
>>  {
>>  .id= AV_CODEC_ID_XSUB,
>> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
>> index 19d9b0bc66..f2c8a66a03 100644
>> --- a/libavformat/matroskaenc.c
>> +++ b/libavformat/matroskaenc.c
>> @@ -1694,17 +1694,9 @@ static int mkv_write_attachments(AVFormatContext *s)
>>  if (t = av_dict_get(st->metadata, "mimetype", NULL, 0))
>>  mimetype = t->value;
>>  else if (st->codecpar->codec_id != AV_CODEC_ID_NONE ) {
>> -int i;
>> -for (i = 0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++)
>> -if (ff_mkv_mime_tags[i].id == st->codecpar->codec_id) {
>> -mimetype = ff_mkv_mime_tags[i].str;
>> -break;
>> -}
>> -for (i = 0; ff_mkv_image_mime_tags[i].id != AV_CODEC_ID_NONE; 
>> i++)
>> -if (ff_mkv_image_mime_tags[i].id == st->codecpar->codec_id) 
>> {
>> -mimetype = ff_mkv_image_mime_tags[i].str;
>> -break;
>> -}
>> +const AVCodecDescriptor *desc = 
>> avcodec_descriptor_get(st->codecpar->codec_id);
>> +if (desc && desc->mime_types)
>> +mimetype = desc->mime_types[0];
> 
> This will change the value written for AV_CODEC_ID_BIN_DATA from
> "binary" to "application/octet-stream". Is that intended and/or desirable?
> 
Both. application/octet-stream is on the list of mimetypes [1] and it
is used as default value for binary data [2], whereas "binary" is
AFAIK not even a valid name for a mimetype (and it is also not on the
list of mimetypes and neither does MKVToolNix offer said mimetype (it
uses application/octet-stream for unrecognized non-textual files)).
I don't know whether there are really files that use this mimetype in
the wild. The commit message for c9212abf indicates that there are,
but even in this case the muxer should not use this for
AV_CODEC_ID_BIN_DATA in the absence of a user-specified mimetype.

- Andreas

[1]: https://www.iana.org/assignments/media-types/media-types.xhtml
[2]: E.g.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH] avfilter: remove useless cast

2019-11-06 Thread Zhao Zhili


> On Nov 6, 2019, at 10:15 PM, Fu, Linjie  wrote:
> 
>> -Original Message-
>> From: ffmpeg-devel  On Behalf Of
>> "zhilizhao(???)"
>> Sent: Wednesday, November 6, 2019 21:09
>> To: FFmpeg development discussions and patches > de...@ffmpeg.org>
>> Subject: Re: [FFmpeg-devel] [PATCH] avfilter: remove useless cast
>> 
>> 
>> 
>>> On Oct 29, 2019, at 10:28 PM, zhilizhao(赵志立) 
>> wrote:
>>> 
>>> 
 On Oct 29, 2019, at 9:15 PM, Paul B Mahol  wrote:
 
 On 10/29/19, Michael Niedermayer  wrote:
> On Mon, Oct 28, 2019 at 11:18:04AM +0800, myp...@gmail.com wrote:
>> On Mon, Oct 28, 2019 at 12:03 AM Zhao Zhili 
>> wrote:
>>> 
>>> ---
>>> libavfilter/allfilters.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
>>> index d136734338..6156066028 100644
>>> --- a/libavfilter/allfilters.c
>>> +++ b/libavfilter/allfilters.c
>>> @@ -503,7 +503,7 @@ const AVFilter *avfilter_get_by_name(const
>> char
>>> *name)
>>> 
>>>   while ((f = av_filter_iterate(&opaque)))
>>>   if (!strcmp(f->name, name))
>>> -return (AVFilter *)f;
>>> +return f;
>>> 
>>>   return NULL;
>>> }
>>> --
>>> 2.21.0
>> LGTM
> 
> will apply
> 
 
 Breaks ABI.
>>> 
>>> I don’t get it, would you care to elaborate?
>> 
>> Ping.
>> 
> 
> Is this because of :
> "9. Change the const or volatile qualifier of a member function"
> 
> Some compilers encode the constness of a function in the mangled
> name and hence changing the function from const to non-const changes
> the mangled name.
> 
> https://www.acodersjourney.com/20-abi-breaking-changes/ 
> 

It doesn't change the qualifier of function return type or local variable.
And mangle/demangle doesn't matter for C, right?
 
const AVFilter *avfilter_get_by_name(const char *name)
{
const AVFilter *f = NULL;
void *opaque = 0;

if (!name)
return NULL;

while ((f = av_filter_iterate(&opaque)))
if (!strcmp(f->name, name))
return (AVFilter *)f;

return NULL;
}


> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

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

Re: [FFmpeg-devel] [PATCH 5/5] avcodec/g729dec: Use 64bit and clip in scalar product

2019-11-06 Thread Michael Niedermayer
On Wed, Nov 06, 2019 at 12:44:32AM +0100, Carl Eugen Hoyos wrote:
> Am Mi., 6. Nov. 2019 um 00:31 Uhr schrieb Michael Niedermayer
> :
> >
> > The G729 reference clips after each individual operation and keeps
> > track if overflow occurred (in the fixed point implementation)
> 
> I believe this is missing the word "decoder".

locally added

thx

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

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


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

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

Re: [FFmpeg-devel] [PATCH 19/23] avformat/matroskaenc: Improve mimetype search

2019-11-06 Thread James Almer
On 11/5/2019 11:49 PM, Andreas Rheinhardt wrote:
> Use the mime_types of the corresponding AVCodecDescriptor instead of own
> arrays. The former are more encompassing.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/codec_desc.c   |  1 +
>  libavformat/matroskaenc.c | 14 +++---
>  2 files changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 0602ecb1b5..837b09e7f4 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -3020,6 +3020,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
>  .name  = "text",
>  .long_name = NULL_IF_CONFIG_SMALL("raw UTF-8 text"),
>  .props = AV_CODEC_PROP_TEXT_SUB,
> +.mime_types= MT("text/plain"),
>  },
>  {
>  .id= AV_CODEC_ID_XSUB,
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 19d9b0bc66..f2c8a66a03 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -1694,17 +1694,9 @@ static int mkv_write_attachments(AVFormatContext *s)
>  if (t = av_dict_get(st->metadata, "mimetype", NULL, 0))
>  mimetype = t->value;
>  else if (st->codecpar->codec_id != AV_CODEC_ID_NONE ) {
> -int i;
> -for (i = 0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++)
> -if (ff_mkv_mime_tags[i].id == st->codecpar->codec_id) {
> -mimetype = ff_mkv_mime_tags[i].str;
> -break;
> -}
> -for (i = 0; ff_mkv_image_mime_tags[i].id != AV_CODEC_ID_NONE; 
> i++)
> -if (ff_mkv_image_mime_tags[i].id == st->codecpar->codec_id) {
> -mimetype = ff_mkv_image_mime_tags[i].str;
> -break;
> -}
> +const AVCodecDescriptor *desc = 
> avcodec_descriptor_get(st->codecpar->codec_id);
> +if (desc && desc->mime_types)
> +mimetype = desc->mime_types[0];

This will change the value written for AV_CODEC_ID_BIN_DATA from
"binary" to "application/octet-stream". Is that intended and/or desirable?

>  }
>  if (!mimetype) {
>  av_log(s, AV_LOG_ERROR, "Attachment stream %d has no mimetype 
> tag and "
> 

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

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

Re: [FFmpeg-devel] [PATCH] avfilter: remove useless cast

2019-11-06 Thread Fu, Linjie
> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> "zhilizhao(???)"
> Sent: Wednesday, November 6, 2019 21:09
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] avfilter: remove useless cast
> 
> 
> 
> > On Oct 29, 2019, at 10:28 PM, zhilizhao(赵志立) 
> wrote:
> >
> >
> >> On Oct 29, 2019, at 9:15 PM, Paul B Mahol  wrote:
> >>
> >> On 10/29/19, Michael Niedermayer  wrote:
> >>> On Mon, Oct 28, 2019 at 11:18:04AM +0800, myp...@gmail.com wrote:
>  On Mon, Oct 28, 2019 at 12:03 AM Zhao Zhili 
>  wrote:
> >
> > ---
> > libavfilter/allfilters.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> > index d136734338..6156066028 100644
> > --- a/libavfilter/allfilters.c
> > +++ b/libavfilter/allfilters.c
> > @@ -503,7 +503,7 @@ const AVFilter *avfilter_get_by_name(const
> char
> > *name)
> >
> >while ((f = av_filter_iterate(&opaque)))
> >if (!strcmp(f->name, name))
> > -return (AVFilter *)f;
> > +return f;
> >
> >return NULL;
> > }
> > --
> > 2.21.0
>  LGTM
> >>>
> >>> will apply
> >>>
> >>
> >> Breaks ABI.
> >
> > I don’t get it, would you care to elaborate?
> 
> Ping.
> 

Is this because of :
"9. Change the const or volatile qualifier of a member function"

Some compilers encode the constness of a function in the mangled
name and hence changing the function from const to non-const changes
the mangled name.

https://www.acodersjourney.com/20-abi-breaking-changes/

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

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

Re: [FFmpeg-devel] [PATCH] lavc/qsvenc: add the missing vp9 file

2019-11-06 Thread Fu, Linjie
> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Dennis Mungai
> Sent: Wednesday, November 6, 2019 20:36
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Cc: Zhong Li 
> Subject: Re: [FFmpeg-devel] [PATCH] lavc/qsvenc: add the missing vp9 file
> 
> On Tue, 5 Nov 2019 at 12:22, Fu, Linjie  wrote:
> >
> > > -Original Message-
> > > From: ffmpeg-devel  On Behalf Of
> > > Dennis Mungai
> > > Sent: Tuesday, November 5, 2019 13:04
> > > To: FFmpeg development discussions and patches  > > de...@ffmpeg.org>
> > > Cc: Zhong Li 
> > > Subject: Re: [FFmpeg-devel] [PATCH] lavc/qsvenc: add the missing vp9
> file
> > >
> > > On Mon, 4 Nov 2019 at 10:12, Zhong Li  wrote:
> > > >
> > > > It is missed in commit 3358380
> > > >
> > > > Signed-off-by: Zhong Li 
> > > > ---
> > > >  libavcodec/qsvenc_vp9.c | 113
> > > 
> > > >  1 file changed, 113 insertions(+)
> > > >  create mode 100644 libavcodec/qsvenc_vp9.c
> > > >
> > > > diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c
> > > > new file mode 100644
> > > > index 000..9402f80
> > > > --- /dev/null
> > > > +++ b/libavcodec/qsvenc_vp9.c
> > > > @@ -0,0 +1,113 @@
> > > > +/*
> > > > + * Intel MediaSDK QSV based VP9 encoder
> > > > + *
> > > > + * This file is part of FFmpeg.
> > > > + *
> > > > + * FFmpeg is free software; you can redistribute it and/or
> > > > + * modify it under the terms of the GNU Lesser General Public
> > > > + * License as published by the Free Software Foundation; either
> > > > + * version 2.1 of the License, or (at your option) any later version.
> > > > + *
> > > > + * FFmpeg is distributed in the hope that it will be useful,
> > > > + * but WITHOUT ANY WARRANTY; without even the implied warranty
> of
> > > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
> the
> > > GNU
> > > > + * Lesser General Public License for more details.
> > > > + *
> > > > + * You should have received a copy of the GNU Lesser General Public
> > > > + * License along with FFmpeg; if not, write to the Free Software
> > > > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-
> 1301
> > > USA
> > > > + */
> > > > +
> > > > +
> > > > +#include 
> > > > +#include 
> > > > +
> > > > +#include 
> > > > +
> > > > +#include "libavutil/common.h"
> > > > +#include "libavutil/opt.h"
> > > > +
> > > > +#include "avcodec.h"
> > > > +#include "internal.h"
> > > > +#include "qsv.h"
> > > > +#include "qsv_internal.h"
> > > > +#include "qsvenc.h"
> > > > +
> > > > +typedef struct QSVVP9EncContext {
> > > > +AVClass *class;
> > > > +QSVEncContext qsv;
> > > > +} QSVVP9EncContext;
> > > > +
> > > > +static av_cold int qsv_enc_init(AVCodecContext *avctx)
> > > > +{
> > > > +QSVVP9EncContext *q = avctx->priv_data;
> > > > +q->qsv.low_power = 1;
> > > > +
> > > > +return ff_qsv_enc_init(avctx, &q->qsv);
> > > > +}
> > > > +
> > > > +static int qsv_enc_frame(AVCodecContext *avctx, AVPacket *pkt,
> > > > + const AVFrame *frame, int *got_packet)
> > > > +{
> > > > +QSVVP9EncContext *q = avctx->priv_data;
> > > > +
> > > > +return ff_qsv_encode(avctx, &q->qsv, pkt, frame, got_packet);
> > > > +}
> > > > +
> > > > +static av_cold int qsv_enc_close(AVCodecContext *avctx)
> > > > +{
> > > > +QSVVP9EncContext *q = avctx->priv_data;
> > > > +
> > > > +return ff_qsv_enc_close(avctx, &q->qsv);
> > > > +}
> > > > +
> > > > +#define OFFSET(x) offsetof(QSVVP9EncContext, x)
> > > > +#define VE AV_OPT_FLAG_VIDEO_PARAM |
> > > AV_OPT_FLAG_ENCODING_PARAM
> > > > +static const AVOption options[] = {
> > > > +QSV_COMMON_OPTS
> > > > +
> > > > +{ "profile",   NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT,   { 
> > > > .i64 =
> > > MFX_PROFILE_UNKNOWN },   0,   INT_MAX,  VE,  "profile" },
> > > > +{ "unknown",   NULL, 0,   AV_OPT_TYPE_CONST, { 
> > > > .i64 =
> > > MFX_PROFILE_UNKNOWN},   INT_MIN,  INT_MAX,  VE,  "profile" },
> > > > +{ "profile0",  NULL, 0,   AV_OPT_TYPE_CONST, { 
> > > > .i64 =
> > > MFX_PROFILE_VP9_0   },  INT_MIN,  INT_MAX,  VE,  "profile" },
> > > > +{ "profile1",  NULL, 0,   AV_OPT_TYPE_CONST, { 
> > > > .i64 =
> > > MFX_PROFILE_VP9_1   },  INT_MIN,  INT_MAX,  VE,  "profile" },
> > > > +{ "profile2",  NULL, 0,   AV_OPT_TYPE_CONST, { 
> > > > .i64 =
> > > MFX_PROFILE_VP9_2   },  INT_MIN,  INT_MAX,  VE,  "profile" },
> > > > +{ "profile3",  NULL, 0,   AV_OPT_TYPE_CONST, { 
> > > > .i64 =
> > > MFX_PROFILE_VP9_3   },  INT_MIN,  INT_MAX,  VE,  "profile" },
> > > > +
> > > > +{ NULL },
> > > > +};
> > > > +
> > > > +static const AVClass class = {
> > > > +.class_name = "vp9_qsv encoder",
> > > > +.item_name  = av_default_item_name,
> > > > +.option = options,
> > > > +.version= LIBAVUTIL_VERSION_INT,
> > > > +};
> > > > +
> > > > +static const AVCodecDefault q

Re: [FFmpeg-devel] [PATCH] avfilter: remove useless cast

2019-11-06 Thread zhilizhao(赵志立)


> On Oct 29, 2019, at 10:28 PM, zhilizhao(赵志立)  wrote:
> 
> 
>> On Oct 29, 2019, at 9:15 PM, Paul B Mahol  wrote:
>> 
>> On 10/29/19, Michael Niedermayer  wrote:
>>> On Mon, Oct 28, 2019 at 11:18:04AM +0800, myp...@gmail.com wrote:
 On Mon, Oct 28, 2019 at 12:03 AM Zhao Zhili 
 wrote:
> 
> ---
> libavfilter/allfilters.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index d136734338..6156066028 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -503,7 +503,7 @@ const AVFilter *avfilter_get_by_name(const char
> *name)
> 
>while ((f = av_filter_iterate(&opaque)))
>if (!strcmp(f->name, name))
> -return (AVFilter *)f;
> +return f;
> 
>return NULL;
> }
> --
> 2.21.0
 LGTM
>>> 
>>> will apply
>>> 
>> 
>> Breaks ABI.
> 
> I don’t get it, would you care to elaborate?

Ping.

> 
>> 
>>> thx
>>> 
>>> [...]
>>> 
>>> --
>>> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>>> 
>>> Good people do not need laws to tell them to act responsibly, while bad
>>> people will find a way around the laws. -- Plato
>>> 
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> 



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

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

Re: [FFmpeg-devel] [PATCH] lavc/qsvenc: add the missing vp9 file

2019-11-06 Thread Dennis Mungai
On Tue, 5 Nov 2019 at 12:22, Fu, Linjie  wrote:
>
> > -Original Message-
> > From: ffmpeg-devel  On Behalf Of
> > Dennis Mungai
> > Sent: Tuesday, November 5, 2019 13:04
> > To: FFmpeg development discussions and patches  > de...@ffmpeg.org>
> > Cc: Zhong Li 
> > Subject: Re: [FFmpeg-devel] [PATCH] lavc/qsvenc: add the missing vp9 file
> >
> > On Mon, 4 Nov 2019 at 10:12, Zhong Li  wrote:
> > >
> > > It is missed in commit 3358380
> > >
> > > Signed-off-by: Zhong Li 
> > > ---
> > >  libavcodec/qsvenc_vp9.c | 113
> > 
> > >  1 file changed, 113 insertions(+)
> > >  create mode 100644 libavcodec/qsvenc_vp9.c
> > >
> > > diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c
> > > new file mode 100644
> > > index 000..9402f80
> > > --- /dev/null
> > > +++ b/libavcodec/qsvenc_vp9.c
> > > @@ -0,0 +1,113 @@
> > > +/*
> > > + * Intel MediaSDK QSV based VP9 encoder
> > > + *
> > > + * This file is part of FFmpeg.
> > > + *
> > > + * FFmpeg is free software; you can redistribute it and/or
> > > + * modify it under the terms of the GNU Lesser General Public
> > > + * License as published by the Free Software Foundation; either
> > > + * version 2.1 of the License, or (at your option) any later version.
> > > + *
> > > + * FFmpeg is distributed in the hope that it will be useful,
> > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > GNU
> > > + * Lesser General Public License for more details.
> > > + *
> > > + * You should have received a copy of the GNU Lesser General Public
> > > + * License along with FFmpeg; if not, write to the Free Software
> > > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
> > > 02110-1301
> > USA
> > > + */
> > > +
> > > +
> > > +#include 
> > > +#include 
> > > +
> > > +#include 
> > > +
> > > +#include "libavutil/common.h"
> > > +#include "libavutil/opt.h"
> > > +
> > > +#include "avcodec.h"
> > > +#include "internal.h"
> > > +#include "qsv.h"
> > > +#include "qsv_internal.h"
> > > +#include "qsvenc.h"
> > > +
> > > +typedef struct QSVVP9EncContext {
> > > +AVClass *class;
> > > +QSVEncContext qsv;
> > > +} QSVVP9EncContext;
> > > +
> > > +static av_cold int qsv_enc_init(AVCodecContext *avctx)
> > > +{
> > > +QSVVP9EncContext *q = avctx->priv_data;
> > > +q->qsv.low_power = 1;
> > > +
> > > +return ff_qsv_enc_init(avctx, &q->qsv);
> > > +}
> > > +
> > > +static int qsv_enc_frame(AVCodecContext *avctx, AVPacket *pkt,
> > > + const AVFrame *frame, int *got_packet)
> > > +{
> > > +QSVVP9EncContext *q = avctx->priv_data;
> > > +
> > > +return ff_qsv_encode(avctx, &q->qsv, pkt, frame, got_packet);
> > > +}
> > > +
> > > +static av_cold int qsv_enc_close(AVCodecContext *avctx)
> > > +{
> > > +QSVVP9EncContext *q = avctx->priv_data;
> > > +
> > > +return ff_qsv_enc_close(avctx, &q->qsv);
> > > +}
> > > +
> > > +#define OFFSET(x) offsetof(QSVVP9EncContext, x)
> > > +#define VE AV_OPT_FLAG_VIDEO_PARAM |
> > AV_OPT_FLAG_ENCODING_PARAM
> > > +static const AVOption options[] = {
> > > +QSV_COMMON_OPTS
> > > +
> > > +{ "profile",   NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT,   { .i64 =
> > MFX_PROFILE_UNKNOWN },   0,   INT_MAX,  VE,  "profile" },
> > > +{ "unknown",   NULL, 0,   AV_OPT_TYPE_CONST, { .i64 =
> > MFX_PROFILE_UNKNOWN},   INT_MIN,  INT_MAX,  VE,  "profile" },
> > > +{ "profile0",  NULL, 0,   AV_OPT_TYPE_CONST, { .i64 =
> > MFX_PROFILE_VP9_0   },  INT_MIN,  INT_MAX,  VE,  "profile" },
> > > +{ "profile1",  NULL, 0,   AV_OPT_TYPE_CONST, { .i64 =
> > MFX_PROFILE_VP9_1   },  INT_MIN,  INT_MAX,  VE,  "profile" },
> > > +{ "profile2",  NULL, 0,   AV_OPT_TYPE_CONST, { .i64 =
> > MFX_PROFILE_VP9_2   },  INT_MIN,  INT_MAX,  VE,  "profile" },
> > > +{ "profile3",  NULL, 0,   AV_OPT_TYPE_CONST, { .i64 =
> > MFX_PROFILE_VP9_3   },  INT_MIN,  INT_MAX,  VE,  "profile" },
> > > +
> > > +{ NULL },
> > > +};
> > > +
> > > +static const AVClass class = {
> > > +.class_name = "vp9_qsv encoder",
> > > +.item_name  = av_default_item_name,
> > > +.option = options,
> > > +.version= LIBAVUTIL_VERSION_INT,
> > > +};
> > > +
> > > +static const AVCodecDefault qsv_enc_defaults[] = {
> > > +{ "b", "1M"},
> > > +{ "refs",  "0" },
> > > +{ "g", "250"   },
> > > +{ "trellis",   "-1"},
> > > +{ "flags", "+cgop" },
> > > +{ NULL },
> > > +};
> > > +
> > > +AVCodec ff_vp9_qsv_encoder = {
> > > +.name   = "vp9_qsv",
> > > +.long_name  = NULL_IF_CONFIG_SMALL("VP9 video (Intel Quick Sync
> > Video acceleration)"),
> > > +.priv_data_size = sizeof(QSVVP9EncContext),
> > > +.type   = AVMEDIA_TYPE_VIDEO,
> > > +.id = AV_CODEC_ID_VP9,
> > > +

[FFmpeg-devel] [PATCH] fftools/ffmpeg_opt: Fix mixed declarations and code

2019-11-06 Thread Andreas Rheinhardt
Introduced in ed3c317d.

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

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index af9a9a6acb..f4ccf3f65e 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -3008,9 +3008,10 @@ static int opt_old2new(void *optctx, const char *opt, 
const char *arg)
 {
 OptionsContext *o = optctx;
 char *s = av_asprintf("%s:%c", opt + 1, *opt);
+int ret;
 if (!s)
 return AVERROR(ENOMEM);
-int ret = parse_option(o, s, arg, options);
+ret = parse_option(o, s, arg, options);
 av_free(s);
 return ret;
 }
@@ -3088,9 +3089,10 @@ static int opt_timecode(void *optctx, const char *opt, 
const char *arg)
 {
 OptionsContext *o = optctx;
 char *tcr = av_asprintf("timecode=%s", arg);
+int ret;
 if (!tcr)
 return AVERROR(ENOMEM);
-int ret = parse_option(o, "metadata:g", tcr, options);
+ret = parse_option(o, "metadata:g", tcr, options);
 if (ret >= 0)
 ret = av_dict_set(&o->g->codec_opts, "gop_timecode", arg, 0);
 av_free(tcr);
-- 
2.20.1

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

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

Re: [FFmpeg-devel] [PATCH] avformat/movenc: Support for variable timescale in mov containers

2019-11-06 Thread Kevin Wheatley
On Tue, Nov 5, 2019 at 4:52 PM Michael Niedermayer
 wrote:
> Assuming this doesnt violate any specifications and assuming that
> it works with all players.
> Then it would make sense to select this value automatically based
> on the stream timestamps or timebases.
> maybe there could be still a -mov_timescale but with an option for
> "auto" to autoselect a small one which allows accurate representation
> of most streams

Michael,

thanks for the feedback, I did consider this, but I am not that
familiar with the code base of FFmpeg to know what the 'right' data
fields to use are and at what point during the initialisation process
of the movenc code it is valid to use them.

There certainly seams to be a number of points at which the code tries
to compute a lowest common multiple in the general FFmpeg code and a
number of fields representing timebases, frame rates etc.

If somebody can help point me at what I should use, then I'm happy to
add something to automatically determine something.

In terms of the specification, the Apple documentation certainly
recommends the use of 600 on p221 of
https://developer.apple.com/standards/qtff-2001.pdf for most integer
frame rates, but as the following section in that document says this
does not work for 23.976 or 29.97.

For newer frame rates like 48 and any other number of 'new' content
types, those number fail so whilst  I'd suggest using the Apple number
for the well used rates, I guess a computation would be needed for
other things.

Finally what about the default behaviour, would it be the old use a
fixed setting or would we change the default to be automatic with the
option of explicitly passing in 1000 to mimic the previous behaviour
if required (plus any updates to fate to account for the change).

Thanks

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

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

[FFmpeg-devel] VDD FFmpeg meeting

2019-11-06 Thread Jean-Baptiste Kempf
Hello fellow multimedia developers,

This week-end, the VDD conference is happening in Tokyo.
Subjects are everything related to low-level multimedia.

Since an important number of developers from the FFmpeg community will be 
present, we will try and discuss a few topics, on the Sunday. But to be more 
inclusive, the meeting will be joinable from the distance with 
Skype/Hangouts/Something-similar and live on IRC.

Since we've had a few heated discussions in the past months, I would suggest to 
discuss the hot topics, and probably prepare future votes on some item points, 
so remote participation is very welcome. Those votes will likely happen by 
email after the discussions, so everyone has time to think about it, and note 
vote during the heat of the moment.

The meeting should happen on Sunday, 15:00 local time (I think 7am in Europe, 
and 10pm USA west cost), if everything goes as planned :D It will might be 
long, since we have lots to cover.

I would also advise us to do this more regularly (every month? every 2 
months?), to smooth things out, before the blow up on IRC or on the mailing 
lists.
And to be able to fine-tune the decisions, since it's difficult to get 
everything right the first time.

Here are some of the topics that people have brought up to me.
Those are in no way binding or impossible to extend: it is very likely that we 
won't cover everything and I would also love new topics to discuss, that I 
forgot.

In no particular order:

  - General Decision making
  - voting powers
  - decision procedure

  - Conflict resolution
  - technical debates
  - community conflicts (including CoC?)

   - Developer meetings
  - what format
  - when / regular schedule
  - as an instance for decision making?

  - Technical points:
 - development process policies
 - gitlab or not, MR or not
 - API changes schedule
 - release schedule
 - code quality and reviews
 - splitting repos or not,
 - CI, CD, fuzzing etc...
   
   - Legal points:
 - nvidia & other hw APIs
 - decklink 
 - NDI
 - hosting

Please share your ideas about points, and other points.
There is no need to debate those ideas now yet :)

With my very best regards,

-- 
Jean-Baptiste Kempf -  President
+33 672 704 734
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread Limin Wang
On Wed, Nov 06, 2019 at 11:18:10AM +0100, Carl Eugen Hoyos wrote:
> Am Mi., 6. Nov. 2019 um 10:01 Uhr schrieb :
> >
> > From: Limin Wang 
> >
> > Signed-off-by: Limin Wang 
> > ---
> >  libavformat/utils.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index 8196442dd1..8381498e2b 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -367,8 +367,7 @@ static int set_codec_from_probe_data(AVFormatContext 
> > *s, AVStream *st,
> > fmt->name, score);
> >  for (i = 0; fmt_id_type[i].name; i++) {
> >  if (!strcmp(fmt->name, fmt_id_type[i].name)) {
> > -if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> > -st->codecpar->sample_rate)
> > +if (st->codecpar->sample_rate)
> >  continue;
> 
> I believe the correct fix is to change the mp3 probe function so that it
> does not return a score of 51 for the pcm pattern of ff ff e8 ff ff ff e8 
> ff...

It has been detected as pcm and have get the valid audio sample rate, why we 
detect it
again here?  
I have run fate testing with the patch and haven't find any broken condition.


> 
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v1] avfilter/vf_vaguedenoiser: use fabsf() instead of FFABS()

2019-11-06 Thread Limin Wang
On Wed, Nov 06, 2019 at 11:11:08AM +0100, Carl Eugen Hoyos wrote:
> Am Mi., 6. Nov. 2019 um 10:31 Uhr schrieb :
> >
> > From: Limin Wang 
> >
> > Signed-off-by: Limin Wang 
> > ---
> >  libavfilter/vf_vaguedenoiser.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/libavfilter/vf_vaguedenoiser.c b/libavfilter/vf_vaguedenoiser.c
> > index a68f7626e6..75a58c363b 100644
> > --- a/libavfilter/vf_vaguedenoiser.c
> > +++ b/libavfilter/vf_vaguedenoiser.c
> > @@ -335,7 +335,7 @@ static void hard_thresholding(float *block, const int 
> > width, const int height,
> >
> >  for (y = 0; y < height; y++) {
> >  for (x = 0; x < width; x++) {
> > -if (FFABS(block[x]) <= threshold)
> > +if (fabsf(block[x]) <= threshold)
> >  block[x] *= frac;
> >  }
> >  block += stride;
> > @@ -359,7 +359,7 @@ static void soft_thresholding(float *block, const int 
> > width, const int height, c
> >  for (y = 0; y < height; y++) {
> >  const int x0 = (y < h) ? w : 0;
> >  for (x = x0; x < width; x++) {
> > -const float temp = FFABS(block[x]);
> > +const float temp = fabsf(block[x]);
> >  if (temp <= threshold)
> >  block[x] *= frac;
> >  else
> > @@ -380,7 +380,7 @@ static void qian_thresholding(float *block, const int 
> > width, const int height,
> >
> >  for (y = 0; y < height; y++) {
> >  for (x = 0; x < width; x++) {
> > -const float temp = FFABS(block[x]);
> > +const float temp = fabsf(block[x]);
> >  if (temp <= threshold) {
> >  block[x] *= frac;
> >  } else {
> 
> Please add a sentence to the commit message that explains why this
> change is a good idea.

block is float type, so I think it's better to use fabsf, isn't right?

> 
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread Limin Wang
On Wed, Nov 06, 2019 at 11:30:41AM +0100, Hendrik Leppkes wrote:
> On Wed, Nov 6, 2019 at 10:01 AM  wrote:
> >
> > From: Limin Wang 
> >
> > Signed-off-by: Limin Wang 
> > ---
> >  libavformat/utils.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index 8196442dd1..8381498e2b 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -367,8 +367,7 @@ static int set_codec_from_probe_data(AVFormatContext 
> > *s, AVStream *st,
> > fmt->name, score);
> >  for (i = 0; fmt_id_type[i].name; i++) {
> >  if (!strcmp(fmt->name, fmt_id_type[i].name)) {
> > -if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> > -st->codecpar->sample_rate)
> > +if (st->codecpar->sample_rate)
> >  continue;
> >  if (st->request_probe > score &&
> >  st->codecpar->codec_id != fmt_id_type[i].id)
> 
> This change seems wrong, as you are practically rejecting probing of
> any audio now, since those would get a sample rate.

By the old logic, I assume sample_rate > 0 means the audio has been detected, 
so don't probe the data again. The old code is for video only I think.
If have condition is broken, it should be add to fate testing.

> 
> - Hendrik
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v3] avdevice/v4l2: Remove av_assert0 when format not supported

2019-11-06 Thread Nicolas George
Andriy Gelman (12019-11-04):
> From: Andriy Gelman 
> 
> Before this commit an av_assert0 would fail if a v4l2 device did not
> support a target format.
> For example,
> ./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts -
> would signal an abort if /dev/video0 did not support h264.
> 
> The new behaviour is to return an AVERROR(EINVAL) error code. An
> av_assert0 has been added to verify this return.
> 
> Fixes #6629
> 
> Signed-off-by: Andriy Gelman 
> ---
>  libavdevice/v4l2.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index 446a243cf8..365bacd771 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -811,7 +811,8 @@ static int device_try_init(AVFormatContext *ctx,
>  }
>  
>  *codec_id = ff_fmt_v4l2codec(*desired_format);
> -av_assert0(*codec_id != AV_CODEC_ID_NONE);
> +if (*codec_id == AV_CODEC_ID_NONE)
> +av_assert0(ret == AVERROR(EINVAL));
>  return ret;
>  }
>  

This version is fine by me, thanks. But I do not maintain this file.

Please remember to reply to the list, not personally; it is the default,
no need to do anything special if your software works normally.

Regards,

-- 
  Nicolas George


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

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

Re: [FFmpeg-devel] [PATCH] Add a new channel layout API

2019-11-06 Thread Nicolas George
Paul B Mahol (12019-10-28):
> +char *av_channel_layout_describe(const AVChannelLayout *channel_layout)
> +{
> +int i;
> +
> +switch (channel_layout->order) {
> +case AV_CHANNEL_ORDER_NATIVE:
> +for (i = 0; channel_layout_map[i].name; i++)
> +if (channel_layout->u.mask == 
> channel_layout_map[i].layout.u.mask)
> +return av_strdup(channel_layout_map[i].name);
> +// fall-through
> +case AV_CHANNEL_ORDER_CUSTOM: {

> +// max 4 bytes for channel name + a separator
> +int size = 5 * channel_layout->nb_channels + 1;
> +char *ret;
> +
> +ret = av_mallocz(size);
> +if (!ret)
> +return NULL;
> +
> +for (i = 0; i < channel_layout->nb_channels; i++) {
> +enum AVChannel ch = 
> av_channel_layout_get_channel(channel_layout, i);
> +const char *ch_name = av_channel_name(ch);
> +
> +if (i)
> +av_strlcat(ret, "+", size);
> +av_strlcat(ret, ch_name, size);
> +}
> +return ret;
> +}

We can do that with AVBPrint.

> +case AV_CHANNEL_ORDER_UNSPEC: {
> +char buf[64];
> +snprintf(buf, sizeof(buf), "%d channels", 
> channel_layout->nb_channels);
> +return av_strdup(buf);
> +}
> +default:
> +return NULL;
> +}
> +}

What is the user interface to designate a specific channel in a channel
layout with duplicates?

For example, I could imagine an equalizer that splits each channel into
three (low, mid, high). Then, with pan :

pan=stereo|FL=0.5*FL0+0.8*FL1+1*FL2|FR=0.5*FR0+0.8*FR1+1*FR2

Unfortunately:

- The API has nothing to specify why there are three FL channels and
  thee FR channels. The possibility to attach an arbitrary label for
  custom layouts should be considered.

- We need something like
  idx = av_channel_layout_get_channel_by_descr(cl, "FL1");


Note: Paul, please do not take these comments as attacks against your
work. You took work that was developed in libav and ported it here, that
is a worthy achievement. But at the time it was designed, libav had
about 1.5 active developers, and they have about a quarter of our
features, and therefore of our needs. With these circumstances, it is
normal they forgot a lot of things. Our goal should be to design an API
that will be convenient to use in the long run, not to integrate their
imperfect API as fast as possible.

Regards,

-- 
  Nicolas George


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

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

Re: [FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread Hendrik Leppkes
On Wed, Nov 6, 2019 at 10:01 AM  wrote:
>
> From: Limin Wang 
>
> Signed-off-by: Limin Wang 
> ---
>  libavformat/utils.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 8196442dd1..8381498e2b 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -367,8 +367,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
> AVStream *st,
> fmt->name, score);
>  for (i = 0; fmt_id_type[i].name; i++) {
>  if (!strcmp(fmt->name, fmt_id_type[i].name)) {
> -if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> -st->codecpar->sample_rate)
> +if (st->codecpar->sample_rate)
>  continue;
>  if (st->request_probe > score &&
>  st->codecpar->codec_id != fmt_id_type[i].id)

This change seems wrong, as you are practically rejecting probing of
any audio now, since those would get a sample rate.

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

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

Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec/libvpxdec: reject video and alpha dimension mismatches

2019-11-06 Thread Carl Eugen Hoyos
Am Mi., 6. Nov. 2019 um 08:28 Uhr schrieb Marton Balint :
>
> ffmpeg | branch: master | Marton Balint  | Sun Oct 27 
> 18:10:36 2019 +0100| [c54268ce02f71c144d444a5e6d35417d5f043ed5] | committer: 
> James Zern
>
> avcodec/libvpxdec: reject video and alpha dimension mismatches
>
> Signed-off-by: Marton Balint 
> Signed-off-by: James Zern 
>
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c54268ce02f71c144d444a5e6d35417d5f043ed5
> ---
>
>  libavcodec/libvpxdec.c | 11 +++
>  1 file changed, 11 insertions(+)
>
> diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
> index fdd5d458d3..1ae2361167 100644
> --- a/libavcodec/libvpxdec.c
> +++ b/libavcodec/libvpxdec.c
> @@ -283,6 +283,17 @@ static int vpx_decode(AVCodecContext *avctx,
>  return ret;
>  }
>
> +if (ctx->has_alpha_channel &&
> +(img->d_w != img_alpha->d_w ||
> + img->d_h != img_alpha->d_h ||
> + img->bit_depth != img_alpha->bit_depth)) {
> +av_log(avctx, AV_LOG_ERROR,
> +   "Video dimensions %dx%d@%dbpp differ from alpha 
> dimensions %dx%d@%dbpp\n",
> +   img->d_w, img->d_h, img->bit_depth,
> +   img_alpha->d_w, img_alpha->d_h, img_alpha->bit_depth);
> +return AVERROR_INVALIDDATA;

Shouldn't this be "bpc" instead of "bpp"?

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

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

Re: [FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread Carl Eugen Hoyos
Am Mi., 6. Nov. 2019 um 10:01 Uhr schrieb :
>
> From: Limin Wang 
>
> Signed-off-by: Limin Wang 
> ---
>  libavformat/utils.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 8196442dd1..8381498e2b 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -367,8 +367,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
> AVStream *st,
> fmt->name, score);
>  for (i = 0; fmt_id_type[i].name; i++) {
>  if (!strcmp(fmt->name, fmt_id_type[i].name)) {
> -if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> -st->codecpar->sample_rate)
> +if (st->codecpar->sample_rate)
>  continue;

I believe the correct fix is to change the mp3 probe function so that it
does not return a score of 51 for the pcm pattern of ff ff e8 ff ff ff e8 ff...

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

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

Re: [FFmpeg-devel] [PATCH] avformat/utils: fix logic failure

2019-11-06 Thread Carl Eugen Hoyos
Am Di., 29. Okt. 2019 um 13:15 Uhr schrieb Paul B Mahol :
>
> On 10/29/19, Michael Niedermayer  wrote:
> > On Tue, Oct 29, 2019 at 10:45:20AM +0100, Paul B Mahol wrote:
> >> Fixes decoding of wav file which is wrongly recognized as mp1 audio.
> >>
> >> Signed-off-by: Paul B Mahol 
> >> ---
> >>  libavformat/utils.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavformat/utils.c b/libavformat/utils.c
> >> index cfb6d03397..bf27531ed0 100644
> >> --- a/libavformat/utils.c
> >> +++ b/libavformat/utils.c
> >> @@ -370,7 +370,7 @@ static int set_codec_from_probe_data(AVFormatContext
> >> *s, AVStream *st,
> >>  if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> >>  st->codecpar->sample_rate)
> >>  continue;
> >> -if (st->request_probe > score &&
> >> +if (st->request_probe > score ||
> >>  st->codecpar->codec_id != fmt_id_type[i].id)
> >>  continue;
> >
> > this change is wrong and would break fate,
> > the 2nd term could be removed if it causes problems but they cannot
> > be run as "||"
> >
> > how can this issue be reproduced ?
> >
>
> https://0x0.st/zYLx.wav

This repeated pcm_s16le pattern triggers the mp3 misdetection
(score 51 after 4096 bytes):

  ff ff e8 ff ff ff e8 ff  ff ff e8 ff ff ff e8 ff  ||
*

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

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

Re: [FFmpeg-devel] [PATCH v1] avfilter/vf_vaguedenoiser: use fabsf() instead of FFABS()

2019-11-06 Thread Carl Eugen Hoyos
Am Mi., 6. Nov. 2019 um 10:31 Uhr schrieb :
>
> From: Limin Wang 
>
> Signed-off-by: Limin Wang 
> ---
>  libavfilter/vf_vaguedenoiser.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavfilter/vf_vaguedenoiser.c b/libavfilter/vf_vaguedenoiser.c
> index a68f7626e6..75a58c363b 100644
> --- a/libavfilter/vf_vaguedenoiser.c
> +++ b/libavfilter/vf_vaguedenoiser.c
> @@ -335,7 +335,7 @@ static void hard_thresholding(float *block, const int 
> width, const int height,
>
>  for (y = 0; y < height; y++) {
>  for (x = 0; x < width; x++) {
> -if (FFABS(block[x]) <= threshold)
> +if (fabsf(block[x]) <= threshold)
>  block[x] *= frac;
>  }
>  block += stride;
> @@ -359,7 +359,7 @@ static void soft_thresholding(float *block, const int 
> width, const int height, c
>  for (y = 0; y < height; y++) {
>  const int x0 = (y < h) ? w : 0;
>  for (x = x0; x < width; x++) {
> -const float temp = FFABS(block[x]);
> +const float temp = fabsf(block[x]);
>  if (temp <= threshold)
>  block[x] *= frac;
>  else
> @@ -380,7 +380,7 @@ static void qian_thresholding(float *block, const int 
> width, const int height,
>
>  for (y = 0; y < height; y++) {
>  for (x = 0; x < width; x++) {
> -const float temp = FFABS(block[x]);
> +const float temp = fabsf(block[x]);
>  if (temp <= threshold) {
>  block[x] *= frac;
>  } else {

Please add a sentence to the commit message that explains why this
change is a good idea.

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

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

[FFmpeg-devel] [PATCH v1] avfilter/vf_vaguedenoiser: use fabsf() instead of FFABS()

2019-11-06 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavfilter/vf_vaguedenoiser.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_vaguedenoiser.c b/libavfilter/vf_vaguedenoiser.c
index a68f7626e6..75a58c363b 100644
--- a/libavfilter/vf_vaguedenoiser.c
+++ b/libavfilter/vf_vaguedenoiser.c
@@ -335,7 +335,7 @@ static void hard_thresholding(float *block, const int 
width, const int height,
 
 for (y = 0; y < height; y++) {
 for (x = 0; x < width; x++) {
-if (FFABS(block[x]) <= threshold)
+if (fabsf(block[x]) <= threshold)
 block[x] *= frac;
 }
 block += stride;
@@ -359,7 +359,7 @@ static void soft_thresholding(float *block, const int 
width, const int height, c
 for (y = 0; y < height; y++) {
 const int x0 = (y < h) ? w : 0;
 for (x = x0; x < width; x++) {
-const float temp = FFABS(block[x]);
+const float temp = fabsf(block[x]);
 if (temp <= threshold)
 block[x] *= frac;
 else
@@ -380,7 +380,7 @@ static void qian_thresholding(float *block, const int 
width, const int height,
 
 for (y = 0; y < height; y++) {
 for (x = 0; x < width; x++) {
-const float temp = FFABS(block[x]);
+const float temp = fabsf(block[x]);
 if (temp <= threshold) {
 block[x] *= frac;
 } else {
-- 
2.21.0

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

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

[FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

2019-11-06 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavformat/utils.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8196442dd1..8381498e2b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -367,8 +367,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
AVStream *st,
fmt->name, score);
 for (i = 0; fmt_id_type[i].name; i++) {
 if (!strcmp(fmt->name, fmt_id_type[i].name)) {
-if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
-st->codecpar->sample_rate)
+if (st->codecpar->sample_rate)
 continue;
 if (st->request_probe > score &&
 st->codecpar->codec_id != fmt_id_type[i].id)
-- 
2.21.0

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

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

Re: [FFmpeg-devel] [PATCH V3] avfilter/vf_dnn_processing: add a generic filter for image proccessing with dnn networks

2019-11-06 Thread Guo, Yejun


> -Original Message-
> From: Guo, Yejun
> Sent: Thursday, October 31, 2019 4:33 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Guo, Yejun 
> Subject: [PATCH V3] avfilter/vf_dnn_processing: add a generic filter for image
> proccessing with dnn networks
> 
> This filter accepts all the dnn networks which do image processing.
> Currently, frame with formats rgb24 and bgr24 are supported. Other
> formats such as gray and YUV will be supported next. The dnn network
> can accept data in float32 or uint8 format. And the dnn network can
> change frame size.
> 
> The following is a python script to halve the value of the first
> channel of the pixel. It demos how to setup and execute dnn model
> with python+tensorflow. It also generates .pb file which will be
> used by ffmpeg.
> 
> import tensorflow as tf
> import numpy as np
> import scipy.misc
> in_img = scipy.misc.imread('in.bmp')
> in_img = in_img.astype(np.float32)/255.0
> in_data = in_img[np.newaxis, :]
> filter_data = np.array([0.5, 0, 0, 0, 1., 0, 0, 0,
> 1.]).reshape(1,1,3,3).astype(np.float32)
> filter = tf.Variable(filter_data)
> x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
> y = tf.nn.conv2d(x, filter, strides=[1, 1, 1, 1], padding='VALID', 
> name='dnn_out')
> sess=tf.Session()
> sess.run(tf.global_variables_initializer())
> output = sess.run(y, feed_dict={x: in_data})
> graph_def = tf.graph_util.convert_variables_to_constants(sess,
> sess.graph_def, ['dnn_out'])
> tf.train.write_graph(graph_def, '.', 'halve_first_channel.pb', as_text=False)
> output = output * 255.0
> output = output.astype(np.uint8)
> scipy.misc.imsave("out.bmp", np.squeeze(output))
> 
> To do the same thing with ffmpeg:
> - generate halve_first_channel.pb with the above script
> - generate halve_first_channel.model with tools/python/convert.py
> - try with following commands
>   ./ffmpeg -i input.jpg -vf
> dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_
> out:fmt=rgb24:dnn_backend=native -y out.native.png
>   ./ffmpeg -i input.jpg -vf
> dnn_processing=model=halve_first_channel.pb:input=dnn_in:output=dnn_out:f
> mt=rgb24:dnn_backend=tensorflow -y out.tf.png
> 
> Signed-off-by: Guo, Yejun 
> ---
>  configure   |   1 +
>  doc/filters.texi|  44 ++
>  libavfilter/Makefile|   1 +
>  libavfilter/allfilters.c|   1 +
>  libavfilter/vf_dnn_processing.c | 331
> 

this patch ask for review, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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