Re: [FFmpeg-devel] [IMPORTANT] FOSDEM meeting

2020-01-28 Thread Liu Steven


> 在 2020年1月27日,下午3:29,Jean-Baptiste Kempf  写道:
> 
> Hello fellow developers,
> 
> As a reminder, this week-end is the FOSDEM, in Brussels.
Looks very interesting.
> 
> As promised, we will do a FFmpeg developer meeting, where we will vote on the 
> decisions taken during VDD.
> Notably, re-elect the committees, and the voted will  now be done by the new 
> electors.
> 
> This will take place on Saturday (Sunday is the dev room), probably at 14:00 
> if we can.
> It will be joinable through some VideoConf tool.
Can we join by IRC or other things on internet? 
Because these days are Spring Festival (Chinese New Year, Important festivals 
that have lasted for thousands of years),
The more important reason is New infectious virus epidemic areas here. :(

> If you cannot go to FOSDEM for money reasons, please contact me. Both FFmpeg 
> and VideoLAN can sponsor your venue to Brussels!
> 
> Hoping on seeing you in BRU.
> 
> Best,
> 
> -- 
> 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".



Steven
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] [IMPORTANT] FOSDEM meeting

2020-01-28 Thread Paul B Mahol
On 1/28/20, Jean-Baptiste Kempf  wrote:
> On Mon, Jan 27, 2020, at 14:52, Paul B Mahol wrote:
>> On 1/27/20, Jean-Baptiste Kempf  wrote:
>> > Hello fellow developers,
>> >
>> > As a reminder, this week-end is the FOSDEM, in Brussels.
>> >
>> > As promised, we will do a FFmpeg developer meeting, where we will vote
>> > on
>> > the decisions taken during VDD.
>> > Notably, re-elect the committees, and the voted will  now be done by the
>> > new
>> > electors.
>> >
>> > This will take place on Saturday (Sunday is the dev room), probably at
>> > 14:00
>> > if we can.
>> > It will be joinable through some VideoConf tool.
>> >
>> > If you cannot go to FOSDEM for money reasons, please contact me. Both
>> > FFmpeg
>> > and VideoLAN can sponsor your venue to Brussels!
>> >
>>
>> I see no point in joining group of close friends.
>
> If you have nothing of value to add to discussion, please refrain from doing
> so.
>
> Noone is forcing you to come and discuss with other developers; but then
> don't be surprised if an unvoiced opinion is not taken in account.

Well, judging by previous experiences it would not be taken in account anyway.

> --
> 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".
___
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] avformat/mov: correct to representative names for mov.c

2020-01-28 Thread Hendrik Leppkes
On Tue, Jan 28, 2020 at 8:46 AM Gyan Doshi  wrote:
>
> ---
>  libavformat/mov.c   | 6 +++---
>  libavformat/utils.c | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 064fa88137..064d2b5f6e 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -8062,15 +8062,15 @@ static const AVOption mov_options[] = {
>  };
>
>  static const AVClass mov_class = {
> -.class_name = "mov,mp4,m4a,3gp,3g2,mj2",
> +.class_name = "qt,isobmff",
>  .item_name  = av_default_item_name,
>  .option = mov_options,
>  .version= LIBAVUTIL_VERSION_INT,
>  };
>
>  AVInputFormat ff_mov_demuxer = {
> -.name   = "mov,mp4,m4a,3gp,3g2,mj2",
> -.long_name  = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
> +.name   = "qt,isobmff",
> +.long_name  = NULL_IF_CONFIG_SMALL("QuickTime / ISO Base Media File 
> Format"),
>  .priv_class = &mov_class,
>  .priv_data_size = sizeof(MOVContext),
>  .extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v",

These names are strictly speaking part of the ABI, and I'm sure that
some applications will use them to identify a format - I know that I
do, for example.

- 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] [PATCH 5/5] avformat/mov: correct to representative names for mov.c

2020-01-28 Thread Gyan



On 28-01-2020 01:37 pm, Hendrik Leppkes wrote:

On Tue, Jan 28, 2020 at 8:46 AM Gyan Doshi  wrote:

---
  libavformat/mov.c   | 6 +++---
  libavformat/utils.c | 2 +-
  2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 064fa88137..064d2b5f6e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8062,15 +8062,15 @@ static const AVOption mov_options[] = {
  };

  static const AVClass mov_class = {
-.class_name = "mov,mp4,m4a,3gp,3g2,mj2",
+.class_name = "qt,isobmff",
  .item_name  = av_default_item_name,
  .option = mov_options,
  .version= LIBAVUTIL_VERSION_INT,
  };

  AVInputFormat ff_mov_demuxer = {
-.name   = "mov,mp4,m4a,3gp,3g2,mj2",
-.long_name  = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
+.name   = "qt,isobmff",
+.long_name  = NULL_IF_CONFIG_SMALL("QuickTime / ISO Base Media File 
Format"),
  .priv_class = &mov_class,
  .priv_data_size = sizeof(MOVContext),
  .extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v",

These names are strictly speaking part of the ABI, and I'm sure that
some applications will use them to identify a format - I know that I
do, for example.


So, this has to be done with the next major bump for lavf?

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 5/5] avformat/mov: correct to representative names for mov.c

2020-01-28 Thread Hendrik Leppkes
On Tue, Jan 28, 2020 at 9:55 AM Gyan  wrote:
>
>
>
> On 28-01-2020 01:37 pm, Hendrik Leppkes wrote:
> > On Tue, Jan 28, 2020 at 8:46 AM Gyan Doshi  wrote:
> >> ---
> >>   libavformat/mov.c   | 6 +++---
> >>   libavformat/utils.c | 2 +-
> >>   2 files changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/libavformat/mov.c b/libavformat/mov.c
> >> index 064fa88137..064d2b5f6e 100644
> >> --- a/libavformat/mov.c
> >> +++ b/libavformat/mov.c
> >> @@ -8062,15 +8062,15 @@ static const AVOption mov_options[] = {
> >>   };
> >>
> >>   static const AVClass mov_class = {
> >> -.class_name = "mov,mp4,m4a,3gp,3g2,mj2",
> >> +.class_name = "qt,isobmff",
> >>   .item_name  = av_default_item_name,
> >>   .option = mov_options,
> >>   .version= LIBAVUTIL_VERSION_INT,
> >>   };
> >>
> >>   AVInputFormat ff_mov_demuxer = {
> >> -.name   = "mov,mp4,m4a,3gp,3g2,mj2",
> >> -.long_name  = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
> >> +.name   = "qt,isobmff",
> >> +.long_name  = NULL_IF_CONFIG_SMALL("QuickTime / ISO Base Media 
> >> File Format"),
> >>   .priv_class = &mov_class,
> >>   .priv_data_size = sizeof(MOVContext),
> >>   .extensions = 
> >> "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v",
> > These names are strictly speaking part of the ABI, and I'm sure that
> > some applications will use them to identify a format - I know that I
> > do, for example.
>
> So, this has to be done with the next major bump for lavf?
>

Whats the advantage in renaming them at all?

- 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] [PATCH] avformat/tty: add probe function

2020-01-28 Thread Michael Niedermayer
On Tue, Jan 28, 2020 at 08:17:11AM +0100, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavformat/tty.c | 18 +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/tty.c b/libavformat/tty.c
> index 8d48f2c45c..c127500fa1 100644
> --- a/libavformat/tty.c
> +++ b/libavformat/tty.c
> @@ -24,6 +24,8 @@
>   * Tele-typewriter demuxer
>   */
>  
> +#include 
> +
>  #include "libavutil/intreadwrite.h"
>  #include "libavutil/avstring.h"
>  #include "libavutil/log.h"
> @@ -34,6 +36,8 @@
>  #include "internal.h"
>  #include "sauce.h"
>  
> +static const char *const tty_extensions = "ans,art,asc,diz,ice,nfo,txt,vt";
> +
>  typedef struct TtyDemuxContext {
>  AVClass *class;
>  int chars_per_frame;
> @@ -42,6 +46,17 @@ typedef struct TtyDemuxContext {
>  AVRational framerate; /**< Set by a private option. */
>  } TtyDemuxContext;
>  
> +static int read_probe(const AVProbeData *p)
> +{
> +int cnt = 0;
> +
> +for (int i = 0; i < p->buf_size; i++)
> +cnt += !!isprint(p->buf[i]);
> +
> +return (cnt * 100LL / p->buf_size) * (cnt > 400) *
> +!!av_match_ext(p->filename, tty_extensions);
> +}
> +
>  /**
>   * Parse EFI header
>   */
> @@ -153,8 +168,9 @@ AVInputFormat ff_tty_demuxer = {
>  .name   = "tty",
>  .long_name  = NULL_IF_CONFIG_SMALL("Tele-typewriter"),
>  .priv_data_size = sizeof(TtyDemuxContext),
> +.read_probe = read_probe,
>  .read_header= read_header,
>  .read_packet= read_packet,
> -.extensions = "ans,art,asc,diz,ice,nfo,txt,vt",
> +.extensions = tty_extensions,

src/libavformat/tty.c:174:23: error: initializer element is not constant
 .extensions = tty_extensions,
   ^~
src/libavformat/tty.c:174:23: note: (near initialization for 
‘ff_tty_demuxer.extensions’)
src/ffbuild/common.mak:59: recipe for target 'libavformat/tty.o' failed
make: *** [libavformat/tty.o] Error 1

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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] avformat/mov: correct to representative names for mov.c

2020-01-28 Thread Gyan



On 28-01-2020 02:33 pm, Hendrik Leppkes wrote:

On Tue, Jan 28, 2020 at 9:55 AM Gyan  wrote:



On 28-01-2020 01:37 pm, Hendrik Leppkes wrote:

On Tue, Jan 28, 2020 at 8:46 AM Gyan Doshi  wrote:

---
   libavformat/mov.c   | 6 +++---
   libavformat/utils.c | 2 +-
   2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 064fa88137..064d2b5f6e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8062,15 +8062,15 @@ static const AVOption mov_options[] = {
   };

   static const AVClass mov_class = {
-.class_name = "mov,mp4,m4a,3gp,3g2,mj2",
+.class_name = "qt,isobmff",
   .item_name  = av_default_item_name,
   .option = mov_options,
   .version= LIBAVUTIL_VERSION_INT,
   };

   AVInputFormat ff_mov_demuxer = {
-.name   = "mov,mp4,m4a,3gp,3g2,mj2",
-.long_name  = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
+.name   = "qt,isobmff",
+.long_name  = NULL_IF_CONFIG_SMALL("QuickTime / ISO Base Media File 
Format"),
   .priv_class = &mov_class,
   .priv_data_size = sizeof(MOVContext),
   .extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v",

These names are strictly speaking part of the ABI, and I'm sure that
some applications will use them to identify a format - I know that I
do, for example.

So, this has to be done with the next major bump for lavf?


Whats the advantage in renaming them at all?


Accuracy, but it's just a nitpick.

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/scale: fix CID 1457833

2020-01-28 Thread Anton Khirnov
Quoting Gyan (2020-01-17 10:40:22)
> 
> 
> On 16-01-2020 09:07 pm, Anton Khirnov wrote:
> > Quoting Gyan Doshi (2020-01-16 13:59:47)
> >> ---
> >>   libavfilter/vf_scale.c | 6 ++
> >>   1 file changed, 2 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
> >> index d46c767e70..70978345e8 100644
> >> --- a/libavfilter/vf_scale.c
> >> +++ b/libavfilter/vf_scale.c
> >> @@ -498,10 +498,8 @@ static int config_props(AVFilterLink *outlink)
> >>  scale->force_original_aspect_ratio,
> >>  scale->force_divisible_by);
> >>   
> >> -if (scale->w > INT_MAX ||
> >> -scale->h > INT_MAX ||
> >> -(scale->h * inlink->w) > INT_MAX ||
> >> -(scale->w * inlink->h) > INT_MAX)
> >> +if (((int64_t)scale->h * inlink->w) > INT_MAX ||
> >> +((int64_t)scale->w * inlink->h) > INT_MAX)
> > This only works when int is 32bit, which is not guaranteed to be true.
> > The correct way to test it is something like
> > if (scale->h > INT_MAX / inlink->w)
> 
> Makes sense. I took my cue from similar checks in other scale filters. 
> Should convert those too.
> 
> Although I do wonder why this check exists at this time. All it results 
> in is a log msg; any invalid values aren't adjusted. Should this be 
> replaced with av_image_check_size2 or is there another reason for this 
> check?

Yeah, the check seems useless and it's been there since the beginning. I
assume it was intended to avoid overflow in the aspect ratio
calculation.

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

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

[FFmpeg-devel] [PATCH] avformat/tty: add probe function

2020-01-28 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavformat/tty.c | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/libavformat/tty.c b/libavformat/tty.c
index 8d48f2c45c..a8fb9dc8f3 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -24,6 +24,8 @@
  * Tele-typewriter demuxer
  */
 
+#include 
+
 #include "libavutil/intreadwrite.h"
 #include "libavutil/avstring.h"
 #include "libavutil/log.h"
@@ -34,6 +36,8 @@
 #include "internal.h"
 #include "sauce.h"
 
+static const char tty_extensions[31] = "ans,art,asc,diz,ice,nfo,txt,vt";
+
 typedef struct TtyDemuxContext {
 AVClass *class;
 int chars_per_frame;
@@ -42,6 +46,17 @@ typedef struct TtyDemuxContext {
 AVRational framerate; /**< Set by a private option. */
 } TtyDemuxContext;
 
+static int read_probe(const AVProbeData *p)
+{
+int cnt = 0;
+
+for (int i = 0; i < p->buf_size; i++)
+cnt += !!isprint(p->buf[i]);
+
+return (cnt * 100LL / p->buf_size) * (cnt > 400) *
+!!av_match_ext(p->filename, tty_extensions);
+}
+
 /**
  * Parse EFI header
  */
@@ -153,8 +168,9 @@ AVInputFormat ff_tty_demuxer = {
 .name   = "tty",
 .long_name  = NULL_IF_CONFIG_SMALL("Tele-typewriter"),
 .priv_data_size = sizeof(TtyDemuxContext),
+.read_probe = read_probe,
 .read_header= read_header,
 .read_packet= read_packet,
-.extensions = "ans,art,asc,diz,ice,nfo,txt,vt",
+.extensions = tty_extensions,
 .priv_class = &tty_demuxer_class,
 };
-- 
2.17.1

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

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

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/avdct: Clear IDCTDSPContext context

2020-01-28 Thread Michael Niedermayer
On Mon, Jan 27, 2020 at 11:49:49PM -0300, James Almer wrote:
> On 1/27/2020 9:25 PM, Michael Niedermayer wrote:
> > On Mon, Jan 27, 2020 at 06:09:28PM -0300, James Almer wrote:
> >> On 1/27/2020 5:54 PM, Michael Niedermayer wrote:
> >>> Fixes use of uninitialized variable and segfault
> >>>
> >>> Signed-off-by: Michael Niedermayer 
> >>> ---
> >>>  libavcodec/avdct.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/libavcodec/avdct.c b/libavcodec/avdct.c
> >>> index 47e5f7134e..7c761cf39a 100644
> >>> --- a/libavcodec/avdct.c
> >>> +++ b/libavcodec/avdct.c
> >>> @@ -100,7 +100,7 @@ int avcodec_dct_init(AVDCT *dsp)
> >>>  
> >>>  #if CONFIG_IDCTDSP
> >>>  {
> >>> -IDCTDSPContext idsp;
> >>> +IDCTDSPContext idsp = {0};
> >>
> >> Should probably be a memset() in ff_idctdsp_init(). This is not the only
> >> IDCTDSPContext user.
> > 
> > this would not work as IDCTDSPContext.mpeg4_studio_profile must be 
> > initialized but it is also an input to ff_idctdsp_init()
> > 
> > an alternative to the = {0} on the caller side would be to
> > simply add the mpeg4_studio_profile as an argument to ff_idctdsp_init()
> > and remove it from the context, its all just internal API so we can
> > easily redesign this. It should also be documented better ...
> > 
> > What do you suggest ?
> 
> memset(c, 0, offsetof(IDCTDSPContext, mpeg4_studio_profile)) in
> ff_idctdsp_init() should workaround that without the need to add new
> parameters. Just document that mpeg4_studio_profile must be at the end
> of the struct, and be the first field of all those that must be
> initialized before a call to ff_idctdsp_init(), in case new ones are
> added in the future for whatever reason.

The memset() suggested in ff_idctdsp_init() would make no difference
as the function already sets all fields which are not an input.
This would reduce the suggestion to setting mpeg4_studio_profile
in the ?single? caller which does not memset(0) the context prior.

That leaves 3 suggestions
A. "-IDCTDSPContext idsp;"
A. "+IDCTDSPContext idsp = {0};" (for one caller)

B. "+idsp.mpeg4_studio_profile = 0;" (for one caller)

C. "-ff_idctdsp_init();"   
C. "+ff_idctdsp_init(0);"(for all callers)

In all cases ff_idctdsp_init() also probably should be documented.

What do you prefer ?

thx

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

Republics decline into democracies and democracies degenerate into
despotisms. -- 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] [PATCH 1/5] avformat/format: add av_find_input_format2

2020-01-28 Thread Andreas Rheinhardt
Gyan Doshi:
> Identifies demuxer by extension if search by short name fails.
> ---
>  libavformat/avformat.h |  7 +++
>  libavformat/format.c   | 14 +-
>  libavformat/version.h  |  2 +-
>  3 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 9b9b634ec3..c81c4f18fd 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -2246,6 +2246,13 @@ ff_const59 AVInputFormat *av_find_input_format(const 
> char *short_name);
>   */
>  ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, 
> int is_opened);
>  
> +/**
> + * Find AVInputFormat based on the short name of the input format.
> + * If that fails and as_extension is set, find demuxer which has registered 
> the
> + * name as an extension.
> + */
> +ff_const59 AVInputFormat *av_find_input_format2(const char *short_name, int 
> as_extension);
> +
There is no reason not to make this function const-correct from the
beginning, i.e. replace ff_const59 by const.
>  /**
>   * Guess the file format.
>   *
> diff --git a/libavformat/format.c b/libavformat/format.c
> index c47490c8eb..d2382d1cd0 100644
> --- a/libavformat/format.c
> +++ b/libavformat/format.c
> @@ -115,16 +115,28 @@ enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat 
> *fmt, const char *short_
>  return AV_CODEC_ID_NONE;
>  }
>  
> -ff_const59 AVInputFormat *av_find_input_format(const char *short_name)
> +ff_const59 AVInputFormat *av_find_input_format2(const char *short_name, int 
> as_extension)
>  {
>  const AVInputFormat *fmt = NULL;
>  void *i = 0;
>  while ((fmt = av_demuxer_iterate(&i)))
>  if (av_match_name(short_name, fmt->name))
>  return (AVInputFormat*)fmt;

Then you don't need to cast the const away here

> +
> +if (as_extension) {
> +i = 0;
> +while ((fmt = av_demuxer_iterate(&i)))
> +if (fmt->extensions && av_match_name(short_name, 
> fmt->extensions))
> +return (AVInputFormat*)fmt;

and here.

> +}
>  return NULL;
>  }
>  
> +ff_const59 AVInputFormat *av_find_input_format(const char *short_name)
> +{
> +return av_find_input_format2(short_name, 0);

But you will have to cast the const away here.

Not commenting on whether this function should be added at all.

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

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

Re: [FFmpeg-devel] [PATCH v3] avfilter/vf_zoompan: fix shaking when zooming

2020-01-28 Thread Robert Deibel

On 27.01.20 16:44, Paul B Mahol wrote:

On 1/27/20, Robert Deibel  wrote:

-y = *dy = av_clipd(*dy, 0, FFMAX(in->height - h, 0));
-var_values[VAR_Y] = *dy;
-y &= ~((1 << s->desc->log2_chroma_h) - 1);
-
-out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+out = ff_get_video_buffer(outlink, overscaled_w, overscaled_h);

This is wrong. outlink->w/h should be used always, otherwise outlink
w/h differs from frame w/h.

So how should I create a video buffer? I tried av_frame_alloc + setting 
width, height and format + av_frame_get_buffer, but this resulted in a 
heavy performance impact. Apart from the fact, that I can't get the 
correct data copied.


Also, if it's not allowed to pass other w/h why is it even possible? Or 
is it only a problem if I use the outlink? Could I request a buffer from 
the inlink with the modified sizes?


___
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_zoompan: fix shaking when zooming

2020-01-28 Thread Paul B Mahol
On 1/28/20, Robert Deibel  wrote:
> On 27.01.20 16:44, Paul B Mahol wrote:
>> On 1/27/20, Robert Deibel  wrote:
>>> -y = *dy = av_clipd(*dy, 0, FFMAX(in->height - h, 0));
>>> -var_values[VAR_Y] = *dy;
>>> -y &= ~((1 << s->desc->log2_chroma_h) - 1);
>>> -
>>> -out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
>>> +out = ff_get_video_buffer(outlink, overscaled_w, overscaled_h);
>> This is wrong. outlink->w/h should be used always, otherwise outlink
>> w/h differs from frame w/h.
>>
> So how should I create a video buffer? I tried av_frame_alloc + setting
> width, height and format + av_frame_get_buffer, but this resulted in a
> heavy performance impact. Apart from the fact, that I can't get the
> correct data copied.
>
> Also, if it's not allowed to pass other w/h why is it even possible? Or
> is it only a problem if I use the outlink? Could I request a buffer from
> the inlink with the modified sizes?

Frame w/h should be exactly same as outlink w/h.
Otherwise output will not have always same w/h.
Why are you changing w/h at all?

>
> ___
> 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] avfilter/vf_zoompan: fix shaking when zooming

2020-01-28 Thread Robert Deibel

On 28.01.20 15:46, Paul B Mahol wrote:

On 1/28/20, Robert Deibel  wrote:

On 27.01.20 16:44, Paul B Mahol wrote:

On 1/27/20, Robert Deibel  wrote:

-y = *dy = av_clipd(*dy, 0, FFMAX(in->height - h, 0));
-var_values[VAR_Y] = *dy;
-y &= ~((1 << s->desc->log2_chroma_h) - 1);
-
-out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+out = ff_get_video_buffer(outlink, overscaled_w, overscaled_h);

This is wrong. outlink->w/h should be used always, otherwise outlink
w/h differs from frame w/h.


So how should I create a video buffer? I tried av_frame_alloc + setting
width, height and format + av_frame_get_buffer, but this resulted in a
heavy performance impact. Apart from the fact, that I can't get the
correct data copied.

Also, if it's not allowed to pass other w/h why is it even possible? Or
is it only a problem if I use the outlink? Could I request a buffer from
the inlink with the modified sizes?

Frame w/h should be exactly same as outlink w/h.
Otherwise output will not have always same w/h.
Why are you changing w/h at all?


The idea was to build a slightly larger frame than output to compensate 
for rounding errors and crop it to the correct size afterwards.


___
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] [IMPORTANT] FOSDEM meeting

2020-01-28 Thread Jean-Baptiste Kempf
On Tue, Jan 28, 2020, at 09:08, Paul B Mahol wrote:
> On 1/28/20, Jean-Baptiste Kempf  wrote:
> > On Mon, Jan 27, 2020, at 14:52, Paul B Mahol wrote:
> >> > If you cannot go to FOSDEM for money reasons, please contact me. Both
> >> > FFmpeg
> >> > and VideoLAN can sponsor your venue to Brussels!
> >> >
> >>
> >> I see no point in joining group of close friends.
> >
> > If you have nothing of value to add to discussion, please refrain from doing
> > so.
> >
> > Noone is forcing you to come and discuss with other developers; but then
> > don't be surprised if an unvoiced opinion is not taken in account.
> 
> Well, judging by previous experiences it would not be taken in account anyway.

All expressed opinions have always been taken into account.

However, "I don't like that" or "I hereby here declare against this "Decisions" 
and will act against them." without explanations are not expressed opinions, 
they are just flamebait statements with nothing to act on.

If you have points where you are against, you can explain why.
Any "I'm against" will just be discarded, because this is not actionable by 
anyone  and solves no problem whatsoever.

It's exactly like you complain when people reject your patches because "I don't 
like the patch", without more explanations.

-- 
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] avfilter/asrc_sinc: Don't allocate arrays separately

2020-01-28 Thread Michael Niedermayer
On Mon, Jan 27, 2020 at 09:36:51AM +0100, Paul B Mahol wrote:
> LGTM

will apply


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

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- 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 2/4] avformat/mov: Don't leak MOVFragmentStreamInfo on error

2020-01-28 Thread Michael Niedermayer
On Mon, Jan 27, 2020 at 09:28:19AM +0100, Andreas Rheinhardt wrote:
> Fixes Coverity issue #1441933.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/mov.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

will apply

thx

[...]
-- 
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 1/4] avformat/mov: Free encryption data on error

2020-01-28 Thread Michael Niedermayer
On Mon, Jan 27, 2020 at 09:28:18AM +0100, Andreas Rheinhardt wrote:
> Fixes memleak and Coverity issue #1439587.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/mov.c | 6 --
>  1 file changed, 4 insertions(+), 2 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] [PATCH 2/2] libavcodec/amfenc_hevc.c: Fix Profile level option on AMF HEVC.

2020-01-28 Thread OvchinnikovDmitrii
Patch was made by Sitan Liu 
The same code already exists in amfenc_h264.c
---
 libavcodec/amfenc_hevc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index 8b4d289fac..77e57d2461 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -136,7 +136,7 @@ static av_cold int amf_encode_init_hevc(AVCodecContext 
*avctx)
 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, 
ctx->tier);
 
 profile_level = avctx->level;
-if (profile_level == 0) {
+if (profile_level == FF_LEVEL_UNKNOWN) {
 profile_level = ctx->level;
 }
 if (profile_level != 0) {
@@ -144,7 +144,7 @@ static av_cold int amf_encode_init_hevc(AVCodecContext 
*avctx)
 }
 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, 
AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET, ctx->quality);
 // Maximum Reference Frames
-if (avctx->refs != 0) {
+if (avctx->refs != -1) {
 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, 
AMF_VIDEO_ENCODER_HEVC_MAX_NUM_REFRAMES, avctx->refs);
 }
 // Aspect Ratio
-- 
2.19.1.windows.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] libavcodec/amfenc_hevc.c: Fix constant QP settings for I, P

2020-01-28 Thread OvchinnikovDmitrii
---
 libavcodec/amfenc_hevc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index 7c9a33ab33..8b4d289fac 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -254,10 +254,10 @@ static av_cold int amf_encode_init_hevc(AVCodecContext 
*avctx)
 }
 
 if (ctx->qp_p != -1) {
-AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, 
AMF_VIDEO_ENCODER_HEVC_QP_I, ctx->qp_p);
+AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, 
AMF_VIDEO_ENCODER_HEVC_QP_P, ctx->qp_p);
 }
 if (ctx->qp_i != -1) {
-AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, 
AMF_VIDEO_ENCODER_HEVC_QP_P, ctx->qp_i);
+AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, 
AMF_VIDEO_ENCODER_HEVC_QP_I, ctx->qp_i);
 }
 AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, 
AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_SKIP_FRAME_ENABLE, ctx->skip_frame);
 
-- 
2.19.1.windows.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 001/244] Add a new channel layout API

2020-01-28 Thread Anton Khirnov
Quoting Nicolas George (2020-01-14 17:07:56)
> Anton Khirnov (12020-01-14):
> > No. If you want to mix multiple streams, then your mixing filter should
> > support multiple streams. It is certainly in no way "natural" or correct
> > to invent a scheme for stream multiplexing through channel layouts.
> 
> You could argue that if the channel layout API was done and the filter
> was in the process of being written. But it is the other way around: the
> filter exists, it has needs, the new API must adapt.

That makes no sense. The filter cannot "have needs" when the current API
does not support the use case you have in mind (which is good). The
filter can either be modified to allow multiple inputs or a new filter
can be added.

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

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

Re: [FFmpeg-devel] [PATCH 4/6] avcodec/pngdec: Check amount decoded

2020-01-28 Thread Michael Niedermayer
On Sun, Aug 18, 2019 at 01:28:39AM +0200, Michael Niedermayer wrote:
> Fixes: Timeout (70sec -> 243ms)
> Fixes: 
> 16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/pngdec.c | 12 
>  1 file changed, 12 insertions(+)

There are now 4 testcases this patch fixes:
Fixes: 
16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824
Fixes: 
16927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5170612070252544
Fixes: 
16927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5706325622784000
Fixes: 
18705/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5650989302677504

[...]

-- 
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 1/2] avutil/log: Add av_log_once() for printing a message just once per instance

2020-01-28 Thread Anton Khirnov
Quoting Michael Niedermayer (2020-01-24 13:04:08)
> On Tue, Jan 21, 2020 at 07:44:46PM +0100, Anton Khirnov wrote:
> > Quoting Michael Niedermayer (2020-01-21 15:43:48)
> > > On Tue, Jan 21, 2020 at 12:24:50PM +0100, Anton Khirnov wrote:
> > > > Quoting Michael Niedermayer (2020-01-16 17:51:28)
> > > > > Compared to ad-hoc if(printed) ... code this allows the user to 
> > > > > disable
> > > > > it with a flag and see all repeated messages, it is also simpler
> > > > 
> > > > That flag is global state - it should be deprecated and removed, not
> > > > embedded further into the API.
> > > 
> > > When the flag is replaced by a non global solution every of its uses
> > > would be replaced too.
> > > 
> > > Until such a non global API exists, this is the only way the user can
> > > indicate her choice of which log messages to print.
> > > Code should honor the existing API and user preferrance.
> > 
> > The problem is that right now, flags is only used by the default log
> > callback. The behaviour of the default log callback is not specified by
> > the API, so it can be changed later without much trouble. With this
> > patch, the function of flags is hardcoded into the API, making its
> > future removal significantly harder.
> 
> I dont really see this concern. Because if you disable the flag "today"
> you break the API as it is documented, the flag is documented to
> affect the message repeation.
> With this patch, disabling it still breaks a bunch of message repeating
> behavior, so to me this looks like its basically the same.

The flag is documented, but the situations where it applies are not.
Currently, it only applies to the default log callback. It has no effect
whatsoever on users who use their own callback. With your patch, its
influence spreads into the core API. Since I see the flag as something
to be removed, I would prefer it were not done.

> 
> But what do you suggest ?
> 
> We could send all the repeated _once() messages to the callback and leave it
> to the callback to drop them. Just needs a way to tag them as repeats
> 
> We could move the (no)repeat flag to each context but this feels unwieldy
> and feels like it solves a problem noone had. Because noone ever asked
> AFAIR that they wanted to change repeating behavior on a per context base.
> This is probably mostly used by developers wanting to check for "all"
> messages. Or users produding bug reports which also would ideally have
> no dropped messages.
> 
> I can also just drop the use of the flag entirely from the patch and just
> leave this as a unconditional _once() log. It feels a bit like a missing
> feature though because as a devleoper for debuging a simple switch to
> see all repeats seems usefull.

I would say that log_once() should be used only for messages that are
meaningful just once (per context). It then makes no sense to log them
multiple times. Otherwise normal logging should be used.

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

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

[FFmpeg-devel] [PATCH 3/3] avcodec/lagarith: Sanity check scale

2020-01-28 Thread Michael Niedermayer
A value of 24 and above can collaps the range to 0 which would not work.

Fixes: Timeout (75sec -> 21sec)
Fixes: 
18707/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-5708950892969984

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/lagarith.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 59169be5de..0a45812bc1 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -226,6 +226,9 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext 
*gb)
 }
 }
 
+if (scale_factor > 23)
+return AVERROR_INVALIDDATA;
+
 rac->scale = scale_factor;
 
 /* Fill probability array with cumulative probability for each symbol. */
-- 
2.17.1

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

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

[FFmpeg-devel] [PATCH 1/3] avcodec/apedec: Fix integer overflows in predictor_decode_mono_3950()

2020-01-28 Thread Michael Niedermayer
Fixes: signed integer overflow: -2147407150 + -1871606 cannot be represented in 
type 'int'
Fixes: 
18702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5679095417667584

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/apedec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 1b23e54153..1cafa9c2f3 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1208,14 +1208,14 @@ static void predictor_decode_mono_3950(APEContext *ctx, 
int count)
 A = *decoded0;
 
 p->buf[YDELAYA] = currentA;
-p->buf[YDELAYA - 1] = p->buf[YDELAYA] - p->buf[YDELAYA - 1];
+p->buf[YDELAYA - 1] = p->buf[YDELAYA] - (unsigned)p->buf[YDELAYA - 1];
 
 predictionA = p->buf[YDELAYA] * p->coeffsA[0][0] +
   p->buf[YDELAYA - 1] * p->coeffsA[0][1] +
   p->buf[YDELAYA - 2] * p->coeffsA[0][2] +
   p->buf[YDELAYA - 3] * p->coeffsA[0][3];
 
-currentA = A + (predictionA >> 10);
+currentA = A + (unsigned)(predictionA >> 10);
 
 p->buf[YADAPTCOEFFSA] = APESIGN(p->buf[YDELAYA]);
 p->buf[YADAPTCOEFFSA - 1] = APESIGN(p->buf[YDELAYA - 1]);
-- 
2.17.1

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

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

[FFmpeg-devel] [PATCH 2/3] avcodec/pngdec: Check amount decoded

2020-01-28 Thread Michael Niedermayer
Fixes: Timeout (70sec -> 243ms)
Fixes: 
16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824
Fixes: 
16927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5170612070252544
Fixes: 
16927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5706325622784000
Fixes: 
18705/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5650989302677504

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/pngdec.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index d37dabcc4d..3ce980fc15 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -320,6 +320,15 @@ static void deloco_ ## NAME(TYPE *dst, int size, int 
alpha) \
 YUV2RGB(rgb8, uint8_t)
 YUV2RGB(rgb16, uint16_t)
 
+static int percent_missing(PNGDecContext *s)
+{
+if (s->interlace_type) {
+return 100 - 100 * s->pass / (NB_PASSES - 1);
+} else {
+return 100 - 100 * s->y / s->cur_h;
+}
+}
+
 /* process exactly one decompressed row */
 static void png_handle_row(PNGDecContext *s)
 {
@@ -1354,6 +1363,9 @@ exit_loop:
 return 0;
 }
 
+if (percent_missing(s) > avctx->discard_damaged_percentage)
+return AVERROR_INVALIDDATA;
+
 if (s->bits_per_pixel <= 4)
 handle_small_bpp(s, p);
 
-- 
2.17.1

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

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

Re: [FFmpeg-devel] [PATCH] avformat/tty: add probe function

2020-01-28 Thread Peter Ross
On Tue, Jan 28, 2020 at 02:17:35PM +0100, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavformat/tty.c | 18 +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/tty.c b/libavformat/tty.c
> index 8d48f2c45c..a8fb9dc8f3 100644
> --- a/libavformat/tty.c
> +++ b/libavformat/tty.c
> @@ -24,6 +24,8 @@
>   * Tele-typewriter demuxer
>   */
>  
> +#include 
> +
>  #include "libavutil/intreadwrite.h"
>  #include "libavutil/avstring.h"
>  #include "libavutil/log.h"
> @@ -34,6 +36,8 @@
>  #include "internal.h"
>  #include "sauce.h"
>  
> +static const char tty_extensions[31] = "ans,art,asc,diz,ice,nfo,txt,vt";
> +
>  typedef struct TtyDemuxContext {
>  AVClass *class;
>  int chars_per_frame;
> @@ -42,6 +46,17 @@ typedef struct TtyDemuxContext {
>  AVRational framerate; /**< Set by a private option. */
>  } TtyDemuxContext;
>  
> +static int read_probe(const AVProbeData *p)
> +{
> +int cnt = 0;
> +
> +for (int i = 0; i < p->buf_size; i++)
> +cnt += !!isprint(p->buf[i]);
> +
> +return (cnt * 100LL / p->buf_size) * (cnt > 400) *
> +!!av_match_ext(p->filename, tty_extensions);
> +}
> +
>  /**
>   * Parse EFI header
>   */
> @@ -153,8 +168,9 @@ AVInputFormat ff_tty_demuxer = {
>  .name   = "tty",
>  .long_name  = NULL_IF_CONFIG_SMALL("Tele-typewriter"),
>  .priv_data_size = sizeof(TtyDemuxContext),
> +.read_probe = read_probe,
>  .read_header= read_header,
>  .read_packet= read_packet,
> -.extensions = "ans,art,asc,diz,ice,nfo,txt,vt",
> +.extensions = tty_extensions,
>  .priv_class = &tty_demuxer_class,
>  };
> -- 
> 2.17.1

i can't offer any more suggestions. recommend approve.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


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/2] tools/target_dec_fuzzer: Add threshold for IFF_ILBM

2020-01-28 Thread Peter Ross
On Thu, Jan 23, 2020 at 12:36:39AM +0100, Michael Niedermayer wrote:
> Fixes: Timeout (32 -> 1sec)
> Fixes: 
> 20138/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5634665251864576
> 
> 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(+)
> 
> diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
> index a3d784a019..e554558b69 100644
> --- a/tools/target_dec_fuzzer.c
> +++ b/tools/target_dec_fuzzer.c
> @@ -143,6 +143,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
> size) {
>  case AV_CODEC_ID_DST:   maxsamples /= 8192; break;
>  case AV_CODEC_ID_DXV:   maxpixels /= 32;  break;
>  case AV_CODEC_ID_FFWAVESYNTH: maxsamples /= 16384; break;
> +case AV_CODEC_ID_IFF_ILBM:  maxpixels /= 128; break;
>  case AV_CODEC_ID_MSRLE: maxpixels /= 16;  break;
>  case AV_CODEC_ID_QTRLE: maxpixels /= 16;  break;
>  case AV_CODEC_ID_RASC:  maxpixels /= 16;  break;

approve.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


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/tty: add probe function

2020-01-28 Thread Nicolas George
Peter Ross (12020-01-29):
> > +for (int i = 0; i < p->buf_size; i++)
> > +cnt += !!isprint(p->buf[i]);

This depends on locale settings. Is it on purpose?

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] avformat/tty: add probe function

2020-01-28 Thread Paul B Mahol
On 1/28/20, Nicolas George  wrote:
> Peter Ross (12020-01-29):
>> > +for (int i = 0; i < p->buf_size; i++)
>> > +cnt += !!isprint(p->buf[i]);
>
> This depends on locale settings. Is it on purpose?

I certainly could write one which does not use locale, if that is ok with you?

>
> Regards,
>
> --
>   Nicolas George
>
___
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/tty: add probe function

2020-01-28 Thread Nicolas George
Paul B Mahol (12020-01-28):
> I certainly could write one which does not use locale, if that is ok with you?

You know better than me on this issue. I was just pointing something
that may have been forgotten.

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

[FFmpeg-devel] [PATCH] avformat/tty: add probe function

2020-01-28 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavformat/tty.c | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/libavformat/tty.c b/libavformat/tty.c
index 8d48f2c45c..69aad64790 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -34,6 +34,13 @@
 #include "internal.h"
 #include "sauce.h"
 
+static int isansicode(int x)
+{
+return (x == 0x1B) || (x >= 0x20 && x < 0x7f);
+}
+
+static const char tty_extensions[31] = "ans,art,asc,diz,ice,nfo,txt,vt";
+
 typedef struct TtyDemuxContext {
 AVClass *class;
 int chars_per_frame;
@@ -42,6 +49,17 @@ typedef struct TtyDemuxContext {
 AVRational framerate; /**< Set by a private option. */
 } TtyDemuxContext;
 
+static int read_probe(const AVProbeData *p)
+{
+int cnt = 0;
+
+for (int i = 0; i < p->buf_size; i++)
+cnt += !!isansicode(p->buf[i]);
+
+return (cnt * 100LL / p->buf_size) * (cnt > 400) *
+!!av_match_ext(p->filename, tty_extensions);
+}
+
 /**
  * Parse EFI header
  */
@@ -153,8 +171,9 @@ AVInputFormat ff_tty_demuxer = {
 .name   = "tty",
 .long_name  = NULL_IF_CONFIG_SMALL("Tele-typewriter"),
 .priv_data_size = sizeof(TtyDemuxContext),
+.read_probe = read_probe,
 .read_header= read_header,
 .read_packet= read_packet,
-.extensions = "ans,art,asc,diz,ice,nfo,txt,vt",
+.extensions = tty_extensions,
 .priv_class = &tty_demuxer_class,
 };
-- 
2.17.1

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

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

Re: [FFmpeg-devel] [PATCH v2] HEVC: Export motion vectors to frame side data.

2020-01-28 Thread Asaf Kave
On Sun, Jan 26, 2020, 12:31 Asaf Kave  wrote:

>
>
> On Wed, Jan 22, 2020 at 1:09 PM Asaf Kave  wrote:
>
>>
>>
>> On Tue, Jan 21, 2020 at 8:17 PM Lynne  wrote:
>>
>>> Jan 20, 2020, 08:42 by kavea...@gmail.com:
>>>
>>> > Ping
>>> >
>>>
>>> https://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248836.html
>>>
>>>
>>> I've okayed it, its just not been pushed yet.
>>> You'll need to add the vectors to the block struct. int16_t [2] will do.
>>>
>>
>> Thanks Lynne,
>> I didn't find the 'libavutil: AVEncodeInfo data structures' commit\patch,
>> even i try searching the code on the latest 'master' branch.
>> Where can i get the new API ?
>>
>
> Hi,
> Can someone accelerate this?
> Thanks
>
>

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".
>>
>>
___
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/tty: add probe function

2020-01-28 Thread Carl Eugen Hoyos
Am Di., 28. Jan. 2020 um 22:28 Uhr schrieb Paul B Mahol :

> +static int isansicode(int x)
> +{
> +return (x == 0x1B) || (x >= 0x20 && x < 0x7f);

I would have expected at least CR and LF, maybe
also the tabulator, to be valid characters.

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] fate/filter-video.mak: do not use bit-exact check for dnn_processing

2020-01-28 Thread Carl Eugen Hoyos
Am Mi., 22. Jan. 2020 um 13:09 Uhr schrieb Martin Storsjö :

> If it takes time to get the test to that point, I would suggest reverting
> the existing two tests for now.

Did this when I realized that the existing test breaks fate without
SAMPLES on all platforms.

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/mov: update extensions

2020-01-28 Thread Carl Eugen Hoyos
Am Mo., 27. Jan. 2020 um 18:07 Uhr schrieb Gyan :

> As I mentioned, the benefit is for cli users able to specify `-f ext`
> as well as `-h demuxer=ext`

I cannot reproduce this...

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]lavf/nut: Explicitely add tags for NV12 and NV21

2020-01-28 Thread Carl Eugen Hoyos
Hi!

Mentioned tags are already used in nut by fate.

Please comment, Carl Eugen
From dd52b20ce2eea008a0c58c09f768e5ef92133578 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Wed, 29 Jan 2020 01:43:24 +0100
Subject: [PATCH] lavf/nut: Explicitely add NV12/NV21 tags.

These are already used by fate.
---
 libavformat/nut.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/nut.c b/libavformat/nut.c
index d6993239a3..fb7d7b512d 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -163,6 +163,9 @@ const AVCodecTag ff_nut_video_tags[] = {
 { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1',   0,  14) },
 { AV_CODEC_ID_RAWVIDEO, MKTAG(14,0, '1', 'Y') },
 
+{ AV_CODEC_ID_RAWVIDEO, MKTAG('N', 'V', '1', '2') },
+{ AV_CODEC_ID_RAWVIDEO, MKTAG('N', 'V', '2', '1') },
+
 { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3',   0,   8) },
 
 { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3',   0,   9) },
-- 
2.24.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] Fix undefined behavior in ff_configure_buffers_for_index()

2020-01-28 Thread Dale Curtis
When e2_pts == INT64_MIN and e1_pts >= 0 the calculation of
e2_pts - e1_pts will overflow an int64_t. So instead check
for overflow and default to |time_tolerance| if the value
is too large for an int64_t.

Signed-off-by: Dale Curtis 
From 412751f4747faf34e3dba088dc55290783eb6bd5 Mon Sep 17 00:00:00 2001
From: Dale Curtis 
Date: Tue, 28 Jan 2020 16:49:14 -0800
Subject: [PATCH] Fix undefined behavior in ff_configure_buffers_for_index()

When e2_pts == INT64_MIN and e1_pts >= 0 the calculation of
e2_pts - e1_pts will overflow an int64_t. So instead check
for overflow and default to |time_tolerance| if the value
is too large for an int64_t.

Signed-off-by: Dale Curtis 
---
 libavformat/utils.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index e22ca7cab8..d6197358c9 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2135,7 +2135,13 @@ void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance)
 for (; i2 < st2->nb_index_entries; i2++) {
 AVIndexEntry *e2 = &st2->index_entries[i2];
 int64_t e2_pts = av_rescale_q(e2->timestamp, st2->time_base, AV_TIME_BASE_Q);
-if (e2_pts - e1_pts < time_tolerance)
+int64_t delta = e1_pts < 1 ? INT64_MAX + e1_pts >= e2_pts
+ ? e2_pts - e1_pts
+ : time_tolerance
+   : INT64_MIN + e1_pts <= e2_pts
+ ? e2_pts - e1_pts
+ : time_tolerance;
+if (delta < time_tolerance)
 continue;
 pos_delta = FFMAX(pos_delta, e1->pos - e2->pos);
 break;
-- 
2.25.0.341.g760bfbb309-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] [PATCH] fate/filter-video.mak: do not use bit-exact check for dnn_processing

2020-01-28 Thread Pedro Arthur
Em ter., 28 de jan. de 2020 às 21:20, Carl Eugen Hoyos
 escreveu:
>
> Am Mi., 22. Jan. 2020 um 13:09 Uhr schrieb Martin Storsjö :
>
> > If it takes time to get the test to that point, I would suggest reverting
> > the existing two tests for now.
>
> Did this when I realized that the existing test breaks fate without
> SAMPLES on all platforms.
I'm not against reverting it but isn't SAMPLES required to run fate?
at least it seems to be implied by [1]

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

[1] - https://ffmpeg.org/fate.html
___
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/mov: update extensions

2020-01-28 Thread Gyan



On 29-01-2020 05:52 am, Carl Eugen Hoyos wrote:

Am Mo., 27. Jan. 2020 um 18:07 Uhr schrieb Gyan :


As I mentioned, the benefit is for cli users able to specify `-f ext`
as well as `-h demuxer=ext`

I cannot reproduce this...


That will depend on my patch that adds av_find_input_format2. I sent it 
yesterday.


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 02/13] lavc/ass: add support for configuring default style via AVOptions

2020-01-28 Thread rcombs


> On Jan 27, 2020, at 08:28, Moritz Barsnick  wrote:
> 
> On Fri, Jan 24, 2020 at 20:01:49 -0600, rcombs wrote:
>> +static int invert_ass_alpha(uint32_t c)
>> +{
>> +uint32_t a = c >> 24;
>> +return ((255 - a) << 24) | (c & 0xff);
>> +}
> 
> You're inverting the "leftmost" 8 bits of c? Can't you just make this
> 
> return (c ^ 0xff00);
> 
> ? Even inline, or just a macro? (Or perhaps I'm missing something, and
> (255 - a) is not always the same as (a ^ 0xff).

These are indeed equivalent, but I thought this more clearly conveyed the 
intent here ("convert between 0=transparent and 0=opaque by inverting the 0-255 
alpha field").

> 
>> +#define ASS_HEADER_AVOPTIONS(cls, obj) \
>> +{ "res",  "script resolution", offsetof(cls, obj.res_x), 
>> AV_OPT_TYPE_IMAGE_SIZE, { .str = ASS_DEFAULT_PLAYRES_STR }, 1, INT_MAX, 
>> ASS_DS }, \
>> +{ "font", "default font name", offsetof(cls, obj.style.font), 
>> AV_OPT_TYPE_STRING,  { .str = NULL }, 0, 0, ASS_DS }, \
>> +{ "font_size", "default font name", offsetof(cls, obj.style.font_size), 
>> AV_OPT_TYPE_DOUBLE,  { .dbl = ASS_DEFAULT_FONT_SIZE }, 0, INT_MAX, ASS_DS }, 
>> \
>> +{ "color", "default text color", offsetof(cls, obj.style.color), 
>> AV_OPT_TYPE_COLOR, { .str = ASS_DEFAULT_COLOR_STR }, 0, 0, ASS_DS }, \
>> +{ "color2", "default secondary text color", offsetof(cls, 
>> obj.style.color2), AV_OPT_TYPE_COLOR, { .str = ASS_DEFAULT_COLOR_STR }, 0, 
>> 0, ASS_DS }, \
>> +{ "outline_color", "default text outline color", offsetof(cls, 
>> obj.style.outline_color), AV_OPT_TYPE_COLOR, { .str = ASS_DEFAULT_BCOLOR_STR 
>> }, 0, 0, ASS_DS }, \
>> +{ "back_color", "default text background/shadow color", offsetof(cls, 
>> obj.style.back_color), AV_OPT_TYPE_COLOR, { .str = ASS_DEFAULT_BCOLOR_STR }, 
>> 0, 0, ASS_DS }, \
>> +{ "bold", "default text boldness (0/1/weight value)", offsetof(cls, 
>> obj.style.bold), AV_OPT_TYPE_INT, { .i64 = ASS_DEFAULT_BOLD }, 0, INT_MAX, 
>> ASS_DS }, \
>> +{ "italic", "default text italics", offsetof(cls, obj.style.bold), 
>> AV_OPT_TYPE_BOOL, { .i64 = ASS_DEFAULT_ITALIC }, 0, 1, ASS_DS }, \
>> +{ "underline", "default text italics", offsetof(cls, 
>> obj.style.underline), AV_OPT_TYPE_BOOL, { .i64 = ASS_DEFAULT_UNDERLINE }, 0, 
>> 1, ASS_DS }, \
>> +{ "strikeout", "default text strikeout", offsetof(cls, 
>> obj.style.strikeout), AV_OPT_TYPE_BOOL, { .i64 = ASS_DEFAULT_STRIKEOUT }, 0, 
>> 1, ASS_DS }, \
>> +{ "scale_x", "default horizontal text scale", offsetof(cls, 
>> obj.style.scale_x), AV_OPT_TYPE_DOUBLE, { .dbl = ASS_DEFAULT_SCALE_X }, 0, 
>> INT_MAX, ASS_DS }, \
>> +{ "scale_y", "default vertical text scale", offsetof(cls, 
>> obj.style.scale_y), AV_OPT_TYPE_DOUBLE, { .dbl = ASS_DEFAULT_SCALE_Y }, 0, 
>> INT_MAX, ASS_DS }, \
>> +{ "border_style", "default text border style", offsetof(cls, 
>> obj.style.border_style), AV_OPT_TYPE_INT, { .i64 = ASS_DEFAULT_BORDERSTYLE 
>> }, 1, 4, ASS_DS }, \
>> +{ "outline", "default text outline width", offsetof(cls, 
>> obj.style.outline), AV_OPT_TYPE_DOUBLE, { .dbl = ASS_DEFAULT_OUTLINE }, 0, 
>> INT_MAX, ASS_DS }, \
>> +{ "shadow", "default text shadow drop", offsetof(cls, 
>> obj.style.shadow), AV_OPT_TYPE_DOUBLE, { .dbl = ASS_DEFAULT_SHADOW }, 0, 
>> INT_MAX, ASS_DS }, \
>> +{ "alignment", "default text alignment", offsetof(cls, 
>> obj.style.alignment), AV_OPT_TYPE_INT, { .i64 = ASS_DEFAULT_ALIGNMENT }, 1, 
>> 9, ASS_DS }, \
>> +{ "margin_l", "default left margin", offsetof(cls, obj.style.margin_l), 
>> AV_OPT_TYPE_INT, { .i64 = ASS_DEFAULT_MARGINL }, 0, INT_MAX, ASS_DS }, \
>> +{ "margin_r", "default right margin", offsetof(cls, 
>> obj.style.margin_r), AV_OPT_TYPE_INT, { .i64 = ASS_DEFAULT_MARGINR }, 0, 
>> INT_MAX, ASS_DS }, \
>> +{ "margin_v", "default vertical margin", offsetof(cls, 
>> obj.style.margin_v), AV_OPT_TYPE_INT, { .i64 = ASS_DEFAULT_MARGINV }, 0, 
>> INT_MAX, ASS_DS }, \
> 
> To make this more readable, you should also MACROify the "offsetof(cls,
> obj.X)", as many other options sections do it, and perhaps align the
> entries' columns.

I shied away from this to avoid polluting the global macro space (since this is 
in a header); I can do it anyway if you prefer (it's not like it's a public 
header, at least).

> 
> Moritz
> ___
> 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 v4] avcodec/libvpxenc: add VP9 temporal scalability encoding option

2020-01-28 Thread James Zern
On Fri, Jan 17, 2020 at 1:56 PM Wonkap Jang
 wrote:
>
> Hi James,
>
> On Fri, Jan 17, 2020 at 1:50 PM Wonkap Jang  wrote:
>
> > This commit reuses the configuration options for VP8 that enables
> > temporal scalability for VP9. It also adds a way to enable three
> > preset temporal structures (refer to the documentation for more
> > detail) that can be used in offline encoding.
> > ---
> >  doc/encoders.texi  |  18 ++-
> >  libavcodec/libvpxenc.c | 250 +
> >  2 files changed, 242 insertions(+), 26 deletions(-)
> >

I realized I missed a couple things previously.

> > [...]
> > +static int vpx_ts_param_parse(VPxContext *ctx, struct vpx_codec_enc_cfg
> > *enccfg,
> > +  char *key, char *value, enum AVCodecID
> > codec_id)
> >  {
> >  size_t value_len = strlen(value);
> > +int ts_layering_mode = 0;
> >
> >  if (!value_len)
> >  return -1;
> >
> >  if (!strcmp(key, "ts_number_layers"))

There isn't much validation here, libvpx should provide that, but can you try
some incompatible input? ts_layering_mode is defined up to 3, so
ts_number_layers > 3 should fail on init.

> > [...]
> > +
> > +#if (VPX_ENCODER_ABI_VERSION >= 12) && CONFIG_LIBVPX_VP9_ENCODER
> > +enccfg->temporal_layering_mode = 1; // only bypass mode is supported

There's VP9E_TEMPORAL_LAYERING_MODE_BYPASS for this.

> > for now.
> > +enccfg->ss_number_layers = 1; // TODO: add spatial scalability
> > support.
> > +#endif
> > +if (ts_layering_mode) {
> > +// make sure the ts_layering_mode comes at the end of the
> > ts_parameter string to ensure that
> > +// correct configuration is done.
> > +ctx->ts_layer_flags = av_malloc(sizeof(*ctx->ts_layer_flags) *
> > VPX_TS_MAX_PERIODICITY);

This would be better written as av_malloc_array. Looking at the use of the
array, it doesn't look like it needs to be zeroed, but there's av_mallocz_array
for that.
___
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".