Re: [libav-devel] [PATCH 1/3] movenc: Add an option for enabling negative CTS offsets

2017-02-22 Thread Yusuke Nakamura
2017-02-20 6:22 GMT+09:00 Martin Storsjö :

> This reduces the need for an edit list; streams that start with
> e.g. dts=-1, pts=0 can be encoded as dts=0, pts=0 (which is valid
> in mov/mp4) by shifting the dts values of all packets forward.
> This avoids the need for edit lists for such streams (while they
> still are needed for audio streams with encoder delay).
> ---
>  libavformat/movenc.c | 24 
>  libavformat/movenc.h |  2 ++
>  2 files changed, 22 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 840190d..713c145 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -62,6 +62,7 @@ static const AVOption options[] = {
>  { "delay_moov", "Delay writing the initial moov until the first
> fragment is cut, or until the first fragment flush", 0, AV_OPT_TYPE_CONST,
> {.i64 = FF_MOV_FLAG_DELAY_MOOV}, INT_MIN, INT_MAX,
> AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
>  { "global_sidx", "Write a global sidx index at the start of the
> file", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_GLOBAL_SIDX}, INT_MIN,
> INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
>  { "skip_trailer", "Skip writing the mfra/tfra/mfro trailer for
> fragmented files", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_SKIP_TRAILER},
> INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
> +{ "negative_cts_offsets", "Use negative CTS offsets (reducing the
> need for edit lists)", 0, AV_OPT_TYPE_CONST, {.i64 =
> FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS}, INT_MIN, INT_MAX,
> AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
>  FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
>  { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext,
> iods_skip), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
>  { "iods_audio_profile", "iods audio profile atom.",
> offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.i64 = -1},
> -1, 255, AV_OPT_FLAG_ENCODING_PARAM},
> @@ -1163,8 +1164,9 @@ static int mov_write_stsd_tag(AVFormatContext *s,
> AVIOContext *pb, MOVTrack *tra
>  return update_size(pb, pos);
>  }
>
> -static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
> +static int mov_write_ctts_tag(AVFormatContext *s, AVIOContext *pb,
> MOVTrack *track)
>  {
> +MOVMuxContext *mov = s->priv_data;
>  MOVStts *ctts_entries;
>  uint32_t entries = 0;
>  uint32_t atom_size;
> @@ -1188,7 +1190,11 @@ static int mov_write_ctts_tag(AVIOContext *pb,
> MOVTrack *track)
>  atom_size = 16 + (entries * 8);
>  avio_wb32(pb, atom_size); /* size */
>  ffio_wfourcc(pb, "ctts");
> -avio_wb32(pb, 0); /* version & flags */
> +if (mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS)
> +avio_w8(pb, 1); /* version */
>

ctts ver. 1 is defined in iso4 or later isobmff brands.


> +else
> +avio_w8(pb, 0); /* version */
> +avio_wb24(pb, 0); /* flags */
>  avio_wb32(pb, entries); /* entry count */
>  for (i = 0; i < entries; i++) {
>  avio_wb32(pb, ctts_entries[i].count);
> @@ -1273,7 +1279,7 @@ static int mov_write_stbl_tag(AVFormatContext *s,
> AVIOContext *pb, MOVTrack *tra
>  mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE);
>  if (track->par->codec_type == AVMEDIA_TYPE_VIDEO &&
>  track->flags & MOV_TRACK_CTTS && track->entry)
> -mov_write_ctts_tag(pb, track);
> +mov_write_ctts_tag(s, pb, track);
>  mov_write_stsc_tag(pb, track);
>  mov_write_stsz_tag(pb, track);
>  mov_write_stco_tag(pb, track);
> @@ -2594,7 +2600,10 @@ static int mov_write_trun_tag(AVIOContext *pb,
> MOVMuxContext *mov,
>
>  avio_wb32(pb, 0); /* size placeholder */
>  ffio_wfourcc(pb, "trun");
> -avio_w8(pb, 0); /* version */
> +if (mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS)
> +avio_w8(pb, 1); /* version */
> +else
> +avio_w8(pb, 0); /* version */
>  avio_wb24(pb, flags);
>
>  avio_wb32(pb, end - first); /* sample count */
> @@ -3729,6 +3738,12 @@ static int mov_write_packet(AVFormatContext *s,
> AVPacket *pkt)
>  mov->flags &= ~FF_MOV_FLAG_FRAG_DISCONT;
>  }
>
> +if (mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS) {
> +if (trk->dts_shift == AV_NOPTS_VALUE)
> +trk->dts_shift = pkt->pts - pkt->dts;
>

Do you care about an issue of negative composition time offset on early
flush of movie fragments? Reordering of leading samples could confuse
demuxers due to the non-zero cts of the first sample and no examination
about subsequent samples. This can be occured when starting to remux from
Open-GOP boundary (also, don't forget that AVC and HEVC can output P or B
pictures before IDR picture).


> +pkt->dts += trk->dts_shift;
> +}
> +
>  if (!pkt->size) {
>  if (trk->start_dts == AV_NOPTS_VALUE && trk->frag_discont) {
>  trk->start_dts = pkt->dts;
> @@ -4095,6 +4110,7 @@ static int 

Re: [libav-devel] [PATCH 2/3] movenc: Don't write any edit list if the start offset is zero

2017-02-22 Thread Yusuke Nakamura
2017-02-22 6:45 GMT+09:00 Martin Storsjö :

> Hi Yusuke,
>
>
> On Wed, 22 Feb 2017, Yusuke Nakamura wrote:
>
> 2017-02-20 6:22 GMT+09:00 Martin Storsjö :
>>
>> In these cases, the CTTS flag is set, but no edit list is necessary.
>>> ---
>>>  libavformat/movenc.c | 3 +--
>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>>> index 713c145..f1c2253 100644
>>> --- a/libavformat/movenc.c
>>> +++ b/libavformat/movenc.c
>>> @@ -1811,8 +1811,7 @@ static int mov_write_trak_tag(AVIOContext *pb,
>>> MOVMuxContext *mov,
>>>  ffio_wfourcc(pb, "trak");
>>>  mov_write_tkhd_tag(pb, mov, track, st);
>>>  if (track->start_dts != AV_NOPTS_VALUE &&
>>> -(track->mode == MODE_PSP || track->flags & MOV_TRACK_CTTS ||
>>> -track->start_dts || is_clcp_track(track))) {
>>> +(track->mode == MODE_PSP || track->start_dts ||
>>> is_clcp_track(track))) {
>>>  if (mov->use_editlist)
>>>  mov_write_edts_tag(pb, mov, track);  // PSP Movies require
>>> edts box
>>>  else if ((track->entry && track->cluster[0].dts) || track->mode
>>> == MODE_PSP || is_clcp_track(track))
>>> --
>>> 2.10.1 (Apple Git-78)
>>>
>>> ___
>>> libav-devel mailing list
>>> libav-devel@libav.org
>>> https://lists.libav.org/mailman/listinfo/libav-devel
>>>
>>
>>
>> I dislike this patch since an implicit one‐to‐one mapping of presentation
>> timeline and media timeline does not specify the relative rate. For
>> example, QuickTime plays a track at double rate relative to a
>> corresponding
>> media if the media duration is twice as much as the track duration.
>>
>
> I don't really follow in which concrete case this patch would make a
> difference? With patch 1/3 applied, if one enables the negative_cts_offsets
> flag that I added, one will end up with an unnecessary edit list. As far as
> I can see right now, this is the only case where this patch (currently)
> would make any difference.
>
> Is there any case where it's beneficial to write out an edit list even
> though it's with media_time = 0, and with the full duration of the track?
>

I see. this patch makes no change in existing implementation.

This is a good time to tell about my stance.
I think, basically, edit lists should be write as much as possible to
indicate writer's intention. At least within descriptions of the current
isobmff spec, demuxers might interpret implicit edits as they like. (i
realized that it's too difficult to understand how edits work even if edits
are explicit things while reading drafts and defect reports flowing on
mp4-sys ml. apparently edit list is veiled in mystery even for mpeg
members). The spec does not explicitly say a track presentation starts from
composition time 0, only says that all tracks start from presentation time
0 when edit list is absent, and the spec does not specify rule to determine
the relative rate,thus, those behavior cannot be predicted on wild demuxers.

I'm sorry for making a noise.


> // Martin
>
> ___
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
>
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 1/3] movenc: Add an option for enabling negative CTS offsets

2017-02-22 Thread Jan Ekstrom
On Sun, Feb 19, 2017 at 11:22 PM, Martin Storsjö  wrote:
> This reduces the need for an edit list; streams that start with
> e.g. dts=-1, pts=0 can be encoded as dts=0, pts=0 (which is valid
> in mov/mp4) by shifting the dts values of all packets forward.
> This avoids the need for edit lists for such streams (while they
> still are needed for audio streams with encoder delay).
> ---

Cool stuff. Did some general testing and it seems to work nicely!

Thus, LGTM from me.

Jan
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] movenc: factor initial_padding into edit lists

2017-02-22 Thread Martin Storsjö

On Wed, 22 Feb 2017, John Stebbins wrote:


initial_padding was getting added to the edit list indirectly due to
initial negative dts.  But in cases where the audio is delayed,
all or part of initial_padding would be unaccounted for.  This patch
makes initial_padding explicit.
---
libavformat/movenc.c | 60 +---
1 file changed, 43 insertions(+), 17 deletions(-)


Ok with me.

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 3/3] Add Apple Pixlet decoder

2017-02-22 Thread Vittorio Giovara
From: Paul B Mahol 

Signed-off-by: Vittorio Giovara 
---
Changes from last iteration:
- lowpass_prediction is rewritten to be clearer (by Anton)
- bitstream_unget is used instead of read + branch/skip
Missing version.h bump, I'll add it at push time.
Vittorio

 Changelog   |   1 +
 doc/general.texi|   1 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 +
 libavcodec/pixlet.c | 689 
 libavformat/isom.c  |   2 +
 tests/fate/video.mak|   3 +
 tests/ref/fate/pixlet   |   2 +
 10 files changed, 708 insertions(+)
 create mode 100644 libavcodec/pixlet.c
 create mode 100644 tests/ref/fate/pixlet

diff --git a/Changelog b/Changelog
index 713883d..8e8bbcb 100644
--- a/Changelog
+++ b/Changelog
@@ -8,6 +8,7 @@ version :
 - VAAPI-accelerated deinterlacing
 - config.log and other configuration files moved into avbuild/ directory
 - VAAPI-accelerated MPEG-2 and VP8 encoding
+- Apple Pixlet decoder
 
 
 version 12:
diff --git a/doc/general.texi b/doc/general.texi
index d232300..54e319f 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -590,6 +590,7 @@ following image formats are supported:
 @item ANSI/ASCII art @tab @tab  X
 @item Apple Intermediate Codec @tab @tab  X
 @item Apple MJPEG-B  @tab @tab  X
+@item Apple Pixlet   @tab @tab  X
 @item Apple ProRes   @tab  X  @tab  X
 @item Apple QuickDraw@tab @tab  X
 @tab fourcc: qdrw
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 7d28d66..7f295dc 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -375,6 +375,7 @@ OBJS-$(CONFIG_PGMYUV_DECODER)  += pnmdec.o pnm.o
 OBJS-$(CONFIG_PGMYUV_ENCODER)  += pnmenc.o
 OBJS-$(CONFIG_PGSSUB_DECODER)  += pgssubdec.o
 OBJS-$(CONFIG_PICTOR_DECODER)  += pictordec.o cga_data.o
+OBJS-$(CONFIG_PIXLET_DECODER)  += pixlet.o
 OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o pngdsp.o
 OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
 OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 46c42c5..1bfddb0 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -231,6 +231,7 @@ void avcodec_register_all(void)
 REGISTER_ENCDEC (PGM,   pgm);
 REGISTER_ENCDEC (PGMYUV,pgmyuv);
 REGISTER_DECODER(PICTOR,pictor);
+REGISTER_DECODER(PIXLET,pixlet);
 REGISTER_ENCDEC (PNG,   png);
 REGISTER_ENCDEC (PPM,   ppm);
 REGISTER_ENCDEC (PRORES,prores);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b7bf85a..489a618 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -392,6 +392,7 @@ enum AVCodecID {
 AV_CODEC_ID_MAGICYUV,
 AV_CODEC_ID_TRUEMOTION2RT,
 AV_CODEC_ID_AV1,
+AV_CODEC_ID_PIXLET,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 18568c9..ab2018b 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1212,6 +1212,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("Alliance for Open Media AV1"),
 .props = AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_PIXLET,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "pixlet",
+.long_name = NULL_IF_CONFIG_SMALL("Apple Pixlet"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+},
 
 /* image codecs */
 {
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
new file mode 100644
index 000..713167d
--- /dev/null
+++ b/libavcodec/pixlet.c
@@ -0,0 +1,689 @@
+/*
+ * Apple Pixlet decoder
+ * Copyright (c) 2016 Paul B Mahol
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+
+#include "libavutil/imgutils.h"
+#include "libavutil/intmath.h"
+#include "libavutil/opt.h"
+
+#include "avcodec.h"
+#include 

[libav-devel] [PATCH 1/3] intmath: add faster clz support

2017-02-22 Thread Vittorio Giovara
From: Ganesh Ajjanagadde 

---
 libavutil/intmath.h | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/libavutil/intmath.h b/libavutil/intmath.h
index a5ee652..780bbab 100644
--- a/libavutil/intmath.h
+++ b/libavutil/intmath.h
@@ -44,6 +44,10 @@
 #   endif
 #endif /* ff_log2 */
 
+#ifndef ff_clz
+#   define ff_clz(v) __builtin_clz(v)
+#endif /* ff_clz */
+
 #endif /* AV_GCC_VERSION_AT_LEAST(3,4) */
 
 extern const uint8_t ff_log2_tab[256];
@@ -132,6 +136,21 @@ static av_always_inline av_const int ff_ctz_c(int v)
 }
 #endif
 
+#ifndef ff_clz
+#define ff_clz ff_clz_c
+static av_always_inline av_const unsigned ff_clz_c(unsigned x)
+{
+unsigned i = sizeof(x) * 8;
+
+while (x) {
+x >>= 1;
+i--;
+}
+
+return i;
+}
+#endif
+
 /**
  * Trailing zero bit count.
  *
-- 
2.10.0

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

[libav-devel] [PATCH 2/3] libavutil: add av_mod_uintp2

2017-02-22 Thread Vittorio Giovara
From: James Almer 

Signed-off-by: James Almer 
---
 libavutil/common.h | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/libavutil/common.h b/libavutil/common.h
index d2ddcba..3832f10 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -182,6 +182,17 @@ static av_always_inline av_const unsigned 
av_clip_uintp2_c(int a, int p)
 else   return  a;
 }
 
+/**
+ * Clear high bits from an unsigned integer starting with specific bit position
+ * @param  a value to clip
+ * @param  p bit position to clip at
+ * @return clipped value
+ */
+static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned 
p)
+{
+return a & ((1 << p) - 1);
+}
+
 /**
  * Add two signed 32-bit values with saturation.
  *
@@ -410,6 +421,9 @@ static av_always_inline av_const int 
av_popcount64_c(uint64_t x)
 #ifndef av_clip_uintp2
 #   define av_clip_uintp2   av_clip_uintp2_c
 #endif
+#ifndef av_mod_uintp2
+#   define av_mod_uintp2av_mod_uintp2_c
+#endif
 #ifndef av_sat_add32
 #   define av_sat_add32 av_sat_add32_c
 #endif
-- 
2.10.0

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

Re: [libav-devel] [PATCH 02/24] hwcontext: Add function to find an AVHWDeviceType by name

2017-02-22 Thread Anton Khirnov
Quoting Mark Thompson (2017-02-19 19:46:24)
> ---
>  libavutil/hwcontext.c | 11 +++
>  libavutil/hwcontext.h |  8 
>  2 files changed, 19 insertions(+)
> 
> diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
> index 1f9442622..e3484c78c 100644
> --- a/libavutil/hwcontext.c
> +++ b/libavutil/hwcontext.c
> @@ -18,6 +18,7 @@
>  
>  #include "config.h"
>  
> +#include "avstring.h"
>  #include "buffer.h"
>  #include "common.h"
>  #include "hwcontext.h"
> @@ -47,6 +48,16 @@ static const HWContextType * const hw_table[] = {
>  NULL,
>  };
>  
> +enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
> +{
> +int i;
> +for (i = 0; hw_table[i]; i++) {
> +if (!av_strcasecmp(hw_table[i]->name, name))
> +return hw_table[i]->type;
> +}
> +return -1;
> +}
> +
>  static const AVClass hwdevice_ctx_class = {
>  .class_name = "AVHWDeviceContext",
>  .item_name  = av_default_item_name,
> diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
> index a31799267..98f9172ee 100644
> --- a/libavutil/hwcontext.h
> +++ b/libavutil/hwcontext.h
> @@ -223,6 +223,14 @@ typedef struct AVHWFramesContext {
>  } AVHWFramesContext;
>  
>  /**
> + * Look up an AVHWDeviceType by name.
> + *
> + * @param name String name of the device type (case-insensitive).
> + * @return The type from enum AVHWDeviceType, or -1 on failure.
> + */
> +enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name);
> +
> +/**
>   * Allocate an AVHWDeviceContext for a given pixel format.
>   *
>   * @return a reference to the newly created AVHWDeviceContext on success or 
> NULL
> -- 
> 2.11.0

Would you mind adding a function for enumerating available device types
while you're at it? I can imagine that being quite useful to some
callers.

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

Re: [libav-devel] [PATCH 5/5] fate: Add build-only targets to FATE

2017-02-22 Thread Diego Biurrun
On Wed, Feb 22, 2017 at 06:03:42PM +0100, Diego Biurrun wrote:
> On Wed, Feb 22, 2017 at 11:49:36AM -0500, Vittorio Giovara wrote:
> > On Wed, Feb 22, 2017 at 11:39 AM, Diego Biurrun  wrote:
> > > --- /dev/null
> > > +++ b/tests/fate/examples.mak
> > > @@ -0,0 +1,32 @@
> > > +FATE_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)+= 
> > > fate-example-decode_audio
> > > +fate-example-decode_audio: doc/examples/decode_audio$(EXESUF)
> > > +
> > > +FATE_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)+= 
> > > fate-example-decode_video
> > > +fate-example-decode_video: doc/examples/decode_video$(EXESUF)
> > > +
> > > +FATE_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE)+= 
> > > fate-example-encode_audio
> > > +fate-example-encode_audio: doc/examples/encode_audio$(EXESUF)
> > > +
> > > +FATE_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE)+= 
> > > fate-example-encode_video
> > > +fate-example-encode_video: doc/examples/encode_video$(EXESUF)
> > > +
> > > +FATE_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)+= 
> > > fate-example-filter_audio
> > > +fate-example-filter_audio: doc/examples/filter_audio$(EXESUF)
> > > +
> > > +FATE_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)+= fate-example-metadata
> > > +fate-example-metadata: doc/examples/metadata$(EXESUF)
> > > +
> > > +FATE_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)  += fate-example-output
> > > +fate-example-output: doc/examples/output$(EXESUF)
> > > +
> > > +FATE_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)  += fate-example-qsvdec
> > > +fate-example-qsvdec: doc/examples/qsvdec$(EXESUF)
> > > +
> > > +FATE_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)   += 
> > > fate-example-transcode_aac
> > > +fate-example-transcode_aac: doc/examples/transcode_aac$(EXESUF)
> > > +
> > > +$(FATE_EXAMPLES-yes): CMD = null
> > > +$(FATE_EXAMPLES-yes): CMP = null
> > > +
> > > +FATE += $(FATE_EXAMPLES-yes)
> > > +fate-examples: $(FATE_EXAMPLES-yes)
> > 
> > Is this file needed? I'm quite sure we'd forget to update it when
> > examples are added
> 
> Thanks for the hint.

Actually, it depends what you want: a blanket target that covers all examples
or subtargets for each individual example. The latter is possibly nicer, but
it does require a bit of maintenance, yes.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 5/5] fate: Add build-only targets to FATE

2017-02-22 Thread Diego Biurrun
On Wed, Feb 22, 2017 at 11:49:36AM -0500, Vittorio Giovara wrote:
> On Wed, Feb 22, 2017 at 11:39 AM, Diego Biurrun  wrote:
> > --- /dev/null
> > +++ b/tests/fate/examples.mak
> > @@ -0,0 +1,32 @@
> > +FATE_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)+= 
> > fate-example-decode_audio
> > +fate-example-decode_audio: doc/examples/decode_audio$(EXESUF)
> > +
> > +FATE_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)+= 
> > fate-example-decode_video
> > +fate-example-decode_video: doc/examples/decode_video$(EXESUF)
> > +
> > +FATE_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE)+= 
> > fate-example-encode_audio
> > +fate-example-encode_audio: doc/examples/encode_audio$(EXESUF)
> > +
> > +FATE_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE)+= 
> > fate-example-encode_video
> > +fate-example-encode_video: doc/examples/encode_video$(EXESUF)
> > +
> > +FATE_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)+= 
> > fate-example-filter_audio
> > +fate-example-filter_audio: doc/examples/filter_audio$(EXESUF)
> > +
> > +FATE_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)+= fate-example-metadata
> > +fate-example-metadata: doc/examples/metadata$(EXESUF)
> > +
> > +FATE_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)  += fate-example-output
> > +fate-example-output: doc/examples/output$(EXESUF)
> > +
> > +FATE_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)  += fate-example-qsvdec
> > +fate-example-qsvdec: doc/examples/qsvdec$(EXESUF)
> > +
> > +FATE_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)   += 
> > fate-example-transcode_aac
> > +fate-example-transcode_aac: doc/examples/transcode_aac$(EXESUF)
> > +
> > +$(FATE_EXAMPLES-yes): CMD = null
> > +$(FATE_EXAMPLES-yes): CMP = null
> > +
> > +FATE += $(FATE_EXAMPLES-yes)
> > +fate-examples: $(FATE_EXAMPLES-yes)
> 
> Is this file needed? I'm quite sure we'd forget to update it when
> examples are added

Thanks for the hint.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] build: Generalize yasm/nasm-related variable names

2017-02-22 Thread Diego Biurrun
On Mon, Feb 20, 2017 at 11:19:38PM +0200, Martin Storsjö wrote:
> On Fri, 17 Feb 2017, Diego Biurrun wrote:
> 
> >None of them are specific to the YASM assembler.
> >---
> >
> >"x86-asm" it is.
> 
> Kinda ok with me, but I want to hear acks/nacks from others as well.
> 
> For the configure option name, it feels like the least bad option to me, but
> it feels a bit more clunky when used in ifdefs in the code.

Here are some comments from IRC:

16:54 <@DonDiego> lu_zero: https://patches.libav.org/patch/62859/ - wbs invited 
more comments from others there
16:55 <@lu_zero> DonDiego: I'd bikeshed for intel-asm
16:55 <@DonDiego> .. because ..
16:56 <@DonDiego> ?
16:56 <@lu_zero> iirc yasm is using the intel syntax while gas is using at ?
16:57 <@lu_zero> anyway I do not have a strong opinion about it
16:58 <@DonDiego> actually, yasm implements the nasm macro language
16:58 <@lu_zero> ah then nasm could be the other naming to throw in as 
alternative :)
16:58 <@DonDiego> it is certainly better than yasm
17:00 <@lu_zero> I guess nasm might be less strange looking

16:46 <@DonDiego> elenril: https://patches.libav.org/patch/62859/
17:02 <@elenril> i have no strong feelings about the asm one
17:02 <@elenril> x86-asm works fine for me

17:44 <@DonDiego> koda: do you have an opinion on 
https://patches.libav.org/patch/62859/ ?
17:47 <@koda> not really, the dash in the name does look clunky but i don't 
have any proper alternative

So x86-asm or nasm are the alternatives.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 5/5] fate: Add build-only targets to FATE

2017-02-22 Thread Vittorio Giovara
On Wed, Feb 22, 2017 at 11:39 AM, Diego Biurrun  wrote:
> ---
> diff --git a/tests/fate/examples.mak b/tests/fate/examples.mak
> new file mode 100644
> index 000..9809645
> --- /dev/null
> +++ b/tests/fate/examples.mak
> @@ -0,0 +1,32 @@
> +FATE_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)+= fate-example-decode_audio
> +fate-example-decode_audio: doc/examples/decode_audio$(EXESUF)
> +
> +FATE_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)+= fate-example-decode_video
> +fate-example-decode_video: doc/examples/decode_video$(EXESUF)
> +
> +FATE_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE)+= fate-example-encode_audio
> +fate-example-encode_audio: doc/examples/encode_audio$(EXESUF)
> +
> +FATE_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE)+= fate-example-encode_video
> +fate-example-encode_video: doc/examples/encode_video$(EXESUF)
> +
> +FATE_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)+= fate-example-filter_audio
> +fate-example-filter_audio: doc/examples/filter_audio$(EXESUF)
> +
> +FATE_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)+= fate-example-metadata
> +fate-example-metadata: doc/examples/metadata$(EXESUF)
> +
> +FATE_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)  += fate-example-output
> +fate-example-output: doc/examples/output$(EXESUF)
> +
> +FATE_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)  += fate-example-qsvdec
> +fate-example-qsvdec: doc/examples/qsvdec$(EXESUF)
> +
> +FATE_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)   += fate-example-transcode_aac
> +fate-example-transcode_aac: doc/examples/transcode_aac$(EXESUF)
> +
> +$(FATE_EXAMPLES-yes): CMD = null
> +$(FATE_EXAMPLES-yes): CMP = null
> +
> +FATE += $(FATE_EXAMPLES-yes)
> +fate-examples: $(FATE_EXAMPLES-yes)
> --

Is this file needed? I'm quite sure we'd forget to update it when
examples are added
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 3/5] fate: Rename WMV8_DRM decoder tests to WMV3_DRM

2017-02-22 Thread Vittorio Giovara
On Wed, Feb 22, 2017 at 11:39 AM, Diego Biurrun  wrote:
> The codec used in those files is WMV3/WMV9, not WMV2/WMV8.
> ---
>  tests/fate/microsoft.mak | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/tests/fate/microsoft.mak b/tests/fate/microsoft.mak
> index 5b32c7f..4e66307 100644
> --- a/tests/fate/microsoft.mak
> +++ b/tests/fate/microsoft.mak
> @@ -34,15 +34,15 @@ fate-msvideo1: $(FATE_MSVIDEO1)
>  FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, MTS2) += fate-mts2
>  fate-mts2: CMD = framecrc -i $(TARGET_SAMPLES)/mts2/ScreenCapture.xesc
>
> -FATE_WMV8_DRM += fate-wmv8-drm
> +FATE_WMV3_DRM += fate-wmv3-drm
>  # discard last packet to avoid fails due to overread of VC-1 decoder
> -fate-wmv8-drm: CMD = framecrc -cryptokey 
> 137381538c84c068111902a59c5cf6c340247c39 -i 
> $(TARGET_SAMPLES)/wmv8/wmv_drm.wmv -an -frames:v 129
> +fate-wmv3-drm: CMD = framecrc -cryptokey 
> 137381538c84c068111902a59c5cf6c340247c39 -i 
> $(TARGET_SAMPLES)/wmv3/wmv_drm.wmv -an -frames:v 129
>
> -FATE_WMV8_DRM += fate-wmv8-drm-nodec
> -fate-wmv8-drm-nodec: CMD = framecrc -cryptokey 
> 137381538c84c068111902a59c5cf6c340247c39 -i 
> $(TARGET_SAMPLES)/wmv8/wmv_drm.wmv -c copy
> +FATE_WMV3_DRM += fate-wmv3-drm-nodec
> +fate-wmv3-drm-nodec: CMD = framecrc -cryptokey 
> 137381538c84c068111902a59c5cf6c340247c39 -i 
> $(TARGET_SAMPLES)/wmv3/wmv_drm.wmv -c copy
>
> -FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, WMV3) += $(FATE_WMV8_DRM)
> -fate-wmv8_drm: $(FATE_WMV8_DRM)
> +FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, WMV3) += $(FATE_WMV3_DRM)
> +fate-wmv3_drm: $(FATE_WMV3_DRM)
>
>  FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, WMV2) += fate-wmv8-intrax8
>  fate-wmv8-intrax8: CMD = framecrc -flags +bitexact -i 
> $(TARGET_SAMPLES)/wmv8/wmv8_x8intra.wmv -an
> --

ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 2/5] Use modern avconv syntax for codec selection in documentation and tests

2017-02-22 Thread Vittorio Giovara
On Wed, Feb 22, 2017 at 11:39 AM, Diego Biurrun  wrote:
> ---
>  doc/encoders.texi|  2 +-
>  doc/faq.texi |  8 
>  doc/filters.texi |  4 ++--
>  tests/fate-run.sh|  4 ++--
>  tests/fate/demux.mak | 34 +-
>  tests/fate/h264.mak  |  2 +-
>  tests/fate/microsoft.mak |  2 +-
>  tests/fate/mp3.mak   | 14 +++---
>  tests/fate/mpc.mak   |  4 ++--
>  tests/fate/utvideo.mak   |  2 +-
>  tests/fate/video.mak |  4 ++--
>  tests/fate/vqf.mak   |  2 +-
>  tests/lavf-regression.sh | 28 ++--
>  13 files changed, 55 insertions(+), 55 deletions(-)
>
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index bc5b336..41b8398 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -38,7 +38,7 @@ always faster, just that one or the other may be better 
> suited to a
>  particular system. The floating-point encoder will generally produce better
>  quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
>  default codec for any of the output formats, so it must be specified 
> explicitly
> -using the option @code{-acodec ac3_fixed} in order to use it.
> +using the option @code{-c:a ac3_fixed} in order to use it.
>
>  @subsection AC-3 Metadata
>
> diff --git a/doc/faq.texi b/doc/faq.texi
> index b400124..f3d55bd 100644
> --- a/doc/faq.texi
> +++ b/doc/faq.texi
> @@ -234,7 +234,7 @@ mkfifo intermediate2.mpg
>  avconv -i input1.avi -y intermediate1.mpg < /dev/null &
>  avconv -i input2.avi -y intermediate2.mpg < /dev/null &
>  cat intermediate1.mpg intermediate2.mpg |\
> -avconv -f mpeg -i - -c:v mpeg4 -acodec libmp3lame output.avi
> +avconv -f mpeg -i - -c:v mpeg4 -c:a libmp3lame output.avi
>  @end example
>
>  Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
> @@ -253,13 +253,13 @@ mkfifo temp2.a
>  mkfifo temp2.v
>  mkfifo all.a
>  mkfifo all.v
> -avconv -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > 
> temp1.a < /dev/null &
> -avconv -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > 
> temp2.a < /dev/null &
> +avconv -i input1.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - > temp1.a 
> < /dev/null &
> +avconv -i input2.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - > temp2.a 
> < /dev/null &
>  avconv -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
>  @{ avconv -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > 
> temp2.v ; @} &
>  cat temp1.a temp2.a > all.a &
>  cat temp1.v temp2.v > all.v &
> -avconv -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
> +avconv -f u16le -c:a pcm_s16le -ac 2 -ar 44100 -i all.a \
> -f yuv4mpegpipe -i all.v \
> -y output.flv
>  rm temp[12].[av] all.[av]
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 954765f..947fd79 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -661,10 +661,10 @@ avconv -i HDCD16.flac -af hdcd OUT24.flac
>
>  When using the filter with WAV, note that the default encoding for WAV is 
> 16-bit,
>  so the resulting 20-bit stream will be truncated back to 16-bit. Use 
> something
> -like @command{-acodec pcm_s24le} after the filter to get 24-bit PCM output.
> +like @command{-c:a pcm_s24le} after the filter to get 24-bit PCM output.
>  @example
>  avconv -i HDCD16.wav -af hdcd OUT16.wav
> -avconv -i HDCD16.wav -af hdcd -acodec pcm_s24le OUT24.wav
> +avconv -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
>  @end example
>
>  The filter accepts the following options:
> diff --git a/tests/fate-run.sh b/tests/fate-run.sh
> index 623fd63..43fcee0 100755
> --- a/tests/fate-run.sh
> +++ b/tests/fate-run.sh
> @@ -164,8 +164,8 @@ video_filter(){
>  label=${test#filter-}
>  raw_src="${target_path}/tests/vsynth1/%02d.pgm"
>  printf '%-20s' $label
> -avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
> -$FLAGS $ENC_OPTS -vf "$filters" -vcodec rawvideo -frames:v 5 $* -f 
> nut md5:
> +avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src \
> +$FLAGS $ENC_OPTS -vf "$filters" -c:v rawvideo -frames:v 5 $* -f nut 
> md5:
>  }
>
>  pixfmts(){
> diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
> index d529341..44c4d6e 100644
> --- a/tests/fate/demux.mak
> +++ b/tests/fate/demux.mak
> @@ -1,26 +1,26 @@
>  FATE_SAMPLES_AVCONV-$(call DEMDEC, AAC, AAC) += fate-adts-demux
> -fate-adts-demux: CMD = crc -i $(TARGET_SAMPLES)/aac/ct_faac-adts.aac -acodec 
> copy
> +fate-adts-demux: CMD = crc -i $(TARGET_SAMPLES)/aac/ct_faac-adts.aac -c:a 
> copy
>
>  FATE_SAMPLES_AVCONV-$(CONFIG_AEA_DEMUXER) += fate-aea-demux
> -fate-aea-demux: CMD = crc -i $(TARGET_SAMPLES)/aea/chirp.aea -acodec copy
> +fate-aea-demux: CMD = crc -i $(TARGET_SAMPLES)/aea/chirp.aea -c:a copy
>
>  FATE_SAMPLES_AVCONV-$(CONFIG_BINK_DEMUXER) += fate-bink-demux
> -fate-bink-demux: CMD = crc -i $(TARGET_SAMPLES)/bink/Snd0a7d9b58.dee -vn 
> -acodec copy
> +fate-bink-demux: CMD = crc -i 

[libav-devel] [PATCH 2/5] Use modern avconv syntax for codec selection in documentation and tests

2017-02-22 Thread Diego Biurrun
---
 doc/encoders.texi|  2 +-
 doc/faq.texi |  8 
 doc/filters.texi |  4 ++--
 tests/fate-run.sh|  4 ++--
 tests/fate/demux.mak | 34 +-
 tests/fate/h264.mak  |  2 +-
 tests/fate/microsoft.mak |  2 +-
 tests/fate/mp3.mak   | 14 +++---
 tests/fate/mpc.mak   |  4 ++--
 tests/fate/utvideo.mak   |  2 +-
 tests/fate/video.mak |  4 ++--
 tests/fate/vqf.mak   |  2 +-
 tests/lavf-regression.sh | 28 ++--
 13 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index bc5b336..41b8398 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -38,7 +38,7 @@ always faster, just that one or the other may be better 
suited to a
 particular system. The floating-point encoder will generally produce better
 quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
 default codec for any of the output formats, so it must be specified explicitly
-using the option @code{-acodec ac3_fixed} in order to use it.
+using the option @code{-c:a ac3_fixed} in order to use it.
 
 @subsection AC-3 Metadata
 
diff --git a/doc/faq.texi b/doc/faq.texi
index b400124..f3d55bd 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -234,7 +234,7 @@ mkfifo intermediate2.mpg
 avconv -i input1.avi -y intermediate1.mpg < /dev/null &
 avconv -i input2.avi -y intermediate2.mpg < /dev/null &
 cat intermediate1.mpg intermediate2.mpg |\
-avconv -f mpeg -i - -c:v mpeg4 -acodec libmp3lame output.avi
+avconv -f mpeg -i - -c:v mpeg4 -c:a libmp3lame output.avi
 @end example
 
 Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
@@ -253,13 +253,13 @@ mkfifo temp2.a
 mkfifo temp2.v
 mkfifo all.a
 mkfifo all.v
-avconv -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > 
temp1.a < /dev/null &
-avconv -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > 
temp2.a < /dev/null &
+avconv -i input1.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - > temp1.a < 
/dev/null &
+avconv -i input2.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - > temp2.a < 
/dev/null &
 avconv -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
 @{ avconv -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > 
temp2.v ; @} &
 cat temp1.a temp2.a > all.a &
 cat temp1.v temp2.v > all.v &
-avconv -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
+avconv -f u16le -c:a pcm_s16le -ac 2 -ar 44100 -i all.a \
-f yuv4mpegpipe -i all.v \
-y output.flv
 rm temp[12].[av] all.[av]
diff --git a/doc/filters.texi b/doc/filters.texi
index 954765f..947fd79 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -661,10 +661,10 @@ avconv -i HDCD16.flac -af hdcd OUT24.flac
 
 When using the filter with WAV, note that the default encoding for WAV is 
16-bit,
 so the resulting 20-bit stream will be truncated back to 16-bit. Use something
-like @command{-acodec pcm_s24le} after the filter to get 24-bit PCM output.
+like @command{-c:a pcm_s24le} after the filter to get 24-bit PCM output.
 @example
 avconv -i HDCD16.wav -af hdcd OUT16.wav
-avconv -i HDCD16.wav -af hdcd -acodec pcm_s24le OUT24.wav
+avconv -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
 @end example
 
 The filter accepts the following options:
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 623fd63..43fcee0 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -164,8 +164,8 @@ video_filter(){
 label=${test#filter-}
 raw_src="${target_path}/tests/vsynth1/%02d.pgm"
 printf '%-20s' $label
-avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
-$FLAGS $ENC_OPTS -vf "$filters" -vcodec rawvideo -frames:v 5 $* -f nut 
md5:
+avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src \
+$FLAGS $ENC_OPTS -vf "$filters" -c:v rawvideo -frames:v 5 $* -f nut 
md5:
 }
 
 pixfmts(){
diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index d529341..44c4d6e 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -1,26 +1,26 @@
 FATE_SAMPLES_AVCONV-$(call DEMDEC, AAC, AAC) += fate-adts-demux
-fate-adts-demux: CMD = crc -i $(TARGET_SAMPLES)/aac/ct_faac-adts.aac -acodec 
copy
+fate-adts-demux: CMD = crc -i $(TARGET_SAMPLES)/aac/ct_faac-adts.aac -c:a copy
 
 FATE_SAMPLES_AVCONV-$(CONFIG_AEA_DEMUXER) += fate-aea-demux
-fate-aea-demux: CMD = crc -i $(TARGET_SAMPLES)/aea/chirp.aea -acodec copy
+fate-aea-demux: CMD = crc -i $(TARGET_SAMPLES)/aea/chirp.aea -c:a copy
 
 FATE_SAMPLES_AVCONV-$(CONFIG_BINK_DEMUXER) += fate-bink-demux
-fate-bink-demux: CMD = crc -i $(TARGET_SAMPLES)/bink/Snd0a7d9b58.dee -vn 
-acodec copy
+fate-bink-demux: CMD = crc -i $(TARGET_SAMPLES)/bink/Snd0a7d9b58.dee -vn -c:a 
copy
 
 FATE_SAMPLES_AVCONV-$(CONFIG_CAF_DEMUXER) += fate-caf
 fate-caf: CMD = crc -i $(TARGET_SAMPLES)/caf/caf-pcm16.caf -c copy
 
 FATE_SAMPLES_AVCONV-$(CONFIG_CDXL_DEMUXER) += fate-cdxl-demux
-fate-cdxl-demux: CMD = framecrc -i 

[libav-devel] [PATCH 3/5] fate: Rename WMV8_DRM decoder tests to WMV3_DRM

2017-02-22 Thread Diego Biurrun
The codec used in those files is WMV3/WMV9, not WMV2/WMV8.
---
 tests/fate/microsoft.mak | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/fate/microsoft.mak b/tests/fate/microsoft.mak
index 5b32c7f..4e66307 100644
--- a/tests/fate/microsoft.mak
+++ b/tests/fate/microsoft.mak
@@ -34,15 +34,15 @@ fate-msvideo1: $(FATE_MSVIDEO1)
 FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, MTS2) += fate-mts2
 fate-mts2: CMD = framecrc -i $(TARGET_SAMPLES)/mts2/ScreenCapture.xesc
 
-FATE_WMV8_DRM += fate-wmv8-drm
+FATE_WMV3_DRM += fate-wmv3-drm
 # discard last packet to avoid fails due to overread of VC-1 decoder
-fate-wmv8-drm: CMD = framecrc -cryptokey 
137381538c84c068111902a59c5cf6c340247c39 -i $(TARGET_SAMPLES)/wmv8/wmv_drm.wmv 
-an -frames:v 129
+fate-wmv3-drm: CMD = framecrc -cryptokey 
137381538c84c068111902a59c5cf6c340247c39 -i $(TARGET_SAMPLES)/wmv3/wmv_drm.wmv 
-an -frames:v 129
 
-FATE_WMV8_DRM += fate-wmv8-drm-nodec
-fate-wmv8-drm-nodec: CMD = framecrc -cryptokey 
137381538c84c068111902a59c5cf6c340247c39 -i $(TARGET_SAMPLES)/wmv8/wmv_drm.wmv 
-c copy
+FATE_WMV3_DRM += fate-wmv3-drm-nodec
+fate-wmv3-drm-nodec: CMD = framecrc -cryptokey 
137381538c84c068111902a59c5cf6c340247c39 -i $(TARGET_SAMPLES)/wmv3/wmv_drm.wmv 
-c copy
 
-FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, WMV3) += $(FATE_WMV8_DRM)
-fate-wmv8_drm: $(FATE_WMV8_DRM)
+FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, WMV3) += $(FATE_WMV3_DRM)
+fate-wmv3_drm: $(FATE_WMV3_DRM)
 
 FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, WMV2) += fate-wmv8-intrax8
 fate-wmv8-intrax8: CMD = framecrc -flags +bitexact -i 
$(TARGET_SAMPLES)/wmv8/wmv8_x8intra.wmv -an
-- 
2.1.4

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

[libav-devel] [PATCH 4/5] fate: Make null comparison method more useful

2017-02-22 Thread Diego Biurrun
This allows dropping /dev/null as reference value when no output is generated.
---
 tests/fate-run.sh |  2 +-
 tests/fate/libavcodec.mak |  4 +---
 tests/fate/libavutil.mak  | 13 ++---
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 43fcee0..240 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -203,7 +203,7 @@ if [ $err -gt 128 ]; then
 test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig
 fi
 
-if test -e "$ref" || test $cmp = "oneline" ; then
+if test -e "$ref" || test $cmp = "oneline" || test $cmp = "null" ; then
 case $cmp in
 diff)   diff -u -b "$ref" "$outfile">$cmpfile ;;
 oneoff) oneoff "$ref" "$outfile">$cmpfile ;;
diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak
index d656ace..0bbe572 100644
--- a/tests/fate/libavcodec.mak
+++ b/tests/fate/libavcodec.mak
@@ -1,13 +1,12 @@
 FATE_LIBAVCODEC-$(CONFIG_GOLOMB) += fate-golomb
 fate-golomb: libavcodec/tests/golomb$(EXESUF)
 fate-golomb: CMD = run libavcodec/tests/golomb
-fate-golomb: REF = /dev/null
+fate-golomb: CMP = null
 
 FATE_LIBAVCODEC-$(CONFIG_IDCTDSP) += fate-idct8x8
 fate-idct8x8: libavcodec/tests/dct$(EXESUF)
 fate-idct8x8: CMD = run libavcodec/tests/dct -i
 fate-idct8x8: CMP = null
-fate-idct8x8: REF = /dev/null
 
 FATE_LIBAVCODEC-$(CONFIG_IIRFILTER) += fate-iirfilter
 fate-iirfilter: libavcodec/tests/iirfilter$(EXESUF)
@@ -17,7 +16,6 @@ FATE_LIBAVCODEC-$(CONFIG_RANGECODER) += fate-rangecoder
 fate-rangecoder: libavcodec/tests/rangecoder$(EXESUF)
 fate-rangecoder: CMD = run libavcodec/tests/rangecoder
 fate-rangecoder: CMP = null
-fate-rangecoder: REF = /dev/null
 
 FATE-$(CONFIG_AVCODEC) += $(FATE_LIBAVCODEC-yes)
 fate-libavcodec: $(FATE_LIBAVCODEC-yes)
diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index 8b17411..e0a6693 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -1,12 +1,12 @@
 FATE_LIBAVUTIL += fate-adler32
 fate-adler32: libavutil/tests/adler32$(EXESUF)
 fate-adler32: CMD = run libavutil/tests/adler32
-fate-adler32: REF = /dev/null
+fate-adler32: CMP = null
 
 FATE_LIBAVUTIL += fate-aes
 fate-aes: libavutil/tests/aes$(EXESUF)
 fate-aes: CMD = run libavutil/tests/aes
-fate-aes: REF = /dev/null
+fate-aes: CMP = null
 
 FATE_LIBAVUTIL += fate-avstring
 fate-avstring: libavutil/tests/avstring$(EXESUF)
@@ -23,12 +23,12 @@ fate-blowfish: CMD = run libavutil/tests/blowfish
 FATE_LIBAVUTIL += fate-cpu
 fate-cpu: libavutil/tests/cpu$(EXESUF)
 fate-cpu: CMD = run libavutil/tests/cpu $(CPUFLAGS:%=-c%) $(THREADS:%=-t%)
-fate-cpu: REF = /dev/null
+fate-cpu: CMP = null
 
 FATE_LIBAVUTIL-$(HAVE_THREADS) += fate-cpu_init
 fate-cpu_init: libavutil/tests/cpu_init$(EXESUF)
 fate-cpu_init: CMD = run libavutil/tests/cpu_init
-fate-cpu_init: REF = /dev/null
+fate-cpu_init: CMP = null
 
 FATE_LIBAVUTIL += fate-crc
 fate-crc: libavutil/tests/crc$(EXESUF)
@@ -37,7 +37,7 @@ fate-crc: CMD = run libavutil/tests/crc
 FATE_LIBAVUTIL += fate-des
 fate-des: libavutil/tests/des$(EXESUF)
 fate-des: CMD = run libavutil/tests/des
-fate-des: REF = /dev/null
+fate-des: CMP = null
 
 FATE_LIBAVUTIL += fate-eval
 fate-eval: libavutil/tests/eval$(EXESUF)
@@ -51,7 +51,6 @@ FATE_LIBAVUTIL += fate-float-dsp
 fate-float-dsp: libavutil/tests/float_dsp$(EXESUF)
 fate-float-dsp: CMD = run libavutil/tests/float_dsp
 fate-float-dsp: CMP = null
-fate-float-dsp: REF = /dev/null
 
 FATE_LIBAVUTIL += fate-hmac
 fate-hmac: libavutil/tests/hmac$(EXESUF)
@@ -72,7 +71,7 @@ fate-sha: CMD = run libavutil/tests/sha
 FATE_LIBAVUTIL += fate-tree
 fate-tree: libavutil/tests/tree$(EXESUF)
 fate-tree: CMD = run libavutil/tests/tree
-fate-tree: REF = /dev/null
+fate-tree: CMP = null
 
 FATE_LIBAVUTIL += fate-xtea
 fate-xtea: libavutil/tests/xtea$(EXESUF)
-- 
2.1.4

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

[libav-devel] [PATCH 5/5] fate: Add build-only targets to FATE

2017-02-22 Thread Diego Biurrun
---

People keep forgetting to run "make check", this integrates the build
targets into fate so they will show up as failed tests.

 tests/Makefile  |  1 +
 tests/fate-run.sh   |  4 
 tests/fate/build.mak| 14 ++
 tests/fate/examples.mak | 32 
 4 files changed, 51 insertions(+)
 create mode 100644 tests/fate/build.mak
 create mode 100644 tests/fate/examples.mak

diff --git a/tests/Makefile b/tests/Makefile
index 30e06e8..d3f11ef 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -72,6 +72,7 @@ include $(SRC_PATH)/tests/fate/amrwb.mak
 include $(SRC_PATH)/tests/fate/atrac.mak
 include $(SRC_PATH)/tests/fate/audio.mak
 include $(SRC_PATH)/tests/fate/bmp.mak
+include $(SRC_PATH)/tests/fate/build.mak
 include $(SRC_PATH)/tests/fate/canopus.mak
 include $(SRC_PATH)/tests/fate/cdxl.mak
 include $(SRC_PATH)/tests/fate/checkasm.mak
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 240..8de749d 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -192,6 +192,10 @@ pixfmts(){
 test=$outertest
 }
 
+null(){
+:
+}
+
 mkdir -p "$outdir"
 
 exec 3>&2
diff --git a/tests/fate/build.mak b/tests/fate/build.mak
new file mode 100644
index 000..bce6de4
--- /dev/null
+++ b/tests/fate/build.mak
@@ -0,0 +1,14 @@
+FATE_BUILD += fate-build-alltools
+fate-build-alltools: alltools
+
+FATE_BUILD += fate-build-checkheaders
+fate-build-checkheaders: checkheaders
+
+FATE_BUILD += fate-build-testprogs
+fate-build-testprogs: testprogs
+
+$(FATE_BUILD): CMD = null
+$(FATE_BUILD): CMP = null
+
+FATE += $(FATE_BUILD)
+fate-build: $(FATE_BUILD)
diff --git a/tests/fate/examples.mak b/tests/fate/examples.mak
new file mode 100644
index 000..9809645
--- /dev/null
+++ b/tests/fate/examples.mak
@@ -0,0 +1,32 @@
+FATE_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)+= fate-example-decode_audio
+fate-example-decode_audio: doc/examples/decode_audio$(EXESUF)
+
+FATE_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)+= fate-example-decode_video
+fate-example-decode_video: doc/examples/decode_video$(EXESUF)
+
+FATE_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE)+= fate-example-encode_audio
+fate-example-encode_audio: doc/examples/encode_audio$(EXESUF)
+
+FATE_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE)+= fate-example-encode_video
+fate-example-encode_video: doc/examples/encode_video$(EXESUF)
+
+FATE_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)+= fate-example-filter_audio
+fate-example-filter_audio: doc/examples/filter_audio$(EXESUF)
+
+FATE_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)+= fate-example-metadata
+fate-example-metadata: doc/examples/metadata$(EXESUF)
+
+FATE_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)  += fate-example-output
+fate-example-output: doc/examples/output$(EXESUF)
+
+FATE_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)  += fate-example-qsvdec
+fate-example-qsvdec: doc/examples/qsvdec$(EXESUF)
+
+FATE_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)   += fate-example-transcode_aac
+fate-example-transcode_aac: doc/examples/transcode_aac$(EXESUF)
+
+$(FATE_EXAMPLES-yes): CMD = null
+$(FATE_EXAMPLES-yes): CMP = null
+
+FATE += $(FATE_EXAMPLES-yes)
+fate-examples: $(FATE_EXAMPLES-yes)
-- 
2.1.4

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

[libav-devel] [PATCH 1/5] build: Drop DOC_ prefix from EXAMPLES-related variables

2017-02-22 Thread Diego Biurrun
---
 doc/examples/Makefile | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index c42c68f..40c9557 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -1,31 +1,31 @@
-DOC_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio
-DOC_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE) += decode_video
-DOC_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE) += encode_audio
-DOC_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE) += encode_video
-DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio
-DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata
-DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)   += output
-DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)   += qsvdec
-DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)+= transcode_aac
-
-DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
-ALL_DOC_EXAMPLES := $(DOC_EXAMPLES) $(DOC_EXAMPLES-:%=doc/examples/%$(EXESUF))
-PROGS+= $(DOC_EXAMPLES)
-
-$(foreach P,$(DOC_EXAMPLES),$(eval OBJS-$(P:%$(EXESUF)=%) = 
$(P:%$(EXESUF)=%).o))
-$(DOC_EXAMPLES): %$(EXESUF): %.o
-
-examples: $(DOC_EXAMPLES)
-
-$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
+EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio
+EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE) += decode_video
+EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE) += encode_audio
+EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE) += encode_video
+EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio
+EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata
+EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)   += output
+EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)   += qsvdec
+EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)+= transcode_aac
+
+EXAMPLES := $(EXAMPLES-yes:%=doc/examples/%$(EXESUF))
+ALL_EXAMPLES := $(EXAMPLES) $(EXAMPLES-:%=doc/examples/%$(EXESUF))
+PROGS+= $(EXAMPLES)
+
+$(foreach P,$(EXAMPLES),$(eval OBJS-$(P:%$(EXESUF)=%) = $(P:%$(EXESUF)=%).o))
+$(EXAMPLES): %$(EXESUF): %.o
+
+examples: $(EXAMPLES)
+
+$(EXAMPLES:%$(EXESUF)=%.o): | doc/examples
 OBJDIRS += doc/examples
 
-DOXY_INPUT += $(addprefix $(SRC_PATH)/, $(DOC_EXAMPLES:%$(EXESUF)=%.c))
+DOXY_INPUT += $(addprefix $(SRC_PATH)/, $(EXAMPLES:%$(EXESUF)=%.c))
 
 clean::
-   $(RM) $(ALL_DOC_EXAMPLES)
+   $(RM) $(ALL_EXAMPLES)
$(RM) $(CLEANSUFFIXES:%=doc/examples/%)
 
--include $(wildcard $(DOC_EXAMPLES:%$(EXESUF)=%.d))
+-include $(wildcard $(EXAMPLES:%$(EXESUF)=%.d))
 
 .PHONY: examples
-- 
2.1.4

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

Re: [libav-devel] [PATCH] fate: Add another SVQ3 test to increase coverage

2017-02-22 Thread Diego Biurrun
On Sun, Feb 05, 2017 at 01:14:46PM +0100, Diego Biurrun wrote:
> ---
> 
> This covers a regression I introduced a long time ago.
> 
>  tests/fate/qt.mak   | 10 --
>  tests/ref/fate/{svq3 => svq3-1} |  0
>  tests/ref/fate/svq3-2   | 20 
>  3 files changed, 28 insertions(+), 2 deletions(-)
>  rename tests/ref/fate/{svq3 => svq3-1} (100%)
>  create mode 100644 tests/ref/fate/svq3-2

OKed by Anton on IRC.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] movenc: factor initial_padding into edit lists

2017-02-22 Thread John Stebbins
initial_padding was getting added to the edit list indirectly due to
initial negative dts.  But in cases where the audio is delayed,
all or part of initial_padding would be unaccounted for.  This patch
makes initial_padding explicit.
---
 libavformat/movenc.c | 60 +---
 1 file changed, 43 insertions(+), 17 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 689291d..c01eb8b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1698,9 +1698,31 @@ static int mov_write_edts_tag(AVIOContext *pb, 
MOVMuxContext *mov,
   track->timescale, AV_ROUND_UP);
 int version = duration < INT32_MAX ? 0 : 1;
 int entry_size, entry_count, size;
-int64_t delay, start_ct = track->start_cts;
-delay = av_rescale_rnd(track->start_dts + start_ct, MOV_TIMESCALE,
-   track->timescale, AV_ROUND_DOWN);
+int64_t delay;
+int64_t mediatime;
+int64_t skip = 0;
+
+delay = track->start_dts + track->start_cts;
+
+if (track->par->codec_type == AVMEDIA_TYPE_AUDIO &&
+track->par->initial_padding > 0) {
+/* Adjust delay so that initial_padding gets recorded in the
+ * MediaTime of an edit list entry even in the case that
+ * delay is positive. I.e. we don't want initial_padding to be
+ * absorbed and hidden in the delay. MediaTime must contain
+ * initial_padding in order to know where the actual media
+ * timeline begins. A player should drop samples until MediaTime
+ * is reached */
+delay += av_rescale_rnd(track->par->initial_padding, track->timescale,
+track->par->sample_rate, AV_ROUND_UP);
+skip = av_rescale_rnd(track->par->initial_padding,
+  track->timescale,
+  track->par->sample_rate, AV_ROUND_DOWN);
+}
+/* rescale delay, this was not done earlier to minimize rounding errors */
+delay = av_rescale_rnd(delay, MOV_TIMESCALE,
+   track->timescale, AV_ROUND_NEAR_INF);
+
 version |= delay < INT32_MAX ? 0 : 1;
 
 entry_size = (version == 1) ? 20 : 12;
@@ -1731,33 +1753,35 @@ static int mov_write_edts_tag(AVIOContext *pb, 
MOVMuxContext *mov,
 }
 avio_wb32(pb, 0x0001);
 } else {
-/* Avoid accidentally ending up with start_ct = -1 which has got a
- * special meaning. Normally start_ct should end up positive or zero
- * here, but use FFMIN in case dts is a a small positive integer
- * rounded to 0 when represented in MOV_TIMESCALE units. */
-start_ct  = -FFMIN(track->start_dts, 0);
-/* Note, this delay is calculated from the pts of the first sample,
- * ensuring that we don't reduce the duration for cases with
- * dts<0 pts=0. */
-duration += delay;
+/* Skip the larger of initial_padding or the initial -PTS. */
+skip = FFMAX(skip, -track->start_dts - track->start_cts);
 }
+mediatime = skip + track->start_cts;
+
+/* skip is the duration of the media segment that will be dropped
+ * during playback when an edit entry is applied.  The edit entry
+ * duration must be reduced by this amount. */
+duration -= av_rescale_rnd(skip, MOV_TIMESCALE,
+   track->timescale, AV_ROUND_UP);
 
 /* For fragmented files, we don't know the full length yet. Setting
  * duration to 0 allows us to only specify the offset, including
  * the rest of the content (from all future fragments) without specifying
  * an explicit duration. */
-if (mov->flags & FF_MOV_FLAG_FRAGMENT)
+if (mov->flags & FF_MOV_FLAG_FRAGMENT || duration < 0)
 duration = 0;
 
-/* duration */
+/* add edit entry that defines the presentation time of the first
+ * sample to render during playback and the duration of the segment */
 if (version == 1) {
 avio_wb64(pb, duration);
-avio_wb64(pb, start_ct);
+avio_wb64(pb, mediatime);
 } else {
 avio_wb32(pb, duration);
-avio_wb32(pb, start_ct);
+avio_wb32(pb, mediatime);
 }
 avio_wb32(pb, 0x0001);
+
 return size;
 }
 
@@ -1867,7 +1891,9 @@ static int mov_write_trak_tag(AVIOContext *pb, 
MOVMuxContext *mov,
 mov_write_tkhd_tag(pb, mov, track, st);
 if (track->start_dts != AV_NOPTS_VALUE &&
 (track->mode == MODE_PSP || track->flags & MOV_TRACK_CTTS ||
-track->start_dts || is_clcp_track(track))) {
+track->start_dts || is_clcp_track(track) ||
+(track->par->codec_type == AVMEDIA_TYPE_AUDIO &&
+ track->par->initial_padding > 0))) {
 if (mov->use_editlist)
 mov_write_edts_tag(pb, mov, track);  // PSP Movies require edts box
 else if ((track->entry && track->cluster[0].dts) || track->mode == 
MODE_PSP || is_clcp_track(track))
-- 

Re: [libav-devel] [PATCH] movenc: factor initial_padding into edit lists

2017-02-22 Thread John Stebbins
On 02/22/2017 03:41 AM, Martin Storsjö wrote:
> On Tue, 21 Feb 2017, John Stebbins wrote:
>
>> On 02/21/2017 02:54 PM, Martin Storsjö wrote:
>>> On Tue, 21 Feb 2017, John Stebbins wrote:
>>>
 initial_padding was getting added to the edit list indirectly due to
 initial negative dts.  But in cases where the audio is delayed,
 all or part of initial_padding would be unaccounted for.  This patch
 makes initial_padding explicit.
 ---
 libavformat/movenc.c | 58 
 +---
 1 file changed, 42 insertions(+), 16 deletions(-)

 diff --git a/libavformat/movenc.c b/libavformat/movenc.c
 index 689291d..d60e194 100644
 --- a/libavformat/movenc.c
 +++ b/libavformat/movenc.c
 @@ -1698,9 +1698,31 @@ static int mov_write_edts_tag(AVIOContext *pb, 
 MOVMuxContext *mov,
   track->timescale, AV_ROUND_UP);
 int version = duration < INT32_MAX ? 0 : 1;
 int entry_size, entry_count, size;
 -int64_t delay, start_ct = track->start_cts;
 -delay = av_rescale_rnd(track->start_dts + start_ct, MOV_TIMESCALE,
 -   track->timescale, AV_ROUND_DOWN);
 +int64_t delay;
 +int64_t mediatime;
 +int64_t skip = 0;
 +
 +delay = track->start_dts + track->start_cts;
 +
 +if (track->par->codec_type == AVMEDIA_TYPE_AUDIO &&
 +track->par->initial_padding > 0) {
 +/* Adjust delay so that initial_padding gets recorded in the
 + * MediaTime of an edit list entry even in the case that
 + * delay is positive. I.e. we don't want initial_padding to be
 + * absorbed and hidden in the delay. MediaTime must contain
 + * initial_padding in order to know where the actual media
 + * timeline begins. A player should drop samples until MediaTime
 + * is reached */
 +delay += av_rescale_rnd(track->par->initial_padding, 
 track->timescale,
 +track->par->sample_rate, AV_ROUND_UP);
 +skip = av_rescale_rnd(track->par->initial_padding,
 +  track->timescale,
 +  track->par->sample_rate, AV_ROUND_DOWN);
 +}
 +/* rescale delay, this was not done earlier to minimize rounding 
 errors */
 +delay = av_rescale_rnd(delay, MOV_TIMESCALE,
 +   track->timescale, AV_ROUND_NEAR_INF);
>>> Nice; I thought about pointing this out in the previous review but
>>> skipped, since it would at most mean an 1 ms rounding error. But this way
>>> it's even better, especially since the timescale in most cases will be
>>> equal to the sample rate.
>>>
 +
 version |= delay < INT32_MAX ? 0 : 1;

 entry_size = (version == 1) ? 20 : 12;
 @@ -1731,33 +1753,37 @@ static int mov_write_edts_tag(AVIOContext *pb, 
 MOVMuxContext *mov,
 }
 avio_wb32(pb, 0x0001);
 } else {
 -/* Avoid accidentally ending up with start_ct = -1 which has got a
 - * special meaning. Normally start_ct should end up positive or 
 zero
 - * here, but use FFMIN in case dts is a a small positive integer
 - * rounded to 0 when represented in MOV_TIMESCALE units. */
 -start_ct  = -FFMIN(track->start_dts, 0);
 -/* Note, this delay is calculated from the pts of the first 
 sample,
 - * ensuring that we don't reduce the duration for cases with
 - * dts<0 pts=0. */
 -duration += delay;
 +/* Skip the larger of initial_padding or the initial -PTS.
>>> This is good, this makes it very clear what it does.
>>>
 + * Skipping -PTS when PTS is negative ensures that timestamps
 + * can be represented with positive values in stts and ctts. */
>>> This still has me confused though - I don't see what that has to do with
>>> this code here.
>> Better wording is still required I guess.  stts and ctts will be positive 
>> regardless, but if the edit list entry is
>> *not* set to -PTS the resulting timestamps during decode will be wrong.  The 
>> only way to get correct timestamps without
>> setting -PTS as MediaTime would be something like your negative CTS patch.
> Yup. Given this, I'd be ok with reducing this comment just to the first 
> sentence - that seems like enough to me.
>
>>> Also see the patchset I posted the other day, about adding the
>>> negative_cts_offsets flag. In mov/mp4, it's ok with negative ctts values,
>>> which makes it possible to omit the edit lists for normal video with
>>> b-frames.
>> Yes, I did see this patch set.
> Ok, great. If this goes in first, I'll need to update patch 2/3 to check 
> for "start_dts || initial_padding".

I actually should have added initial_padding to this test since it's 

Re: [libav-devel] [PATCH 1/2] Add Cineform HD Decoder

2017-02-22 Thread Luca Barbato
On 22/02/2017 13:44, Diego Biurrun wrote:
> From: Kieran Kunhya 
> 
> Decodes YUV 4:2:2 10-bit and RGB 12-bit files.
> Older files with more subbands, skips, Bayer, alpha not supported.
> 
> Further fixes and refactorings by Anton Khirnov ,
> Diego Biurrun , Vittorio Giovara 
> 
> 
> Signed-off-by: Diego Biurrun 
> ---
> 
> Rebased on top of current master, converted to the new bitstream reader.
> 

Seems ok.

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

Re: [libav-devel] [PATCH 2/2] cfhd: Add FATE tests

2017-02-22 Thread Luca Barbato
On 22/02/2017 13:44, Diego Biurrun wrote:
> ---
>  tests/fate/video.mak  | 12 
>  tests/ref/fate/cfhd-1 | 11 +++
>  tests/ref/fate/cfhd-2 | 11 +++
>  tests/ref/fate/cfhd-3 | 11 +++
>  4 files changed, 45 insertions(+)
>  create mode 100644 tests/ref/fate/cfhd-1
>  create mode 100644 tests/ref/fate/cfhd-2
>  create mode 100644 tests/ref/fate/cfhd-3
> 

Possibly Ok.

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

[libav-devel] [PATCH 1/2] Add Cineform HD Decoder

2017-02-22 Thread Diego Biurrun
From: Kieran Kunhya 

Decodes YUV 4:2:2 10-bit and RGB 12-bit files.
Older files with more subbands, skips, Bayer, alpha not supported.

Further fixes and refactorings by Anton Khirnov ,
Diego Biurrun , Vittorio Giovara 

Signed-off-by: Diego Biurrun 
---

Rebased on top of current master, converted to the new bitstream reader.

 Changelog   |   1 +
 doc/general.texi|   1 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/cfhd.c   | 770 
 libavcodec/cfhd.h   | 108 +++
 libavcodec/cfhddata.c   | 337 +
 libavcodec/codec_desc.c |   7 +
 libavformat/riff.c  |   1 +
 10 files changed, 1228 insertions(+)
 create mode 100644 libavcodec/cfhd.c
 create mode 100644 libavcodec/cfhd.h
 create mode 100644 libavcodec/cfhddata.c

diff --git a/Changelog b/Changelog
index 713883d..a59b802 100644
--- a/Changelog
+++ b/Changelog
@@ -8,6 +8,7 @@ version :
 - VAAPI-accelerated deinterlacing
 - config.log and other configuration files moved into avbuild/ directory
 - VAAPI-accelerated MPEG-2 and VP8 encoding
+- Cineform HD decoder
 
 
 version 12:
diff --git a/doc/general.texi b/doc/general.texi
index d232300..7691767 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -625,6 +625,7 @@ following image formats are supported:
 @tab Amiga CD video codec
 @item Chinese AVS video  @tab  E  @tab  X
 @tab AVS1-P2, JiZhun profile, encoding through external library libxavs
+@item Cineform HD@tab @tab  X
 @item Delphine Software International CIN video  @tab @tab  X
 @tab Codec used in Delphine Software International games.
 @item Discworld II BMV Video @tab @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 7d28d66..ae5235d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -180,6 +180,7 @@ OBJS-$(CONFIG_CAVS_DECODER)+= cavs.o cavsdec.o 
cavsdsp.o \
   cavsdata.o mpeg12data.o
 OBJS-$(CONFIG_CDGRAPHICS_DECODER)  += cdgraphics.o
 OBJS-$(CONFIG_CDXL_DECODER)+= cdxl.o
+OBJS-$(CONFIG_CFHD_DECODER)+= cfhd.o cfhddata.o
 OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
 OBJS-$(CONFIG_CLJR_DECODER)+= cljrdec.o
 OBJS-$(CONFIG_CLJR_ENCODER)+= cljrenc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 46c42c5..ef9fbd6 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -127,6 +127,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(CAVS,  cavs);
 REGISTER_DECODER(CDGRAPHICS,cdgraphics);
 REGISTER_DECODER(CDXL,  cdxl);
+REGISTER_DECODER(CFHD,  cfhd);
 REGISTER_DECODER(CINEPAK,   cinepak);
 REGISTER_ENCDEC (CLJR,  cljr);
 REGISTER_DECODER(CLLC,  cllc);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b7bf85a..07d8892 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -392,6 +392,7 @@ enum AVCodecID {
 AV_CODEC_ID_MAGICYUV,
 AV_CODEC_ID_TRUEMOTION2RT,
 AV_CODEC_ID_AV1,
+AV_CODEC_ID_CFHD,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
new file mode 100644
index 000..e122deb
--- /dev/null
+++ b/libavcodec/cfhd.c
@@ -0,0 +1,770 @@
+/*
+ * Copyright (c) 2015-2016 Kieran Kunhya 
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Cineform HD video decoder
+ */
+
+#include "libavutil/attributes.h"
+#include "libavutil/buffer.h"
+#include "libavutil/common.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+
+#include "avcodec.h"
+#include "bitstream.h"
+#include "bytestream.h"
+#include "internal.h"
+#include "thread.h"
+#include "cfhd.h"
+
+enum CFHDParam {
+ChannelCount =  12,
+SubbandCount =  14,
+ImageWidth   =  20,
+ImageHeight  =  21,
+LowpassPrecision =  35,

[libav-devel] [PATCH 2/2] cfhd: Add FATE tests

2017-02-22 Thread Diego Biurrun
---
 tests/fate/video.mak  | 12 
 tests/ref/fate/cfhd-1 | 11 +++
 tests/ref/fate/cfhd-2 | 11 +++
 tests/ref/fate/cfhd-3 | 11 +++
 4 files changed, 45 insertions(+)
 create mode 100644 tests/ref/fate/cfhd-1
 create mode 100644 tests/ref/fate/cfhd-2
 create mode 100644 tests/ref/fate/cfhd-3

diff --git a/tests/fate/video.mak b/tests/fate/video.mak
index bd5d3ca..3256f4e 100644
--- a/tests/fate/video.mak
+++ b/tests/fate/video.mak
@@ -61,6 +61,18 @@ fate-cavs: CMD = framecrc -i $(TARGET_SAMPLES)/cavs/cavs.mpg 
-an
 FATE_SAMPLES_AVCONV-$(call DEMDEC, CDG, CDGRAPHICS) += fate-cdgraphics
 fate-cdgraphics: CMD = framecrc -i 
$(TARGET_SAMPLES)/cdgraphics/BrotherJohn.cdg -pix_fmt rgb24 -t 1
 
+FATE_CFHD-$(CONFIG_AVI_DEMUXER) += fate-cfhd-1
+fate-cfhd-1: CMD = framecrc -i $(TARGET_SAMPLES)/cfhd/cfhd_422.avi -pix_fmt 
yuv422p10le
+
+FATE_CFHD-$(CONFIG_AVI_DEMUXER) += fate-cfhd-2
+fate-cfhd-2: CMD = framecrc -i $(TARGET_SAMPLES)/cfhd/cfhd_444.avi -pix_fmt 
yuv422p10le
+
+FATE_CFHD-$(CONFIG_MOV_DEMUXER) += fate-cfhd-3
+fate-cfhd-3: CMD = framecrc -i $(TARGET_SAMPLES)/cfhd/cfhd_odd.mov -pix_fmt 
yuv422p10le
+
+FATE_SAMPLES_AVCONV-$(CONFIG_CFHD_DECODER) += $(FATE_CFHD-yes)
+fate-cfhd: $(FATE_CFHD-yes)
+
 FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, CLJR) += fate-cljr
 fate-cljr: CMD = framecrc -i $(TARGET_SAMPLES)/cljr/testcljr-partial.avi
 
diff --git a/tests/ref/fate/cfhd-1 b/tests/ref/fate/cfhd-1
new file mode 100644
index 000..cccfc8b
--- /dev/null
+++ b/tests/ref/fate/cfhd-1
@@ -0,0 +1,11 @@
+#tb 0: 1001/3
+0,  0,  0,1,  1382400, 0xa3e49817
+0,  1,  1,1,  1382400, 0x544fdfac
+0,  2,  2,1,  1382400, 0x84964e11
+0,  3,  3,1,  1382400, 0xc608c8d1
+0,  4,  4,1,  1382400, 0xf2f1404f
+0,  5,  5,1,  1382400, 0x5a3100ba
+0,  6,  6,1,  1382400, 0x3727baa9
+0,  7,  7,1,  1382400, 0x894f07db
+0,  8,  8,1,  1382400, 0x3ef27d46
+0,  9,  9,1,  1382400, 0x1f90880d
diff --git a/tests/ref/fate/cfhd-2 b/tests/ref/fate/cfhd-2
new file mode 100644
index 000..1af92d0
--- /dev/null
+++ b/tests/ref/fate/cfhd-2
@@ -0,0 +1,11 @@
+#tb 0: 1001/3
+0,  0,  0,1,  1382400, 0xe1c2201d
+0,  1,  1,1,  1382400, 0x13e5bc81
+0,  2,  2,1,  1382400, 0x3062ca82
+0,  3,  3,1,  1382400, 0x1c71624f
+0,  4,  4,1,  1382400, 0xf286c080
+0,  5,  5,1,  1382400, 0xd517d824
+0,  6,  6,1,  1382400, 0xe571ffd5
+0,  7,  7,1,  1382400, 0x94a523ff
+0,  8,  8,1,  1382400, 0x85c58fca
+0,  9,  9,1,  1382400, 0x6b3278b0
diff --git a/tests/ref/fate/cfhd-3 b/tests/ref/fate/cfhd-3
new file mode 100644
index 000..6169848
--- /dev/null
+++ b/tests/ref/fate/cfhd-3
@@ -0,0 +1,11 @@
+#tb 0: 1/14587
+0,  0,  0,0,   478144, 0x6ed01dcd
+0,   1000,   1000,0,   478144, 0x6ed01dcd
+0,   2000,   2000,0,   478144, 0x6ed01dcd
+0,   3000,   3000,0,   478144, 0xb1b4a74b
+0,   4000,   4000,0,   478144, 0x94c345c3
+0,   5000,   5000,0,   478144, 0x05e0388d
+0,   6000,   6000,0,   478144, 0xe747476a
+0,   7000,   7000,0,   478144, 0x8c1561f1
+0,   8000,   8000,0,   478144, 0x8c1561f1
+0,   9000,   9000,0,   478144, 0x8c1561f1
-- 
2.1.4

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

Re: [libav-devel] [PATCH] Place attribute_deprecated in the right position for struct declarations

2017-02-22 Thread Mark Thompson
On 22/02/17 10:59, Diego Biurrun wrote:
> libavcodec/vaapi.h:58:1: warning: attribute 'deprecated' is ignored, place it 
> after "struct" to apply attribute to type declaration [-Wignored-attributes]
> ---
>  libavcodec/vaapi.h | 3 +--
>  libavcodec/xvmc.h  | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
> index ceb7904..391368c 100644
> --- a/libavcodec/vaapi.h
> +++ b/libavcodec/vaapi.h
> @@ -55,8 +55,7 @@
>   *
>   * Deprecated: use AVCodecContext.hw_frames_ctx instead.
>   */
> -attribute_deprecated
> -struct vaapi_context {
> +struct attribute_deprecated vaapi_context {
>  /**
>   * Window system dependent data
>   *
> diff --git a/libavcodec/xvmc.h b/libavcodec/xvmc.h
> index 950ed18..91027b9 100644
> --- a/libavcodec/xvmc.h
> +++ b/libavcodec/xvmc.h
> @@ -45,7 +45,7 @@
>  #define AV_XVMC_ID0x1DC711C0  /**< special value to 
> ensure that regular pixel routines haven't corrupted the struct
> the number is 1337 
> speak for the letters IDCT MCo (motion compensation) */
>  
> -attribute_deprecated struct xvmc_pix_fmt {
> +struct attribute_deprecated xvmc_pix_fmt {
>  /** The field contains the special constant value AV_XVMC_ID.
>  It is used as a test that the application correctly uses the API,
>  and that there is no corruption caused by pixel routines.
> 

Huh.  I can see why the compiler is doing what it is there - attribute before 
struct is deprecating a variable or typedef using the struct rather than the 
struct itself - but to end up silently applying the attribute to nothing 
because there is no declarator is pretty crazy (in gcc - a win for warnings in 
clang, I guess).

Patch LGTM.

Thanks,

- Mark

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

[libav-devel] [PATCH] Place attribute_deprecated in the right position for struct declarations

2017-02-22 Thread Diego Biurrun
libavcodec/vaapi.h:58:1: warning: attribute 'deprecated' is ignored, place it 
after "struct" to apply attribute to type declaration [-Wignored-attributes]
---
 libavcodec/vaapi.h | 3 +--
 libavcodec/xvmc.h  | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
index ceb7904..391368c 100644
--- a/libavcodec/vaapi.h
+++ b/libavcodec/vaapi.h
@@ -55,8 +55,7 @@
  *
  * Deprecated: use AVCodecContext.hw_frames_ctx instead.
  */
-attribute_deprecated
-struct vaapi_context {
+struct attribute_deprecated vaapi_context {
 /**
  * Window system dependent data
  *
diff --git a/libavcodec/xvmc.h b/libavcodec/xvmc.h
index 950ed18..91027b9 100644
--- a/libavcodec/xvmc.h
+++ b/libavcodec/xvmc.h
@@ -45,7 +45,7 @@
 #define AV_XVMC_ID0x1DC711C0  /**< special value to ensure 
that regular pixel routines haven't corrupted the struct
the number is 1337 
speak for the letters IDCT MCo (motion compensation) */
 
-attribute_deprecated struct xvmc_pix_fmt {
+struct attribute_deprecated xvmc_pix_fmt {
 /** The field contains the special constant value AV_XVMC_ID.
 It is used as a test that the application correctly uses the API,
 and that there is no corruption caused by pixel routines.
-- 
2.1.4

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

Re: [libav-devel] [PATCH] movenc: factor initial_padding into edit lists

2017-02-22 Thread Martin Storsjö

On Tue, 21 Feb 2017, John Stebbins wrote:


On 02/21/2017 02:54 PM, Martin Storsjö wrote:

On Tue, 21 Feb 2017, John Stebbins wrote:


initial_padding was getting added to the edit list indirectly due to
initial negative dts.  But in cases where the audio is delayed,
all or part of initial_padding would be unaccounted for.  This patch
makes initial_padding explicit.
---
libavformat/movenc.c | 58 +---
1 file changed, 42 insertions(+), 16 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 689291d..d60e194 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1698,9 +1698,31 @@ static int mov_write_edts_tag(AVIOContext *pb, 
MOVMuxContext *mov,
  track->timescale, AV_ROUND_UP);
int version = duration < INT32_MAX ? 0 : 1;
int entry_size, entry_count, size;
-int64_t delay, start_ct = track->start_cts;
-delay = av_rescale_rnd(track->start_dts + start_ct, MOV_TIMESCALE,
-   track->timescale, AV_ROUND_DOWN);
+int64_t delay;
+int64_t mediatime;
+int64_t skip = 0;
+
+delay = track->start_dts + track->start_cts;
+
+if (track->par->codec_type == AVMEDIA_TYPE_AUDIO &&
+track->par->initial_padding > 0) {
+/* Adjust delay so that initial_padding gets recorded in the
+ * MediaTime of an edit list entry even in the case that
+ * delay is positive. I.e. we don't want initial_padding to be
+ * absorbed and hidden in the delay. MediaTime must contain
+ * initial_padding in order to know where the actual media
+ * timeline begins. A player should drop samples until MediaTime
+ * is reached */
+delay += av_rescale_rnd(track->par->initial_padding, track->timescale,
+track->par->sample_rate, AV_ROUND_UP);
+skip = av_rescale_rnd(track->par->initial_padding,
+  track->timescale,
+  track->par->sample_rate, AV_ROUND_DOWN);
+}
+/* rescale delay, this was not done earlier to minimize rounding errors */
+delay = av_rescale_rnd(delay, MOV_TIMESCALE,
+   track->timescale, AV_ROUND_NEAR_INF);

Nice; I thought about pointing this out in the previous review but
skipped, since it would at most mean an 1 ms rounding error. But this way
it's even better, especially since the timescale in most cases will be
equal to the sample rate.


+
version |= delay < INT32_MAX ? 0 : 1;

entry_size = (version == 1) ? 20 : 12;
@@ -1731,33 +1753,37 @@ static int mov_write_edts_tag(AVIOContext *pb, 
MOVMuxContext *mov,
}
avio_wb32(pb, 0x0001);
} else {
-/* Avoid accidentally ending up with start_ct = -1 which has got a
- * special meaning. Normally start_ct should end up positive or zero
- * here, but use FFMIN in case dts is a a small positive integer
- * rounded to 0 when represented in MOV_TIMESCALE units. */
-start_ct  = -FFMIN(track->start_dts, 0);
-/* Note, this delay is calculated from the pts of the first sample,
- * ensuring that we don't reduce the duration for cases with
- * dts<0 pts=0. */
-duration += delay;
+/* Skip the larger of initial_padding or the initial -PTS.

This is good, this makes it very clear what it does.


+ * Skipping -PTS when PTS is negative ensures that timestamps
+ * can be represented with positive values in stts and ctts. */

This still has me confused though - I don't see what that has to do with
this code here.


Better wording is still required I guess.  stts and ctts will be positive 
regardless, but if the edit list entry is
*not* set to -PTS the resulting timestamps during decode will be wrong.  The 
only way to get correct timestamps without
setting -PTS as MediaTime would be something like your negative CTS patch.


Yup. Given this, I'd be ok with reducing this comment just to the first 
sentence - that seems like enough to me.



Also see the patchset I posted the other day, about adding the
negative_cts_offsets flag. In mov/mp4, it's ok with negative ctts values,
which makes it possible to omit the edit lists for normal video with
b-frames.


Yes, I did see this patch set.


Ok, great. If this goes in first, I'll need to update patch 2/3 to check 
for "start_dts || initial_padding".



The rest of this patch seems fine (still) - you seems to be doing a lot of
practical testing of it, which gives me confidence. I assume/hope you've
tested (either manually or later via the movenc unit test) that it
preserves the current behaviour for video tracks that start with a
positive offset.


I assume you mean delay here where an empty edit is inserted. I've tested video 
with positive delay, audio with positive
delay and both with 0 delay. There is also another related patch on the mailing 
list now that extracts 

Re: [libav-devel] [PATCH] mkv: Update the seek test to match 5d3953a5dc

2017-02-22 Thread Luca Barbato
On 22/02/2017 10:11, Diego Biurrun wrote:
> On Wed, Feb 22, 2017 at 09:56:36AM +0100, Luca Barbato wrote:
>> ---
>>  tests/ref/seek/lavf-mkv | 26 +-
>>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> Hopefully OK
> 

fate seems happy with this :)

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

Re: [libav-devel] [PATCH] mkv: Update the seek test to match 5d3953a5dc

2017-02-22 Thread Diego Biurrun
On Wed, Feb 22, 2017 at 09:56:36AM +0100, Luca Barbato wrote:
> ---
>  tests/ref/seek/lavf-mkv | 26 +-
>  1 file changed, 13 insertions(+), 13 deletions(-)

Hopefully OK

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] mkv: Update the seek test to match 5d3953a5dc

2017-02-22 Thread Luca Barbato
---
 tests/ref/seek/lavf-mkv | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/ref/seek/lavf-mkv b/tests/ref/seek/lavf-mkv
index 530c8df..8267a2a 100644
--- a/tests/ref/seek/lavf-mkv
+++ b/tests/ref/seek/lavf-mkv
@@ -1,53 +1,53 @@
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:633 size:   
208
 ret: 0 st:-1 flags:0  ts:-1.00
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:849 size: 
27837
 ret: 0 st:-1 flags:1  ts: 1.894167
 ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292271 size: 
27834
 ret: 0 st: 0 flags:0  ts: 0.788000
 ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292271 size: 
27834
 ret: 0 st: 0 flags:1  ts:-0.317000
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:849 size: 
27837
 ret: 0 st: 1 flags:0  ts: 2.577000
 ret:-EOF
 ret: 0 st: 1 flags:1  ts: 1.471000
-ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 320112 size:   
209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320112 size:   
209
 ret: 0 st:-1 flags:0  ts: 0.365002
 ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146824 size: 
27925
 ret: 0 st:-1 flags:1  ts:-0.740831
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:849 size: 
27837
 ret: 0 st: 0 flags:0  ts: 2.153000
 ret:-EOF
 ret: 0 st: 0 flags:1  ts: 1.048000
 ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292271 size: 
27834
 ret: 0 st: 1 flags:0  ts:-0.058000
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:633 size:   
208
 ret: 0 st: 1 flags:1  ts: 2.836000
-ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 320112 size:   
209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320112 size:   
209
 ret: 0 st:-1 flags:0  ts: 1.730004
 ret:-EOF
 ret: 0 st:-1 flags:1  ts: 0.624171
 ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146824 size: 
27925
 ret: 0 st: 0 flags:0  ts:-0.482000
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:849 size: 
27837
 ret: 0 st: 0 flags:1  ts: 2.413000
 ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292271 size: 
27834
 ret: 0 st: 1 flags:0  ts: 1.307000
 ret:-EOF
 ret: 0 st: 1 flags:1  ts: 0.201000
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 1 flags:1 dts: 0.183000 pts: 0.183000 pos:  72204 size:   
209
 ret: 0 st:-1 flags:0  ts:-0.904994
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:849 size: 
27837
 ret: 0 st:-1 flags:1  ts: 1.989173
 ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292271 size: 
27834
 ret: 0 st: 0 flags:0  ts: 0.883000
 ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292271 size: 
27834
 ret: 0 st: 0 flags:1  ts:-0.222000
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:849 size: 
27837
 ret: 0 st: 1 flags:0  ts: 2.672000
 ret:-EOF
 ret: 0 st: 1 flags:1  ts: 1.566000
-ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 320112 size:   
209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320112 size:   
209
 ret: 0 st:-1 flags:0  ts: 0.460008
 ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146824 size: 
27925
 ret: 0 st:-1 flags:1  ts:-0.645825
-ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos:633 size:   
208
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:849 size: 
27837
-- 
2.9.2

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

Re: [libav-devel] [PATCH] fate: Update fate-lavf-mkv after commit 5d3953a5dc

2017-02-22 Thread Luca Barbato
On 22/02/2017 06:53, wm4 wrote:
> Come on, either it's ok or it's not ok.

I was wondering if it was enough, in fact it is not.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 3/3] build: Fine-grained link-time dependency settings

2017-02-22 Thread Diego Biurrun
On Tue, Feb 21, 2017 at 07:58:04PM +0100, Luca Barbato wrote:
> On 21/02/2017 18:26, Diego Biurrun wrote:
> >  all: $(AVPROGS) alltools checkheaders examples testprogs
> 
> What?

That's a local change that I have to force building all targets on Oracle.
Notice that it's not part of the patch series, it's just something that
caught your eye.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel