Re: [FFmpeg-devel] [PATCH 1/8] lavu/pix_fmt: add new pixel format y210

2020-01-11 Thread Fu, Linjie
> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Mark Thompson
> Sent: Thursday, January 9, 2020 05:47
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH 1/8] lavu/pix_fmt: add new pixel format
> y210
> 
> On 29/12/2019 16:28, Linjie Fu wrote:
> > Add some packed 4:2:2 10-bit pixel formats for hardware decode support
> > in VAAPI and QSV.
> >
> > Signed-off-by: Linjie Fu 
> > ---
> >  libavutil/pixdesc.c  | 23 +++
> >  libavutil/pixfmt.h   |  5 +
> >  libavutil/version.h  |  2 +-
> >  tests/ref/fate/sws-pixdesc-query |  7 +++
> >  4 files changed, 36 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> > index 05dd4a1..1e118ef 100644
> > --- a/libavutil/pixdesc.c
> > +++ b/libavutil/pixdesc.c
> > @@ -205,6 +205,29 @@ static const AVPixFmtDescriptor
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> >  { 0, 4, 1, 0, 8, 3, 7, 2 },/* V */
> >  },
> >  },
> > +[AV_PIX_FMT_Y210LE] = {
> > +.name = "y210le",
> > +.nb_components = 3,
> > +.log2_chroma_w = 1,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 0, 4, 0, 6, 10, 3, 9, 1 },/* Y */
> > +{ 0, 8, 2, 6, 10, 7, 9, 3 },/* U */
> > +{ 0, 8, 6, 6, 10, 7, 9, 7 },/* V */
> > +},
> > +},
> > +[AV_PIX_FMT_Y210BE] = {
> > +.name = "y210be",
> > +.nb_components = 3,
> > +.log2_chroma_w = 1,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 0, 4, 0, 6, 10, 3, 9, 1 },/* Y */
> > +{ 0, 8, 2, 6, 10, 7, 9, 3 },/* U */
> > +{ 0, 8, 6, 6, 10, 7, 9, 7 },/* V */
> > +},
> > +.flags = AV_PIX_FMT_FLAG_BE,
> > +},
> >  [AV_PIX_FMT_RGB24] = {
> >  .name = "rgb24",
> >  .nb_components = 3,
> > diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> > index 37ecebd..7ffa5a0 100644
> > --- a/libavutil/pixfmt.h
> > +++ b/libavutil/pixfmt.h
> > @@ -348,6 +348,9 @@ enum AVPixelFormat {
> >  AV_PIX_FMT_NV24,  ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1
> plane for the UV components, which are interleaved (first byte U and the
> following byte V)
> >  AV_PIX_FMT_NV42,  ///< as above, but U and V bytes are swapped
> >
> > +AV_PIX_FMT_Y210BE,///< packed YUV 4:2:2, 32bpp, Y0 Cb Y1 Cr, big-
> endian
> > +AV_PIX_FMT_Y210LE,///< packed YUV 4:2:2, 32bpp, Y0 Cb Y1 Cr, 
> > little-
> endian
> 
> These comments should be clear that the data are in the high bits (like P010),
> rather than in the low bits (like most formats used by software codecs).
> 
> Being consistent with other comments would write 20bpp rather than 32bpp,
> though I'm not sure how much information that number is really adding.
> 
Would update the comments like:
packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, zeros in the low 
bits, big-endian

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

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

Re: [FFmpeg-devel] [PATCH 05/11] avformat/apngdec: Remove goto fail that does nothing

2020-01-11 Thread Michael Niedermayer
On Sat, Jan 11, 2020 at 11:46:07PM +0100, Michael Niedermayer wrote:
> On Tue, Dec 10, 2019 at 10:59:49PM +0100, Andreas Rheinhardt wrote:
> > Signed-off-by: Andreas Rheinhardt 
> > ---
> >  libavformat/apngdec.c | 31 ---
> >  1 file changed, 12 insertions(+), 19 deletions(-)
> 
> will apply

will apply but not yet as it depends on the previous apngdec patch which
is being reworked and wasnt approved yet.
... I didnt realize as i had it applied locally, and mkver reminded me
too

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.



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 05/11] avformat/apngdec: Remove goto fail that does nothing

2020-01-11 Thread Michael Niedermayer
On Tue, Dec 10, 2019 at 10:59:49PM +0100, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/apngdec.c | 31 ---
>  1 file changed, 12 insertions(+), 19 deletions(-)

will apply

thx

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

Democracy is the form of government in which you can choose your dictator


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 3/3] tools/target_dec_fuzzer: Adjust threshold for RASC

2020-01-11 Thread Michael Niedermayer
On Wed, Dec 11, 2019 at 10:03:52PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout(35sec -> 4sec)
> Fixes: 
> 19289/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5676526398078976
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fuzzer.c | 1 +
>  1 file changed, 1 insertion(+)

will apply

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

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


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/cbs_h2645: Skip all 0 NAL units

2020-01-11 Thread Michael Niedermayer
On Fri, Dec 13, 2019 at 07:26:04PM -0300, James Almer wrote:
> On 12/13/2019 7:17 PM, Michael Niedermayer wrote:
> > Fixes: assertion failure
> > Fixes: 
> > 19286/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_REDUNDANT_PPS_fuzzer-5707990724509696
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/cbs_h2645.c | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
> > index 5f71d80584..90f77d0039 100644
> > --- a/libavcodec/cbs_h2645.c
> > +++ b/libavcodec/cbs_h2645.c
> > @@ -568,7 +568,10 @@ static int 
> > cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
> >  // Remove trailing zeroes.
> >  while (size > 0 && nal->data[size - 1] == 0)
> >  --size;
> > -av_assert0(size > 0);
> > +if (size == 0) {
> > +av_log(ctx->log_ctx, AV_LOG_WARNING, "Discarding empty 0 NAL 
> > unit\n");
> 
> IMO, no warning message, same as h2645_parse. Or if anything, make it
> VERBOSE.
> 
> LGTM otherwise.

will apply with VERBOSE

thx

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

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2



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 1/2] avcodec/adpcm: Fix overflow in FFABS() IMA_EA_EACS

2020-01-11 Thread Michael Niedermayer
On Sat, Dec 07, 2019 at 10:24:03AM +0100, Michael Niedermayer wrote:
> Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to 
> an unsigned type to negate this value to itself
> Fixes: 
> 19235/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_EA_EACS_fuzzer-5680878952382464
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/adpcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu


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 2/4] avcodec/alac: Fix integer overflow in LPC coefficient adaption

2020-01-11 Thread Michael Niedermayer
On Sun, Dec 08, 2019 at 12:20:10AM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 267693597 * 10 cannot be represented in type 
> 'int'
> Fixes: 
> 19237/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5755407700328448
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/alac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply


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

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


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 1/4] avcodec/g729postfilter: Optimize out overflowing multiplication from apply_tilt_comp()

2020-01-11 Thread Michael Niedermayer
On Sun, Dec 08, 2019 at 12:20:09AM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: -1114392282 * 2 cannot be represented in type 
> 'int'
> Fixes: 
> 19236/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G729_fuzzer-5741678938030080
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/g729postfilter.c | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)

will apply

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

Take away the freedom of one citizen and you will be jailed, take away
the freedom of all citizens and you will be congratulated by your peers
in Parliament.


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 4/5] avcodec/vc1dec: Check field_mode for sprites

2020-01-11 Thread Michael Niedermayer
On Sun, Dec 08, 2019 at 10:31:19PM +0100, Michael Niedermayer wrote:
> Fixes: Out of array read
> Fixes: 
> 19263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5389219325542400
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/vc1dec.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

will apply

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


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 5/5] libavcodec/vc1: Remove bits variable

2020-01-11 Thread Michael Niedermayer
On Sun, Dec 08, 2019 at 10:31:20PM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/mss2.c  |  2 --
>  libavcodec/vc1.h   |  2 --
>  libavcodec/vc1_block.c | 16 
>  libavcodec/vc1dec.c|  2 --
>  4 files changed, 8 insertions(+), 14 deletions(-)

will apply

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

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


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

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

Re: [FFmpeg-devel] [PATCH 3/5] avcodec/vc1dec: Limit bits by the actual bitstream size

2020-01-11 Thread Michael Niedermayer
On Sun, Dec 08, 2019 at 10:31:18PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout (350 ->19sec)
> Fixes: 
> 19249/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-6566896438870016
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/vc1dec.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

will apply


[...]
-- 
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 v1] avcodec/wavpack: simplify the code

2020-01-11 Thread Michael Niedermayer
On Sat, Jan 11, 2020 at 01:31:06PM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  libavcodec/wavpack.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

will apply

thx

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

No snowflake in an avalanche ever feels responsible. -- Voltaire


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

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

[FFmpeg-devel] New Defects reported by Coverity Scan for FFmpeg/FFmpeg (fwd)

2020-01-11 Thread Marton Balint

Hi,

Has anybody reported these and similar false positives involving 
av_dict_set() with a 0 flag to Coverity?


These are popping up all over the codebase, something should be done to 
make Coverity smarter about them. Any ideas?


Thanks,
Marton

-- Forwarded message --
Date: Sat, 11 Jan 2020 00:16:31 + (UTC)
From: scan-ad...@coverity.com
To: c...@passwd.hu
Subject: New Defects reported by Coverity Scan for FFmpeg/FFmpeg

Hi,

Please find the latest report on new defect(s) introduced to FFmpeg/FFmpeg 
found with Coverity Scan.

3 new defect(s) introduced to FFmpeg/FFmpeg found with Coverity Scan.
4 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 3 of 3 defect(s)


** CID 1457612:  Memory - corruptions  (BAD_FREE)



*** CID 1457612:  Memory - corruptions  (BAD_FREE)
/libavformat/img2dec.c: 387 in add_filename_as_pkt_side_data()
381 static int add_filename_as_pkt_side_data(char *filename, AVPacket *pkt) 
{
382 uint8_t* metadata;
383 int metadata_len;
384 AVDictionary *d = NULL;
385 char *packed_metadata = NULL;
386

CID 1457612:  Memory - corruptions  (BAD_FREE)
"av_dict_set" frees array ""lavf.image2dec.source_path"".

387 av_dict_set(, "lavf.image2dec.source_path", filename, 0);
388 av_dict_set(, "lavf.image2dec.source_basename", 
av_basename(filename), 0);
389
390 packed_metadata = av_packet_pack_dictionary(d, _len);
391 av_dict_free();
392 if (!packed_metadata)

** CID 1457611:  Memory - corruptions  (BAD_FREE)



*** CID 1457611:  Memory - corruptions  (BAD_FREE)
/libavformat/img2dec.c: 522 in ff_img_read_packet()
516 /*
517  * export_path_metadata must be explicitly enabled via
518  * command line options for path metadata to be exported
519  * as packet side_data.
520  */
521 if (!s->is_pipe && s->export_path_metadata == 1) {

CID 1457611:  Memory - corruptions  (BAD_FREE)
"add_filename_as_pkt_side_data" frees incorrect pointer "filename".

522 res = add_filename_as_pkt_side_data(filename, pkt);
523 if (res < 0)
524 goto fail;
525 }
526
527 pkt->size = 0;

** CID 1457610:  Memory - illegal accesses  (USE_AFTER_FREE)
/libavformat/img2dec.c: 388 in add_filename_as_pkt_side_data()



*** CID 1457610:  Memory - illegal accesses  (USE_AFTER_FREE)
/libavformat/img2dec.c: 388 in add_filename_as_pkt_side_data()
382 uint8_t* metadata;
383 int metadata_len;
384 AVDictionary *d = NULL;
385 char *packed_metadata = NULL;
386
387 av_dict_set(, "lavf.image2dec.source_path", filename, 0);

CID 1457610:  Memory - illegal accesses  (USE_AFTER_FREE)
Passing freed pointer "filename" as an argument to "av_basename".

388 av_dict_set(, "lavf.image2dec.source_basename", 
av_basename(filename), 0);
389
390 packed_metadata = av_packet_pack_dictionary(d, _len);
391 av_dict_free();
392 if (!packed_metadata)
393 return AVERROR(ENOMEM);



To view the defects in Coverity Scan visit, 
https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRaqasF6Uk2bO40DRQinvhHXkt8Nls-2F5NS-2BxBTpKqgEzgg-3D-3D_iLiXcktl7KXGjSQAr3vGdzTcLOyVPdi-2FBYEhWvx6cOoPLZW2npBAP5ETvXBhWGQ-2BgGJ0akoMF82ThsW9C-2F8kD7NGEkYmCVuwItSQDN-2F4UiEw3JkP-2FsfAH5o75w0HStCw5boTnud6r9LTKGs6m8KQdVh-2FG-2FTXdOBD93QMYdqvm3u0nIoqo5mLxL1vbe508XZaxAMLhX8G0C3DdM2zlivjwq6YtDCr35ABndfcAK6nJBE-3D

  To manage Coverity Scan email notifications for "c...@passwd.hu", click 
https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4KxDzmpfyD-2F0l0XIVTmMtZD7ylWpUIkhWLZ-2FqTpdzByKR1etBqRMP9Gr8p3ndILxSbjDX9BckY-2F41HYDCOY7v3gsXsVPM0ldLTEl8rIsTJxw-3D_iLiXcktl7KXGjSQAr3vGdzTcLOyVPdi-2FBYEhWvx6cOoPLZW2npBAP5ETvXBhWGQ-2BU3-2BqjFTr8yNdZAvCs7njXlOq2sv2NxTYVnecxAhviSfimYN-2BCgZ-2BLA9CtqCpFfl46oybryC4cyLFEb4qC-2FgzBgmaX-2B-2FDQg4VD4eVWKgYCTGxJyZCCm6W9y4-2For0hWKj-2BcpP9pd4gEimyi3f2fW7AX3ff2au-2BKxQVNznvqdFqYeM-3D
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH] avutil/hwcontext_d3d11va: Use secure dlopen.

2020-01-11 Thread Matt Oliver
On Tue, 31 Dec 2019 at 03:37, Andriy Gelman  wrote:

> On Mon, 30. Dec 11:31, Andriy Gelman wrote:
> > On Tue, 31. Dec 03:02, Matt Oliver wrote:
> > > dlopen contains additional security to prevent dll hijacking compared
> to
> > > standard LoadLibrary.
> > > ---
> > >  libavutil/hwcontext_d3d11va.c | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/libavutil/hwcontext_d3d11va.c
> b/libavutil/hwcontext_d3d11va.c
> > > index 6670c47579..c8ae58f908 100644
> > > --- a/libavutil/hwcontext_d3d11va.c
> > > +++ b/libavutil/hwcontext_d3d11va.c
> > > @@ -39,6 +39,7 @@
> > >  #include "pixdesc.h"
> > >  #include "pixfmt.h"
> > >  #include "thread.h"
> > > +#include "compat/w32dlfcn.h"
> > >
> > >  typedef HRESULT(WINAPI *PFN_CREATE_DXGI_FACTORY)(REFIID riid, void
> > > **ppFactory);
> > >
> > > @@ -55,8 +56,8 @@ static av_cold void load_functions(void)
> > >  // from too many LoadLibrary calls.
> > >  HANDLE d3dlib, dxgilib;
> > >
> > > -d3dlib  = LoadLibrary("d3d11.dll");
> > > -dxgilib = LoadLibrary("dxgi.dll");
> > > +d3dlib  = dlopen("d3d11.dll", 0);
> > > +dxgilib = dlopen("dxgi.dll", 0);
> > >  if (!d3dlib || !dxgilib)
> > >  return;
> > >
> > > --
> >
> > Hello Matt,
> >
> > This patch doesn't apply:
> >
> > error: corrupt patch at line 16
> > Patch failed at 0001 avutil/hwcontext_d3d11va: Use secure dlopen.
> >
> >
> https://unofficial.patchwork-ffmpeg.org/project/FFmpeg/patch/cahvn4mjopjag+jac9_n_inhjzl2p1_9z3fvhf91pr0lc-dv...@mail.gmail.com/
> >
>
> sorry, my git am failed because the patch was sent as text and an
> attachment.
> Applying just one of them works.
>
> --
> Andriy
>

ping
___
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 04/11] lavfi/hue: enable runtime change flag

2020-01-11 Thread Paul B Mahol
On 1/11/20, Michael Niedermayer  wrote:
> On Sat, Jan 11, 2020 at 12:13:51PM +0800, Jun Zhao wrote:
>> From: Jun Zhao 
>>
>> enable runtime change flag.
>>
>> Signed-off-by: Jun Zhao 
>> ---
>>  libavfilter/vf_hue.c |2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/libavfilter/vf_hue.c b/libavfilter/vf_hue.c
>> index 32b..026d4b6 100644
>> --- a/libavfilter/vf_hue.c
>> +++ b/libavfilter/vf_hue.c
>> @@ -86,7 +86,7 @@ typedef struct HueContext {
>>  } HueContext;
>>
>>  #define OFFSET(x) offsetof(HueContext, x)
>> -#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
>> +#define FLAGS
>> AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
>
> its maybe confusing if FLAGS sometimes means what TFLAGS means elsewhere
> while there FLAGS has different meaning.
> Something consistent across filters would be better
>
> Thanks
>

I disagree.

> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Many things microsoft did are stupid, but not doing something just because
> microsoft did it is even more stupid. If everything ms did were stupid they
> would be bankrupt already.
>
___
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 04/11] lavfi/hue: enable runtime change flag

2020-01-11 Thread Michael Niedermayer
On Sat, Jan 11, 2020 at 12:13:51PM +0800, Jun Zhao wrote:
> From: Jun Zhao 
> 
> enable runtime change flag.
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavfilter/vf_hue.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavfilter/vf_hue.c b/libavfilter/vf_hue.c
> index 32b..026d4b6 100644
> --- a/libavfilter/vf_hue.c
> +++ b/libavfilter/vf_hue.c
> @@ -86,7 +86,7 @@ typedef struct HueContext {
>  } HueContext;
>  
>  #define OFFSET(x) offsetof(HueContext, x)
> -#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
> +#define FLAGS 
> AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM

its maybe confusing if FLAGS sometimes means what TFLAGS means elsewhere
while there FLAGS has different meaning.
Something consistent across filters would be better

Thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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 01/11] lavfi/spp: add "quality" option in runtime change path

2020-01-11 Thread Michael Niedermayer
On Sat, Jan 11, 2020 at 12:13:48PM +0800, Jun Zhao wrote:
> From: Jun Zhao 
> 
> it's stranage to use option "level" in runtime change path but used
> "quality" in option, add "quality" in runtime change path, it's more
> intuitive and keep the "level" for compatibility.
> 
> Signed-off-by: Jun Zhao 
> ---
>  doc/filters.texi |9 +
>  libavfilter/vf_spp.c |2 +-
>  2 files changed, 10 insertions(+), 1 deletions(-)

not sure both should be documented

otherwise probably ok

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 V1 11/11] lavfi/vulume: enable runtime change flag

2020-01-11 Thread Michael Niedermayer
On Sat, Jan 11, 2020 at 12:13:58PM +0800, Jun Zhao wrote:
> From: Jun Zhao 
> 
>  enable runtime change flag.
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavfilter/af_volume.c |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

typo in commit message (vulume)

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

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


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 02/11] lavfi/spp: enable runtime change flag

2020-01-11 Thread Michael Niedermayer
On Sat, Jan 11, 2020 at 12:13:49PM +0800, Jun Zhao wrote:
> From: Jun Zhao 
> 
> enable runtime change flag.
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavfilter/vf_spp.c |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

LGTM

thx

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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


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] [PATCHv2 1/3] avutil/eval: separate AVExpr state to a new AVExprState struct

2020-01-11 Thread Marton Balint



On Sat, 11 Jan 2020, Michael Niedermayer wrote:


On Fri, Jan 10, 2020 at 12:49:08AM +0100, Marton Balint wrote:



On Thu, 9 Jan 2020, Michael Niedermayer wrote:


On Wed, Jan 01, 2020 at 05:40:33PM +0100, Marton Balint wrote:



On Wed, 1 Jan 2020, Michael Niedermayer wrote:


On Mon, Dec 30, 2019 at 11:23:40PM +0100, Marton Balint wrote:

Also add helper functions to allocate and free such a struct, and make it
usable by providing a new av_eval_expr2 function for which you can specify a
custom AVExprState.

Signed-off-by: Marton Balint 
---
doc/APIchanges  |  4 
libavutil/eval.c| 36 +---
libavutil/eval.h| 41 +
libavutil/version.h |  2 +-
4 files changed, 71 insertions(+), 12 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 3c24dc6fbc..d0b33bda02 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2017-10-21

API changes, most recent first:

+2020-01-xx - xx - lavu 56.39.100 - eval.h
+  Add AVExprState struct and av_expr_eval2, av_expr_state_alloc,
+  av_expr_state_free functions
+
2019-12-27 - xx - lavu 56.38.100 - eval.h
 Add av_expr_count_func().

diff --git a/libavutil/eval.c b/libavutil/eval.c
index d527f6a9d0..4619d0fba0 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -53,7 +53,6 @@ typedef struct Parser {
   void *opaque;
   int log_offset;
   void *log_ctx;
-#define VARS 10
   double *var;
} Parser;

@@ -173,7 +172,7 @@ struct AVExpr {
   double (*func2)(void *, double, double);
   } a;
   struct AVExpr *param[3];
-double *var;
+AVExprState *state;
};

static double etime(double v)
@@ -191,7 +190,7 @@ static double eval_expr(Parser *p, AVExpr *e)
   case e_func2:  return e->value * e->a.func2(p->opaque, eval_expr(p, 
e->param[0]), eval_expr(p, e->param[1]));
   case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0])));
   case e_gauss: { double d = eval_expr(p, e->param[0]); return 
exp(-d*d/2)/sqrt(2*M_PI); }
-case e_ld: return e->value * p->var[av_clip(eval_expr(p, 
e->param[0]), 0, VARS-1)];
+case e_ld: return e->value * p->var[av_clip(eval_expr(p, 
e->param[0]), 0, AV_EXPR_STATE_NB_VARS-1)];
   case e_isnan:  return e->value * !!isnan(eval_expr(p, e->param[0]));
   case e_isinf:  return e->value * !!isinf(eval_expr(p, e->param[0]));
   case e_floor:  return e->value * floor(eval_expr(p, e->param[0]));
@@ -230,7 +229,7 @@ static double eval_expr(Parser *p, AVExpr *e)
   return x;
   }
   case e_random:{
-int idx= av_clip(eval_expr(p, e->param[0]), 0, VARS-1);
+int idx= av_clip(eval_expr(p, e->param[0]), 0, 
AV_EXPR_STATE_NB_VARS-1);
   uint64_t r= isnan(p->var[idx]) ? 0 : p->var[idx];
   r= r*1664525+1013904223;
   p->var[idx]= r;
@@ -245,7 +244,7 @@ static double eval_expr(Parser *p, AVExpr *e)
   case e_taylor: {
   double t = 1, d = 0, v;
   double x = eval_expr(p, e->param[1]);
-int id = e->param[2] ? av_clip(eval_expr(p, e->param[2]), 0, 
VARS-1) : 0;
+int id = e->param[2] ? av_clip(eval_expr(p, e->param[2]), 0, 
AV_EXPR_STATE_NB_VARS-1) : 0;
   int i;
   double var0 = p->var[id];
   for(i=0; i<1000; i++) {
@@ -320,7 +319,7 @@ static double eval_expr(Parser *p, AVExpr *e)
   case e_div: return e->value * ((!CONFIG_FTRAPV || d2 ) ? (d / 
d2) : d * INFINITY);
   case e_add: return e->value * (d + d2);
   case e_last:return e->value * d2;
-case e_st : return e->value * (p->var[av_clip(d, 0, VARS-1)]= 
d2);
+case e_st : return e->value * (p->var[av_clip(d, 0, 
AV_EXPR_STATE_NB_VARS-1)]= d2);
   case e_hypot:return e->value * hypot(d, d2);
   case e_atan2:return e->value * atan2(d, d2);
   case e_bitand: return isnan(d) || isnan(d2) ? NAN : e->value * 
((long int)d & (long int)d2);
@@ -333,13 +332,23 @@ static double eval_expr(Parser *p, AVExpr *e)

static int parse_expr(AVExpr **e, Parser *p);

+AVExprState *av_expr_state_alloc(void)
+{
+return av_mallocz(sizeof(AVExprState));
+}
+
+void av_expr_state_free(AVExprState **ps)
+{
+av_freep(ps);
+}
+
void av_expr_free(AVExpr *e)
{
   if (!e) return;
   av_expr_free(e->param[0]);
   av_expr_free(e->param[1]);
   av_expr_free(e->param[2]);
-av_freep(>var);
+av_expr_state_free(>state);
   av_freep();
}

@@ -724,8 +733,8 @@ int av_expr_parse(AVExpr **expr, const char *s,
   ret = AVERROR(EINVAL);
   goto end;
   }
-e->var= av_mallocz(sizeof(double) *VARS);
-if (!e->var) {
+e->state = av_expr_state_alloc();
+if (!e->state) {
   ret = AVERROR(ENOMEM);
   goto end;
   }
@@ -763,16 +772,21 @@ int av_expr_count_func(AVExpr *e, unsigned *counter, int 
size, int arg)
   return expr_count(e, counter, size, ((int[]){e_const, e_func1, 
e_func2})[arg]);
}


Re: [FFmpeg-devel] [PATCH 01/20] avformat/matroskaenc: Fix ReferenceBlock timestamp

2020-01-11 Thread James Almer
On 1/11/2020 11:12 AM, Paul B Mahol wrote:
> probably ok

Applied.

> 
> On 1/1/20, Andreas Rheinhardt  wrote:
>> In order to indicate that the frames in a BlockGroup are not keyframes,
>> one has to add a ReferenceBlock element containing the timestamp of a
>> referenced Block that has already been written. The timestamp ought to be
>> relative to the timestamp of the Block it is attached to. Yet the
>> Matroska muxer used the relative timestamp of the preceding Block of the
>> track, i.e. the timestamp of the preceding block relative to the
>> timestamp of the Cluster containing said block (that need not be the
>> Cluster containing the current Block). This has been fixed.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>  libavformat/matroskaenc.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
>> index 469b604de6..9cf840c9be 100644
>> --- a/libavformat/matroskaenc.c
>> +++ b/libavformat/matroskaenc.c
>> @@ -2167,9 +2167,9 @@ static void mkv_write_block(AVFormatContext *s,
>> AVIOContext *pb,
>>  av_free(data);
>>
>>  if (blockid == MATROSKA_ID_BLOCK && !keyframe) {
>> -put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE,
>> track->last_timestamp);
>> +put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE, track->last_timestamp
>> - ts);
>>  }
>> -track->last_timestamp = ts - mkv->cluster_pts;
>> +track->last_timestamp = ts;
>>
>>  if (discard_padding) {
>>  put_ebml_sint(pb, MATROSKA_ID_DISCARDPADDING, discard_padding);
>> --
>> 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 01/20] avformat/matroskaenc: Fix ReferenceBlock timestamp

2020-01-11 Thread Paul B Mahol
probably ok

On 1/1/20, Andreas Rheinhardt  wrote:
> In order to indicate that the frames in a BlockGroup are not keyframes,
> one has to add a ReferenceBlock element containing the timestamp of a
> referenced Block that has already been written. The timestamp ought to be
> relative to the timestamp of the Block it is attached to. Yet the
> Matroska muxer used the relative timestamp of the preceding Block of the
> track, i.e. the timestamp of the preceding block relative to the
> timestamp of the Cluster containing said block (that need not be the
> Cluster containing the current Block). This has been fixed.
>
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/matroskaenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 469b604de6..9cf840c9be 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -2167,9 +2167,9 @@ static void mkv_write_block(AVFormatContext *s,
> AVIOContext *pb,
>  av_free(data);
>
>  if (blockid == MATROSKA_ID_BLOCK && !keyframe) {
> -put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE,
> track->last_timestamp);
> +put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE, track->last_timestamp
> - ts);
>  }
> -track->last_timestamp = ts - mkv->cluster_pts;
> +track->last_timestamp = ts;
>
>  if (discard_padding) {
>  put_ebml_sint(pb, MATROSKA_ID_DISCARDPADDING, discard_padding);
> --
> 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 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 01/20] avformat/matroskaenc: Fix ReferenceBlock timestamp

2020-01-11 Thread Andreas Rheinhardt
On Tue, Jan 7, 2020 at 3:12 PM Andreas Rheinhardt <
andreas.rheinha...@gmail.com> wrote:

> On Wed, Jan 1, 2020 at 1:59 AM Andreas Rheinhardt <
> andreas.rheinha...@gmail.com> wrote:
>
>> In order to indicate that the frames in a BlockGroup are not keyframes,
>> one has to add a ReferenceBlock element containing the timestamp of a
>> referenced Block that has already been written. The timestamp ought to be
>> relative to the timestamp of the Block it is attached to. Yet the
>> Matroska muxer used the relative timestamp of the preceding Block of the
>> track, i.e. the timestamp of the preceding block relative to the
>> timestamp of the Cluster containing said block (that need not be the
>> Cluster containing the current Block). This has been fixed.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>  libavformat/matroskaenc.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
>> index 469b604de6..9cf840c9be 100644
>> --- a/libavformat/matroskaenc.c
>> +++ b/libavformat/matroskaenc.c
>> @@ -2167,9 +2167,9 @@ static void mkv_write_block(AVFormatContext *s,
>> AVIOContext *pb,
>>  av_free(data);
>>
>>  if (blockid == MATROSKA_ID_BLOCK && !keyframe) {
>> -put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE,
>> track->last_timestamp);
>> +put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE,
>> track->last_timestamp - ts);
>>  }
>> -track->last_timestamp = ts - mkv->cluster_pts;
>> +track->last_timestamp = ts;
>>
>>  if (discard_padding) {
>>  put_ebml_sint(pb, MATROSKA_ID_DISCARDPADDING, discard_padding);
>> --
>> 2.20.1
>>
>>
> Ping for the rest of this patchset.
>
> - Andreas
>
>
Ping.

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

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

Re: [FFmpeg-devel] [PATCHv2 1/3] avutil/eval: separate AVExpr state to a new AVExprState struct

2020-01-11 Thread Michael Niedermayer
On Fri, Jan 10, 2020 at 12:49:08AM +0100, Marton Balint wrote:
> 
> 
> On Thu, 9 Jan 2020, Michael Niedermayer wrote:
> 
> >On Wed, Jan 01, 2020 at 05:40:33PM +0100, Marton Balint wrote:
> >>
> >>
> >>On Wed, 1 Jan 2020, Michael Niedermayer wrote:
> >>
> >>>On Mon, Dec 30, 2019 at 11:23:40PM +0100, Marton Balint wrote:
> Also add helper functions to allocate and free such a struct, and make it
> usable by providing a new av_eval_expr2 function for which you can 
> specify a
> custom AVExprState.
> 
> Signed-off-by: Marton Balint 
> ---
> doc/APIchanges  |  4 
> libavutil/eval.c| 36 +---
> libavutil/eval.h| 41 +
> libavutil/version.h |  2 +-
> 4 files changed, 71 insertions(+), 12 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 3c24dc6fbc..d0b33bda02 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,10 @@ libavutil: 2017-10-21
> 
> API changes, most recent first:
> 
> +2020-01-xx - xx - lavu 56.39.100 - eval.h
> +  Add AVExprState struct and av_expr_eval2, av_expr_state_alloc,
> +  av_expr_state_free functions
> +
> 2019-12-27 - xx - lavu 56.38.100 - eval.h
>   Add av_expr_count_func().
> 
> diff --git a/libavutil/eval.c b/libavutil/eval.c
> index d527f6a9d0..4619d0fba0 100644
> --- a/libavutil/eval.c
> +++ b/libavutil/eval.c
> @@ -53,7 +53,6 @@ typedef struct Parser {
> void *opaque;
> int log_offset;
> void *log_ctx;
> -#define VARS 10
> double *var;
> } Parser;
> 
> @@ -173,7 +172,7 @@ struct AVExpr {
> double (*func2)(void *, double, double);
> } a;
> struct AVExpr *param[3];
> -double *var;
> +AVExprState *state;
> };
> 
> static double etime(double v)
> @@ -191,7 +190,7 @@ static double eval_expr(Parser *p, AVExpr *e)
> case e_func2:  return e->value * e->a.func2(p->opaque, 
>  eval_expr(p, e->param[0]), eval_expr(p, e->param[1]));
> case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0])));
> case e_gauss: { double d = eval_expr(p, e->param[0]); return 
>  exp(-d*d/2)/sqrt(2*M_PI); }
> -case e_ld: return e->value * p->var[av_clip(eval_expr(p, 
> e->param[0]), 0, VARS-1)];
> +case e_ld: return e->value * p->var[av_clip(eval_expr(p, 
> e->param[0]), 0, AV_EXPR_STATE_NB_VARS-1)];
> case e_isnan:  return e->value * !!isnan(eval_expr(p, 
>  e->param[0]));
> case e_isinf:  return e->value * !!isinf(eval_expr(p, 
>  e->param[0]));
> case e_floor:  return e->value * floor(eval_expr(p, e->param[0]));
> @@ -230,7 +229,7 @@ static double eval_expr(Parser *p, AVExpr *e)
> return x;
> }
> case e_random:{
> -int idx= av_clip(eval_expr(p, e->param[0]), 0, VARS-1);
> +int idx= av_clip(eval_expr(p, e->param[0]), 0, 
> AV_EXPR_STATE_NB_VARS-1);
> uint64_t r= isnan(p->var[idx]) ? 0 : p->var[idx];
> r= r*1664525+1013904223;
> p->var[idx]= r;
> @@ -245,7 +244,7 @@ static double eval_expr(Parser *p, AVExpr *e)
> case e_taylor: {
> double t = 1, d = 0, v;
> double x = eval_expr(p, e->param[1]);
> -int id = e->param[2] ? av_clip(eval_expr(p, e->param[2]), 0, 
> VARS-1) : 0;
> +int id = e->param[2] ? av_clip(eval_expr(p, e->param[2]), 0, 
> AV_EXPR_STATE_NB_VARS-1) : 0;
> int i;
> double var0 = p->var[id];
> for(i=0; i<1000; i++) {
> @@ -320,7 +319,7 @@ static double eval_expr(Parser *p, AVExpr *e)
> case e_div: return e->value * ((!CONFIG_FTRAPV || d2 ) ? 
>  (d / d2) : d * INFINITY);
> case e_add: return e->value * (d + d2);
> case e_last:return e->value * d2;
> -case e_st : return e->value * (p->var[av_clip(d, 0, 
> VARS-1)]= d2);
> +case e_st : return e->value * (p->var[av_clip(d, 0, 
> AV_EXPR_STATE_NB_VARS-1)]= d2);
> case e_hypot:return e->value * hypot(d, d2);
> case e_atan2:return e->value * atan2(d, d2);
> case e_bitand: return isnan(d) || isnan(d2) ? NAN : 
>  e->value * ((long int)d & (long int)d2);
> @@ -333,13 +332,23 @@ static double eval_expr(Parser *p, AVExpr *e)
> 
> static int parse_expr(AVExpr **e, Parser *p);
> 
> +AVExprState *av_expr_state_alloc(void)
> +{
> +return av_mallocz(sizeof(AVExprState));
> +}
> +
> +void av_expr_state_free(AVExprState **ps)
> +{
> +av_freep(ps);
> +}
> +
> void 

[FFmpeg-devel] [PATCH 2/2] avformat/mov: Free memory before returning in update_frag_index, when streams lack track id.

2020-01-11 Thread Michael Niedermayer
From: Thomas Guilbert 

Signed-off-by: Michael Niedermayer 
---
 libavformat/mov.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 75f098af09..c49fd4d43f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1327,8 +1327,10 @@ static int update_frag_index(MOVContext *c, int64_t 
offset)
 
 for (i = 0; i < c->fc->nb_streams; i++) {
 // Avoid building frag index if streams lack track id.
-if (c->fc->streams[i]->id < 0)
+if (c->fc->streams[i]->id < 0) {
+av_freep(_stream_info);
 return AVERROR_INVALIDDATA;
+}
 
 frag_stream_info[i].id = c->fc->streams[i]->id;
 frag_stream_info[i].sidx_pts = AV_NOPTS_VALUE;
-- 
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".

[FFmpeg-devel] [PATCH 1/2] avformat/mov: Check STCO location

2020-01-11 Thread Michael Niedermayer
Fixes: bypassing of checks and assertion failure
Fixes: asan_1003879.mp4

Found-by: Clusterfuzz + asan
Reported-by: Thomas Guilbert 
Signed-off-by: Michael Niedermayer 
---
 libavformat/mov.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 589576b529..75f098af09 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1976,6 +1976,10 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 MOVStreamContext *sc;
 unsigned int i, entries;
 
+if (c->trak_index < 0) {
+av_log(c->fc, AV_LOG_WARNING, "STCO outside TRAK\n");
+return 0;
+}
 if (c->fc->nb_streams < 1)
 return 0;
 st = c->fc->streams[c->fc->nb_streams-1];
-- 
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] avfilter: add freezeframes video filter

2020-01-11 Thread Paul B Mahol
Will apply soon.

On 12/31/19, Paul B Mahol  wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  doc/filters.texi  |  19 
>  libavfilter/Makefile  |   1 +
>  libavfilter/allfilters.c  |   1 +
>  libavfilter/vf_freezeframes.c | 167 ++
>  4 files changed, 188 insertions(+)
>  create mode 100644 libavfilter/vf_freezeframes.c
___
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: add crossfade filter

2020-01-11 Thread Gyan



On 11-01-2020 03:53 pm, Paul B Mahol wrote:

On 1/11/20, Gyan  wrote:


On 11-01-2020 03:35 pm, Paul B Mahol wrote:

On 1/11/20, Gyan  wrote:

Paul, this is useful. When can you merge this?

You actually tried it?

No. Do I need to? It looks to be video counterpart of acrossfade.

Yes, but generic filtering/crossfade is pretty slow, so wanted to do
vulkan filter instead.


I'll test this filter tonight, but it does not have to be either/or. We 
have s/w scale,overlay and h/w assisted versions as well.


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

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

Re: [FFmpeg-devel] [PATCH] avfilter: add crossfade filter

2020-01-11 Thread Paul B Mahol
On 1/11/20, Gyan  wrote:
>
>
> On 11-01-2020 03:35 pm, Paul B Mahol wrote:
>> On 1/11/20, Gyan  wrote:
>>> Paul, this is useful. When can you merge this?
>> You actually tried it?
>
> No. Do I need to? It looks to be video counterpart of acrossfade.

Yes, but generic filtering/crossfade is pretty slow, so wanted to do
vulkan filter instead.

>
> Gyan
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
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: add crossfade filter

2020-01-11 Thread Gyan



On 11-01-2020 03:35 pm, Paul B Mahol wrote:

On 1/11/20, Gyan  wrote:

Paul, this is useful. When can you merge this?

You actually tried it?


No. Do I need to? It looks to be video counterpart of acrossfade.

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

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

Re: [FFmpeg-devel] [PATCH] avfilter: add crossfade filter

2020-01-11 Thread Paul B Mahol
On 1/11/20, Gyan  wrote:
> Paul, this is useful. When can you merge this?

You actually tried it?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH] avfilter: add csound audio filter wrapper

2020-01-11 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 configure|   4 +
 doc/filters.texi |  16 +++
 libavfilter/Makefile |   1 +
 libavfilter/af_csound.c  | 267 +++
 libavfilter/allfilters.c |   1 +
 5 files changed, 289 insertions(+)
 create mode 100644 libavfilter/af_csound.c

diff --git a/configure b/configure
index 46f2038627..da5bd9a485 100755
--- a/configure
+++ b/configure
@@ -207,6 +207,7 @@ External library support:
   --disable-bzlib  disable bzlib [autodetect]
   --disable-coreimage  disable Apple CoreImage framework [autodetect]
   --enable-chromaprint enable audio fingerprinting with chromaprint [no]
+  --enable-csound  enable Csound audio filtering [no]
   --enable-frei0r  enable frei0r video filtering [no]
   --enable-gcrypt  enable gcrypt, needed for rtmp(t)e support
if openssl, librtmp or gmp is not used [no]
@@ -1752,6 +1753,7 @@ EXTERNAL_LIBRARY_LIST="
 $EXTERNAL_LIBRARY_VERSION3_LIST
 $EXTERNAL_LIBRARY_GPLV3_LIST
 chromaprint
+csound
 gcrypt
 gnutls
 jni
@@ -3474,6 +3476,7 @@ coreimagesrc_filter_deps="coreimage appkit"
 coreimagesrc_filter_extralibs="-framework OpenGL"
 cover_rect_filter_deps="avcodec avformat gpl"
 cropdetect_filter_deps="gpl"
+csound_filter_deps="csound"
 deconvolve_filter_deps="avcodec"
 deconvolve_filter_select="fft"
 deinterlace_qsv_filter_deps="libmfx"
@@ -6222,6 +6225,7 @@ done
 # these are off by default, so fail if requested and not available
 enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed 
checking for nvcc."; }
 enabled chromaprint   && require chromaprint chromaprint.h 
chromaprint_get_version -lchromaprint
+enabled csound&& require csound csound/csound.h csoundCreate 
-lcsound64
 enabled decklink  && { require_headers DeckLinkAPI.h &&
{ test_cpp_condition DeckLinkAPIVersion.h 
"BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a090500" || die "ERROR: Decklink API 
version must be >= 10.9.5."; } }
 enabled frei0r&& require_headers "frei0r.h dlfcn.h"
diff --git a/doc/filters.texi b/doc/filters.texi
index 6fb660b05a..41c90e6819 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3230,6 +3230,22 @@ Enable clipping. By default is enabled.
 
 This filter supports the all above options as @ref{commands}.
 
+@section csound
+
+Load a Csound plugin.
+
+Csound is a unit generator-based, user-programmable computer music system.
+
+To enable compilation of this filter you need to configure FFmpeg with
+@code{--enable-csound}.
+
+@table @option
+@item csd
+Give name or full path to CSD script file.
+CSD file holds unified orchestra and score file.
+This option must always be set.
+@end table
+
 @section dcshift
 Apply a DC shift to the audio.
 
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 8b8a5bd535..18885950ec 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -102,6 +102,7 @@ OBJS-$(CONFIG_COMPAND_FILTER)+= af_compand.o
 OBJS-$(CONFIG_COMPENSATIONDELAY_FILTER)  += af_compensationdelay.o
 OBJS-$(CONFIG_CROSSFEED_FILTER)  += af_crossfeed.o
 OBJS-$(CONFIG_CRYSTALIZER_FILTER)+= af_crystalizer.o
+OBJS-$(CONFIG_CSOUND_FILTER) += af_csound.o
 OBJS-$(CONFIG_DCSHIFT_FILTER)+= af_dcshift.o
 OBJS-$(CONFIG_DEESSER_FILTER)+= af_deesser.o
 OBJS-$(CONFIG_DRMETER_FILTER)+= af_drmeter.o
diff --git a/libavfilter/af_csound.c b/libavfilter/af_csound.c
new file mode 100644
index 00..9404a42f58
--- /dev/null
+++ b/libavfilter/af_csound.c
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 2020 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Csound wrapper
+ */
+
+#include 
+#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/opt.h"
+#include "audio.h"
+#include "avfilter.h"
+#include "filters.h"
+#include "internal.h"
+
+typedef struct CsoundContext {
+const AVClass *class;
+int sample_rate;
+int nchnls, nchnls_input;
+char *csd_filename;
+
+uint32_t ksmps;
+int format;
+int64_t 

[FFmpeg-devel] [PATCH v4 1/1] avdevice/gdigrab add use_captureblt option

2020-01-11 Thread fgodtdev
From: FgoDt 

Add use_captureblt option for disable or use CAPTUREBLT flag, when useing the 
bitblt function with CAPTUREBLT may caused the Windows mouse cursor flicker. 
most time we don't need this flag to capture window
I tested on Windows 10 works fine

Signed-off-by: fgodt 
---
 doc/indevs.texi   |  7 +++
 libavdevice/gdigrab.c | 10 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 6f5afaf344..967ae22991 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -743,6 +743,13 @@ When capturing a region with @var{video_size}, set the 
distance from the top edg
 
 Note that the offset calculation is from the top left corner of the primary 
monitor on Windows. If you have a monitor positioned above your primary 
monitor, you will need to use a negative @var{offset_y} value to move the 
region to that monitor.
 
+@item use_captureblt
+gdigrab use CAPTUREBLT flag to capture window or desktop by default, which may 
make Windows mouse cursor flickering.
+If not capture layered window you can set value @code{0} disable CAPTUREBLT 
flag, to fix Windows cursor flickering.
+Default value is @code{1}
+
+Note the value @code{1} is essential to capture layered  window
+
 @end table
 
 @section iec61883
diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c
index f406fa..658719e929 100644
--- a/libavdevice/gdigrab.c
+++ b/libavdevice/gdigrab.c
@@ -53,6 +53,8 @@ struct gdigrab {
 intoffset_x;/**< Capture x offset (private option) */
 intoffset_y;/**< Capture y offset (private option) */
 
+intuse_captureblt; /**< Capture gdi window with CAPTUREBLT flag 
(private option) */
+
 HWND   hwnd;/**< Handle of the window for the grab */
 HDCsource_hdc;  /**< Source device context */
 HDCdest_hdc;/**< Destination, source-compatible DC */
@@ -542,6 +544,8 @@ static int gdigrab_read_packet(AVFormatContext *s1, 
AVPacket *pkt)
 
 int64_t curtime, delay;
 
+unsigned long flag = SRCCOPY;
+
 /* Calculate the time of the next frame */
 time_frame += INT64_C(100);
 
@@ -570,12 +574,15 @@ static int gdigrab_read_packet(AVFormatContext *s1, 
AVPacket *pkt)
 return AVERROR(ENOMEM);
 pkt->pts = curtime;
 
+if(gdigrab->use_captureblt)
+flag |= CAPTUREBLT;
+
 /* Blit screen grab */
 if (!BitBlt(dest_hdc, 0, 0,
 clip_rect.right - clip_rect.left,
 clip_rect.bottom - clip_rect.top,
 source_hdc,
-clip_rect.left, clip_rect.top, SRCCOPY | CAPTUREBLT)) {
+clip_rect.left, clip_rect.top, flag)) {
 WIN32_API_ERROR("Failed to capture image");
 return AVERROR(EIO);
 }
@@ -639,6 +646,7 @@ static const AVOption options[] = {
 { "video_size", "set video frame size", OFFSET(width), 
AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
 { "offset_x", "capture area x offset", OFFSET(offset_x), AV_OPT_TYPE_INT, 
{.i64 = 0}, INT_MIN, INT_MAX, DEC },
 { "offset_y", "capture area y offset", OFFSET(offset_y), AV_OPT_TYPE_INT, 
{.i64 = 0}, INT_MIN, INT_MAX, DEC },
+{ "use_captureblt", "capture gdi window use CAPTTUREBLT flag", 
OFFSET(use_captureblt), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, DEC },
 { NULL },
 };
 
-- 
2.23.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".