Re: [FFmpeg-devel] [PATCH] lavc/qsvenc_hevc: add qmax/qmin support for HEVC encoding

2020-06-29 Thread Fu, Linjie
> From: Zhong Li 
> Sent: Thursday, March 12, 2020 10:07
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Cc: Rogozhkin, Dmitry V ; Fu, Linjie
> 
> Subject: Re: [FFmpeg-devel] [PATCH] lavc/qsvenc_hevc: add qmax/qmin
> support for HEVC encoding
> 
> Linjie Fu  于2020年3月11日周三 下午6:44写道:
> >
> > Add qmax/qmin support for HEVC software bitrate control(SWBRC).
> >
> > Limitations:
> > - RateControlMethod != MFX_RATECONTROL_CQP
> > - with EXTBRC ON
> >
> > Signed-off-by: Dmitry Rogozhkin 
> > Signed-off-by: Linjie Fu 
> > ---
> >
> > Relative code in MSDK for the limitation:
> > https://github.com/Intel-Media-
> SDK/MediaSDK/blob/master/_studio/mfx_lib/encode_hw/hevc/agnostic/g9
> /hevcehw_g9_legacy.cpp#L4267
> >
> >  libavcodec/qsvenc.c  | 11 +--
> >  libavcodec/qsvenc_hevc.c |  2 ++
> >  2 files changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> > index 52b4e43..2c22eb7 100644
> > --- a/libavcodec/qsvenc.c
> > +++ b/libavcodec/qsvenc.c
> > @@ -732,6 +732,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >  if (q->adaptive_b >= 0)
> >  q->extco2.AdaptiveB = q->adaptive_b ?
> MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
> >  #endif
> > +}
> > +
> > +if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id ==
> AV_CODEC_ID_HEVC) {
> > +if (q->extbrc >= 0)
> > +q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON :
> MFX_CODINGOPTION_OFF;
> >
> >  #if QSV_VERSION_ATLEAST(1, 9)
> >  if (avctx->qmin >= 0 && avctx->qmax >= 0 && avctx->qmin > 
> > avctx-
> >qmax) {
> > @@ -747,12 +752,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >  q->extco2.MaxQPP = q->extco2.MaxQPB = q->extco2.MaxQPI;
> >  }
> >  #endif
> > -}
> > -
> > -if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id ==
> AV_CODEC_ID_HEVC) {
> > -if (q->extbrc >= 0)
> > -q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON :
> MFX_CODINGOPTION_OFF;
> > -
> >  q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2;
> >  q->extco2.Header.BufferSz = sizeof(q->extco2);
> >
> > diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
> > index 27e2232..3bdca7d 100644
> > --- a/libavcodec/qsvenc_hevc.c
> > +++ b/libavcodec/qsvenc_hevc.c
> > @@ -262,6 +262,8 @@ static const AVCodecDefault qsv_enc_defaults[] = {
> >  // same as the x264 default
> >  { "g", "248"   },
> >  { "bf","8" },
> > +{ "qmin",  "-1"},
> > +{ "qmax",  "-1"},
> >  { "trellis",   "-1"},
> >  { "flags", "+cgop" },
> >  #if FF_API_PRIVATE_OPT
> > --
> > 2.7.4
> 
> LGTM, will apply
A kind ping.

- Linjie
___
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] lavfi/vf_vpp_qsv: fix the infinite loop while framerate lower than input

2020-06-29 Thread Fu, Linjie
> From: Zhong Li 
> Sent: Sunday, April 19, 2020 23:00
> To: Fu, Linjie 
> Cc: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] lavfi/vf_vpp_qsv: fix the infinite loop
> while framerate lower than input
> 
> Fu, Linjie  于2020年2月29日周六 下午5:35写道:
> >
> > > -Original Message-
> > > From: Zhong Li 
> > > Sent: Saturday, February 29, 2020 13:14
> > > To: FFmpeg development discussions and patches  > > de...@ffmpeg.org>
> > > Cc: Fu, Linjie 
> > > Subject: Re: [FFmpeg-devel] [PATCH] lavfi/vf_vpp_qsv: fix the infinite
> loop
> > > while framerate lower than input
> > >
> > > Linjie Fu  于2020年2月28日周五 下午11:34写
> 道:
> > > >
> > > > There are frame droppings in frc while converting into a lower
> framerate,
> > > > and MSDK returns ERROR_MORE_DATA which should be ignored.
> > >
> > > Should be fixed in MSDK instead of working around in FFmpeg?
> >
> > MSDK made decision regarding frame rate conversion. If it's the framerate
> down case,
> > FRC would skip frame without producing an output [1], and request a new
> input frame.
> 
> I can't see the benefit to use MSDK framerate conversion function. Is
> it a good idea to drop it and use ffmpeg native fps filter instead?

Reconsidering this, leaving the filter buggy doesn't seem to be comfortable to 
me,
hence IMHO it'll be better to have this bug fixed.

Ping for this, thx.

- Linjie

___
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] libavformat/dashenc.c:kill latency when ldash on

2020-06-29 Thread Siyuan Huang

Soory for wrong commit messge 

Update to no file mode modify at version2

From efd83d91a9bd9a485bcda6799f5f681c203a7449 Mon Sep 17 00:00:00 2001
From: Siyuan Huang 
Date: Tue, 30 Jun 2020 13:44:01 +0800
Subject: [PATCH] libavformat/dashenc.c:kill latency when ldash on v2

disable write tmp file to let it using chunk downloading at last segment

Signed-off-by: Siyuan Huang 
---
 libavformat/dashenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index dc3306a56a..ef6e3d29c6 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -2232,6 +2232,8 @@ static int dash_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 AVDictionary *opts = NULL;
 const char *proto = avio_find_protocol_name(s->url);
 int use_rename = proto && !strcmp(proto, "file");
+if (c->ldash)
+use_rename = 0;
 if (os->segment_type == SEGMENT_TYPE_MP4)
 write_styp(os->ctx->pb);
 os->filename[0] = os->full_path[0] = os->temp_path[0] = '\0';
-- 
2.17.1

-Original Message-
From: Siyuan Huang  
Sent: 2020年6月30日 13:37
To: 'FFmpeg development discussions and patches' 
Subject: RE: [FFmpeg-devel] [PATCH] libavformat/dashenc.c:kill latency when 
ldash on

Update with no file mode changes :
  
From 6d08df73f9cb8cc8d8dfa3b974232f0c0a2b11f8 Mon Sep 17 00:00:00 2001
From: Siyuan Huang 
Date: Tue, 30 Jun 2020 13:34:47 +0800
Subject: [PATCH] libavformat/dashenc.c:support mpd update period

according iso 23009-1 , in live cases , mpd refresh period should be changeable

Signed-off-by: Siyuan Huang 
---
 libavformat/dashenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 
dc3306a56a..ef6e3d29c6 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -2232,6 +2232,8 @@ static int dash_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 AVDictionary *opts = NULL;
 const char *proto = avio_find_protocol_name(s->url);
 int use_rename = proto && !strcmp(proto, "file");
+if (c->ldash)
+use_rename = 0;
 if (os->segment_type == SEGMENT_TYPE_MP4)
 write_styp(os->ctx->pb);
 os->filename[0] = os->full_path[0] = os->temp_path[0] = '\0';
--
2.17.1  
  
-Original Message-
From: ffmpeg-devel  On Behalf Of 
myp...@gmail.com
Sent: 2020年6月30日 11:53
To: FFmpeg development discussions and patches 
Subject: Re: [FFmpeg-devel] [PATCH] libavformat/dashenc.c:kill latency when 
ldash on

On Tue, Jun 30, 2020 at 11:12 AM Siyuan Huang  wrote:
>
> From: Siyuan Huang 
>
>
>
> disable write tmp file to let it using chunk downloading at last 
> segment
>
>
>
> Signed-off-by: Siyuan Huang 
>
> ---
>
> libavformat/dashenc.c | 2 ++
>
> 1 file changed, 2 insertions(+)
>
> mode change 100644 => 100755 libavformat/dashenc.c
>
>
>
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
>
> old mode 100644
>
> new mode 100755
>
This patch change the file mode

> index 62193058d7..66a8a62294
>
> --- a/libavformat/dashenc.c
>
> +++ b/libavformat/dashenc.c
>
> @@ -2229,6 +2229,8 @@ static int dash_write_packet(AVFormatContext *s, 
> AVPacket *pkt)
>
>  AVDictionary *opts = NULL;
>
> const char *proto = avio_find_protocol_name(s->url);
>
>  int use_rename = proto && !strcmp(proto, "file");
>
> +if (c->ldash)
>
> +use_rename = 0;
>
>  if (os->segment_type == SEGMENT_TYPE_MP4)
>
>  write_styp(os->ctx->pb);
>
>  os->filename[0] = os->full_path[0] = os->temp_path[0] = '\0';
>
> --
>
> 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".


0001-libavformat-dashenc.c-kill-latency-when-ldash-on-v2.patch
Description: Binary data
___
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] libavformat/dashenc.c:support mpd update period

2020-06-29 Thread Siyuan Huang
Update with no file mode changes :

 

From 818095d4f0aa50dfee3cb0622146a2180801c5fe Mon Sep 17 00:00:00 2001

From: Siyuan Huang 

Date: Tue, 30 Jun 2020 13:41:46 +0800

Subject: [PATCH] libavformat/dashenc.c:support mpd update period v3

 

according iso 23009-1 , in live cases , mpd refresh

period should be changeable

 

Signed-off-by: Siyuan Huang 

---

doc/muxers.texi   | 4 

libavformat/dashenc.c | 4 

2 files changed, 8 insertions(+)

 

diff --git a/doc/muxers.texi b/doc/muxers.texi

index b1389a3227..86976f4f61 100644

--- a/doc/muxers.texi

+++ b/doc/muxers.texi

@@ -366,6 +366,10 @@ adjusting playback latency and buffer occupancy during
normal playback by client

Set the maximum playback rate indicated as appropriate for the purposes of
automatically

adjusting playback latency and buffer occupancy during normal playback by
clients.

+@item update_period @var{update_period}

+ Set the mpd update period ,for dynamic content.

+ The unit is second.

+

@end table

 @anchor{framecrc}

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

index 62193058d7..dc3306a56a 100644

--- a/libavformat/dashenc.c

+++ b/libavformat/dashenc.c

@@ -198,6 +198,7 @@ typedef struct DASHContext {

 int target_latency_refid;

 AVRational min_playback_rate;

 AVRational max_playback_rate;

+int64_t update_period;

} DASHContext;

 static struct codec_string {

@@ -1184,6 +1185,8 @@ static int write_manifest(AVFormatContext *s, int
final)

 char now_str[100];

 if (c->use_template && !c->use_timeline)

 update_period = 500;

+if (c->update_period)

+update_period = c->update_period;

 avio_printf(out, "\tminimumUpdatePeriod=\"PT%"PRId64"S\"\n",
update_period);

 if (!c->ldash)

 avio_printf(out,
"\tsuggestedPresentationDelay=\"PT%"PRId64"S\"\n", c->last_duration /
AV_TIME_BASE);

@@ -2380,6 +2383,7 @@ static const AVOption options[] = {

 { "target_latency", "Set desired target latency for Low-latency dash",
OFFSET(target_latency), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, E },

 { "min_playback_rate", "Set desired minimum playback rate",
OFFSET(min_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E
},

 { "max_playback_rate", "Set desired maximum playback rate",
OFFSET(max_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E
},

+{ "update_period", "Set the mpd update interval",
OFFSET(update_period), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E},

 { NULL },

};

-- 

2.17.1

 

From: Siyuan Huang  
Sent: 2020年6月30日 11:59
To: 'ffmpeg-devel@ffmpeg.org' 
Subject: RE: [PATCH] libavformat/dashenc.c:support mpd update period

 

Add patch file 

 

From: Siyuan Huang < 
saber.hu...@samsung.com> 
Sent: 2020年6月30日 11:34
To: 'ffmpeg-devel@ffmpeg.org' < 
ffmpeg-devel@ffmpeg.org>
Subject: [PATCH] libavformat/dashenc.c:support mpd update period

 

From: Siyuan Huang < 
saber.hu...@samsung.com>

 

according iso 23009-1 , in live cases , mpd refresh

period should be changeable

 

Signed-off-by: Siyuan Huang < 
saber.hu...@samsung.com>

---

doc/muxers.texi   | 4 

libavformat/dashenc.c | 4 

2 files changed, 8 insertions(+)

mode change 100644 => 100755 doc/muxers.texi

 

diff --git a/doc/muxers.texi b/doc/muxers.texi

old mode 100644

new mode 100755

index b1389a3227..babbcb16af

--- a/doc/muxers.texi

+++ b/doc/muxers.texi

@@ -366,6 +366,10 @@ adjusting playback latency and buffer occupancy during
normal playback by client

Set the maximum playback rate indicated as appropriate for the purposes of
automatically

adjusting playback latency and buffer occupancy during normal playback by
clients.

 

+@item update_period @var{update_period}

+ Set the mpd update period ,for dynamic content.

+ The unit is second.

+

@end table

 

 @anchor{framecrc}

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

index 66a8a62294..ef6e3d29c6 100755

--- a/libavformat/dashenc.c

+++ b/libavformat/dashenc.c

@@ -198,6 +198,7 @@ typedef struct DASHContext {

 int target_latency_refid;

 AVRational min_playback_rate;

 AVRational max_playback_rate;

+int64_t update_period;

} DASHContext;

 

 static struct codec_string {

@@ -1184,6 +1185,8 @@ static int write_manifest(AVFormatContext *s, int
final)

 char now_str[100];

 if (c->use_template && !c->use_timeline)

 update_period = 500;

+if (c->update_period)

+update_period = c->update_period;

 avio_printf(out, "\tminimumUpdatePeriod=\"PT%"PRId64"S\"\n",
update_period);

 if (!c->ldash)

 avio_printf(out,
"\tsuggestedPresentationDelay=\"PT%"PRId64"S\"\n", c->last_duration /
AV_TIME_BASE);

@@ -2382,6 +2385,7 @@ static const AVOption options[] = {

 { "target_latency", "Set desired 

Re: [FFmpeg-devel] [PATCH] libavformat/dashenc.c:kill latency when ldash on

2020-06-29 Thread Siyuan Huang
Update with no file mode changes :
  
From 6d08df73f9cb8cc8d8dfa3b974232f0c0a2b11f8 Mon Sep 17 00:00:00 2001
From: Siyuan Huang 
Date: Tue, 30 Jun 2020 13:34:47 +0800
Subject: [PATCH] libavformat/dashenc.c:support mpd update period

according iso 23009-1 , in live cases , mpd refresh
period should be changeable

Signed-off-by: Siyuan Huang 
---
 libavformat/dashenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index dc3306a56a..ef6e3d29c6 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -2232,6 +2232,8 @@ static int dash_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 AVDictionary *opts = NULL;
 const char *proto = avio_find_protocol_name(s->url);
 int use_rename = proto && !strcmp(proto, "file");
+if (c->ldash)
+use_rename = 0;
 if (os->segment_type == SEGMENT_TYPE_MP4)
 write_styp(os->ctx->pb);
 os->filename[0] = os->full_path[0] = os->temp_path[0] = '\0';
-- 
2.17.1  
  
-Original Message-
From: ffmpeg-devel  On Behalf Of 
myp...@gmail.com
Sent: 2020年6月30日 11:53
To: FFmpeg development discussions and patches 
Subject: Re: [FFmpeg-devel] [PATCH] libavformat/dashenc.c:kill latency when 
ldash on

On Tue, Jun 30, 2020 at 11:12 AM Siyuan Huang  wrote:
>
> From: Siyuan Huang 
>
>
>
> disable write tmp file to let it using chunk downloading at last 
> segment
>
>
>
> Signed-off-by: Siyuan Huang 
>
> ---
>
> libavformat/dashenc.c | 2 ++
>
> 1 file changed, 2 insertions(+)
>
> mode change 100644 => 100755 libavformat/dashenc.c
>
>
>
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
>
> old mode 100644
>
> new mode 100755
>
This patch change the file mode

> index 62193058d7..66a8a62294
>
> --- a/libavformat/dashenc.c
>
> +++ b/libavformat/dashenc.c
>
> @@ -2229,6 +2229,8 @@ static int dash_write_packet(AVFormatContext *s, 
> AVPacket *pkt)
>
>  AVDictionary *opts = NULL;
>
> const char *proto = avio_find_protocol_name(s->url);
>
>  int use_rename = proto && !strcmp(proto, "file");
>
> +if (c->ldash)
>
> +use_rename = 0;
>
>  if (os->segment_type == SEGMENT_TYPE_MP4)
>
>  write_styp(os->ctx->pb);
>
>  os->filename[0] = os->full_path[0] = os->temp_path[0] = '\0';
>
> --
>
> 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".


0001-libavformat-dashenc.c-kill-latency-when-ldash-on.patch
Description: Binary data
___
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] libavformat/dashenc.c:kill latency when ldash on

2020-06-29 Thread myp...@gmail.com
On Tue, Jun 30, 2020 at 11:12 AM Siyuan Huang  wrote:
>
> From: Siyuan Huang 
>
>
>
> disable write tmp file to let it using chunk downloading at last segment
>
>
>
> Signed-off-by: Siyuan Huang 
>
> ---
>
> libavformat/dashenc.c | 2 ++
>
> 1 file changed, 2 insertions(+)
>
> mode change 100644 => 100755 libavformat/dashenc.c
>
>
>
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
>
> old mode 100644
>
> new mode 100755
>
This patch change the file mode

> index 62193058d7..66a8a62294
>
> --- a/libavformat/dashenc.c
>
> +++ b/libavformat/dashenc.c
>
> @@ -2229,6 +2229,8 @@ static int dash_write_packet(AVFormatContext *s,
> AVPacket *pkt)
>
>  AVDictionary *opts = NULL;
>
> const char *proto = avio_find_protocol_name(s->url);
>
>  int use_rename = proto && !strcmp(proto, "file");
>
> +if (c->ldash)
>
> +use_rename = 0;
>
>  if (os->segment_type == SEGMENT_TYPE_MP4)
>
>  write_styp(os->ctx->pb);
>
>  os->filename[0] = os->full_path[0] = os->temp_path[0] = '\0';
>
> --
>
> 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 v4 1/2] avutil/timecode: add description for SMPTE binary format

2020-06-29 Thread lance . lmwang
From: Limin Wang 

AV_FRAME_DATA_S12M_TIMECODE is public API, so user need to know its format
by the API header instead of reading the code.

Signed-off-by: Limin Wang 
---
 libavutil/frame.h|  4 ++--
 libavutil/timecode.h | 16 +++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/libavutil/frame.h b/libavutil/frame.h
index 3fb8c56..c694b12 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -162,8 +162,8 @@ enum AVFrameSideDataType {
 /**
  * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 
uint32_t
  * where the first uint32_t describes how many (1-3) of the other 
timecodes are used.
- * The timecode format is described in the 
av_timecode_get_smpte_from_framenum()
- * function in libavutil/timecode.c.
+ * The timecode format is described in the comments of 
av_timecode_get_smpte_from_framenum()
+ * function in libavutil/timecode.h.
  */
 AV_FRAME_DATA_S12M_TIMECODE,
 
diff --git a/libavutil/timecode.h b/libavutil/timecode.h
index ab38e66..b1c1887 100644
--- a/libavutil/timecode.h
+++ b/libavutil/timecode.h
@@ -61,7 +61,21 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int fps);
  * @param tc   timecode data correctly initialized
  * @param framenum frame number
  * @return the SMPTE binary representation
- *
+ * the format description as follows, note it's in system byte order:
+ * 31b: color frame flag (0: unsync mode, 1: sync mode)
+ * 30b: drop  frame flag (0: non drop,1: drop)
+ * 28b,29b: tens  of frames
+ * 24-27b:  units of frames
+ * 23b: PC (NTSC) or BGF0 (PAL)
+ * 20b,22b: tens  of seconds
+ * 16-19b:  units of seconds
+ * 15b: BGF0 (NTSC) or BGF2 (PAL)
+ * 12b,13b: tens  of minutes
+ * 8-11b:   units of minutes
+ * 7b:  BGF2 (NTSC) or PC (PAL)
+ * 6b:  BGF1
+ * 4b,5b:   tens  of hours
+ * 0b-3b:   units of hours
  * @note Frame number adjustment is automatically done in case of drop 
timecode,
  *   you do NOT have to call av_timecode_adjust_ntsc_framenum2().
  * @note The frame number is relative to tc->start.
-- 
1.8.3.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 v4 2/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 doc/APIchanges|  3 +++
 libavcodec/avpacket.c |  1 +
 libavcodec/decode.c   |  1 +
 libavcodec/packet.h   |  8 
 libavcodec/version.h  |  2 +-
 libavformat/dump.c| 21 +
 6 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 1d6cc36..7cad7fa 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+2020-06-xx - xx - lavc 58.94.100 - packet.h
+  Add AV_PKT_DATA_S12M_TIMECODE.
+
 2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
   Add AV_PIX_FMT_X2RGB10.
 
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index dce26cb..4801163 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
AVPacketSideDataType type)
 case AV_PKT_DATA_PRFT:   return "Producer Reference 
Time";
 case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
 case AV_PKT_DATA_DOVI_CONF:  return "DOVI configuration 
record";
+case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 12-1:2014 
timecode";
 }
 return NULL;
 }
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index de9c079..f2244fc 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame 
*frame)
 { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
 { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
 { AV_PKT_DATA_ICC_PROFILE,AV_FRAME_DATA_ICC_PROFILE },
+{ AV_PKT_DATA_S12M_TIMECODE,  AV_FRAME_DATA_S12M_TIMECODE 
},
 };
 
 if (pkt) {
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 96f237f..232af69 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -283,6 +283,14 @@ enum AVPacketSideDataType {
 AV_PKT_DATA_DOVI_CONF,
 
 /**
+ * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array of 
4 uint32_t
+ * where the first uint32_t describes how many (1-3) of the other 
timecodes are used.
+ * The timecode format is described in the commenets of 
av_timecode_get_smpte_from_framenum()
+ * function in libavutil/timecode.h.
+ */
+AV_PKT_DATA_S12M_TIMECODE,
+
+/**
  * The number of side data types.
  * This is not part of the public API/ABI in the sense that it may
  * change when new side data types are added.
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 0359302..482cc6d 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  58
-#define LIBAVCODEC_VERSION_MINOR  93
+#define LIBAVCODEC_VERSION_MINOR  94
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 117c681..55ac129 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -34,6 +34,7 @@
 #include "libavutil/replaygain.h"
 #include "libavutil/spherical.h"
 #include "libavutil/stereo3d.h"
+#include "libavutil/timecode.h"
 
 #include "avformat.h"
 
@@ -402,6 +403,22 @@ static void dump_dovi_conf(void *ctx, AVPacketSideData* sd)
dovi->dv_bl_signal_compatibility_id);
 }
 
+static void dump_s12m_timecode(void *ctx, AVPacketSideData *sd)
+{
+uint32_t *tc = (uint32_t *)sd->data;
+
+if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
+av_log(ctx, AV_LOG_ERROR, "invalid data\n");
+return;
+}
+
+for (int j = 1; j <= tc[0]; j++) {
+char tcbuf[AV_TIMECODE_STR_SIZE];
+av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
+av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", " : 
"");
+}
+}
+
 static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
 {
 int i;
@@ -468,6 +485,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const 
char *indent)
 av_log(ctx, AV_LOG_INFO, "DOVI configuration record: ");
 dump_dovi_conf(ctx, &sd);
 break;
+case AV_PKT_DATA_S12M_TIMECODE:
+av_log(ctx, AV_LOG_INFO, "SMPTE ST 12-1:2014: ");
+dump_s12m_timecode(ctx, &sd);
+break;
 default:
 av_log(ctx, AV_LOG_INFO,
"unknown side data type %d (%d bytes)", sd.type, sd.size);
-- 
1.8.3.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] libavformat/dashenc.c:support mpd update period

2020-06-29 Thread Siyuan Huang
Add patch file 

 

From: Siyuan Huang  
Sent: 2020年6月30日 11:34
To: 'ffmpeg-devel@ffmpeg.org' 
Subject: [PATCH] libavformat/dashenc.c:support mpd update period

 

From: Siyuan Huang mailto:saber.hu...@samsung.com>
>

 

according iso 23009-1 , in live cases , mpd refresh

period should be changeable

 

Signed-off-by: Siyuan Huang mailto:saber.hu...@samsung.com> >

---

doc/muxers.texi   | 4 

libavformat/dashenc.c | 4 

2 files changed, 8 insertions(+)

mode change 100644 => 100755 doc/muxers.texi

 

diff --git a/doc/muxers.texi b/doc/muxers.texi

old mode 100644

new mode 100755

index b1389a3227..babbcb16af

--- a/doc/muxers.texi

+++ b/doc/muxers.texi

@@ -366,6 +366,10 @@ adjusting playback latency and buffer occupancy during
normal playback by client

Set the maximum playback rate indicated as appropriate for the purposes of
automatically

adjusting playback latency and buffer occupancy during normal playback by
clients.

 

+@item update_period @var{update_period}

+ Set the mpd update period ,for dynamic content.

+ The unit is second.

+

@end table

 

 @anchor{framecrc}

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

index 66a8a62294..ef6e3d29c6 100755

--- a/libavformat/dashenc.c

+++ b/libavformat/dashenc.c

@@ -198,6 +198,7 @@ typedef struct DASHContext {

 int target_latency_refid;

 AVRational min_playback_rate;

 AVRational max_playback_rate;

+int64_t update_period;

} DASHContext;

 

 static struct codec_string {

@@ -1184,6 +1185,8 @@ static int write_manifest(AVFormatContext *s, int
final)

 char now_str[100];

 if (c->use_template && !c->use_timeline)

 update_period = 500;

+if (c->update_period)

+update_period = c->update_period;

 avio_printf(out, "\tminimumUpdatePeriod=\"PT%"PRId64"S\"\n",
update_period);

 if (!c->ldash)

 avio_printf(out,
"\tsuggestedPresentationDelay=\"PT%"PRId64"S\"\n", c->last_duration /
AV_TIME_BASE);

@@ -2382,6 +2385,7 @@ static const AVOption options[] = {

 { "target_latency", "Set desired target latency for Low-latency dash",
OFFSET(target_latency), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, E },

 { "min_playback_rate", "Set desired minimum playback rate",
OFFSET(min_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E
},

 { "max_playback_rate", "Set desired maximum playback rate",
OFFSET(max_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E
},

+{ "update_period", "Set the mpd update interval",
OFFSET(update_period), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E},

 { NULL },

};

 

-- 

2.17.1

 



0001-libavformat-dashenc.c-support-mpd-update-period.patch
Description: Binary data
___
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] libavformat/dashenc.c:kill latency when ldash on

2020-06-29 Thread Siyuan Huang
Add patch file,

 

From: Siyuan Huang  
Sent: 2020年6月30日 11:12
To: 'ffmpeg-devel@ffmpeg.org' 
Subject: [PATCH] libavformat/dashenc.c:kill latency when ldash on

 

From: Siyuan Huang mailto:saber.hu...@samsung.com>
>

 

disable write tmp file to let it using chunk downloading at last segment

 

Signed-off-by: Siyuan Huang mailto:saber.hu...@samsung.com> >

---

libavformat/dashenc.c | 2 ++

1 file changed, 2 insertions(+)

mode change 100644 => 100755 libavformat/dashenc.c

 

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

old mode 100644

new mode 100755

index 62193058d7..66a8a62294

--- a/libavformat/dashenc.c

+++ b/libavformat/dashenc.c

@@ -2229,6 +2229,8 @@ static int dash_write_packet(AVFormatContext *s,
AVPacket *pkt)

 AVDictionary *opts = NULL;

const char *proto = avio_find_protocol_name(s->url);

 int use_rename = proto && !strcmp(proto, "file");

+if (c->ldash)

+use_rename = 0;

 if (os->segment_type == SEGMENT_TYPE_MP4)

 write_styp(os->ctx->pb);

 os->filename[0] = os->full_path[0] = os->temp_path[0] = '\0';

-- 

2.17.1

 



0001-libavformat-dashenc.c-kill-latency-when-ldash-on.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH v1] avfilter: add overlay vaapi filter

2020-06-29 Thread Fei Wang
From: Xinpeng Sun 

Overlay one video on the top of another.

It takes two inputs and has one output. The first input is the "main" video on
which the second input is overlaid. This filter requires same memory layout for
all the inputs.

An example command to use this filter to overlay an image LOGO at the top-left
corner of the INPUT video and both inputs are h264 file:

ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 \
-hwaccel_output_format vaapi -i INPUT.h264 -hwaccel vaapi \
-vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i \
LOGO.h264 -filter_complex "[0:v][1:v]overlay_vaapi=w=50:h=50:alpha=0.5" \
-c:v h264_vaapi -y OUTPUT.h264

Signed-off-by: Xinpeng Sun 
Signed-off-by: Zachary Zhou 
Signed-off-by: Fei Wang 
---
 Changelog  |   1 +
 configure  |   3 +
 doc/filters.texi   |  51 
 libavfilter/Makefile   |   1 +
 libavfilter/allfilters.c   |   1 +
 libavfilter/version.h  |   2 +-
 libavfilter/vf_overlay_vaapi.c | 426 +
 7 files changed, 484 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/vf_overlay_vaapi.c

diff --git a/Changelog b/Changelog
index a60e7d2eb8..f745f6f52a 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version :
 - AudioToolbox output device
 - MacCaption demuxer
+- overlay_vaapi filter
 
 
 version 4.3:
diff --git a/configure b/configure
index 7495f35faa..c930b261a2 100755
--- a/configure
+++ b/configure
@@ -3560,6 +3560,7 @@ openclsrc_filter_deps="opencl"
 overlay_opencl_filter_deps="opencl"
 overlay_qsv_filter_deps="libmfx"
 overlay_qsv_filter_select="qsvvpp"
+overlay_vaapi_filter_deps="vaapi"
 overlay_vulkan_filter_deps="vulkan libglslang"
 owdenoise_filter_deps="gpl"
 pad_opencl_filter_deps="opencl"
@@ -3620,6 +3621,7 @@ tonemap_vaapi_filter_deps="vaapi 
VAProcFilterParameterBufferHDRToneMapping"
 tonemap_opencl_filter_deps="opencl const_nan"
 transpose_opencl_filter_deps="opencl"
 transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
+overlay_vaapi_filter_deps="vaapi VAProcPipelineCaps_blend_flags"
 unsharp_opencl_filter_deps="opencl"
 uspp_filter_deps="gpl avcodec"
 vaguedenoiser_filter_deps="gpl"
@@ -6643,6 +6645,7 @@ if enabled vaapi; then
 check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
 check_type   "va/va.h va/va_vpp.h" 
"VAProcFilterParameterBufferHDRToneMapping"
 check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
+check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" blend_flags
 check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
 check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
 check_type "va/va.h va/va_enc_vp8.h"  "VAEncPictureParameterBufferVP8"
diff --git a/doc/filters.texi b/doc/filters.texi
index 67892e0afb..c53fe37bae 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -22128,6 +22128,57 @@ To enable compilation of these filters you need to 
configure FFmpeg with
 
 To use vaapi filters, you need to setup the vaapi device correctly. For more 
information, please read @url{https://trac.ffmpeg.org/wiki/Hardware/VAAPI}
 
+@section overlay_vaapi
+
+Overlay one video on the top of another.
+
+It takes two inputs and has one output. The first input is the "main" video on 
which the second input is overlaid.
+This filter requires same memory layout for all the inputs. So, format 
conversion may be needed.
+
+The filter accepts the following options:
+
+@table @option
+
+@item x
+Set the x coordinate of the overlaid video on the main video.
+Default value is @code{0}.
+
+@item y
+Set the y coordinate of the overlaid video on the main video.
+Default value is @code{0}.
+
+@item w
+Set the width of the overlaid video on the main video.
+Default value is the width of input overlay video.
+
+@item h
+Set the height of the overlaid video on the main video.
+Default value is the height of input overlay video.
+
+@item alpha
+Set blocking detection thresholds. Allowed range is 0.0 to 1.0, it
+requires an input video with alpha channel.
+Default value is @code{0.0}.
+
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs 
for this filter are yuv420p format.
+@example
+-i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, 
hwupload[b], [a][b]overlay_vaapi" OUTPUT
+@end example
+@item
+Overlay an image LOGO at the offset (200, 100) from the top-left corner of the 
INPUT video.
+The inputs have same memory layout for color channels, the overlay has 
additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
+@example
+-i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, 
hwupload[b], [a][b]overlay_vaapi=x=200:y=100:w=400:h=300:alpha=1.0, hwdownload, 
format=nv12" OUTPUT
+@end example
+
+@end itemize
+
 @section tonemap_vaapi
 
 Pe

[FFmpeg-devel] [PATCH] libavformat/dashenc.c:support mpd update period

2020-06-29 Thread Siyuan Huang
From: Siyuan Huang 

 

according iso 23009-1 , in live cases , mpd refresh

period should be changeable

 

Signed-off-by: Siyuan Huang 

---

doc/muxers.texi   | 4 

libavformat/dashenc.c | 4 

2 files changed, 8 insertions(+)

mode change 100644 => 100755 doc/muxers.texi

 

diff --git a/doc/muxers.texi b/doc/muxers.texi

old mode 100644

new mode 100755

index b1389a3227..babbcb16af

--- a/doc/muxers.texi

+++ b/doc/muxers.texi

@@ -366,6 +366,10 @@ adjusting playback latency and buffer occupancy during
normal playback by client

Set the maximum playback rate indicated as appropriate for the purposes of
automatically

adjusting playback latency and buffer occupancy during normal playback by
clients.

+@item update_period @var{update_period}

+ Set the mpd update period ,for dynamic content.

+ The unit is second.

+

@end table

 @anchor{framecrc}

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

index 66a8a62294..ef6e3d29c6 100755

--- a/libavformat/dashenc.c

+++ b/libavformat/dashenc.c

@@ -198,6 +198,7 @@ typedef struct DASHContext {

 int target_latency_refid;

 AVRational min_playback_rate;

 AVRational max_playback_rate;

+int64_t update_period;

} DASHContext;

 static struct codec_string {

@@ -1184,6 +1185,8 @@ static int write_manifest(AVFormatContext *s, int
final)

 char now_str[100];

 if (c->use_template && !c->use_timeline)

 update_period = 500;

+if (c->update_period)

+update_period = c->update_period;

 avio_printf(out, "\tminimumUpdatePeriod=\"PT%"PRId64"S\"\n",
update_period);

 if (!c->ldash)

 avio_printf(out,
"\tsuggestedPresentationDelay=\"PT%"PRId64"S\"\n", c->last_duration /
AV_TIME_BASE);

@@ -2382,6 +2385,7 @@ static const AVOption options[] = {

 { "target_latency", "Set desired target latency for Low-latency dash",
OFFSET(target_latency), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, E },

 { "min_playback_rate", "Set desired minimum playback rate",
OFFSET(min_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E
},

 { "max_playback_rate", "Set desired maximum playback rate",
OFFSET(max_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E
},

+{ "update_period", "Set the mpd update interval",
OFFSET(update_period), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E},

 { NULL },

};

-- 

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] libavformat/dashenc.c:kill latency when ldash on

2020-06-29 Thread Siyuan Huang
From: Siyuan Huang 

 

disable write tmp file to let it using chunk downloading at last segment

 

Signed-off-by: Siyuan Huang 

---

libavformat/dashenc.c | 2 ++

1 file changed, 2 insertions(+)

mode change 100644 => 100755 libavformat/dashenc.c

 

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

old mode 100644

new mode 100755

index 62193058d7..66a8a62294

--- a/libavformat/dashenc.c

+++ b/libavformat/dashenc.c

@@ -2229,6 +2229,8 @@ static int dash_write_packet(AVFormatContext *s,
AVPacket *pkt)

 AVDictionary *opts = NULL;

const char *proto = avio_find_protocol_name(s->url);

 int use_rename = proto && !strcmp(proto, "file");

+if (c->ldash)

+use_rename = 0;

 if (os->segment_type == SEGMENT_TYPE_MP4)

 write_styp(os->ctx->pb);

 os->filename[0] = os->full_path[0] = os->temp_path[0] = '\0';

-- 

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 v4 1/2] libavcodec/pgxdec: Add PGX decoder

2020-06-29 Thread Gautam Ramakrishnan
On Tue, Jun 30, 2020 at 5:49 AM Michael Niedermayer
 wrote:
>
> On Tue, Jun 30, 2020 at 12:26:17AM +0530, gautamr...@gmail.com wrote:
> > From: Gautam Ramakrishnan 
> >
> > This patch adds a pgx decoder.
> > ---
> >  Changelog   |   1 +
> >  doc/general.texi|   2 +
> >  libavcodec/Makefile |   1 +
> >  libavcodec/allcodecs.c  |   1 +
> >  libavcodec/codec_desc.c |   7 ++
> >  libavcodec/codec_id.h   |   1 +
> >  libavcodec/pgxdec.c | 199 
> >  libavcodec/version.h|   2 +-
> >  8 files changed, 213 insertions(+), 1 deletion(-)
> >  create mode 100644 libavcodec/pgxdec.c
> >
> > diff --git a/Changelog b/Changelog
> > index a60e7d2eb8..1bb9931c0d 100644
> > --- a/Changelog
> > +++ b/Changelog
> > @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
> >  version :
> >  - AudioToolbox output device
> >  - MacCaption demuxer
> > +- PGX decoder
> >
> >
> >  version 4.3:
> > diff --git a/doc/general.texi b/doc/general.texi
> > index ea34b963b5..53d556c56c 100644
> > --- a/doc/general.texi
> > +++ b/doc/general.texi
> > @@ -751,6 +751,8 @@ following image formats are supported:
> >  @tab Portable GrayMap image
> >  @item PGMYUV   @tab X @tab X
> >  @tab PGM with U and V components in YUV 4:2:0
> > +@item PGX  @tab   @tab X
> > +@tab PGX file decoder
> >  @item PIC  @tab @tab X
> >  @tab Pictor/PC Paint
> >  @item PNG  @tab X @tab X
> > diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> > index 5a6ea59715..12aa43fe51 100644
> > --- a/libavcodec/Makefile
> > +++ b/libavcodec/Makefile
> > @@ -536,6 +536,7 @@ OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o
> >  OBJS-$(CONFIG_PGMYUV_DECODER)  += pnmdec.o pnm.o
> >  OBJS-$(CONFIG_PGMYUV_ENCODER)  += pnmenc.o
> >  OBJS-$(CONFIG_PGSSUB_DECODER)  += pgssubdec.o
> > +OBJS-$(CONFIG_PGX_DECODER) += pgxdec.o
> >  OBJS-$(CONFIG_PICTOR_DECODER)  += pictordec.o cga_data.o
> >  OBJS-$(CONFIG_PIXLET_DECODER)  += pixlet.o
> >  OBJS-$(CONFIG_PJS_DECODER) += textdec.o ass.o
> > diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> > index fa0c08d42e..a5048290f7 100644
> > --- a/libavcodec/allcodecs.c
> > +++ b/libavcodec/allcodecs.c
> > @@ -238,6 +238,7 @@ extern AVCodec ff_pgm_encoder;
> >  extern AVCodec ff_pgm_decoder;
> >  extern AVCodec ff_pgmyuv_encoder;
> >  extern AVCodec ff_pgmyuv_decoder;
> > +extern AVCodec ff_pgx_decoder;
> >  extern AVCodec ff_pictor_decoder;
> >  extern AVCodec ff_pixlet_decoder;
> >  extern AVCodec ff_png_encoder;
> > diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> > index 9f8847544f..67e0a3055c 100644
> > --- a/libavcodec/codec_desc.c
> > +++ b/libavcodec/codec_desc.c
> > @@ -1405,6 +1405,13 @@ static const AVCodecDescriptor codec_descriptors[] = 
> > {
> >  .long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
> >  .props = AV_CODEC_PROP_LOSSY,
> >  },
> > +{
> > +.id= AV_CODEC_ID_PGX,
> > +.type  = AVMEDIA_TYPE_VIDEO,
> > +.name  = "pgx",
> > +.long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"),
> > +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
> > +},
> >  {
> >  .id= AV_CODEC_ID_Y41P,
> >  .type  = AVMEDIA_TYPE_VIDEO,
> > diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
> > index d885962c9c..896ecb0ce0 100644
> > --- a/libavcodec/codec_id.h
> > +++ b/libavcodec/codec_id.h
> > @@ -241,6 +241,7 @@ enum AVCodecID {
> >  AV_CODEC_ID_SCREENPRESSO,
> >  AV_CODEC_ID_RSCC,
> >  AV_CODEC_ID_AVS2,
> > +AV_CODEC_ID_PGX,
> >
> >  AV_CODEC_ID_Y41P = 0x8000,
> >  AV_CODEC_ID_AVRP,
> > diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c
> > new file mode 100644
> > index 00..9c3b18f87d
> > --- /dev/null
> > +++ b/libavcodec/pgxdec.c
> > @@ -0,0 +1,199 @@
> > +/*
> > + * PGX image format
> > + * Copyright (c) 2020 Gautam Ramakrishnan
> > + *
> > + * This file is part of FFmpeg.
> > + *
> > + * FFmpeg is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Lesser General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2.1 of the License, or (at your option) any later version.
> > + *
> > + * FFmpeg is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > + * Lesser General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU Lesser General Public
> > + * License along with FFmpeg; if not, write to the Free Software
> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
> > 02110-1301 USA
> > + */
> > +
> > +#include "avcodec.h"
> > +#include "internal.h"
> > +#include "bytestre

[FFmpeg-devel] [PATCH v3] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-06-29 Thread Wang Cao
From: Wang Cao 

Signed-off-by: Wang Cao 
---
Check libaom ABI version to use SUPERRES enum in aom_encoder.h
 doc/encoders.texi  | 36 +
 libavcodec/libaomenc.c | 46 ++
 libavcodec/version.h   |  2 +-
 3 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 17a0f4c821..80052763db 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1599,6 +1599,42 @@ Enable the use of global motion for block prediction. 
Default is true.
 Enable block copy mode for intra block prediction. This mode is
 useful for screen content. Default is true.
 
+@item superres-mode (@emph{mode})
+Select super-resolution mode.
+
+@table @option
+@item none (@emph{0})
+No frame superres allowed.
+
+@item fixed (@emph{1})
+All frames are coded at the specified scale and super-resolved.
+
+@item random (@emph{2})
+All frames are coded at a random scale and super-resolved.
+
+@item qthresh (@emph{3})
+Superres scale for a frame is determined based on q_index.
+
+@item auto (@emph{4})
+Automatically select superres for appropriate frames.
+@end table
+
+@item superres_denominator
+The denominator for superres to use when @option{superres-mode} is 
@option{fixed}.
+Valid value ranges from 8 to 16.
+
+@item superres_kf_denominator
+The denominator for superres to use on key frames when
+@option{superres-mode} is @option{fixed}. Valid value ranges from 8 to 16.
+
+@item superres_qthresh
+The q level threshold after which superres is used when @option{superres-mode}
+is @option{qthresh}. Valid value ranges from 1 to 63.
+
+@item superres_kf_qthresh
+The q level threshold after which superres is used for key frames when
+@option{superres-mode} is @option{qthresh}. Valid value ranges from 1 to 63.
+
 @end table
 
 @section libkvazaar
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index fe98449fa1..4959f84c2c 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -23,6 +23,7 @@
  * AV1 encoder support via libaom
  */
 
+#include 
 #define AOM_DISABLE_CTRL_TYPECHECKS 1
 #include 
 #include 
@@ -96,6 +97,11 @@ typedef struct AOMEncoderContext {
 int enable_restoration;
 int usage;
 int tune;
+int superres_mode;
+int superres_denominator;
+int superres_qthresh;
+int superres_kf_denominator;
+int superres_kf_qthresh;
 } AOMContext;
 
 static const char *const ctlidstr[] = {
@@ -135,6 +141,7 @@ static const char *const ctlidstr[] = {
 #endif
 [AV1E_SET_ENABLE_CDEF]  = "AV1E_SET_ENABLE_CDEF",
 [AOME_SET_TUNING]   = "AOME_SET_TUNING",
+[AV1E_SET_ENABLE_SUPERRES]  = "AV1E_SET_ENABLE_SUPERRES",
 };
 
 static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc)
@@ -204,6 +211,13 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx,
width, "tile_width_count:",  cfg->tile_width_count,
width, "tile_height_count:", cfg->tile_height_count);
 av_log(avctx, level, "\n");
+av_log(avctx, level, "super resolution settings\n"
+ "  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n  ",
+   width, "rc_superres_mode:",   cfg->rc_superres_mode,
+   width, "rc_superres_denominator:",cfg->rc_superres_denominator,
+   width, "rc_superres_qthresh:",cfg->rc_superres_qthresh,
+   width, "rc_superres_kf_denominator:", 
cfg->rc_superres_kf_denominator,
+   width, "rc_superres_kf_qthresh:", cfg->rc_superres_kf_qthresh);
 }
 
 static void coded_frame_add(void *list, struct FrameListData *cx_frame)
@@ -546,6 +560,17 @@ static av_cold int aom_init(AVCodecContext *avctx,
 return AVERROR(EINVAL);
 }
 
+if (ctx->superres_mode >= 0)
+enccfg.rc_superres_mode = ctx->superres_mode;
+if (ctx->superres_qthresh > 0)
+enccfg.rc_superres_qthresh = ctx->superres_qthresh;
+if (ctx->superres_kf_qthresh > 0)
+enccfg.rc_superres_kf_qthresh = ctx->superres_kf_qthresh;
+if (ctx->superres_denominator >= 8)
+enccfg.rc_superres_denominator = ctx->superres_denominator;
+if (ctx->superres_kf_denominator >= 8)
+enccfg.rc_superres_kf_denominator = ctx->superres_kf_denominator;
+
 dump_enc_cfg(avctx, &enccfg);
 
 enccfg.g_w= avctx->width;
@@ -688,6 +713,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
 // codec control failures are currently treated only as warnings
 av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n");
 codecctl_int(avctx, AOME_SET_CPUUSED, ctx->cpu_used);
+if (ctx->superres_mode > 0)
+codecctl_int(avctx, AV1E_SET_ENABLE_SUPERRES, 1);
 if (ctx->auto_alt_ref >= 0)
 codecctl_int(avctx, AOME_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref);
 if (ctx->arnr_max_frames >= 0)
@@ -1107,6 +1134,25 @@ static const AVOption options[] = {
 { "tune","The metric that the encoder tunes for. Automatically 
chosen b

Re: [FFmpeg-devel] [PATCH v3 1/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread lance . lmwang
On Tue, Jun 30, 2020 at 01:54:06AM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > On Mon, Jun 29, 2020 at 06:18:23PM +0200, Andreas Rheinhardt wrote:
> >> lance.lmw...@gmail.com:
> >>> On Mon, Jun 29, 2020 at 05:35:58PM +0200, Andreas Rheinhardt wrote:
>  lance.lmw...@gmail.com:
> > From: Limin Wang 
> >
> > Signed-off-by: Limin Wang 
> > ---
> >  doc/APIchanges|  3 +++
> >  libavcodec/avpacket.c |  1 +
> >  libavcodec/decode.c   |  1 +
> >  libavcodec/packet.h   |  6 ++
> >  libavcodec/version.h  |  2 +-
> >  libavformat/dump.c| 21 +
> >  6 files changed, 33 insertions(+), 1 deletion(-)
> >
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index 1d6cc36..7cad7fa 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -15,6 +15,9 @@ libavutil: 2017-10-21
> >  
> >  API changes, most recent first:
> >  
> > +2020-06-xx - xx - lavc 58.94.100 - packet.h
> > +  Add AV_PKT_DATA_S12M_TIMECODE.
> > +
> >  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
> >Add AV_PIX_FMT_X2RGB10.
> >  
> > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> > index dce26cb..24e2a74 100644
> > --- a/libavcodec/avpacket.c
> > +++ b/libavcodec/avpacket.c
> > @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> > AVPacketSideDataType type)
> >  case AV_PKT_DATA_PRFT:   return "Producer 
> > Reference Time";
> >  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
> >  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> > configuration record";
> > +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 
> > 12-1:2014 timecode";
> >  }
> >  return NULL;
> >  }
> > diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> > index de9c079..f2244fc 100644
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> > @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> > AVFrame *frame)
> >  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> > AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
> >  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC 
> > },
> >  { AV_PKT_DATA_ICC_PROFILE,
> > AV_FRAME_DATA_ICC_PROFILE },
> > +{ AV_PKT_DATA_S12M_TIMECODE,  
> > AV_FRAME_DATA_S12M_TIMECODE },
> >  };
> >  
> >  if (pkt) {
> > diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> > index 96f237f..d84 100644
> > --- a/libavcodec/packet.h
> > +++ b/libavcodec/packet.h
> > @@ -283,6 +283,12 @@ enum AVPacketSideDataType {
> >  AV_PKT_DATA_DOVI_CONF,
> >  
> >  /**
> > + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an 
> > array of 4 uint32_t
> > + * where the first uint32_t describes how many (1-3) of the other 
> > timecodes are used.
> > + */
> 
>  You should move the doc to timecode.h first in a separate patch and then
>  reference the documentation here.
> >>>
> >>> I'm not native English, so it's difficult for me to describe the format 
> >>> of timecode in comments clearly.
> >>> As it's defined in SMPTE ST 12-1:2014, so I think it's enough as it says 
> >>> conforms to SMPTE ST 12-1:2014
> >>> at beginning. 
> >>>
> >>
> >> Could you please point me to the part of SMPTE ST 12-1:2014 that
> >> describes the format that we use here? Because AFAIK SMPTE ST 12-1:2014
> >> just defines what fields a SMPTE ST 12-1 message has (and what
> >> semantics), but leaves the rest (the actual framing) to other standards:
> >>
> >> "The actual transport of the codewords for digital systems varies
> >> significantly from the transport methods defined for analog systems, and
> >> is defined in the associated document, SMPTE ST 12-2."
> >>
> >> E.g. RTP uses a different framing (see RFC 5484); obviously every
> >> framing method used for transport must prescribe endianness of not
> >> depend upon endianness; yet our method does. (Isn't this actually a
> >> problem for fate-tests because framecrc calculates checksums for side 
> >> date?)
> > 
> > So the transport format is using SMPTE ST 12-2?  I'm not sure about it. It's
> > better to say which standard are using in comments, it's not private format.
> > Now I'm just using the timecode.[ch], so it's difficult to give comments for
> > its format. For HEVC timecode, it's use little endianness.
> > 
> 
> No, av_timecode_get_smpte seems to use a custom format, not SMPTE ST
> 12-2. That's why it is so important to actually document it.

av_timecode_get_smpte() is coming from h264_slice. In fact, I have plan to 
remove the
duplicate code with av_timecode_get_smpte_from_framenum().
So the real format which is refer by

[FFmpeg-devel] [PATCH v1] avfilter/tonemap_vaapi: set va parameters filters and numbers

2020-06-29 Thread Fei Wang
This can fill VAProcPipelineParameterBuffer correctly and make the
pipeline works.

Signed-off-by: Fei Wang 
---
 libavfilter/vf_tonemap_vaapi.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/vf_tonemap_vaapi.c b/libavfilter/vf_tonemap_vaapi.c
index 2f41b90424..9f52590a49 100644
--- a/libavfilter/vf_tonemap_vaapi.c
+++ b/libavfilter/vf_tonemap_vaapi.c
@@ -296,6 +296,11 @@ static int tonemap_vaapi_filter_frame(AVFilterLink 
*inlink, AVFrame *input_frame
 if (err < 0)
 goto fail;
 
+if (vpp_ctx->nb_filter_buffers) {
+params.filters = &vpp_ctx->filter_buffers[0];
+params.num_filters = vpp_ctx->nb_filter_buffers;
+}
+
 err = ff_vaapi_vpp_render_picture(avctx, ¶ms, output_frame);
 if (err < 0)
 goto fail;
-- 
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 v4 1/2] libavcodec/pgxdec: Add PGX decoder

2020-06-29 Thread Michael Niedermayer
On Tue, Jun 30, 2020 at 12:26:17AM +0530, gautamr...@gmail.com wrote:
> From: Gautam Ramakrishnan 
> 
> This patch adds a pgx decoder.
> ---
>  Changelog   |   1 +
>  doc/general.texi|   2 +
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/codec_desc.c |   7 ++
>  libavcodec/codec_id.h   |   1 +
>  libavcodec/pgxdec.c | 199 
>  libavcodec/version.h|   2 +-
>  8 files changed, 213 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/pgxdec.c
> 
> diff --git a/Changelog b/Changelog
> index a60e7d2eb8..1bb9931c0d 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
>  version :
>  - AudioToolbox output device
>  - MacCaption demuxer
> +- PGX decoder
>  
>  
>  version 4.3:
> diff --git a/doc/general.texi b/doc/general.texi
> index ea34b963b5..53d556c56c 100644
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -751,6 +751,8 @@ following image formats are supported:
>  @tab Portable GrayMap image
>  @item PGMYUV   @tab X @tab X
>  @tab PGM with U and V components in YUV 4:2:0
> +@item PGX  @tab   @tab X
> +@tab PGX file decoder
>  @item PIC  @tab @tab X
>  @tab Pictor/PC Paint
>  @item PNG  @tab X @tab X
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 5a6ea59715..12aa43fe51 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -536,6 +536,7 @@ OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o
>  OBJS-$(CONFIG_PGMYUV_DECODER)  += pnmdec.o pnm.o
>  OBJS-$(CONFIG_PGMYUV_ENCODER)  += pnmenc.o
>  OBJS-$(CONFIG_PGSSUB_DECODER)  += pgssubdec.o
> +OBJS-$(CONFIG_PGX_DECODER) += pgxdec.o
>  OBJS-$(CONFIG_PICTOR_DECODER)  += pictordec.o cga_data.o
>  OBJS-$(CONFIG_PIXLET_DECODER)  += pixlet.o
>  OBJS-$(CONFIG_PJS_DECODER) += textdec.o ass.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index fa0c08d42e..a5048290f7 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -238,6 +238,7 @@ extern AVCodec ff_pgm_encoder;
>  extern AVCodec ff_pgm_decoder;
>  extern AVCodec ff_pgmyuv_encoder;
>  extern AVCodec ff_pgmyuv_decoder;
> +extern AVCodec ff_pgx_decoder;
>  extern AVCodec ff_pictor_decoder;
>  extern AVCodec ff_pixlet_decoder;
>  extern AVCodec ff_png_encoder;
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 9f8847544f..67e0a3055c 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -1405,6 +1405,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
>  .long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
>  .props = AV_CODEC_PROP_LOSSY,
>  },
> +{
> +.id= AV_CODEC_ID_PGX,
> +.type  = AVMEDIA_TYPE_VIDEO,
> +.name  = "pgx",
> +.long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"),
> +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
> +},
>  {
>  .id= AV_CODEC_ID_Y41P,
>  .type  = AVMEDIA_TYPE_VIDEO,
> diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
> index d885962c9c..896ecb0ce0 100644
> --- a/libavcodec/codec_id.h
> +++ b/libavcodec/codec_id.h
> @@ -241,6 +241,7 @@ enum AVCodecID {
>  AV_CODEC_ID_SCREENPRESSO,
>  AV_CODEC_ID_RSCC,
>  AV_CODEC_ID_AVS2,
> +AV_CODEC_ID_PGX,
>  
>  AV_CODEC_ID_Y41P = 0x8000,
>  AV_CODEC_ID_AVRP,
> diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c
> new file mode 100644
> index 00..9c3b18f87d
> --- /dev/null
> +++ b/libavcodec/pgxdec.c
> @@ -0,0 +1,199 @@
> +/*
> + * PGX image format
> + * Copyright (c) 2020 Gautam Ramakrishnan
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +
> +#include "avcodec.h"
> +#include "internal.h"
> +#include "bytestream.h"
> +#include "libavutil/imgutils.h"
> +
> +typedef struct PGXContext {
> +GetByteContext  g;
> +} PGXContext;
> +
> +static int pgx_get_number(AVCodecContext *avctx, PGXContext * const s) {
> +int ret = -1;
> +char digit;
> +
> +while (1) {
> +uint64_t temp;
> +if (!bytestr

Re: [FFmpeg-devel] [PATCH v3 1/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread Andreas Rheinhardt
lance.lmw...@gmail.com:
> On Mon, Jun 29, 2020 at 06:18:23PM +0200, Andreas Rheinhardt wrote:
>> lance.lmw...@gmail.com:
>>> On Mon, Jun 29, 2020 at 05:35:58PM +0200, Andreas Rheinhardt wrote:
 lance.lmw...@gmail.com:
> From: Limin Wang 
>
> Signed-off-by: Limin Wang 
> ---
>  doc/APIchanges|  3 +++
>  libavcodec/avpacket.c |  1 +
>  libavcodec/decode.c   |  1 +
>  libavcodec/packet.h   |  6 ++
>  libavcodec/version.h  |  2 +-
>  libavformat/dump.c| 21 +
>  6 files changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 1d6cc36..7cad7fa 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>  
>  API changes, most recent first:
>  
> +2020-06-xx - xx - lavc 58.94.100 - packet.h
> +  Add AV_PKT_DATA_S12M_TIMECODE.
> +
>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
>Add AV_PIX_FMT_X2RGB10.
>  
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index dce26cb..24e2a74 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> AVPacketSideDataType type)
>  case AV_PKT_DATA_PRFT:   return "Producer 
> Reference Time";
>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> configuration record";
> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 
> 12-1:2014 timecode";
>  }
>  return NULL;
>  }
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index de9c079..f2244fc 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> AVFrame *frame)
>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
>  { AV_PKT_DATA_ICC_PROFILE,
> AV_FRAME_DATA_ICC_PROFILE },
> +{ AV_PKT_DATA_S12M_TIMECODE,  
> AV_FRAME_DATA_S12M_TIMECODE },
>  };
>  
>  if (pkt) {
> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> index 96f237f..d84 100644
> --- a/libavcodec/packet.h
> +++ b/libavcodec/packet.h
> @@ -283,6 +283,12 @@ enum AVPacketSideDataType {
>  AV_PKT_DATA_DOVI_CONF,
>  
>  /**
> + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an 
> array of 4 uint32_t
> + * where the first uint32_t describes how many (1-3) of the other 
> timecodes are used.
> + */

 You should move the doc to timecode.h first in a separate patch and then
 reference the documentation here.
>>>
>>> I'm not native English, so it's difficult for me to describe the format of 
>>> timecode in comments clearly.
>>> As it's defined in SMPTE ST 12-1:2014, so I think it's enough as it says 
>>> conforms to SMPTE ST 12-1:2014
>>> at beginning. 
>>>
>>
>> Could you please point me to the part of SMPTE ST 12-1:2014 that
>> describes the format that we use here? Because AFAIK SMPTE ST 12-1:2014
>> just defines what fields a SMPTE ST 12-1 message has (and what
>> semantics), but leaves the rest (the actual framing) to other standards:
>>
>> "The actual transport of the codewords for digital systems varies
>> significantly from the transport methods defined for analog systems, and
>> is defined in the associated document, SMPTE ST 12-2."
>>
>> E.g. RTP uses a different framing (see RFC 5484); obviously every
>> framing method used for transport must prescribe endianness of not
>> depend upon endianness; yet our method does. (Isn't this actually a
>> problem for fate-tests because framecrc calculates checksums for side date?)
> 
> So the transport format is using SMPTE ST 12-2?  I'm not sure about it. It's
> better to say which standard are using in comments, it's not private format.
> Now I'm just using the timecode.[ch], so it's difficult to give comments for
> its format. For HEVC timecode, it's use little endianness.
> 

No, av_timecode_get_smpte seems to use a custom format, not SMPTE ST
12-2. That's why it is so important to actually document it.

>>

> +AV_PKT_DATA_S12M_TIMECODE,
> +
> +/**
>   * The number of side data types.
>   * This is not part of the public API/ABI in the sense that it may
>   * change when new side data types are added.
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 0359302..482cc6d 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -28,7 +28,7 @@
>  #include "libavutil/version.h"
>  

Re: [FFmpeg-devel] [PATCH v2] avcodec/mpeg12dec: Fix uninitialized data in fate-sub-cc-scte20

2020-06-29 Thread lance . lmwang
On Mon, Jun 29, 2020 at 09:19:56PM +0300, Martin Storsjö wrote:
> On Sun, 28 Jun 2020, lance.lmw...@gmail.com wrote:
> 
> > From: Limin Wang 
> > 
> > The issue is introduced from a705bcd763e344fa, please tested with below 
> > command line:
> > make V=1 fate-sub-cc-scte20 TARGET_EXEC="valgrind --error-exitcode=1"
> > 
> > Reported-by:   Martin Storsjö 
> > Signed-off-by: Limin Wang 
> > ---
> > libavcodec/mpeg12dec.c | 2 ++
> > 1 file changed, 2 insertions(+)
> > 
> > diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> > index f0f92ac..e9bdccc 100644
> > --- a/libavcodec/mpeg12dec.c
> > +++ b/libavcodec/mpeg12dec.c
> > @@ -2276,6 +2276,8 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
> > if (ret >= 0) {
> > uint8_t field, cc1, cc2;
> > uint8_t *cap = s1->a53_buf_ref->data;
> > +
> > +memset(s1->a53_buf_ref->data + old_size, 0, cc_count * 3);
> > for (i = 0; i < cc_count && get_bits_left(&gb) >= 26; i++) {
> > skip_bits(&gb, 2); // priority
> > field = get_bits(&gb, 2);
> > -- 
> > 1.8.3.1
> 
> OK with me if nobody else has anything more to say.

thanks, will apply.

> 
> // Martin


-- 
Thanks,
Limin Wang
___
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 1/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread lance . lmwang
On Mon, Jun 29, 2020 at 06:18:23PM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > On Mon, Jun 29, 2020 at 05:35:58PM +0200, Andreas Rheinhardt wrote:
> >> lance.lmw...@gmail.com:
> >>> From: Limin Wang 
> >>>
> >>> Signed-off-by: Limin Wang 
> >>> ---
> >>>  doc/APIchanges|  3 +++
> >>>  libavcodec/avpacket.c |  1 +
> >>>  libavcodec/decode.c   |  1 +
> >>>  libavcodec/packet.h   |  6 ++
> >>>  libavcodec/version.h  |  2 +-
> >>>  libavformat/dump.c| 21 +
> >>>  6 files changed, 33 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/doc/APIchanges b/doc/APIchanges
> >>> index 1d6cc36..7cad7fa 100644
> >>> --- a/doc/APIchanges
> >>> +++ b/doc/APIchanges
> >>> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
> >>>  
> >>>  API changes, most recent first:
> >>>  
> >>> +2020-06-xx - xx - lavc 58.94.100 - packet.h
> >>> +  Add AV_PKT_DATA_S12M_TIMECODE.
> >>> +
> >>>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
> >>>Add AV_PIX_FMT_X2RGB10.
> >>>  
> >>> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> >>> index dce26cb..24e2a74 100644
> >>> --- a/libavcodec/avpacket.c
> >>> +++ b/libavcodec/avpacket.c
> >>> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> >>> AVPacketSideDataType type)
> >>>  case AV_PKT_DATA_PRFT:   return "Producer 
> >>> Reference Time";
> >>>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
> >>>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> >>> configuration record";
> >>> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 
> >>> 12-1:2014 timecode";
> >>>  }
> >>>  return NULL;
> >>>  }
> >>> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> >>> index de9c079..f2244fc 100644
> >>> --- a/libavcodec/decode.c
> >>> +++ b/libavcodec/decode.c
> >>> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> >>> AVFrame *frame)
> >>>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> >>> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
> >>>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
> >>>  { AV_PKT_DATA_ICC_PROFILE,
> >>> AV_FRAME_DATA_ICC_PROFILE },
> >>> +{ AV_PKT_DATA_S12M_TIMECODE,  
> >>> AV_FRAME_DATA_S12M_TIMECODE },
> >>>  };
> >>>  
> >>>  if (pkt) {
> >>> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> >>> index 96f237f..d84 100644
> >>> --- a/libavcodec/packet.h
> >>> +++ b/libavcodec/packet.h
> >>> @@ -283,6 +283,12 @@ enum AVPacketSideDataType {
> >>>  AV_PKT_DATA_DOVI_CONF,
> >>>  
> >>>  /**
> >>> + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an 
> >>> array of 4 uint32_t
> >>> + * where the first uint32_t describes how many (1-3) of the other 
> >>> timecodes are used.
> >>> + */
> >>
> >> You should move the doc to timecode.h first in a separate patch and then
> >> reference the documentation here.
> > 
> > I'm not native English, so it's difficult for me to describe the format of 
> > timecode in comments clearly.
> > As it's defined in SMPTE ST 12-1:2014, so I think it's enough as it says 
> > conforms to SMPTE ST 12-1:2014
> > at beginning. 
> > 
> 
> Could you please point me to the part of SMPTE ST 12-1:2014 that
> describes the format that we use here? Because AFAIK SMPTE ST 12-1:2014
> just defines what fields a SMPTE ST 12-1 message has (and what
> semantics), but leaves the rest (the actual framing) to other standards:
> 
> "The actual transport of the codewords for digital systems varies
> significantly from the transport methods defined for analog systems, and
> is defined in the associated document, SMPTE ST 12-2."
> 
> E.g. RTP uses a different framing (see RFC 5484); obviously every
> framing method used for transport must prescribe endianness of not
> depend upon endianness; yet our method does. (Isn't this actually a
> problem for fate-tests because framecrc calculates checksums for side date?)

So the transport format is using SMPTE ST 12-2?  I'm not sure about it. It's
better to say which standard are using in comments, it's not private format.
Now I'm just using the timecode.[ch], so it's difficult to give comments for
its format. For HEVC timecode, it's use little endianness.

> 
> >>
> >>> +AV_PKT_DATA_S12M_TIMECODE,
> >>> +
> >>> +/**
> >>>   * The number of side data types.
> >>>   * This is not part of the public API/ABI in the sense that it may
> >>>   * change when new side data types are added.
> >>> diff --git a/libavcodec/version.h b/libavcodec/version.h
> >>> index 0359302..482cc6d 100644
> >>> --- a/libavcodec/version.h
> >>> +++ b/libavcodec/version.h
> >>> @@ -28,7 +28,7 @@
> >>>  #include "libavutil/version.h"
> >>>  
> >>>  #define LIBAVCODEC_VERSION_MAJOR  58
> >>> -#define LIBAVCODEC_VERSION_MINOR  93
> >>> +#define LIBAVCODEC_VERSION_MINOR  94
> >>>  #define LIBAVCODEC_VERSION_MICRO 100
> >

[FFmpeg-devel] [PATCH v2] libavformat/mov: Fix memleaks when demuxing DV audio

2020-06-29 Thread Andreas Rheinhardt
The code for demuxing DV audio predates the introduction of refcounted
packets and when the latter was added, changes to the former were
forgotten. This meant that when avpriv_dv_produce_packet initialized the
packet containing the AVBufferRef, the AVBufferRef as well as the
underlying AVBuffer leaked; the actual packet data didn't leak: They
were directly freed, but not via their AVBuffer's free function.

https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4671/dir1.tar.bz2
contains samples for this (enable_drefs needs to be enabled for them).

Moreover, errors in avpriv_dv_produce_packet were ignored; this has been
changed, too.

Furthermore, in the hypothetical scenario that the track has a palette,
this would leak, too, so reorder the code so that the palette code
appears after the DV audio code.

Signed-off-by: Andreas Rheinhardt 
---
I already sent this patch last September [1]; the only difference is
that I have updated the commit message in light of the fact that I have
now found a sample to actually test it (it works as intended). I intend
to apply it in two days unless there are objections.

[1]: 
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20190916155502.17579-3-andreas.rheinha...@gmail.com/

 libavformat/mov.c | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index adc52de947..8be01dd66b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7898,6 +7898,19 @@ static int mov_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 }
 return ret;
 }
+#if CONFIG_DV_DEMUXER
+if (mov->dv_demux && sc->dv_audio_container) {
+AVBufferRef *buf = pkt->buf;
+ret = avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, 
pkt->size, pkt->pos);
+pkt->buf = buf;
+av_packet_unref(pkt);
+if (ret < 0)
+return ret;
+ret = avpriv_dv_get_packet(mov->dv_demux, pkt);
+if (ret < 0)
+return ret;
+}
+#endif
 if (sc->has_palette) {
 uint8_t *pal;
 
@@ -7909,16 +7922,6 @@ static int mov_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 sc->has_palette = 0;
 }
 }
-#if CONFIG_DV_DEMUXER
-if (mov->dv_demux && sc->dv_audio_container) {
-avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, 
pkt->pos);
-av_freep(&pkt->data);
-pkt->size = 0;
-ret = avpriv_dv_get_packet(mov->dv_demux, pkt);
-if (ret < 0)
-return ret;
-}
-#endif
 if (st->codecpar->codec_id == AV_CODEC_ID_MP3 && !st->need_parsing && 
pkt->size > 4) {
 if (ff_mpa_check_header(AV_RB32(pkt->data)) < 0)
 st->need_parsing = AVSTREAM_PARSE_FULL;
-- 
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] configure: remove libvmaf from EXTERNAL_LIBRARY_VERSION3_LIST

2020-06-29 Thread Carl Eugen Hoyos
Am Mo., 29. Juni 2020 um 23:21 Uhr schrieb Kyle Swanson :
>
> On Mon, Jun 29, 2020 at 12:14 PM Derek Buitenhuis
>  wrote:
> > You'll need to update the pkg-config check too if you want to
> > to this, since it's at >= 1.3.9 right now.
> >
> > - Derek
>
> Thanks. Updated patch attached.

No objections.

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] configure: remove libvmaf from EXTERNAL_LIBRARY_VERSION3_LIST

2020-06-29 Thread Kyle Swanson
On Mon, Jun 29, 2020 at 12:14 PM Derek Buitenhuis
 wrote:
> You'll need to update the pkg-config check too if you want to
> to this, since it's at >= 1.3.9 right now.
>
> - Derek

Thanks. Updated patch attached.


0001-configure-remove-libvmaf-from-EXTERNAL_LIBRARY_VERSI.patch
Description: Binary data
___
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: fix memleak

2020-06-29 Thread Andreas Rheinhardt
Zhao Zhili:
> Remove the check on dv_demux since dv_fctx will leak if allocate
> dv_demux failed.
> ---
>  libavformat/mov.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index adc52de947..f179b6efdd 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -7357,10 +7357,9 @@ static int mov_read_close(AVFormatContext *s)
>  av_freep(&sc->coll);
>  }
>  
> -if (mov->dv_demux) {
> -avformat_free_context(mov->dv_fctx);
> -mov->dv_fctx = NULL;
> -}
> +av_freep(&mov->dv_demux);
> +avformat_free_context(mov->dv_fctx);
> +mov->dv_fctx = NULL;
>  
>  if (mov->meta_keys) {
>  for (i = 1; i < mov->meta_keys_count; i++) {
> 

I found samples [1] to test the dv audio codepath; it indeed showed two
kinds of leaks: The leaks of AVBufferRef and AVBuffer per packet (fixed
by my patch) and the leak of the DVDemuxContext (fixed by your patch).
The latter leak is a regression since
edb1af7c466ebb28bfdb0c076e498e527b43d24f.

I intend to apply the two patches in two days if there are no objections
from other devs (or if the maintainer of mov.c doesn't do it earlier).

- Andreas

[1]: Use the samples from
http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4671/dir1.tar.bz2
together with the enable_drefs option set.
___
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: fix memleak

2020-06-29 Thread Andreas Rheinhardt
Dave Rice:
> Hi Andreas,
> 
>> On Jun 27, 2020, at 5:09 PM, Andreas Rheinhardt 
>>  wrote:
>>
>> Zhao Zhili:
>>> Remove the check on dv_demux since dv_fctx will leak if allocate
>>> dv_demux failed.
>>> ---
>>> libavformat/mov.c | 7 +++
>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>>> index adc52de947..f179b6efdd 100644
>>> --- a/libavformat/mov.c
>>> +++ b/libavformat/mov.c
>>> @@ -7357,10 +7357,9 @@ static int mov_read_close(AVFormatContext *s)
>>> av_freep(&sc->coll);
>>> }
>>>
>>> -if (mov->dv_demux) {
>>> -avformat_free_context(mov->dv_fctx);
>>> -mov->dv_fctx = NULL;
>>> -}
>>> +av_freep(&mov->dv_demux);
>>> +avformat_free_context(mov->dv_fctx);
>>> +mov->dv_fctx = NULL;
>>>
>>> if (mov->meta_keys) {
>>> for (i = 1; i < mov->meta_keys_count; i++) {
>>>
>> Do you have a sample for this? I am asking because there are more
>> memleaks related to dv audio and I have a patch [1] for them, but I
>> never found any sample for dv in mov/mp4, so it was never applied.
> 
> I’m working with a lot of DV lately. Could you clarify what type of sample 
> that you are looking for?
> 

I was looking for samples with data format/Fourcc vdva or dvca to
trigger the codepath introduced in
b60c04547c9b59685d4cdc09d85efcf750978f60. But I have now found one*, so
I don't need your help any more. But thanks for the offer.

- Andreas

*: https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4671/dir1.tar.bz2
contains such samples (set the enable_drefs option to 1 for it to work).
Found via https://github.com/bcoudurier/FFmbc/pull/3 which I strangely
didn't find when searching for this last year.
___
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/3] fate: Update fate refs after cca982ee018aad54214e94f2a0a5921c8bbf1328

2020-06-29 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt 
> ---
> I am not sure know whether cca982ee018aad54214e94f2a0a5921c8bbf1328 is
> correct or whether it should be reverted.
> 
>  tests/ref/fate/filter-colorbalance  | 6 +++---
>  tests/ref/fate/filter-colorbalance-gbrap| 6 +++---
>  tests/ref/fate/filter-colorbalance-gbrap-16 | 6 +++---
>  tests/ref/fate/filter-colorbalance-rgba64   | 6 +++---
>  4 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/tests/ref/fate/filter-colorbalance 
> b/tests/ref/fate/filter-colorbalance
> index 0be1f1c855..f267da572e 100644
> --- a/tests/ref/fate/filter-colorbalance
> +++ b/tests/ref/fate/filter-colorbalance
> @@ -3,6 +3,6 @@
>  #codec_id 0: rawvideo
>  #dimensions 0: 352x288
>  #sar 0: 0/1
> -0,  0,  0,1,   304128, 0x3451c8eb
> -0,  1,  1,1,   304128, 0x2107daa0
> -0,  2,  2,1,   304128, 0xcda7aa33
> +0,  0,  0,1,   304128, 0xd50c9fea
> +0,  1,  1,1,   304128, 0xdf9e1f79
> +0,  2,  2,1,   304128, 0x9b84087e
> diff --git a/tests/ref/fate/filter-colorbalance-gbrap 
> b/tests/ref/fate/filter-colorbalance-gbrap
> index 2e99601829..a85dc388b0 100644
> --- a/tests/ref/fate/filter-colorbalance-gbrap
> +++ b/tests/ref/fate/filter-colorbalance-gbrap
> @@ -3,6 +3,6 @@
>  #codec_id 0: rawvideo
>  #dimensions 0: 352x288
>  #sar 0: 0/1
> -0,  0,  0,1,   405504, 0xad0f2d82
> -0,  1,  1,1,   405504, 0x81d7d31f
> -0,  2,  2,1,   405504, 0x40c5e836
> +0,  0,  0,1,   405504, 0xd33217e5
> +0,  1,  1,1,   405504, 0x08f161af
> +0,  2,  2,1,   405504, 0x27508654
> diff --git a/tests/ref/fate/filter-colorbalance-gbrap-16 
> b/tests/ref/fate/filter-colorbalance-gbrap-16
> index 4ce323557b..d18fe5a466 100644
> --- a/tests/ref/fate/filter-colorbalance-gbrap-16
> +++ b/tests/ref/fate/filter-colorbalance-gbrap-16
> @@ -3,6 +3,6 @@
>  #codec_id 0: rawvideo
>  #dimensions 0: 352x288
>  #sar 0: 0/1
> -0,  0,  0,1,   405504, 0xa97c136c
> -0,  1,  1,1,   405504, 0x0a120697
> -0,  2,  2,1,   405504, 0x85b133ff
> +0,  0,  0,1,   405504, 0x2e44c4b0
> +0,  1,  1,1,   405504, 0xf47244e0
> +0,  2,  2,1,   405504, 0x040769dd
> diff --git a/tests/ref/fate/filter-colorbalance-rgba64 
> b/tests/ref/fate/filter-colorbalance-rgba64
> index f6fcfee250..254669ff88 100644
> --- a/tests/ref/fate/filter-colorbalance-rgba64
> +++ b/tests/ref/fate/filter-colorbalance-rgba64
> @@ -3,6 +3,6 @@
>  #codec_id 0: rawvideo
>  #dimensions 0: 352x288
>  #sar 0: 0/1
> -0,  0,  0,1,   811008, 0xa67db91d
> -0,  1,  1,1,   811008, 0x0846578a
> -0,  2,  2,1,   811008, 0x77af61f8
> +0,  0,  0,1,   811008, 0x42e5db8b
> +0,  1,  1,1,   811008, 0x31be5974
> +0,  2,  2,1,   811008, 0xdef21287
> 
Will apply soon.

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

[FFmpeg-devel] [PATCH v4 1/2] libavcodec/pgxdec: Add PGX decoder

2020-06-29 Thread gautamramk
From: Gautam Ramakrishnan 

This patch adds a pgx decoder.
---
 Changelog   |   1 +
 doc/general.texi|   2 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/codec_desc.c |   7 ++
 libavcodec/codec_id.h   |   1 +
 libavcodec/pgxdec.c | 199 
 libavcodec/version.h|   2 +-
 8 files changed, 213 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/pgxdec.c

diff --git a/Changelog b/Changelog
index a60e7d2eb8..1bb9931c0d 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version :
 - AudioToolbox output device
 - MacCaption demuxer
+- PGX decoder
 
 
 version 4.3:
diff --git a/doc/general.texi b/doc/general.texi
index ea34b963b5..53d556c56c 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -751,6 +751,8 @@ following image formats are supported:
 @tab Portable GrayMap image
 @item PGMYUV   @tab X @tab X
 @tab PGM with U and V components in YUV 4:2:0
+@item PGX  @tab   @tab X
+@tab PGX file decoder
 @item PIC  @tab @tab X
 @tab Pictor/PC Paint
 @item PNG  @tab X @tab X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 5a6ea59715..12aa43fe51 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -536,6 +536,7 @@ OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o
 OBJS-$(CONFIG_PGMYUV_DECODER)  += pnmdec.o pnm.o
 OBJS-$(CONFIG_PGMYUV_ENCODER)  += pnmenc.o
 OBJS-$(CONFIG_PGSSUB_DECODER)  += pgssubdec.o
+OBJS-$(CONFIG_PGX_DECODER) += pgxdec.o
 OBJS-$(CONFIG_PICTOR_DECODER)  += pictordec.o cga_data.o
 OBJS-$(CONFIG_PIXLET_DECODER)  += pixlet.o
 OBJS-$(CONFIG_PJS_DECODER) += textdec.o ass.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index fa0c08d42e..a5048290f7 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -238,6 +238,7 @@ extern AVCodec ff_pgm_encoder;
 extern AVCodec ff_pgm_decoder;
 extern AVCodec ff_pgmyuv_encoder;
 extern AVCodec ff_pgmyuv_decoder;
+extern AVCodec ff_pgx_decoder;
 extern AVCodec ff_pictor_decoder;
 extern AVCodec ff_pixlet_decoder;
 extern AVCodec ff_png_encoder;
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 9f8847544f..67e0a3055c 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1405,6 +1405,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
 .props = AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_PGX,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "pgx",
+.long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+},
 {
 .id= AV_CODEC_ID_Y41P,
 .type  = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index d885962c9c..896ecb0ce0 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -241,6 +241,7 @@ enum AVCodecID {
 AV_CODEC_ID_SCREENPRESSO,
 AV_CODEC_ID_RSCC,
 AV_CODEC_ID_AVS2,
+AV_CODEC_ID_PGX,
 
 AV_CODEC_ID_Y41P = 0x8000,
 AV_CODEC_ID_AVRP,
diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c
new file mode 100644
index 00..9c3b18f87d
--- /dev/null
+++ b/libavcodec/pgxdec.c
@@ -0,0 +1,199 @@
+/*
+ * PGX image format
+ * Copyright (c) 2020 Gautam Ramakrishnan
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avcodec.h"
+#include "internal.h"
+#include "bytestream.h"
+#include "libavutil/imgutils.h"
+
+typedef struct PGXContext {
+GetByteContext  g;
+} PGXContext;
+
+static int pgx_get_number(AVCodecContext *avctx, PGXContext * const s) {
+int ret = -1;
+char digit;
+
+while (1) {
+uint64_t temp;
+if (!bytestream2_get_bytes_left(&s->g))
+return -1;
+digit = bytestream2_get_byte(&s->g);
+if (digit == ' ' || digit == 0xA || digit == 0xD)
+break;
+else if (digit < '0' || digit > '9')
+return -1;
+
+if (ret < 0)
+ret = 0;
+
+temp = 10 * ret + (digit - '0');
+i

Re: [FFmpeg-devel] [PATCH] avformat/hls: Pass a copy of the URL for probing

2020-06-29 Thread Michael Niedermayer
On Mon, Jun 29, 2020 at 09:08:07PM +0200, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > The segments / url can be modified by the io read when reloading
> > 
> > This may be an alternative or additional fix for Ticket8673
> > as a further alternative the reload stuff could be disabled during
> > probing
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/hls.c | 6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavformat/hls.c b/libavformat/hls.c
> > index 3798bdd5d1..ba17c4ed96 100644
> > --- a/libavformat/hls.c
> > +++ b/libavformat/hls.c
> > @@ -1946,6 +1946,7 @@ static int hls_read_header(AVFormatContext *s)
> >  /* Open the demuxer for each playlist */
> >  for (i = 0; i < c->n_playlists; i++) {
> >  struct playlist *pls = c->playlists[i];
> > +char *url;
> >  ff_const59 AVInputFormat *in_fmt = NULL;
> >  
> >  if (!(pls->ctx = avformat_alloc_context())) {
> > @@ -1983,8 +1984,9 @@ static int hls_read_header(AVFormatContext *s)
> >read_data, NULL, NULL);
> >  pls->ctx->probesize = s->probesize > 0 ? s->probesize : 1024 * 4;
> >  pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? 
> > s->max_analyze_duration : 4 * AV_TIME_BASE;
> > -ret = av_probe_input_buffer(&pls->pb, &in_fmt, 
> > pls->segments[0]->url,
> > -NULL, 0, 0);
> > +url = av_strdup(pls->segments[0]->url);
> > +ret = av_probe_input_buffer(&pls->pb, &in_fmt, url, NULL, 0, 0);
> > +av_free(url);
> >  if (ret < 0) {
> >  /* Free the ctx - it isn't initialized properly at this point,
> >   * so avformat_close_input shouldn't be called. If
> > 
> Is the missing allocation check intentional?

i thought if it fails filename is NULL and the code could still
plausibly continue.
but we can also fail or warn if people prefer

thx

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

It is what and why we do it that matters, not just one of them.


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 v5] libavformat/img2dec: Added pgx demuxer

2020-06-29 Thread gautamramk
From: Gautam Ramakrishnan 

This patch adds support to demux pgx file
format.
---
 libavformat/allformats.c | 1 +
 libavformat/img2dec.c| 9 +
 libavformat/version.h| 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 97fd06debb..f8527b1fd4 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -488,6 +488,7 @@ extern AVInputFormat  ff_image_pbm_pipe_demuxer;
 extern AVInputFormat  ff_image_pcx_pipe_demuxer;
 extern AVInputFormat  ff_image_pgmyuv_pipe_demuxer;
 extern AVInputFormat  ff_image_pgm_pipe_demuxer;
+extern AVInputFormat  ff_image_pgx_pipe_demuxer;
 extern AVInputFormat  ff_image_pictor_pipe_demuxer;
 extern AVInputFormat  ff_image_png_pipe_demuxer;
 extern AVInputFormat  ff_image_ppm_pipe_demuxer;
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index ee7ceed08f..a7e89cd056 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -1000,6 +1000,14 @@ static int pgmyuv_probe(const AVProbeData *p) // custom 
FFmpeg format recognized
 return ret && av_match_ext(p->filename, "pgmyuv") ? ret : 0;
 }
 
+static int pgx_probe(const AVProbeData *p)
+{
+const uint8_t *b = p->buf;
+if (!memcmp(b, "PG ML ", 6))
+return AVPROBE_SCORE_EXTENSION + 1;
+return 0;
+}
+
 static int ppm_probe(const AVProbeData *p)
 {
 return pnm_magic_check(p, 3) || pnm_magic_check(p, 6) ? pnm_probe(p) : 0;
@@ -1094,6 +1102,7 @@ IMAGEAUTO_DEMUXER(pbm, AV_CODEC_ID_PBM)
 IMAGEAUTO_DEMUXER(pcx, AV_CODEC_ID_PCX)
 IMAGEAUTO_DEMUXER(pgm, AV_CODEC_ID_PGM)
 IMAGEAUTO_DEMUXER(pgmyuv,  AV_CODEC_ID_PGMYUV)
+IMAGEAUTO_DEMUXER(pgx, AV_CODEC_ID_PGX)
 IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR)
 IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
 IMAGEAUTO_DEMUXER(ppm, AV_CODEC_ID_PPM)
diff --git a/libavformat/version.h b/libavformat/version.h
index 3c1957b00c..75c03fde0a 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  58
-#define LIBAVFORMAT_VERSION_MINOR  47
+#define LIBAVFORMAT_VERSION_MINOR  48
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-- 
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] configure: remove libvmaf from EXTERNAL_LIBRARY_VERSION3_LIST

2020-06-29 Thread Derek Buitenhuis
On 29/06/2020 18:04, Kyle Swanson wrote:
> since libvmaf v1.5.1, libvmaf has been relicensed as BSD+Patent
> 
> Signed-off-by: Kyle Swanson 
> ---
>  configure | 1 -
>  1 file changed, 1 deletion(-)

You'll need to update the pkg-config check too if you want to
to this, since it's at >= 1.3.9 right now.

- Derek
___
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/hls: Pass a copy of the URL for probing

2020-06-29 Thread Andreas Rheinhardt
Michael Niedermayer:
> The segments / url can be modified by the io read when reloading
> 
> This may be an alternative or additional fix for Ticket8673
> as a further alternative the reload stuff could be disabled during
> probing
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/hls.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/hls.c b/libavformat/hls.c
> index 3798bdd5d1..ba17c4ed96 100644
> --- a/libavformat/hls.c
> +++ b/libavformat/hls.c
> @@ -1946,6 +1946,7 @@ static int hls_read_header(AVFormatContext *s)
>  /* Open the demuxer for each playlist */
>  for (i = 0; i < c->n_playlists; i++) {
>  struct playlist *pls = c->playlists[i];
> +char *url;
>  ff_const59 AVInputFormat *in_fmt = NULL;
>  
>  if (!(pls->ctx = avformat_alloc_context())) {
> @@ -1983,8 +1984,9 @@ static int hls_read_header(AVFormatContext *s)
>read_data, NULL, NULL);
>  pls->ctx->probesize = s->probesize > 0 ? s->probesize : 1024 * 4;
>  pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? 
> s->max_analyze_duration : 4 * AV_TIME_BASE;
> -ret = av_probe_input_buffer(&pls->pb, &in_fmt, pls->segments[0]->url,
> -NULL, 0, 0);
> +url = av_strdup(pls->segments[0]->url);
> +ret = av_probe_input_buffer(&pls->pb, &in_fmt, url, NULL, 0, 0);
> +av_free(url);
>  if (ret < 0) {
>  /* Free the ctx - it isn't initialized properly at this point,
>   * so avformat_close_input shouldn't be called. If
> 
Is the missing allocation check intentional?

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

[FFmpeg-devel] [PATCH] avformat/hls: Pass a copy of the URL for probing

2020-06-29 Thread Michael Niedermayer
The segments / url can be modified by the io read when reloading

This may be an alternative or additional fix for Ticket8673
as a further alternative the reload stuff could be disabled during
probing

Signed-off-by: Michael Niedermayer 
---
 libavformat/hls.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 3798bdd5d1..ba17c4ed96 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1946,6 +1946,7 @@ static int hls_read_header(AVFormatContext *s)
 /* Open the demuxer for each playlist */
 for (i = 0; i < c->n_playlists; i++) {
 struct playlist *pls = c->playlists[i];
+char *url;
 ff_const59 AVInputFormat *in_fmt = NULL;
 
 if (!(pls->ctx = avformat_alloc_context())) {
@@ -1983,8 +1984,9 @@ static int hls_read_header(AVFormatContext *s)
   read_data, NULL, NULL);
 pls->ctx->probesize = s->probesize > 0 ? s->probesize : 1024 * 4;
 pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? 
s->max_analyze_duration : 4 * AV_TIME_BASE;
-ret = av_probe_input_buffer(&pls->pb, &in_fmt, pls->segments[0]->url,
-NULL, 0, 0);
+url = av_strdup(pls->segments[0]->url);
+ret = av_probe_input_buffer(&pls->pb, &in_fmt, url, NULL, 0, 0);
+av_free(url);
 if (ret < 0) {
 /* Free the ctx - it isn't initialized properly at this point,
  * so avformat_close_input shouldn't be called. If
-- 
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 v4 2/2] libavformat/img2dec: Added pgx demuxer

2020-06-29 Thread Gautam Ramakrishnan
On Tue, Jun 30, 2020 at 12:28 AM Nicolas George  wrote:
>
> gautamr...@gmail.com (12020-06-30):
> > From: Gautam Ramakrishnan 
> >
> > This patch adds support to demux pgx file
> > format.
> > ---
> >  libavformat/allformats.c | 1 +
> >  libavformat/img2dec.c| 9 +
> >  libavformat/version.h| 2 +-
> >  3 files changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> > index 97fd06debb..f8527b1fd4 100644
> > --- a/libavformat/allformats.c
> > +++ b/libavformat/allformats.c
> > @@ -488,6 +488,7 @@ extern AVInputFormat  ff_image_pbm_pipe_demuxer;
> >  extern AVInputFormat  ff_image_pcx_pipe_demuxer;
> >  extern AVInputFormat  ff_image_pgmyuv_pipe_demuxer;
> >  extern AVInputFormat  ff_image_pgm_pipe_demuxer;
> > +extern AVInputFormat  ff_image_pgx_pipe_demuxer;
> >  extern AVInputFormat  ff_image_pictor_pipe_demuxer;
> >  extern AVInputFormat  ff_image_png_pipe_demuxer;
> >  extern AVInputFormat  ff_image_ppm_pipe_demuxer;
> > diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> > index ee7ceed08f..b6063bb685 100644
> > --- a/libavformat/img2dec.c
> > +++ b/libavformat/img2dec.c
> > @@ -1000,6 +1000,14 @@ static int pgmyuv_probe(const AVProbeData *p) // 
> > custom FFmpeg format recognized
> >  return ret && av_match_ext(p->filename, "pgmyuv") ? ret : 0;
> >  }
> >
> > +static int pgx_probe(const AVProbeData *p)
> > +{
> > +const uint8_t *b = p->buf;
>
> > +if ((AV_RB64(b) & 0x) == 0x5047204D4C20)
> > +return AVPROBE_SCORE_EXTENSION + 1;
>
> Why do you use AV_RB64() here and not memcmp() like you did in the other
> patch? This 0x5047204D4C20 is abominable.
I saw AV_RB32() and AVRB64() being used a lot in img2dec and it didnt strike me.
Ill change this.
>
> > +return 0;
> > +}
> > +
> >  static int ppm_probe(const AVProbeData *p)
> >  {
> >  return pnm_magic_check(p, 3) || pnm_magic_check(p, 6) ? pnm_probe(p) : 
> > 0;
> > @@ -1094,6 +1102,7 @@ IMAGEAUTO_DEMUXER(pbm, AV_CODEC_ID_PBM)
> >  IMAGEAUTO_DEMUXER(pcx, AV_CODEC_ID_PCX)
> >  IMAGEAUTO_DEMUXER(pgm, AV_CODEC_ID_PGM)
> >  IMAGEAUTO_DEMUXER(pgmyuv,  AV_CODEC_ID_PGMYUV)
> > +IMAGEAUTO_DEMUXER(pgx, AV_CODEC_ID_PGX)
> >  IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR)
> >  IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
> >  IMAGEAUTO_DEMUXER(ppm, AV_CODEC_ID_PPM)
> > diff --git a/libavformat/version.h b/libavformat/version.h
> > index 3c1957b00c..75c03fde0a 100644
> > --- a/libavformat/version.h
> > +++ b/libavformat/version.h
> > @@ -32,7 +32,7 @@
> >  // Major bumping may affect Ticket5467, 5421, 5451(compatibility with 
> > Chromium)
> >  // Also please add any ticket numbers that you believe might be affected 
> > here
> >  #define LIBAVFORMAT_VERSION_MAJOR  58
> > -#define LIBAVFORMAT_VERSION_MINOR  47
> > +#define LIBAVFORMAT_VERSION_MINOR  48
> >  #define LIBAVFORMAT_VERSION_MICRO 100
> >
> >  #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
>
> Regards,
>
> --
>   Nicolas George



-- 
-
Gautam |
___
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 2/2] libavformat/img2dec: Added pgx demuxer

2020-06-29 Thread Nicolas George
gautamr...@gmail.com (12020-06-30):
> From: Gautam Ramakrishnan 
> 
> This patch adds support to demux pgx file
> format.
> ---
>  libavformat/allformats.c | 1 +
>  libavformat/img2dec.c| 9 +
>  libavformat/version.h| 2 +-
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 97fd06debb..f8527b1fd4 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -488,6 +488,7 @@ extern AVInputFormat  ff_image_pbm_pipe_demuxer;
>  extern AVInputFormat  ff_image_pcx_pipe_demuxer;
>  extern AVInputFormat  ff_image_pgmyuv_pipe_demuxer;
>  extern AVInputFormat  ff_image_pgm_pipe_demuxer;
> +extern AVInputFormat  ff_image_pgx_pipe_demuxer;
>  extern AVInputFormat  ff_image_pictor_pipe_demuxer;
>  extern AVInputFormat  ff_image_png_pipe_demuxer;
>  extern AVInputFormat  ff_image_ppm_pipe_demuxer;
> diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> index ee7ceed08f..b6063bb685 100644
> --- a/libavformat/img2dec.c
> +++ b/libavformat/img2dec.c
> @@ -1000,6 +1000,14 @@ static int pgmyuv_probe(const AVProbeData *p) // 
> custom FFmpeg format recognized
>  return ret && av_match_ext(p->filename, "pgmyuv") ? ret : 0;
>  }
>  
> +static int pgx_probe(const AVProbeData *p)
> +{
> +const uint8_t *b = p->buf;

> +if ((AV_RB64(b) & 0x) == 0x5047204D4C20)
> +return AVPROBE_SCORE_EXTENSION + 1;

Why do you use AV_RB64() here and not memcmp() like you did in the other
patch? This 0x5047204D4C20 is abominable.

> +return 0;
> +}
> +
>  static int ppm_probe(const AVProbeData *p)
>  {
>  return pnm_magic_check(p, 3) || pnm_magic_check(p, 6) ? pnm_probe(p) : 0;
> @@ -1094,6 +1102,7 @@ IMAGEAUTO_DEMUXER(pbm, AV_CODEC_ID_PBM)
>  IMAGEAUTO_DEMUXER(pcx, AV_CODEC_ID_PCX)
>  IMAGEAUTO_DEMUXER(pgm, AV_CODEC_ID_PGM)
>  IMAGEAUTO_DEMUXER(pgmyuv,  AV_CODEC_ID_PGMYUV)
> +IMAGEAUTO_DEMUXER(pgx, AV_CODEC_ID_PGX)
>  IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR)
>  IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
>  IMAGEAUTO_DEMUXER(ppm, AV_CODEC_ID_PPM)
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 3c1957b00c..75c03fde0a 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -32,7 +32,7 @@
>  // Major bumping may affect Ticket5467, 5421, 5451(compatibility with 
> Chromium)
>  // Also please add any ticket numbers that you believe might be affected here
>  #define LIBAVFORMAT_VERSION_MAJOR  58
> -#define LIBAVFORMAT_VERSION_MINOR  47
> +#define LIBAVFORMAT_VERSION_MINOR  48
>  #define LIBAVFORMAT_VERSION_MICRO 100
>  
>  #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

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 v4 2/2] libavformat/img2dec: Added pgx demuxer

2020-06-29 Thread gautamramk
From: Gautam Ramakrishnan 

This patch adds support to demux pgx file
format.
---
 libavformat/allformats.c | 1 +
 libavformat/img2dec.c| 9 +
 libavformat/version.h| 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 97fd06debb..f8527b1fd4 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -488,6 +488,7 @@ extern AVInputFormat  ff_image_pbm_pipe_demuxer;
 extern AVInputFormat  ff_image_pcx_pipe_demuxer;
 extern AVInputFormat  ff_image_pgmyuv_pipe_demuxer;
 extern AVInputFormat  ff_image_pgm_pipe_demuxer;
+extern AVInputFormat  ff_image_pgx_pipe_demuxer;
 extern AVInputFormat  ff_image_pictor_pipe_demuxer;
 extern AVInputFormat  ff_image_png_pipe_demuxer;
 extern AVInputFormat  ff_image_ppm_pipe_demuxer;
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index ee7ceed08f..b6063bb685 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -1000,6 +1000,14 @@ static int pgmyuv_probe(const AVProbeData *p) // custom 
FFmpeg format recognized
 return ret && av_match_ext(p->filename, "pgmyuv") ? ret : 0;
 }
 
+static int pgx_probe(const AVProbeData *p)
+{
+const uint8_t *b = p->buf;
+if ((AV_RB64(b) & 0x) == 0x5047204D4C20)
+return AVPROBE_SCORE_EXTENSION + 1;
+return 0;
+}
+
 static int ppm_probe(const AVProbeData *p)
 {
 return pnm_magic_check(p, 3) || pnm_magic_check(p, 6) ? pnm_probe(p) : 0;
@@ -1094,6 +1102,7 @@ IMAGEAUTO_DEMUXER(pbm, AV_CODEC_ID_PBM)
 IMAGEAUTO_DEMUXER(pcx, AV_CODEC_ID_PCX)
 IMAGEAUTO_DEMUXER(pgm, AV_CODEC_ID_PGM)
 IMAGEAUTO_DEMUXER(pgmyuv,  AV_CODEC_ID_PGMYUV)
+IMAGEAUTO_DEMUXER(pgx, AV_CODEC_ID_PGX)
 IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR)
 IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
 IMAGEAUTO_DEMUXER(ppm, AV_CODEC_ID_PPM)
diff --git a/libavformat/version.h b/libavformat/version.h
index 3c1957b00c..75c03fde0a 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  58
-#define LIBAVFORMAT_VERSION_MINOR  47
+#define LIBAVFORMAT_VERSION_MINOR  48
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-- 
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 1/5] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 5:55 PM Wang Cao  wrote:
>
> From: Wang Cao 
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 39 +++
>  libavcodec/libaomenc.c | 38 ++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 78 insertions(+), 1 deletion(-)
>
> [...]
> @@ -688,6 +713,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
>  // codec control failures are currently treated only as warnings
>  av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n");
>  codecctl_int(avctx, AOME_SET_CPUUSED, ctx->cpu_used);
> +if (ctx->enable_superres >= 0)

I think you can just check whether superres_mode has been set to avoid
this additional option.

> +codecctl_int(avctx, AV1E_SET_ENABLE_SUPERRES, ctx->enable_superres);
>  if (ctx->auto_alt_ref >= 0)
>  codecctl_int(avctx, AOME_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref);
>  if (ctx->arnr_max_frames >= 0)
> @@ -1107,6 +1134,17 @@ static const AVOption options[] = {
>  { "tune","The metric that the encoder tunes for. 
> Automatically chosen by the encoder by default", OFFSET(tune), 
> AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_TUNE_SSIM, VE, "tune"},
>  { "psnr",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> AOM_TUNE_PSNR}, 0, 0, VE, "tune"},
>  { "ssim",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> AOM_TUNE_SSIM}, 0, 0, VE, "tune"},
> +{ "enable-superres", "Enable super-resolution mode", 
> OFFSET(enable_superres), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "superres-mode",   "Select super-resultion mode", 
> OFFSET(superres_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_SUPERRES_AUTO, 
> VE, "superres_mode"},

resolution

> +{ "none","No frame superres allowed",
>   0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_NONE},0, 0, VE, 
> "superres_mode"},
> +{ "fixed",   "All frames are coded at the specified scale and 
> super-resolved", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_FIXED},   0, 0, 
> VE, "superres_mode"},
> +{ "random",  "All frames are coded at a random scale and 
> super-resolved.", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_RANDOM},  0, 
> 0, VE, "superres_mode"},
> +{ "qthresh", "Superres scale for a frame is determined based on 
> q_index",  0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_QTHRESH}, 0, 0, VE, 
> "superres_mode"},
> +{ "auto","Automatically select superres for appropriate 
> frames",   0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_AUTO},0, 0, 
> VE, "superres_mode"},
> +{ "superres-denominator","The denominator for superres to use, range 
> [8, 16]",   OFFSET(superres_denominator),
> AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE},
> +{ "superres-qthresh","The q level threshold after which superres 
> is used, range [1, 63]",OFFSET(superres_qthresh),
> AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE},
> +{ "superres-kf-denominator", "The denominator for superres to use on key 
> frames, range [8, 16]", OFFSET(superres_kf_denominator), 
> AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE},
> +{ "superres-kf-qthresh", "The q level threshold after which superres 
> is used for key frames, range [1, 63]", OFFSET(superres_kf_qthresh), 
> AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE},
>  { NULL },
>  };
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 5/5] libavcodec/libaomenc.c: Add command-line options for inter-coding tools

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 5:56 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 36 +
>  libavcodec/libaomenc.c | 61 ++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 98 insertions(+), 1 deletion(-)
>
> [...]
>  codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh);
> @@ -1226,6 +1275,18 @@ static const AVOption options[] = {
>  { "use-intra-dct-only","Use DCT only for INTRA modes",   
>   OFFSET(use_intra_dct_only),AV_OPT_TYPE_BOOL, {.i64 = 
> -1}, -1, 1, VE},
>  { "use-inter-dct-only","Use DCT only for INTRA modes",   
>   OFFSET(use_inter_dct_only),AV_OPT_TYPE_BOOL, {.i64 = 
> -1}, -1, 1, VE},
>  { "use-intra-default-tx-only", "Use Default-transform only for INTRA 
> modes",   OFFSET(use_intra_default_tx_only), AV_OPT_TYPE_BOOL, {.i64 
> = -1}, -1, 1, VE},
> +{ "enable-ref-frame-mvs", "Enable temporal mv prediction 
> (default is 1)", 
> OFFSET(enable_ref_frame_mvs), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, 
> VE},
> +{ "enable-reduced-reference-set", "Use reduced set of single and 
> compound references  (0: off (default), 1: on)", 
> OFFSET(enable_reduced_reference_set), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, 
> VE},
> +{ "enable-obmc",  "Enable obmc (0: false, 1: true 
> (default))",OFFSET(enable_obmc),  
> AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-dual-filter",   "Enable dual filter (0: false, 1: true 
> (default))", OFFSET(enable_dual_filter),  
>  AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-diff-wtd-comp", "Enable difference-weighted compound 
> (0: false, 1: true (default))",OFFSET(enable_diff_wtd_comp),  
>AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-dist-wtd-comp", "Enable distance-weighted compound (0: 
> false, 1: true (default))",  OFFSET(enable_dist_wtd_comp),
>  AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-onesided-comp", "Enable one sided compound (0: false, 
> 1: true (default))",  OFFSET(enable_onesided_comp),   
>   AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-interinter-wedge",  "Enable interinter wedge compound (0: 
> false, 1: true (default))",   OFFSET(enable_interinter_wedge),
>   AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-interintra-wedge",  "Enable interintra wedge compound (0: 
> false, 1: true (default))",   OFFSET(enable_interintra_wedge),
>   AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-masked-comp",   "Enable masked compound (0: false, 1: 
> true (default))", OFFSET(enable_masked_comp), 
>   AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-interintra-comp",   "Enable interintra compound (0: false, 
> 1: true (default))", OFFSET(enable_interintra_comp),  
>  AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-smooth-interintra", "Enable smooth interintra mode (0: 
> false, 1: true (default))",  
> OFFSET(enable_smooth_interintra), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, 
> VE},

These show up as booleans in the help output, so '(default true)' is
probably enough. You can have a look at the output with -h
encoder=libaom-av1.
___
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] libavcodec/libaomenc.c: Add command-line options for tx tools.

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 5:56 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 21 +
>  libavcodec/libaomenc.c | 31 +++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 53 insertions(+), 1 deletion(-)
>
> [...]
> +{ "reduced-tx-type-set",   "Use reduced set of transform types. 
> Default is false", OFFSET(reduced_tx_type_set),   AV_OPT_TYPE_BOOL, {.i64 
> = -1}, -1, 1, VE},
> +{ "use-intra-dct-only","Use DCT only for INTRA modes",   
>   OFFSET(use_intra_dct_only),AV_OPT_TYPE_BOOL, {.i64 = 
> -1}, -1, 1, VE},
> +{ "use-inter-dct-only","Use DCT only for INTRA modes",   
>   OFFSET(use_inter_dct_only),AV_OPT_TYPE_BOOL, {.i64 = 
> -1}, -1, 1, VE},

INTER
___
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] avcodec/mpeg12dec: Fix uninitialized data in fate-sub-cc-scte20

2020-06-29 Thread Martin Storsjö

On Sun, 28 Jun 2020, lance.lmw...@gmail.com wrote:


From: Limin Wang 

The issue is introduced from a705bcd763e344fa, please tested with below command 
line:
make V=1 fate-sub-cc-scte20 TARGET_EXEC="valgrind --error-exitcode=1"

Reported-by:   Martin Storsjö 
Signed-off-by: Limin Wang 
---
libavcodec/mpeg12dec.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index f0f92ac..e9bdccc 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2276,6 +2276,8 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
if (ret >= 0) {
uint8_t field, cc1, cc2;
uint8_t *cap = s1->a53_buf_ref->data;
+
+memset(s1->a53_buf_ref->data + old_size, 0, cc_count * 3);
for (i = 0; i < cc_count && get_bits_left(&gb) >= 26; i++) {
skip_bits(&gb, 2); // priority
field = get_bits(&gb, 2);
--
1.8.3.1


OK with me if nobody else has anything more to say.

// Martin
___
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] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-06-29 Thread James Zern
On Mon, Jun 29, 2020 at 11:05 AM James Zern  wrote:
>
> On Thu, Jun 25, 2020 at 5:55 PM Wang Cao  wrote:
> >
> > From: Wang Cao 
> >
> > Signed-off-by: Wang Cao 
> > ---
> >  doc/encoders.texi  | 39 +++
> >  libavcodec/libaomenc.c | 38 ++
> >  libavcodec/version.h   |  2 +-
> >  3 files changed, 78 insertions(+), 1 deletion(-)
> >
> > [...]
> > @@ -688,6 +713,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
> >  // codec control failures are currently treated only as warnings
> >  av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n");
> >  codecctl_int(avctx, AOME_SET_CPUUSED, ctx->cpu_used);
> > +if (ctx->enable_superres >= 0)
>
> I think you can just check whether superres_mode has been set to avoid
> this additional option.
>
> > +codecctl_int(avctx, AV1E_SET_ENABLE_SUPERRES, 
> > ctx->enable_superres);
> >  if (ctx->auto_alt_ref >= 0)
> >  codecctl_int(avctx, AOME_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref);
> >  if (ctx->arnr_max_frames >= 0)
> > @@ -1107,6 +1134,17 @@ static const AVOption options[] = {
> >  { "tune","The metric that the encoder tunes for. 
> > Automatically chosen by the encoder by default", OFFSET(tune), 
> > AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_TUNE_SSIM, VE, "tune"},
> >  { "psnr",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > AOM_TUNE_PSNR}, 0, 0, VE, "tune"},
> >  { "ssim",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > AOM_TUNE_SSIM}, 0, 0, VE, "tune"},
> > +{ "enable-superres", "Enable super-resolution mode", 
> > OFFSET(enable_superres), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> > +{ "superres-mode",   "Select super-resultion mode", 
> > OFFSET(superres_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_SUPERRES_AUTO, 
> > VE, "superres_mode"},
>
> resolution
>
> > +{ "none","No frame superres allowed",  
> > 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_NONE},0, 0, 
> > VE, "superres_mode"},

The AOM_SUPERRES_* enum values are a recent addition, for
compatibility you can use integer constants. If there was an abi bump
after they were added you can check that and keep the enum values for
current versions of the library.

> > +{ "fixed",   "All frames are coded at the specified scale and 
> > super-resolved", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_FIXED},   0, 0, 
> > VE, "superres_mode"},
> > +{ "random",  "All frames are coded at a random scale and 
> > super-resolved.", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_RANDOM},  
> > 0, 0, VE, "superres_mode"},
> > +{ "qthresh", "Superres scale for a frame is determined based 
> > on q_index",  0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_QTHRESH}, 0, 
> > 0, VE, "superres_mode"},
> > +{ "auto","Automatically select superres for appropriate 
> > frames",   0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_AUTO},0, 
> > 0, VE, "superres_mode"},
> > +{ "superres-denominator","The denominator for superres to use, 
> > range [8, 16]",   OFFSET(superres_denominator), 
> >AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE},
> > +{ "superres-qthresh","The q level threshold after which 
> > superres is used, range [1, 63]",OFFSET(superres_qthresh),  
> >   AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE},
> > +{ "superres-kf-denominator", "The denominator for superres to use on 
> > key frames, range [8, 16]", 
> > OFFSET(superres_kf_denominator), AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE},
> > +{ "superres-kf-qthresh", "The q level threshold after which 
> > superres is used for key frames, range [1, 63]", 
> > OFFSET(superres_kf_qthresh), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE},
> >  { NULL },
> >  };
> >
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 3/5] libavcodec/libaomenc.c: Add command-line options for intra-coding tools

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 5:55 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 21 +++
>  libavcodec/libaomenc.c | 47 --
>  libavcodec/version.h   |  2 +-
>  3 files changed, 63 insertions(+), 7 deletions(-)
>

lgtm.
___
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/5] libavcodec/libaomenc: Add command-line options to control the use of partition tools.

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 6:02 PM Wang Cao  wrote:
>
> This patch adds the control for enabling rectangular partitions, 1:4/4:1
> partitions and AB shape partitions.
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 10 ++
>  libavcodec/libaomenc.c | 15 +++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 26 insertions(+), 1 deletion(-)
>

lgtm. I'll apply this soon if there aren't any other comments.
___
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] libavcodec/jpeg2000.c: Precinct size check removed

2020-06-29 Thread gautamramk
From: Gautam Ramakrishnan 

This patch removes a check which throws an error if
the log2 precinct width/height is 0. The standard allows
the first component to have 0 as the log2 width/height.
However, to ensure proper intialization of coding style,
an extra check has been added.
---
 libavcodec/jpeg2000.c| 3 ---
 libavcodec/jpeg2000.h| 1 +
 libavcodec/jpeg2000dec.c | 6 --
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index 73206d17f3..1aca31ffa4 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -509,9 +509,6 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
 // update precincts size: 2^n value
 reslevel->log2_prec_width  = codsty->log2_prec_widths[reslevelno];
 reslevel->log2_prec_height = codsty->log2_prec_heights[reslevelno];
-if (!reslevel->log2_prec_width || !reslevel->log2_prec_height) {
-return AVERROR_INVALIDDATA;
-}
 
 /* Number of bands for each resolution level */
 if (reslevelno == 0)
diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h
index 0f82716981..27df43786d 100644
--- a/libavcodec/jpeg2000.h
+++ b/libavcodec/jpeg2000.h
@@ -144,6 +144,7 @@ typedef struct Jpeg2000CodingStyle {
 uint8_t prog_order;   // progression order
 uint8_t log2_prec_widths[JPEG2000_MAX_RESLEVELS];  // precincts size 
according resolution levels
 uint8_t log2_prec_heights[JPEG2000_MAX_RESLEVELS]; // TODO: initialize 
prec_size array with 0?
+uint8_t init;
 } Jpeg2000CodingStyle;
 
 typedef struct Jpeg2000QuantStyle {
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 546a646668..3f4a9ef96c 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -567,7 +567,7 @@ static int get_cod(Jpeg2000DecoderContext *s, 
Jpeg2000CodingStyle *c,
 
 if ((ret = get_cox(s, &tmp)) < 0)
 return ret;
-
+tmp.init = 1;
 for (compno = 0; compno < s->ncomponents; compno++)
 if (!(properties[compno] & HAD_COC))
 memcpy(c + compno, &tmp, sizeof(tmp));
@@ -605,6 +605,7 @@ static int get_coc(Jpeg2000DecoderContext *s, 
Jpeg2000CodingStyle *c,
 return ret;
 
 properties[compno] |= HAD_COC;
+c->init = 1;
 return 0;
 }
 
@@ -991,7 +992,8 @@ static int init_tile(Jpeg2000DecoderContext *s, int tileno)
 
 if (!comp->roi_shift)
 comp->roi_shift = s->roi_shift[compno];
-
+if (!codsty->init)
+return AVERROR_INVALIDDATA;
 if (ret = ff_jpeg2000_init_component(comp, codsty, qntsty,
  s->cbps[compno], s->cdx[compno],
  s->cdy[compno], s->avctx))
-- 
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 v3] fbdetile cpu based detiling of framebuffers v03

2020-06-29 Thread hanishkvc
v03-20200629IST2208 fbdetile

Added a generic detiling logic, which can be easily configured to
detile many different tiling schemes.

The same is inturn used to detile Intel Tile-Yf layout.

NOTE: This is a full patch, it contains the previous versions also
in it.

v02-20200627IST2331

Unrolled Intel Legacy Tile-Y detiling logic.

Also a consolidated patch file, instead of the previous development
flow based multiple patch files.

v01-20200627IST1308

Implemented Intel Legacy Tile-X and Tile-Y detiling logic

NOTES:

This video filter allows framebuffers which are tiled to be detiled
using logic running on the cpu, into a linear layout.

Currently it supports Intel Legacy Tile-X and Tile-Y layout detiling,
as well as the newer Intel Tile-Yf layouts.

THis should help one to work with frames captured (say using kmsgrab)
on laptops having Intel GPU. This can be done live while capturing
itself, or it can be applied later as a seperate pass.

Tile-X conversion logic has been explicitly cross checked, with Tile-X
based frames. However Tile-Y and Tile-Yf conv logics havent been tested
with Tile-Y | Tile-Yf based frames, but it should potentially get the
job done, based on my current understanding of these layout formats.

TODO1: At a later time have to generate Tile-Y|Yf based frames, and then
cross check the corresponding logic explicitly.

TODO2: May be use OpenGL or Vulcan buffer helper routines to do the
layout conversion. But some online discussions from sometime back seem
to indicate that this path is not fully bug free currently.
---
 Changelog |   1 +
 doc/filters.texi  |  74 ++
 libavfilter/Makefile  |   1 +
 libavfilter/allfilters.c  |   1 +
 libavfilter/vf_fbdetile.c | 465 ++
 5 files changed, 542 insertions(+)
 create mode 100644 libavfilter/vf_fbdetile.c

diff --git a/Changelog b/Changelog
index a60e7d2eb8..0e03491f6a 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest 
within each release,
 releases are sorted from youngest to oldest.
 
 version :
+- fbdetile cpu based framebuffer layout detiling video filter
 - AudioToolbox output device
 - MacCaption demuxer
 
diff --git a/doc/filters.texi b/doc/filters.texi
index 67892e0afb..f7bcae1685 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -12210,6 +12210,80 @@ It accepts the following optional parameters:
 The number of the CUDA device to use
 @end table
 
+@anchor{fbdetile}
+@section fbdetile
+
+Detiles the Framebuffer tile layout into a linear layout using CPU.
+
+It currently supports conversion from Intel legacy tile-x and tile-y as well
+as the newer Intel tile-yf layouts into a linear layout. This is useful if
+one is using kmsgrab and hwdownload to capture a screen which is using one
+of these non-linear layouts.
+
+NOTE: It also provides a generic detiling logic, which can be easily configured
+to detile many different tiling schemes if required, in future. The same is
+used for detiling the intel tile-yf layout. Also sample configuration to handle
+intel tile-x and tile-y using generic detile logic is also shown for reference,
+in the code.
+
+Currently it expects the data to be a 32bit RGB based pixel format. However
+the logic doesnt do any pixel format conversion or so. Later will be enabling
+16bit RGB data also, as the logic is transparent to it at one level.
+
+One could either insert this into the filter chain while capturing itself,
+or else, if it is slowing things down or so, then one could instead insert
+it into the filter chain during playback or transcoding or so.
+
+It supports the following optional parameters
+
+@table @option
+@item type
+Specify which detiling conversion to apply. The supported values are
+@table @var
+@item 0
+intel tile-x to linear conversion (the default)
+@item 1
+intel tile-y to linear conversion.
+@item 2
+intel tile-yf to linear conversion.
+@end table
+@end table
+
+If one wants to convert during capture itself, one could do
+@example
+ffmpeg -f kmsgrab -i - -vf "hwdownload,format=bgr0,fbdetile" OUTPUT
+@end example
+
+However if one wants to convert after the tiled data has been already captured
+@example
+ffmpeg -i INPUT -vf "fbdetile" OUTPUT
+@end example
+@example
+ffplay -i INPUT -vf "fbdetile"
+@end example
+
+NOTE: While transcoding a test 1080p h264 stream, with 276 frames, below was
+the average times taken by the different detile logics.
+@example
+rm out.mp4; time ./ffmpeg -i input.mp4 out.mp4
+rm out.mp4; time ./ffmpeg -i input.mp4 -vf fbdetile=0 out.mp4
+rm out.mp4; time ./ffmpeg -i input.mp4 -vf fbdetile=1 out.mp4
+rm out.mp4; time ./ffmpeg -i input.mp4 -vf fbdetile=2 out.mp4
+@end example
+@table @option
+@item with no fbdetile filter
+it took ~7.28 secs, i5-8th Gen
+it took ~10.1 secs, i7-7th Gen
+@item with fbdetile=0 filter, Intel Tile-X
+it took ~8.69 secs, i5-8th Gen
+it took ~13.3 secs, i7-7th Gen
+@item with fbdetile=1 filter, Intel Tile-Y

Re: [FFmpeg-devel] [PATCH] configure: remove libvmaf from EXTERNAL_LIBRARY_VERSION3_LIST

2020-06-29 Thread Kyle Swanson
Hi,

On Mon, Jun 29, 2020 at 10:05 AM Kyle Swanson  wrote:
>
> since libvmaf v1.5.1, libvmaf has been relicensed as BSD+Patent
>
> Signed-off-by: Kyle Swanson 
> ---
>  configure | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/configure b/configure
> index 7495f35faa..e0b76ac1ea 100755
> --- a/configure
> +++ b/configure
> @@ -1741,7 +1741,6 @@ EXTERNAL_LIBRARY_VERSION3_LIST="
>  liblensfun
>  libopencore_amrnb
>  libopencore_amrwb
> -libvmaf
>  libvo_amrwbenc
>  mbedtls
>  rkmpp
> --
> 2.26.2
>

Missed the filter docs. Updated patch attached.

Thanks,
Kyle


0001-configure-remove-libvmaf-from-EXTERNAL_LIBRARY_VERSI.patch
Description: Binary data
___
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] fbdetile cpu based framebuffer layout detiling v02

2020-06-29 Thread C Hanish Menon
Hi Lynne,

Thanks for your thoughts. My thoughts I have embedded below

On Mon, Jun 29, 2020 at 6:32 PM Lynne  wrote:

> Jun 28, 2020, 22:40 by hanish...@gmail.com:
>
> > Hi Mark,
> >
> >  hwdownload vs separate filter
> >
> > True, for kmsgrab use-case one could potentially do this transform as
> part
> > of the drm_transfer_data logic (which currently mmaps and does a linear
> > copy, if even I remember correctly).  But like what I had mentioned in my
> > previous email, as this is done on the cpu side, if one wants to capture
> > very large framebuffers (say 4K or 8K at high fps), it could impact the
> > performance to some extent, so in such a situation decoupling the capture
> > from detiling, allows one to capture the screen at a very high resolution
> > without worrying about detiling and then handle detile in a offline /
> > separate pass manner.
> >
>
> I too think the filter must be done during hwdownload. That's the only
> place
> where it fits, since the tiling is known, and also the intent to access
> the buffer
> is known.
> We should not be outputting raw, tiled data in the first place and if speed
> really is necessary the detiling can be SIMD'd to speed it up
> significantly.
>
>
Do note that if one uses kmsgrab currently it will be outputting raw tiled
data only, if the underlying framebuffer is tiled. So it is not a new
behaviour, but what exists currently.

And as I had mentioned before, if we embed this logic into hwdownload, then
it can be used only when capturing using hardware context, while by keeping
the logic as a separate filter, the end user has the flexibility to use it
as they may find suitable for their situation. Also the overhead added by
the separate filter to the path is minimal.

Isn't the whole idea of unix kiss principle and piping as well as filter
chaining in the first place to have each logically independent | self
contained functionality as its own and give the user the freedom to mix and
match things the way they want for their end use. And this definitely
follows that.


>
> > NOTE1: Also as a side note, I dont think the existing logic is currently
> > fetching the format modifier of the actual frame buffer, I think it gets
> > set to NONE type by default and remains like that, unless user passes the
> > format_modifier argument, but I could be wrong in this understanding of
> > mine, as I have only gone through the code flow quickly once and also as
> I
> > am in alien territory in some sense at one level.
> >
>
> kmsgrab might not, but other APIs certainly do.
> Also, we don't top post on this mailing list.
> ___
> 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".



-- 
Keep ;-)
HanishKVC
___
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/dvbsub_parser: Don't allocate buffer separately

2020-06-29 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/dvbsub_parser.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/libavcodec/dvbsub_parser.c b/libavcodec/dvbsub_parser.c
index 8ced3c4c34..b7a3d6154c 100644
--- a/libavcodec/dvbsub_parser.c
+++ b/libavcodec/dvbsub_parser.c
@@ -35,20 +35,12 @@
 
 /* parser definition */
 typedef struct DVBSubParseContext {
-uint8_t *packet_buf;
 int packet_start;
 int packet_index;
 int in_packet;
+uint8_t packet_buf[PARSE_BUF_SIZE];
 } DVBSubParseContext;
 
-static av_cold int dvbsub_parse_init(AVCodecParserContext *s)
-{
-DVBSubParseContext *pc = s->priv_data;
-pc->packet_buf = av_malloc(PARSE_BUF_SIZE);
-
-return 0;
-}
-
 static int dvbsub_parse(AVCodecParserContext *s,
 AVCodecContext *avctx,
 const uint8_t **poutbuf, int *poutbuf_size,
@@ -173,16 +165,8 @@ static int dvbsub_parse(AVCodecParserContext *s,
 return buf_size;
 }
 
-static av_cold void dvbsub_parse_close(AVCodecParserContext *s)
-{
-DVBSubParseContext *pc = s->priv_data;
-av_freep(&pc->packet_buf);
-}
-
 AVCodecParser ff_dvbsub_parser = {
 .codec_ids  = { AV_CODEC_ID_DVB_SUBTITLE },
 .priv_data_size = sizeof(DVBSubParseContext),
-.parser_init= dvbsub_parse_init,
 .parser_parse   = dvbsub_parse,
-.parser_close   = dvbsub_parse_close,
 };
-- 
2.20.1

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

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

[FFmpeg-devel] [PATCH 3/3] avcodec/dvdsub_parser: Remove empty init function

2020-06-29 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/dvdsub_parser.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/libavcodec/dvdsub_parser.c b/libavcodec/dvdsub_parser.c
index 698ccb6987..054af69db9 100644
--- a/libavcodec/dvdsub_parser.c
+++ b/libavcodec/dvdsub_parser.c
@@ -32,11 +32,6 @@ typedef struct DVDSubParseContext {
 int packet_index;
 } DVDSubParseContext;
 
-static av_cold int dvdsub_parse_init(AVCodecParserContext *s)
-{
-return 0;
-}
-
 static int dvdsub_parse(AVCodecParserContext *s,
 AVCodecContext *avctx,
 const uint8_t **poutbuf, int *poutbuf_size,
@@ -92,7 +87,6 @@ static av_cold void dvdsub_parse_close(AVCodecParserContext 
*s)
 AVCodecParser ff_dvdsub_parser = {
 .codec_ids  = { AV_CODEC_ID_DVD_SUBTITLE },
 .priv_data_size = sizeof(DVDSubParseContext),
-.parser_init= dvdsub_parse_init,
 .parser_parse   = dvdsub_parse,
 .parser_close   = dvdsub_parse_close,
 };
-- 
2.20.1

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

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

[FFmpeg-devel] [PATCH 1/3] fate: Update fate refs after cca982ee018aad54214e94f2a0a5921c8bbf1328

2020-06-29 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
I am not sure know whether cca982ee018aad54214e94f2a0a5921c8bbf1328 is
correct or whether it should be reverted.

 tests/ref/fate/filter-colorbalance  | 6 +++---
 tests/ref/fate/filter-colorbalance-gbrap| 6 +++---
 tests/ref/fate/filter-colorbalance-gbrap-16 | 6 +++---
 tests/ref/fate/filter-colorbalance-rgba64   | 6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/ref/fate/filter-colorbalance 
b/tests/ref/fate/filter-colorbalance
index 0be1f1c855..f267da572e 100644
--- a/tests/ref/fate/filter-colorbalance
+++ b/tests/ref/fate/filter-colorbalance
@@ -3,6 +3,6 @@
 #codec_id 0: rawvideo
 #dimensions 0: 352x288
 #sar 0: 0/1
-0,  0,  0,1,   304128, 0x3451c8eb
-0,  1,  1,1,   304128, 0x2107daa0
-0,  2,  2,1,   304128, 0xcda7aa33
+0,  0,  0,1,   304128, 0xd50c9fea
+0,  1,  1,1,   304128, 0xdf9e1f79
+0,  2,  2,1,   304128, 0x9b84087e
diff --git a/tests/ref/fate/filter-colorbalance-gbrap 
b/tests/ref/fate/filter-colorbalance-gbrap
index 2e99601829..a85dc388b0 100644
--- a/tests/ref/fate/filter-colorbalance-gbrap
+++ b/tests/ref/fate/filter-colorbalance-gbrap
@@ -3,6 +3,6 @@
 #codec_id 0: rawvideo
 #dimensions 0: 352x288
 #sar 0: 0/1
-0,  0,  0,1,   405504, 0xad0f2d82
-0,  1,  1,1,   405504, 0x81d7d31f
-0,  2,  2,1,   405504, 0x40c5e836
+0,  0,  0,1,   405504, 0xd33217e5
+0,  1,  1,1,   405504, 0x08f161af
+0,  2,  2,1,   405504, 0x27508654
diff --git a/tests/ref/fate/filter-colorbalance-gbrap-16 
b/tests/ref/fate/filter-colorbalance-gbrap-16
index 4ce323557b..d18fe5a466 100644
--- a/tests/ref/fate/filter-colorbalance-gbrap-16
+++ b/tests/ref/fate/filter-colorbalance-gbrap-16
@@ -3,6 +3,6 @@
 #codec_id 0: rawvideo
 #dimensions 0: 352x288
 #sar 0: 0/1
-0,  0,  0,1,   405504, 0xa97c136c
-0,  1,  1,1,   405504, 0x0a120697
-0,  2,  2,1,   405504, 0x85b133ff
+0,  0,  0,1,   405504, 0x2e44c4b0
+0,  1,  1,1,   405504, 0xf47244e0
+0,  2,  2,1,   405504, 0x040769dd
diff --git a/tests/ref/fate/filter-colorbalance-rgba64 
b/tests/ref/fate/filter-colorbalance-rgba64
index f6fcfee250..254669ff88 100644
--- a/tests/ref/fate/filter-colorbalance-rgba64
+++ b/tests/ref/fate/filter-colorbalance-rgba64
@@ -3,6 +3,6 @@
 #codec_id 0: rawvideo
 #dimensions 0: 352x288
 #sar 0: 0/1
-0,  0,  0,1,   811008, 0xa67db91d
-0,  1,  1,1,   811008, 0x0846578a
-0,  2,  2,1,   811008, 0x77af61f8
+0,  0,  0,1,   811008, 0x42e5db8b
+0,  1,  1,1,   811008, 0x31be5974
+0,  2,  2,1,   811008, 0xdef21287
-- 
2.20.1

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

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

[FFmpeg-devel] [PATCH] configure: remove libvmaf from EXTERNAL_LIBRARY_VERSION3_LIST

2020-06-29 Thread Kyle Swanson
since libvmaf v1.5.1, libvmaf has been relicensed as BSD+Patent

Signed-off-by: Kyle Swanson 
---
 configure | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configure b/configure
index 7495f35faa..e0b76ac1ea 100755
--- a/configure
+++ b/configure
@@ -1741,7 +1741,6 @@ EXTERNAL_LIBRARY_VERSION3_LIST="
 liblensfun
 libopencore_amrnb
 libopencore_amrwb
-libvmaf
 libvo_amrwbenc
 mbedtls
 rkmpp
-- 
2.26.2

___
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] fbdetile cpu based framebuffer layout detiling v02

2020-06-29 Thread Lynne
Jun 28, 2020, 22:40 by hanish...@gmail.com:

> Hi Mark,
>
>  hwdownload vs separate filter
>
> True, for kmsgrab use-case one could potentially do this transform as part
> of the drm_transfer_data logic (which currently mmaps and does a linear
> copy, if even I remember correctly).  But like what I had mentioned in my
> previous email, as this is done on the cpu side, if one wants to capture
> very large framebuffers (say 4K or 8K at high fps), it could impact the
> performance to some extent, so in such a situation decoupling the capture
> from detiling, allows one to capture the screen at a very high resolution
> without worrying about detiling and then handle detile in a offline /
> separate pass manner.
>

I too think the filter must be done during hwdownload. That's the only place
where it fits, since the tiling is known, and also the intent to access the 
buffer
is known.
We should not be outputting raw, tiled data in the first place and if speed
really is necessary the detiling can be SIMD'd to speed it up significantly.



> NOTE1: Also as a side note, I dont think the existing logic is currently
> fetching the format modifier of the actual frame buffer, I think it gets
> set to NONE type by default and remains like that, unless user passes the
> format_modifier argument, but I could be wrong in this understanding of
> mine, as I have only gone through the code flow quickly once and also as I
> am in alien territory in some sense at one level.
>

kmsgrab might not, but other APIs certainly do.
Also, we don't top post on this mailing list.
___
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 1/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread Andreas Rheinhardt
lance.lmw...@gmail.com:
> On Mon, Jun 29, 2020 at 05:35:58PM +0200, Andreas Rheinhardt wrote:
>> lance.lmw...@gmail.com:
>>> From: Limin Wang 
>>>
>>> Signed-off-by: Limin Wang 
>>> ---
>>>  doc/APIchanges|  3 +++
>>>  libavcodec/avpacket.c |  1 +
>>>  libavcodec/decode.c   |  1 +
>>>  libavcodec/packet.h   |  6 ++
>>>  libavcodec/version.h  |  2 +-
>>>  libavformat/dump.c| 21 +
>>>  6 files changed, 33 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/doc/APIchanges b/doc/APIchanges
>>> index 1d6cc36..7cad7fa 100644
>>> --- a/doc/APIchanges
>>> +++ b/doc/APIchanges
>>> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>>>  
>>>  API changes, most recent first:
>>>  
>>> +2020-06-xx - xx - lavc 58.94.100 - packet.h
>>> +  Add AV_PKT_DATA_S12M_TIMECODE.
>>> +
>>>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
>>>Add AV_PIX_FMT_X2RGB10.
>>>  
>>> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
>>> index dce26cb..24e2a74 100644
>>> --- a/libavcodec/avpacket.c
>>> +++ b/libavcodec/avpacket.c
>>> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
>>> AVPacketSideDataType type)
>>>  case AV_PKT_DATA_PRFT:   return "Producer 
>>> Reference Time";
>>>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
>>>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
>>> configuration record";
>>> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 
>>> 12-1:2014 timecode";
>>>  }
>>>  return NULL;
>>>  }
>>> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
>>> index de9c079..f2244fc 100644
>>> --- a/libavcodec/decode.c
>>> +++ b/libavcodec/decode.c
>>> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
>>> AVFrame *frame)
>>>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
>>> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
>>>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
>>>  { AV_PKT_DATA_ICC_PROFILE,
>>> AV_FRAME_DATA_ICC_PROFILE },
>>> +{ AV_PKT_DATA_S12M_TIMECODE,  
>>> AV_FRAME_DATA_S12M_TIMECODE },
>>>  };
>>>  
>>>  if (pkt) {
>>> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
>>> index 96f237f..d84 100644
>>> --- a/libavcodec/packet.h
>>> +++ b/libavcodec/packet.h
>>> @@ -283,6 +283,12 @@ enum AVPacketSideDataType {
>>>  AV_PKT_DATA_DOVI_CONF,
>>>  
>>>  /**
>>> + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array 
>>> of 4 uint32_t
>>> + * where the first uint32_t describes how many (1-3) of the other 
>>> timecodes are used.
>>> + */
>>
>> You should move the doc to timecode.h first in a separate patch and then
>> reference the documentation here.
> 
> I'm not native English, so it's difficult for me to describe the format of 
> timecode in comments clearly.
> As it's defined in SMPTE ST 12-1:2014, so I think it's enough as it says 
> conforms to SMPTE ST 12-1:2014
> at beginning. 
> 

Could you please point me to the part of SMPTE ST 12-1:2014 that
describes the format that we use here? Because AFAIK SMPTE ST 12-1:2014
just defines what fields a SMPTE ST 12-1 message has (and what
semantics), but leaves the rest (the actual framing) to other standards:

"The actual transport of the codewords for digital systems varies
significantly from the transport methods defined for analog systems, and
is defined in the associated document, SMPTE ST 12-2."

E.g. RTP uses a different framing (see RFC 5484); obviously every
framing method used for transport must prescribe endianness of not
depend upon endianness; yet our method does. (Isn't this actually a
problem for fate-tests because framecrc calculates checksums for side date?)

>>
>>> +AV_PKT_DATA_S12M_TIMECODE,
>>> +
>>> +/**
>>>   * The number of side data types.
>>>   * This is not part of the public API/ABI in the sense that it may
>>>   * change when new side data types are added.
>>> diff --git a/libavcodec/version.h b/libavcodec/version.h
>>> index 0359302..482cc6d 100644
>>> --- a/libavcodec/version.h
>>> +++ b/libavcodec/version.h
>>> @@ -28,7 +28,7 @@
>>>  #include "libavutil/version.h"
>>>  
>>>  #define LIBAVCODEC_VERSION_MAJOR  58
>>> -#define LIBAVCODEC_VERSION_MINOR  93
>>> +#define LIBAVCODEC_VERSION_MINOR  94
>>>  #define LIBAVCODEC_VERSION_MICRO 100
>>>  
>>>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
>>> diff --git a/libavformat/dump.c b/libavformat/dump.c
>>> index 117c681..0f64c4f 100644
>>> --- a/libavformat/dump.c
>>> +++ b/libavformat/dump.c
>>> @@ -34,6 +34,7 @@
>>>  #include "libavutil/replaygain.h"
>>>  #include "libavutil/spherical.h"
>>>  #include "libavutil/stereo3d.h"
>>> +#include "libavutil/timecode.h"
>>>  
>>>  #include "avformat.h"
>>>  
>>> @@ -402,6 +403,22 @@ static void dump_dovi_conf(void *ctx, 
>>> AVPacketSideData* sd)
>>> dovi->dv_bl_signal_compatibility_id);
>>>  }

Re: [FFmpeg-devel] [PATCH 1/5] libavcodec/jpeg2000.c: Precinct size check removed

2020-06-29 Thread Gautam Ramakrishnan
On Mon, Jun 29, 2020 at 12:26 AM Michael Niedermayer
 wrote:
>
> On Sat, Jun 27, 2020 at 09:14:26PM +0530, Gautam Ramakrishnan wrote:
> > On Sat, Jun 27, 2020 at 7:36 PM Michael Niedermayer
> >  wrote:
> > >
> > > On Sat, Jun 27, 2020 at 04:49:49PM +0530, Gautam Ramakrishnan wrote:
> > > > On Sat, Jun 27, 2020 at 3:13 PM Michael Niedermayer
> > > >  wrote:
> > > > >
> > > > > On Mon, Jun 22, 2020 at 12:12:04AM +0530, gautamr...@gmail.com wrote:
> > > > > > From: Gautam Ramakrishnan 
> > > > > >
> > > > > > This patch removes a check which throws an error if
> > > > > > the log2 precinct width/height is 0. The standard allows
> > > > > > the first component to have 0 as the log2 width/height.
> > > > > > ---
> > > > > >  libavcodec/jpeg2000.c | 3 ---
> > > > > >  1 file changed, 3 deletions(-)
> > > > > >
> > > > > > diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
> > > > > > index 73206d17f3..1aca31ffa4 100644
> > > > > > --- a/libavcodec/jpeg2000.c
> > > > > > +++ b/libavcodec/jpeg2000.c
> > > > > > @@ -509,9 +509,6 @@ int 
> > > > > > ff_jpeg2000_init_component(Jpeg2000Component *comp,
> > > > > >  // update precincts size: 2^n value
> > > > > >  reslevel->log2_prec_width  = 
> > > > > > codsty->log2_prec_widths[reslevelno];
> > > > > >  reslevel->log2_prec_height = 
> > > > > > codsty->log2_prec_heights[reslevelno];
> > > > > > -if (!reslevel->log2_prec_width || 
> > > > > > !reslevel->log2_prec_height) {
> > > > > > -return AVERROR_INVALIDDATA;
> > > > > > -}
> > > > >
> > > > > This checked that log2_prec_width... has been initialized.
> > > > > Is there some other check that ensures this is not just 0 from 
> > > > > allocation
> > > > > which IIUC is not an allowed path in the spec
> > > >
> > > > A check happens only when the COD and COC marker gets read.
> > >
> > > is there a check that protects against the absence of these markers ?
> > >
> > No, there is no check for this. Now I realize that this is an
> > important check which is
> > missing. Same would apply to other compulsory markers like the SIZ marker.
> > Shall I add a check that would ensure that these markers are present before 
> > the
> > tile part data starts?
>
> yes
Looks like the check for missing SIZ marker is already there. I shall
submit a check to ensure
the coding style values are initialized.




-- 
-
Gautam |
___
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/smacker: Support seeking to first frame

2020-06-29 Thread Timotej Lazar
Andreas Rheinhardt  [2020-06-28 15:32:05+0200]:
> Moreover, I have a patchset for the Smacker demuxer [1] and you seem to
> know a lot about Smacker, so you might take a look.

Thanks for the feedback! I don’t really know much about Smacker beyond
what I discovered while trying to get rewinding to work. That said, your
patches look good to me – while working on my patch I was wondering
about several issues you addressed, such as buffering audio packets.

> In particular, I don't know if Smacker supports sparse tracks where
> the gaps between points where a track has data is filled by data
> from other tracks

The description of the “Start mixing at what frame” setting¹ leads me
to believe that all audio tracks are “complete”, padded with silence
if necessary – at least when created with RAD tools. The same page
hints that multiple audio tracks were intended to be used simply as an
alternative to having a separate video file for each language.

While there might be some program-specific extensions to do what you
describe (online docs also mention the possibility of using audio tracks
to store other data), I don’t think ffmpeg could or should support them.

> Furthermore, do you have samples with PCM data as audio?

I found no such files, the games I looked at use either smacker- or
bink-compressed audio. I was also not able to produce a file with
uncompressed audio using RAD tools. The libsmacker decoder² does what
you (and the MultimediaWiki) suggest, only reading UnpackedLength for
compressed audio tracks, so we should probably do the same.

> But in a seeking function you should perform the seek yourself, so
> that you can check whether the seek was successfull or not.

Once your patches are merged, is it OK to redo the seek patch with the
changes you suggest? Not sure if supporting only seeks to beginning is
generally considered OK for ffmpeg.

Finally, I’m not sure how to handle ring frames – the last frame of a
Smacker video can be a “ring frame”, which is visually identical to the
first frame and is intended to be used with looping videos.

Libsmacker automatically loops a video indefinitely when a ring frame is
detected, skipping the first frame on all but the first iteration. This
doesn’t seem to fit well with ffmpeg. Another option would be to seek to
the second frame (only) when rewinding from the last frame. Or we could
simply ignore the ring frame.

¹ http://www.radgametools.com/binkhmas.htm
² https://sourceforge.net/p/libsmacker/code/HEAD/tree/trunk/smacker.c#l1052
___
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] avcodec/nvenc_hevc: add a53cc option for hevc

2020-06-29 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavcodec/nvenc_hevc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index 45dda3d..6153f9a 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -132,6 +132,8 @@ static const AVOption options[] = {
 { "tc",   "Use timecode (if available)",OFFSET(tc),
   AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1,   VE },
 { "dpb_size", "Specifies the DPB size used for encoding (0 means 
automatic)",
 OFFSET(dpb_size),  
   AV_OPT_TYPE_INT,   { .i64 = 0 }, 0, INT_MAX, VE },
+{ "a53cc","Use A53 Closed Captions (if available)",
+OFFSET(a53_cc),
   AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1,   VE },
 { NULL }
 };
 
-- 
1.8.3.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 v3 1/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread lance . lmwang
On Mon, Jun 29, 2020 at 05:35:58PM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> >  doc/APIchanges|  3 +++
> >  libavcodec/avpacket.c |  1 +
> >  libavcodec/decode.c   |  1 +
> >  libavcodec/packet.h   |  6 ++
> >  libavcodec/version.h  |  2 +-
> >  libavformat/dump.c| 21 +
> >  6 files changed, 33 insertions(+), 1 deletion(-)
> > 
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index 1d6cc36..7cad7fa 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -15,6 +15,9 @@ libavutil: 2017-10-21
> >  
> >  API changes, most recent first:
> >  
> > +2020-06-xx - xx - lavc 58.94.100 - packet.h
> > +  Add AV_PKT_DATA_S12M_TIMECODE.
> > +
> >  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
> >Add AV_PIX_FMT_X2RGB10.
> >  
> > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> > index dce26cb..24e2a74 100644
> > --- a/libavcodec/avpacket.c
> > +++ b/libavcodec/avpacket.c
> > @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> > AVPacketSideDataType type)
> >  case AV_PKT_DATA_PRFT:   return "Producer 
> > Reference Time";
> >  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
> >  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> > configuration record";
> > +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 
> > 12-1:2014 timecode";
> >  }
> >  return NULL;
> >  }
> > diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> > index de9c079..f2244fc 100644
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> > @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> > AVFrame *frame)
> >  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> > AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
> >  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
> >  { AV_PKT_DATA_ICC_PROFILE,
> > AV_FRAME_DATA_ICC_PROFILE },
> > +{ AV_PKT_DATA_S12M_TIMECODE,  
> > AV_FRAME_DATA_S12M_TIMECODE },
> >  };
> >  
> >  if (pkt) {
> > diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> > index 96f237f..d84 100644
> > --- a/libavcodec/packet.h
> > +++ b/libavcodec/packet.h
> > @@ -283,6 +283,12 @@ enum AVPacketSideDataType {
> >  AV_PKT_DATA_DOVI_CONF,
> >  
> >  /**
> > + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array 
> > of 4 uint32_t
> > + * where the first uint32_t describes how many (1-3) of the other 
> > timecodes are used.
> > + */
> 
> You should move the doc to timecode.h first in a separate patch and then
> reference the documentation here.

I'm not native English, so it's difficult for me to describe the format of 
timecode in comments clearly.
As it's defined in SMPTE ST 12-1:2014, so I think it's enough as it says 
conforms to SMPTE ST 12-1:2014
at beginning. 

> 
> > +AV_PKT_DATA_S12M_TIMECODE,
> > +
> > +/**
> >   * The number of side data types.
> >   * This is not part of the public API/ABI in the sense that it may
> >   * change when new side data types are added.
> > diff --git a/libavcodec/version.h b/libavcodec/version.h
> > index 0359302..482cc6d 100644
> > --- a/libavcodec/version.h
> > +++ b/libavcodec/version.h
> > @@ -28,7 +28,7 @@
> >  #include "libavutil/version.h"
> >  
> >  #define LIBAVCODEC_VERSION_MAJOR  58
> > -#define LIBAVCODEC_VERSION_MINOR  93
> > +#define LIBAVCODEC_VERSION_MINOR  94
> >  #define LIBAVCODEC_VERSION_MICRO 100
> >  
> >  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> > diff --git a/libavformat/dump.c b/libavformat/dump.c
> > index 117c681..0f64c4f 100644
> > --- a/libavformat/dump.c
> > +++ b/libavformat/dump.c
> > @@ -34,6 +34,7 @@
> >  #include "libavutil/replaygain.h"
> >  #include "libavutil/spherical.h"
> >  #include "libavutil/stereo3d.h"
> > +#include "libavutil/timecode.h"
> >  
> >  #include "avformat.h"
> >  
> > @@ -402,6 +403,22 @@ static void dump_dovi_conf(void *ctx, 
> > AVPacketSideData* sd)
> > dovi->dv_bl_signal_compatibility_id);
> >  }
> >  
> > +static void dump_s12m_timecode(void *ctx, AVPacketSideData* sd)
> 
> * belongs to the variable, not the type.
> 
> > +{
> > +uint32_t *tc = (uint32_t*)sd->data;
> > +
> > +if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
> > +av_log(ctx, AV_LOG_ERROR, "invalid data\n");
> > +return;
> > +}
> > +
> > +for (int j = 1; j <= tc[0]; j++) {
> > +char tcbuf[AV_TIMECODE_STR_SIZE];
> > +av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
> > +av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", 
> > " : "");
> > +}
> > +}
> > +
> >  static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
> >  {
> >  int i;
> > @@ -468,6 +485,10 @@ static void dump_sidedata(void *ctx, AVStream *s

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/nvenc_hevc: add a53cc option for nvenc hevc

2020-06-29 Thread lance . lmwang
On Mon, Jun 29, 2020 at 05:26:24PM +0200, Moritz Barsnick wrote:
> On Mon, Jun 29, 2020 at 23:21:03 +0800, lance.lmw...@gmail.com wrote:
> > diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
> > index 45dda3d..6153f9a 100644
> > --- a/libavcodec/nvenc_hevc.c
> > +++ b/libavcodec/nvenc_hevc.c
> > @@ -132,6 +132,8 @@ static const AVOption options[] = {
> >  { "tc",   "Use timecode (if available)",OFFSET(tc),
> >AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1,   VE },
> >  { "dpb_size", "Specifies the DPB size used for encoding (0 means 
> > automatic)",
> >  
> > OFFSET(dpb_size), AV_OPT_TYPE_INT,   { .i64 = 0 }, 0, INT_MAX, VE },
> >   OFFSET(dpb_size), AV_OPT_TYPE_INT,   { .i64 = 0 }, 0, 
> > INT_MAX, VE },
> >  { "a53cc","Use A53 Closed Captions (if available)",
> >  
> > OFFSET(a53_cc),   AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1,   VE },
> >  { NULL }
> >  };
> 
> Are you sure this is a valid patch? It doesn't mark any changes.

yeah, I'm confusing what's happen, have used "git format-patch" recreate 
the patch and send again.

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

-- 
Thanks,
Limin Wang
___
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 1/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread Andreas Rheinhardt
lance.lmw...@gmail.com:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  doc/APIchanges|  3 +++
>  libavcodec/avpacket.c |  1 +
>  libavcodec/decode.c   |  1 +
>  libavcodec/packet.h   |  6 ++
>  libavcodec/version.h  |  2 +-
>  libavformat/dump.c| 21 +
>  6 files changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 1d6cc36..7cad7fa 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>  
>  API changes, most recent first:
>  
> +2020-06-xx - xx - lavc 58.94.100 - packet.h
> +  Add AV_PKT_DATA_S12M_TIMECODE.
> +
>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
>Add AV_PIX_FMT_X2RGB10.
>  
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index dce26cb..24e2a74 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> AVPacketSideDataType type)
>  case AV_PKT_DATA_PRFT:   return "Producer Reference 
> Time";
>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI configuration 
> record";
> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 12-1:2014 
> timecode";
>  }
>  return NULL;
>  }
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index de9c079..f2244fc 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> AVFrame *frame)
>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
>  { AV_PKT_DATA_ICC_PROFILE,AV_FRAME_DATA_ICC_PROFILE 
> },
> +{ AV_PKT_DATA_S12M_TIMECODE,  
> AV_FRAME_DATA_S12M_TIMECODE },
>  };
>  
>  if (pkt) {
> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> index 96f237f..d84 100644
> --- a/libavcodec/packet.h
> +++ b/libavcodec/packet.h
> @@ -283,6 +283,12 @@ enum AVPacketSideDataType {
>  AV_PKT_DATA_DOVI_CONF,
>  
>  /**
> + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array 
> of 4 uint32_t
> + * where the first uint32_t describes how many (1-3) of the other 
> timecodes are used.
> + */

You should move the doc to timecode.h first in a separate patch and then
reference the documentation here.

> +AV_PKT_DATA_S12M_TIMECODE,
> +
> +/**
>   * The number of side data types.
>   * This is not part of the public API/ABI in the sense that it may
>   * change when new side data types are added.
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 0359302..482cc6d 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -28,7 +28,7 @@
>  #include "libavutil/version.h"
>  
>  #define LIBAVCODEC_VERSION_MAJOR  58
> -#define LIBAVCODEC_VERSION_MINOR  93
> +#define LIBAVCODEC_VERSION_MINOR  94
>  #define LIBAVCODEC_VERSION_MICRO 100
>  
>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index 117c681..0f64c4f 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -34,6 +34,7 @@
>  #include "libavutil/replaygain.h"
>  #include "libavutil/spherical.h"
>  #include "libavutil/stereo3d.h"
> +#include "libavutil/timecode.h"
>  
>  #include "avformat.h"
>  
> @@ -402,6 +403,22 @@ static void dump_dovi_conf(void *ctx, AVPacketSideData* 
> sd)
> dovi->dv_bl_signal_compatibility_id);
>  }
>  
> +static void dump_s12m_timecode(void *ctx, AVPacketSideData* sd)

* belongs to the variable, not the type.

> +{
> +uint32_t *tc = (uint32_t*)sd->data;
> +
> +if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
> +av_log(ctx, AV_LOG_ERROR, "invalid data\n");
> +return;
> +}
> +
> +for (int j = 1; j <= tc[0]; j++) {
> +char tcbuf[AV_TIMECODE_STR_SIZE];
> +av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
> +av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", " 
> : "");
> +}
> +}
> +
>  static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
>  {
>  int i;
> @@ -468,6 +485,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const 
> char *indent)
>  av_log(ctx, AV_LOG_INFO, "DOVI configuration record: ");
>  dump_dovi_conf(ctx, &sd);
>  break;
> +case AV_PKT_DATA_S12M_TIMECODE:
> +av_log(ctx, AV_LOG_INFO, "SMPTE ST 12-1:2014: ");
> +dump_s12m_timecode(ctx, &sd);
> +break;
>  default:
>  av_log(ctx, AV_LOG_INFO,
> "unknown side data type %d (%d bytes)", sd.type, sd.size);
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@

Re: [FFmpeg-devel] [PATCH v2] avfilter: add nonlinearstretch filter.

2020-06-29 Thread Mathias Rasmussen
How do I proceed?
___
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/nvenc_hevc: add a53cc option for nvenc hevc

2020-06-29 Thread Moritz Barsnick
On Mon, Jun 29, 2020 at 23:21:03 +0800, lance.lmw...@gmail.com wrote:
> diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
> index 45dda3d..6153f9a 100644
> --- a/libavcodec/nvenc_hevc.c
> +++ b/libavcodec/nvenc_hevc.c
> @@ -132,6 +132,8 @@ static const AVOption options[] = {
>  { "tc",   "Use timecode (if available)",OFFSET(tc),  
>  AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1,   VE },
>  { "dpb_size", "Specifies the DPB size used for encoding (0 means 
> automatic)",
>  
> OFFSET(dpb_size), AV_OPT_TYPE_INT,   { .i64 = 0 }, 0, INT_MAX, VE },
>   OFFSET(dpb_size), AV_OPT_TYPE_INT,   { .i64 = 0 }, 0, INT_MAX, 
> VE },
>  { "a53cc","Use A53 Closed Captions (if available)",
>  OFFSET(a53_cc),  
>  AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1,   VE },
>  { NULL }
>  };

Are you sure this is a valid patch? It doesn't mark any changes.

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] [PATCH 1/2] avformat/dump: add a \n for end of ERROR log

2020-06-29 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavformat/dump.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 117c681..a1bf083 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -211,7 +211,7 @@ static void dump_paramchange(void *ctx, AVPacketSideData 
*sd)
 
 return;
 fail:
-av_log(ctx, AV_LOG_ERROR, "unknown param");
+av_log(ctx, AV_LOG_ERROR, "unknown param\n");
 }
 
 /* replaygain side data*/
@@ -240,7 +240,7 @@ static void dump_replaygain(void *ctx, AVPacketSideData *sd)
 AVReplayGain *rg;
 
 if (sd->size < sizeof(*rg)) {
-av_log(ctx, AV_LOG_ERROR, "invalid data");
+av_log(ctx, AV_LOG_ERROR, "invalid data\n");
 return;
 }
 rg = (AVReplayGain*)sd->data;
@@ -256,7 +256,7 @@ static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
 AVStereo3D *stereo;
 
 if (sd->size < sizeof(*stereo)) {
-av_log(ctx, AV_LOG_ERROR, "invalid data");
+av_log(ctx, AV_LOG_ERROR, "invalid data\n");
 return;
 }
 
@@ -273,7 +273,7 @@ static void dump_audioservicetype(void *ctx, 
AVPacketSideData *sd)
 enum AVAudioServiceType *ast = (enum AVAudioServiceType *)sd->data;
 
 if (sd->size < sizeof(*ast)) {
-av_log(ctx, AV_LOG_ERROR, "invalid data");
+av_log(ctx, AV_LOG_ERROR, "invalid data\n");
 return;
 }
 
@@ -316,7 +316,7 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
 AVCPBProperties *cpb = (AVCPBProperties *)sd->data;
 
 if (sd->size < sizeof(*cpb)) {
-av_log(ctx, AV_LOG_ERROR, "invalid data");
+av_log(ctx, AV_LOG_ERROR, "invalid data\n");
 return;
 }
 
@@ -365,7 +365,7 @@ static void dump_spherical(void *ctx, AVCodecParameters 
*par, AVPacketSideData *
 double yaw, pitch, roll;
 
 if (sd->size < sizeof(*spherical)) {
-av_log(ctx, AV_LOG_ERROR, "invalid data");
+av_log(ctx, AV_LOG_ERROR, "invalid data\n");
 return;
 }
 
-- 
1.8.3.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/2] avcodec/nvenc_hevc: add a53cc option for nvenc hevc

2020-06-29 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavcodec/nvenc_hevc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index 45dda3d..6153f9a 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -132,6 +132,8 @@ static const AVOption options[] = {
 { "tc",   "Use timecode (if available)",OFFSET(tc),
   AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1,   VE },
 { "dpb_size", "Specifies the DPB size used for encoding (0 means 
automatic)",
 OFFSET(dpb_size),  
   AV_OPT_TYPE_INT,   { .i64 = 0 }, 0, INT_MAX, VE },
  OFFSET(dpb_size), AV_OPT_TYPE_INT,   { .i64 = 0 }, 0, INT_MAX, VE 
},
 { "a53cc","Use A53 Closed Captions (if available)",
 OFFSET(a53_cc),
   AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1,   VE },
 { NULL }
 };
 
-- 
1.8.3.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 V2 12/12] dnn-layer-math-unary-test: add unit test for atanh

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 tests/dnn/dnn-layer-mathunary-test.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/dnn/dnn-layer-mathunary-test.c 
b/tests/dnn/dnn-layer-mathunary-test.c
index 5587e47ad5..683e623d95 100644
--- a/tests/dnn/dnn-layer-mathunary-test.c
+++ b/tests/dnn/dnn-layer-mathunary-test.c
@@ -54,6 +54,8 @@ static float get_expected(float f, DNNMathUnaryOperation op)
 return asinh(f);
 case DMUO_ACOSH:
 return acosh(f);
+case DMUO_ATANH:
+return atanh(f);
 default:
 av_assert0(!"not supported yet");
 return 0.f;
@@ -65,8 +67,8 @@ static int test(DNNMathUnaryOperation op)
 DnnLayerMathUnaryParams params;
 DnnOperand operands[2];
 int32_t input_indexes[1];
-float input[1*1*2*3] = {
--3, 2.5, 2, -2.1, 7.8, 100};
+float input[1*1*3*3] = {
+0.1, 0.5, 0.75, -3, 2.5, 2, -2.1, 7.8, 100};
 float *output;
 
 params.un_op = op;
@@ -74,7 +76,7 @@ static int test(DNNMathUnaryOperation op)
 operands[0].data = input;
 operands[0].dims[0] = 1;
 operands[0].dims[1] = 1;
-operands[0].dims[2] = 2;
+operands[0].dims[2] = 3;
 operands[0].dims[3] = 3;
 operands[1].data = NULL;
 
@@ -121,5 +123,7 @@ int main(int agrc, char **argv)
 return 1;
 if (test(DMUO_ACOSH))
 return 1;
+if (test(DMUO_ATANH))
+return 1;
 return 0;
 }
-- 
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 V2 08/12] dnn-layer-math-unary-test: add unit test for asinh

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 tests/dnn/dnn-layer-mathunary-test.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/tests/dnn/dnn-layer-mathunary-test.c 
b/tests/dnn/dnn-layer-mathunary-test.c
index 6885b4d318..90fce71a0c 100644
--- a/tests/dnn/dnn-layer-mathunary-test.c
+++ b/tests/dnn/dnn-layer-mathunary-test.c
@@ -50,6 +50,8 @@ static float get_expected(float f, DNNMathUnaryOperation op)
 return cosh(f);
 case DMUO_TANH:
 return tanh(f);
+case DMUO_ASINH:
+return asinh(f);
 default:
 av_assert0(!"not supported yet");
 return 0.f;
@@ -113,5 +115,7 @@ int main(int agrc, char **argv)
 return 1;
 if (test(DMUO_TANH))
 return 1;
+if (test(DMUO_ASINH))
+return 1;
 return 0;
 }
-- 
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 V2 07/12] dnn_backend_native_layer_mathunary: add asinh support

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 libavfilter/dnn/dnn_backend_native_layer_mathunary.c | 4 
 libavfilter/dnn/dnn_backend_native_layer_mathunary.h | 1 +
 tools/python/convert_from_tensorflow.py  | 2 +-
 tools/python/convert_header.py   | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
index ccdbcc21e0..83df98d0f8 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
@@ -116,6 +116,10 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, 
const int32_t *input_oper
 for (int i = 0; i < dims_count; ++i)
 dst[i] = tanh(src[i]);
 return 0;
+case DMUO_ASINH:
+for (int i = 0; i < dims_count; ++i)
+dst[i] = asinh(src[i]);
+return 0;
 default:
 return -1;
 }
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
index ae0c1e1cdd..fbe9af5c7d 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
@@ -40,6 +40,7 @@ typedef enum {
 DMUO_SINH = 7,
 DMUO_COSH = 8,
 DMUO_TANH = 9,
+DMUO_ASINH = 10,
 DMUO_COUNT
 } DNNMathUnaryOperation;
 
diff --git a/tools/python/convert_from_tensorflow.py 
b/tools/python/convert_from_tensorflow.py
index f98a3cae3d..0d756c8109 100644
--- a/tools/python/convert_from_tensorflow.py
+++ b/tools/python/convert_from_tensorflow.py
@@ -72,7 +72,7 @@ class TFConverter:
 self.conv2d_scopename_inputname_dict = {}
 self.op2code = {'Conv2D':1, 'DepthToSpace':2, 'MirrorPad':3, 
'Maximum':4, 'MathBinary':5, 'MathUnary':6}
 self.mathbin2code = {'Sub':0, 'Add':1, 'Mul':2, 'RealDiv':3, 
'Minimum':4}
-self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8, 'Tanh':9}
+self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8, 'Tanh':9, 'Asinh':10}
 self.mirrorpad_mode = {'CONSTANT':0, 'REFLECT':1, 'SYMMETRIC':2}
 self.name_operand_dict = {}
 
diff --git a/tools/python/convert_header.py b/tools/python/convert_header.py
index d2753f0af0..3211c13f6d 100644
--- a/tools/python/convert_header.py
+++ b/tools/python/convert_header.py
@@ -23,4 +23,4 @@ str = 'FFMPEGDNNNATIVE'
 major = 1
 
 # increase minor when we don't have to re-convert the model file
-minor = 15
+minor = 16
-- 
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 V2 11/12] dnn_backend_native_layer_mathunary: add atanh support

2020-06-29 Thread Ting Fu
It can be tested with the model generated with below python script:

import tensorflow as tf
import numpy as np
import imageio

in_img = imageio.imread('input.jpeg')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]

x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')

please uncomment the part you want to test

x_sinh_1 = tf.sinh(x)
x_out = tf.divide(x_sinh_1, 1.176) # sinh(1.0)

x_cosh_1 = tf.cosh(x)
x_out = tf.divide(x_cosh_1, 1.55) # cosh(1.0)

x_tanh_1 = tf.tanh(x)
x__out = tf.divide(x_tanh_1, 0.77) # tanh(1.0)

x_asinh_1 = tf.asinh(x)
x_out = tf.divide(x_asinh_1, 0.89) # asinh(1.0/1.1)

x_acosh_1 = tf.add(x, 1.1)
x_acosh_2 = tf.acosh(x_acosh_1) # accept (1, inf)
x_out = tf.divide(x_acosh_2, 1.4) # acosh(2.1)

x_atanh_1 = tf.divide(x, 1.1)
x_atanh_2 = tf.atanh(x_atanh_1) # accept (-1, 1)
x_out = tf.divide(x_atanh_2, 1.55) # atanhh(1.0/1.1)

y = tf.identity(x_out, name='dnn_out') #please only preserve the x_out you want 
to test

sess=tf.Session()
sess.run(tf.global_variables_initializer())

graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, 
['dnn_out'])
tf.train.write_graph(graph_def, '.', 'image_process.pb', as_text=False)

print("image_process.pb generated, please use \
path_to_ffmpeg/tools/python/convert.py to generate image_process.model\n")

output = sess.run(y, feed_dict={x: in_data})
imageio.imsave("out.jpg", np.squeeze(output))

Signed-off-by: Ting Fu 
---
 libavfilter/dnn/dnn_backend_native_layer_mathunary.c | 4 
 libavfilter/dnn/dnn_backend_native_layer_mathunary.h | 1 +
 tools/python/convert_from_tensorflow.py  | 2 +-
 tools/python/convert_header.py   | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
index b77b84a794..c83d50db64 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
@@ -124,6 +124,10 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, 
const int32_t *input_oper
 for (int i = 0; i < dims_count; ++i)
 dst[i] = acosh(src[i]);
 return 0;
+case DMUO_ATANH:
+for (int i = 0; i < dims_count; ++i)
+dst[i] = atanh(src[i]);
+return 0;
 default:
 return -1;
 }
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
index eb30231549..8076356ba4 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
@@ -42,6 +42,7 @@ typedef enum {
 DMUO_TANH = 9,
 DMUO_ASINH = 10,
 DMUO_ACOSH = 11,
+DMUO_ATANH = 12,
 DMUO_COUNT
 } DNNMathUnaryOperation;
 
diff --git a/tools/python/convert_from_tensorflow.py 
b/tools/python/convert_from_tensorflow.py
index 1e73e3aefe..85db7bf710 100644
--- a/tools/python/convert_from_tensorflow.py
+++ b/tools/python/convert_from_tensorflow.py
@@ -72,7 +72,7 @@ class TFConverter:
 self.conv2d_scopename_inputname_dict = {}
 self.op2code = {'Conv2D':1, 'DepthToSpace':2, 'MirrorPad':3, 
'Maximum':4, 'MathBinary':5, 'MathUnary':6}
 self.mathbin2code = {'Sub':0, 'Add':1, 'Mul':2, 'RealDiv':3, 
'Minimum':4}
-self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8, 'Tanh':9, 'Asinh':10, 'Acosh':11}
+self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8, 'Tanh':9, 'Asinh':10, 'Acosh':11, 
'Atanh':12}
 self.mirrorpad_mode = {'CONSTANT':0, 'REFLECT':1, 'SYMMETRIC':2}
 self.name_operand_dict = {}
 
diff --git a/tools/python/convert_header.py b/tools/python/convert_header.py
index 8fc3438552..9851d84144 100644
--- a/tools/python/convert_header.py
+++ b/tools/python/convert_header.py
@@ -23,4 +23,4 @@ str = 'FFMPEGDNNNATIVE'
 major = 1
 
 # increase minor when we don't have to re-convert the model file
-minor = 17
+minor = 18
-- 
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 V2 09/12] dnn_backend_native_layer_mathunary: add acosh support

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 libavfilter/dnn/dnn_backend_native_layer_mathunary.c | 4 
 libavfilter/dnn/dnn_backend_native_layer_mathunary.h | 1 +
 tools/python/convert_from_tensorflow.py  | 2 +-
 tools/python/convert_header.py   | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
index 83df98d0f8..b77b84a794 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
@@ -120,6 +120,10 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, 
const int32_t *input_oper
 for (int i = 0; i < dims_count; ++i)
 dst[i] = asinh(src[i]);
 return 0;
+case DMUO_ACOSH:
+for (int i = 0; i < dims_count; ++i)
+dst[i] = acosh(src[i]);
+return 0;
 default:
 return -1;
 }
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
index fbe9af5c7d..eb30231549 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
@@ -41,6 +41,7 @@ typedef enum {
 DMUO_COSH = 8,
 DMUO_TANH = 9,
 DMUO_ASINH = 10,
+DMUO_ACOSH = 11,
 DMUO_COUNT
 } DNNMathUnaryOperation;
 
diff --git a/tools/python/convert_from_tensorflow.py 
b/tools/python/convert_from_tensorflow.py
index 0d756c8109..1e73e3aefe 100644
--- a/tools/python/convert_from_tensorflow.py
+++ b/tools/python/convert_from_tensorflow.py
@@ -72,7 +72,7 @@ class TFConverter:
 self.conv2d_scopename_inputname_dict = {}
 self.op2code = {'Conv2D':1, 'DepthToSpace':2, 'MirrorPad':3, 
'Maximum':4, 'MathBinary':5, 'MathUnary':6}
 self.mathbin2code = {'Sub':0, 'Add':1, 'Mul':2, 'RealDiv':3, 
'Minimum':4}
-self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8, 'Tanh':9, 'Asinh':10}
+self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8, 'Tanh':9, 'Asinh':10, 'Acosh':11}
 self.mirrorpad_mode = {'CONSTANT':0, 'REFLECT':1, 'SYMMETRIC':2}
 self.name_operand_dict = {}
 
diff --git a/tools/python/convert_header.py b/tools/python/convert_header.py
index 3211c13f6d..8fc3438552 100644
--- a/tools/python/convert_header.py
+++ b/tools/python/convert_header.py
@@ -23,4 +23,4 @@ str = 'FFMPEGDNNNATIVE'
 major = 1
 
 # increase minor when we don't have to re-convert the model file
-minor = 16
+minor = 17
-- 
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 V2 06/12] dnn-layer-math-unary-test: add unit test for tanh

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 tests/dnn/dnn-layer-mathunary-test.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/tests/dnn/dnn-layer-mathunary-test.c 
b/tests/dnn/dnn-layer-mathunary-test.c
index 0280debc0b..6885b4d318 100644
--- a/tests/dnn/dnn-layer-mathunary-test.c
+++ b/tests/dnn/dnn-layer-mathunary-test.c
@@ -48,6 +48,8 @@ static float get_expected(float f, DNNMathUnaryOperation op)
 return sinh(f);
 case DMUO_COSH:
 return cosh(f);
+case DMUO_TANH:
+return tanh(f);
 default:
 av_assert0(!"not supported yet");
 return 0.f;
@@ -109,5 +111,7 @@ int main(int agrc, char **argv)
 return 1;
 if (test(DMUO_COSH))
 return 1;
+if (test(DMUO_TANH))
+return 1;
 return 0;
 }
-- 
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 V2 10/12] dnn-layer-math-unary-test: add unit test for acosh

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 tests/dnn/dnn-layer-mathunary-test.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/tests/dnn/dnn-layer-mathunary-test.c 
b/tests/dnn/dnn-layer-mathunary-test.c
index 90fce71a0c..5587e47ad5 100644
--- a/tests/dnn/dnn-layer-mathunary-test.c
+++ b/tests/dnn/dnn-layer-mathunary-test.c
@@ -52,6 +52,8 @@ static float get_expected(float f, DNNMathUnaryOperation op)
 return tanh(f);
 case DMUO_ASINH:
 return asinh(f);
+case DMUO_ACOSH:
+return acosh(f);
 default:
 av_assert0(!"not supported yet");
 return 0.f;
@@ -117,5 +119,7 @@ int main(int agrc, char **argv)
 return 1;
 if (test(DMUO_ASINH))
 return 1;
+if (test(DMUO_ACOSH))
+return 1;
 return 0;
 }
-- 
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 V2 05/12] dnn_backend_native_layer_mathunary: add tanh support

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 libavfilter/dnn/dnn_backend_native_layer_mathunary.c | 4 
 libavfilter/dnn/dnn_backend_native_layer_mathunary.h | 1 +
 tools/python/convert_from_tensorflow.py  | 2 +-
 tools/python/convert_header.py   | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
index ddb70996e7..ccdbcc21e0 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
@@ -112,6 +112,10 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, 
const int32_t *input_oper
 for (int i = 0; i < dims_count; ++i)
 dst[i] = cosh(src[i]);
 return 0;
+case DMUO_TANH:
+for (int i = 0; i < dims_count; ++i)
+dst[i] = tanh(src[i]);
+return 0;
 default:
 return -1;
 }
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
index 5a486b4f5f..ae0c1e1cdd 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
@@ -39,6 +39,7 @@ typedef enum {
 DMUO_ATAN = 6,
 DMUO_SINH = 7,
 DMUO_COSH = 8,
+DMUO_TANH = 9,
 DMUO_COUNT
 } DNNMathUnaryOperation;
 
diff --git a/tools/python/convert_from_tensorflow.py 
b/tools/python/convert_from_tensorflow.py
index 96da44c4a8..f98a3cae3d 100644
--- a/tools/python/convert_from_tensorflow.py
+++ b/tools/python/convert_from_tensorflow.py
@@ -72,7 +72,7 @@ class TFConverter:
 self.conv2d_scopename_inputname_dict = {}
 self.op2code = {'Conv2D':1, 'DepthToSpace':2, 'MirrorPad':3, 
'Maximum':4, 'MathBinary':5, 'MathUnary':6}
 self.mathbin2code = {'Sub':0, 'Add':1, 'Mul':2, 'RealDiv':3, 
'Minimum':4}
-self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8}
+self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8, 'Tanh':9}
 self.mirrorpad_mode = {'CONSTANT':0, 'REFLECT':1, 'SYMMETRIC':2}
 self.name_operand_dict = {}
 
diff --git a/tools/python/convert_header.py b/tools/python/convert_header.py
index a73f51ba48..d2753f0af0 100644
--- a/tools/python/convert_header.py
+++ b/tools/python/convert_header.py
@@ -23,4 +23,4 @@ str = 'FFMPEGDNNNATIVE'
 major = 1
 
 # increase minor when we don't have to re-convert the model file
-minor = 14
+minor = 15
-- 
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 V2 04/12] dnn-layer-math-unary-test: add unit test for cosh

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 tests/dnn/dnn-layer-mathunary-test.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/tests/dnn/dnn-layer-mathunary-test.c 
b/tests/dnn/dnn-layer-mathunary-test.c
index a1ff05e5fb..0280debc0b 100644
--- a/tests/dnn/dnn-layer-mathunary-test.c
+++ b/tests/dnn/dnn-layer-mathunary-test.c
@@ -46,6 +46,8 @@ static float get_expected(float f, DNNMathUnaryOperation op)
 return atan(f);
 case DMUO_SINH:
 return sinh(f);
+case DMUO_COSH:
+return cosh(f);
 default:
 av_assert0(!"not supported yet");
 return 0.f;
@@ -105,5 +107,7 @@ int main(int agrc, char **argv)
 return 1;
 if (test(DMUO_SINH))
 return 1;
+if (test(DMUO_COSH))
+return 1;
 return 0;
 }
-- 
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 V2 02/12] dnn-layer-math-unary-test: add unit test for sinh

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 tests/dnn/dnn-layer-mathunary-test.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/tests/dnn/dnn-layer-mathunary-test.c 
b/tests/dnn/dnn-layer-mathunary-test.c
index bf77c44bbe..a1ff05e5fb 100644
--- a/tests/dnn/dnn-layer-mathunary-test.c
+++ b/tests/dnn/dnn-layer-mathunary-test.c
@@ -44,6 +44,8 @@ static float get_expected(float f, DNNMathUnaryOperation op)
 return acos(f);
 case DMUO_ATAN:
 return atan(f);
+case DMUO_SINH:
+return sinh(f);
 default:
 av_assert0(!"not supported yet");
 return 0.f;
@@ -101,5 +103,7 @@ int main(int agrc, char **argv)
 return 1;
 if (test(DMUO_ATAN))
 return 1;
+if (test(DMUO_SINH))
+return 1;
 return 0;
 }
-- 
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 V2 01/12] dnn_backend_native_layer_mathunary: add sinh support

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
V2:
Add more test number
Fix incorrect atanh unit test

 libavfilter/dnn/dnn_backend_native_layer_mathunary.c | 4 
 libavfilter/dnn/dnn_backend_native_layer_mathunary.h | 1 +
 tools/python/convert_from_tensorflow.py  | 2 +-
 tools/python/convert_header.py   | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
index 42615c43d5..2630fe07e2 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
@@ -104,6 +104,10 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, 
const int32_t *input_oper
 for (int i = 0; i < dims_count; ++i)
 dst[i] = atan(src[i]);
 return 0;
+case DMUO_SINH:
+for (int i = 0; i < dims_count; ++i)
+dst[i] = sinh(src[i]);
+return 0;
 default:
 return -1;
 }
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
index 13fa33178a..760930c60e 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
@@ -37,6 +37,7 @@ typedef enum {
 DMUO_ASIN = 4,
 DMUO_ACOS = 5,
 DMUO_ATAN = 6,
+DMUO_SINH = 7,
 DMUO_COUNT
 } DNNMathUnaryOperation;
 
diff --git a/tools/python/convert_from_tensorflow.py 
b/tools/python/convert_from_tensorflow.py
index b90c31c495..6f34a71ab4 100644
--- a/tools/python/convert_from_tensorflow.py
+++ b/tools/python/convert_from_tensorflow.py
@@ -72,7 +72,7 @@ class TFConverter:
 self.conv2d_scopename_inputname_dict = {}
 self.op2code = {'Conv2D':1, 'DepthToSpace':2, 'MirrorPad':3, 
'Maximum':4, 'MathBinary':5, 'MathUnary':6}
 self.mathbin2code = {'Sub':0, 'Add':1, 'Mul':2, 'RealDiv':3, 
'Minimum':4}
-self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6}
+self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7}
 self.mirrorpad_mode = {'CONSTANT':0, 'REFLECT':1, 'SYMMETRIC':2}
 self.name_operand_dict = {}
 
diff --git a/tools/python/convert_header.py b/tools/python/convert_header.py
index 73cf23bf53..4747f41395 100644
--- a/tools/python/convert_header.py
+++ b/tools/python/convert_header.py
@@ -23,4 +23,4 @@ str = 'FFMPEGDNNNATIVE'
 major = 1
 
 # increase minor when we don't have to re-convert the model file
-minor = 12
+minor = 13
-- 
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 V2 03/12] dnn_backend_native_layer_mathunary: add cosh support

2020-06-29 Thread Ting Fu
Signed-off-by: Ting Fu 
---
 libavfilter/dnn/dnn_backend_native_layer_mathunary.c | 4 
 libavfilter/dnn/dnn_backend_native_layer_mathunary.h | 1 +
 tools/python/convert_from_tensorflow.py  | 2 +-
 tools/python/convert_header.py   | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
index 2630fe07e2..ddb70996e7 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
@@ -108,6 +108,10 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, 
const int32_t *input_oper
 for (int i = 0; i < dims_count; ++i)
 dst[i] = sinh(src[i]);
 return 0;
+case DMUO_COSH:
+for (int i = 0; i < dims_count; ++i)
+dst[i] = cosh(src[i]);
+return 0;
 default:
 return -1;
 }
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h 
b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
index 760930c60e..5a486b4f5f 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
@@ -38,6 +38,7 @@ typedef enum {
 DMUO_ACOS = 5,
 DMUO_ATAN = 6,
 DMUO_SINH = 7,
+DMUO_COSH = 8,
 DMUO_COUNT
 } DNNMathUnaryOperation;
 
diff --git a/tools/python/convert_from_tensorflow.py 
b/tools/python/convert_from_tensorflow.py
index 6f34a71ab4..96da44c4a8 100644
--- a/tools/python/convert_from_tensorflow.py
+++ b/tools/python/convert_from_tensorflow.py
@@ -72,7 +72,7 @@ class TFConverter:
 self.conv2d_scopename_inputname_dict = {}
 self.op2code = {'Conv2D':1, 'DepthToSpace':2, 'MirrorPad':3, 
'Maximum':4, 'MathBinary':5, 'MathUnary':6}
 self.mathbin2code = {'Sub':0, 'Add':1, 'Mul':2, 'RealDiv':3, 
'Minimum':4}
-self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7}
+self.mathun2code  = {'Abs':0, 'Sin':1, 'Cos':2, 'Tan':3, 'Asin':4, 
'Acos':5, 'Atan':6, 'Sinh':7, 'Cosh':8}
 self.mirrorpad_mode = {'CONSTANT':0, 'REFLECT':1, 'SYMMETRIC':2}
 self.name_operand_dict = {}
 
diff --git a/tools/python/convert_header.py b/tools/python/convert_header.py
index 4747f41395..a73f51ba48 100644
--- a/tools/python/convert_header.py
+++ b/tools/python/convert_header.py
@@ -23,4 +23,4 @@ str = 'FFMPEGDNNNATIVE'
 major = 1
 
 # increase minor when we don't have to re-convert the model file
-minor = 13
+minor = 14
-- 
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/4] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread lance . lmwang
On Mon, Jun 29, 2020 at 03:52:00PM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > On Mon, Jun 29, 2020 at 02:06:49PM +0200, Andreas Rheinhardt wrote:
> >> lance.lmw...@gmail.com:
> >>> On Mon, Jun 29, 2020 at 04:53:21AM +0200, Andreas Rheinhardt wrote:
>  lance.lmw...@gmail.com:
> > From: Limin Wang 
> >
> > Signed-off-by: Limin Wang 
> > ---
> >  doc/APIchanges|  3 +++
> >  libavcodec/avpacket.c |  1 +
> >  libavcodec/decode.c   |  1 +
> >  libavcodec/packet.h   |  8 
> >  libavcodec/version.h  |  2 +-
> >  libavformat/dump.c| 22 ++
> >  6 files changed, 36 insertions(+), 1 deletion(-)
> >
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index 1d6cc36..7cad7fa 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -15,6 +15,9 @@ libavutil: 2017-10-21
> >  
> >  API changes, most recent first:
> >  
> > +2020-06-xx - xx - lavc 58.94.100 - packet.h
> > +  Add AV_PKT_DATA_S12M_TIMECODE.
> > +
> >  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
> >Add AV_PIX_FMT_X2RGB10.
> >  
> > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> > index dce26cb..a4316a7 100644
> > --- a/libavcodec/avpacket.c
> > +++ b/libavcodec/avpacket.c
> > @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> > AVPacketSideDataType type)
> >  case AV_PKT_DATA_PRFT:   return "Producer 
> > Reference Time";
> >  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
> >  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> > configuration record";
> > +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE 12-1 
> > timecode";
> >  }
> >  return NULL;
> >  }
> > diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> > index a4e50c0..a2bf0cc 100644
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> > @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> > AVFrame *frame)
> >  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> > AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
> >  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC 
> > },
> >  { AV_PKT_DATA_ICC_PROFILE,
> > AV_FRAME_DATA_ICC_PROFILE },
> > +{ AV_PKT_DATA_S12M_TIMECODE,  
> > AV_FRAME_DATA_S12M_TIMECODE },
> >  };
> >  
> >  if (pkt) {
> > diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> > index 41485f4..72cb4f7 100644
> > --- a/libavcodec/packet.h
> > +++ b/libavcodec/packet.h
> > @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
> >  AV_PKT_DATA_DOVI_CONF,
> >  
> >  /**
> > + * Timecode which conforms to SMPTE ST 12-1. The data is an array 
> > of 4 uint32_t
> > + * where the first uint32_t describes how many (1-3) of the other 
> > timecodes are used.
> > + * The timecode format is described in the 
> > av_timecode_get_smpte_from_framenum()
> > + * function in libavutil/timecode.c.
> 
>  The format is documented in a C source file, not a public header? Sure
>  about that?
> >>>
> >>> For AV_PKT_DATA_S12M_TIMECODE use the same format with 
> >>> AV_FRAME_DATA_S12M_TIMECODE, so I copy the
> >>> comments for AV_FRAME_DATA_S12M_TIMECODE, it's not my comments for it. I 
> >>> think the format is described
> >>> in "SMPTE ST 12-2:2014" standard document, but it's not free for download.
> >>>
> >>
> >> It's SMPTE ST 12-1:2014 and this standard is currently (until 21 July)
> >> available for free [1] due to Corona.
> > 
> > oh, it's good to hear it's free due to Corona. I haven't notice it's online.
> > 
> >>
> >>> What's your suggestion to change?
> >>>
> >>
> >> The best is probably to incorporate the documentation of the format into
> >> the documentation of av_timecode_get_smpte_from_framenum.
> > OK, I'll remove the comments for the timecode format.
> >>
> 
> > + */
> > +AV_PKT_DATA_S12M_TIMECODE,
> > +
> > +/**
> >   * The number of side data types.
> >   * This is not part of the public API/ABI in the sense that it may
> >   * change when new side data types are added.
> > diff --git a/libavcodec/version.h b/libavcodec/version.h
> > index 0359302..482cc6d 100644
> > --- a/libavcodec/version.h
> > +++ b/libavcodec/version.h
> > @@ -28,7 +28,7 @@
> >  #include "libavutil/version.h"
> >  
> >  #define LIBAVCODEC_VERSION_MAJOR  58
> > -#define LIBAVCODEC_VERSION_MINOR  93
> > +#define LIBAVCODEC_VERSION_MINOR  94
> >  #define LIBAVCODEC_VERSION_MICRO 100
> >  
> >  #define LIBAVCODEC_VERSION_INT  
> > AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> > diff --

[FFmpeg-devel] [PATCH v3 1/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 doc/APIchanges|  3 +++
 libavcodec/avpacket.c |  1 +
 libavcodec/decode.c   |  1 +
 libavcodec/packet.h   |  6 ++
 libavcodec/version.h  |  2 +-
 libavformat/dump.c| 21 +
 6 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 1d6cc36..7cad7fa 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+2020-06-xx - xx - lavc 58.94.100 - packet.h
+  Add AV_PKT_DATA_S12M_TIMECODE.
+
 2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
   Add AV_PIX_FMT_X2RGB10.
 
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index dce26cb..24e2a74 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
AVPacketSideDataType type)
 case AV_PKT_DATA_PRFT:   return "Producer Reference 
Time";
 case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
 case AV_PKT_DATA_DOVI_CONF:  return "DOVI configuration 
record";
+case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 12-1:2014 
timecode";
 }
 return NULL;
 }
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index de9c079..f2244fc 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame 
*frame)
 { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
 { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
 { AV_PKT_DATA_ICC_PROFILE,AV_FRAME_DATA_ICC_PROFILE },
+{ AV_PKT_DATA_S12M_TIMECODE,  AV_FRAME_DATA_S12M_TIMECODE 
},
 };
 
 if (pkt) {
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 96f237f..d84 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -283,6 +283,12 @@ enum AVPacketSideDataType {
 AV_PKT_DATA_DOVI_CONF,
 
 /**
+ * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array of 
4 uint32_t
+ * where the first uint32_t describes how many (1-3) of the other 
timecodes are used.
+ */
+AV_PKT_DATA_S12M_TIMECODE,
+
+/**
  * The number of side data types.
  * This is not part of the public API/ABI in the sense that it may
  * change when new side data types are added.
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 0359302..482cc6d 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  58
-#define LIBAVCODEC_VERSION_MINOR  93
+#define LIBAVCODEC_VERSION_MINOR  94
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 117c681..0f64c4f 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -34,6 +34,7 @@
 #include "libavutil/replaygain.h"
 #include "libavutil/spherical.h"
 #include "libavutil/stereo3d.h"
+#include "libavutil/timecode.h"
 
 #include "avformat.h"
 
@@ -402,6 +403,22 @@ static void dump_dovi_conf(void *ctx, AVPacketSideData* sd)
dovi->dv_bl_signal_compatibility_id);
 }
 
+static void dump_s12m_timecode(void *ctx, AVPacketSideData* sd)
+{
+uint32_t *tc = (uint32_t*)sd->data;
+
+if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
+av_log(ctx, AV_LOG_ERROR, "invalid data\n");
+return;
+}
+
+for (int j = 1; j <= tc[0]; j++) {
+char tcbuf[AV_TIMECODE_STR_SIZE];
+av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
+av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", " : 
"");
+}
+}
+
 static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
 {
 int i;
@@ -468,6 +485,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const 
char *indent)
 av_log(ctx, AV_LOG_INFO, "DOVI configuration record: ");
 dump_dovi_conf(ctx, &sd);
 break;
+case AV_PKT_DATA_S12M_TIMECODE:
+av_log(ctx, AV_LOG_INFO, "SMPTE ST 12-1:2014: ");
+dump_s12m_timecode(ctx, &sd);
+break;
 default:
 av_log(ctx, AV_LOG_INFO,
"unknown side data type %d (%d bytes)", sd.type, sd.size);
-- 
1.8.3.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 v3 1/2] libavcodec/pgxdec: Add PGX decoder

2020-06-29 Thread Gautam Ramakrishnan
On Mon, Jun 29, 2020 at 2:14 AM Michael Niedermayer
 wrote:
>
> On Sun, Jun 28, 2020 at 08:13:28PM +0530, gautamr...@gmail.com wrote:
> > From: Gautam Ramakrishnan 
> >
> > This patch adds a pgx decoder.
> > ---
> >  Changelog   |   1 +
> >  doc/general.texi|   2 +
> >  libavcodec/Makefile |   1 +
> >  libavcodec/allcodecs.c  |   1 +
> >  libavcodec/codec_desc.c |   7 ++
> >  libavcodec/codec_id.h   |   1 +
> >  libavcodec/pgxdec.c | 205 
> >  libavcodec/version.h|   2 +-
> >  8 files changed, 219 insertions(+), 1 deletion(-)
> >  create mode 100644 libavcodec/pgxdec.c
> >
> > diff --git a/Changelog b/Changelog
> > index a60e7d2eb8..1bb9931c0d 100644
> > --- a/Changelog
> > +++ b/Changelog
> > @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
> >  version :
> >  - AudioToolbox output device
> >  - MacCaption demuxer
> > +- PGX decoder
> >
> >
> >  version 4.3:
> > diff --git a/doc/general.texi b/doc/general.texi
> > index ea34b963b5..53d556c56c 100644
> > --- a/doc/general.texi
> > +++ b/doc/general.texi
> > @@ -751,6 +751,8 @@ following image formats are supported:
> >  @tab Portable GrayMap image
> >  @item PGMYUV   @tab X @tab X
> >  @tab PGM with U and V components in YUV 4:2:0
> > +@item PGX  @tab   @tab X
> > +@tab PGX file decoder
> >  @item PIC  @tab @tab X
> >  @tab Pictor/PC Paint
> >  @item PNG  @tab X @tab X
> > diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> > index 5a6ea59715..12aa43fe51 100644
> > --- a/libavcodec/Makefile
> > +++ b/libavcodec/Makefile
> > @@ -536,6 +536,7 @@ OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o
> >  OBJS-$(CONFIG_PGMYUV_DECODER)  += pnmdec.o pnm.o
> >  OBJS-$(CONFIG_PGMYUV_ENCODER)  += pnmenc.o
> >  OBJS-$(CONFIG_PGSSUB_DECODER)  += pgssubdec.o
> > +OBJS-$(CONFIG_PGX_DECODER) += pgxdec.o
> >  OBJS-$(CONFIG_PICTOR_DECODER)  += pictordec.o cga_data.o
> >  OBJS-$(CONFIG_PIXLET_DECODER)  += pixlet.o
> >  OBJS-$(CONFIG_PJS_DECODER) += textdec.o ass.o
> > diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> > index fa0c08d42e..a5048290f7 100644
> > --- a/libavcodec/allcodecs.c
> > +++ b/libavcodec/allcodecs.c
> > @@ -238,6 +238,7 @@ extern AVCodec ff_pgm_encoder;
> >  extern AVCodec ff_pgm_decoder;
> >  extern AVCodec ff_pgmyuv_encoder;
> >  extern AVCodec ff_pgmyuv_decoder;
> > +extern AVCodec ff_pgx_decoder;
> >  extern AVCodec ff_pictor_decoder;
> >  extern AVCodec ff_pixlet_decoder;
> >  extern AVCodec ff_png_encoder;
> > diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> > index 9f8847544f..67e0a3055c 100644
> > --- a/libavcodec/codec_desc.c
> > +++ b/libavcodec/codec_desc.c
> > @@ -1405,6 +1405,13 @@ static const AVCodecDescriptor codec_descriptors[] = 
> > {
> >  .long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
> >  .props = AV_CODEC_PROP_LOSSY,
> >  },
> > +{
> > +.id= AV_CODEC_ID_PGX,
> > +.type  = AVMEDIA_TYPE_VIDEO,
> > +.name  = "pgx",
> > +.long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"),
> > +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
> > +},
> >  {
> >  .id= AV_CODEC_ID_Y41P,
> >  .type  = AVMEDIA_TYPE_VIDEO,
> > diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
> > index d885962c9c..896ecb0ce0 100644
> > --- a/libavcodec/codec_id.h
> > +++ b/libavcodec/codec_id.h
> > @@ -241,6 +241,7 @@ enum AVCodecID {
> >  AV_CODEC_ID_SCREENPRESSO,
> >  AV_CODEC_ID_RSCC,
> >  AV_CODEC_ID_AVS2,
> > +AV_CODEC_ID_PGX,
> >
> >  AV_CODEC_ID_Y41P = 0x8000,
> >  AV_CODEC_ID_AVRP,
> > diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c
> > new file mode 100644
> > index 00..688846f797
> > --- /dev/null
> > +++ b/libavcodec/pgxdec.c
> > @@ -0,0 +1,205 @@
> > +/*
> > + * PGX image format
> > + * Copyright (c) 2020 Gautam Ramakrishnan
> > + *
> > + * This file is part of FFmpeg.
> > + *
> > + * FFmpeg is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Lesser General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2.1 of the License, or (at your option) any later version.
> > + *
> > + * FFmpeg is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > + * Lesser General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU Lesser General Public
> > + * License along with FFmpeg; if not, write to the Free Software
> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
> > 02110-1301 USA
> > + */
> > +
> > +#include "avcodec.h"
> > +#include "internal.h"
> > +#include "bytestre

Re: [FFmpeg-devel] [PATCH 1/2] libavcodec/pgxdec: Add PGX decoder

2020-06-29 Thread Gautam Ramakrishnan
On Mon, Jun 29, 2020 at 6:28 PM Nicolas George  wrote:
>
> Gautam Ramakrishnan (12020-06-27):
> > I used 9 digits because I was using a fixed size string to store the number
> > and then used strol. Now as I removed the usage of strol, it wasnt 
> > necessary.
> > Do you thing using a loop of fixed iterations is a good idea?  Is it better 
> > if
> > I use the for loop again?
>
> You need to write it as the format demands. If there is an official
> limit on the size of the numbers, then use that. Otherwise, if it is
> possible to write the width as 0640, then
> your parser should accept that, and find another way to avoid the
> overflow. Checking for INT_MAX/10 before multiplying seems like an easy
> and obvious solution.
>
I did not think of this. I shall account for this.





-- 
-
Gautam |
___
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] RfP Candidates

2020-06-29 Thread Jean-Baptiste Kempf
Hello,

The next step in the community voting process is to re-elect the Community and 
Technical Committees.

Therefore, we need candidates.

Reminders:
The community committee is here to help smooth things down between people in 
the community and the conflicts that can arise here. The main task for the 
months to come is to create (or not) a CoC and update some of the rules of 
interactions.

The technical committee is here to entangle technical debates, when people 
cannot agree, and force a decision.
The TC is not here to define the FFmpeg roadmap or whatever, but to do 
arbitration.

We need 5 people for each.


If you are interested in being a candidate, please mail me in private (aka not 
on the list).
You can suggest another candidate, but I will validate with them if they might 
agree in the end.

You have until Wednesday 23:59 UTC to suggest candidates. Thursday starts the 
votes for 5 days.

With my kind FFregards,

-- 
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 2/4] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread lance . lmwang
On Mon, Jun 29, 2020 at 03:52:00PM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > On Mon, Jun 29, 2020 at 02:06:49PM +0200, Andreas Rheinhardt wrote:
> >> lance.lmw...@gmail.com:
> >>> On Mon, Jun 29, 2020 at 04:53:21AM +0200, Andreas Rheinhardt wrote:
>  lance.lmw...@gmail.com:
> > From: Limin Wang 
> >
> > Signed-off-by: Limin Wang 
> > ---
> >  doc/APIchanges|  3 +++
> >  libavcodec/avpacket.c |  1 +
> >  libavcodec/decode.c   |  1 +
> >  libavcodec/packet.h   |  8 
> >  libavcodec/version.h  |  2 +-
> >  libavformat/dump.c| 22 ++
> >  6 files changed, 36 insertions(+), 1 deletion(-)
> >
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index 1d6cc36..7cad7fa 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -15,6 +15,9 @@ libavutil: 2017-10-21
> >  
> >  API changes, most recent first:
> >  
> > +2020-06-xx - xx - lavc 58.94.100 - packet.h
> > +  Add AV_PKT_DATA_S12M_TIMECODE.
> > +
> >  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
> >Add AV_PIX_FMT_X2RGB10.
> >  
> > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> > index dce26cb..a4316a7 100644
> > --- a/libavcodec/avpacket.c
> > +++ b/libavcodec/avpacket.c
> > @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> > AVPacketSideDataType type)
> >  case AV_PKT_DATA_PRFT:   return "Producer 
> > Reference Time";
> >  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
> >  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> > configuration record";
> > +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE 12-1 
> > timecode";
> >  }
> >  return NULL;
> >  }
> > diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> > index a4e50c0..a2bf0cc 100644
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> > @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> > AVFrame *frame)
> >  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> > AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
> >  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC 
> > },
> >  { AV_PKT_DATA_ICC_PROFILE,
> > AV_FRAME_DATA_ICC_PROFILE },
> > +{ AV_PKT_DATA_S12M_TIMECODE,  
> > AV_FRAME_DATA_S12M_TIMECODE },
> >  };
> >  
> >  if (pkt) {
> > diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> > index 41485f4..72cb4f7 100644
> > --- a/libavcodec/packet.h
> > +++ b/libavcodec/packet.h
> > @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
> >  AV_PKT_DATA_DOVI_CONF,
> >  
> >  /**
> > + * Timecode which conforms to SMPTE ST 12-1. The data is an array 
> > of 4 uint32_t
> > + * where the first uint32_t describes how many (1-3) of the other 
> > timecodes are used.
> > + * The timecode format is described in the 
> > av_timecode_get_smpte_from_framenum()
> > + * function in libavutil/timecode.c.
> 
>  The format is documented in a C source file, not a public header? Sure
>  about that?
> >>>
> >>> For AV_PKT_DATA_S12M_TIMECODE use the same format with 
> >>> AV_FRAME_DATA_S12M_TIMECODE, so I copy the
> >>> comments for AV_FRAME_DATA_S12M_TIMECODE, it's not my comments for it. I 
> >>> think the format is described
> >>> in "SMPTE ST 12-2:2014" standard document, but it's not free for download.
> >>>
> >>
> >> It's SMPTE ST 12-1:2014 and this standard is currently (until 21 July)
> >> available for free [1] due to Corona.
> > 
> > oh, it's good to hear it's free due to Corona. I haven't notice it's online.
> > 
> >>
> >>> What's your suggestion to change?
> >>>
> >>
> >> The best is probably to incorporate the documentation of the format into
> >> the documentation of av_timecode_get_smpte_from_framenum.
> > OK, I'll remove the comments for the timecode format.
> >>
> 
> > + */
> > +AV_PKT_DATA_S12M_TIMECODE,
> > +
> > +/**
> >   * The number of side data types.
> >   * This is not part of the public API/ABI in the sense that it may
> >   * change when new side data types are added.
> > diff --git a/libavcodec/version.h b/libavcodec/version.h
> > index 0359302..482cc6d 100644
> > --- a/libavcodec/version.h
> > +++ b/libavcodec/version.h
> > @@ -28,7 +28,7 @@
> >  #include "libavutil/version.h"
> >  
> >  #define LIBAVCODEC_VERSION_MAJOR  58
> > -#define LIBAVCODEC_VERSION_MINOR  93
> > +#define LIBAVCODEC_VERSION_MINOR  94
> >  #define LIBAVCODEC_VERSION_MICRO 100
> >  
> >  #define LIBAVCODEC_VERSION_INT  
> > AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> > diff --

[FFmpeg-devel] [PATCH v2] avcodec/internal: fix the outdated comments for ff_add_cpb_side_data()

2020-06-29 Thread lance . lmwang
From: Limin Wang 

It's used for decode and encode in fact, so it's more proper to change
the encoding to codec in the comments.

Signed-off-by: Limin Wang 
---
 libavcodec/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 8771078..8705b38 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -360,7 +360,7 @@ int ff_get_format(AVCodecContext *avctx, const enum 
AVPixelFormat *fmt);
 int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame);
 
 /**
- * Add a CPB properties side data to an encoding context.
+ * Add a CPB properties side data to a codec context.
  */
 AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx);
 
-- 
1.8.3.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/4] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread Andreas Rheinhardt
lance.lmw...@gmail.com:
> On Mon, Jun 29, 2020 at 02:06:49PM +0200, Andreas Rheinhardt wrote:
>> lance.lmw...@gmail.com:
>>> On Mon, Jun 29, 2020 at 04:53:21AM +0200, Andreas Rheinhardt wrote:
 lance.lmw...@gmail.com:
> From: Limin Wang 
>
> Signed-off-by: Limin Wang 
> ---
>  doc/APIchanges|  3 +++
>  libavcodec/avpacket.c |  1 +
>  libavcodec/decode.c   |  1 +
>  libavcodec/packet.h   |  8 
>  libavcodec/version.h  |  2 +-
>  libavformat/dump.c| 22 ++
>  6 files changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 1d6cc36..7cad7fa 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>  
>  API changes, most recent first:
>  
> +2020-06-xx - xx - lavc 58.94.100 - packet.h
> +  Add AV_PKT_DATA_S12M_TIMECODE.
> +
>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
>Add AV_PIX_FMT_X2RGB10.
>  
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index dce26cb..a4316a7 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> AVPacketSideDataType type)
>  case AV_PKT_DATA_PRFT:   return "Producer 
> Reference Time";
>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> configuration record";
> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE 12-1 
> timecode";
>  }
>  return NULL;
>  }
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index a4e50c0..a2bf0cc 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> AVFrame *frame)
>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
>  { AV_PKT_DATA_ICC_PROFILE,
> AV_FRAME_DATA_ICC_PROFILE },
> +{ AV_PKT_DATA_S12M_TIMECODE,  
> AV_FRAME_DATA_S12M_TIMECODE },
>  };
>  
>  if (pkt) {
> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> index 41485f4..72cb4f7 100644
> --- a/libavcodec/packet.h
> +++ b/libavcodec/packet.h
> @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
>  AV_PKT_DATA_DOVI_CONF,
>  
>  /**
> + * Timecode which conforms to SMPTE ST 12-1. The data is an array of 
> 4 uint32_t
> + * where the first uint32_t describes how many (1-3) of the other 
> timecodes are used.
> + * The timecode format is described in the 
> av_timecode_get_smpte_from_framenum()
> + * function in libavutil/timecode.c.

 The format is documented in a C source file, not a public header? Sure
 about that?
>>>
>>> For AV_PKT_DATA_S12M_TIMECODE use the same format with 
>>> AV_FRAME_DATA_S12M_TIMECODE, so I copy the
>>> comments for AV_FRAME_DATA_S12M_TIMECODE, it's not my comments for it. I 
>>> think the format is described
>>> in "SMPTE ST 12-2:2014" standard document, but it's not free for download.
>>>
>>
>> It's SMPTE ST 12-1:2014 and this standard is currently (until 21 July)
>> available for free [1] due to Corona.
> 
> oh, it's good to hear it's free due to Corona. I haven't notice it's online.
> 
>>
>>> What's your suggestion to change?
>>>
>>
>> The best is probably to incorporate the documentation of the format into
>> the documentation of av_timecode_get_smpte_from_framenum.
> OK, I'll remove the comments for the timecode format.
>>

> + */
> +AV_PKT_DATA_S12M_TIMECODE,
> +
> +/**
>   * The number of side data types.
>   * This is not part of the public API/ABI in the sense that it may
>   * change when new side data types are added.
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 0359302..482cc6d 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -28,7 +28,7 @@
>  #include "libavutil/version.h"
>  
>  #define LIBAVCODEC_VERSION_MAJOR  58
> -#define LIBAVCODEC_VERSION_MINOR  93
> +#define LIBAVCODEC_VERSION_MINOR  94
>  #define LIBAVCODEC_VERSION_MICRO 100
>  
>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, 
> \
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index 117c681..c5f0bd6 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -34,6 +34,7 @@
>  #include "libavutil/replaygain.h"
>  #include "libavutil/spherical.h"
>  #include "libavutil/stereo3d.h"
> +#include "libavutil/timecode.h"

Re: [FFmpeg-devel] [PATCH] avcodec/internal: fix the outdating comments for ff_add_cpb_side_data()

2020-06-29 Thread lance . lmwang
On Mon, Jun 29, 2020 at 01:36:00PM +0200, Moritz Barsnick wrote:
> On Sun, Jun 28, 2020 at 20:55:08 +0800, lance.lmw...@gmail.com wrote:
> > From: Limin Wang 
> > Subject: avcodec/internal: fix the outdating comments for 
> > ff_add_cpb_side_data()
> 
> "outdated"
> 
> > - * Add a CPB properties side data to an encoding context.
> > + * Add a CPB properties side data to an codec context.
> 
> "a codec"

thanks, will update them.

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

-- 
Thanks,
Limin Wang
___
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] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread lance . lmwang
On Mon, Jun 29, 2020 at 02:06:49PM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > On Mon, Jun 29, 2020 at 04:53:21AM +0200, Andreas Rheinhardt wrote:
> >> lance.lmw...@gmail.com:
> >>> From: Limin Wang 
> >>>
> >>> Signed-off-by: Limin Wang 
> >>> ---
> >>>  doc/APIchanges|  3 +++
> >>>  libavcodec/avpacket.c |  1 +
> >>>  libavcodec/decode.c   |  1 +
> >>>  libavcodec/packet.h   |  8 
> >>>  libavcodec/version.h  |  2 +-
> >>>  libavformat/dump.c| 22 ++
> >>>  6 files changed, 36 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/doc/APIchanges b/doc/APIchanges
> >>> index 1d6cc36..7cad7fa 100644
> >>> --- a/doc/APIchanges
> >>> +++ b/doc/APIchanges
> >>> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
> >>>  
> >>>  API changes, most recent first:
> >>>  
> >>> +2020-06-xx - xx - lavc 58.94.100 - packet.h
> >>> +  Add AV_PKT_DATA_S12M_TIMECODE.
> >>> +
> >>>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
> >>>Add AV_PIX_FMT_X2RGB10.
> >>>  
> >>> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> >>> index dce26cb..a4316a7 100644
> >>> --- a/libavcodec/avpacket.c
> >>> +++ b/libavcodec/avpacket.c
> >>> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> >>> AVPacketSideDataType type)
> >>>  case AV_PKT_DATA_PRFT:   return "Producer 
> >>> Reference Time";
> >>>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
> >>>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> >>> configuration record";
> >>> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE 12-1 
> >>> timecode";
> >>>  }
> >>>  return NULL;
> >>>  }
> >>> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> >>> index a4e50c0..a2bf0cc 100644
> >>> --- a/libavcodec/decode.c
> >>> +++ b/libavcodec/decode.c
> >>> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> >>> AVFrame *frame)
> >>>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> >>> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
> >>>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
> >>>  { AV_PKT_DATA_ICC_PROFILE,
> >>> AV_FRAME_DATA_ICC_PROFILE },
> >>> +{ AV_PKT_DATA_S12M_TIMECODE,  
> >>> AV_FRAME_DATA_S12M_TIMECODE },
> >>>  };
> >>>  
> >>>  if (pkt) {
> >>> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> >>> index 41485f4..72cb4f7 100644
> >>> --- a/libavcodec/packet.h
> >>> +++ b/libavcodec/packet.h
> >>> @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
> >>>  AV_PKT_DATA_DOVI_CONF,
> >>>  
> >>>  /**
> >>> + * Timecode which conforms to SMPTE ST 12-1. The data is an array of 
> >>> 4 uint32_t
> >>> + * where the first uint32_t describes how many (1-3) of the other 
> >>> timecodes are used.
> >>> + * The timecode format is described in the 
> >>> av_timecode_get_smpte_from_framenum()
> >>> + * function in libavutil/timecode.c.
> >>
> >> The format is documented in a C source file, not a public header? Sure
> >> about that?
> > 
> > For AV_PKT_DATA_S12M_TIMECODE use the same format with 
> > AV_FRAME_DATA_S12M_TIMECODE, so I copy the
> > comments for AV_FRAME_DATA_S12M_TIMECODE, it's not my comments for it. I 
> > think the format is described
> > in "SMPTE ST 12-2:2014" standard document, but it's not free for download.
> > 
> 
> It's SMPTE ST 12-1:2014 and this standard is currently (until 21 July)
> available for free [1] due to Corona.

oh, it's good to hear it's free due to Corona. I haven't notice it's online.

> 
> > What's your suggestion to change?
> > 
> 
> The best is probably to incorporate the documentation of the format into
> the documentation of av_timecode_get_smpte_from_framenum.
OK, I'll remove the comments for the timecode format.
> 
> >>
> >>> + */
> >>> +AV_PKT_DATA_S12M_TIMECODE,
> >>> +
> >>> +/**
> >>>   * The number of side data types.
> >>>   * This is not part of the public API/ABI in the sense that it may
> >>>   * change when new side data types are added.
> >>> diff --git a/libavcodec/version.h b/libavcodec/version.h
> >>> index 0359302..482cc6d 100644
> >>> --- a/libavcodec/version.h
> >>> +++ b/libavcodec/version.h
> >>> @@ -28,7 +28,7 @@
> >>>  #include "libavutil/version.h"
> >>>  
> >>>  #define LIBAVCODEC_VERSION_MAJOR  58
> >>> -#define LIBAVCODEC_VERSION_MINOR  93
> >>> +#define LIBAVCODEC_VERSION_MINOR  94
> >>>  #define LIBAVCODEC_VERSION_MICRO 100
> >>>  
> >>>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, 
> >>> \
> >>> diff --git a/libavformat/dump.c b/libavformat/dump.c
> >>> index 117c681..c5f0bd6 100644
> >>> --- a/libavformat/dump.c
> >>> +++ b/libavformat/dump.c
> >>> @@ -34,6 +34,7 @@
> >>>  #include "libavutil/replaygain.h"
> >>>  #include "libavutil/spherical.h"
> >>>  #include "libavutil/stereo3d.h"
> >>> +#include "libavutil/timecode.h"
> >>>  
> >>>  #include "avformat.h"

[FFmpeg-devel] [PATCH 1/2] lavc/aac_ac3_parser: fix the potential overflow

2020-06-29 Thread Jun Zhao
From: Jun Zhao 

Fix the potential overflow.

Suggested-by: Alexander Strasser 
Signed-off-by: Jun Zhao 
---
 libavcodec/aac_ac3_parser.c | 9 +
 libavcodec/aac_ac3_parser.h | 4 ++--
 tests/ref/fate/adtstoasc_ticket3715 | 2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index 0746798..b26790d 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -98,11 +98,12 @@ get_next:
 }
 
 /* Calculate the average bit rate */
-s->frame_number++;
 if (avctx->codec_id != AV_CODEC_ID_EAC3) {
-avctx->bit_rate =
-(s->last_bit_rate * (s->frame_number -1) + 
s->bit_rate)/s->frame_number;
-s->last_bit_rate = avctx->bit_rate;
+if (s->frame_number < UINT64_MAX) {
+s->frame_number++;
+s->last_bit_rate += (s->bit_rate - 
s->last_bit_rate)/s->frame_number;
+avctx->bit_rate = (int64_t)llround(s->last_bit_rate);
+}
 }
 }
 
diff --git a/libavcodec/aac_ac3_parser.h b/libavcodec/aac_ac3_parser.h
index b04041f..c53d16f 100644
--- a/libavcodec/aac_ac3_parser.h
+++ b/libavcodec/aac_ac3_parser.h
@@ -55,8 +55,8 @@ typedef struct AACAC3ParseContext {
 uint64_t state;
 
 int need_next_header;
-int frame_number;
-int last_bit_rate;
+uint64_t frame_number;
+double last_bit_rate;
 enum AVCodecID codec_id;
 } AACAC3ParseContext;
 
diff --git a/tests/ref/fate/adtstoasc_ticket3715 
b/tests/ref/fate/adtstoasc_ticket3715
index 3b473ee..63e577a 100644
--- a/tests/ref/fate/adtstoasc_ticket3715
+++ b/tests/ref/fate/adtstoasc_ticket3715
@@ -1,4 +1,4 @@
-3e63cbb6bb6ec756d79fab2632fef305 *tests/data/fate/adtstoasc_ticket3715.mov
+feb8a43e4b7df2a4763bd9d55153c900 *tests/data/fate/adtstoasc_ticket3715.mov
 33324 tests/data/fate/adtstoasc_ticket3715.mov
 #extradata 0:2, 0x00340022
 #tb 0: 1/44100
-- 
2.7.4

___
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] lavfi/setpts: fix setpts/asetpts option dump error

2020-06-29 Thread Jun Zhao
From: Jun Zhao 

fix the command fmpeg -h filter=setpts/asetpts both dump the expr
option with "FVA" flags.

Signed-off-by: Jun Zhao 
---
 libavfilter/setpts.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c
index c7c3836..8547514 100644
--- a/libavfilter/setpts.c
+++ b/libavfilter/setpts.c
@@ -266,9 +266,11 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(SetPTSContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | 
AV_OPT_FLAG_FILTERING_PARAM
+#define V AV_OPT_FLAG_VIDEO_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM
+#define F AV_OPT_FLAG_FILTERING_PARAM
 static const AVOption options[] = {
-{ "expr", "Expression determining the frame timestamp", OFFSET(expr_str), 
AV_OPT_TYPE_STRING, { .str = "PTS" }, .flags = FLAGS },
+{ "expr", "Expression determining the frame timestamp", OFFSET(expr_str), 
AV_OPT_TYPE_STRING, { .str = "PTS" }, .flags = V|F },
 { NULL }
 };
 
@@ -310,7 +312,10 @@ AVFilter ff_vf_setpts = {
 
 #if CONFIG_ASETPTS_FILTER
 
-#define asetpts_options options
+static const AVOption asetpts_options[] = {
+{ "expr", "Expression determining the frame timestamp", OFFSET(expr_str), 
AV_OPT_TYPE_STRING, { .str = "PTS" }, .flags = A|F },
+{ NULL }
+};
 AVFILTER_DEFINE_CLASS(asetpts);
 
 static const AVFilterPad asetpts_inputs[] = {
-- 
2.7.4

___
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]libavfilter/asrc_atone.c : generate algorithmic music

2020-06-29 Thread Moritz Barsnick
On Thu, Jun 25, 2020 at 21:15:06 +0530, Ashutosh Pradhan wrote:
> Generate algorithmic riff music. Changed to activate api.

This commit doesn't change to activate API, as it introduces this
filter. So that sentence doesn't belong here.

>  - Real War KVAG muxer
> -
> +- atone filter

Don't remove the empty line.

>--enable-libfliteenable flite (voice synthesis) support via 
> libflite [no]
> +  --enable-libfluidsynth   enable libfluidsynth support for fluidsynth [no]

"for fluidsynth"?. Perhaps "for atone source".

>  atempo_filter_select="rdft"
> +atone_filter_deps="libfluidsynth"

> +@item sfont
> +Specify the location of soundfont file. Default value is
> +"/usr/share/sounds/sf2/FluidR3_GM.sf2"(for linux).

For Linux - and elsewhere?
It will be the same path on all Unixes, but meaningless under Windows,
I guess.

> +++ b/libavfilter/Makefile
> @@ -152,6 +152,7 @@ OBJS-$(CONFIG_FLITE_FILTER)  += 
> asrc_flite.o
>  OBJS-$(CONFIG_HILBERT_FILTER)+= asrc_hilbert.o
>  OBJS-$(CONFIG_SINC_FILTER)   += asrc_sinc.o
>  OBJS-$(CONFIG_SINE_FILTER)   += asrc_sine.o
> +OBJS-$(CONFIG_ATONE_FILTER)  += asrc_atone.o

I believe the audio sources are meant to be sorted alphabetically (by
CONFIG_*).

> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -146,6 +146,7 @@ extern AVFilter ff_asrc_flite;
>  extern AVFilter ff_asrc_hilbert;
>  extern AVFilter ff_asrc_sinc;
>  extern AVFilter ff_asrc_sine;
> +extern AVFilter ff_asrc_atone;

Same here.

> +#include 

> +s->beat_dur = 6/s->beats_pm;
> +/*get change interval in frames/sec*/
> +s->changerate = (4*s->beat_dur)*s->sample_rate/s->nb_samples;
> +if (s->changerate<1.0)
> +s->changerate = 1.0;

Please leave single spaces around the operators such as '/', '*', '<'.

> +s->numriffs = sizeof(riff)/(NPR* sizeof(int));

Same here.

> +for (int i = 0; i < s->numriffs*NPR ; i++)

And here.

> +if (s->framecount == INT_MAX)
> +   s->framecount = 0;

Indentation.

> +for (int i = 0; i < 
> sizeof(GM_instrument_list)/sizeof(GM_instrument_list[0]); i++)

Use macro FF_ARRAY_ELEMS

> +if (strcmp(GM_instrument_list[i], instrument) == 0)
> +return i;
> +
> +return 0;
> +}

If this doesn't match any string, it returns 0. It also returns 0 if it
matches "Acoustic-Grand". Is that correct? (In find_percussion_track(),
you return i instead.)

> +static void schedule_noteon(int chan, short key, unsigned int ticks, int 
> velocity, AtoneContext *s)
> +{
> +   fluid_event_t *ev = new_fluid_event();

Indentation.

> +unsigned rand = av_lfg_get(&s->r)/2;
[...]
> +riff = rand%s->numriffs;

Spaces around operators, please.

> +if (3*i < numbars)
> +return (100 - (90*i)/numbars);
> +else if (3*i > 2*numbars)
> +return (40 + (90*i)/numbars);

Same here.

> +/*Determine the pattern, tempo (to paly as 8th, 16th or 32nd notes) and add 
> the riffs to sequencer

"play"

> +Refernce: http://peterlangston.com/Papers/amc.pdf */

"Reference"

> +AVFrame *frame;
> +int  nb_samples;
  ^^ two spaces, drop one.

> +ret = ff_set_common_formats (ctx, formats);
  ^ drop the space

> +typedef struct
> +{

Bracket on the same line.

> +Refernce: http://peterlangston.com/Papers/amc.pdf */

"Reference".


Regards,
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] [PATCH 2/2] lavc/aac_ac3_parser: Cosmetics

2020-06-29 Thread Jun Zhao
From: Jun Zhao 

Signed-off-by: Jun Zhao 
---
 libavcodec/aac_ac3_parser.c | 31 +++
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index b26790d..23c60f6 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -37,37 +37,36 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1,
 int got_frame = 0;
 
 get_next:
-i=END_NOT_FOUND;
-if(s->remaining_size <= buf_size){
-if(s->remaining_size && !s->need_next_header){
-i= s->remaining_size;
+i = END_NOT_FOUND;
+if (s->remaining_size <= buf_size) {
+if (s->remaining_size && !s->need_next_header) {
+i = s->remaining_size;
 s->remaining_size = 0;
-}else{ //we need a header first
-len=0;
-for(i=s->remaining_size; iremaining_size; istate = (s->state<<8) + buf[i];
-if((len=s->sync(s->state, s, &s->need_next_header, 
&new_frame_start)))
+if ((len=s->sync(s->state, s, &s->need_next_header, 
&new_frame_start)))
 break;
 }
-if(len<=0){
-i=END_NOT_FOUND;
-}else{
+if (len <= 0) {
+i = END_NOT_FOUND;
+} else {
 got_frame = 1;
-s->state=0;
+s->state = 0;
 i-= s->header_size -1;
 s->remaining_size = len;
-if(!new_frame_start || pc->index+i<=0){
+if (!new_frame_start || pc->index+i <= 0) {
 s->remaining_size += i;
 goto get_next;
-}
-else if (i < 0) {
+} else if (i < 0) {
 s->remaining_size += i;
 }
 }
 }
 }
 
-if(ff_combine_frame(pc, i, &buf, &buf_size)<0){
+if (ff_combine_frame(pc, i, &buf, &buf_size) < 0) {
 s->remaining_size -= FFMIN(s->remaining_size, buf_size);
 *poutbuf = NULL;
 *poutbuf_size = 0;
-- 
2.7.4

___
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] libavcodec/pgxdec: Add PGX decoder

2020-06-29 Thread Nicolas George
Gautam Ramakrishnan (12020-06-27):
> I used 9 digits because I was using a fixed size string to store the number
> and then used strol. Now as I removed the usage of strol, it wasnt necessary.
> Do you thing using a loop of fixed iterations is a good idea?  Is it better if
> I use the for loop again?

You need to write it as the format demands. If there is an official
limit on the size of the numbers, then use that. Otherwise, if it is
possible to write the width as 0640, then
your parser should accept that, and find another way to avoid the
overflow. Checking for INT_MAX/10 before multiplying seems like an easy
and obvious solution.

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 2/4] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-29 Thread Andreas Rheinhardt
lance.lmw...@gmail.com:
> On Mon, Jun 29, 2020 at 04:53:21AM +0200, Andreas Rheinhardt wrote:
>> lance.lmw...@gmail.com:
>>> From: Limin Wang 
>>>
>>> Signed-off-by: Limin Wang 
>>> ---
>>>  doc/APIchanges|  3 +++
>>>  libavcodec/avpacket.c |  1 +
>>>  libavcodec/decode.c   |  1 +
>>>  libavcodec/packet.h   |  8 
>>>  libavcodec/version.h  |  2 +-
>>>  libavformat/dump.c| 22 ++
>>>  6 files changed, 36 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/doc/APIchanges b/doc/APIchanges
>>> index 1d6cc36..7cad7fa 100644
>>> --- a/doc/APIchanges
>>> +++ b/doc/APIchanges
>>> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>>>  
>>>  API changes, most recent first:
>>>  
>>> +2020-06-xx - xx - lavc 58.94.100 - packet.h
>>> +  Add AV_PKT_DATA_S12M_TIMECODE.
>>> +
>>>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
>>>Add AV_PIX_FMT_X2RGB10.
>>>  
>>> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
>>> index dce26cb..a4316a7 100644
>>> --- a/libavcodec/avpacket.c
>>> +++ b/libavcodec/avpacket.c
>>> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
>>> AVPacketSideDataType type)
>>>  case AV_PKT_DATA_PRFT:   return "Producer 
>>> Reference Time";
>>>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
>>>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
>>> configuration record";
>>> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE 12-1 
>>> timecode";
>>>  }
>>>  return NULL;
>>>  }
>>> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
>>> index a4e50c0..a2bf0cc 100644
>>> --- a/libavcodec/decode.c
>>> +++ b/libavcodec/decode.c
>>> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
>>> AVFrame *frame)
>>>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
>>> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
>>>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
>>>  { AV_PKT_DATA_ICC_PROFILE,
>>> AV_FRAME_DATA_ICC_PROFILE },
>>> +{ AV_PKT_DATA_S12M_TIMECODE,  
>>> AV_FRAME_DATA_S12M_TIMECODE },
>>>  };
>>>  
>>>  if (pkt) {
>>> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
>>> index 41485f4..72cb4f7 100644
>>> --- a/libavcodec/packet.h
>>> +++ b/libavcodec/packet.h
>>> @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
>>>  AV_PKT_DATA_DOVI_CONF,
>>>  
>>>  /**
>>> + * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 
>>> uint32_t
>>> + * where the first uint32_t describes how many (1-3) of the other 
>>> timecodes are used.
>>> + * The timecode format is described in the 
>>> av_timecode_get_smpte_from_framenum()
>>> + * function in libavutil/timecode.c.
>>
>> The format is documented in a C source file, not a public header? Sure
>> about that?
> 
> For AV_PKT_DATA_S12M_TIMECODE use the same format with 
> AV_FRAME_DATA_S12M_TIMECODE, so I copy the
> comments for AV_FRAME_DATA_S12M_TIMECODE, it's not my comments for it. I 
> think the format is described
> in "SMPTE ST 12-2:2014" standard document, but it's not free for download.
> 

It's SMPTE ST 12-1:2014 and this standard is currently (until 21 July)
available for free [1] due to Corona.

> What's your suggestion to change?
> 

The best is probably to incorporate the documentation of the format into
the documentation of av_timecode_get_smpte_from_framenum.

>>
>>> + */
>>> +AV_PKT_DATA_S12M_TIMECODE,
>>> +
>>> +/**
>>>   * The number of side data types.
>>>   * This is not part of the public API/ABI in the sense that it may
>>>   * change when new side data types are added.
>>> diff --git a/libavcodec/version.h b/libavcodec/version.h
>>> index 0359302..482cc6d 100644
>>> --- a/libavcodec/version.h
>>> +++ b/libavcodec/version.h
>>> @@ -28,7 +28,7 @@
>>>  #include "libavutil/version.h"
>>>  
>>>  #define LIBAVCODEC_VERSION_MAJOR  58
>>> -#define LIBAVCODEC_VERSION_MINOR  93
>>> +#define LIBAVCODEC_VERSION_MINOR  94
>>>  #define LIBAVCODEC_VERSION_MICRO 100
>>>  
>>>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
>>> diff --git a/libavformat/dump.c b/libavformat/dump.c
>>> index 117c681..c5f0bd6 100644
>>> --- a/libavformat/dump.c
>>> +++ b/libavformat/dump.c
>>> @@ -34,6 +34,7 @@
>>>  #include "libavutil/replaygain.h"
>>>  #include "libavutil/spherical.h"
>>>  #include "libavutil/stereo3d.h"
>>> +#include "libavutil/timecode.h"
>>>  
>>>  #include "avformat.h"
>>>  
>>> @@ -402,6 +403,23 @@ static void dump_dovi_conf(void *ctx, 
>>> AVPacketSideData* sd)
>>> dovi->dv_bl_signal_compatibility_id);
>>>  }
>>>  
>>> +static void dump_s12m_timecode(void *ctx, AVPacketSideData* sd)
>>> +{
>>> +uint32_t *tc = (uint32_t*)sd->data;
>>> +int m = tc[0] & 3;
>>> +
>>> +if (sd->size != sizeof(uint32_t) * 4) {

You already dereferenced tc before this check which might crash if the
size is actually < sizeo

Re: [FFmpeg-devel] [PATCH 2/2] libavfilter/vf_colorconstancy.c : Adding weighted greyedge

2020-06-29 Thread Moritz Barsnick
On Thu, Jun 18, 2020 at 19:22:56 +0530, Yatendra Singh wrote:
> +for(int h = slice_start; h < slice_end; h++)
> +{

Space between "for" and "(", and the opening bracket '{' goes on the
same line.

> +for(int w = 0; w < width; w++)
> +{

Same here, and elsewhere (also for "if" and "while").

> +norm_temp   = pow( 
> td->data[INDEX_DX][plane][INDX2D(h,w,width)], 2);
> +norm_temp   += pow( 
> td->data[INDEX_DY][plane][INDX2D(h,w,width)], 2);
> +norm+= sqrt( norm_temp);

No space after the function calls' opening brackets.

> +.description   = NULL_IF_CONFIG_SMALL("Estimates scene illumination by 
> grey edge assumption."),

Imperative: "Estimate".

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

Re: [FFmpeg-devel] [PATCH] avcodec: Add an SVT-AV1 encoder wrapper

2020-06-29 Thread Andreas Rheinhardt
James Almer:
> From: Daryl Seah 
> 
> Signed-off-by: Daryl Seah 
> Signed-off-by: Jing SUN 
> Signed-off-by: ZhiZhen Tang 
> Signed-off-by: Zhong Li 
> Signed-off-by: Xu Guangxin 
> Signed-off-by: James Almer 
> ---
>  configure   |   4 +
>  doc/encoders.texi   |  36 +++
>  doc/general.texi|  10 +-
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/libsvt_av1.c | 552 
>  6 files changed, 603 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/libsvt_av1.c
> 
> diff --git a/configure b/configure
> index 7495f35faa..ac69e78581 100755
> --- a/configure
> +++ b/configure
> @@ -267,6 +267,7 @@ External library support:
>--enable-libspeexenable Speex de/encoding via libspeex [no]
>--enable-libsrt  enable Haivision SRT protocol via libsrt [no]
>--enable-libssh  enable SFTP protocol via libssh [no]
> +  --enable-libsvtav1   enable AV1 encoding via SVT [no]
>--enable-libtensorflow   enable TensorFlow as a DNN module backend
> for DNN based filters like sr [no]
>--enable-libtesseractenable Tesseract, needed for ocr filter [no]
> @@ -1803,6 +1804,7 @@ EXTERNAL_LIBRARY_LIST="
>  libspeex
>  libsrt
>  libssh
> +libsvtav1
>  libtensorflow
>  libtesseract
>  libtheora
> @@ -3223,6 +3225,7 @@ libopencore_amrnb_decoder_deps="libopencore_amrnb"
>  libopencore_amrnb_encoder_deps="libopencore_amrnb"
>  libopencore_amrnb_encoder_select="audio_frame_queue"
>  libopencore_amrwb_decoder_deps="libopencore_amrwb"
> +libsvt_av1_encoder_deps="libsvtav1"
>  libopenh264_decoder_deps="libopenh264"
>  libopenh264_decoder_select="h264_mp4toannexb_bsf"
>  libopenh264_encoder_deps="libopenh264"
> @@ -6372,6 +6375,7 @@ enabled libsoxr   && require libsoxr soxr.h 
> soxr_create -lsoxr
>  enabled libssh&& require_pkg_config libssh libssh libssh/sftp.h 
> sftp_init
>  enabled libspeex  && require_pkg_config libspeex speex speex/speex.h 
> speex_decoder_init
>  enabled libsrt&& require_pkg_config libsrt "srt >= 1.3.0" 
> srt/srt.h srt_socket
> +enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 
> 0.8.4" EbSvtAv1Enc.h svt_av1_enc_init_handle
>  enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h 
> TF_Version -ltensorflow
>  enabled libtesseract  && require_pkg_config libtesseract tesseract 
> tesseract/capi.h TessBaseAPICreate
>  enabled libtheora && require libtheora theora/theoraenc.h 
> th_info_init -ltheoraenc -ltheoradec -logg
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index 17a0f4c821..4c946cf92d 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -1601,6 +1601,42 @@ useful for screen content. Default is true.
>  
>  @end table
>  
> +@section libsvt-av1
> +
> +SVT-AV1 encoder wrapper.
> +
> +Requires the presence of the SVT-AV1 headers and library during 
> configuration.
> +You need to explicitly configure the build with @code{--enable-libsvtav1}.
> +
> +@subsection Options
> +
> +@table @option
> +@item qmax
> +Sets the maximum quantizer to use when using bitrate mode.
> +
> +@item qmin
> +Sets the minimum quantizer to use when using bitrate mode.
> +
> +@item qp
> +Uses quantizer mode to encode at the given quantizer (0-63).
> +
> +@item hielevel
> +Enable scene change detection.
> +
> +@item la_depth
> +Set number of frames to look ahead (0-120).
> +
> +@item preset
> +Set encoding preset.
> +
> +@item tier
> +
> +@item tile-rows
> +Selects how many rows of tiles to encode with (0-6).
> +
> +@item tile-columns
> +Selects how many columns of tiles to encode with (0-4).
> +
>  @section libkvazaar
>  
>  Kvazaar H.265/HEVC encoder.
> diff --git a/doc/general.texi b/doc/general.texi
> index ea34b963b5..3c0d547eb4 100644
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -263,6 +263,14 @@ Go to @url{https://github.com/xiph/rav1e/} and follow 
> the instructions to build
>  the C library. To enable using rav1e in FFmpeg, pass @code{--enable-librav1e}
>  to @file{./configure}.
>  
> +@section SVT-AV1
> +
> +FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 
> encoding.
> +
> +Go to @url{https://github.com/OpenVisualCloud/SVT-AV1/} and follow the 
> instructions
> +for installing the library. Then pass @code{--enable-libsvtav1} to configure 
> to
> +enable it.
> +
>  @section TwoLAME
>  
>  FFmpeg can make use of the TwoLAME library for MP2 encoding.
> @@ -820,7 +828,7 @@ following image formats are supported:
>  @item Autodesk RLE   @tab @tab  X
>  @tab fourcc: AASC
>  @item AV1@tab  E  @tab  E
> -@tab Supported through external libraries libaom, libdav1d and librav1e
> +@tab Supported through external libraries libaom, libdav1d, librav1e and 
> libsvtav1
>  @item Avid 1:1 10-bit RGB Packer  @tab  X  @tab  X
>  @tab fourcc: AVrp
>  @item

Re: [FFmpeg-devel] [PATCH 1/2] libavfilter/vf_colorconstancy.c : Cleanup code for new filter

2020-06-29 Thread Moritz Barsnick
On Thu, Jun 18, 2020 at 19:22:55 +0530, Yatendra Singh wrote:
> +if(!strcmp(ctx->filter->name, GREY_EDGE))
> +{

Code style.
  => if (! .) {

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

Re: [FFmpeg-devel] [PATCH] avcodec/internal: fix the outdating comments for ff_add_cpb_side_data()

2020-06-29 Thread Moritz Barsnick
On Sun, Jun 28, 2020 at 20:55:08 +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> Subject: avcodec/internal: fix the outdating comments for 
> ff_add_cpb_side_data()

"outdated"

> - * Add a CPB properties side data to an encoding context.
> + * Add a CPB properties side data to an codec context.

"a codec"

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

Re: [FFmpeg-devel] [PATCH 3/3] avcodec/smacker: Add FF_CODEC_CAP_INIT_CLEANUP

2020-06-29 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/smacker.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
> index b4c463b4b9..9f054f071d 100644
> --- a/libavcodec/smacker.c
> +++ b/libavcodec/smacker.c
> @@ -600,13 +600,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
>  /* decode huffman trees from extradata */
>  if(avctx->extradata_size < 16){
>  av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n");
> -decode_end(avctx);
>  return AVERROR(EINVAL);
>  }
>  
>  ret = decode_header_trees(c);
>  if (ret < 0) {
> -decode_end(avctx);
>  return ret;
>  }
>  
> @@ -840,6 +838,7 @@ AVCodec ff_smacker_decoder = {
>  .close  = decode_end,
>  .decode = decode_frame,
>  .capabilities   = AV_CODEC_CAP_DR1,
> +.caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
>  };
>  
>  AVCodec ff_smackaud_decoder = {
> 
Will apply tomorrow unless there are objections.

- 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 v2 1/2] libavcodec/pgxdec: Add PGX decoder

2020-06-29 Thread Kieran Kunhya
On Sun, 28 Jun 2020 at 15:27, Carl Eugen Hoyos  wrote:

> Am So., 28. Juni 2020 um 16:24 Uhr schrieb Gautam Ramakrishnan
> :
>
> > Oh got it, just need to ignore the text then.
>
> You *can*
>
> Carl Eugen
>

Why are you confusing Gautam like this?
If I were new to FFmpeg and working on this I would be really confused by
the lack of clarity.

IMO just let the memcmp stay, but at least make it clear which way he
should go.

Kieran
___
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] avfilter/vf_edgedetect: properly implement double_threshold()

2020-06-29 Thread Valery Kot
On Sun, Jun 28, 2020 at 12:03 AM Andriy Gelman  wrote:
>
> lgtm. I saw a small improvement when testing.
>
> Would be nice to allow weak edges that become strong to trigger neighboring 
> weak
> edges in the future.

Thanks for the comment.

You are right, ideally double_threshold should be recursive (seed from
each "high" peak and spread over "low" peaks). But then potentially we
may end up with width*height/2 recursion depth, which may lead to
stack overflow. So probably some recursion limit is needed, and hence
suboptimal solution.

Or iterative approach, running through the complete image again and
again checking if "low" peaks are touching already selected edge
pixels. Stop when no new pixels can be added to the edge. Better, but
still potentially width*height/2 iterations with width*height
operations each, completely killing performance.

Maybe later I'll try to implement it in a generic way, but this is out
of scope for this patch.

Regards,

Valery Kot
___
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".