Re: [FFmpeg-devel] [PATCH 04/17] avformat/smoothstreaming: Forward errors from copying white/blacklists

2020-06-22 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/smoothstreamingenc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/smoothstreamingenc.c 
> b/libavformat/smoothstreamingenc.c
> index 0e4f531f90..a5fd8a18db 100644
> --- a/libavformat/smoothstreamingenc.c
> +++ b/libavformat/smoothstreamingenc.c
> @@ -333,10 +333,12 @@ static int ism_write_header(AVFormatContext *s)
>  }
>  
>  os->ctx = ctx = avformat_alloc_context();
> -if (!ctx || ff_copy_whiteblacklists(ctx, s) < 0) {
> +if (!ctx) {
>  ret = AVERROR(ENOMEM);
>  goto fail;
>  }
> +if ((ret = ff_copy_whiteblacklists(ctx, s)) < 0)
> +goto fail;
>  ctx->oformat = oformat;
>  ctx->interrupt_callback = s->interrupt_callback;
>  
> 
Ping. 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".

[FFmpeg-devel] [PATCH v2] avformat/smoothstreaming: Don't write trailer of subcontext

2020-06-22 Thread Andreas Rheinhardt
Nothing written in avformat_write_trailer() for the submuxers will be
output anyway because the AVIOContexts used for actual output have been
closed before the call. Writing the trailer of the subcontext has probably
only been done in order to free the memory allocated by the submuxer.
And this job has been taken over by the deinit functions.

Signed-off-by: Andreas Rheinhardt 
---
Resending because 82bf41f3abce4a13e7c6ad1606eb708f371de87f created a
little merge conflict.

 libavformat/smoothstreamingenc.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index eefc61d08b..6599687681 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -49,7 +49,6 @@ typedef struct Fragment {
 
 typedef struct OutputStream {
 AVFormatContext *ctx;
-int ctx_inited;
 char dirname[1024];
 uint8_t iobuf[32768];
 URLContext *out;  // Current output stream where all output is written
@@ -173,8 +172,6 @@ static void ism_free(AVFormatContext *s)
 ffurl_closep(&os->out);
 ffurl_closep(&os->out2);
 ffurl_closep(&os->tail_out);
-if (os->ctx && os->ctx_inited)
-av_write_trailer(os->ctx);
 if (os->ctx && os->ctx->pb)
 avio_context_free(&os->ctx->pb);
 avformat_free_context(os->ctx);
@@ -357,7 +354,6 @@ static int ism_write_header(AVFormatContext *s)
 if (ret < 0) {
  goto fail;
 }
-os->ctx_inited = 1;
 avio_flush(ctx->pb);
 s->streams[i]->time_base = st->time_base;
 if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
-- 
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 1/2] avformat/mvdec: Fix integer overflow with billions of channels

2020-06-22 Thread Andreas Rheinhardt
Michael Niedermayer:
> Fixes: signed integer overflow: 1394614304 * 2 cannot be represented in type 
> 'int'
> Fixes: 
> 23491/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5697377020411904
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mvdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
> index 64166a84b1..fa87384c6b 100644
> --- a/libavformat/mvdec.c
> +++ b/libavformat/mvdec.c
> @@ -355,7 +355,7 @@ static int mv_read_header(AVFormatContext *avctx)
>  avio_skip(pb, 8);
>  av_add_index_entry(ast, pos, timestamp, asize, 0, 
> AVINDEX_KEYFRAME);
>  av_add_index_entry(vst, pos + asize, i, vsize, 0, 
> AVINDEX_KEYFRAME);
> -timestamp += asize / (ast->codecpar->channels * 2);
> +timestamp += asize / (ast->codecpar->channels * 2LL);
>  }
>  } else if (!version && avio_rb16(pb) == 3) {
>  avio_skip(pb, 4);
> 
You could avoid using 64 the 64 bit intermediate by multiplying with 2U
or by using asize / ast->codecpar->channels / 2.

Whatever you prefer should also be applied to read_index.

- 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 5/5] libavcodec/jpeg2000dec.c: Remove log2_chroma check in pixel format selection

2020-06-22 Thread Gautam Ramakrishnan
On Tue, Jun 23, 2020 at 2:55 AM Carl Eugen Hoyos  wrote:
>
> Am Mo., 22. Juni 2020 um 04:57 Uhr schrieb Gautam Ramakrishnan
> :
> >
> > On Mon, Jun 22, 2020 at 1:54 AM Carl Eugen Hoyos  wrote:
> > >
> > > Am So., 21. Juni 2020 um 21:11 Uhr schrieb :
> > > >
> > > > From: Gautam Ramakrishnan 
> > > >
> > > > The log2_chroma_wh is derived from the sample separations of the
> > > > codestream if the file is a j2k codestream. Not sure if sample
> > > > separation is same is subsampling and whether using sample
> > > > separation values from the codestream to determine pixel format.
> > >
> > > What would get fixed by this change?
> > >
> > The p1_01.j2k image was not getting recognized by the native
> > decoder due to this condition.
>
> In any case, this was missing from the commit message.
>
> > It would now get recognized. If this patch is fine,
>
> I wanted to suggest to add the following two lines after
> the calls to pix_fmt_guess():
> if (s->avctx->pix_fmt == AV_PIX_FMT_NONE && ncomponents == 1)
> s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
>
I had tried this for testing initially. I placed this inside the
if (i == possible_fmts_nb) check. It seemed to work correctly.
I could possibly resend with this also, but I did not know this would
be a good solution.
> But p1_01.j2k does not get decoded with the change either here.
>
> > I would preferably remove this check at all places.
>
> I thought the check is needed but if fuzzing does not produce
> invalid memory access for you, it may be ok.
>
I'll run the fuzzer again carefully.
> Carl Eugen
> ___




-- 
-
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 3/5] libavcodec/jpeg2000dec.c Fixed WRITE_FRAME and tile co-ordinates:

2020-06-22 Thread Gautam Ramakrishnan
On Tue, Jun 23, 2020 at 2:48 AM Michael Niedermayer
 wrote:
>
> On Mon, Jun 22, 2020 at 12:12:06AM +0530, gautamr...@gmail.com wrote:
> > From: Gautam Ramakrishnan 
> >
> > libopenjpeg2000 uses ceiling division while dividing tile
> > co-ordinates with the sample separation. Also, corrections
> > were made to the WRITE_FRAME macro.
> > ---
> >  libavcodec/jpeg2000dec.c | 24 ++--
> >  1 file changed, 14 insertions(+), 10 deletions(-)
>
> is there a jpeg2000 file for which this makes a difference ?
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Awnsering whenever a program halts or runs forever is
> On a turing machine, in general impossible (turings halting problem).
> On any real computer, always possible as a real computer has a finite number
> of states N, and will either halt in less than N cycles or never halt.
> ___
> 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".

This patch was also mainly for p1_01.j2k and p1_07.j2k. I did not mention
these two files in the commit messages as it needed the pixel format selection
change to work and the files could be decoded only if that path was applied.


--
-
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] [PATCH] avcodec/cbs_h265: set default VUI parameters when vui_parameters_present_flag is false

2020-06-22 Thread James Almer
Based on cbs_h264 code.

Should fix ticket #8752.

Signed-off-by: James Almer 
---
 libavcodec/cbs_h265_syntax_template.c | 28 +++
 1 file changed, 28 insertions(+)

diff --git a/libavcodec/cbs_h265_syntax_template.c 
b/libavcodec/cbs_h265_syntax_template.c
index 5b7d1aa837..48fae82d04 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -744,6 +744,32 @@ static int FUNC(sps_scc_extension)(CodedBitstreamContext 
*ctx, RWContext *rw,
 return 0;
 }
 
+static int FUNC(vui_parameters_default)(CodedBitstreamContext *ctx,
+RWContext *rw, H265RawVUI *current,
+H265RawSPS *sps)
+{
+infer(aspect_ratio_idc, 0);
+
+infer(video_format, 5);
+infer(video_full_range_flag,0);
+infer(colour_primaries, 2);
+infer(transfer_characteristics, 2);
+infer(matrix_coefficients,  2);
+
+infer(chroma_sample_loc_type_top_field,0);
+infer(chroma_sample_loc_type_bottom_field, 0);
+
+infer(tiles_fixed_structure_flag,0);
+infer(motion_vectors_over_pic_boundaries_flag, 1);
+infer(min_spatial_segmentation_idc,  0);
+infer(max_bytes_per_pic_denom,   2);
+infer(max_bits_per_min_cu_denom, 1);
+infer(log2_max_mv_length_horizontal, 15);
+infer(log2_max_mv_length_vertical,   15);
+
+return 0;
+}
+
 static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
  H265RawSPS *current)
 {
@@ -908,6 +934,8 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext 
*rw,
 flag(vui_parameters_present_flag);
 if (current->vui_parameters_present_flag)
 CHECK(FUNC(vui_parameters)(ctx, rw, ¤t->vui, current));
+else
+CHECK(FUNC(vui_parameters_default)(ctx, rw, ¤t->vui, current));
 
 flag(sps_extension_present_flag);
 if (current->sps_extension_present_flag) {
-- 
2.27.0

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

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

[FFmpeg-devel] [PATCH 2/2] avformat/subtitles: Check for NOPTS in ff_subtitles_queue_finalize()

2020-06-22 Thread Michael Niedermayer
Fixes; signed integer overflow: 1 - -9223372036854775808 cannot be represented 
in type 'long'
Fixes: 
23490/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5133490093031424

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/subtitles.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c
index ad7f68938e..ccab80391f 100644
--- a/libavformat/subtitles.c
+++ b/libavformat/subtitles.c
@@ -202,7 +202,7 @@ void ff_subtitles_queue_finalize(void *log_ctx, 
FFDemuxSubtitlesQueue *q)
   q->sort == SUB_SORT_TS_POS ? cmp_pkt_sub_ts_pos
  : cmp_pkt_sub_pos_ts);
 for (i = 0; i < q->nb_subs; i++)
-if (q->subs[i].duration < 0 && i < q->nb_subs - 1)
+if (q->subs[i].duration < 0 && i < q->nb_subs - 1 && q->subs[i].pts != 
AV_NOPTS_VALUE)
 q->subs[i].duration = q->subs[i + 1].pts - q->subs[i].pts;
 
 if (!q->keep_duplicates)
-- 
2.17.1

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

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

[FFmpeg-devel] [PATCH 1/2] avformat/mvdec: Fix integer overflow with billions of channels

2020-06-22 Thread Michael Niedermayer
Fixes: signed integer overflow: 1394614304 * 2 cannot be represented in type 
'int'
Fixes: 
23491/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5697377020411904

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/mvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 64166a84b1..fa87384c6b 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -355,7 +355,7 @@ static int mv_read_header(AVFormatContext *avctx)
 avio_skip(pb, 8);
 av_add_index_entry(ast, pos, timestamp, asize, 0, 
AVINDEX_KEYFRAME);
 av_add_index_entry(vst, pos + asize, i, vsize, 0, 
AVINDEX_KEYFRAME);
-timestamp += asize / (ast->codecpar->channels * 2);
+timestamp += asize / (ast->codecpar->channels * 2LL);
 }
 } else if (!version && avio_rb16(pb) == 3) {
 avio_skip(pb, 4);
-- 
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 3/5] avformat/au: check return value of au_read_annotation()

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

Signed-off-by: Limin Wang 
---
 libavformat/au.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/au.c b/libavformat/au.c
index ff9176a..f92863e 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -145,6 +145,7 @@ static int au_read_header(AVFormatContext *s)
 int bps, ba = 0;
 enum AVCodecID codec;
 AVStream *st;
+int ret;
 
 tag = avio_rl32(pb);
 if (tag != MKTAG('.', 's', 'n', 'd'))
@@ -163,7 +164,9 @@ static int au_read_header(AVFormatContext *s)
 
 if (size > 24) {
 /* parse annotation field to get metadata */
-au_read_annotation(s, size - 24);
+ret = au_read_annotation(s, size - 24);
+if (ret < 0)
+return ret;
 }
 
 codec = ff_codec_get_id(codec_au_tags, id);
-- 
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/6] avformat/ftp: check return value of av_bprint_finalize()

2020-06-22 Thread lance . lmwang
On Mon, Jun 22, 2020 at 11:08:23PM +0200, Marton Balint wrote:
> 
> 
> On Mon, 22 Jun 2020, lance.lmw...@gmail.com wrote:
> 
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> > libavformat/ftp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/ftp.c b/libavformat/ftp.c
> > index caeea42..39ea297 100644
> > --- a/libavformat/ftp.c
> > +++ b/libavformat/ftp.c
> > @@ -200,7 +200,7 @@ static int ftp_status(FTPContext *s, char **line, const 
> > int response_codes[])
> > }
> > 
> > if (line)
> > -av_bprint_finalize(&line_buffer, line);
> > +result = av_bprint_finalize(&line_buffer, line);
> 
> No. ftp_status is not a function which returns 0 on success, it returns the
> FTP status code. Please be more careful before submitting patches.

Sorry, please ignore the patch. I'm not clear how to map the error so I'll not
update the patch anyore.

> 
> Regards,
> Marton
> ___
> 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 4/6] avformat/au: check return value of au_read_annotation()

2020-06-22 Thread lance . lmwang
On Mon, Jun 22, 2020 at 11:15:12PM +0200, Marton Balint wrote:
> 
> 
> On Mon, 22 Jun 2020, lance.lmw...@gmail.com wrote:
> 
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> > libavformat/au.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/au.c b/libavformat/au.c
> > index ff9176a..b6df63e 100644
> > --- a/libavformat/au.c
> > +++ b/libavformat/au.c
> > @@ -145,6 +145,7 @@ static int au_read_header(AVFormatContext *s)
> > int bps, ba = 0;
> > enum AVCodecID codec;
> > AVStream *st;
> > +int ret;
> > 
> > tag = avio_rl32(pb);
> > if (tag != MKTAG('.', 's', 'n', 'd'))
> > @@ -163,7 +164,8 @@ static int au_read_header(AVFormatContext *s)
> > 
> > if (size > 24) {
> > /* parse annotation field to get metadata */
> > -au_read_annotation(s, size - 24);
> > +if (ret = au_read_annotation(s, size - 24) < 0)
> 
> Use two lines for the assignment and the check, otherwise sooner or later
> you will make an operator precedence mistake.

thanks, will fix it.


> 
> Regards,
> Marton
> 
> > +return ret;
> > }
> > 
> > codec = ff_codec_get_id(codec_au_tags, id);
> > -- 
> > 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 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] lavc/hevc: set correct chroma location

2020-06-22 Thread Hendrik Leppkes
On Tue, Jun 23, 2020 at 12:02 AM Steinar H. Gunderson
 wrote:
>
> HEVC is left chroma like H.264, so add the proper location on init.
>
> Signed-off-by: Steinar H. Gunderson 
> ---
>  libavcodec/hevcdec.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index c9e28f5826..3306cf3702 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -3534,6 +3534,8 @@ static av_cold int hevc_decode_init(AVCodecContext 
> *avctx)
>  else
>  s->threads_type = FF_THREAD_SLICE;
>
> +avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
> +

This is not correct. The chroma location can vary and is signaled in
the bitstream.

I actually send a patch to the ML a while back to do this properly,
but apparently it slipped through the cracks. I'll revive it.

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

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

[FFmpeg-devel] [PATCH] lavc/hevc: set correct chroma location

2020-06-22 Thread Steinar H. Gunderson
HEVC is left chroma like H.264, so add the proper location on init.

Signed-off-by: Steinar H. Gunderson 
---
 libavcodec/hevcdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index c9e28f5826..3306cf3702 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3534,6 +3534,8 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
 else
 s->threads_type = FF_THREAD_SLICE;
 
+avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
+
 return 0;
 }
 
-- 
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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Carl Eugen Hoyos
Am Mo., 22. Juni 2020 um 20:44 Uhr schrieb Gautam Ramakrishnan
:

> Another issue is that as the .pgx format is tightly linked to JPEG2000,
> how could the format be restricted to conversions between j2k and jp2
> files only?

For the sake of this discussion, pgx has absolutely nothing to do with
j2k, and the decoder you suggested to create can especially not be
used to do any conversion from or to j2k or jp2, it can only be used
to read pgx files (I am all for unusual formats in FFmpeg but an
encoder for this format seems of little value).

> For example, the pgx header contains a field called signed, which
> indicates whether the component values are signed or unsigned.

Yes, and when implementing the decoder you have to keep this
field in mind.

> This seems very specific to jpeg2000 and would not probably
> allow conversion from pgx to other formats directly.

No, that's not correct / ask again when you get to a point where this
is an issue.

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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Carl Eugen Hoyos
Am Mo., 22. Juni 2020 um 20:08 Uhr schrieb Gautam Ramakrishnan
:
>
> On Mon, Jun 22, 2020 at 11:30 PM Carl Eugen Hoyos  wrote:
> >
> > Am Mo., 22. Juni 2020 um 19:40 Uhr schrieb Gautam Ramakrishnan
> > :
> > >
> > > On Mon, Jun 22, 2020 at 8:07 PM Carl Eugen Hoyos  
> > > wrote:
> > > >
> > > >
> > > >
> > > > > Am 22.06.2020 um 12:42 schrieb Moritz Barsnick :
> > > > >
> > > > >> On Mon, Jun 22, 2020 at 12:47:11 +0530, Gautam Ramakrishnan wrote:
> > > > >> On Mon, Jun 22, 2020 at 12:38 PM Carl Eugen Hoyos 
> > > > >>  wrote:
> > > >  Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan 
> > > >  :
> > > >  JPEG2000 uses .pgx format for conformance testing. Is it a good 
> > > >  idea
> > > >  to allow the ffmpeg native decoder to have an option to dump .pgx 
> > > >  files?
> > > > >>> I believe it would be more useful if FFmpeg could read pgx files.
> > > > >> So could a new Codec be created for reading and writing pgx files?
> > > > >
> > > > > Actually, probably a very simple demuxer/muxer, as the payload seems
> > > > > to be uncompressed/raw.
> > > >
> > > > Most likely a decoder as for pnm or tga.
> >
> > > I shall work on this. The format seems really simple. However,
> > > how do I make the encoder write multiple files and the decoder
> > > read multiple files? Each component would map to one .pgx file.
> >
> > You only read one of the files at a time, the extractplanes filter can
> > be used to compare the content.

> So what you mean to say is if I am given say 3 pgx files for r g and b
> components respectively, the decoder would not decode all of them into
> one image. But as this is a testing format and only for conformance testing,
> that should not be an issue?

(Please cut the mailing list footer from your quotes)

Let's not overengineer reading a format that has very little use.

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 2/5] libavcodec/jpeg2000dec.c: Modify image dimensions

2020-06-22 Thread Carl Eugen Hoyos
Am Mo., 22. Juni 2020 um 23:32 Uhr schrieb Michael Niedermayer
:
>
> On Mon, Jun 22, 2020 at 12:12:05AM +0530, gautamr...@gmail.com wrote:
> > From: Gautam Ramakrishnan 
> >
> > Reduce image size of the image if all components have
> > a non zero sample separation. This is to replicate the
> > output of opj_decompress.
> > ---
> >  libavcodec/jpeg2000dec.c | 19 ++-
> >  1 file changed, 14 insertions(+), 5 deletions(-)
> >
> > diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
> > index ab36009a2d..05e85f4317 100644
> > --- a/libavcodec/jpeg2000dec.c
> > +++ b/libavcodec/jpeg2000dec.c
> > @@ -269,6 +269,8 @@ static int get_siz(Jpeg2000DecoderContext *s)
> >  const enum AVPixelFormat *possible_fmts = NULL;
> >  int possible_fmts_nb = 0;
> >  int ret;
> > +int o_dimx, o_dimy; //original image dimensions.
> > +int dimx, dimy;
> >
> >  if (bytestream2_get_bytes_left(&s->g) < 36) {
> >  av_log(s->avctx, AV_LOG_ERROR, "Insufficient space for SIZ\n");
> > @@ -371,11 +373,18 @@ static int get_siz(Jpeg2000DecoderContext *s)
> >  }
> >
> >  /* compute image size with reduction factor */
> > -ret = ff_set_dimensions(s->avctx,
> > -ff_jpeg2000_ceildivpow2(s->width  - s->image_offset_x,
> > -   s->reduction_factor),
> > -ff_jpeg2000_ceildivpow2(s->height - s->image_offset_y,
> > -   s->reduction_factor));
> > +o_dimx = ff_jpeg2000_ceildivpow2(s->width  - s->image_offset_x,
> > +   s->reduction_factor);
> > +o_dimy = ff_jpeg2000_ceildivpow2(s->height - s->image_offset_y,
> > +   s->reduction_factor);
> > +dimx = ff_jpeg2000_ceildiv(o_dimx, s->cdx[0]);
> > +dimy = ff_jpeg2000_ceildiv(o_dimy, s->cdy[0]);
> > +for (i = 1; i < s->ncomponents; i++) {
> > +dimx = FFMAX(dimx, ff_jpeg2000_ceildiv(o_dimx, s->cdx[i]));
> > +dimy = FFMAX(dimy, ff_jpeg2000_ceildiv(o_dimy, s->cdy[i]));
> > +}
> > +
> > +ret = ff_set_dimensions(s->avctx, dimx, dimy);
> >  if (ret < 0)
> >  return ret;
>
> I think the resolution, the pixel format and any odd-format-handling
> code probably need to be adjusted together.
> Changing just the dimension code to select a higher resolution when
> chroma or alpha planes are of higher resolution then luma. Will
> probably not work if there is neither a pixel format selected that
> represents that nor code to compensate for this (as mjpeg does)
> but i might be missing something
>
> is there some testcase this fixes or improves ?

At least p1_01.j2k which has one component.

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 2/5] libavcodec/jpeg2000dec.c: Modify image dimensions

2020-06-22 Thread Michael Niedermayer
On Mon, Jun 22, 2020 at 12:12:05AM +0530, gautamr...@gmail.com wrote:
> From: Gautam Ramakrishnan 
> 
> Reduce image size of the image if all components have
> a non zero sample separation. This is to replicate the
> output of opj_decompress.
> ---
>  libavcodec/jpeg2000dec.c | 19 ++-
>  1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
> index ab36009a2d..05e85f4317 100644
> --- a/libavcodec/jpeg2000dec.c
> +++ b/libavcodec/jpeg2000dec.c
> @@ -269,6 +269,8 @@ static int get_siz(Jpeg2000DecoderContext *s)
>  const enum AVPixelFormat *possible_fmts = NULL;
>  int possible_fmts_nb = 0;
>  int ret;
> +int o_dimx, o_dimy; //original image dimensions.
> +int dimx, dimy;
>  
>  if (bytestream2_get_bytes_left(&s->g) < 36) {
>  av_log(s->avctx, AV_LOG_ERROR, "Insufficient space for SIZ\n");
> @@ -371,11 +373,18 @@ static int get_siz(Jpeg2000DecoderContext *s)
>  }
>  
>  /* compute image size with reduction factor */
> -ret = ff_set_dimensions(s->avctx,
> -ff_jpeg2000_ceildivpow2(s->width  - s->image_offset_x,
> -   s->reduction_factor),
> -ff_jpeg2000_ceildivpow2(s->height - s->image_offset_y,
> -   s->reduction_factor));
> +o_dimx = ff_jpeg2000_ceildivpow2(s->width  - s->image_offset_x,
> +   s->reduction_factor);
> +o_dimy = ff_jpeg2000_ceildivpow2(s->height - s->image_offset_y,
> +   s->reduction_factor);
> +dimx = ff_jpeg2000_ceildiv(o_dimx, s->cdx[0]);
> +dimy = ff_jpeg2000_ceildiv(o_dimy, s->cdy[0]);
> +for (i = 1; i < s->ncomponents; i++) {
> +dimx = FFMAX(dimx, ff_jpeg2000_ceildiv(o_dimx, s->cdx[i]));
> +dimy = FFMAX(dimy, ff_jpeg2000_ceildiv(o_dimy, s->cdy[i]));
> +}
> +
> +ret = ff_set_dimensions(s->avctx, dimx, dimy);
>  if (ret < 0)
>  return ret;

I think the resolution, the pixel format and any odd-format-handling
code probably need to be adjusted together.
Changing just the dimension code to select a higher resolution when
chroma or alpha planes are of higher resolution then luma. Will
probably not work if there is neither a pixel format selected that
represents that nor code to compensate for this (as mjpeg does)
but i might be missing something

is there some testcase this fixes or improves ?

thx

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

No great genius has ever existed without some touch of madness. -- Aristotle


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

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

Re: [FFmpeg-devel] [PATCH 4/5] libavcodec/jpeg2000dec.c: Enable image offsets

2020-06-22 Thread Carl Eugen Hoyos
Am Mo., 22. Juni 2020 um 23:16 Uhr schrieb Michael Niedermayer
:
>
> On Mon, Jun 22, 2020 at 12:12:07AM +0530, gautamr...@gmail.com wrote:
> > From: Gautam Ramakrishnan 
> >
> > This patch enables support for image offsets.
> > ---
> >  libavcodec/jpeg2000dec.c | 4 
> >  1 file changed, 4 deletions(-)
>
> Is there a testcase for this ? (a file using this)

p1_01.j2k (one component) and p1_07.j2k (which has two different components)

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 5/5] libavcodec/jpeg2000dec.c: Remove log2_chroma check in pixel format selection

2020-06-22 Thread Carl Eugen Hoyos
Am Mo., 22. Juni 2020 um 04:57 Uhr schrieb Gautam Ramakrishnan
:
>
> On Mon, Jun 22, 2020 at 1:54 AM Carl Eugen Hoyos  wrote:
> >
> > Am So., 21. Juni 2020 um 21:11 Uhr schrieb :
> > >
> > > From: Gautam Ramakrishnan 
> > >
> > > The log2_chroma_wh is derived from the sample separations of the
> > > codestream if the file is a j2k codestream. Not sure if sample
> > > separation is same is subsampling and whether using sample
> > > separation values from the codestream to determine pixel format.
> >
> > What would get fixed by this change?
> >
> The p1_01.j2k image was not getting recognized by the native
> decoder due to this condition.

In any case, this was missing from the commit message.

> It would now get recognized. If this patch is fine,

I wanted to suggest to add the following two lines after
the calls to pix_fmt_guess():
if (s->avctx->pix_fmt == AV_PIX_FMT_NONE && ncomponents == 1)
s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;

But p1_01.j2k does not get decoded with the change either here.

> I would preferably remove this check at all places.

I thought the check is needed but if fuzzing does not produce
invalid memory access for you, it may be ok.

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 3/5] libavcodec/jpeg2000dec.c Fixed WRITE_FRAME and tile co-ordinates:

2020-06-22 Thread Michael Niedermayer
On Mon, Jun 22, 2020 at 12:12:06AM +0530, gautamr...@gmail.com wrote:
> From: Gautam Ramakrishnan 
> 
> libopenjpeg2000 uses ceiling division while dividing tile
> co-ordinates with the sample separation. Also, corrections
> were made to the WRITE_FRAME macro.
> ---
>  libavcodec/jpeg2000dec.c | 24 ++--
>  1 file changed, 14 insertions(+), 10 deletions(-)

is there a jpeg2000 file for which this makes a difference ?

thx

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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

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

Re: [FFmpeg-devel] [PATCH 4/5] libavcodec/jpeg2000dec.c: Enable image offsets

2020-06-22 Thread Michael Niedermayer
On Mon, Jun 22, 2020 at 12:12:07AM +0530, gautamr...@gmail.com wrote:
> From: Gautam Ramakrishnan 
> 
> This patch enables support for image offsets.
> ---
>  libavcodec/jpeg2000dec.c | 4 
>  1 file changed, 4 deletions(-)

Is there a testcase for this ? (a file using this)

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


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

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

Re: [FFmpeg-devel] [PATCH 4/6] avformat/au: check return value of au_read_annotation()

2020-06-22 Thread Marton Balint



On Mon, 22 Jun 2020, lance.lmw...@gmail.com wrote:


From: Limin Wang 

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

diff --git a/libavformat/au.c b/libavformat/au.c
index ff9176a..b6df63e 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -145,6 +145,7 @@ static int au_read_header(AVFormatContext *s)
int bps, ba = 0;
enum AVCodecID codec;
AVStream *st;
+int ret;

tag = avio_rl32(pb);
if (tag != MKTAG('.', 's', 'n', 'd'))
@@ -163,7 +164,8 @@ static int au_read_header(AVFormatContext *s)

if (size > 24) {
/* parse annotation field to get metadata */
-au_read_annotation(s, size - 24);
+if (ret = au_read_annotation(s, size - 24) < 0)


Use two lines for the assignment and the check, otherwise sooner or later 
you will make an operator precedence mistake.


Regards,
Marton


+return ret;
}

codec = ff_codec_get_id(codec_au_tags, id);
--
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 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/6] avformat/ftp: check return value of av_bprint_finalize()

2020-06-22 Thread Marton Balint



On Mon, 22 Jun 2020, lance.lmw...@gmail.com wrote:


From: Limin Wang 

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

diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index caeea42..39ea297 100644
--- a/libavformat/ftp.c
+++ b/libavformat/ftp.c
@@ -200,7 +200,7 @@ static int ftp_status(FTPContext *s, char **line, const int 
response_codes[])
}

if (line)
-av_bprint_finalize(&line_buffer, line);
+result = av_bprint_finalize(&line_buffer, line);


No. ftp_status is not a function which returns 0 on success, it returns 
the FTP status code. Please be more careful before submitting patches.


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

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

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

2020-06-22 Thread Mathias Rasmussen
On Mon, Jun 22, 2020 at 10:35 PM Michael Niedermayer 
wrote:

> the test does not succeed, maybe you forgot to include the ref file in the
> patch
>

Yes, you are correct, is it supposed to be an empty file?
I'm not sure my test case really works though, is there a way to see the
results of the test?
___
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/jpeg2000dec.c: Remove log2_chroma check in pixel format selection

2020-06-22 Thread Michael Niedermayer
On Mon, Jun 22, 2020 at 12:14:39AM +0530, Gautam Ramakrishnan wrote:
> On Mon, Jun 22, 2020 at 12:12 AM  wrote:
> >
> > From: Gautam Ramakrishnan 
> >
> > The log2_chroma_wh is derived from the sample separations of the
> > codestream if the file is a j2k codestream. Not sure if sample
> > separation is same is subsampling and whether using sample
> > separation values from the codestream to determine pixel format.
> > ---
> >  libavcodec/jpeg2000dec.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
> > index c8c89803ac..2b9659bf96 100644
> > --- a/libavcodec/jpeg2000dec.c
> > +++ b/libavcodec/jpeg2000dec.c
> > @@ -225,8 +225,6 @@ static int pix_fmt_match(enum AVPixelFormat pix_fmt, 
> > int components,
> >
> >  case 1:
> >  match = match && desc->comp[0].depth >= bpc &&
> > - (log2_chroma_wh >>  2 & 3) == 0 &&
> > - (log2_chroma_wh   & 3) == 0 &&
> >   (desc->flags & AV_PIX_FMT_FLAG_PAL) == pal8 * 
> > AV_PIX_FMT_FLAG_PAL;
> >  }
> >  return match;
> > --
> > 2.17.1
> >
> This patch has to be discussed. I do not see any other formats having
> a check like this,

see pix_fmt_id in mjpegdec.c


> but that is probably because the pixel format is determined from the
> headers and not
> from the codestream.

If the removed check was wrong then i suspect more changes are needed
and just removing this alone will not be correct

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

There will always be a question for which you do not know the correct answer.


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] avfilter: add nonlinearstretch filter.

2020-06-22 Thread Michael Niedermayer
On Mon, Jun 22, 2020 at 12:47:30AM +0200, Mathias Rasmussen wrote:
> ---
> Hi there! First time contributor here.
> 
> I've made a filter for performing nonlinear stretching of videos,
> also known as dynamic stretch and similar to GoPro's SuperView.
> 
> I left some questions as TODO's in the code that I hope you can help me 
> answer.
> Also, how do you run the test or see the output? I seem to just get empty 
> files.
> 
> This is also my first time using git through a mailing list 
> so please let me know if I'm doing something wierd. Thanks! :)
> 
>  Changelog |   1 +
>  doc/filters.texi  |  34 
>  libavfilter/Makefile  |   1 +
>  libavfilter/allfilters.c  |   1 +
>  libavfilter/version.h |   2 +-
>  libavfilter/vf_nonlinearstretch.c | 268 ++
>  tests/fate/filter-video.mak   |   3 +
>  7 files changed, 309 insertions(+), 1 deletion(-)
>  create mode 100644 libavfilter/vf_nonlinearstretch.c

the test does not succeed, maybe you forgot to include the ref file in the
patch

reference file './tests/ref/fate/filter-nonlinearstretch' not found
./tests/fate-run.sh: 539: ./tests/fate-run.sh: cannot open 
tests/data/fate/filter-nonlinearstretch.diff: No such file
TESTfilter-pp1
Test filter-nonlinearstretch failed. Look at 
tests/data/fate/filter-nonlinearstretch.err for details.
tests/Makefile:255: recipe for target 'fate-filter-nonlinearstretch' failed
make: *** [fate-filter-nonlinearstretch] Error 1
make: *** Waiting for unfinished jobs




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

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 


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

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

Re: [FFmpeg-devel] [RFC PATCH] libavcodec/jpeg2000: Make corrections jpeg2000 decoder

2020-06-22 Thread Michael Niedermayer
On Sun, Jun 21, 2020 at 10:55:24PM +0530, Gautam Ramakrishnan wrote:
> On Sat, Jun 20, 2020 at 9:48 AM Gautam Ramakrishnan
>  wrote:
> >
> > On Sat, Jun 20, 2020 at 1:29 AM Michael Niedermayer
> >  wrote:
> > >
> > > On Thu, Jun 18, 2020 at 11:55:20PM +0530, gautamr...@gmail.com wrote:
> > > > From: Gautam Ramakrishnan 
> > > >
> > > > This is with reference to my previous email on the mailing list
> > > > with subject: "query on pixel formats".
> > > > I wish to cleanup some errors in the decoder code. These changes
> > > > would allow the samples p1_01.j2k and p1_07.j2k to be decoded.
> > > > However, I am facing issues with pixel format selection and have
> > > > currently forced the pixel formats to demonstrate the changes made.
> > > > Would be grateful if anyone could suggest modifications to the pix
> > > > format selection.
> > > > ---
> > > >  libavcodec/jpeg2000.c|  3 ---
> > > >  libavcodec/jpeg2000dec.c | 53 ++--
> > > >  2 files changed, 34 insertions(+), 22 deletions(-)
> > >
> > > Its probably a good idea to run this through some fuzzer when checks are
> > > removed, something really simple like zzuf is probably better than nothing
> > >
> > Yes, I shall do that.
> > > thx
> > >
> > > [...]
> > > --
> > > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> > >
> > > I know you won't believe me, but the highest form of Human Excellence is
> > > to question oneself and others. -- Socrates
> > > ___
> > > 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".
> >
> >
> >
> > --
> > -
> > Gautam |
> 
> When trying to perform fuzz testing, what kind of configuration would
> you recommend using.
> For example, I am taking some of the reference files and setting the
> error rate to 0.01. Is that sufficient?

i tried zzuf with defaults before writing my suggestion and it spotted
segfaults rather quickly, but i dont know if these segfaults where
related to these changes

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

Re: [FFmpeg-devel] Support for dumping pgx for JPEG2000

2020-06-22 Thread Gautam Ramakrishnan
On Mon, Jun 22, 2020 at 11:37 PM Gautam Ramakrishnan
 wrote:
>
> On Mon, Jun 22, 2020 at 11:30 PM Carl Eugen Hoyos  wrote:
> >
> > Am Mo., 22. Juni 2020 um 19:40 Uhr schrieb Gautam Ramakrishnan
> > :
> > >
> > > On Mon, Jun 22, 2020 at 8:07 PM Carl Eugen Hoyos  
> > > wrote:
> > > >
> > > >
> > > >
> > > > > Am 22.06.2020 um 12:42 schrieb Moritz Barsnick :
> > > > >
> > > > >> On Mon, Jun 22, 2020 at 12:47:11 +0530, Gautam Ramakrishnan wrote:
> > > > >> On Mon, Jun 22, 2020 at 12:38 PM Carl Eugen Hoyos 
> > > > >>  wrote:
> > > >  Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan 
> > > >  :
> > > >  JPEG2000 uses .pgx format for conformance testing. Is it a good 
> > > >  idea
> > > >  to allow the ffmpeg native decoder to have an option to dump .pgx 
> > > >  files?
> > > > >>> I believe it would be more useful if FFmpeg could read pgx files.
> > > > >> So could a new Codec be created for reading and writing pgx files?
> > > > >
> > > > > Actually, probably a very simple demuxer/muxer, as the payload seems
> > > > > to be uncompressed/raw.
> > > >
> > > > Most likely a decoder as for pnm or tga.
> >
> > > I shall work on this. The format seems really simple. However,
> > > how do I make the encoder write multiple files and the decoder
> > > read multiple files? Each component would map to one .pgx file.
> >
> > You only read one of the files at a time, the extractplanes filter can
> > be used to compare the content.
> >
> > 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".
>
> So what you mean to say is if I am given say 3 pgx files for r g and b
> components respectively, the decoder would not decode all of them into
> one image. But as this is a testing format and only for conformance testing,
> that should not be an issue?
>
> --
> -
> Gautam |

Another issue is that as the .pgx format is tightly linked to JPEG2000,
how could the format be restricted to conversions between j2k and jp2
files only?
For example, the pgx header contains a field called signed, which
indicates whether
the component values are signed or unsigned. This seems very specific
to jpeg2000
and would not probably allow conversion from pgx to other formats directly.

-- 
-
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] avfilter: add nonlinearstretch filter.

2020-06-22 Thread Mathias Rasmussen
On Mon, Jun 22, 2020 at 6:35 PM Paul B Mahol  wrote:

> I simply looked at youtube videos and images, as I never trust their
> documentation.
>

Okay, but that's what I meant by SuperView.
It's difficult to discuss beyond what is documented.

The filter is not for public.
>

In that case, I would still prefer this filter to be merged since there is
no alternative?
The FFmpeg docs recommend submitting filters to this mailing list,
and while I don't have much experience with the codebase I can guarantee
that
this is not the filter that's the most "limited in functionality".

To be honest I'm quite surprised I have to compete with a filter that's not
even public.
If it's that hard to get a filter merged you should update your docs, and
preferably provide better support for third-party filters.
___
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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Gautam Ramakrishnan
On Mon, Jun 22, 2020 at 11:30 PM Carl Eugen Hoyos  wrote:
>
> Am Mo., 22. Juni 2020 um 19:40 Uhr schrieb Gautam Ramakrishnan
> :
> >
> > On Mon, Jun 22, 2020 at 8:07 PM Carl Eugen Hoyos  wrote:
> > >
> > >
> > >
> > > > Am 22.06.2020 um 12:42 schrieb Moritz Barsnick :
> > > >
> > > >> On Mon, Jun 22, 2020 at 12:47:11 +0530, Gautam Ramakrishnan wrote:
> > > >> On Mon, Jun 22, 2020 at 12:38 PM Carl Eugen Hoyos  
> > > >> wrote:
> > >  Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan 
> > >  :
> > >  JPEG2000 uses .pgx format for conformance testing. Is it a good idea
> > >  to allow the ffmpeg native decoder to have an option to dump .pgx 
> > >  files?
> > > >>> I believe it would be more useful if FFmpeg could read pgx files.
> > > >> So could a new Codec be created for reading and writing pgx files?
> > > >
> > > > Actually, probably a very simple demuxer/muxer, as the payload seems
> > > > to be uncompressed/raw.
> > >
> > > Most likely a decoder as for pnm or tga.
>
> > I shall work on this. The format seems really simple. However,
> > how do I make the encoder write multiple files and the decoder
> > read multiple files? Each component would map to one .pgx file.
>
> You only read one of the files at a time, the extractplanes filter can
> be used to compare the content.
>
> 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".

So what you mean to say is if I am given say 3 pgx files for r g and b
components respectively, the decoder would not decode all of them into
one image. But as this is a testing format and only for conformance testing,
that should not be an issue?

-- 
-
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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Carl Eugen Hoyos
Am Mo., 22. Juni 2020 um 19:40 Uhr schrieb Gautam Ramakrishnan
:
>
> On Mon, Jun 22, 2020 at 8:07 PM Carl Eugen Hoyos  wrote:
> >
> >
> >
> > > Am 22.06.2020 um 12:42 schrieb Moritz Barsnick :
> > >
> > >> On Mon, Jun 22, 2020 at 12:47:11 +0530, Gautam Ramakrishnan wrote:
> > >> On Mon, Jun 22, 2020 at 12:38 PM Carl Eugen Hoyos  
> > >> wrote:
> >  Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan 
> >  :
> >  JPEG2000 uses .pgx format for conformance testing. Is it a good idea
> >  to allow the ffmpeg native decoder to have an option to dump .pgx 
> >  files?
> > >>> I believe it would be more useful if FFmpeg could read pgx files.
> > >> So could a new Codec be created for reading and writing pgx files?
> > >
> > > Actually, probably a very simple demuxer/muxer, as the payload seems
> > > to be uncompressed/raw.
> >
> > Most likely a decoder as for pnm or tga.

> I shall work on this. The format seems really simple. However,
> how do I make the encoder write multiple files and the decoder
> read multiple files? Each component would map to one .pgx file.

You only read one of the files at a time, the extractplanes filter can
be used to compare the content.

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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Gautam Ramakrishnan
On Mon, Jun 22, 2020 at 8:07 PM Carl Eugen Hoyos  wrote:
>
>
>
> > Am 22.06.2020 um 12:42 schrieb Moritz Barsnick :
> >
> >> On Mon, Jun 22, 2020 at 12:47:11 +0530, Gautam Ramakrishnan wrote:
> >> On Mon, Jun 22, 2020 at 12:38 PM Carl Eugen Hoyos  
> >> wrote:
>  Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan 
>  :
>  JPEG2000 uses .pgx format for conformance testing. Is it a good idea
>  to allow the ffmpeg native decoder to have an option to dump .pgx files?
> >>> I believe it would be more useful if FFmpeg could read pgx files.
> >> So could a new Codec be created for reading and writing pgx files?
> >
> > Actually, probably a very simple demuxer/muxer, as the payload seems
> > to be uncompressed/raw.
>
> Most likely a decoder as for pnm or tga.
>
> 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".

I shall work on this. The format seems really simple. However,
how do I make the encoder write multiple files and the decoder
read multiple files? Each component would map to one .pgx file.

-- 
-
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] avfilter: add nonlinearstretch filter.

2020-06-22 Thread Paul B Mahol
On 6/22/20, Mathias Rasmussen  wrote:
> On 22 Jun 2020, at 15.57, Paul B Mahol  wrote:
>>
>> I really doubt that this filter have anything to do with GoPro's
>> SuperView.
>> GoPro's SuperView, unlike this filter, extends FOV of currently
>> recording video with real data.
>
> Please see https://community.gopro.com/t5/en/What-is-SuperView/ta-p/390201
> ,
> I fail to see how this is not nearly identical to what this filter does, so
> please enlighten me if i’m wrong.
> I don’t know what you mean by “real data” but i’m very interested if you
> have information of GoPro using other data than the 4:3 sensor image.
> Also, are you saying this filter cannot be used on “currently recording
> video”? It's not really the intention, but I don’t see why not?
>

I simply looked at youtube videos and images, as I never trust their
documentation.

>> Also this filter is very limited in functionality. I already have
>> another generic warp filter
>> that can do this and much more.
>
>
> That’s great, do you have an example of how to use it for achieving this
> type of stretching?

The filter is not for public.
___
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 5/6] avformat/hlsenc: use proper error codes

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

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

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 71fa3db..f7a4f30 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -370,6 +370,7 @@ static int replace_str_data_in_filename(char **s, const 
char *filename, char pla
 int addchar_count;
 int found_count = 0;
 AVBPrint buf;
+int ret;
 
 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
 
@@ -395,10 +396,10 @@ static int replace_str_data_in_filename(char **s, const 
char *filename, char pla
 }
 if (!av_bprint_is_complete(&buf)) {
 av_bprint_finalize(&buf, NULL);
-return -1;
+return AVERROR(ENOMEM);
 }
-if (av_bprint_finalize(&buf, &new_filename) < 0 || !new_filename)
-return -1;
+if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
+return ret;
 *s = new_filename;
 return found_count;
 }
@@ -411,6 +412,7 @@ static int replace_int_data_in_filename(char **s, const 
char *filename, char pla
 int nd, addchar_count;
 int found_count = 0;
 AVBPrint buf;
+int ret;
 
 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
 
@@ -444,10 +446,10 @@ static int replace_int_data_in_filename(char **s, const 
char *filename, char pla
 }
 if (!av_bprint_is_complete(&buf)) {
 av_bprint_finalize(&buf, NULL);
-return -1;
+return AVERROR(ENOMEM);
 }
-if (av_bprint_finalize(&buf, &new_filename) < 0 || !new_filename)
-return -1;
+if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
+return ret;
 *s = new_filename;
 return found_count;
 }
-- 
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] vf_edgedetect: properly implement double_threshold()

2020-06-22 Thread Valery Kot
On Mon, Jun 22, 2020 at 4:56 PM Andriy Gelman  wrote:
> It should be enough to change the hashes in two files.
> Please resend with these changes.
>
> diff --git a/tests/ref/fate/filter-edgedetect 
> b/tests/ref/fate/filter-edgedetect
> index 23c9953e61..e49639afac 100644
> --- a/tests/ref/fate/filter-edgedetect
> +++ b/tests/ref/fate/filter-edgedetect
> @@ -1 +1 @@
> -edgedetect  93ceace33f6636bcdbeb037317c65745
> +edgedetect  04ff46bb35edff3dbad4102391516d25
> diff --git a/tests/ref/fate/filter-edgedetect-colormix 
> b/tests/ref/fate/filter-edgedetect-colormix
> index e828c6bd19..0df17344bc 100644
> --- a/tests/ref/fate/filter-edgedetect-colormix
> +++ b/tests/ref/fate/filter-edgedetect-colormix
> @@ -1 +1 @@
> -edgedetect-colormix 1b8658252e2f03fbae30e6d63dd24c7c
> +edgedetect-colormix 9f50c5586f899a8f5a10059154d64bde

Just submitted patch V2, please drop this one.

Thanks for the help Andriy, appreciated!

Valery
___
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/6] avutil/opt: check return value of av_bprint_finalize()

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

Signed-off-by: Limin Wang 
---
 libavutil/opt.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 2c3f998..552985e 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -2120,6 +2120,9 @@ int av_opt_serialize(void *obj, int opt_flags, int flags, 
char **buffer,
 av_freep(&buf);
 }
 }
-av_bprint_finalize(&bprint, buffer);
+ret = av_bprint_finalize(&bprint, buffer);
+if (ret < 0)
+return ret;
+
 return 0;
 }
-- 
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 4/6] avformat/au: check return value of au_read_annotation()

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

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

diff --git a/libavformat/au.c b/libavformat/au.c
index ff9176a..b6df63e 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -145,6 +145,7 @@ static int au_read_header(AVFormatContext *s)
 int bps, ba = 0;
 enum AVCodecID codec;
 AVStream *st;
+int ret;
 
 tag = avio_rl32(pb);
 if (tag != MKTAG('.', 's', 'n', 'd'))
@@ -163,7 +164,8 @@ static int au_read_header(AVFormatContext *s)
 
 if (size > 24) {
 /* parse annotation field to get metadata */
-au_read_annotation(s, size - 24);
+if (ret = au_read_annotation(s, size - 24) < 0)
+return ret;
 }
 
 codec = ff_codec_get_id(codec_au_tags, id);
-- 
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] avfilter: add nonlinearstretch filter.

2020-06-22 Thread Mathias Rasmussen
On Mon, Jun 22, 2020 at 3:57 PM Paul B Mahol  wrote:

> I really doubt that this filter have anything to do with GoPro's SuperView.
> GoPro's SuperView, unlike this filter, extends FOV of currently
> recording video with real data.


Please see https://community.gopro.com/t5/en/What-is-SuperView/ta-p/390201,
I fail to see how this is not nearly identical to what this filter does, so
please enlighten me if I’m wrong.
I don’t know what you mean by “real data” but I’m very interested if you
have information of GoPro using other data than the 4:3 sensor image.
Also, are you saying this filter cannot be used on “currently recording
video”? It's not really the intention, but I don’t see why not?

Also this filter is very limited in functionality. I already have
> another generic warp filter
> that can do this and much more.


That’s great, do you have an example of how to use it for achieving this
type of stretching?
___
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/6] avformat/au: check return value of av_bprint_finalize()

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

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

diff --git a/libavformat/au.c b/libavformat/au.c
index 4afee85..ff9176a 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -81,7 +81,7 @@ static int au_read_annotation(AVFormatContext *s, int size)
 AVBPrint bprint;
 char * key = NULL;
 char * value = NULL;
-int i;
+int ret, i;
 
 av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
 
@@ -92,7 +92,9 @@ static int au_read_annotation(AVFormatContext *s, int size)
 if (c == '\0') {
 state = PARSE_FINISHED;
 } else if (c == '=') {
-av_bprint_finalize(&bprint, &key);
+ret = av_bprint_finalize(&bprint, &key);
+if (ret < 0)
+return ret;
 av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
 state = PARSE_VALUE;
 } else {
-- 
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] avfilter/vf_edgedetect: properly implement double_threshold()

2020-06-22 Thread Valery Kot
=== Version 1 ===
vf_edgedetect video filter implements Canny algorithm
(https://en.wikipedia.org/wiki/Canny_edge_detector)

Important part of this algo is the double threshold step: pixels above
"high" threshold being kept, pixels below "low" threshold dropped,
pixels in between kept if they are attached to "high" pixels.

This is implemented in the double_threshold() function. However,
condition to start checking attached pixels, as it is now and as it
was in FFmpeg since 2012, only allows checking on the boundary, not
inside the video. It is a very lucky coincidence that those boundary
pixels are always 0, otherwise following lines would be reading
outside of the buffer.

As it is now, double_threshold() only implements "high" thresholding.
As a result, edges are either noisy or fragmented, depending on "high"
threshold selection; "low" threshold is simply ignored.

Attached one char patch fixes this.

=== Version 2 ===
- include avfilter/ in commit message
- update FATE tests
From 69bbe24bfe23efa3874448f28451b1abaa209d5d Mon Sep 17 00:00:00 2001
From: vkot 
Date: Fri, 19 Jun 2020 16:57:13 +0200
Subject: [PATCH] avfilter/vf_edgedetect: properly implement double_threshold()

---
 libavfilter/vf_edgedetect.c   | 2 +-
 tests/ref/fate/filter-edgedetect  | 2 +-
 tests/ref/fate/filter-edgedetect-colormix | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c
index a5614ea63b..df8afbd532 100644
--- a/libavfilter/vf_edgedetect.c
+++ b/libavfilter/vf_edgedetect.c
@@ -294,7 +294,7 @@ static void double_threshold(int low, int high, int w, int 
h,
 continue;
 }
 
-if ((!i || i == w - 1 || !j || j == h - 1) &&
+if (!(!i || i == w - 1 || !j || j == h - 1) &&
 src[i] > low &&
 (src[-src_linesize + i-1] > high ||
  src[-src_linesize + i  ] > high ||
diff --git a/tests/ref/fate/filter-edgedetect b/tests/ref/fate/filter-edgedetect
index 23c9953e61..e49639afac 100644
--- a/tests/ref/fate/filter-edgedetect
+++ b/tests/ref/fate/filter-edgedetect
@@ -1 +1 @@
-edgedetect  93ceace33f6636bcdbeb037317c65745
+edgedetect  04ff46bb35edff3dbad4102391516d25
diff --git a/tests/ref/fate/filter-edgedetect-colormix 
b/tests/ref/fate/filter-edgedetect-colormix
index e828c6bd19..0df17344bc 100644
--- a/tests/ref/fate/filter-edgedetect-colormix
+++ b/tests/ref/fate/filter-edgedetect-colormix
@@ -1 +1 @@
-edgedetect-colormix 1b8658252e2f03fbae30e6d63dd24c7c
+edgedetect-colormix 9f50c5586f899a8f5a10059154d64bde
-- 
2.26.2.windows.1

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

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

[FFmpeg-devel] [PATCH 6/6] avformat/hlsenc: fix av_bprint_finalize() usage

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

Don't need to do double check by the description of the API.

Signed-off-by: Limin Wang 
---
 libavformat/hlsenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f7a4f30..a34da2f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -398,7 +398,7 @@ static int replace_str_data_in_filename(char **s, const 
char *filename, char pla
 av_bprint_finalize(&buf, NULL);
 return AVERROR(ENOMEM);
 }
-if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
+if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0)
 return ret;
 *s = new_filename;
 return found_count;
@@ -448,7 +448,7 @@ static int replace_int_data_in_filename(char **s, const 
char *filename, char pla
 av_bprint_finalize(&buf, NULL);
 return AVERROR(ENOMEM);
 }
-if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
+if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0)
 return ret;
 *s = new_filename;
 return found_count;
-- 
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/6] avformat/ftp: check return value of av_bprint_finalize()

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

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

diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index caeea42..39ea297 100644
--- a/libavformat/ftp.c
+++ b/libavformat/ftp.c
@@ -200,7 +200,7 @@ static int ftp_status(FTPContext *s, char **line, const int 
response_codes[])
 }
 
 if (line)
-av_bprint_finalize(&line_buffer, line);
+result = av_bprint_finalize(&line_buffer, line);
 return result;
 }
 
-- 
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] avfilter: add nonlinearstretch filter.

2020-06-22 Thread Mathias Rasmussen
On 22 Jun 2020, at 15.57, Paul B Mahol  wrote:
> 
> I really doubt that this filter have anything to do with GoPro's SuperView.
> GoPro's SuperView, unlike this filter, extends FOV of currently
> recording video with real data.

Please see https://community.gopro.com/t5/en/What-is-SuperView/ta-p/390201 
,
I fail to see how this is not nearly identical to what this filter does, so 
please enlighten me if i’m wrong.
I don’t know what you mean by “real data” but i’m very interested if you have 
information of GoPro using other data than the 4:3 sensor image.
Also, are you saying this filter cannot be used on “currently recording video”? 
It's not really the intention, but I don’t see why not?

> Also this filter is very limited in functionality. I already have
> another generic warp filter
> that can do this and much more.


That’s great, do you have an example of how to use it for achieving this type 
of stretching?
___
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] vf_edgedetect: properly implement double_threshold()

2020-06-22 Thread Andriy Gelman
On Mon, 22. Jun 09:58, Valery Kot wrote:
> On Mon, Jun 22, 2020 at 7:58 AM Andriy Gelman  wrote:
> >
> > Hi Valery,
> >
> > Thanks for the patch.
> >
> > Please also update the fate test:
> > https://patchwork.ffmpeg.org/project/ffmpeg/patch/cagtf1mncx2joo-vmtucdkjcp76y5jslnhubzat4mf48c2hf...@mail.gmail.com/
> 
> Thanks for feedback. Updating FATE tests is a bridge too far for me. I
> can't even build FFmpeg itself at the moment, say nothing about
> setting up the test environment and finding out how it works. Could
> you please do this update for me?

It should be enough to change the hashes in two files.
Please resend with these changes.

diff --git a/tests/ref/fate/filter-edgedetect b/tests/ref/fate/filter-edgedetect
index 23c9953e61..e49639afac 100644
--- a/tests/ref/fate/filter-edgedetect
+++ b/tests/ref/fate/filter-edgedetect
@@ -1 +1 @@
-edgedetect  93ceace33f6636bcdbeb037317c65745
+edgedetect  04ff46bb35edff3dbad4102391516d25
diff --git a/tests/ref/fate/filter-edgedetect-colormix 
b/tests/ref/fate/filter-edgedetect-colormix
index e828c6bd19..0df17344bc 100644
--- a/tests/ref/fate/filter-edgedetect-colormix
+++ b/tests/ref/fate/filter-edgedetect-colormix
@@ -1 +1 @@
-edgedetect-colormix 1b8658252e2f03fbae30e6d63dd24c7c
+edgedetect-colormix 9f50c5586f899a8f5a10059154d64bde


Thanks,
-- 
Andriy
___
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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Carl Eugen Hoyos


> Am 22.06.2020 um 12:42 schrieb Moritz Barsnick :
> 
>> On Mon, Jun 22, 2020 at 12:47:11 +0530, Gautam Ramakrishnan wrote:
>> On Mon, Jun 22, 2020 at 12:38 PM Carl Eugen Hoyos  wrote:
 Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan :
 JPEG2000 uses .pgx format for conformance testing. Is it a good idea
 to allow the ffmpeg native decoder to have an option to dump .pgx files?
>>> I believe it would be more useful if FFmpeg could read pgx files.
>> So could a new Codec be created for reading and writing pgx files?
> 
> Actually, probably a very simple demuxer/muxer, as the payload seems
> to be uncompressed/raw.

Most likely a decoder as for pnm or tga.

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

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

[FFmpeg-devel] [PATCH v2 4/4] lavc, doc: add libuavs3d video decoder wrapper

2020-06-22 Thread hwrenx
From: hwren 

Signed-off-by: hbj 
Signed-off-by: hwren 
---
 Changelog  |   1 +
 configure  |   4 +
 doc/decoders.texi  |  21 +++
 doc/general.texi   |   8 ++
 libavcodec/Makefile|   1 +
 libavcodec/allcodecs.c |   1 +
 libavcodec/libuavs3d.c | 283 +
 7 files changed, 319 insertions(+)
 create mode 100644 libavcodec/libuavs3d.c

diff --git a/Changelog b/Changelog
index a60e7d2eb8..dfd56b3fc6 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version :
 - AudioToolbox output device
 - MacCaption demuxer
+- AVS3 video decoder via libuavs3d
 
 
 version 4.3:
diff --git a/configure b/configure
index 7495f35faa..7340bc4a35 100755
--- a/configure
+++ b/configure
@@ -274,6 +274,7 @@ External library support:
   --enable-libtls  enable LibreSSL (via libtls), needed for https 
support
if openssl, gnutls or mbedtls is not used [no]
   --enable-libtwolame  enable MP2 encoding via libtwolame [no]
+  --enable-libuavs3d   enable AVS3 decoding via libuavs3d [no]
   --enable-libv4l2 enable libv4l2/v4l-utils [no]
   --enable-libvidstab  enable video stabilization using vid.stab [no]
   --enable-libvmaf enable vmaf filter via libvmaf [no]
@@ -1807,6 +1808,7 @@ EXTERNAL_LIBRARY_LIST="
 libtesseract
 libtheora
 libtwolame
+libuavs3d
 libv4l2
 libvorbis
 libvpx
@@ -3242,6 +3244,7 @@ libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
 libtheora_encoder_deps="libtheora"
 libtwolame_encoder_deps="libtwolame"
+libuavs3d_decoder_deps="libuavs3d"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
 libvorbis_decoder_deps="libvorbis"
 libvorbis_encoder_deps="libvorbis libvorbisenc"
@@ -6379,6 +6382,7 @@ enabled libtls&& require_pkg_config libtls 
libtls tls.h tls_configur
 enabled libtwolame&& require libtwolame twolame.h twolame_init 
-ltwolame &&
  { check_lib libtwolame twolame.h 
twolame_encode_buffer_float32_interleaved -ltwolame ||
die "ERROR: libtwolame must be installed and 
version must be >= 0.3.10"; }
+enabled libuavs3d && require_pkg_config libuavs3d uavs3d uavs3d.h 
uavs3d_decode
 enabled libv4l2   && require_pkg_config libv4l2 libv4l2 libv4l2.h 
v4l2_ioctl
 enabled libvidstab&& require_pkg_config libvidstab "vidstab >= 0.98" 
vid.stab/libvidstab.h vsMotionDetectInit
 enabled libvmaf   && require_pkg_config libvmaf "libvmaf >= 1.3.9" 
libvmaf.h compute_vmaf
diff --git a/doc/decoders.texi b/doc/decoders.texi
index 9005714e3c..f1a0b3c36e 100644
--- a/doc/decoders.texi
+++ b/doc/decoders.texi
@@ -86,6 +86,27 @@ AVS2-P2/IEEE1857.4 video decoder wrapper.
 
 This decoder allows libavcodec to decode AVS2 streams with davs2 library.
 
+@c man end VIDEO DECODERS
+ 
+@section libuavs3d
+
+AVS3-P2/IEEE1857.10 video decoder.
+
+libuavs3d allows libavcodec to decode AVS3 streams.
+Requires the presence of the libuavs3d headers and library during 
configuration.
+You need to explicitly configure the build with @code{--enable-libuavs3d}.
+
+@subsection Options
+
+The following option is supported by the libuavs3d wrapper.
+
+@table @option
+
+@item frame_threads
+Set amount of frame threads to use during decoding. The default value is 0 
(autodetect).
+
+@end table
+
 @c man end VIDEO DECODERS
 
 @chapter Audio Decoders
diff --git a/doc/general.texi b/doc/general.texi
index 9b0ee96752..6d673b74e1 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -125,6 +125,14 @@ Go to @url{https://github.com/pkuvcl/davs2} and follow the 
instructions for
 installing the library. Then pass @code{--enable-libdavs2} to configure to
 enable it.
 
+@section uavs3d
+
+FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video 
decoding.
+
+Go to @url{https://github.com/uavs3/uavs3d} and follow the instructions for
+installing the library. Then pass @code{--enable-libuavs3d} to configure to
+enable it.
+
 @float NOTE
 libdavs2 is under the GNU Public License Version 2 or later
 (see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index f1512779be..491485f3c0 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1026,6 +1026,7 @@ OBJS-$(CONFIG_LIBSPEEX_DECODER)   += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)   += libspeexenc.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)  += libtheoraenc.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
+OBJS-$(CONFIG_LIBUAVS3D_DECODER)  += libuavs3d.o
 OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
 OBJS-$(CONFIG_LIBVORBIS_DECODER)  += libvorbisdec.o
 OBJS-$(CONFIG_LIBVORBIS_ENCODER)  += libvorbisenc.o \
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 80f128cade..3d2d0af87a 100644
--- a/libavcodec/a

[FFmpeg-devel] [PATCH v2 1/4] lavc: add AVS3 codec id and desc

2020-06-22 Thread hwrenx
From: hwren 

Signed-off-by: hbj 
Signed-off-by: hwren 
---
 libavcodec/codec_desc.c | 7 +++
 libavcodec/codec_id.h   | 1 +
 2 files changed, 8 insertions(+)

diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 9f8847544f..ad55d992d3 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_AVS3,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "avs3",
+.long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"),
+.props = AV_CODEC_PROP_LOSSY,
+},
 {
 .id= AV_CODEC_ID_Y41P,
 .type  = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index d885962c9c..7f7dee51f1 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_AVS3,
 
 AV_CODEC_ID_Y41P = 0x8000,
 AV_CODEC_ID_AVRP,
-- 
2.23.0.windows.1

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

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

[FFmpeg-devel] [PATCH v2 3/4] lavf/avs3dec: add raw avs3 demuxer

2020-06-22 Thread hwrenx
From: hwren 

Signed-off-by: hbj 
Signed-off-by: hwren 
---
 libavformat/Makefile |  1 +
 libavformat/allformats.c |  1 +
 libavformat/avs3dec.c| 75 
 3 files changed, 77 insertions(+)
 create mode 100644 libavformat/avs3dec.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 26af859a28..b433a6029c 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -120,6 +120,7 @@ OBJS-$(CONFIG_AVR_DEMUXER)   += avr.o pcm.o
 OBJS-$(CONFIG_AVS_DEMUXER)   += avs.o voc_packet.o vocdec.o voc.o
 OBJS-$(CONFIG_AVS2_DEMUXER)  += davs2.o rawdec.o
 OBJS-$(CONFIG_AVS2_MUXER)+= rawenc.o
+OBJS-$(CONFIG_AVS3_DEMUXER)  += avs3dec.o rawdec.o
 OBJS-$(CONFIG_BETHSOFTVID_DEMUXER)   += bethsoftvid.o
 OBJS-$(CONFIG_BFI_DEMUXER)   += bfi.o
 OBJS-$(CONFIG_BINK_DEMUXER)  += bink.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 97fd06debb..2d768b8c88 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -82,6 +82,7 @@ extern AVInputFormat  ff_avr_demuxer;
 extern AVInputFormat  ff_avs_demuxer;
 extern AVInputFormat  ff_avs2_demuxer;
 extern AVOutputFormat ff_avs2_muxer;
+extern AVInputFormat  ff_avs3_demuxer;
 extern AVInputFormat  ff_bethsoftvid_demuxer;
 extern AVInputFormat  ff_bfi_demuxer;
 extern AVInputFormat  ff_bintext_demuxer;
diff --git a/libavformat/avs3dec.c b/libavformat/avs3dec.c
new file mode 100644
index 00..955114dc42
--- /dev/null
+++ b/libavformat/avs3dec.c
@@ -0,0 +1,75 @@
+/*
+ * RAW AVS3-P2/IEEE1857.10 video demuxer
+ * Copyright (c) 2020 Zhenyu Wang 
+ *Bingjie Han 
+ *Huiwen Ren  
+ *
+ * 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 "avformat.h"
+#include "rawdec.h"
+#include "libavcodec/internal.h"
+
+#define AVS3_SEQ_START_CODE   0x01b0
+#define AVS3_PIC_I_START_CODE 0x01b3
+#define AVS3_UNDEF_START_CODE 0x01b4
+#define AVS3_PIC_PB_START_CODE0x01b6
+#define AVS3_VIDEO_EDIT_CODE  0x01b7
+#define AVS3_PROFILE_JIZHUN   0x20
+#define AVS3_PROFILE_JIZHUN10 0x22
+
+static int avs3video_probe(const AVProbeData *p)
+{
+uint32_t code= -1;
+int pic=0, seq=0, slice_pos = 0;
+const uint8_t *ptr = p->buf, *end = p->buf + p->buf_size;
+int ret = 0;
+
+while (ptr < end) {
+ptr = avpriv_find_start_code(ptr, end, &code);
+if ((code & 0xff00) == 0x100) {
+if (code < AVS3_SEQ_START_CODE) {
+/* slices have to be consecutive */
+if (code < slice_pos)
+return 0;
+slice_pos = code;
+} else {
+slice_pos = 0;
+}
+if (code == AVS3_SEQ_START_CODE) {
+seq++;
+/* check for the only currently supported profile */
+if (*ptr != AVS3_PROFILE_JIZHUN && *ptr != 
AVS3_PROFILE_JIZHUN10)
+return 0;
+} else if ((code == AVS3_PIC_I_START_CODE) ||
+   (code == AVS3_PIC_PB_START_CODE)) {
+pic++;
+} else if ((code == AVS3_UNDEF_START_CODE) ||
+   (code >  AVS3_VIDEO_EDIT_CODE)) {
+return 0;
+}
+}
+}
+if (seq && pic && av_match_ext(p->filename, "avs3")) {
+ret = AVPROBE_SCORE_MAX;
+}
+return ret;
+}
+
+FF_DEF_RAWVIDEO_DEMUXER(avs3, "raw AVS3-P2/IEEE1857.10", avs3video_probe, 
"avs3", AV_CODEC_ID_AVS3)
+
-- 
2.23.0.windows.1

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

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

[FFmpeg-devel] [PATCH v2 2/4] lavc/avs3_paeser: add avs3 parser

2020-06-22 Thread hwrenx
From: hwren 

Signed-off-by: hbj 
Signed-off-by: hwren 
---
 libavcodec/Makefile  |   1 +
 libavcodec/avs3_parser.c | 184 +++
 libavcodec/parsers.c |   1 +
 3 files changed, 186 insertions(+)
 create mode 100644 libavcodec/avs3_parser.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 5a6ea59715..f1512779be 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1053,6 +1053,7 @@ OBJS-$(CONFIG_AC3_PARSER)  += ac3tab.o 
aac_ac3_parser.o
 OBJS-$(CONFIG_ADX_PARSER)  += adx_parser.o adx.o
 OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o av1_parse.o
 OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o
+OBJS-$(CONFIG_AVS3_PARSER) += avs3_parser.o
 OBJS-$(CONFIG_BMP_PARSER)  += bmp_parser.o
 OBJS-$(CONFIG_CAVSVIDEO_PARSER)+= cavs_parser.o
 OBJS-$(CONFIG_COOK_PARSER) += cook_parser.o
diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c
new file mode 100644
index 00..7a7f826c59
--- /dev/null
+++ b/libavcodec/avs3_parser.c
@@ -0,0 +1,184 @@
+/*
+ * AVS3-P2/IEEE1857.10 video parser.
+ * Copyright (c) 2020 Zhenyu Wang 
+ *Bingjie Han 
+ *Huiwen Ren  
+ *
+ * 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 "parser.h"
+
+#define SLICE_MAX_START_CODE0x01af
+
+#define ISPIC(x)  ((x) == 0xB3 || (x) == 0xB6)
+#define ISUNIT(x) ((x) == 0xB0 || ISPIC(x))
+
+static av_cold int avs3_find_frame_end(ParseContext *pc, const uint8_t *buf, 
int buf_size)
+{
+int pic_found  = pc->frame_start_found;
+uint32_t state = pc->state;
+int cur = 0;
+
+if (!pic_found) {
+for (; cur < buf_size; ++cur) {
+state = (state<<8) | buf[cur];
+if (ISPIC(buf[cur])){
+++cur;
+pic_found = 1;
+break;
+}
+}
+}
+
+if (pic_found) {
+if (!buf_size)
+return END_NOT_FOUND;
+for (; cur < buf_size; ++cur) {
+state = (state << 8) | buf[cur];
+if ((state & 0xFF00) == 0x100 && ISUNIT(state & 0xFF)) {
+pc->frame_start_found = 0;
+pc->state = -1;
+return cur - 3;
+}
+}
+}
+
+pc->frame_start_found = pic_found;
+pc->state = state;
+
+return END_NOT_FOUND;
+}
+
+static unsigned int read_bits(const char** ppbuf, int *pidx, int bits) 
+{
+const char* p = *ppbuf;
+int idx = *pidx;
+unsigned int val = 0;
+
+while (bits) {
+bits--;
+val = (val << 1) | (((*p) >> idx) & 0x1);
+if (--idx < 0) {
+idx = 7;
+p++;
+}
+}
+
+*ppbuf = p;
+*pidx = idx;
+
+return val;
+}
+
+static void parse_avs3_nal_units(AVCodecParserContext *s, const uint8_t *buf,
+   int buf_size, AVCodecContext *avctx)
+{
+if (buf_size < 5) {
+return;
+}
+
+if (buf[0] == 0x0 && buf[1] == 0x0 && buf[2] == 0x1) {
+if (buf[3] == 0xB0) {
+static const int avs3_fps_num[9] = {0, 24, 24, 25, 3, 30, 
50, 6, 60 };
+static const int avs3_fps_den[9] = {1,   1001,  1,  1,  1001,  1,  
1,  1001,  1 };
+int profile,ratecode;
+const char* p = buf + 4;
+int idx = 7;
+
+s->key_frame = 1;
+s->pict_type = AV_PICTURE_TYPE_I;
+
+profile = read_bits(&p, &idx, 8);
+// level(8) + progressive(1) + field(1) + library(2) + resv(1) + 
width(14) + resv(1) + height(14) + chroma(2) + sampe_precision(3)
+read_bits(&p, &idx, 47); 
+
+if (profile == 0x22) {
+avctx->pix_fmt = read_bits(&p, &idx, 3) == 1 ? 
AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUV420P10LE;
+} 
+
+// resv(1) + aspect(4)
+read_bits(&p, &idx, 5);
+
+ratecode = read_bits(&p, &idx, 4);
+
+// resv(1) + bitrate_low(18) + resv(1) + bitrate_high(12)
+read_bits(&p, &idx, 32);
+
+avctx->has_b_frames = !read_bits(&p, &idx, 1);
+
+avctx->framerate.num = avctx->time_base.den = 
avs3_fps_num[ratecode];
+ 

[FFmpeg-devel] [PATCH v2 0/4] Supplement AVS3-P2/IEEE1857.10 video decoding via libuavs3d

2020-06-22 Thread hwrenx
From: hwren 

=== Version1 ===
These patches are to supplement the third generation of Audio Video Coding 
Standard,
part 2: video (AVS3-P2), aka IEEE1857.10, decoding support via libuavs3d 
wrapper.

The uAVS3d decoder could be found in https://github.com/uavs3/uavs3d
AVS3 sample streams could be found in https://github.com/uavs3/avs3stream

=== Version 2 ===
Fix conflict with CAVS streams. Considering that there is no direct version 
flag in AVS,
AVS3 demuxer only supports raw streams in format <*.avs3>.

Fix API function conflict.

Thanks.

hwren (4):
  lavc: add AVS3 codec id and desc
  lavc/avs3_paeser: add avs3 parser
  lavf/avs3dec: add raw avs3 demuxer
  lavc,doc: add libuavs3d video decoder wrapper

 Changelog|   1 +
 configure|   4 +
 doc/decoders.texi|  21 +++
 doc/general.texi |   8 ++
 libavcodec/Makefile  |   2 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/avs3_parser.c | 184 +
 libavcodec/codec_desc.c  |   7 +
 libavcodec/codec_id.h|   1 +
 libavcodec/libuavs3d.c   | 283 +++
 libavcodec/parsers.c |   1 +
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/avs3dec.c|  75 +++
 14 files changed, 590 insertions(+)
 create mode 100644 libavcodec/avs3_parser.c
 create mode 100644 libavcodec/libuavs3d.c
 create mode 100644 libavformat/avs3dec.c

-- 
2.23.0.windows.1

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

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

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

2020-06-22 Thread Paul B Mahol
On 6/22/20, Mathias Rasmussen  wrote:
> ---
> Hi there! First time contributor here.
>
> I've made a filter for performing nonlinear stretching of videos,
> also known as dynamic stretch and similar to GoPro's SuperView.
>

I really doubt that this filter have anything to do with GoPro's SuperView.
GoPro's SuperView, unlike this filter, extends FOV of currently
recording video with real data.

Also this filter is very limited in functionality. I already have
another generic warp filter
that can do this and much more.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 1/4 v2] avutil/buffer: change public function and struct size parameter types to size_t

2020-06-22 Thread James Almer
On 6/22/2020 6:18 AM, Anton Khirnov wrote:
> Quoting James Almer (2020-06-01 19:25:36)
>> Signed-off-by: James Almer 
>> ---
>> No changes since v1.
>>
>>  doc/APIchanges  |  4 
>>  libavutil/buffer.c  | 25 +
>>  libavutil/buffer.h  | 31 +++
>>  libavutil/buffer_internal.h | 13 +
>>  libavutil/version.h |  3 +++
>>  5 files changed, 76 insertions(+)
> 
> Are we ok with everyone who writes bindings for other languages hating
> us (even more)?

Well, there are similar changes done to the crypto modules scheduled for
the upcoming bump, so if they need to adapt such bindings, might as well
do it for crypto *and* buffer at the same time. It's not like they would
be spared the headache if this isn't committed.
___
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] vf_edgedetect: properly implement double_threshold()

2020-06-22 Thread Valery Kot
On Mon, Jun 22, 2020 at 12:57 PM Moritz Barsnick  wrote:
>
> On Mon, Jun 22, 2020 at 09:58:42 +0200, Valery Kot wrote:
> > Thanks for feedback. Updating FATE tests is a bridge too far for me. I
> > can't even build FFmpeg itself at the moment, say nothing about
> > setting up the test environment and finding out how it works. Could
> > you please do this update for me?
>
> Are you saying you analyzed this issue in the source code, but have
> not had a chance to check whether the change really fixes the output?
> [*]

I tested master build from Zeranoe to confirm that there is a bug
(modifying low threshold changes nothing in output). Then I modified
double_threshold() function and tested it locally in a unit test (in
my own testbed).

>
> Once you *do* understand how to build ffmpeg, you can follow the fate
> instructions here:
> https://ffmpeg.org/fate.html#Using-FATE-from-your-FFmpeg-source-directory
>
> You don't actually need to add a new fate test in this case, but submit
> the changed reference output with your patch (assuming that the changed
> output is really correct!).

I am working on Windows, and don't have build environment for FFmpeg
at this moment. As this is not a pressing issue for me, I don't want
to spend time on it. I was just developing my own Canny filter
implementation and noticed that FFmpeg edge detector is
underperforming (quality wise). I could've do nothing, or just sent a
bug report, but chose to send this patch as a contribution to the
community.

>
> Cheers,
> Moritz
>
> [*] I'm not saying that someone couldn't do that for you instead, if
> they are willing.
___
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] vf_edgedetect: properly implement double_threshold()

2020-06-22 Thread Valery Kot
On Mon, Jun 22, 2020 at 12:54 PM Moritz Barsnick  wrote:
>
> On Fri, Jun 19, 2020 at 17:15:06 +0200, Valery Kot wrote:
> > -if ((!i || i == w - 1 || !j || j == h - 1) &&
> > +if (!(!i || i == w - 1 || !j || j == h - 1) &&
>
> NOT of a logical OR can be inverted, so this *may* be more readable as:
>if ((i && i != w - 1 && j && j != h - 1) &&
> or even drop the bracket
>if (i && i != w - 1 && j && j != h - 1 &&
>

Indeed, those three are equivalent. Complex logical conditions can be
written in different ways. I chose mine to minimize change, assuming
that there was just a typo in original algo implementation.
___
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] avdevice/decklink_dec: extracting and outputing klv from vanc

2020-06-22 Thread Zivkovic, Milos
Hello,

I've attached another patch with the latest changes.
Sorry for sending it as an attachment again, I'll figure something out
for the future patches.

Anyhow, this patch removes the reordering and the unused HANC constant.
It also checks if PSC is in order and renames the option to "enable_klv".

Thanks,
Milos


0001-avdevice-decklink_dec-extracting-and-outputing-klv.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] vf_edgedetect: properly implement double_threshold()

2020-06-22 Thread Moritz Barsnick
On Mon, Jun 22, 2020 at 09:58:42 +0200, Valery Kot wrote:
> Thanks for feedback. Updating FATE tests is a bridge too far for me. I
> can't even build FFmpeg itself at the moment, say nothing about
> setting up the test environment and finding out how it works. Could
> you please do this update for me?

Are you saying you analyzed this issue in the source code, but have
not had a chance to check whether the change really fixes the output?
[*]

Once you *do* understand how to build ffmpeg, you can follow the fate
instructions here:
https://ffmpeg.org/fate.html#Using-FATE-from-your-FFmpeg-source-directory

You don't actually need to add a new fate test in this case, but submit
the changed reference output with your patch (assuming that the changed
output is really correct!).

Cheers,
Moritz

[*] I'm not saying that someone couldn't do that for you instead, if
they are willing.
___
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] vf_edgedetect: properly implement double_threshold()

2020-06-22 Thread Moritz Barsnick
On Fri, Jun 19, 2020 at 17:15:06 +0200, Valery Kot wrote:
> -if ((!i || i == w - 1 || !j || j == h - 1) &&
> +if (!(!i || i == w - 1 || !j || j == h - 1) &&

NOT of a logical OR can be inverted, so this *may* be more readable as:
   if ((i && i != w - 1 && j && j != h - 1) &&
or even drop the bracket
   if (i && i != w - 1 && j && j != h - 1 &&

Untested, just from observation.

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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Moritz Barsnick
On Mon, Jun 22, 2020 at 12:47:11 +0530, Gautam Ramakrishnan wrote:
> On Mon, Jun 22, 2020 at 12:38 PM Carl Eugen Hoyos  wrote:
> > > Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan :
> > > JPEG2000 uses .pgx format for conformance testing. Is it a good idea
> > > to allow the ffmpeg native decoder to have an option to dump .pgx files?
> > I believe it would be more useful if FFmpeg could read pgx files.
> So could a new Codec be created for reading and writing pgx files?

Actually, probably a very simple demuxer/muxer, as the payload seems
to be uncompressed/raw.

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 1/4 v2] avutil/buffer: change public function and struct size parameter types to size_t

2020-06-22 Thread Anton Khirnov
Quoting James Almer (2020-06-01 19:25:36)
> Signed-off-by: James Almer 
> ---
> No changes since v1.
> 
>  doc/APIchanges  |  4 
>  libavutil/buffer.c  | 25 +
>  libavutil/buffer.h  | 31 +++
>  libavutil/buffer_internal.h | 13 +
>  libavutil/version.h |  3 +++
>  5 files changed, 76 insertions(+)

Are we ok with everyone who writes bindings for other languages hating
us (even more)?

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

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

Re: [FFmpeg-devel] [PATCH 05/11] avcodec/h264_parser: Reuse the RBSP buffer

2020-06-22 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2020-05-29 17:52:40)
> Ping. What is other's opinion on this matter? Notice that the current
> behaviour is suboptimal even if it is decided that the buffer should not
> be kept: It allocates 1/16 more than needed (in addition to
> AV_INPUT_BUFFER_PADDING_SIZE) that is guaranteed not to be used; and it
> uses mallocz for the allocation.

Random idea: free the buffer on every IDR? Not super optimal, but simple
to implement.

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

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

[FFmpeg-devel] To Speed Up thumbnail creation - picture & video

2020-06-22 Thread Arunava Banerjee
Hello,

We have been using FFMPEG library to create the following thumbnails from
videos:
a. picture
b. video - for example a 60secs video thumbnail.

Our video sizes are about 200 - 300 MB. We are using a PHP program to
transfer command to the shell for FFMPEG executable to generate the
thumbnails.

The videos exists on AWS S3, and we are fetching them using S3 signature
url, generating the thumbs and uploading back.

We have noticed that FFMPEG takes quite sometime to create the thumbnails,
which is creating a wait time on the part of the interface.

Please let us know if there could be a way, we can fasten this process.
Do such params exist in FFMPEG ?

The time for creation on a local system using S3 is given hereunder:

To create a picture:
real 0m37.618s
user 0m17.791s
sys 0m0.783s

To create a video thumb:
real 3m6.979s
user 2m29.448s
sys 0m4.621s

-- 
==
Best Regards,

Arunava Banerjee
Sr. Web Developer,
Capital Numbers Infotech Pvt.Ltd.
Gmail: arunava.baner...@capitalnumbers.com
==
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 3/5] avcodec/packet: Improve documentation of av_packet_get_side_data

2020-06-22 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2020-06-21 10:53:47)
> Document that it also sets the size in case the desired side data is
> absent (if the pointer has been supplied).
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
> Do this and the next patch actually need a version bump and API change
> entry?

I'd say documenting existing behaviour is not an API change, so doesn't
need anything.

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

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

Re: [FFmpeg-devel] [PATCH 1/5] avcodec/nellymoserdec: Don't use invalid AVPacketSideDataType

2020-06-22 Thread Anton Khirnov
Patchset looks ok

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

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

Re: [FFmpeg-devel] [Patch] vf_edgedetect: properly implement double_threshold()

2020-06-22 Thread Valery Kot
On Mon, Jun 22, 2020 at 7:58 AM Andriy Gelman  wrote:
>
> Hi Valery,
>
> Thanks for the patch.
>
> Please also update the fate test:
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/cagtf1mncx2joo-vmtucdkjcp76y5jslnhubzat4mf48c2hf...@mail.gmail.com/

Thanks for feedback. Updating FATE tests is a bridge too far for me. I
can't even build FFmpeg itself at the moment, say nothing about
setting up the test environment and finding out how it works. Could
you please do this update for me?

> Add an avfilter/ prefix to the commit title.

I will, if FATE issue can be solved

> Thanks,
> --
> Andriy
>
___
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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Gautam Ramakrishnan
On Mon, Jun 22, 2020 at 12:38 PM Carl Eugen Hoyos  wrote:
>
>
>
> > Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan :
> >
> > Hello,
> >
> > JPEG2000 uses .pgx format for conformance testing. Is it a good idea
> > to allow the ffmpeg
> > native decoder to have an option to dump .pgx files? This would help
> > with testing additions
> > to the code.
>
> I believe it would be more useful if FFmpeg could read pgx files.
So could a new Codec be created for reading and writing pgx files?
>
> 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".



-- 
-
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] Support for dumping pgx for JPEG2000

2020-06-22 Thread Carl Eugen Hoyos


> Am 22.06.2020 um 07:32 schrieb Gautam Ramakrishnan :
> 
> Hello,
> 
> JPEG2000 uses .pgx format for conformance testing. Is it a good idea
> to allow the ffmpeg
> native decoder to have an option to dump .pgx files? This would help
> with testing additions
> to the code.

I believe it would be more useful if FFmpeg could read pgx files.

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