Re: [FFmpeg-devel] [PATCH 2/2] qt-faststart - optimize the offset change loop

2018-05-30 Thread Tomas Härdin
tis 2018-05-29 klockan 14:36 + skrev Eran Kornblau:
> Hi,
> 
> The attached is a slightly more optimized (and IMHO elegant) code for
> updating the stco/co64 offsets

Looks OK to me. Those & 0xFF are actually superfluous, but the compiler
should remove them anyway.

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


Re: [FFmpeg-devel] [PATCH 5/5] avformat/mxfdec: recognize SMPTE 436 VBI data

2018-05-30 Thread Tomas Härdin
mån 2018-05-28 klockan 00:27 +0200 skrev Marton Balint:
> 
> On Sun, 27 May 2018, Tomas Härdin wrote:
> 
> > sön 2018-05-27 klockan 21:21 +0200 skrev Marton Balint:
> > > > Signed-off-by: Marton Balint 
> > > 
> > > ---
> > >  libavformat/mxfdec.c | 5 -
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > > index a62021b0d7..df97d6438f 100644
> > > --- a/libavformat/mxfdec.c
> > > +++ b/libavformat/mxfdec.c
> > > @@ -1278,11 +1278,13 @@ static const MXFCodecUL 
> > > mxf_sound_essence_container_uls[] = {
> > >  };
> > >  
> > >  static const MXFCodecUL mxf_data_essence_container_uls[] = {
> > > -{ { 
> > > 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00
> > >  }, 16, 0 },
> > > +{ { 
> > > 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00
> > >  }, 16, AV_CODEC_ID_NONE },
> > > +{ { 
> > > 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00
> > >  }, 16, AV_CODEC_ID_NONE },
> > >  { { 
> > > 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
> > >  },  0, AV_CODEC_ID_NONE },
> > >  };
> > >  
> > >  static const char * const mxf_data_essence_descriptor[] = {
> > > +"vbi_smpte_436M",
> > >  "vbi_vanc_smpte_436M",
> > >  };
> > 
> > Should this really be added at the top of the array?
> 
> Yeah, following existing style, I tried to keep the container_uls in 
> numeric order, and the descriptor names must be in the same order as the 
> essence_container_uls:
> 
> ... 0d is MXFGCGenericVBIDataMappingUndefinedPayload (this is the new)
> ... 0e is MXFGCGenericANCDataMappingUndefinedPayload

Feels like these two should be in the same struct if order is important
in that way. But maybe there's some MXF peculiarity I'm overlooking..

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


Re: [FFmpeg-devel] [PATCH v2] avcodec/vc1: fix overlap smoothing filter for P frames

2018-05-30 Thread Jerome Borsboom
The v_overlap_filter needs to run on the colocated block of the previous
macroblock. For the luma plane, the colocated block is located two blocks
on the left instead of one. In addition, the overlap filter needs to run
on the non-edge blocks of the first macroblock row and column.

Signed-off-by: Jerome Borsboom 
---
This is an improved patch that should also fix the remaining frames in 
SSL0013.rcv.

 libavcodec/vc1_loopfilter.c | 60 ++---
 1 file changed, 35 insertions(+), 25 deletions(-)

diff --git a/libavcodec/vc1_loopfilter.c b/libavcodec/vc1_loopfilter.c
index 4c0de7c025..aceb1f77ff 100644
--- a/libavcodec/vc1_loopfilter.c
+++ b/libavcodec/vc1_loopfilter.c
@@ -64,27 +64,23 @@ void ff_vc1_loop_filter_iblk(VC1Context *v, int pq)
 static av_always_inline void vc1_h_overlap_filter(VC1Context *v, int16_t 
(*left_block)[64],
   int16_t (*right_block)[64], 
int block_num)
 {
-if (left_block != right_block || (block_num & 5) == 1) {
-if (block_num > 3)
-v->vc1dsp.vc1_h_s_overlap(left_block[block_num], 
right_block[block_num]);
-else if (block_num & 1)
-v->vc1dsp.vc1_h_s_overlap(right_block[block_num - 1], 
right_block[block_num]);
-else
-v->vc1dsp.vc1_h_s_overlap(left_block[block_num + 1], 
right_block[block_num]);
-}
+if (block_num > 3)
+v->vc1dsp.vc1_h_s_overlap(left_block[block_num], 
right_block[block_num]);
+else if (block_num & 1)
+v->vc1dsp.vc1_h_s_overlap(right_block[block_num - 1], 
right_block[block_num]);
+else
+v->vc1dsp.vc1_h_s_overlap(left_block[block_num + 1], 
right_block[block_num]);
 }
 
 static av_always_inline void vc1_v_overlap_filter(VC1Context *v, int16_t 
(*top_block)[64],
   int16_t (*bottom_block)[64], 
int block_num)
 {
-if (top_block != bottom_block || block_num & 2) {
-if (block_num > 3)
-v->vc1dsp.vc1_v_s_overlap(top_block[block_num], 
bottom_block[block_num]);
-else if (block_num & 2)
-v->vc1dsp.vc1_v_s_overlap(bottom_block[block_num - 2], 
bottom_block[block_num]);
-else
-v->vc1dsp.vc1_v_s_overlap(top_block[block_num + 2], 
bottom_block[block_num]);
-}
+if (block_num > 3)
+v->vc1dsp.vc1_v_s_overlap(top_block[block_num], 
bottom_block[block_num]);
+else if (block_num & 2)
+v->vc1dsp.vc1_v_s_overlap(bottom_block[block_num - 2], 
bottom_block[block_num]);
+else
+v->vc1dsp.vc1_v_s_overlap(top_block[block_num + 2], 
bottom_block[block_num]);
 }
 
 void ff_vc1_i_overlap_filter(VC1Context *v)
@@ -108,21 +104,28 @@ void ff_vc1_i_overlap_filter(VC1Context *v)
  * borders. Therefore, the H overlap trails by one MB col and the
  * V overlap trails by one MB row. This is reflected in the time at which
  * we run the put_pixels loop, i.e. delayed by one row and one column. */
-for (i = 0; i < block_count; i++)
+for (i = 0; i < block_count; i++) {
+if (s->mb_x == 0 && (i & 5) != 1)
+continue;
+
 if (v->pq >= 9 || v->condover == CONDOVER_ALL ||
-(v->over_flags_plane[mb_pos] && ((i & 5) == 1 || (s->mb_x && 
v->over_flags_plane[mb_pos - 1]
+(v->over_flags_plane[mb_pos] && ((i & 5) == 1 || 
v->over_flags_plane[mb_pos - 1])))
 vc1_h_overlap_filter(v, s->mb_x ? left_blk : cur_blk, cur_blk, i);
+}
 
 if (v->fcm != ILACE_FRAME)
 for (i = 0; i < block_count; i++) {
+if (s->first_slice_line && !(i & 2))
+continue;
+
 if (s->mb_x && (v->pq >= 9 || v->condover == CONDOVER_ALL ||
 (v->over_flags_plane[mb_pos - 1] &&
- ((i & 2) || (!s->first_slice_line && 
v->over_flags_plane[mb_pos - 1 - s->mb_stride])
+ ((i & 2) || v->over_flags_plane[mb_pos - 1 - s->mb_stride]
 vc1_v_overlap_filter(v, s->first_slice_line ? left_blk : 
topleft_blk, left_blk, i);
 if (s->mb_x == s->mb_width - 1)
 if (v->pq >= 9 || v->condover == CONDOVER_ALL ||
 (v->over_flags_plane[mb_pos] &&
- ((i & 2) || (!s->first_slice_line && 
v->over_flags_plane[mb_pos - s->mb_stride]
+ ((i & 2) || v->over_flags_plane[mb_pos - s->mb_stride])))
 vc1_v_overlap_filter(v, s->first_slice_line ? cur_blk : 
top_blk, cur_blk, i);
 }
 }
@@ -139,18 +142,25 @@ void ff_vc1_p_overlap_filter(VC1Context *v)
 left_blk = v->block[v->left_blk_idx];
 cur_blk = v->block[v->cur_blk_idx];
 
-for (i = 0; i < block_count; i++)
-if (v->mb_type[0][s->block_index[i]] && (s->mb_x == 0 || 
v->mb_type[0][s->block_index[i] - 1]))
+for (i = 0; i < block_count; i++) {
+if (s->mb_x == 0 && (i & 5) != 1)
+continue;
+
+if (v->mb_type[0][s->block_index[i]] && 
v-

Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace

2018-05-30 Thread Vasile Toncu

Hello,

Here is patch 3 which renames reinterlace to tinterlace. Fate tests and 
warnings should be ok now.

In patch 4 I will add the new options to the filter.

Thank you,
Vasile Toncu
>From 25d4f0154fe2a8bde3a47491f80ce131ebb20330 Mon Sep 17 00:00:00 2001
From: Vasile Toncu 
Date: Tue, 29 May 2018 18:29:06 +0300
Subject: [PATCH] Reint-Patch3

---
 configure |   1 -
 libavfilter/Makefile  |   1 -
 libavfilter/allfilters.c  |   1 -
 libavfilter/reinterlace.h | 131 --
 libavfilter/tinterlace.h  | 156 +--
 libavfilter/vf_reinterlace.c  | 768 ---
 libavfilter/vf_tinterlace.c   | 826 ++
 libavfilter/x86/Makefile  |   1 -
 libavfilter/x86/vf_reinterlace_init.c | 101 -
 libavfilter/x86/vf_tinterlace_init.c  |  41 +-
 10 files changed, 668 insertions(+), 1359 deletions(-)
 delete mode 100644 libavfilter/reinterlace.h
 delete mode 100644 libavfilter/vf_reinterlace.c
 delete mode 100644 libavfilter/x86/vf_reinterlace_init.c

diff --git a/configure b/configure
index 22eeca2..20d9eee 100755
--- a/configure
+++ b/configure
@@ -3400,7 +3400,6 @@ stereo3d_filter_deps="gpl"
 subtitles_filter_deps="avformat avcodec libass"
 super2xsai_filter_deps="gpl"
 pixfmts_super2xsai_test_deps="super2xsai_filter"
-tinterlace_filter_deps="gpl"
 tinterlace_merge_test_deps="tinterlace_filter"
 tinterlace_pad_test_deps="tinterlace_filter"
 tonemap_filter_deps="const_nan"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 39f9cb7..c68ef05 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -239,7 +239,6 @@ OBJS-$(CONFIG_IDET_FILTER)   += vf_idet.o
 OBJS-$(CONFIG_IL_FILTER) += vf_il.o
 OBJS-$(CONFIG_INFLATE_FILTER)+= vf_neighbor.o
 OBJS-$(CONFIG_INTERLACE_FILTER)  += vf_tinterlace.o
-OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.o
 OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o
 OBJS-$(CONFIG_KERNDEINT_FILTER)  += vf_kerndeint.o
 OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 0b6f585..b44093d 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -340,7 +340,6 @@ extern AVFilter ff_vf_thumbnail;
 extern AVFilter ff_vf_thumbnail_cuda;
 extern AVFilter ff_vf_tile;
 extern AVFilter ff_vf_tinterlace;
-extern AVFilter ff_vf_reinterlace;
 extern AVFilter ff_vf_tlut2;
 extern AVFilter ff_vf_tmix;
 extern AVFilter ff_vf_tonemap;
diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h
deleted file mode 100644
index 1035a5b..000
--- a/libavfilter/reinterlace.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2017 Vasile Toncu 
- * Copyright (c) 2017 Thomas Mundt 
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Reinterlace filter
- */
-
-#include 
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "libavutil/avassert.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-
-#include "libavutil/bswap.h"
-
-enum FilterMode {
-MODE_MERGE,
-MODE_DROP_EVEN,
-MODE_DROP_ODD,
-MODE_PAD,
-MODE_INTERLEAVE_TOP,
-MODE_INTERLEAVE_BOTTOM,
-MODE_INTERLACE_X2,
-MODE_MERGE_X2,
-MODE_MERGE_TFF,
-MODE_MERGE_BFF,
-MODE_NB
-};
-
-enum FilterFlags {
-FLAG_NOTHING= 0x00,
-FLAG_VLPF   = 0x01,
-FLAG_EXACT_TB   = 0x02,
-FLAG_CVLPF  = 0x04,
-FLAG_NB
-};
-
-static const AVRational standard_tbs[] = {
-{1, 25},
-{1, 30},
-{1001, 3},
-};
-
-typedef struct {
-const AVClass *class;
-int mode;
-int flags;
-
-AVFrame *prev_frame, *current_frame;
-int64_t current_frame_index;
-
-void *black_vec[4];
-
-int skip_next_frame;
-
-void *thread_data;
-
-uint8_t bit_depth;
-
-void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
- ptrdiff_t mref, ptrdiff_t pref, int clip_max);
-
-AVRational preout_time_base;
-
-} ReInterlaceContext;
-
-#if CONFIG_GPL
-voi

Re: [FFmpeg-devel] [PATCH 2/5] Added reinterlace filter

2018-05-30 Thread Vasile Toncu

Hello,

Sorry for the late reply, I've been working on other projects.
Here is patch 2, which adds vf_reinterlace filter. To my understanding, 
patch 2 and patch 3 will be merged at the same time, so there is no need 
to add documentation for reinterlace as it will replace tinterlace.


Thank you,
Vasile Toncu
>From 5b19aaac81fd0f5a9d37a1585e2c814414542e2e Mon Sep 17 00:00:00 2001
From: Vasile Toncu 
Date: Tue, 29 May 2018 15:54:19 +0300
Subject: [PATCH] Reint-Patch2

---
 libavfilter/Makefile  |   1 +
 libavfilter/allfilters.c  |   1 +
 libavfilter/reinterlace.h | 133 ++
 libavfilter/vf_reinterlace.c  | 769 ++
 libavfilter/x86/Makefile  |   1 +
 libavfilter/x86/vf_reinterlace_init.c | 101 +
 6 files changed, 1006 insertions(+)
 create mode 100644 libavfilter/reinterlace.h
 create mode 100644 libavfilter/vf_reinterlace.c
 create mode 100644 libavfilter/x86/vf_reinterlace_init.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index c68ef05..39f9cb7 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -239,6 +239,7 @@ OBJS-$(CONFIG_IDET_FILTER)   += vf_idet.o
 OBJS-$(CONFIG_IL_FILTER) += vf_il.o
 OBJS-$(CONFIG_INFLATE_FILTER)+= vf_neighbor.o
 OBJS-$(CONFIG_INTERLACE_FILTER)  += vf_tinterlace.o
+OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.o
 OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o
 OBJS-$(CONFIG_KERNDEINT_FILTER)  += vf_kerndeint.o
 OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index b44093d..0b6f585 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -340,6 +340,7 @@ extern AVFilter ff_vf_thumbnail;
 extern AVFilter ff_vf_thumbnail_cuda;
 extern AVFilter ff_vf_tile;
 extern AVFilter ff_vf_tinterlace;
+extern AVFilter ff_vf_reinterlace;
 extern AVFilter ff_vf_tlut2;
 extern AVFilter ff_vf_tmix;
 extern AVFilter ff_vf_tonemap;
diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h
new file mode 100644
index 000..6025665
--- /dev/null
+++ b/libavfilter/reinterlace.h
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2017 Vasile Toncu 
+ * Copyright (c) 2017 Thomas Mundt 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Reinterlace filter
+ */
+
+#include 
+
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+#include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+
+#include "libavutil/bswap.h"
+
+enum FilterMode {
+MODE_MERGE,
+MODE_DROP_EVEN,
+MODE_DROP_ODD,
+MODE_PAD,
+MODE_INTERLEAVE_TOP,
+MODE_INTERLEAVE_BOTTOM,
+MODE_INTERLACE_X2,
+MODE_MERGE_X2,
+MODE_MERGE_TFF,
+MODE_MERGE_BFF,
+MODE_NB
+};
+
+enum FilterFlags {
+FLAG_NOTHING= 0x00,
+FLAG_VLPF   = 0x01,
+FLAG_EXACT_TB   = 0x02,
+FLAG_CVLPF  = 0x04,
+FLAG_NB
+};
+
+static const AVRational standard_tbs[] = {
+{1, 25},
+{1, 30},
+{1001, 3},
+};
+
+typedef struct {
+const AVClass *class;
+int mode;
+int flags;
+
+AVFrame *prev_frame, *current_frame;
+int64_t current_frame_index;
+
+void *black_vec[4];
+
+int skip_next_frame;
+
+void *thread_data;
+
+uint8_t bit_depth;
+
+void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
+ ptrdiff_t mref, ptrdiff_t pref, int clip_max);
+
+AVRational preout_time_base;
+
+} ReInterlaceContext;
+
+#if CONFIG_GPL
+void ff_reinterlace_init_x86(ReInterlaceContext *reinterlace);
+#endif
+
+#define OFFSET(x) offsetof(ReInterlaceContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption reinterlace_options[] = {
+{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_MERGE}, 0, MODE_NB - 1, FLAGS, "mode" },
+{ "merge", "merge frames",0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE},INT_MIN, INT_MAX, FLAGS, "mode"},
+{ "drop_even", "drop even frames",  

Re: [FFmpeg-devel] [PATCH v2] avcodec/vc1: fix overlap smoothing filter for P frames

2018-05-30 Thread Carl Eugen Hoyos
2018-05-30 13:53 GMT+02:00, Jerome Borsboom :
> The v_overlap_filter needs to run on the colocated block of the previous
> macroblock. For the luma plane, the colocated block is located two blocks
> on the left instead of one. In addition, the overlap filter needs to run
> on the non-edge blocks of the first macroblock row and column.
>
> Signed-off-by: Jerome Borsboom 
> ---
> This is an improved patch that should also fix the remaining frames in
> SSL0013.rcv.

The patch also fixes SSL0014.rcv, the only sample in this directory
that still doesn't decode bit-exact is SSL0015.rcv, I don't know if the
issue is also loopfilter-related.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace

2018-05-30 Thread Vasile Toncu

Hello,

I've sent a wrong version in the previous email for patch 3. Please 
ignore. This is the corect one.


Have a good day,
Vasile Toncu
>From 5898c531066f8e6c034eb1c882000f60ba4f0cb9 Mon Sep 17 00:00:00 2001
From: Vasile Toncu 
Date: Tue, 29 May 2018 18:29:06 +0300
Subject: [PATCH] Reint-Patch3

---
 configure |   1 -
 libavfilter/Makefile  |   1 -
 libavfilter/allfilters.c  |   1 -
 libavfilter/reinterlace.h | 131 --
 libavfilter/tinterlace.h  | 116 +++--
 libavfilter/vf_reinterlace.c  | 768 ---
 libavfilter/vf_tinterlace.c   | 834 ++
 libavfilter/x86/Makefile  |   1 -
 libavfilter/x86/vf_reinterlace_init.c | 101 
 libavfilter/x86/vf_tinterlace_init.c  |  41 +-
 10 files changed, 651 insertions(+), 1344 deletions(-)
 delete mode 100644 libavfilter/reinterlace.h
 delete mode 100644 libavfilter/vf_reinterlace.c
 delete mode 100644 libavfilter/x86/vf_reinterlace_init.c

diff --git a/configure b/configure
index 22eeca2..20d9eee 100755
--- a/configure
+++ b/configure
@@ -3400,7 +3400,6 @@ stereo3d_filter_deps="gpl"
 subtitles_filter_deps="avformat avcodec libass"
 super2xsai_filter_deps="gpl"
 pixfmts_super2xsai_test_deps="super2xsai_filter"
-tinterlace_filter_deps="gpl"
 tinterlace_merge_test_deps="tinterlace_filter"
 tinterlace_pad_test_deps="tinterlace_filter"
 tonemap_filter_deps="const_nan"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 39f9cb7..c68ef05 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -239,7 +239,6 @@ OBJS-$(CONFIG_IDET_FILTER)   += vf_idet.o
 OBJS-$(CONFIG_IL_FILTER) += vf_il.o
 OBJS-$(CONFIG_INFLATE_FILTER)+= vf_neighbor.o
 OBJS-$(CONFIG_INTERLACE_FILTER)  += vf_tinterlace.o
-OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.o
 OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o
 OBJS-$(CONFIG_KERNDEINT_FILTER)  += vf_kerndeint.o
 OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 0b6f585..b44093d 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -340,7 +340,6 @@ extern AVFilter ff_vf_thumbnail;
 extern AVFilter ff_vf_thumbnail_cuda;
 extern AVFilter ff_vf_tile;
 extern AVFilter ff_vf_tinterlace;
-extern AVFilter ff_vf_reinterlace;
 extern AVFilter ff_vf_tlut2;
 extern AVFilter ff_vf_tmix;
 extern AVFilter ff_vf_tonemap;
diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h
deleted file mode 100644
index 1035a5b..000
--- a/libavfilter/reinterlace.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2017 Vasile Toncu 
- * Copyright (c) 2017 Thomas Mundt 
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Reinterlace filter
- */
-
-#include 
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "libavutil/avassert.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-
-#include "libavutil/bswap.h"
-
-enum FilterMode {
-MODE_MERGE,
-MODE_DROP_EVEN,
-MODE_DROP_ODD,
-MODE_PAD,
-MODE_INTERLEAVE_TOP,
-MODE_INTERLEAVE_BOTTOM,
-MODE_INTERLACE_X2,
-MODE_MERGE_X2,
-MODE_MERGE_TFF,
-MODE_MERGE_BFF,
-MODE_NB
-};
-
-enum FilterFlags {
-FLAG_NOTHING= 0x00,
-FLAG_VLPF   = 0x01,
-FLAG_EXACT_TB   = 0x02,
-FLAG_CVLPF  = 0x04,
-FLAG_NB
-};
-
-static const AVRational standard_tbs[] = {
-{1, 25},
-{1, 30},
-{1001, 3},
-};
-
-typedef struct {
-const AVClass *class;
-int mode;
-int flags;
-
-AVFrame *prev_frame, *current_frame;
-int64_t current_frame_index;
-
-void *black_vec[4];
-
-int skip_next_frame;
-
-void *thread_data;
-
-uint8_t bit_depth;
-
-void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
- ptrdiff_t mref, ptrdiff_t pref, int clip_max);
-
-AVRational preout_time_base;
-
-} ReInterlaceContext;
-
-#if CONFIG_GPL
-void ff_reinterlace_init_x86(ReInterlaceContext *rei

Re: [FFmpeg-devel] [GSOC] [PATCH] DNN module introduction and SRCNN filter update

2018-05-30 Thread Pedro Arthur
Please, send patch 0002 in a new email and discuss it  there.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Set st->start_time for video streams explicitly.

2018-05-30 Thread Derek Buitenhuis
On Tue, May 29, 2018 at 11:39 PM, Sasi Inguva
 wrote:
> If start_time is not set, ffmpeg takes the duration from the global
> movie instead of the per stream duration.
> Signed-off-by: Sasi Inguva 

Probably OK, though it seems your git client didn't have your email configured.

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


Re: [FFmpeg-devel] [PATCH 1/3] avcodec/idctdsp: Transmit studio_profile to init instead of using AVCodecContext profile

2018-05-30 Thread Michael Niedermayer
On Mon, May 28, 2018 at 10:29:56PM +0200, Michael Niedermayer wrote:
> These 2 fields are not always the same, it is simpler to always use the same 
> field
> for detecting studio profile
> 
> Fixes: null pointer dereference
> Fixes: ffmpeg_crash_3.avi
> 
> Found-by: Thuan Pham , Marcel Böhme, Andrew Santosa 
> and Alexandru RazvanCaciulescu with AFLSmart
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/idctdsp.c   | 2 +-
>  libavcodec/idctdsp.h   | 2 ++
>  libavcodec/mpegvideo.c | 2 ++
>  3 files changed, 5 insertions(+), 1 deletion(-)

will apply patchset

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

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


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


[FFmpeg-devel] [PATCH] configure fix arm inline defines

2018-05-30 Thread John Cox
Hi

I believe there is a bug in the arm feature detection for inline asm in
configure and I have a patch for it.

Currently using a command line like:

./configure --enable-cross-compile --arch=arm --cpu=cortex-a7
--target-os=linux --cross-prefix=arm-linux-gnueabihf-

gives in config.h:

#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
#define HAVE_ARMV8 0
#define HAVE_NEON 1
#define HAVE_VFP 1
#define HAVE_VFPV3 1
#define HAVE_SETEND 1
...
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
#define HAVE_SETEND_EXTERNAL 1
...
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
#define HAVE_SETEND_INLINE 0

With the patch below you get

...
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
#define HAVE_ARMV8 0
#define HAVE_NEON 1
#define HAVE_VFP 1
#define HAVE_VFPV3 1
#define HAVE_SETEND 1
...
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
#define HAVE_SETEND_EXTERNAL 1
...
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
#define HAVE_SETEND_INLINE 1

If I want to get Neon enabled as well then I need to have a --mfpu=neon
on the command line too.  I'm not sure how to get it there unless I pass
it as extra flags.

This patch adds quotes around the asm that is in the __asm__ statement

Regards

John Cox

diff --git a/configure b/configure
index 22eeca22a5..4dbee8d349 100755
--- a/configure
+++ b/configure
@@ -1040,7 +1040,7 @@ EOF

 check_insn(){
 log check_insn "$@"
-check_inline_asm ${1}_inline "$2"
+check_inline_asm ${1}_inline "\"$2\""
 check_as ${1}_external "$2"
 }
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2] avformat/hls: Properly expose intercepted ID3 tags to the API.

2018-05-30 Thread Richard Shaffer
On Fri, May 18, 2018 at 4:09 PM,  wrote:

> From: Richard Shaffer 
>
> The HLS demuxer will process any ID3 tags at the beginning of a segment in
> order to obtain timestamp data. However, when this data was parsed on a
> second
> or subsequent segment, the updated metadata would be discarded. This change
> preserves the data and also sets the AVSTREAM_EVENT_FLAG_METADATA_UPDATED
> event flag when appropriate.
> ---
>
> Changes in this version:
> * Only set metadata updated flag if we have non-timestamp metadata.
> * Fix clearing of metadata updated flag in hls_read_header.
> * Specifically cast operands to unsigned when using bitwise operators.
>
> (This last one is almost certainly pedantic, but it doesn't hurt anything.)
>
>  libavformat/hls.c | 39 ---
>  1 file changed, 24 insertions(+), 15 deletions(-)
>
> diff --git a/libavformat/hls.c b/libavformat/hls.c
> index 3d4f7f2647..342a022975 100644
> --- a/libavformat/hls.c
> +++ b/libavformat/hls.c
> @@ -982,18 +982,8 @@ static void parse_id3(AVFormatContext *s, AVIOContext
> *pb,
>  }
>
>  /* Check if the ID3 metadata contents have changed */
> -static int id3_has_changed_values(struct playlist *pls, AVDictionary
> *metadata,
> -  ID3v2ExtraMetaAPIC *apic)
> +static int id3_has_changed_values(struct playlist *pls,
> ID3v2ExtraMetaAPIC *apic)
>  {
> -AVDictionaryEntry *entry = NULL;
> -AVDictionaryEntry *oldentry;
> -/* check that no keys have changed values */
> -while ((entry = av_dict_get(metadata, "", entry,
> AV_DICT_IGNORE_SUFFIX))) {
> -oldentry = av_dict_get(pls->id3_initial, entry->key, NULL,
> AV_DICT_MATCH_CASE);
> -if (!oldentry || strcmp(oldentry->value, entry->value) != 0)
> -return 1;
> -}
> -
>  /* check if apic appeared */
>  if (apic && (pls->ctx->nb_streams != 2 || !pls->ctx->streams[1]->
> attached_pic.data))
>  return 1;
> @@ -1019,6 +1009,19 @@ static void handle_id3(AVIOContext *pb, struct
> playlist *pls)
>  int64_t timestamp = AV_NOPTS_VALUE;
>
>  parse_id3(pls->ctx, pb, &metadata, ×tamp, &apic, &extra_meta);
> +ff_id3v2_parse_priv_dict(&metadata, &extra_meta);
> +av_dict_copy(&pls->ctx->metadata, metadata, 0);
> +/*
> + * If we've handled any ID3 metadata here, it's not going to be seen
> by the
> + * sub-demuxer. In the case that we got here because of an IO call
> during
> + * hls_read_header, this will be cleared. Otherwise, it provides the
> + * necessary hint to hls_read_packet that there is new metadata. Note
> that
> + * we only set the update flag if we have metadata other than a
> timestamp.
> + */
> +if (av_dict_count(metadata) > (timestamp == AV_NOPTS_VALUE ? 0 : 1)) {
> +pls->ctx->event_flags = (unsigned)pls->ctx->event_flags |
> +(unsigned)AVFMT_EVENT_FLAG_METADATA_UPDATED;
> +}
>
>  if (timestamp != AV_NOPTS_VALUE) {
>  pls->id3_mpegts_timestamp = timestamp;
> @@ -1037,12 +1040,10 @@ static void handle_id3(AVIOContext *pb, struct
> playlist *pls)
>  /* demuxer not yet opened, defer picture attachment */
>  pls->id3_deferred_extra = extra_meta;
>
> -ff_id3v2_parse_priv_dict(&metadata, &extra_meta);
> -av_dict_copy(&pls->ctx->metadata, metadata, 0);
>  pls->id3_initial = metadata;
>
>  } else {
> -if (!pls->id3_changed && id3_has_changed_values(pls, metadata,
> apic)) {
> +if (!pls->id3_changed && id3_has_changed_values(pls, apic)) {
>  avpriv_report_missing_feature(pls->ctx, "Changing ID3
> metadata in HLS audio elementary stream");
>  pls->id3_changed = 1;
>  }
> @@ -1939,8 +1940,16 @@ static int hls_read_header(AVFormatContext *s)
>   * Copy any metadata from playlist to main streams, but do not set
>   * event flags.
>   */
> -if (pls->n_main_streams)
> +if (pls->n_main_streams) {
>  av_dict_copy(&pls->main_streams[0]->metadata,
> pls->ctx->metadata, 0);
> +/*
> + * If we've intercepted metadata, we will have set this event
> flag.
> + * Clear it to avoid confusion, since otherwise we will flag
> it as
> + * new metadata on the next call to hls_read_packet.
> + */
> +pls->ctx->event_flags = (unsigned)pls->ctx->event_flags &
> +~(unsigned)AVFMT_EVENT_FLAG_METADATA_UPDATED;
> +}
>
>  add_metadata_from_renditions(s, pls, AVMEDIA_TYPE_AUDIO);
>  add_metadata_from_renditions(s, pls, AVMEDIA_TYPE_VIDEO);
> --
> 2.15.1 (Apple Git-101)
>
>
Just wanted to ping the list one last time and see if I can get anyone to
take a look at this changeset.

Thanks,

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


[FFmpeg-devel] Patch: Replace quotes for inline asm detection.

2018-05-30 Thread Frank Liberato
Please find attached a one line patch:


> Commit 8c893aa3cd5 removed quotes that were required to detect
> inline asm in clank:
>
> check_insn armv5te qadd r0, r0, r0
> .../test.c:1:34: error: expected string literal in 'asm'
> void foo(void){ __asm__ volatile(qadd r0, r0, r0); }
>
> The correct code is:
>
> void foo(void){ __asm__ volatile("qadd r0, r0, r0"); }


Thanks
Frank
From 58c96127b6f1510b956b2280049d1c3778e3cab4 Mon Sep 17 00:00:00 2001
From: "liber...@chromium.org" 
Date: Tue, 29 May 2018 11:35:04 -0700
Subject: [PATCH] Replace quotes for inline asm detection.

Commit 8c893aa3cd5 removed quotes that were required to detect
inline asm in clank:

check_insn armv5te qadd r0, r0, r0
.../test.c:1:34: error: expected string literal in 'asm'
void foo(void){ __asm__ volatile(qadd r0, r0, r0); }

The correct code is:

void foo(void){ __asm__ volatile("qadd r0, r0, r0"); }
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 22eeca22a5..4dbee8d349 100755
--- a/configure
+++ b/configure
@@ -1040,7 +1040,7 @@ EOF
 
 check_insn(){
 log check_insn "$@"
-check_inline_asm ${1}_inline "$2"
+check_inline_asm ${1}_inline "\"$2\""
 check_as ${1}_external "$2"
 }
 
-- 
2.17.0.921.gf22659ad46-goog

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


Re: [FFmpeg-devel] [PATCH] tools/crypto_bench: add support for mbedcrypto

2018-05-30 Thread James Almer
On 5/27/2018 6:25 PM, James Almer wrote:
> Requires mbed TLS 2.7.0 or newer
> 
> Signed-off-by: James Almer 
> ---
>  tools/crypto_bench.c | 111 +--
>  1 file changed, 108 insertions(+), 3 deletions(-)

Pushed alongside a couple extra additions.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Limited timecode support for lavd/decklink

2018-05-30 Thread Marton Balint



On Tue, 29 May 2018, Jonathan Morley wrote:


Thank you Marton, That makes sense to me, but can you please clarify which 
context is the most appropriate to use?


Just put it in decklink_ctx in the Status section.

Don't forget to free it in ff_decklink_read_close.

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


Re: [FFmpeg-devel] [PATCH] Limited timecode support for lavd/decklink

2018-05-30 Thread Jonathan Morley
Thank you. I will add that and get you a new patch for review.

> On May 30, 2018, at 11:04 AM, Marton Balint  wrote:
> 
> 
> 
> On Tue, 29 May 2018, Jonathan Morley wrote:
> 
>> Thank you Marton, That makes sense to me, but can you please clarify which 
>> context is the most appropriate to use?
> 
> Just put it in decklink_ctx in the Status section.
> 
> Don't forget to free it in ff_decklink_read_close.
> 
> Regards,
> Marton
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] doc/ffmpeg - rewrite Stream Selection chapter

2018-05-30 Thread Lou Logan
On Tue, May 29, 2018, at 9:43 PM, Gyan Doshi wrote:
>
> They do here. Which version of makeinfo do you have?

6.5

Works when "--init-file=doc/t2h.pm" is omitted. Didn't investigate further.

> More importantly, which version is on the project server?

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


Re: [FFmpeg-devel] [PATCH 5/5] avformat/mxfdec: recognize SMPTE 436 VBI data

2018-05-30 Thread Marton Balint



On Wed, 30 May 2018, Tomas Härdin wrote:


mån 2018-05-28 klockan 00:27 +0200 skrev Marton Balint:


On Sun, 27 May 2018, Tomas Härdin wrote:

> sön 2018-05-27 klockan 21:21 +0200 skrev Marton Balint:
> > > Signed-off-by: Marton Balint 
> > 
> > ---

> >  libavformat/mxfdec.c | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c

> > index a62021b0d7..df97d6438f 100644
> > --- a/libavformat/mxfdec.c
> > +++ b/libavformat/mxfdec.c
> > @@ -1278,11 +1278,13 @@ static const MXFCodecUL 
mxf_sound_essence_container_uls[] = {
> >  };
> >  
> >  static const MXFCodecUL mxf_data_essence_container_uls[] = {
> > -{ { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 
16, 0 },
> > +{ { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00 }, 
16, AV_CODEC_ID_NONE },
> > +{ { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 
16, AV_CODEC_ID_NONE },
> >  { { 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  
0, AV_CODEC_ID_NONE },
> >  };
> >  
> >  static const char * const mxf_data_essence_descriptor[] = {
> > +"vbi_smpte_436M",
> >  "vbi_vanc_smpte_436M",
> >  };
> 
> Should this really be added at the top of the array?


Yeah, following existing style, I tried to keep the container_uls in 
numeric order, and the descriptor names must be in the same order as the 
essence_container_uls:

... 0d is MXFGCGenericVBIDataMappingUndefinedPayload (this is the new)
... 0e is MXFGCGenericANCDataMappingUndefinedPayload


Feels like these two should be in the same struct if order is important
in that way. But maybe there's some MXF peculiarity I'm overlooking..


Ok, I will change it. I pushed the first 3 patches in the series, I will 
re-send this one and the previous.


Thanks,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mxfdec: fix NULL pointer dereference in mxf_read_packet_old

2018-05-30 Thread Marton Balint



On Thu, 17 Nov 2016, Andreas Cadhalpun wrote:


Metadata streams have priv_data set to NULL.

Signed-off-by: Andreas Cadhalpun 
---
libavformat/mxfdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index a1a79ce..2ad0c28 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -3135,7 +3135,7 @@ static int mxf_read_packet_old(AVFormatContext *s, 
AVPacket *pkt)
if (mxf->nb_index_tables >= 1 && mxf->current_edit_unit < 
t->nb_ptses) {
pkt->dts = mxf->current_edit_unit + t->first_dts;
pkt->pts = t->ptses[mxf->current_edit_unit];
-} else if (track->intra_only) {
+} else if (track && track->intra_only) {
/* intra-only -> PTS = EditUnit.
 * let utils.c figure out DTS since it can be < PTS if 
low_delay = 0 (Sony IMX30) */
pkt->pts = mxf->current_edit_unit;


Was this patch really necessary? Because as far as I see, metadata streams 
(which have priv_data set to NULL) always have a AVMEDIA_TYPE_DATA 
st->codecpar->codec_type, and since this code calculates video pts, it 
never encounters a NULL track.


So is it OK to revert?

Thanks,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 1/3] lavc,doc: add avs2 codec

2018-05-30 Thread Jan Ekström
On Wed, May 30, 2018 at 4:19 AM, hwren  wrote:
> Signed-off-by: hwren 
> ---
>  doc/APIchanges  | 3 +++
>  libavcodec/avcodec.h| 1 +
>  libavcodec/codec_desc.c | 7 +++
>  libavcodec/version.h| 4 ++--
>  4 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index efe15ba..3d08bb9 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>
>  API changes, most recent first:
>
> +2018-05-xx - xx - lavc 58.20.100 - avcodec.h
> +  Add AV_CODEC_ID_AVS2.
> +
>  2018-05-xx - xx - lavf 58.15.100 - avformat.h
>Add pmt_version field to AVProgram
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index fb0c6fa..ce5f307 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -409,6 +409,7 @@ enum AVCodecID {
>  AV_CODEC_ID_DXV,
>  AV_CODEC_ID_SCREENPRESSO,
>  AV_CODEC_ID_RSCC,
> +AV_CODEC_ID_AVS2,
>
>  AV_CODEC_ID_Y41P = 0x8000,
>  AV_CODEC_ID_AVRP,
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 79552a9..e85492e 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -1395,6 +1395,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
>  .props = AV_CODEC_PROP_LOSSLESS,
>  },
>  {
> +.id= AV_CODEC_ID_AVS2,
> +.type  = AVMEDIA_TYPE_VIDEO,
> +.name  = "avs2",
> +.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"),
> +.props = AV_CODEC_PROP_LOSSY,
> +},

Hi,

Are there any reference sample sets available for GY/T 299.1-2016 aka
IEEE 1857.4 aka AVS2?

I tried to search around and while I found some info that 92 samples
were available on some semi-closed FTP, I couldn't really find any
real test samples that could make a reference test suite.

Best regards,
Jan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 2/3] lavc, doc, configure: add libdavs2 video decoder

2018-05-30 Thread Mark Thompson
On 30/05/18 02:19, hwren wrote:
> Add avs2 video decoder via libdavs2 library.
> 
> Signed-off-by: hwren 
> ---
>  Changelog  |   1 +
>  configure  |   4 +
>  doc/decoders.texi  |  10 +++
>  doc/general.texi   |   8 ++
>  libavcodec/Makefile|   1 +
>  libavcodec/allcodecs.c |   1 +
>  libavcodec/libdavs2.c  | 204 
> +
>  7 files changed, 229 insertions(+)
>  create mode 100644 libavcodec/libdavs2.c
> 
> ...
> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
> new file mode 100644
> index 000..b4a5f72
> --- /dev/null
> +++ b/libavcodec/libdavs2.c
> @@ -0,0 +1,204 @@
> +/*
> + * AVS2 decoding using the davs2 library
> + *
> + * Copyright (C) 2018 Yiqun Xu, 
> + *Falei Luo, 
> + *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 "libavutil/avassert.h"
> +#include "libavutil/common.h"
> +#include "libavutil/avutil.h"
> +#include "avcodec.h"
> +#include "libavutil/imgutils.h"
> +#include "internal.h"
> +
> +#include 
> +
> +typedef struct DAVS2Context {
> +void *decoder;
> +
> +AVFrame *frame;
> +davs2_param_tparam;  // decoding parameters
> +davs2_packet_t   packet; // input bitstream
> +
> +int decoded_frames;
> +
> +davs2_picture_t  out_frame;  // output data, frame data
> +davs2_seq_info_t headerset;  // output data, sequence header
> +
> +}DAVS2Context;
> +
> +static av_cold davs2_init(AVCodecContext *avctx)

Missing return type.

> +{
> +DAVS2Context *cad = avctx->priv_data;
> +
> +/* init the decoder */
> +cad->param.threads  = avctx->thread_count;
> +cad->param.i_info_level = 0;
> +cad->decoder = davs2_decoder_open(&cad->param);
> +avctx->flags |= AV_CODEC_FLAG_TRUNCATED;

From avcodec.h:

/**
 * AV_CODEC_FLAG_*.
 * - encoding: Set by user.
 * - decoding: Set by user.
 */
int flags;

The decoder should not be setting this field.

Having run this and seen it reading in 1024-byte chunks from a flat, I think 
what you actually need here to support flat files is a demuxer/parser which is 
aware of the structure of the codec and can split the input file into sensible 
packets.  (Any input other than a flat file will already do this.)

> +
> +av_log(avctx, AV_LOG_VERBOSE, "decoder created. %p\n", cad->decoder);
> +return 0;
> +}
> +
> +static int davs_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, 
> davs2_seq_info_t *headerset, AVFrame *frame)
> +{
> +DAVS2Context *cad = avctx->priv_data;
> +avctx->flags |= AV_CODEC_FLAG_TRUNCATED;

Remove this.

> +int bytes_per_sample = pic->bytes_per_sample;
> +int i;
> +
> +if (!headerset)
> +return 0;
> +
> +if (!pic || pic->ret_type == DAVS2_GOT_HEADER) {
> +avctx->width= headerset->horizontal_size;
> +avctx->height   = headerset->vertical_size;
> +avctx->pix_fmt  = headerset->output_bitdepth == 10 ? 
> AV_PIX_FMT_YUV420P10 : AV_PIX_FMT_YUV420P;

It looks like the output bitdepth is actually set at build time of the library, 
right?  Does that do downsampling/upsampling if the input has the other 
bitdepth, or will it fail in that case?

> +
> +AVRational r = av_d2q(headerset->frame_rate,4096);
> +avctx->framerate.num = r.num;
> +avctx->framerate.den = r.den;

AVCodecContext.framerate is also an AVRational, so you don't need this 
indirection (also fixes the mixed declarations and code).

Alternatively: the API appears to give you frame_rate_code as well, so indexing 
that into ff_mpeg12_frame_rate_tab[] will give you the right value without any 
rounding.

> +return 0;
> +}
> +
> +for (i = 0; i < 3; ++i) {
> +int size_plane = pic->width[i] * pic->lines[i] * bytes_per_sample;
> +frame->buf[i]  = av_buffer_alloc(size_plane);
> +frame->data[i] = frame->buf[i]->data;

Crashes if the allocation failed - you need to immediately check after the 
allocation.

> +frame->linesize[i] = pic->width[i] * bytes_per_sample;
> +if (!frame->buf[i] || !frame->data[i] || !frame->linesize[i]){
> +   

Re: [FFmpeg-devel] [PATCH 2/2] qt-faststart - optimize the offset change loop

2018-05-30 Thread Michael Niedermayer
On Wed, May 30, 2018 at 05:39:50AM +, Eran Kornblau wrote:
> > 
> > 
> > -Original Message-
> > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of 
> > Michael Niedermayer
> > Sent: Wednesday, May 30, 2018 12:37 AM
> > To: FFmpeg development discussions and patches 
> > Subject: Re: [FFmpeg-devel] [PATCH 2/2] qt-faststart - optimize the offset 
> > change loop
> > 
> > > +*ptr++ = (current_offset >> 56) & 0xFF;
> > > +*ptr++ = (current_offset >> 48) & 0xFF;
> > > +*ptr++ = (current_offset >> 40) & 0xFF;
> > > +*ptr++ = (current_offset >> 32) & 0xFF;
> > > +*ptr++ = (current_offset >> 24) & 0xFF;
> > > +*ptr++ = (current_offset >> 16) & 0xFF;
> > > +*ptr++ = (current_offset >>  8) & 0xFF;
> > > +*ptr++ = (current_offset >>  0) & 0xFF;
> > 
> > can this be simplfified with
> > libavcodec/bytestream.h, libavutil/intreadwrite.h or similar ?
> > 
> > [...]
> > 
> 
> Yes, I can change it to AV_WB32/AV_WB64, but at the moment this utility is 
> completely stand-alone - 
> it does not depend on anything from ffmpeg, so maybe it's better to keep it 
> this way.

well, i surely wont insist but these should not add dependancies
just use inline functions and macros from headers
I think it does no harm to use these as it doesnt add a depency at link


[...]
-- 
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
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] doc/ffmpeg - rewrite Stream Selection chapter

2018-05-30 Thread Michael Niedermayer
On Wed, May 30, 2018 at 10:59:22AM +0530, Gyan Doshi wrote:
> 
> 
> On 30-05-2018 04:57 AM, Carl Eugen Hoyos wrote:
> >2018-05-27 6:16 GMT+02:00, Gyan Doshi :
> >
> >>v2 attached.
> >
> >>+In the absence of any map options for a particular output file, ffmpeg 
> >>inspects the output
> >>+format to check which type of streams can be included in it, viz. video, 
> >>audio and/or
> >
> >Sorry, what is "viz."?
> 
> "Namely". Commonly seen in English prose. Can change it to 'i.e.' which is
> less correct here.
> 
> >>+subtitles. For each acceptable stream type, ffmpeg will pick one stream, 
> >>when available,
> >>+from among all the inputs.
> >
> >I don't think this is correct, not every stream type is picked.
> >Or do I misunderstand?
> 
> Yes. The qualifier is at the start, "For each acceptable stream type"
> 
>  >> +It will select that stream based upon the following criteria:
> >>+@*
> >>+@*for video, it is the stream with the highest resolution,
> >>+@*for audio, it is the stream with the most channels,
> >>+@*for subtitles, it is the first subtitle stream
> >
> >Please remove the actual current criteria:
> >This is just the current state of the implementation, for one
> >of the above, this is obviously not a good choice, for the
> >others, we could find better criteria.
> >Or mention that they may all change at any point.
> 
> These have been the criteria for nearly 7 years now. The narrowing of the
> subtitle selection was added by you nearly 4 years ago. This is one of the
> parts I copied from the current version, since it remains valid.
> 
> >>+The output format's default subtitle encoder may be text-based or 
> >>image-based, and only a
> >>+subtitle stream of the same type can be chosen.
> >
> >I wish that were true but I fear it isn't;-(
> 
> Please test. The 2nd example demonstrates it. It's your logic - you authored
> & committed it.
> (`dvb teletext` is an exception since it no prop flags set.)
> 
> >>+In the case where several streams of the same type rate equally, the 
> >>stream with the
> >>lowest
> >>+index is chosen.
> >
> >Please remove this.
> 
> Why? Another part, copied from the original. Remains valid
> 
> >All-in-all, this is far too complicated imo.
> 
> The _implementation_ is complicated. The docs now reflect it.
> 
> The basic principle I'm aiming to follow for docs, even if execution remains
> uneven, is
> 
> If a user consults the relevant parts of the documentation before execution,
> they should be able to predict how the program will behave. If they do it
> afterwards, they should understand what the program did. Even though FFmpeg
> is an open source project, end users of the CLI tools aren't expected to
> understand or dive into the source to grasp how the program behaves. It's
> the job of the docs to convey descriptions of behaviour that will affect
> what the end user expects the program to do. Do you disagree?

This will only work to some extend
Different version will and probably do behave slightly different.

I still think its important to draw a line between what is
A. intended to behave exactly as it does
B. behaves one way and is just documented to do so.

Case A is much more likely to be conserved over time
Case B may change in the implementation whenever it feels convenient to the
developers i suspect ...

Theres also the distinction between what we intend to maintain over time
in Command line interface behavior and what we do not intend to.

in a few years this document is maybe still 70% accurate. It would be
usefull if people today could have a good guess what part will be that 70%
today, so they could write code that is future proof ...

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


[FFmpeg-devel] [PATCH]lavc/profiles: Mention AAC-LC only once

2018-05-30 Thread Carl Eugen Hoyos
Hi!

I noticed that AAC-LC is listed twice in ff_aac_profiles[] - is there a reason?
And why do some codecs call a profile "codec-main" and some just "main"?

Please comment, Carl Eugen
From e34da28a84796513ed7690c1e51fbab7f740f832 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Thu, 31 May 2018 01:45:26 +0200
Subject: [PATCH] lavc/profiles: Mention AAC-LC only once.

---
 libavcodec/profiles.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index d7dc960..c31399f 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -30,7 +30,6 @@ const AVProfile ff_aac_profiles[] = {
 { FF_PROFILE_AAC_LD,"LD"   },
 { FF_PROFILE_AAC_ELD,   "ELD"  },
 { FF_PROFILE_AAC_MAIN,  "Main" },
-{ FF_PROFILE_AAC_LOW,   "LC"   },
 { FF_PROFILE_AAC_SSR,   "SSR"  },
 { FF_PROFILE_AAC_LTP,   "LTP"  },
 { FF_PROFILE_UNKNOWN },
-- 
1.7.10.4

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


[FFmpeg-devel] [PATCH 1/6] avformat/mxfdec: use MXFCodecUL struct to store essence description for data_essence_container_uls

2018-05-30 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/mxf.h|  1 +
 libavformat/mxfdec.c | 16 
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/libavformat/mxf.h b/libavformat/mxf.h
index ffcc429a8b..19f8d8a9f5 100644
--- a/libavformat/mxf.h
+++ b/libavformat/mxf.h
@@ -68,6 +68,7 @@ typedef struct MXFCodecUL {
 UID uid;
 unsigned matching_len;
 int id;
+const char *desc;
 } MXFCodecUL;
 
 typedef struct {
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index bd46572e48..1099616174 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1278,14 +1278,10 @@ static const MXFCodecUL 
mxf_sound_essence_container_uls[] = {
 };
 
 static const MXFCodecUL mxf_data_essence_container_uls[] = {
-{ { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 
}, 16, 0 },
+{ { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 
}, 16, AV_CODEC_ID_NONE, "vbi_vanc_smpte_436M" },
 { { 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 
},  0, AV_CODEC_ID_NONE },
 };
 
-static const char * const mxf_data_essence_descriptor[] = {
-"vbi_vanc_smpte_436M",
-};
-
 static int mxf_get_sorted_table_segments(MXFContext *mxf, int 
*nb_sorted_segments, MXFIndexTableSegment ***sorted_segments)
 {
 int i, j, nb_segments = 0;
@@ -2354,13 +2350,9 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 st->need_parsing = AVSTREAM_PARSE_FULL;
 }
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
-int codec_id = mxf_get_codec_ul(mxf_data_essence_container_uls,
-essence_container_ul)->id;
-if (codec_id >= 0 &&
-codec_id < FF_ARRAY_ELEMS(mxf_data_essence_descriptor)) {
-av_dict_set(&st->metadata, "data_type",
-mxf_data_essence_descriptor[codec_id], 0);
-}
+container_ul = mxf_get_codec_ul(mxf_data_essence_container_uls, 
essence_container_ul);
+if (container_ul->desc)
+av_dict_set(&st->metadata, "data_type", container_ul->desc, 0);
 }
 if (descriptor->extradata) {
 if (!ff_alloc_extradata(st->codecpar, descriptor->extradata_size)) 
{
-- 
2.16.3

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


[FFmpeg-devel] [PATCH 6/6] avformat/mxfdec: add support for recognizing timed text streams

2018-05-30 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/mxfdec.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index cf1cd71987..d9ce09cc75 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1280,6 +1280,7 @@ static const MXFCodecUL mxf_sound_essence_container_uls[] 
= {
 static const MXFCodecUL mxf_data_essence_container_uls[] = {
 { { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00 
}, 16, AV_CODEC_ID_NONE,  "vbi_smpte_436M" },
 { { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 
}, 16, AV_CODEC_ID_NONE, "vbi_vanc_smpte_436M" },
+{ { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x13,0x01,0x01 
}, 16, AV_CODEC_ID_TIMED_TEXT_MARKUP },
 { { 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 
},  0, AV_CODEC_ID_NONE },
 };
 
@@ -2351,7 +2352,13 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 st->need_parsing = AVSTREAM_PARSE_FULL;
 }
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
+enum AVMediaType type;
 container_ul = mxf_get_codec_ul(mxf_data_essence_container_uls, 
essence_container_ul);
+if (st->codecpar->codec_id == AV_CODEC_ID_NONE)
+st->codecpar->codec_id = container_ul->id;
+type = avcodec_get_type(st->codecpar->codec_id);
+if (type == AVMEDIA_TYPE_SUBTITLE)
+st->codecpar->codec_type = type;
 if (container_ul->desc)
 av_dict_set(&st->metadata, "data_type", container_ul->desc, 0);
 }
@@ -2501,6 +2508,7 @@ static const MXFMetadataReadTableEntry 
mxf_metadata_read_table[] = {
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5b,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* VBI - 
SMPTE 436M */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5c,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* 
VANC/VBI - SMPTE 436M */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5e,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* 
MPEG2AudioDescriptor */
+{ { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x64,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* DC 
Timed Text Descriptor */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 
}, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 
}, mxf_read_track, sizeof(MXFTrack), Track }, /* Generic Track */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 
}, mxf_read_timecode_component, sizeof(MXFTimecodeComponent), TimecodeComponent 
},
-- 
2.16.3

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


[FFmpeg-devel] [PATCH 5/6] avcodec/avcodec.h: add AV_CODEC_ID_TIMED_TEXT_MARKUP

2018-05-30 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavcodec/avcodec.h| 1 +
 libavcodec/codec_desc.c | 8 
 libavcodec/version.h| 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index fb0c6fae70..91ccef538e 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -665,6 +665,7 @@ enum AVCodecID {
 AV_CODEC_ID_PJS,
 AV_CODEC_ID_ASS,
 AV_CODEC_ID_HDMV_TEXT_SUBTITLE,
+AV_CODEC_ID_TIMED_TEXT_MARKUP,
 
 /* other specific kind of codecs (generally used for attachments) */
 AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,   ///< A dummy ID pointing at 
the start of various fake codecs.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 79552a910d..9d38e63284 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -3047,6 +3047,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("HDMV Text subtitle"),
 .props = AV_CODEC_PROP_TEXT_SUB,
 },
+{
+.id= AV_CODEC_ID_TIMED_TEXT_MARKUP,
+.type  = AVMEDIA_TYPE_SUBTITLE,
+.name  = "ttml",
+.long_name = NULL_IF_CONFIG_SMALL("Timed Text Markup Language"),
+.props = AV_CODEC_PROP_TEXT_SUB,
+},
+
 
 /* other kind of codecs and pseudo-codecs */
 {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f65346a1ac..5a70093eaa 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  19
-#define LIBAVCODEC_VERSION_MICRO 104
+#define LIBAVCODEC_VERSION_MICRO 105
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
-- 
2.16.3

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


[FFmpeg-devel] [PATCH 2/6] avformat/mxfdec: recognize SMPTE 436 VBI data

2018-05-30 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/mxfdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 1099616174..3d8c8e204c 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1278,6 +1278,7 @@ static const MXFCodecUL mxf_sound_essence_container_uls[] 
= {
 };
 
 static const MXFCodecUL mxf_data_essence_container_uls[] = {
+{ { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00 
}, 16, AV_CODEC_ID_NONE,  "vbi_smpte_436M" },
 { { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 
}, 16, AV_CODEC_ID_NONE, "vbi_vanc_smpte_436M" },
 { { 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 
},  0, AV_CODEC_ID_NONE },
 };
@@ -2497,6 +2498,7 @@ static const MXFMetadataReadTableEntry 
mxf_metadata_read_table[] = {
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Wave */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* AES3 */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* 
MPEG2VideoDescriptor */
+{ { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5b,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* VBI - 
SMPTE 436M */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5c,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* 
VANC/VBI - SMPTE 436M */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5e,0x00 
}, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* 
MPEG2AudioDescriptor */
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 
}, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */
-- 
2.16.3

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


[FFmpeg-devel] [PATCH 3/6] avformat/mxfdec: only disallow seek on metadata streams

2018-05-30 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/mxfdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 3d8c8e204c..e80ef62d57 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -3447,7 +3447,7 @@ static int mxf_read_seek(AVFormatContext *s, int 
stream_index, int64_t sample_ti
 MXFIndexTable *t;
 MXFTrack *source_track = st->priv_data;
 
-if(st->codecpar->codec_type == AVMEDIA_TYPE_DATA)
+if (!source_track)
 return 0;
 
 /* if audio then truncate sample_time to EditRate */
-- 
2.16.3

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


[FFmpeg-devel] [PATCH 4/6] avformat/mxfdec: remove check for NULL MXFTrack in mxf_set_pts

2018-05-30 Thread Marton Balint
It cannot happen for video streams.

Signed-off-by: Marton Balint 
---
 libavformat/mxfdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index e80ef62d57..cf1cd71987 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -3221,7 +3221,7 @@ static int mxf_set_pts(MXFContext *mxf, AVStream *st, 
AVPacket *pkt, int64_t nex
 if (mxf->nb_index_tables >= 1 && mxf->current_edit_unit < t->nb_ptses) 
{
 pkt->dts = mxf->current_edit_unit + t->first_dts;
 pkt->pts = t->ptses[mxf->current_edit_unit];
-} else if (track && track->intra_only) {
+} else if (track->intra_only) {
 /* intra-only -> PTS = EditUnit.
  * let utils.c figure out DTS since it can be < PTS if low_delay = 
0 (Sony IMX30) */
 pkt->pts = mxf->current_edit_unit;
-- 
2.16.3

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


Re: [FFmpeg-devel] Patch: Replace quotes for inline asm detection.

2018-05-30 Thread Michael Niedermayer
On Wed, May 30, 2018 at 09:48:51AM -0700, Frank Liberato wrote:
> Please find attached a one line patch:
> 
> 
> > Commit 8c893aa3cd5 removed quotes that were required to detect
> > inline asm in clank:
> >
> > check_insn armv5te qadd r0, r0, r0
> > .../test.c:1:34: error: expected string literal in 'asm'
> > void foo(void){ __asm__ volatile(qadd r0, r0, r0); }
> >
> > The correct code is:
> >
> > void foo(void){ __asm__ volatile("qadd r0, r0, r0"); }
> 
> 
> Thanks
> Frank

>  configure |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 2d51797903ad2f3cab321e72bf5e7209116c3dae  
> 0001-Replace-quotes-for-inline-asm-detection.patch
> From 58c96127b6f1510b956b2280049d1c3778e3cab4 Mon Sep 17 00:00:00 2001
> From: "liber...@chromium.org" 
> Date: Tue, 29 May 2018 11:35:04 -0700
> Subject: [PATCH] Replace quotes for inline asm detection.
> 
> Commit 8c893aa3cd5 removed quotes that were required to detect
> inline asm in clank:
> 
> check_insn armv5te qadd r0, r0, r0
> .../test.c:1:34: error: expected string literal in 'asm'
> void foo(void){ __asm__ volatile(qadd r0, r0, r0); }
> 
> The correct code is:
> 
> void foo(void){ __asm__ volatile("qadd r0, r0, r0"); }
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 22eeca22a5..4dbee8d349 100755
> --- a/configure
> +++ b/configure
> @@ -1040,7 +1040,7 @@ EOF
>  
>  check_insn(){
>  log check_insn "$@"
> -check_inline_asm ${1}_inline "$2"
> +check_inline_asm ${1}_inline "\"$2\""
>  check_as ${1}_external "$2"
>  }

This seems to break my arm qemu build:

In file included from src/libavutil/intmath.h:30:0,
 from src/libavutil/common.h:106,
 from src/libavutil/avutil.h:296,
 from src/libavutil/imgutils.h:30,
 from src/libavfilter/vf_amplify.c:21:
src/libavutil/arm/intmath.h: In function ‘amplify_frame’:
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints [enabled by default]
src/libavutil/arm/intmath.h:77:5: error: impossible constraint in ‘asm’
make: *** [libavfilter/vf_amplify.o] Error 1
make: *** Waiting for unfinished jobs
src/libavfilter/src_movie.c: In function ‘open_stream’:
src/libavfilter/src_movie.c:175:5: warning: ‘refcounted_frames’ is deprecated 
(declared at src/libavcodec/avcodec.h:2345) [-Wdeprecated-declarations]
src/libavfilter/src_movie.c: In function ‘movie_push_frame’:
src/libavfilter/src_movie.c:529:9: warning: ‘avcodec_decode_video2’ is 
deprecated (declared at src/libavcodec/avcodec.h:4756) 
[-Wdeprecated-declarations]
src/libavfilter/src_movie.c:532:9: warning: ‘avcodec_decode_audio4’ is 
deprecated (declared at src/libavcodec/avcodec.h:4707) 
[-Wdeprecated-declarations]
src/libavfilter/vaf_spectrumsynth.c: In function ‘try_push_frame’:
src/libavfilter/vaf_spectrumsynth.c:429:12: warning: ‘end’ may be used 
uninitialized in this function [-Wuninitialized]
src/libavfilter/vaf_spectrumsynth.c:428:14: warning: ‘start’ may be used 
uninitialized in this function [-Wuninitialized]
src/libavfilter/vaf_spectrumsynth.c: In function ‘try_push_frames’:
src/libavfilter/vaf_spectrumsynth.c:437:9: warning: ‘ret’ may be used 
uninitialized in this function [-Wuninitialized]

arm-linux-gnueabi-gcc-4.6 (Debian 4.6.3-15) 4.6.3

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


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


Re: [FFmpeg-devel] Patch: Replace quotes for inline asm detection.

2018-05-30 Thread James Almer
On 5/30/2018 10:32 PM, Michael Niedermayer wrote:
> On Wed, May 30, 2018 at 09:48:51AM -0700, Frank Liberato wrote:
>> Please find attached a one line patch:
>>
>>
>>> Commit 8c893aa3cd5 removed quotes that were required to detect
>>> inline asm in clank:
>>>
>>> check_insn armv5te qadd r0, r0, r0
>>> .../test.c:1:34: error: expected string literal in 'asm'
>>> void foo(void){ __asm__ volatile(qadd r0, r0, r0); }
>>>
>>> The correct code is:
>>>
>>> void foo(void){ __asm__ volatile("qadd r0, r0, r0"); }
>>
>>
>> Thanks
>> Frank
> 
>>  configure |2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 2d51797903ad2f3cab321e72bf5e7209116c3dae  
>> 0001-Replace-quotes-for-inline-asm-detection.patch
>> From 58c96127b6f1510b956b2280049d1c3778e3cab4 Mon Sep 17 00:00:00 2001
>> From: "liber...@chromium.org" 
>> Date: Tue, 29 May 2018 11:35:04 -0700
>> Subject: [PATCH] Replace quotes for inline asm detection.
>>
>> Commit 8c893aa3cd5 removed quotes that were required to detect
>> inline asm in clank:
>>
>> check_insn armv5te qadd r0, r0, r0
>> .../test.c:1:34: error: expected string literal in 'asm'
>> void foo(void){ __asm__ volatile(qadd r0, r0, r0); }
>>
>> The correct code is:
>>
>> void foo(void){ __asm__ volatile("qadd r0, r0, r0"); }
>> ---
>>  configure | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index 22eeca22a5..4dbee8d349 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1040,7 +1040,7 @@ EOF
>>  
>>  check_insn(){
>>  log check_insn "$@"
>> -check_inline_asm ${1}_inline "$2"
>> +check_inline_asm ${1}_inline "\"$2\""
>>  check_as ${1}_external "$2"
>>  }
> 
> This seems to break my arm qemu build:

That'd be because vf_amplify is calling av_clip_uintp2() with a non
immediate value. The arm optimized function makes an immediate value as
second argument a requirement, so av_clip_uintp2_c() should be used
there instead.

This means 3c56d673418/8c893aa3cd5 broke detection of arm inline asm
features for your qemu builds as well, and this patch restores that
functionality.

> 
> In file included from src/libavutil/intmath.h:30:0,
>  from src/libavutil/common.h:106,
>  from src/libavutil/avutil.h:296,
>  from src/libavutil/imgutils.h:30,
>  from src/libavfilter/vf_amplify.c:21:
> src/libavutil/arm/intmath.h: In function ‘amplify_frame’:
> src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t 
> match constraints [enabled by default]
> src/libavutil/arm/intmath.h:77:5: error: impossible constraint in ‘asm’
> make: *** [libavfilter/vf_amplify.o] Error 1
> make: *** Waiting for unfinished jobs
> src/libavfilter/src_movie.c: In function ‘open_stream’:
> src/libavfilter/src_movie.c:175:5: warning: ‘refcounted_frames’ is deprecated 
> (declared at src/libavcodec/avcodec.h:2345) [-Wdeprecated-declarations]
> src/libavfilter/src_movie.c: In function ‘movie_push_frame’:
> src/libavfilter/src_movie.c:529:9: warning: ‘avcodec_decode_video2’ is 
> deprecated (declared at src/libavcodec/avcodec.h:4756) 
> [-Wdeprecated-declarations]
> src/libavfilter/src_movie.c:532:9: warning: ‘avcodec_decode_audio4’ is 
> deprecated (declared at src/libavcodec/avcodec.h:4707) 
> [-Wdeprecated-declarations]
> src/libavfilter/vaf_spectrumsynth.c: In function ‘try_push_frame’:
> src/libavfilter/vaf_spectrumsynth.c:429:12: warning: ‘end’ may be used 
> uninitialized in this function [-Wuninitialized]
> src/libavfilter/vaf_spectrumsynth.c:428:14: warning: ‘start’ may be used 
> uninitialized in this function [-Wuninitialized]
> src/libavfilter/vaf_spectrumsynth.c: In function ‘try_push_frames’:
> src/libavfilter/vaf_spectrumsynth.c:437:9: warning: ‘ret’ may be used 
> uninitialized in this function [-Wuninitialized]
> 
> arm-linux-gnueabi-gcc-4.6 (Debian 4.6.3-15) 4.6.3

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


Re: [FFmpeg-devel] [PATCH 5/6] avcodec/avcodec.h: add AV_CODEC_ID_TIMED_TEXT_MARKUP

2018-05-30 Thread Rostislav Pehlivanov
On 31 May 2018 at 01:05, Marton Balint  wrote:

> Signed-off-by: Marton Balint 
> ---
>  libavcodec/avcodec.h| 1 +
>  libavcodec/codec_desc.c | 8 
>  libavcodec/version.h| 2 +-
>  3 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index fb0c6fae70..91ccef538e 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -665,6 +665,7 @@ enum AVCodecID {
>  AV_CODEC_ID_PJS,
>  AV_CODEC_ID_ASS,
>  AV_CODEC_ID_HDMV_TEXT_SUBTITLE,
> +AV_CODEC_ID_TIMED_TEXT_MARKUP,
>
>  /* other specific kind of codecs (generally used for attachments) */
>  AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,   ///< A dummy ID
> pointing at the start of various fake codecs.
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 79552a910d..9d38e63284 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -3047,6 +3047,14 @@ static const AVCodecDescriptor codec_descriptors[]
> = {
>  .long_name = NULL_IF_CONFIG_SMALL("HDMV Text subtitle"),
>  .props = AV_CODEC_PROP_TEXT_SUB,
>  },
> +{
> +.id= AV_CODEC_ID_TIMED_TEXT_MARKUP,
> +.type  = AVMEDIA_TYPE_SUBTITLE,
> +.name  = "ttml",
> +.long_name = NULL_IF_CONFIG_SMALL("Timed Text Markup Language"),
> +.props = AV_CODEC_PROP_TEXT_SUB,
> +},
> +
>
>  /* other kind of codecs and pseudo-codecs */
>  {
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index f65346a1ac..5a70093eaa 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -29,7 +29,7 @@
>
>  #define LIBAVCODEC_VERSION_MAJOR  58
>  #define LIBAVCODEC_VERSION_MINOR  19
> -#define LIBAVCODEC_VERSION_MICRO 104
> +#define LIBAVCODEC_VERSION_MICRO 105
>
>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR,
> \
> LIBAVCODEC_VERSION_MINOR, \
> --
> 2.16.3
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

I'd prefer AV_CODEC_ID_TTML, TTML is how pretty much everyone refers to it
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] avformat/flvdec: reindent code for previous commit

2018-05-30 Thread Steven Liu
Signed-off-by: Steven Liu 
---
 libavformat/flvdec.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 861cf7c020..f65542711e 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -1254,19 +1254,19 @@ retry_duration:
 leave:
 last = avio_rb32(s->pb);
 if (!flv->trust_datasize) {
-if (last != orig_size + 11 && last != orig_size + 10 &&
-!avio_feof(s->pb) &&
-(last != orig_size || !last) && last != flv->sum_flv_tag_size &&
-!flv->broken_sizes) {
-av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d %d\n", last, orig_size 
+ 11, flv->sum_flv_tag_size);
-avio_seek(s->pb, pos + 1, SEEK_SET);
-ret = resync(s);
-av_packet_unref(pkt);
-if (ret >= 0) {
-goto retry;
+if (last != orig_size + 11 && last != orig_size + 10 &&
+!avio_feof(s->pb) &&
+(last != orig_size || !last) && last != flv->sum_flv_tag_size &&
+!flv->broken_sizes) {
+av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d %d\n", last, 
orig_size + 11, flv->sum_flv_tag_size);
+avio_seek(s->pb, pos + 1, SEEK_SET);
+ret = resync(s);
+av_packet_unref(pkt);
+if (ret >= 0) {
+goto retry;
+}
 }
 }
-}
 return ret;
 }
 
-- 
2.15.1



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


[FFmpeg-devel] [PATCH] avformat/hlsenc: reimplement randomize of hls use av_get_random_seed

2018-05-30 Thread Steven Liu
for support use the mbedtls

Signed-off-by: Steven Liu 
---
 libavformat/hlsenc.c | 22 +++---
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 9c06551ea6..17b464f540 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -569,18 +569,13 @@ fail:
 return ret;
 }
 
-static int randomize(uint8_t *buf, int len)
+
+static void randomize(uint8_t *buf, int len)
 {
-#if CONFIG_GCRYPT
-gcry_randomize(buf, len, GCRY_VERY_STRONG_RANDOM);
-return 0;
-#elif CONFIG_OPENSSL
-if (RAND_bytes(buf, len))
-return 0;
-#else
-return AVERROR(ENOSYS);
-#endif
-return AVERROR(EINVAL);
+uint32_t tmp_number[2];
+tmp_number[0] = av_get_random_seed();
+tmp_number[1] = av_get_random_seed();
+memcpy(buf, iv, len);
 }
 
 static int do_encrypt(AVFormatContext *s, VariantStream *vs)
@@ -633,10 +628,7 @@ static int do_encrypt(AVFormatContext *s, VariantStream 
*vs)
 
 if (!*hls->key_string) {
 if (!hls->key) {
-if ((ret = randomize(key, sizeof(key))) < 0) {
-av_log(s, AV_LOG_ERROR, "Cannot generate a strong random 
key\n");
-return ret;
-}
+randomize(key, sizeof(key));
 } else {
 memcpy(key, hls->key, sizeof(key));
 }
-- 
2.15.1



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


[FFmpeg-devel] [PATCH 1/2] avformat/flvdec: add flv_ignore_prevtag option into flvdec

2018-05-30 Thread Steven Liu
dump the problem flv to problem_flv.flv.
liuqideMacBook-Pro:xxx liuqi$ dd if=~/Movies/Test/1.flv of=problem_flv.flv 
count=81920 bs=1
81920+0 records in
81920+0 records out
81920 bytes transferred in 0.767041 secs (106800 bytes/sec)

before this patch:
liuqideMacBook-Pro:xxx liuqi$ ./ffplay problem_flv.flv
ffplay version N-91141-gc24d247e2c Copyright (c) 2003-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
  configuration: --enable-fontconfig --enable-gpl --enable-libass 
--enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex 
--enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 
--cc='ccache gcc' --enable-nonfree --enable-videotoolbox --enable-opengl 
--enable-libxml2 --enable-libsrt
  libavutil  56. 18.102 / 56. 18.102
  libavcodec 58. 19.102 / 58. 19.102
  libavformat58. 16.100 / 58. 16.100
  libavdevice58.  4.100 / 58.  4.100
  libavfilter 7. 24.100 /  7. 24.100
  libswscale  5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc55.  2.100 / 55.  2.100
[flv @ 0x7fcfe5821e00] Packet mismatch 355 352 352
problem_flv.flv: could not find codec parameters

after this patch:
liuqideMacBook-Pro:xxx liuqi$ ./ffplay -flv_ignore_prevtag 1 problem_flv.flv
ffplay version N-91141-gc24d247e2c Copyright (c) 2003-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
  configuration: --enable-fontconfig --enable-gpl --enable-libass 
--enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex 
--enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 
--cc='ccache gcc' --enable-nonfree --enable-videotoolbox --enable-opengl 
--enable-libxml2 --enable-libsrt
  libavutil  56. 18.102 / 56. 18.102
  libavcodec 58. 19.102 / 58. 19.102
  libavformat58. 16.100 / 58. 16.100
  libavdevice58.  4.100 / 58.  4.100
  libavfilter 7. 24.100 /  7. 24.100
  libswscale  5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc55.  2.100 / 55.  2.100
Input #0, flv, from 'problem_flv.flv':
  Metadata:
fileSize: 102128061
audiochannels   : 2
encoder : obs-output module (libobs version 0.10.1)
  Duration: 00:05:09.60, start: 0.00, bitrate: 2 kb/s
Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 131 kb/s
Stream #0:1: Video: h264 (High), yuv420p(tv, bt709, progressive), 960x600, 
2560 kb/s, 30 fps, 30 tbr, 1k tbn, 60 tbc
[h264 @ 0x7fdf64122a00] Invalid NAL unit size (10375 > 1656).=0/0
[h264 @ 0x7fdf64122a00] Error splitting the input into NAL units.
   2.14 A-V: -0.013 fd=   0 aq=0KB vq=0KB sq=0B f=0/0

Signed-off-by: Steven Liu 
---
 doc/demuxers.texi| 3 +++
 libavformat/flvdec.c | 4 
 2 files changed, 7 insertions(+)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 072918be28..5007e6339f 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -269,6 +269,9 @@ ffmpeg -f live_flv -i rtmp:///anything/key 
 @table @option
 @item -flv_metadata @var{bool}
 Allocate the streams according to the onMetaData array content.
+
+@item -flv_ignore_prevtag @var{bool}
+Ignore the size of previous tag value.
 @end table
 
 @section gif
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 34c3e08bad..861cf7c020 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -44,6 +44,7 @@
 typedef struct FLVContext {
 const AVClass *class; ///< Class for private options.
 int trust_metadata;   ///< configure streams according onMetaData
+int trust_datasize;   ///< trust data size of FLVTag
 int wrong_dts;///< wrong dts due to negative cts
 uint8_t *new_extradata[FLV_STREAM_TYPE_NB];
 int new_extradata_size[FLV_STREAM_TYPE_NB];
@@ -1252,6 +1253,7 @@ retry_duration:
 
 leave:
 last = avio_rb32(s->pb);
+if (!flv->trust_datasize) {
 if (last != orig_size + 11 && last != orig_size + 10 &&
 !avio_feof(s->pb) &&
 (last != orig_size || !last) && last != flv->sum_flv_tag_size &&
@@ -1264,6 +1266,7 @@ leave:
 goto retry;
 }
 }
+}
 return ret;
 }
 
@@ -1279,6 +1282,7 @@ static int flv_read_seek(AVFormatContext *s, int 
stream_index,
 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
 { "flv_metadata", "Allocate streams according to the onMetaData array", 
OFFSET(trust_metadata), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
+{ "flv_ignore_prevtag", "Ignore the Size of previous tag", 
OFFSET(trust_datasize), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
 { "missing_streams", "", OFFSET(missing_streams), AV_OPT_TYPE_INT, { .i64 
= 0 }, 0, 0xFF, VD | AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
 { NULL }
 };
-- 
2.15.1



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


[FFmpeg-devel] [PATCH] avformat/flvdec: add flv_full_metadata option into flvdec

2018-05-30 Thread Steven Liu
output all the metadata context when use this option.

Signed-off-by: Steven Liu 
---
 doc/demuxers.texi| 3 +++
 libavformat/flvdec.c | 6 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 5007e6339f..aad94eb50e 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -272,6 +272,9 @@ Allocate the streams according to the onMetaData array 
content.
 
 @item -flv_ignore_prevtag @var{bool}
 Ignore the size of previous tag value.
+
+@item -flv_full_metadata @var{bool}
+Output all context of the onMetadata.
 @end table
 
 @section gif
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index f65542711e..52280c2e3d 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -45,6 +45,7 @@ typedef struct FLVContext {
 const AVClass *class; ///< Class for private options.
 int trust_metadata;   ///< configure streams according onMetaData
 int trust_datasize;   ///< trust data size of FLVTag
+int dump_full_metadata;   ///< Dump full metadata of the onMetadata
 int wrong_dts;///< wrong dts due to negative cts
 uint8_t *new_extradata[FLV_STREAM_TYPE_NB];
 int new_extradata_size[FLV_STREAM_TYPE_NB];
@@ -612,7 +613,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
 (!vpar && !strcmp(key, "videocodecid"
 s->ctx_flags &= ~AVFMTCTX_NOHEADER; //If there is either 
audio/video missing, codecid will be an empty object
 
-if (!strcmp(key, "duration")||
+if ((!strcmp(key, "duration")||
 !strcmp(key, "filesize")||
 !strcmp(key, "width")   ||
 !strcmp(key, "height")  ||
@@ -624,7 +625,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
 !strcmp(key, "audiosamplesize") ||
 !strcmp(key, "stereo")  ||
 !strcmp(key, "audiocodecid")||
-!strcmp(key, "datastream"))
+!strcmp(key, "datastream")) && !flv->dump_full_metadata)
 return 0;
 
 s->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
@@ -1282,6 +1283,7 @@ static int flv_read_seek(AVFormatContext *s, int 
stream_index,
 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
 { "flv_metadata", "Allocate streams according to the onMetaData array", 
OFFSET(trust_metadata), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
+{ "flv_full_metadata", "Dump full metadata of the onMetadata", 
OFFSET(dump_full_metadata), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
 { "flv_ignore_prevtag", "Ignore the Size of previous tag", 
OFFSET(trust_datasize), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
 { "missing_streams", "", OFFSET(missing_streams), AV_OPT_TYPE_INT, { .i64 
= 0 }, 0, 0xFF, VD | AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
 { NULL }
-- 
2.15.1



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


Re: [FFmpeg-devel] [PATCH 1/2] avformat/flvdec: add flv_ignore_prevtag option into flvdec

2018-05-30 Thread Steven Liu


> On May 31, 2018, at 12:40, Steven Liu  wrote:
> 
> dump the problem flv to problem_flv.flv.
> liuqideMacBook-Pro:xxx liuqi$ dd if=~/Movies/Test/1.flv of=problem_flv.flv 
> count=81920 bs=1
> 81920+0 records in
> 81920+0 records out
> 81920 bytes transferred in 0.767041 secs (106800 bytes/sec)
> 
> before this patch:
> liuqideMacBook-Pro:xxx liuqi$ ./ffplay problem_flv.flv
> ffplay version N-91141-gc24d247e2c Copyright (c) 2003-2018 the FFmpeg 
> developers
>  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
>  configuration: --enable-fontconfig --enable-gpl --enable-libass 
> --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex 
> --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 
> --cc='ccache gcc' --enable-nonfree --enable-videotoolbox --enable-opengl 
> --enable-libxml2 --enable-libsrt
>  libavutil  56. 18.102 / 56. 18.102
>  libavcodec 58. 19.102 / 58. 19.102
>  libavformat58. 16.100 / 58. 16.100
>  libavdevice58.  4.100 / 58.  4.100
>  libavfilter 7. 24.100 /  7. 24.100
>  libswscale  5.  2.100 /  5.  2.100
>  libswresample   3.  2.100 /  3.  2.100
>  libpostproc55.  2.100 / 55.  2.100
> [flv @ 0x7fcfe5821e00] Packet mismatch 355 352 352
> problem_flv.flv: could not find codec parameters
> 
> after this patch:
> liuqideMacBook-Pro:xxx liuqi$ ./ffplay -flv_ignore_prevtag 1 problem_flv.flv
> ffplay version N-91141-gc24d247e2c Copyright (c) 2003-2018 the FFmpeg 
> developers
>  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
>  configuration: --enable-fontconfig --enable-gpl --enable-libass 
> --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex 
> --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 
> --cc='ccache gcc' --enable-nonfree --enable-videotoolbox --enable-opengl 
> --enable-libxml2 --enable-libsrt
>  libavutil  56. 18.102 / 56. 18.102
>  libavcodec 58. 19.102 / 58. 19.102
>  libavformat58. 16.100 / 58. 16.100
>  libavdevice58.  4.100 / 58.  4.100
>  libavfilter 7. 24.100 /  7. 24.100
>  libswscale  5.  2.100 /  5.  2.100
>  libswresample   3.  2.100 /  3.  2.100
>  libpostproc55.  2.100 / 55.  2.100
> Input #0, flv, from 'problem_flv.flv':
>  Metadata:
>fileSize: 102128061
>audiochannels   : 2
>encoder : obs-output module (libobs version 0.10.1)
>  Duration: 00:05:09.60, start: 0.00, bitrate: 2 kb/s
>Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 131 kb/s
>Stream #0:1: Video: h264 (High), yuv420p(tv, bt709, progressive), 960x600, 
> 2560 kb/s, 30 fps, 30 tbr, 1k tbn, 60 tbc
> [h264 @ 0x7fdf64122a00] Invalid NAL unit size (10375 > 1656).=0/0
> [h264 @ 0x7fdf64122a00] Error splitting the input into NAL units.
>   2.14 A-V: -0.013 fd=   0 aq=0KB vq=0KB sq=0B f=0/0
> 
> Signed-off-by: Steven Liu 
> ---
> doc/demuxers.texi| 3 +++
> libavformat/flvdec.c | 4 
> 2 files changed, 7 insertions(+)
> 
> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> index 072918be28..5007e6339f 100644
> --- a/doc/demuxers.texi
> +++ b/doc/demuxers.texi
> @@ -269,6 +269,9 @@ ffmpeg -f live_flv -i rtmp:///anything/key 
> 
> @table @option
> @item -flv_metadata @var{bool}
> Allocate the streams according to the onMetaData array content.
> +
> +@item -flv_ignore_prevtag @var{bool}
> +Ignore the size of previous tag value.
> @end table
> 
> @section gif
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index 34c3e08bad..861cf7c020 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -44,6 +44,7 @@
> typedef struct FLVContext {
> const AVClass *class; ///< Class for private options.
> int trust_metadata;   ///< configure streams according onMetaData
> +int trust_datasize;   ///< trust data size of FLVTag
> int wrong_dts;///< wrong dts due to negative cts
> uint8_t *new_extradata[FLV_STREAM_TYPE_NB];
> int new_extradata_size[FLV_STREAM_TYPE_NB];
> @@ -1252,6 +1253,7 @@ retry_duration:
> 
> leave:
> last = avio_rb32(s->pb);
> +if (!flv->trust_datasize) {
> if (last != orig_size + 11 && last != orig_size + 10 &&
> !avio_feof(s->pb) &&
> (last != orig_size || !last) && last != flv->sum_flv_tag_size &&
> @@ -1264,6 +1266,7 @@ leave:
> goto retry;
> }
> }
> +}
> return ret;
> }
> 
> @@ -1279,6 +1282,7 @@ static int flv_read_seek(AVFormatContext *s, int 
> stream_index,
> #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
> static const AVOption options[] = {
> { "flv_metadata", "Allocate streams according to the onMetaData array", 
> OFFSET(trust_metadata), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
> +{ "flv_ignore_prevtag", "Ignore the Size of previous tag", 
> OFFSET(trust_datasize), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
> { "missing_streams", "", OFFSET(missing_streams), AV_OPT_TYPE_INT, { .i64 
> = 0 }, 0, 0xFF, VD | AV_OPT_FLAG_EXPORT | AV

Re: [FFmpeg-devel] [PATCH] doc/ffmpeg - rewrite Stream Selection chapter

2018-05-30 Thread Gyan Doshi



On 31-05-2018 04:35 AM, Michael Niedermayer wrote:


If a user consults the relevant parts of the documentation before execution,
they should be able to predict how the program will behave. If they do it
afterwards, they should understand what the program did. Even though FFmpeg
is an open source project, end users of the CLI tools aren't expected to
understand or dive into the source to grasp how the program behaves. It's
the job of the docs to convey descriptions of behaviour that will affect
what the end user expects the program to do. Do you disagree?


This will only work to some extend
Different version will and probably do behave slightly different.


The docs on the website are only for git master.


I still think its important to draw a line between what is
A. intended to behave exactly as it does
B. behaves one way and is just documented to do so.

Case A is much more likely to be conserved over time
Case B may change in the implementation whenever it feels convenient to the
developers i suspect ...



in a few years this document is maybe still 70% accurate. It would be
usefull if people today could have a good guess what part will be that 70%
today, so they could write code that is future proof ...


Agreed. But that depends on the devs recording their intentions in 
writing. In this particular case, I don't see any TODO, FIXME or similar 
notes. The code has remained relatively the same for a few years now. If 
you know what the 70% is, in this case, I'll note that.


I'll add a disclaimer about ffmpeg being under active development and 
that the docs are maintained on a best-effort basis.


Regards,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [RFC] libfdk_aac license

2018-05-30 Thread Gyan Doshi



"The Fraunhofer AAC library is licensed under a license incompatible to
  the GPL. Therefore, for GPL builds, you have to pass
  @code{--enable-nonfree} to configure to use it. To the best of our
  knowledge, it is compatible with the LGPL" ?


Will push in a day with above changes.

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


Re: [FFmpeg-devel] [PATCH] doc/ffmpeg - rewrite Stream Selection chapter

2018-05-30 Thread Gyan Doshi



On 31-05-2018 02:00 AM, Lou Logan wrote:

On Tue, May 29, 2018, at 9:43 PM, Gyan Doshi wrote:

Works when "--init-file=doc/t2h.pm" is omitted. Didn't investigate further.


make uses the init file here. makeinfo is texi2any 6.3

makeinfo --html -I doc --no-split -D config-not-all 
--init-file=/ffmpeg/src/doc/t2h.pm --output doc/ffmpeg.html 
/ffmpeg/src/doc/ffmpeg.texi



Can you run this on the server to check if subsubheadings are rendered?

Thanks,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [RFC] libfdk_aac license

2018-05-30 Thread Mark Harris
>> "The Fraunhofer AAC library is licensed under a license incompatible to

s/to/with/

>>   the GPL. Therefore, for GPL builds, you have to pass
>>   @code{--enable-nonfree} to configure to use it. To the best of our
>>   knowledge, it is compatible with the LGPL" ?

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