[FFmpeg-devel] [PATCH] [RFC] avformat/async: support filling with a background thread.

2015-07-16 Thread Zhang Rui
---
 configure|   1 +
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/async.c  | 380 +++
 4 files changed, 383 insertions(+)
 create mode 100644 libavformat/async.c

diff --git a/configure b/configure
index 1cd9fd6..fa1868a 100755
--- a/configure
+++ b/configure
@@ -2638,6 +2638,7 @@ x11grab_indev_deps="x11grab"
 x11grab_xcb_indev_deps="libxcb"
 
 # protocols
+async_protocol_deps="pthreads"
 bluray_protocol_deps="libbluray"
 ffrtmpcrypt_protocol_deps="!librtmp_protocol"
 ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 479361a..108b6a6 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -496,6 +496,7 @@ OBJS-$(CONFIG_LIBSSH_PROTOCOL)   += libssh.o
 OBJS-$(CONFIG_LIBSMBCLIENT_PROTOCOL) += libsmbclient.o
 
 # protocols I/O
+OBJS-$(CONFIG_ASYNC_PROTOCOL)+= async.o
 OBJS-$(CONFIG_APPLEHTTP_PROTOCOL)+= hlsproto.o
 OBJS-$(CONFIG_BLURAY_PROTOCOL)   += bluray.o
 OBJS-$(CONFIG_CACHE_PROTOCOL)+= cache.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 2caa6b1..181cb9e 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -351,6 +351,7 @@ void av_register_all(void)
 
 
 /* protocols */
+REGISTER_PROTOCOL(ASYNC,async);
 REGISTER_PROTOCOL(BLURAY,   bluray);
 REGISTER_PROTOCOL(CACHE,cache);
 REGISTER_PROTOCOL(CONCAT,   concat);
diff --git a/libavformat/async.c b/libavformat/async.c
new file mode 100644
index 000..36c7a061
--- /dev/null
+++ b/libavformat/async.c
@@ -0,0 +1,380 @@
+/*
+ * Input async protocol.
+ * Copyright (c) 2015 Zhang Rui 
+ *
+ * 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
+ *
+ * Based on libavformat/cache.c by Michael Niedermayer
+ */
+
+ /**
+ * @TODO
+ *  support timeout
+ *  support backward short seek
+ *  support work with concatdec, hls
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
+#include "libavutil/error.h"
+#include "libavutil/fifo.h"
+#include "libavutil/log.h"
+#include "libavutil/opt.h"
+#include "url.h"
+#include 
+#include 
+#include 
+
+#define BUFFER_CAPACITY (4 * 1024 * 1024)
+#define SHORT_SEEK_THRESHOLD(256 * 1024)
+
+typedef struct Context {
+AVClass*class;
+URLContext *inner;
+
+int seek_request;
+size_t  seek_pos;
+int seek_whence;
+int seek_completed;
+int64_t seek_ret;
+
+int io_error;
+int io_eof_reached;
+
+size_t  logical_pos;
+size_t  logical_size;
+AVFifoBuffer   *fifo;
+
+pthread_cond_t  cond_wakeup_main;
+pthread_cond_t  cond_wakeup_background;
+pthread_mutex_t mutex;
+pthread_t   async_buffer_thread;
+
+int abort_request;
+AVIOInterruptCB interrupt_callback;
+} Context;
+
+static int async_interrupt_callback(void *arg)
+{
+URLContext *h   = arg;
+Context*c   = h->priv_data;
+int ret = 0;
+
+if (c->interrupt_callback.callback) {
+ret = c->interrupt_callback.callback(c->interrupt_callback.opaque);
+if (!ret)
+return ret;
+}
+
+return c->abort_request;
+}
+
+static void *async_buffer_task(void *arg)
+{
+URLContext   *h= arg;
+Context  *c= h->priv_data;
+AVFifoBuffer *fifo = c->fifo;
+int   ret  = 0;
+
+while (1) {
+if (async_interrupt_callback(h)) {
+c->io_eof_reached = 1;
+c->io_error   = AVERROR_EXIT;
+break;
+}
+
+if (c->seek_request) {
+pthread_mutex_lock(&c->mutex);
+
+ret = ffurl_seek(c->inner, c->seek_pos, c->seek_whence);
+if (ret < 0) {
+c->io_eof_reached = 1;
+c->io_error   = ret;
+} else {
+c->io_eof_reached = 0;
+c->io_error   = 0;
+}
+
+c->seek_completed = 1;
+c->seek_ret   = ret;
+c->seek_request   = 0;
+
+av_fifo_reset(fifo);
+
+

Re: [FFmpeg-devel] [PATCH] [RFC] avformat/async: support filling with a background thread.

2015-07-16 Thread Zhang Rui
Supposed to work as:
async:cache:http://example.org/video.mp4
or
async:http://example.org/video.mp4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avformat/mpegtsenc: Support a user specified PAT/PMT period

2015-07-16 Thread Hendrik Leppkes
On Thu, Jul 16, 2015 at 1:54 AM, Michael Niedermayer  wrote:
> From: Michael Niedermayer 
>
> Can be used to fix Ticket3714
>
> Signed-off-by: Michael Niedermayer 

There already was a patch on the ML some time ago that did this which
was never applied, and it looked much simpler (and had better option
names, imho):

https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-April/171320.html
https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-April/171321.html

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


[FFmpeg-devel] [PATCH] avfilter/vf_alphamerge: switch to dualinput

2015-07-16 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/Makefile|  2 +-
 libavfilter/vf_alphamerge.c | 73 +
 2 files changed, 29 insertions(+), 46 deletions(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 058b9e9..c504070 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -93,7 +93,7 @@ OBJS-$(CONFIG_ANULLSINK_FILTER)  += 
asink_anullsink.o
 
 OBJS-$(CONFIG_ASS_FILTER)+= vf_subtitles.o
 OBJS-$(CONFIG_ALPHAEXTRACT_FILTER)   += vf_extractplanes.o
-OBJS-$(CONFIG_ALPHAMERGE_FILTER) += vf_alphamerge.o
+OBJS-$(CONFIG_ALPHAMERGE_FILTER) += vf_alphamerge.o dualinput.o 
framesync.o
 OBJS-$(CONFIG_BBOX_FILTER)   += bbox.o vf_bbox.o
 OBJS-$(CONFIG_BLACKDETECT_FILTER)+= vf_blackdetect.o
 OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o
diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index 5f0da35..a5fb311 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -27,27 +27,24 @@
 
 #include "libavutil/pixfmt.h"
 #include "avfilter.h"
-#include "bufferqueue.h"
 #include "drawutils.h"
 #include "formats.h"
 #include "internal.h"
+#include "dualinput.h"
 #include "video.h"
 
 enum { Y, U, V, A };
 
 typedef struct {
-int frame_requested;
+FFDualInputContext dinput;
 int is_packed_rgb;
 uint8_t rgba_map[4];
-struct FFBufQueue queue_main;
-struct FFBufQueue queue_alpha;
 } AlphaMergeContext;
 
 static av_cold void uninit(AVFilterContext *ctx)
 {
-AlphaMergeContext *merge = ctx->priv;
-ff_bufqueue_discard_all(&merge->queue_main);
-ff_bufqueue_discard_all(&merge->queue_alpha);
+AlphaMergeContext *s = ctx->priv;
+ff_dualinput_uninit(&s->dinput);
 }
 
 static int query_formats(AVFilterContext *ctx)
@@ -77,8 +74,11 @@ static int config_input_main(AVFilterLink *inlink)
 static int config_output(AVFilterLink *outlink)
 {
 AVFilterContext *ctx = outlink->src;
+AlphaMergeContext *s = ctx->priv;
 AVFilterLink *mainlink = ctx->inputs[0];
 AVFilterLink *alphalink = ctx->inputs[1];
+int ret;
+
 if (mainlink->w != alphalink->w || mainlink->h != alphalink->h) {
 av_log(ctx, AV_LOG_ERROR,
"Input frame sizes do not match (%dx%d vs %dx%d).\n",
@@ -92,12 +92,16 @@ static int config_output(AVFilterLink *outlink)
 outlink->time_base = mainlink->time_base;
 outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio;
 outlink->frame_rate = mainlink->frame_rate;
+
+if ((ret = ff_dualinput_init(ctx, &s->dinput)) < 0)
+return ret;
+
 return 0;
 }
 
-static void draw_frame(AVFilterContext *ctx,
-   AVFrame *main_buf,
-   AVFrame *alpha_buf)
+static AVFrame *draw_frame(AVFilterContext *ctx,
+   AVFrame *main_buf,
+   const AVFrame *alpha_buf)
 {
 AlphaMergeContext *merge = ctx->priv;
 int h = main_buf->height;
@@ -124,50 +128,28 @@ static void draw_frame(AVFilterContext *ctx,
FFMIN(main_linesize, alpha_linesize));
 }
 }
+
+return main_buf;
 }
 
-static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
+static av_cold int init(AVFilterContext *ctx)
 {
-AVFilterContext *ctx = inlink->dst;
-AlphaMergeContext *merge = ctx->priv;
-
-int ret = 0;
-int is_alpha = (inlink == ctx->inputs[1]);
-struct FFBufQueue *queue =
-(is_alpha ? &merge->queue_alpha : &merge->queue_main);
-ff_bufqueue_add(ctx, queue, buf);
-
-do {
-AVFrame *main_buf, *alpha_buf;
-
-if (!ff_bufqueue_peek(&merge->queue_main, 0) ||
-!ff_bufqueue_peek(&merge->queue_alpha, 0)) break;
+AlphaMergeContext *s = ctx->priv;
+s->dinput.process = draw_frame;
+return 0;
+}
 
-main_buf = ff_bufqueue_get(&merge->queue_main);
-alpha_buf = ff_bufqueue_get(&merge->queue_alpha);
+static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
+{
+AlphaMergeContext *s = inlink->dst->priv;
 
-merge->frame_requested = 0;
-draw_frame(ctx, main_buf, alpha_buf);
-ret = ff_filter_frame(ctx->outputs[0], main_buf);
-av_frame_free(&alpha_buf);
-} while (ret >= 0);
-return ret;
+return ff_dualinput_filter_frame(&s->dinput, inlink, buf);
 }
 
 static int request_frame(AVFilterLink *outlink)
 {
-AVFilterContext *ctx = outlink->src;
-AlphaMergeContext *merge = ctx->priv;
-int in, ret;
-
-merge->frame_requested = 1;
-while (merge->frame_requested) {
-in = ff_bufqueue_peek(&merge->queue_main, 0) ? 1 : 0;
-ret = ff_request_frame(ctx->inputs[in]);
-if (ret < 0)
-return ret;
-}
-return 0;
+AlphaMergeContext *s = outlink->src->priv;
+return ff_dualinput_request_frame(&s->dinput, outlink);
 }
 
 static const AVFilterPad alphamerge_inputs[] = {
@@ -199,6 

Re: [FFmpeg-devel] [PATCH] avfilter/vf_alphamerge: switch to dualinput

2015-07-16 Thread Nicolas George
Le septidi 27 messidor, an CCXXIII, Paul B Mahol a écrit :
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/Makefile|  2 +-
>  libavfilter/vf_alphamerge.c | 73 
> +
>  2 files changed, 29 insertions(+), 46 deletions(-)
> 
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 058b9e9..c504070 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -93,7 +93,7 @@ OBJS-$(CONFIG_ANULLSINK_FILTER)  += 
> asink_anullsink.o

I think you should not use dualinput in new code: better use framesync
directly.

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


[FFmpeg-devel] [PATCH] avfilter: add random video filter

2015-07-16 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi |  12 +
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/vf_random.c  | 136 +++
 4 files changed, 150 insertions(+)
 create mode 100644 libavfilter/vf_random.c

diff --git a/doc/filters.texi b/doc/filters.texi
index 2679090..04d9333 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -8095,6 +8095,18 @@ qp=2+2*sin(PI*qp)
 @end example
 @end itemize
 
+@section random
+
+Flush video frames from internal cache of frames into a random order.
+No frame is discarded.
+Inspired by @ref{frei0r} nervous filter.
+
+@table @option
+@item frames
+Set size in number of frame of internal cache, in range from 2 to 400.
+Default is 30.
+@end table
+
 @section removegrain
 
 The removegrain filter is a spatial denoiser for progressive video.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 058b9e9..8150640 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -182,6 +182,7 @@ OBJS-$(CONFIG_PP7_FILTER)+= vf_pp7.o
 OBJS-$(CONFIG_PSNR_FILTER)   += vf_psnr.o dualinput.o 
framesync.o
 OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
 OBJS-$(CONFIG_QP_FILTER) += vf_qp.o
+OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o
 OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o
 OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o 
vf_removelogo.o
 OBJS-$(CONFIG_REPEATFIELDS_FILTER)   += vf_repeatfields.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index b0d8410..d1be38a 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -197,6 +197,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(PSNR,   psnr,   vf);
 REGISTER_FILTER(PULLUP, pullup, vf);
 REGISTER_FILTER(QP, qp, vf);
+REGISTER_FILTER(RANDOM, random, vf);
 REGISTER_FILTER(REMOVEGRAIN,removegrain,vf);
 REGISTER_FILTER(REMOVELOGO, removelogo, vf);
 REGISTER_FILTER(REPEATFIELDS,   repeatfields,   vf);
diff --git a/libavfilter/vf_random.c b/libavfilter/vf_random.c
new file mode 100644
index 000..ce64915
--- /dev/null
+++ b/libavfilter/vf_random.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2015 Paul B Mahol
+ *
+ * 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/opt.h"
+#include "libavutil/lfg.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+#define MAX_FRAMES 400
+
+typedef struct RandomContext {
+const AVClass *class;
+
+AVLFG lfg;
+int nb_frames;
+int nb_frames_filled;
+AVFrame *frames[MAX_FRAMES];
+int64_t pts[MAX_FRAMES];
+int flush_idx;
+} RandomContext;
+
+#define OFFSET(x) offsetof(RandomContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption random_options[] = {
+{ "frames", "set number of frames in cache", OFFSET(nb_frames), 
AV_OPT_TYPE_INT, {.i64=30}, 2, MAX_FRAMES, FLAGS },
+{ NULL }
+};
+
+AVFILTER_DEFINE_CLASS(random);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+RandomContext *s = ctx->priv;
+
+av_lfg_init(&s->lfg, 1337);
+
+return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+AVFilterContext *ctx = inlink->dst;
+RandomContext *s = ctx->priv;
+AVFilterLink *outlink = ctx->outputs[0];
+AVFrame *out;
+int idx;
+
+if (s->nb_frames_filled < s->nb_frames) {
+s->frames[s->nb_frames_filled] = in;
+s->pts[s->nb_frames_filled++] = in->pts;
+return 0;
+}
+
+idx = av_lfg_get(&s->lfg) % s->nb_frames;
+
+out = s->frames[idx];
+out->pts = s->pts[0];
+memmove(&s->pts[0], &s->pts[1], (s->nb_frames - 1) * sizeof(s->pts[0]));
+s->frames[idx] = in;
+s->pts[s->nb_frames - 1] = in->pts;
+
+return ff_filter_frame(outlink, out);
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+AVFilterContext *ctx = outlink->src;
+RandomContext *

Re: [FFmpeg-devel] [PATCH 1/5] concatdec: add support for specifying inpoint of files

2015-07-16 Thread Nicolas George
Le septidi 27 messidor, an CCXXIII, Marton Balint a écrit :
> Could you please check the v2 patch series? If it is fine with you, I will
> send the merge request to Michael.

Sorry for the delay. Apart from the minor comment I just sent, ok for me.

Regards,

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


Re: [FFmpeg-devel] [PATCH 1/5] concatdec: add support for specifying inpoint of files

2015-07-16 Thread Nicolas George
Le tridi 23 messidor, an CCXXIII, Marton Balint a écrit :
> Signed-off-by: Marton Balint 
> ---
>  doc/demuxers.texi   | 17 +
>  libavformat/concatdec.c | 39 ++-
>  2 files changed, 43 insertions(+), 13 deletions(-)
> 
> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> index 35a1561..27a9409 100644
> --- a/doc/demuxers.texi
> +++ b/doc/demuxers.texi
> @@ -112,6 +112,23 @@ file is not available or accurate.
>  If the duration is set for all files, then it is possible to seek in the
>  whole concatenated video.
>  
> +@item @code{inpoint @var{timestamp}}
> +In point of the file. When the demuxer opens the file it instantly seeks to 
> the
> +specified timestamp. Seeking is done so that all streams can be presented
> +successfully at In point.
> +
> +This directive works best with intra frame codecs, because for non-intra 
> frame
> +ones you will usually get extra packets before the actual In point and the
> +decoded content will most likely contain frames before In point too.
> +
> +For each file, packets before the file In point will have timestamps less 
> than
> +the calculated start timestamp of the file (negative in case of the first
> +file), and the duration of the files (if not specified by the @code{duration}
> +directive) will be reduced based on their specified In point.
> +
> +Because of potential packets before the specified In point, packet timestamps
> +may overlap between two concatenated files.
> +
>  @item @code{stream}
>  Introduce a stream in the virtual file.
>  All subsequent stream-related directives apply to the last introduced
> diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> index e95ff34..de1543a 100644
> --- a/libavformat/concatdec.c
> +++ b/libavformat/concatdec.c
> @@ -41,8 +41,11 @@ typedef struct ConcatStream {
>  typedef struct {
>  char *url;
>  int64_t start_time;
> +int64_t file_start_time;
> +int64_t file_inpoint;
>  int64_t duration;
>  ConcatStream *streams;
> +int64_t inpoint;
>  int nb_streams;
>  } ConcatFile;
>  
> @@ -142,6 +145,7 @@ static int add_file(AVFormatContext *avf, char *filename, 
> ConcatFile **rfile,
>  file->url= url;
>  file->start_time = AV_NOPTS_VALUE;
>  file->duration   = AV_NOPTS_VALUE;
> +file->inpoint= AV_NOPTS_VALUE;
>  
>  return 0;
>  
> @@ -306,8 +310,14 @@ static int open_file(AVFormatContext *avf, unsigned 
> fileno)
>  file->start_time = !fileno ? 0 :
> cat->files[fileno - 1].start_time +
> cat->files[fileno - 1].duration;
> +file->file_start_time = (avf->start_time == AV_NOPTS_VALUE) ? 0 : 
> avf->start_time;

> +file->file_inpoint = (file->file_inpoint == AV_NOPTS_VALUE) ? 
> file->file_start_time : file->inpoint;

If I read this correctly, file->file_inpoint is always set.

>  if ((ret = match_streams(avf)) < 0)
>  return ret;
> +if (file->inpoint != AV_NOPTS_VALUE) {
> +   if ((ret = avformat_seek_file(cat->avf, -1, INT64_MIN, file->inpoint, 
> file->inpoint, 0) < 0))
> +   return ret;
> +}
>  return 0;
>  }
>  
> @@ -353,20 +363,23 @@ static int concat_read_header(AVFormatContext *avf)
>  }
>  if ((ret = add_file(avf, filename, &file, &nb_files_alloc)) < 0)
>  goto fail;
> -} else if (!strcmp(keyword, "duration")) {
> +} else if (!strcmp(keyword, "duration") || !strcmp(keyword, 
> "inpoint")) {
>  char *dur_str = get_keyword(&cursor);
>  int64_t dur;
>  if (!file) {
> -av_log(avf, AV_LOG_ERROR, "Line %d: duration without file\n",
> -   line);
> +av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n",
> +   line, keyword);
>  FAIL(AVERROR_INVALIDDATA);
>  }
>  if ((ret = av_parse_time(&dur, dur_str, 1)) < 0) {
> -av_log(avf, AV_LOG_ERROR, "Line %d: invalid duration '%s'\n",
> -   line, dur_str);
> +av_log(avf, AV_LOG_ERROR, "Line %d: invalid %s '%s'\n",
> +   line, keyword, dur_str);
>  goto fail;
>  }
> -file->duration = dur;
> +if (!strcmp(keyword, "duration"))
> +file->duration = dur;
> +else if (!strcmp(keyword, "inpoint"))
> +file->inpoint = dur;
>  } else if (!strcmp(keyword, "stream")) {
>  if (!avformat_new_stream(avf, NULL))
>  FAIL(AVERROR(ENOMEM));
> @@ -428,8 +441,11 @@ static int open_next_file(AVFormatContext *avf)
>  ConcatContext *cat = avf->priv_data;
>  unsigned fileno = cat->cur_file - cat->files;
>  
> -if (cat->cur_file->duration == AV_NOPTS_VALUE)
> +if (cat->cur_file->duration == AV_NOPTS_VALUE) {
>  cat->cur_file->duration = cat->avf->durat

Re: [FFmpeg-devel] [PATCH v4] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread wm4
On Wed, 15 Jul 2015 23:03:07 +0200
Nicolas George  wrote:


> > +
> > +#define DRM_BLOB_SIZE 56
> > +
> > +static int mov_read_adrm(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> > +{
> > +// extracted from libAAX_SDK.so and AAXSDKWin.dll files!
> > +unsigned char fixed_key[] = { 0x77, 0x21, 0x4d, 0x4b, 0x19, 0x6a, 
> > 0x87, 0xcd,
> > +  0x52, 0x00, 0x45, 0xfd, 0x20, 0xa5, 
> > 0x1d, 0x67 };
> 
> > +unsigned char intermediate_key[20] = {0};
> > +unsigned char intermediate_iv[20] = {0};
> > +unsigned char input[64] = {0};
> > +unsigned char output[64] = {0};
> > +unsigned char file_checksum[20] = {0};
> > +unsigned char file_checksum_encoded[41] = {0};
> > +unsigned char file_key_encoded[41] = {0};
> > +unsigned char file_iv_encoded[41] = {0};
> 
> Do you need to init to 0? The compiler or valgrind can detect access to
> uninitialized memory, if you init to 0, they can not do it.

Initializing them is always safer. Valgrind doesn't catch everything
either.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avformat/mpegtsenc: Support a user specified PAT/PMT period

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 09:58:54AM +0200, Hendrik Leppkes wrote:
> On Thu, Jul 16, 2015 at 1:54 AM, Michael Niedermayer  wrote:
> > From: Michael Niedermayer 
> >
> > Can be used to fix Ticket3714
> >
> > Signed-off-by: Michael Niedermayer 
> 
> There already was a patch on the ML some time ago that did this which
> was never applied,

> and it looked much simpler

yes but it only works with a fixed and specified muxrate
without muxrate the period parameters are in packets with a specified
muxrate they are in time, i dont think that double semantic is a good
idea and would confuse users quite a bit


> (and had better option
> names, imho):

yes, ill change that

thanks


> 
> https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-April/171320.html
> https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-April/171321.html
> 
> - Hendrik
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


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


[FFmpeg-devel] [PATCH] avfilter/vf_alphamerge: switch to framesync

2015-07-16 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/Makefile|   2 +-
 libavfilter/vf_alphamerge.c | 145 ++--
 2 files changed, 72 insertions(+), 75 deletions(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 058b9e9..c7337af 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -93,7 +93,7 @@ OBJS-$(CONFIG_ANULLSINK_FILTER)  += 
asink_anullsink.o
 
 OBJS-$(CONFIG_ASS_FILTER)+= vf_subtitles.o
 OBJS-$(CONFIG_ALPHAEXTRACT_FILTER)   += vf_extractplanes.o
-OBJS-$(CONFIG_ALPHAMERGE_FILTER) += vf_alphamerge.o
+OBJS-$(CONFIG_ALPHAMERGE_FILTER) += vf_alphamerge.o framesync.o
 OBJS-$(CONFIG_BBOX_FILTER)   += bbox.o vf_bbox.o
 OBJS-$(CONFIG_BLACKDETECT_FILTER)+= vf_blackdetect.o
 OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o
diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index 5f0da35..babbb1a 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -27,27 +27,25 @@
 
 #include "libavutil/pixfmt.h"
 #include "avfilter.h"
-#include "bufferqueue.h"
 #include "drawutils.h"
 #include "formats.h"
 #include "internal.h"
+#include "framesync.h"
 #include "video.h"
 
 enum { Y, U, V, A };
 
 typedef struct {
-int frame_requested;
 int is_packed_rgb;
 uint8_t rgba_map[4];
-struct FFBufQueue queue_main;
-struct FFBufQueue queue_alpha;
+FFFrameSync fs;
+FFFrameSyncIn fsin[1]; /* must be immediately after fs */
 } AlphaMergeContext;
 
 static av_cold void uninit(AVFilterContext *ctx)
 {
-AlphaMergeContext *merge = ctx->priv;
-ff_bufqueue_discard_all(&merge->queue_main);
-ff_bufqueue_discard_all(&merge->queue_alpha);
+AlphaMergeContext *s = ctx->priv;
+ff_framesync_uninit(&s->fs);
 }
 
 static int query_formats(AVFilterContext *ctx)
@@ -74,11 +72,58 @@ static int config_input_main(AVFilterLink *inlink)
 return 0;
 }
 
+static int draw_frame(FFFrameSync *fs)
+{
+AVFilterContext *ctx = fs->parent;
+AVFilterLink *outlink = ctx->outputs[0];
+AlphaMergeContext *s = ctx->priv;
+AVFrame *alpha_buf = NULL, *main_buf = NULL;
+int h, ret;
+
+if ((ret = ff_framesync_get_frame(&s->fs, 0, &main_buf, 1)) < 0 ||
+(ret = ff_framesync_get_frame(&s->fs, 1, &alpha_buf, 0)) < 0) {
+av_frame_free(&main_buf);
+return ret;
+}
+
+main_buf->pts = av_rescale_q(main_buf->pts, s->fs.time_base, 
outlink->time_base);
+if (alpha_buf && !ctx->is_disabled) {
+h = main_buf->height;
+if (s->is_packed_rgb) {
+int x, y;
+uint8_t *pin, *pout;
+for (y = 0; y < h; y++) {
+pin = alpha_buf->data[0] + y * alpha_buf->linesize[0];
+pout = main_buf->data[0] + y * main_buf->linesize[0] + 
s->rgba_map[A];
+for (x = 0; x < main_buf->width; x++) {
+*pout = *pin;
+pin += 1;
+pout += 4;
+}
+}
+} else {
+int y;
+const int main_linesize = main_buf->linesize[A];
+const int alpha_linesize = alpha_buf->linesize[Y];
+for (y = 0; y < h && y < alpha_buf->height; y++) {
+memcpy(main_buf->data[A] + y * main_linesize,
+   alpha_buf->data[Y] + y * alpha_linesize,
+   FFMIN(main_linesize, alpha_linesize));
+}
+}
+}
+
+return ff_filter_frame(outlink, main_buf);
+}
+
 static int config_output(AVFilterLink *outlink)
 {
 AVFilterContext *ctx = outlink->src;
+AlphaMergeContext *s = ctx->priv;
 AVFilterLink *mainlink = ctx->inputs[0];
 AVFilterLink *alphalink = ctx->inputs[1];
+FFFrameSyncIn *in = s->fs.in;
+
 if (mainlink->w != alphalink->w || mainlink->h != alphalink->h) {
 av_log(ctx, AV_LOG_ERROR,
"Input frame sizes do not match (%dx%d vs %dx%d).\n",
@@ -92,82 +137,34 @@ static int config_output(AVFilterLink *outlink)
 outlink->time_base = mainlink->time_base;
 outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio;
 outlink->frame_rate = mainlink->frame_rate;
-return 0;
-}
 
-static void draw_frame(AVFilterContext *ctx,
-   AVFrame *main_buf,
-   AVFrame *alpha_buf)
-{
-AlphaMergeContext *merge = ctx->priv;
-int h = main_buf->height;
-
-if (merge->is_packed_rgb) {
-int x, y;
-uint8_t *pin, *pout;
-for (y = 0; y < h; y++) {
-pin = alpha_buf->data[0] + y * alpha_buf->linesize[0];
-pout = main_buf->data[0] + y * main_buf->linesize[0] + 
merge->rgba_map[A];
-for (x = 0; x < main_buf->width; x++) {
-*pout = *pin;
-pin += 1;
-pout += 4;
-}
-}
-} else {
-int y;
-const int main_linesize

Re: [FFmpeg-devel] [PATCH] avfilter: add random video filter

2015-07-16 Thread wm4
On Wed, 15 Jul 2015 15:00:55 +
Paul B Mahol  wrote:

> Dana 15. 7. 2015. 16:20 osoba "Nicolas George"  napisala
> je:
> >
> > Le septidi 27 messidor, an CCXXIII, Paul B Mahol a écrit :
> > > Returns random frame from internal cache.
> >
> > What internal cache? And what is random? The order? Frames are discarded?
> 
> Internal cache of frames.
> 
> Order is random. No frame is discarded.
> 
> > What does it actually do? What is it useful for?
> 
> Nice effect, like freir0r nervous filter. It's fun to watch.

Doesn't sound very useful. What's the policy for adding new filters?
Anything goes?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Save properties of the decoded stream

2015-07-16 Thread wm4
On Thu, 16 Jul 2015 00:47:51 +0200
Carl Eugen Hoyos  wrote:

> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 738f4db..c8b70d7 100644

Send a proper git patch. git has the format-patch feature for a reason.

> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3173,6 +3173,16 @@ typedef struct AVCodecContext {
>   * - decoding: set by user through AVOPtions (NO direct access)
>   */
>  char *codec_whitelist;
> +
> +/*
> + * Properties of the stream that gets decoded
> + * To be accessed through av_codec_get_properties() (NO direct access)

Create an internal context (like e.g. AVFormatContext does) or so to
store these fields, instead of adding this kind of semi-private fields
to a public struct.

> + * - encoding: unused
> + * - decoding: set by libavcodec
> + */
> +unsigned properties;
> +#define FF_CODEC_PROPERTY_LOSSLESS0x0001
> +#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x0002

FF_ symbols are internal. Why do you add new FF_ symbols that are
apparently supposed to be used by the user?

>  } AVCodecContext;
>  
>  AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
> @@ -3181,6 +3191,8 @@ void   av_codec_set_pkt_timebase 
> (AVCodecContext *avctx, AVRational
>  const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext 
> *avctx);
>  void av_codec_set_codec_descriptor(AVCodecContext 
> *avctx, const AVCodecDescriptor *desc);
>  
> +unsigned av_codec_get_codec_properties(const AVCodecContext *avctx);
> +
>  int  av_codec_get_lowres(const AVCodecContext *avctx);
>  void av_codec_set_lowres(AVCodecContext *avctx, int val);
>  
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index f62ad6a..eb834f1 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -886,6 +886,7 @@ static void decode_postinit(H264Context *h, int 
> setup_finished)
>  memcpy(sd->data, h->a53_caption, h->a53_caption_size);
>  av_freep(&h->a53_caption);
>  h->a53_caption_size = 0;
> +h->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
>  }
>  
>  cur->mmco_reset = h->mmco_reset;
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index f85eabf..f046f8a 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -2058,6 +2058,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void 
> *data, int *got_frame,
>  goto fail;
>  break;
>  case SOF3:
> +s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
>  s->lossless= 1;
>  s->ls  = 0;
>  s->progressive = 0;
> @@ -2065,6 +2066,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void 
> *data, int *got_frame,
>  goto fail;
>  break;
>  case SOF48:
> +s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
>  s->lossless= 1;
>  s->ls  = 1;
>  s->progressive = 0;
> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> index b0e5ae9..9947e5b 100644
> --- a/libavcodec/mpeg12dec.c
> +++ b/libavcodec/mpeg12dec.c
> @@ -1685,6 +1685,7 @@ static int mpeg_field_start(MpegEncContext *s, const 
> uint8_t *buf, int buf_size)
>  if (sd)
>  memcpy(sd->data, s1->a53_caption, s1->a53_caption_size);
>  av_freep(&s1->a53_caption);
> +avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
>  }
>  
>  if (s1->has_stereo3d) {
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 0701786..fe5ac01 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1293,6 +1293,11 @@ MAKE_ACCESSORS(AVCodecContext, codec, int, lowres)
>  MAKE_ACCESSORS(AVCodecContext, codec, int, seek_preroll)
>  MAKE_ACCESSORS(AVCodecContext, codec, uint16_t*, chroma_intra_matrix)
>  
> +unsigned av_codec_get_codec_properties(const AVCodecContext *codec)
> +{
> +return codec->properties;
> +}
> +
>  int av_codec_get_max_lowres(const AVCodec *codec)
>  {
>  return codec->max_lowres;
> @@ -3147,6 +3152,13 @@ void avcodec_string(char *buf, int buf_size, 
> AVCodecContext *enc, int encode)
>  if (encode) {
>  snprintf(buf + strlen(buf), buf_size - strlen(buf),
>   ", q=%d-%d", enc->qmin, enc->qmax);
> +} else {
> +if (enc->properties & FF_CODEC_PROPERTY_CLOSED_CAPTIONS)
> +snprintf(buf + strlen(buf), buf_size - strlen(buf),
> + ", Closed Captions");
> +if (enc->properties & FF_CODEC_PROPERTY_LOSSLESS)
> +snprintf(buf + strlen(buf), buf_size - strlen(buf),
> + ", lossless");
>  }
>  break;
>  case AVMEDIA_TYPE_AUDIO:
> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> index 6888326..5b5ad99 100644
> --- a/libavcodec/vp9.c
> +++ b/libavcodec/vp9.c

[FFmpeg-devel] [PATCH] avformat/mpegtsenc: Support a user specified PAT/PMT period

2015-07-16 Thread Michael Niedermayer
From: Michael Niedermayer 

Can be used to fix Ticket3714

TODO, add docs

Signed-off-by: Michael Niedermayer 
---
 libavformat/mpegtsenc.c |   22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 7fc717c..914a732 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -102,6 +102,8 @@ typedef struct MpegTSWrite {
 int flags;
 int copyts;
 int tables_version;
+float pat_period;
+int64_t last_pat_ts;
 
 int omit_video_pes_length;
 } MpegTSWrite;
@@ -784,6 +786,12 @@ static int mpegts_write_header(AVFormatContext *s)
 service->pcr_packet_period = 1;
 }
 
+ts->last_pat_ts = AV_NOPTS_VALUE;
+// The user specified a period, use only it
+if (ts->pat_period < INT_MAX/2) {
+ts->pat_packet_period = INT_MAX;
+}
+
 // output a PCR as soon as possible
 service->pcr_packet_count = service->pcr_packet_period;
 ts->pat_packet_count  = ts->pat_packet_period - 1;
@@ -834,7 +842,7 @@ fail:
 }
 
 /* send SDT, PAT and PMT tables regulary */
-static void retransmit_si_info(AVFormatContext *s, int force_pat)
+static void retransmit_si_info(AVFormatContext *s, int force_pat, int64_t dts)
 {
 MpegTSWrite *ts = s->priv_data;
 int i;
@@ -843,8 +851,13 @@ static void retransmit_si_info(AVFormatContext *s, int 
force_pat)
 ts->sdt_packet_count = 0;
 mpegts_write_sdt(s);
 }
-if (++ts->pat_packet_count == ts->pat_packet_period || force_pat) {
+if (++ts->pat_packet_count == ts->pat_packet_period ||
+(dts != AV_NOPTS_VALUE && ts->last_pat_ts == AV_NOPTS_VALUE) ||
+(dts != AV_NOPTS_VALUE && dts - ts->last_pat_ts >= 
ts->pat_period*9.0) ||
+force_pat) {
 ts->pat_packet_count = 0;
+if (dts != AV_NOPTS_VALUE)
+ts->last_pat_ts = FFMAX(dts, ts->last_pat_ts);
 mpegts_write_pat(s);
 for (i = 0; i < ts->nb_services; i++)
 mpegts_write_pmt(s, ts->services[i]);
@@ -979,7 +992,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream 
*st,
 
 is_start = 1;
 while (payload_size > 0) {
-retransmit_si_info(s, force_pat);
+retransmit_si_info(s, force_pat, dts);
 force_pat = 0;
 
 write_pcr = 0;
@@ -1530,6 +1543,9 @@ static const AVOption options[] = {
 { "pcr_period", "PCR retransmission time",
   offsetof(MpegTSWrite, pcr_period), AV_OPT_TYPE_INT,
   { .i64 = PCR_RETRANS_TIME }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
+{ "pat_period", "PAT/PMT retransmission time limit in seconds",
+  offsetof(MpegTSWrite, pat_period), AV_OPT_TYPE_FLOAT,
+  { .dbl = INT_MAX }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
 { NULL },
 };
 
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH v4] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread Nicolas George
L'octidi 28 messidor, an CCXXIII, wm4 a écrit :
> Initializing them is always safer. Valgrind doesn't catch everything
> either.

Initializing them may hide bugs and delay their detection and fixing.

Regards,

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


[FFmpeg-devel] [PATCH 1/3] avcodec/hap: move some per-stream setup into decoder init rather than per-frame

2015-07-16 Thread Tom Butterworth
This change will reject frames with a texture type which doesn't match the 
stream description.
---
 libavcodec/hapdec.c | 27 +--
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c
index e6b7d61..5986a3f 100644
--- a/libavcodec/hapdec.c
+++ b/libavcodec/hapdec.c
@@ -78,20 +78,19 @@ static int setup_texture(AVCodecContext *avctx, size_t 
length)
 const char *compressorstr;
 int ret;
 
+if ((avctx->codec_tag == MKTAG('H','a','p','1') && (ctx->section_type & 
0x0F) != HAP_FMT_RGBDXT1)
+|| (avctx->codec_tag == MKTAG('H','a','p','5') && (ctx->section_type & 
0x0F) != HAP_FMT_RGBADXT5)
+|| (avctx->codec_tag == MKTAG('H','a','p','Y') && (ctx->section_type & 
0x0F) != HAP_FMT_YCOCGDXT5))
+return AVERROR_INVALIDDATA;
+
 switch (ctx->section_type & 0x0F) {
 case HAP_FMT_RGBDXT1:
-ctx->tex_rat = 8;
-ctx->tex_fun = ctx->dxtc.dxt1_block;
 texture_name = "DXT1";
 break;
 case HAP_FMT_RGBADXT5:
-ctx->tex_rat = 16;
-ctx->tex_fun = ctx->dxtc.dxt5_block;
 texture_name = "DXT5";
 break;
 case HAP_FMT_YCOCGDXT5:
-ctx->tex_rat = 16;
-ctx->tex_fun = ctx->dxtc.dxt5ys_block;
 texture_name = "DXT5-YCoCg-scaled";
 break;
 default:
@@ -211,6 +210,22 @@ static av_cold int hap_init(AVCodecContext *avctx)
 
 ff_texturedsp_init(&ctx->dxtc);
 
+switch (avctx->codec_tag) {
+case MKTAG('H','a','p','1'):
+ctx->tex_rat = 8;
+ctx->tex_fun = ctx->dxtc.dxt1_block;
+break;
+case MKTAG('H','a','p','5'):
+ctx->tex_rat = 16;
+ctx->tex_fun = ctx->dxtc.dxt5_block;
+break;
+case MKTAG('H','a','p','Y'):
+ctx->tex_rat = 16;
+ctx->tex_fun = ctx->dxtc.dxt5ys_block;
+break;
+default:
+return AVERROR_DECODER_NOT_FOUND;
+}
 return 0;
 }
 
-- 
2.3.2 (Apple Git-55)

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


[FFmpeg-devel] [PATCH 2/3] avcodec/snappy: refactor so ff_snappy_uncompress uses an existing buffer

2015-07-16 Thread Tom Butterworth
Some uses of Snappy require uncompressing to positions within an existing 
buffer. Also adds a function to get the uncompressed length of Snappy data.
---
 libavcodec/hapdec.c |  7 ++-
 libavcodec/snappy.c | 24 +---
 libavcodec/snappy.h | 19 ++-
 3 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c
index 5986a3f..7eff9e0 100644
--- a/libavcodec/hapdec.c
+++ b/libavcodec/hapdec.c
@@ -107,8 +107,13 @@ static int setup_texture(AVCodecContext *avctx, size_t 
length)
 compressorstr = "none";
 break;
 case HAP_COMP_SNAPPY:
+snappy_size = ff_snappy_peek_uncompressed_length(gbc);
+ret = av_reallocp(&ctx->snappied, snappy_size);
+if (ret < 0) {
+return ret;
+}
 /* Uncompress the frame */
-ret = ff_snappy_uncompress(gbc, &ctx->snappied, &snappy_size);
+ret = ff_snappy_uncompress(gbc, ctx->snappied, &snappy_size);
 if (ret < 0) {
  av_log(avctx, AV_LOG_ERROR, "Snappy uncompress error\n");
  return ret;
diff --git a/libavcodec/snappy.c b/libavcodec/snappy.c
index 553d713..7900b0f 100644
--- a/libavcodec/snappy.c
+++ b/libavcodec/snappy.c
@@ -128,7 +128,17 @@ static int64_t decode_len(GetByteContext *gb)
 return len;
 }
 
-int ff_snappy_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
+int64_t ff_snappy_peek_uncompressed_length(GetByteContext *gb)
+{
+int pos = bytestream2_get_bytes_left(gb);
+int64_t len = decode_len(gb);
+
+bytestream2_seek(gb, -pos, SEEK_END);
+
+return len;
+}
+
+int ff_snappy_uncompress(GetByteContext *gb, uint8_t *buf, int64_t *size)
 {
 int64_t len = decode_len(gb);
 int ret = 0;
@@ -137,11 +147,11 @@ int ff_snappy_uncompress(GetByteContext *gb, uint8_t 
**buf, int64_t *size)
 if (len < 0)
 return len;
 
-if ((ret = av_reallocp(buf, len)) < 0)
-return AVERROR(ENOMEM);
+if (len > *size)
+return AVERROR_BUFFER_TOO_SMALL;
 
 *size = len;
-p = *buf;
+p = buf;
 
 while (bytestream2_get_bytes_left(gb) > 0) {
 uint8_t s = bytestream2_get_byte(gb);
@@ -152,13 +162,13 @@ int ff_snappy_uncompress(GetByteContext *gb, uint8_t 
**buf, int64_t *size)
 ret = snappy_literal(gb, p, len, val);
 break;
 case SNAPPY_COPY_1:
-ret = snappy_copy1(gb, *buf, p, len, val);
+ret = snappy_copy1(gb, buf, p, len, val);
 break;
 case SNAPPY_COPY_2:
-ret = snappy_copy2(gb, *buf, p, len, val);
+ret = snappy_copy2(gb, buf, p, len, val);
 break;
 case SNAPPY_COPY_4:
-ret = snappy_copy4(gb, *buf, p, len, val);
+ret = snappy_copy4(gb, buf, p, len, val);
 break;
 }
 
diff --git a/libavcodec/snappy.h b/libavcodec/snappy.h
index b283183..a65cb3a 100644
--- a/libavcodec/snappy.h
+++ b/libavcodec/snappy.h
@@ -38,14 +38,23 @@
 #include "bytestream.h"
 
 /**
- * Decompress an input buffer using Snappy algorithm. Caller is
- * responsible of freeing the memory allocated in buf.
+ * Get the uncompressed length of an input buffer compressed using the Snappy
+ * algorithm. The GetByteContext is not advanced.
  *
  * @param gbinput GetByteContext.
- * @param buf   output buffer pointer.
- * @param size  output buffer size.
+ * @return  A positive length on success, AVERROR otherwise.
+ */
+ int64_t ff_snappy_peek_uncompressed_length(GetByteContext *gb);
+
+/**
+ * Decompress an input buffer using Snappy algorithm.
+ *
+ * @param gbinput GetByteContext.
+ * @param buf   input buffer pointer.
+ * @param size  input/output on input, the size of buffer, on output, the size
+ *  of the uncompressed data.
  * @return  0 if success, AVERROR otherwise.
  */
-int ff_snappy_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size);
+int ff_snappy_uncompress(GetByteContext *gb, uint8_t *buf, int64_t *size);
 
 #endif /* AVCODEC_SNAPPY_H */
-- 
2.3.2 (Apple Git-55)

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


[FFmpeg-devel] [PATCH 3/3] avcodec/hap: Support chunked Hap frames

2015-07-16 Thread Tom Butterworth
---
 libavcodec/Makefile  |   4 +-
 libavcodec/hap.c |  51 +
 libavcodec/hap.h |  68 
 libavcodec/hapdec.c  | 278 ---
 libavcodec/hapenc.c  | 190 ++--
 tests/fate/video.mak |   3 +
 tests/ref/fate/hap-chunk |   2 +
 7 files changed, 481 insertions(+), 115 deletions(-)
 create mode 100644 libavcodec/hap.c
 create mode 100644 tests/ref/fate/hap-chunk

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index b7fe1c9..2796035 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -283,8 +283,8 @@ OBJS-$(CONFIG_H264_MMAL_DECODER)   += mmaldec.o
 OBJS-$(CONFIG_H264_VDA_DECODER)+= vda_h264_dec.o
 OBJS-$(CONFIG_H264_QSV_DECODER)+= qsvdec_h264.o
 OBJS-$(CONFIG_H264_QSV_ENCODER)+= qsvenc_h264.o
-OBJS-$(CONFIG_HAP_DECODER) += hapdec.o
-OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o
+OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o
+OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o
 OBJS-$(CONFIG_HEVC_DECODER)+= hevc.o hevc_mvs.o hevc_ps.o 
hevc_sei.o \
   hevc_cabac.o hevc_refs.o hevcpred.o  
  \
   hevcdsp.o hevc_filter.o hevc_parse.o 
hevc_data.o
diff --git a/libavcodec/hap.c b/libavcodec/hap.c
new file mode 100644
index 000..c1685ad
--- /dev/null
+++ b/libavcodec/hap.c
@@ -0,0 +1,51 @@
+/*
+ * Vidvox Hap utility functions
+ * Copyright (C) 2015 Tom Butterworth 
+ *
+ * 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
+ * Hap utilities
+ */
+#include "hap.h"
+
+int hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame)
+{
+int ret = 0;
+if (first_in_frame == 1 && ctx->chunk_count != count) {
+int ret = av_reallocp_array(&ctx->chunks, count, sizeof(HapChunk));
+if (ret == 0)
+ret = av_reallocp_array(&ctx->chunk_results, count, sizeof(int));
+if (ret < 0) {
+ctx->chunk_count = 0;
+} else {
+ctx->chunk_count = count;
+}
+} else if (ctx->chunk_count != count) {
+ret = AVERROR_INVALIDDATA;
+}
+return ret;
+}
+
+void hap_free_context(HapContext *ctx)
+{
+av_freep(&ctx->tex_buf);
+av_freep(&ctx->chunks);
+av_freep(&ctx->chunk_results);
+}
diff --git a/libavcodec/hap.h b/libavcodec/hap.h
index bd0fd37..b877c4f 100644
--- a/libavcodec/hap.h
+++ b/libavcodec/hap.h
@@ -1,6 +1,7 @@
 /*
  * Vidvox Hap
  * Copyright (C) 2015 Vittorio Giovara 
+ * and Tom Butterworth 
  *
  * This file is part of FFmpeg.
  *
@@ -29,37 +30,66 @@
 #include "bytestream.h"
 #include "texturedsp.h"
 
+enum HapTextureFormat {
+HAP_FMT_RGBDXT1   = 0x0B,
+HAP_FMT_RGBADXT5  = 0x0E,
+HAP_FMT_YCOCGDXT5 = 0x0F,
+};
+
+enum HapCompressor {
+HAP_COMP_NONE= 0xA0,
+HAP_COMP_SNAPPY  = 0xB0,
+HAP_COMP_COMPLEX = 0xC0,
+};
+
+enum HapSectionType {
+HAP_ST_DECODE_INSTRUCTIONS = 0x01,
+HAP_ST_COMPRESSOR_TABLE= 0x02,
+HAP_ST_SIZE_TABLE  = 0x03,
+HAP_ST_OFFSET_TABLE= 0x04,
+};
+
+typedef struct HapChunk {
+enum HapCompressor compressor;
+int compressed_offset;
+size_t compressed_size;
+int uncompressed_offset;
+size_t uncompressed_size;
+} HapChunk;
+
 typedef struct HapContext {
 AVClass *class;
 
 TextureDSPContext dxtc;
 GetByteContext gbc;
-PutByteContext pbc;
 
-int section_type;/* Header type */
+enum HapTextureFormat opt_tex_fmt; /* Texture type (encoder only) */
+int opt_chunk_count; /* User-requested chunk count (encoder only) */
 
-int tex_rat; /* Compression ratio */
-const uint8_t *tex_data; /* Compressed texture */
-uint8_t *tex_buf;/* Uncompressed texture */
-size_t tex_size; /* Size of the compressed texture */
+int chunk_count;
+HapChunk *chunks;
+int *chunk_results;/* Results from threaded operations */
 
-uint8_t *snappied;   /* Buffer interacting with snappy */
-size_t max_snappy;   /* Maximum compressed size for snappy buffer */
+int tex_rat;   /* Compression ratio */
+const uint8_t *tex_da

Re: [FFmpeg-devel] [PATCH 1/2] avcodec: loongson add constant definition

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 03:06:27PM +0800, 周晓勇 wrote:
> From 2e7ab3de30e342a42f00fe85ba3e70c350b05f6f Mon Sep 17 00:00:00 2001
> From: ZhouXiaoyong 
> Date: Thu, 16 Jul 2015 13:22:06 +0800
> Subject: [PATCH 1/2] avcodec: loongson add constant definition
> 
> 
> Signed-off-by: ZhouXiaoyong 
> ---
>  libavcodec/mips/Makefile|  1 +
>  libavcodec/mips/constants.c | 53 ++
>  libavcodec/mips/constants.h | 56 
> +
>  3 files changed, 110 insertions(+)

applied

thanks


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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


Re: [FFmpeg-devel] [PATCH 2/2] avcodec: loongson optimized idctdsp with mmi

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 03:07:14PM +0800, 周晓勇 wrote:
> From ff6de02986fa6693376bee60f9f886e06310d0b6 Mon Sep 17 00:00:00 2001
> From: ZhouXiaoyong 
> Date: Thu, 16 Jul 2015 13:23:36 +0800
> Subject: [PATCH 2/2] avcodec: loongson optimized idctdsp with mmi

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/hap: Support chunked Hap frames

2015-07-16 Thread Tom Butterworth
The sample for fate test added in this commit is at
http://files.kriss.cx/hapy-12-chunks.mov

On 16 July 2015 at 13:23, Tom Butterworth  wrote:
> ---
>  libavcodec/Makefile  |   4 +-
>  libavcodec/hap.c |  51 +
>  libavcodec/hap.h |  68 
>  libavcodec/hapdec.c  | 278 
> ---
>  libavcodec/hapenc.c  | 190 ++--
>  tests/fate/video.mak |   3 +
>  tests/ref/fate/hap-chunk |   2 +
>  7 files changed, 481 insertions(+), 115 deletions(-)
>  create mode 100644 libavcodec/hap.c
>  create mode 100644 tests/ref/fate/hap-chunk
>
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index b7fe1c9..2796035 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -283,8 +283,8 @@ OBJS-$(CONFIG_H264_MMAL_DECODER)   += mmaldec.o
>  OBJS-$(CONFIG_H264_VDA_DECODER)+= vda_h264_dec.o
>  OBJS-$(CONFIG_H264_QSV_DECODER)+= qsvdec_h264.o
>  OBJS-$(CONFIG_H264_QSV_ENCODER)+= qsvenc_h264.o
> -OBJS-$(CONFIG_HAP_DECODER) += hapdec.o
> -OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o
> +OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o
> +OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o
>  OBJS-$(CONFIG_HEVC_DECODER)+= hevc.o hevc_mvs.o hevc_ps.o 
> hevc_sei.o \
>hevc_cabac.o hevc_refs.o 
> hevcpred.o\
>hevcdsp.o hevc_filter.o 
> hevc_parse.o hevc_data.o
> diff --git a/libavcodec/hap.c b/libavcodec/hap.c
> new file mode 100644
> index 000..c1685ad
> --- /dev/null
> +++ b/libavcodec/hap.c
> @@ -0,0 +1,51 @@
> +/*
> + * Vidvox Hap utility functions
> + * Copyright (C) 2015 Tom Butterworth 
> + *
> + * 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
> + * Hap utilities
> + */
> +#include "hap.h"
> +
> +int hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame)
> +{
> +int ret = 0;
> +if (first_in_frame == 1 && ctx->chunk_count != count) {
> +int ret = av_reallocp_array(&ctx->chunks, count, sizeof(HapChunk));
> +if (ret == 0)
> +ret = av_reallocp_array(&ctx->chunk_results, count, sizeof(int));
> +if (ret < 0) {
> +ctx->chunk_count = 0;
> +} else {
> +ctx->chunk_count = count;
> +}
> +} else if (ctx->chunk_count != count) {
> +ret = AVERROR_INVALIDDATA;
> +}
> +return ret;
> +}
> +
> +void hap_free_context(HapContext *ctx)
> +{
> +av_freep(&ctx->tex_buf);
> +av_freep(&ctx->chunks);
> +av_freep(&ctx->chunk_results);
> +}
> diff --git a/libavcodec/hap.h b/libavcodec/hap.h
> index bd0fd37..b877c4f 100644
> --- a/libavcodec/hap.h
> +++ b/libavcodec/hap.h
> @@ -1,6 +1,7 @@
>  /*
>   * Vidvox Hap
>   * Copyright (C) 2015 Vittorio Giovara 
> + * and Tom Butterworth 
>   *
>   * This file is part of FFmpeg.
>   *
> @@ -29,37 +30,66 @@
>  #include "bytestream.h"
>  #include "texturedsp.h"
>
> +enum HapTextureFormat {
> +HAP_FMT_RGBDXT1   = 0x0B,
> +HAP_FMT_RGBADXT5  = 0x0E,
> +HAP_FMT_YCOCGDXT5 = 0x0F,
> +};
> +
> +enum HapCompressor {
> +HAP_COMP_NONE= 0xA0,
> +HAP_COMP_SNAPPY  = 0xB0,
> +HAP_COMP_COMPLEX = 0xC0,
> +};
> +
> +enum HapSectionType {
> +HAP_ST_DECODE_INSTRUCTIONS = 0x01,
> +HAP_ST_COMPRESSOR_TABLE= 0x02,
> +HAP_ST_SIZE_TABLE  = 0x03,
> +HAP_ST_OFFSET_TABLE= 0x04,
> +};
> +
> +typedef struct HapChunk {
> +enum HapCompressor compressor;
> +int compressed_offset;
> +size_t compressed_size;
> +int uncompressed_offset;
> +size_t uncompressed_size;
> +} HapChunk;
> +
>  typedef struct HapContext {
>  AVClass *class;
>
>  TextureDSPContext dxtc;
>  GetByteContext gbc;
> -PutByteContext pbc;
>
> -int section_type;/* Header type */
> +enum HapTextureFormat opt_tex_fmt; /* Texture type (encoder only) */
> +int opt_chunk_count; /* User-requested chunk count (encoder only) */
>
> -int tex_rat; /* Compression ratio */
> -const uint8_t *tex_data; /* Compressed texture */
> -uint8_t *tex_buf;/* Uncompressed te

Re: [FFmpeg-devel] Fix bug for POWER LE in file libswscale/ppc/yuv2rgb_altivec.c

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 05:26:25PM +0800, rongyan wrote:
> Hi,
>  We propose this patch to fix the bug on POWER LE when converting yuv to rgb 
> in macros vec_unh() and vec_unl() in file libswscale/ppc/yuv2rgb_altivec.c.
>   
>  Our test case is like this:
>  ffmpeg -i input.mov -f rawvideo -pix_fmt rgb24 result.rgb
>   
>  Before fix the bug, the output rgb frame is as follows:
>  
>  After bug fix, the output rgb frame is:
>  
>   
>  The fate test result with out patch is in the below:
>  
>  Thanks for your review.
>   
>  Rong Yan
>   --
>   The world has enough for everyone's need, but not enough for everyone's 
> greed.




>  yuv2rgb_altivec.c |5 +
>  1 file changed, 5 insertions(+)
> 5379a9ce8f3e53c47d32862a58aff5fc8012a41d  
> 0001-swscale-ppc-yuv2rgb_altivec-POWER-LE-support-in-the-.patch
> From 503528df22385a7a4d7369a3133b32ea5d64c816 Mon Sep 17 00:00:00 2001
> From: Rong Yan 
> Date: Thu, 16 Jul 2015 03:52:47 -0500
> Subject: [PATCH] swscale/ppc/yuv2rgb_altivec: POWER LE support in the macros
>  vec_unh() and vec_unl()

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH v4] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread wm4
On Thu, 16 Jul 2015 13:59:44 +0200
Nicolas George  wrote:

> L'octidi 28 messidor, an CCXXIII, wm4 a écrit :
> > Initializing them is always safer. Valgrind doesn't catch everything
> > either.
> 
> Initializing them may hide bugs and delay their detection and fixing.

Even if there's a bug, initializing them will at least make the
behavior predictable and reproducible, instead of random,
platform-dependent, and sporadic.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add random video filter

2015-07-16 Thread Paul B Mahol
On 7/16/15, wm4  wrote:
> On Wed, 15 Jul 2015 15:00:55 +
> Paul B Mahol  wrote:
>
>> Dana 15. 7. 2015. 16:20 osoba "Nicolas George"  napisala
>> je:
>> >
>> > Le septidi 27 messidor, an CCXXIII, Paul B Mahol a ecrit :
>> > > Returns random frame from internal cache.
>> >
>> > What internal cache? And what is random? The order? Frames are
>> > discarded?
>>
>> Internal cache of frames.
>>
>> Order is random. No frame is discarded.
>>
>> > What does it actually do? What is it useful for?
>>
>> Nice effect, like freir0r nervous filter. It's fun to watch.
>
> Doesn't sound very useful. What's the policy for adding new filters?

Policy for adding new filters is they works as described in documentation.

> Anything goes?

Everything under the Sun, even VapourSynth, sox, frei0r, VirtualDub,
AviSynth filters.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v4] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread Nicolas George
L'octidi 28 messidor, an CCXXIII, wm4 a écrit :
> Even if there's a bug, initializing them will at least make the
> behavior predictable and reproducible, instead of random,
> platform-dependent, and sporadic.

Which is exactly the problem: instead of a very visible problem, you get a
subtly-wrong behaviour. The very visible problem would be fixed right away,
the faulty behaviour would stay for years. Predictable and reproducible
maybe, but faulty is faulty.

This example exhibits one of the reasons that make me strongly dislike your
way of developing.

Regards,

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


Re: [FFmpeg-devel] [PATCH 1/4] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 MC functions

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 10:58:49AM +, Shivraj Patil wrote:
> Hi,
> May I request somebody from maintainers to review this patch please?
> 
> -Original Message-
> From: Shivraj Patil 
> Sent: 09 July 2015 18:45
> To: ffmpeg-devel@ffmpeg.org
> Cc: Rob Isherwood; Shivraj Patil
> Subject: [PATCH 1/4] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 
> MC functions
> 
> From: Shivraj Patil 
> 
> This patch adds MSA (MIPS-SIMD-Arch) optimizations for VP9 MC functions in 
> new file vp9_mc_msa.c
> 
> Signed-off-by: Shivraj Patil 
> ---
>  libavcodec/mips/Makefile   |2 +
>  libavcodec/mips/vp9_mc_msa.c   | 2387 
> 
>  libavcodec/mips/vp9dsp_init_mips.c |   94 ++
>  libavcodec/mips/vp9dsp_mips.h  |   91 ++
>  libavcodec/vp9dsp.c|1 +
>  libavcodec/vp9dsp.h|1 +
>  6 files changed, 2576 insertions(+)
>  create mode 100644 libavcodec/mips/vp9_mc_msa.c
>  create mode 100644 libavcodec/mips/vp9dsp_init_mips.c
>  create mode 100644 libavcodec/mips/vp9dsp_mips.h

applied

thanks

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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH]Save properties of the decoded stream

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 12:54:24PM +0200, wm4 wrote:
[...]
> > diff --git a/libavcodec/webp.c b/libavcodec/webp.c
> > index 723a847..8caa6a2 100644
> > --- a/libavcodec/webp.c
> > +++ b/libavcodec/webp.c
> > @@ -1417,6 +1417,7 @@ static int webp_decode_frame(AVCodecContext *avctx, 
> > void *data, int *got_frame,
> >  chunk_size, 0);
> >  if (ret < 0)
> >  return ret;
> > +avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
> >  }
> >  bytestream2_skip(&gb, chunk_size);
> >  break;
> 
> The lossless mode can apparently change mid-stream, so it should NOT be
> an AVCodecContext field. Use per-frame side-data instead.

"everything" can change mid stream, this field is not about if a frame
is lossless or even if the whole file is guranteed to be lossless
(for such gurantee the whole file would need to be parsed which is
 not practical for gathering some secondary bit of information about a
 stream)

This field is simply to indicate if a stream appears to be lossless
based on parsing headers or the first keyframe.
So it is a property of the stream or decoder instance, similar to
the width, height, format, sample rate, bit rate, ... fields in
AVCodecContext are properties of a stream or codec instance even
though they too could and do change per frame.

What could be done, and maybe thats what you meant is to use side data
or IMHO better a flag or specific quality value of the existing
quality field from AVFrame, to communicate the lossless nature
of a frame. That per frame information could then be used by the core
to set the per stream information aka  avctx->properties
this is more complex but would make the per frame lossless-ness
information available to user applications

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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


[FFmpeg-devel] [PATCH] avfilter/vf_blend: implement 16bit support

2015-07-16 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/vf_blend.c | 325 ++---
 1 file changed, 202 insertions(+), 123 deletions(-)

diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 9c93baf..f359dff 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -169,24 +169,50 @@ static void blend_normal(const uint8_t *top, int 
top_linesize,
 av_image_copy_plane(dst, dst_linesize, top, top_linesize, width, end - 
start);
 }
 
-#define DEFINE_BLEND(name, expr)  \
-static void blend_## name(const uint8_t *top, int top_linesize,   \
-  const uint8_t *bottom, int bottom_linesize, \
-  uint8_t *dst, int dst_linesize, \
-  int width, int start, int end,  \
-  FilterParams *param, double *values)\
-{ \
-double opacity = param->opacity;  \
-int i, j; \
-  \
-for (i = start; i < end; i++) {   \
-for (j = 0; j < width; j++) { \
-dst[j] = top[j] + ((expr) - top[j]) * opacity;\
-} \
-dst+= dst_linesize;   \
-top+= top_linesize;   \
-bottom += bottom_linesize;\
-} \
+#define DEFINE_BLEND8(name, expr)  
\
+static void blend_## name##_8bit(const uint8_t *top, int top_linesize, 
\
+ const uint8_t *bottom, int bottom_linesize,   
\
+ uint8_t *dst, int dst_linesize,   
\
+ int width, int start, int end,
\
+ FilterParams *param, double *values)  
\
+{  
\
+double opacity = param->opacity;   
\
+int i, j;  
\
+   
\
+for (i = start; i < end; i++) {
\
+for (j = 0; j < width; j++) {  
\
+dst[j] = top[j] + ((expr) - top[j]) * opacity; 
\
+}  
\
+dst+= dst_linesize;
\
+top+= top_linesize;
\
+bottom += bottom_linesize; 
\
+}  
\
+}
+
+#define DEFINE_BLEND16(name, expr) 
\
+static void blend_## name##_16bit(const uint8_t *_top, int top_linesize,   
\
+  const uint8_t *_bottom, int bottom_linesize, 
\
+  uint8_t *_dst, int dst_linesize, 
\
+  int width, int start, int end,   
\
+  FilterParams *param, double *values) 
\
+{  
\
+const uint16_t *top = (uint16_t*)_top; 
\
+const uint16_t *bottom = (uint16_t*)_bottom;   
\
+uint16_t *dst = (uint16_t*)_dst;   
\
+double opacity = param->opacity;   
\
+int i, j;  
\
+dst_linesize /= 2; 
\
+top_linesize /= 2; 
\
+bottom_linesize /= 2;  
\
+   
\
+for (i = start; i < end; i++) {
\
+for (j = 0; j < width; j++) {  
\
+dst[j] = top[j] + ((expr) - top[j]) * opacity; 
\
+}  
\
+dst+= dst_linesize;  

Re: [FFmpeg-devel] [PATCH] [RFC] avformat/async: support filling with a background thread.

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 03:04:42PM +0800, Zhang Rui wrote:
> ---
>  configure|   1 +
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/async.c  | 380 
> +++
>  4 files changed, 383 insertions(+)
>  create mode 100644 libavformat/async.c

please add some information about this and an example to the docs

a fate test also could be added

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


[FFmpeg-devel] (no subject)

2015-07-16 Thread Kais Bensalah
Hi Michael,

FFmpeg, as a leading free multimedia framework, needs an independent 
free research organization maintaining its foundraising via providing the 
internal source code and web hosting facilities: and not depending on a 
web hosting company, to make sure the project gets always in full control 
by the users and developers.

Personally I find the Fraunhofer's FOKUS non-profit organization 
(https://www.fokus.fraunhofer.de/en/fokus/projects) the most right place 
to host FFmpeg, the stable way.

So, why not just contacting FOKUS for hosting the project (at 
https://www.fokus.fraunhofer.de/contact): instead of looking for a hosting 
provider ?
-- 
Best Regards,
Kais Bensalah
GnuPG fingerprint: 1739 7374 28CE 88A8 AD6F  0D9C B9CB 7046 4E5E 
BF34
If the software you use is not free, then you are not free ..

signature.asc
Description: This is a digitally signed message part.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/hap: Support chunked Hap frames

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 01:27:10PM +0100, Tom Butterworth wrote:
> The sample for fate test added in this commit is at
> http://files.kriss.cx/hapy-12-chunks.mov

file uploaded

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

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


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


[FFmpeg-devel] FFmpeg/MPlayer/rtmpdump possibly searching for a new server and hosting

2015-07-16 Thread Kais Bensalah
Hi Michael,

FFmpeg, as a leading free multimedia framework, needs an 
independent free research organization maintaining its foundraising via 
providing the internal source code and web hosting facilities: and not 
depending on a web hosting company, to make sure the project gets 
always in full control by the users and developers.

Personally I find the Fraunhofer's FOKUS non-profit organization 
(https://www.fokus.fraunhofer.de/en/fokus/projects) the most right 
place to host FFmpeg, the stable way.

So, why not just contacting FOKUS for hosting the project (at 
https://www.fokus.fraunhofer.de/contact): instead of looking for a 
hosting provider ?

-- 
Best Regards,
Kais Bensalah
GnuPG fingerprint: 1739 7374 28CE 88A8 AD6F  0D9C B9CB 7046 4E5E 
BF34
If the software you use is not free, then you are not free ..

signature.asc
Description: This is a digitally signed message part.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] avcodec/hap: move some per-stream setup into decoder init rather than per-frame

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 01:23:21PM +0100, Tom Butterworth wrote:
> This change will reject frames with a texture type which doesn't match the 
> stream description.
> ---
>  libavcodec/hapdec.c | 27 +--
>  1 file changed, 21 insertions(+), 6 deletions(-)

applied

thanks

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

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


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


Re: [FFmpeg-devel] [PATCH 3/4] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 idct functions

2015-07-16 Thread Ronald S. Bultje
Hi,

On Thu, Jul 9, 2015 at 9:15 AM,  wrote:

> +void ff_idct_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
> +int16_t *block, int eob)
> +{
> +vp9_idct16x16_colcol_addblk_msa(block, dst, stride);
> +memset(block, 0, 16 * 16 * sizeof(*block));
> +}


(This comment applies to all code in this file), you're not using the eob
parameter anywhere. Admittedly, for the iadst variants, the eob value is
generally quite high so this won't give any merit, but for idct_idct, eob
is typically low (possibly even 1), and you can make use of that to do
sub-idcts. Look at the C code for an example of dc-only idct_idct, and look
at the x86 simd for examples of sub-idcts. They give great speedups on top
of the regular speedup expected from simd vectorization, especially for the
bigger ones (16x16, 32x32).

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


Re: [FFmpeg-devel] GSoC Weely report (libswscale)

2015-07-16 Thread Michael Niedermayer
On Wed, Jul 15, 2015 at 08:06:49PM -0300, Pedro Arthur wrote:
> Hi,
> 
> I removed the asserts referencing unused variables and it passed all tests.
> The following patch contains the changes and some improvements to the code
> as a single diff.
> 
> 2015-07-12 10:04 GMT-03:00 Pedro Arthur :
> 
> > I'll check it, I think most of these asserts are from some unused
> > variables which were replaced by the SwsSlice struct.
> >
> > 2015-07-11 23:51 GMT-03:00 Michael Niedermayer :
> >
> >> On Sat, Jul 11, 2015 at 04:57:22PM -0300, Pedro Arthur wrote:
> >> > Here is the full patch rebased including all previous changes.
> >>
> >> if you build ffmpeg with --assert-level=2
> >>
> >> fails fate
> >> for example in fate-vsynth1-cinepak
> >>
> >> its probably best to always build with --assert-level=2
> >> so you wont miss such failures
> >>
> >> --- ./tests/ref/vsynth/vsynth1-cinepak  2015-07-11 12:25:01.268257903
> >> +0200
> >> +++ tests/data/fate/vsynth1-cinepak 2015-07-12 04:11:06.041453781
> >> +0200
> >> @@ -1,4 +0,0 @@
> >> -546c7c1069f9e418aa787f469b693b94 *tests/data/fate/vsynth1-cinepak.mov
> >> -99465 tests/data/fate/vsynth1-cinepak.mov
> >> -bee091c200262be3427a233a2812388c
> >> *tests/data/fate/vsynth1-cinepak.out.rawvideo
> >> -stddev:8.46 PSNR: 29.58 MAXDIFF:  105 bytes:  7603200/   456192
> >>
> >> Assertion lumSrcPtr + vLumFilterSize - 1 < (const int16_t **)lumPixBuf +
> >> vLumBufSize * 2 failed at libswscale/swscale.c:694
> >>
> >> there are also many other fate tests which fail with --assert-level=2
> >>
> >> also it might make more sense to stash all these commits together
> >> for submission,
> >> if you like you could keep them seperate in your branch (could make
> >> sense for debug/bisect)
> >>
> >> but the commits showing the step wise development are rather hard to
> >> review and would be impossible to push to master git
> >> commits for master git should not introduce known issues that are
> >> fixed in later commits and should be split in selfcontained changesets
> >>
> >> a single stashed together patch should be fine and easy to generate
> >>
> >> thanks
> >>
> >> [...]
> >>
> >> --
> >> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >>
> >> Avoid a single point of failure, be that a person or equipment.
> >>
> >> ___
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >>
> >

>  Makefile   |1 
>  slice.c|  558 
> +
>  swscale.c  |   87 +++-
>  swscale_internal.h |   60 +
>  utils.c|1 
>  5 files changed, 699 insertions(+), 8 deletions(-)

breaks
./ffplay -f lavfi testsrc  -vf format=yuvj420p
(its all grey except last line)



> b1296cf793d33f7c3ec7899dfcf2c85c52a662d7  swscale.patch
> diff --git a/libswscale/Makefile b/libswscale/Makefile
> index a60b057..d876e75 100644
> --- a/libswscale/Makefile
> +++ b/libswscale/Makefile
> @@ -14,6 +14,7 @@ OBJS = hscale_fast_bilinear.o   \
> swscale_unscaled.o   \
> utils.o  \
> yuv2rgb.o\
> +   slice.o  \
>  
>  OBJS-$(CONFIG_SHARED)+= log2_tab.o
>  
> diff --git a/libswscale/slice.c b/libswscale/slice.c
> new file mode 100644
> index 000..bb99ac1
> --- /dev/null
> +++ b/libswscale/slice.c
> @@ -0,0 +1,558 @@
> +#include "swscale_internal.h"
> +
> +static void free_lines(SwsSlice *s)
> +{
> +int i;

> +for (i = 0; i < 4; ++i)
> +{

its not important ATM but before this can be commited the {}
placement style should match to the rest of libswscale


[...]


> diff --git a/libswscale/swscale.c b/libswscale/swscale.c
> index 1945e1d..9f33af2 100644
> --- a/libswscale/swscale.c
> +++ b/libswscale/swscale.c
> @@ -315,6 +315,8 @@ static av_always_inline void hcscale(SwsContext *c, 
> int16_t *dst1,
>  if (DEBUG_SWSCALE_BUFFERS)  \
>  av_log(c, AV_LOG_DEBUG, __VA_ARGS__)
>  
> +
> +
>  static int swscale(SwsContext *c, const uint8_t *src[],

stray lines added


[...]

> -if (perform_gamma)
> -gamma_convert((uint8_t **)src1, srcW, c->inv_gamma);
> +//if (perform_gamma)
> +//gamma_convert((uint8_t **)src1, srcW, c->inv_gamma);
>  
>  hyscale(c, lumPixBuf[lumBufIndex], dstW, src1, srcW, lumXInc,
>  hLumFilter, hLumFilterPos, hLumFilterSize,

is it intentional to disable this ?


> @@ -520,12 +575,12 @@ static int swscale(SwsContext *c, const uint8_t *src[],
>  src[2] + (lastInChrBuf + 1 - chrSrcSliceY) * srcStride[2],
>  src[3] + (lastInChrBuf + 1 - chrSrcSliceY) * srcStride[3],
>  };
> +
>  chrBufIndex++;
> 

Re: [FFmpeg-devel] [PATCH 2/4] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 lpf functions

2015-07-16 Thread Ronald S. Bultje
Hi,

On Thu, Jul 9, 2015 at 9:15 AM,  wrote:

> +if (__msa_test_bz_v(flat)) {
> +p1_d = __msa_copy_u_d((v2i64) p1_out, 0);
> +p0_d = __msa_copy_u_d((v2i64) p0_out, 0);
> +q0_d = __msa_copy_u_d((v2i64) q0_out, 0);
> +q1_d = __msa_copy_u_d((v2i64) q1_out, 0);
> +SD4(p1_d, p0_d, q0_d, q1_d, (src - 2 * pitch), pitch);
> +} else {
>

Can you elaborate on what this does? Does it check that none of the pixels
in the vector of cols/rows has flat=1, and takes a shortcut if that's true?
Of something else? (If I'm right in my assumption, can you please add a
comment to that effect?)


> +static void vp9_lpf_vertical_16_dual_msa(uint8_t *src, int32_t pitch,
> + uint8_t *b_limit_ptr,
> + uint8_t *limit_ptr,
> + uint8_t *thresh_ptr)
> +{
> +uint8_t early_exit = 0;
> +uint8_t transposed_input[16 * 24] ALLOC_ALIGNED(ALIGNMENT);
> +uint8_t *filter48 = &transposed_input[16 * 16];
> +
> +vp9_transpose_16x16((src - 8), pitch, &transposed_input[0], 16);
> +
> +early_exit = vp9_vt_lpf_t4_and_t8_16w((transposed_input + 16 * 8),
> +  &filter48[0], src, pitch,
> +  b_limit_ptr, limit_ptr,
> thresh_ptr);
> +
> +if (0 == early_exit) {
> +early_exit = vp9_vt_lpf_t16_16w((transposed_input + 16 * 8), src,
> pitch,
> +&filter48[0]);
> +
> +if (0 == early_exit) {
> +vp9_transpose_16x16(transposed_input, 16, (src - 8), pitch);
> +}
> +}
> +}
>

Since no state is shared between t16 and t4/t8, it suggests you're
calculating some of the filters twice (since part of the condition of
whether to apply the t16 filter is whether to apply the t8 filter), is that
true? If so, do you think it's worth modifying this so the check on whether
to run t4 or t8 is not re-evaluated in t16?


+void ff_loop_filter_v_84_16_msa(uint8_t *src, ptrdiff_t stride,
> +int32_t e, int32_t i, int32_t h)
> +{
> +uint8_t e1, i1, h1;
> +uint8_t e2, i2, h2;
> +
> +e1 = e & 0xff;
> +i1 = i & 0xff;
> +h1 = h & 0xff;
> +
> +e2 = e >> 8;
> +i2 = i >> 8;
> +h2 = h >> 8;
> +
> +vp9_lpf_horizontal_8_msa(src, stride, &e1, &i1, &h1, 1);
> +vp9_lpf_horizontal_4_msa(src + 8, stride, &e2, &i2, &h2, 1);
> +}


So I think you're missing the point of why this exists. The simd code for
e.g. 88_16 suggests you're capable of doing 16 pixels at once in a single
iteration, right? The idea here is that you can use the fact that t4 is a
strict subset of t8 to run them both in the same iteration, with simply a
mask at the end to assure that "whether to run t8 or t4" for the t4 half of
the pixels is always 0. Look at the x86 simd code for details on how that
would work exactly.

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


Re: [FFmpeg-devel] [PATCH 4/4] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 intra functions

2015-07-16 Thread Ronald S. Bultje
Hi,

On Thu, Jul 9, 2015 at 9:15 AM,  wrote:

> +static void intra_predict_vert_4x4_msa(const uint8_t *src, uint8_t *dst,
> +   int32_t dst_stride)
> +{
> +uint32_t src_data;
> +
> +src_data = LW(src);
> +
> +SW4(src_data, src_data, src_data, src_data, dst, dst_stride);
> +}
>

Is this faster than the C function? I know this is a fair bit of work, but
ideally you'd profile each individual simd function to see how much faster
it is than the C function. These won't be faster, so they just increase the
binary size. Same is likely true for e.g. the vert_8x8 one.

+static void intra_predict_horiz_4x4_msa(const uint8_t *src, int32_t
> src_stride,
> +uint8_t *dst, int32_t dst_stride)
> +{
> +uint32_t out0, out1, out2, out3;
> +
> +out0 = src[0 * src_stride] * 0x01010101;
> +out1 = src[1 * src_stride] * 0x01010101;
> +out2 = src[2 * src_stride] * 0x01010101;
> +out3 = src[3 * src_stride] * 0x01010101;
> +
> +SW4(out0, out1, out2, out3, dst, dst_stride);
> +}
>

Same question here - I suspect this isn't faster than the C version. Same
for horiz_8x8.


> +static void intra_predict_dc_4x4_msa(const uint8_t *src_top,
> + const uint8_t *src_left,
> + int32_t src_stride_left,
> + uint8_t *dst, int32_t dst_stride,
> + uint8_t is_above, uint8_t is_left)
> +{
> +uint32_t row;
> +uint32_t out, addition = 0;
> +v16u8 src_above, store;
> +v8u16 sum_above;
> +v4u32 sum;
> +
> +if (is_left && is_above) {
> +src_above = LD_UB(src_top);
> +
> +sum_above = __msa_hadd_u_h(src_above, src_above);
> +sum = __msa_hadd_u_w(sum_above, sum_above);
> +addition = __msa_copy_u_w((v4i32) sum, 0);
> +
> +for (row = 0; row < 4; row++) {
> +addition += src_left[row * src_stride_left];
> +}
> +
> +addition = (addition + 4) >> 3;
> +store = (v16u8) __msa_fill_b(addition);
> +} else if (is_left) {
> +for (row = 0; row < 4; row++) {
> +addition += src_left[row * src_stride_left];
> +}
> +
> +addition = (addition + 2) >> 2;
> +store = (v16u8) __msa_fill_b(addition);
> +} else if (is_above) {
> +src_above = LD_UB(src_top);
> +
> +sum_above = __msa_hadd_u_h(src_above, src_above);
> +sum = __msa_hadd_u_w(sum_above, sum_above);
> +sum = (v4u32) __msa_srari_w((v4i32) sum, 2);
> +store = (v16u8) __msa_splati_b((v16i8) sum, 0);
> +} else {
> +store = (v16u8) __msa_ldi_b(128);
> +}
> +
> +out = __msa_copy_u_w((v4i32) store, 0);
> +
> +for (row = 4; row--;) {
> +SW(out, dst);
> +dst += dst_stride;
> +}
> +}
> +
> +static void intra_predict_dc_8x8_msa(const uint8_t *src_top,
> + const uint8_t *src_left,
> + int32_t src_stride_left,
> + uint8_t *dst, int32_t dst_stride,
> + uint8_t is_above, uint8_t is_left)
> +{
> +uint32_t row;
> +uint32_t out, addition = 0;
> +v16u8 src_above, store;
> +v8u16 sum_above;
> +v4u32 sum_top;
> +v2u64 sum;
> +
> +if (is_left && is_above) {
> +src_above = LD_UB(src_top);
> +
> +sum_above = __msa_hadd_u_h(src_above, src_above);
> +sum_top = __msa_hadd_u_w(sum_above, sum_above);
> +sum = __msa_hadd_u_d(sum_top, sum_top);
> +addition = __msa_copy_u_w((v4i32) sum, 0);
> +
> +for (row = 0; row < 8; row++) {
> +addition += src_left[row * src_stride_left];
> +}
> +
> +addition = (addition + 8) >> 4;
> +store = (v16u8) __msa_fill_b(addition);
> +} else if (is_left) {
> +for (row = 0; row < 8; row++) {
> +addition += src_left[row * src_stride_left];
> +}
> +
> +addition = (addition + 4) >> 3;
> +store = (v16u8) __msa_fill_b(addition);
> +} else if (is_above) {
> +src_above = LD_UB(src_top);
> +
> +sum_above = __msa_hadd_u_h(src_above, src_above);
> +sum_top = __msa_hadd_u_w(sum_above, sum_above);
> +sum = __msa_hadd_u_d(sum_top, sum_top);
> +sum = (v2u64) __msa_srari_d((v2i64) sum, 3);
> +store = (v16u8) __msa_splati_b((v16i8) sum, 0);
> +} else {
> +store = (v16u8) __msa_ldi_b(128);
> +}
> +
> +out = __msa_copy_u_w((v4i32) store, 0);
> +
> +for (row = 8; row--;) {
> +SW(out, dst);
> +SW(out, (dst + 4));
> +dst += dst_stride;
> +}
> +}
> +
> +static void intra_predict_dc_16x16_msa(const uint8_t *src_top,
> +   const uint8_t *src_left,
> +   int32_t src_stride_left,
> +  

Re: [FFmpeg-devel] [PATCH 1/4] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 MC functions

2015-07-16 Thread Ronald S. Bultje
Hi,

On Thu, Jul 16, 2015 at 6:58 AM, Shivraj Patil 
wrote:

> Hi,
> May I request somebody from maintainers to review this patch please?


Sorry for slowness, I looked at it earlier and told Michael (on IRC) that
this one looked fine to merge. Thanks!

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


[FFmpeg-devel] [PATCH] avfilter: add convolution filter

2015-07-16 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/vf_convolution.c | 331 +++
 3 files changed, 333 insertions(+)
 create mode 100644 libavfilter/vf_convolution.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 058b9e9..0a0fa16 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -105,6 +105,7 @@ OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER)  += 
vf_colorchannelmixer.o
 OBJS-$(CONFIG_COLORKEY_FILTER)   += vf_colorkey.o
 OBJS-$(CONFIG_COLORLEVELS_FILTER)+= vf_colorlevels.o
 OBJS-$(CONFIG_COLORMATRIX_FILTER)+= vf_colormatrix.o
+OBJS-$(CONFIG_CONVOLUTION_FILTER)+= vf_convolution.o
 OBJS-$(CONFIG_COPY_FILTER)   += vf_copy.o
 OBJS-$(CONFIG_COVER_RECT_FILTER) += vf_cover_rect.o lavfutils.o
 OBJS-$(CONFIG_CROP_FILTER)   += vf_crop.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index b0d8410..122dc0d 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -121,6 +121,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(COLORKEY,   colorkey,   vf);
 REGISTER_FILTER(COLORLEVELS,colorlevels,vf);
 REGISTER_FILTER(COLORMATRIX,colormatrix,vf);
+REGISTER_FILTER(CONVOLUTION,convolution,vf);
 REGISTER_FILTER(COPY,   copy,   vf);
 REGISTER_FILTER(COVER_RECT, cover_rect, vf);
 REGISTER_FILTER(CROP,   crop,   vf);
diff --git a/libavfilter/vf_convolution.c b/libavfilter/vf_convolution.c
new file mode 100644
index 000..3908316
--- /dev/null
+++ b/libavfilter/vf_convolution.c
@@ -0,0 +1,331 @@
+/*
+ * Copyright (c) 2012-2013 Oka Motofumi (chikuzen.mo at gmail dot com)
+ * Copyright (c) 2015 Paul B Mahol
+ *
+ * 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/avstring.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct ConvolutionContext {
+const AVClass *class;
+
+char *matrix_str[4];
+float rdiv;
+float bias;
+
+int bstride;
+uint8_t *buffer;
+int nb_planes;
+int planewidth[4];
+int planeheight[4];
+int matrix[4][25];
+int matrix_length[4];
+int copy[4];
+
+void (*filter[4])(struct ConvolutionContext *s, AVFrame *in, AVFrame *out, 
int plane);
+} ConvolutionContext;
+
+#define OFFSET(x) offsetof(ConvolutionContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption convolution_options[] = {
+{ "m0", "set matrix for 1st plane", OFFSET(matrix_str[0]), 
AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
+{ "m1", "set matrix for 2nd plane", OFFSET(matrix_str[1]), 
AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
+{ "m2", "set matrix for 3rd plane", OFFSET(matrix_str[2]), 
AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
+{ "m3", "set matrix for 4th plane", OFFSET(matrix_str[3]), 
AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
+{ "rdiv", "set rdiv", OFFSET(rdiv), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 1.0, 
INT_MAX, FLAGS},
+{ "bias", "set bias", OFFSET(bias), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, 
INT_MAX, FLAGS},
+{ NULL }
+};
+
+AVFILTER_DEFINE_CLASS(convolution);
+
+static const int same3x3[9] = {0, 0, 0,
+   0, 1, 0,
+   0, 0, 0};
+
+static const int same5x5[25] = {0, 0, 0, 0, 0,
+0, 0, 0, 0, 0,
+0, 0, 1, 0, 0,
+0, 0, 0, 0, 0,
+0, 0, 0, 0, 0};
+
+static int query_formats(AVFilterContext *ctx)
+{
+static const enum AVPixelFormat pix_fmts[] = {
+AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
+AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
+AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
+AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
+AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
+AV_PIX_FMT_GBRP, A

Re: [FFmpeg-devel] GSoC Weely report (libswscale)

2015-07-16 Thread Michael Niedermayer
On Wed, Jul 15, 2015 at 08:06:49PM -0300, Pedro Arthur wrote:
> Hi,
> 
> I removed the asserts referencing unused variables and it passed all tests.
> The following patch contains the changes and some improvements to the code
> as a single diff.
> 
> 2015-07-12 10:04 GMT-03:00 Pedro Arthur :
> 
> > I'll check it, I think most of these asserts are from some unused
> > variables which were replaced by the SwsSlice struct.
> >
> > 2015-07-11 23:51 GMT-03:00 Michael Niedermayer :
> >
> >> On Sat, Jul 11, 2015 at 04:57:22PM -0300, Pedro Arthur wrote:
> >> > Here is the full patch rebased including all previous changes.
> >>
> >> if you build ffmpeg with --assert-level=2
> >>
> >> fails fate
> >> for example in fate-vsynth1-cinepak
> >>
> >> its probably best to always build with --assert-level=2
> >> so you wont miss such failures
> >>
> >> --- ./tests/ref/vsynth/vsynth1-cinepak  2015-07-11 12:25:01.268257903
> >> +0200
> >> +++ tests/data/fate/vsynth1-cinepak 2015-07-12 04:11:06.041453781
> >> +0200
> >> @@ -1,4 +0,0 @@
> >> -546c7c1069f9e418aa787f469b693b94 *tests/data/fate/vsynth1-cinepak.mov
> >> -99465 tests/data/fate/vsynth1-cinepak.mov
> >> -bee091c200262be3427a233a2812388c
> >> *tests/data/fate/vsynth1-cinepak.out.rawvideo
> >> -stddev:8.46 PSNR: 29.58 MAXDIFF:  105 bytes:  7603200/   456192
> >>
> >> Assertion lumSrcPtr + vLumFilterSize - 1 < (const int16_t **)lumPixBuf +
> >> vLumBufSize * 2 failed at libswscale/swscale.c:694
> >>
> >> there are also many other fate tests which fail with --assert-level=2
> >>
> >> also it might make more sense to stash all these commits together
> >> for submission,
> >> if you like you could keep them seperate in your branch (could make
> >> sense for debug/bisect)
> >>
> >> but the commits showing the step wise development are rather hard to
> >> review and would be impossible to push to master git
> >> commits for master git should not introduce known issues that are
> >> fixed in later commits and should be split in selfcontained changesets
> >>
> >> a single stashed together patch should be fine and easy to generate
> >>
> >> thanks
> >>
> >> [...]
> >>
> >> --
> >> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >>
> >> Avoid a single point of failure, be that a person or equipment.
> >>
> >> ___
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >>
> >

[...]

> +static int alloc_slice(SwsSlice *s, enum AVPixelFormat fmt, int lumLines, 
> int chrLines, int h_sub_sample, int v_sub_sample, int ring)
> +{
> +int i;
> +int err = 0;
> + 
> +int size[4] = { lumLines,
> +chrLines,
> +chrLines,
> +lumLines };
> +
> +//s->width;
> +s->h_chr_sub_sample = h_sub_sample;
> +s->v_chr_sub_sample = v_sub_sample;
> +s->fmt = fmt;
> +s->is_ring = ring;
> +s->should_free_lines = 0;
> +
> +for (i = 0; i < 4; ++i)
> +{
> +int j;
> +int n = size[i] * ( ring == 0 ? 1 : 2);
> +s->plane[i].line = av_malloc_array(sizeof(uint8_t*), n);
> +if (!s->plane[i].line) 
> +{
> +err = AVERROR(ENOMEM);
> +break;
> +}

> +for (int j = 0; j < n; ++j)

theres already a int j above


[...]
> +static int lum_h_scale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, 
> int sliceH)
> +{
> +ScaleInstance *instance = desc->instance;
> +int srcW = desc->src->width;
> +int dstW = desc->dst->width;
> +int xInc = instance->xInc;
> +
> +int i;
> +for (i = 0; i < sliceH; ++i)
> +{
> +uint8_t ** src = desc->src->plane[0].line;
> +uint8_t ** dst = desc->dst->plane[0].line;
> +int src_pos = sliceY+i - desc->src->plane[0].sliceY;
> +int dst_pos = sliceY+i - desc->dst->plane[0].sliceY;
> +
> +
> +if (!c->hyscale_fast) {
> +c->hyScale(c, (int16_t*)dst[dst_pos], dstW, (const uint8_t 
> *)src[src_pos], instance->filter,
> +   instance->filter_pos, instance->filter_size);
> +} else { // fast bilinear upscale / crap downscale
> +c->hyscale_fast(c, (int16_t*)dst[dst_pos], dstW, src[src_pos], 
> srcW, xInc);
> +}
> +
> +if (c->lumConvertRange)
> +c->lumConvertRange((int16_t*)dst[dst_pos], dstW);
> +
> +desc->dst->plane[0].sliceH += 1;
> +
> +if (desc->alpha)
> +{
> +src = desc->src->plane[3].line;
> +dst = desc->dst->plane[3].line;
> +
> +src_pos = sliceY+i - desc->src->plane[3].sliceY;
> +dst_pos = sliceY+i - desc->dst->plane[3].sliceY;
> +
> +desc->dst->plane[3].sliceH += 1;
> +

> +if (!c->hyscale_fast) {
> +c->hyScale(c, (int16_t*)dst[dst_pos], dstW, (const uint8_t 
> *)src[src_pos], instance->filter,
> +

Re: [FFmpeg-devel] [PATCH v5] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread Vesselin Bontchev
16.07.2015, 03:58, "Vesselin Bontchev" :
> Hi,
>
> A sample Audible .aax file can be downloaded from the following link,
>
> https://gitlab.com/vesselin.bontchev/audible-samples/tree/master
>
> Usage,
>
> ffmpeg -activation_bytes 62689101 -i Audible_AAX_sample_62689101.aax -vn -c:a 
> copy -v debug output.mp4

Hi,

I am attaching a Python script to fetch the "activation bytes" from Audible 
servers (as an alternative to doing offline attacks on the AAX files).

Vesselin

#!/usr/bin/env python

import traceback
try:
import requests
except ImportError:
print("Please install the missing python-requests package.")
import hashlib
import binascii
import sys
import base64
import time


def password_encoder(password):
shift = 8
output = "8"

# rot(8)
for c in password:
t = ord(c) - shift
output = output + "{:02x}".format(t)

return output

payload = {'action': 'register', 'user_alias': '', 'epassword':
   '', 'domain': 'www.audible.com', 'player_type': 'software',
   'license_type': 'individual', 'license_name': '', 'player_slots': 8,
   'player_manuf': 'Audible', 'client_code': 'generic', 'player_model':
   'Desktop', 'time_unused': int(time.time()), 'player_id': ''}

if __name__ == "__main__":
if len(sys.argv) < 3:
sys.stderr.write("Usage: %s  \n" % sys.argv[0])
sys.exit(-1)

payload["user_alias"] = sys.argv[1]
payload["epassword"] = password_encoder(sys.argv[2])

# generate base64 digest of a random 20 byte string ;)
fake_hash = hashlib.sha1(b"").digest()
payload["player_id"] = base64.encodestring(fake_hash).rstrip()
# sys.stderr.write("[+] Player ID is %s\n\n" % (payload["player_id"]))

url = "http://www.audible.com/cgi-bin/licensemgr.cgi";

headers = {
'User-Agent': "AudibleActivation",
'Host': 'www.audible.com',
'Cache-Control': 'no-cache',
'Cookie': 'AM=5.5.0.5; ADM=6.6.0.15; download_audio='
}

# print(headers, payload)

try:
response = requests.get(url, headers=headers, params=payload)
data = response.content
if b"BAD_LOGIN" in data or b"Whoops" in data:
print(data)
print("\nActivation failed! ;(")
sys.exit(-1)
k = data.rfind(b"group_id")
l = data[k:].find(b")")
keys = data[k + l + 1 + 1:]
output_keys = []
# each key is of 70 bytes
for i in range(0, 8):
key = keys[i * 70 + i:(i + 1) * 70 + i]
h = binascii.hexlify(bytes(key))
h = [h[i:i+2] for i in range(0, len(h), 2)]
h = b",".join(h)
output_keys.append(h)
except SystemExit as e:
sys.exit(e)
except:
traceback.print_exc()

# only 4 bytes of output_keys[0] are necessary for decryption! ;)
print(output_keys[0].replace(b",", b"")[0:8])

# de-register!
payload["action"] = "de-register"
response = requests.get(url, headers=headers, params=payload)
# print(response.text)
# print(password_decoder(payload["epassword"]))
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] FFmpeg/MPlayer/rtmpdump possibly searching for a new server and hosting

2015-07-16 Thread Kais Bensalah
On 7/15/15, Michael Niedermayer  wrote:
> On Tue, Jul 14, 2015 at 11:42:30PM +0100, Kieran Kunhya wrote:
>> OVH has poor quality connectivity by the way - this could lead to
>> performance issues in some countries.
>
> Has anyone done some hoster connectivity comparissions /tests ?
> it would be interresting to see what the differences are.

FFmpeg, as a leading free multimedia framework, needs an 
independent free research organization maintaining its foundraising via 
providing the internal source code and web hosting facilities: and not 
depending on a web hosting company, to make sure the project gets 
always in full control by the users and developers.

So, I recommend contacting the Fraunhofer's FOKUS non-profit 
organization (https://www.fokus.fraunhofer.de/contact) for hosting the 
project.

-- 
Best Regards,
Kais Bensalah
GnuPG fingerprint: 1739 7374 28CE 88A8 AD6F  0D9C B9CB 7046 4E5E 
BF34
If the software you use is not free, then you are not free ..

signature.asc
Description: This is a digitally signed message part.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v4] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread wm4
On Thu, 16 Jul 2015 14:48:05 +0200
Nicolas George  wrote:

> L'octidi 28 messidor, an CCXXIII, wm4 a écrit :
> > Even if there's a bug, initializing them will at least make the
> > behavior predictable and reproducible, instead of random,
> > platform-dependent, and sporadic.
> 
> Which is exactly the problem: instead of a very visible problem, you get a
> subtly-wrong behaviour. The very visible problem would be fixed right away,
> the faulty behaviour would stay for years. Predictable and reproducible
> maybe, but faulty is faulty.

But what you suggest can also expose subtly-wrong behavior, except
that it might additionally behave like a heisenbug. Also, such things
easily turn into security issues, or there might be a typical developer
vs. production environment issue.

> This example exhibits one of the reasons that make me strongly dislike your
> way of developing.

You dislike robust code?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Save properties of the decoded stream

2015-07-16 Thread wm4
On Thu, 16 Jul 2015 15:33:31 +0200
Michael Niedermayer  wrote:

> On Thu, Jul 16, 2015 at 12:54:24PM +0200, wm4 wrote:
> [...]
> > > diff --git a/libavcodec/webp.c b/libavcodec/webp.c
> > > index 723a847..8caa6a2 100644
> > > --- a/libavcodec/webp.c
> > > +++ b/libavcodec/webp.c
> > > @@ -1417,6 +1417,7 @@ static int webp_decode_frame(AVCodecContext *avctx, 
> > > void *data, int *got_frame,
> > >  chunk_size, 0);
> > >  if (ret < 0)
> > >  return ret;
> > > +avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
> > >  }
> > >  bytestream2_skip(&gb, chunk_size);
> > >  break;
> > 
> > The lossless mode can apparently change mid-stream, so it should NOT be
> > an AVCodecContext field. Use per-frame side-data instead.
> 
> "everything" can change mid stream, this field is not about if a frame

Which is why the current bloated AVCodecContext approach is wrong.

> is lossless or even if the whole file is guranteed to be lossless
> (for such gurantee the whole file would need to be parsed which is
>  not practical for gathering some secondary bit of information about a
>  stream)
> 
> This field is simply to indicate if a stream appears to be lossless
> based on parsing headers or the first keyframe.
> So it is a property of the stream or decoder instance, similar to
> the width, height, format, sample rate, bit rate, ... fields in
> AVCodecContext are properties of a stream or codec instance even
> though they too could and do change per frame.

So it exists for ffprobe? If ffprobe (or similar things) want to gather
information based on the first frame, they should just decode the first
frame, instead of requiring tons of fragile magic in libavformat.

In any case, adding even more rarely set fields to an already big
struct doesn't sound like a very good idea to me. With side-data at
least there's a certain discoverability and orderliness. It gets
obscure stuff out of the way.

> 
> What could be done, and maybe thats what you meant is to use side data
> or IMHO better a flag or specific quality value of the existing
> quality field from AVFrame, to communicate the lossless nature
> of a frame. That per frame information could then be used by the core
> to set the per stream information aka  avctx->properties
> this is more complex but would make the per frame lossless-ness
> information available to user applications
> 
> [...]

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


[FFmpeg-devel] [PATCH] avfilter: Add reverse filter

2015-07-16 Thread Derek Buitenhuis
Signed-off-by: Derek Buitenhuis 
---
The design is how ubitux requested. Use trim with it or risk using ALL THEM 
MEMORY.
---
 doc/filters.texi |   4 ++
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/version.h|   2 +-
 libavfilter/vf_reverse.c | 145 +++
 5 files changed, 152 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/vf_reverse.c

diff --git a/doc/filters.texi b/doc/filters.texi
index 3b4ec2c..7b0410a 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -8247,6 +8247,10 @@ pixels will slow things down on a large logo.
 This filter uses the repeat_field flag from the Video ES headers and hard 
repeats
 fields based on its value.
 
+@section reverse
+
+Reverses a clip. Requires memory to buffer the entire clip, so trimming is 
suggested.
+
 @section rotate
 
 Rotate video by an arbitrary angle expressed in radians.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 058b9e9..1638ae8 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -185,6 +185,7 @@ OBJS-$(CONFIG_QP_FILTER) += vf_qp.o
 OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o
 OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o 
vf_removelogo.o
 OBJS-$(CONFIG_REPEATFIELDS_FILTER)   += vf_repeatfields.o
+OBJS-$(CONFIG_REVERSE_FILTER)+= vf_reverse.o
 OBJS-$(CONFIG_ROTATE_FILTER) += vf_rotate.o
 OBJS-$(CONFIG_SEPARATEFIELDS_FILTER) += vf_separatefields.o
 OBJS-$(CONFIG_SAB_FILTER)+= vf_sab.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index b0d8410..5e2a322 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -200,6 +200,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(REMOVEGRAIN,removegrain,vf);
 REGISTER_FILTER(REMOVELOGO, removelogo, vf);
 REGISTER_FILTER(REPEATFIELDS,   repeatfields,   vf);
+REGISTER_FILTER(REVERSE,reverse,vf);
 REGISTER_FILTER(ROTATE, rotate, vf);
 REGISTER_FILTER(SAB,sab,vf);
 REGISTER_FILTER(SCALE,  scale,  vf);
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 618c626..d22b2c5 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFILTER_VERSION_MAJOR  5
-#define LIBAVFILTER_VERSION_MINOR  22
+#define LIBAVFILTER_VERSION_MINOR  23
 #define LIBAVFILTER_VERSION_MICRO 100
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
diff --git a/libavfilter/vf_reverse.c b/libavfilter/vf_reverse.c
new file mode 100644
index 000..00512be
--- /dev/null
+++ b/libavfilter/vf_reverse.c
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2015 Derek Buitenhuis
+ *
+ * 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/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+#define DEFAULT_LENGTH 300
+
+typedef struct ReverseContext {
+const AVClass *class;
+
+int nb_frames;
+AVFrame **frames;
+unsigned int frames_size;
+unsigned int pts_size;
+int64_t *pts;
+int flush_idx;
+} ReverseContext;
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ReverseContext *s = ctx->priv;
+
+s->pts = av_fast_realloc(NULL, &s->pts_size,
+ DEFAULT_LENGTH * sizeof(*(s->pts)));
+if (!s->pts)
+return AVERROR(ENOMEM);
+
+s->frames = av_fast_realloc(NULL, &s->frames_size,
+DEFAULT_LENGTH * sizeof(*(s->frames)));
+if (!s->frames) {
+av_freep(&s->pts);
+return AVERROR(ENOMEM);
+}
+
+return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ReverseContext *s = ctx->priv;
+
+av_freep(&s->pts);
+av_freep(&s->frames);
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+AVFilterContext *ctx = inlink->dst;
+ReverseContext *s= ctx->priv;
+
+
+if (s->nb_frames + 1 > s->fr

Re: [FFmpeg-devel] [PATCH v4] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread Nicolas George
L'octidi 28 messidor, an CCXXIII, wm4 a écrit :
> You dislike robust code?

This is not robust, this is defensive. I despise defensive programming.

Regards,

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


Re: [FFmpeg-devel] [PATCH]Save properties of the decoded stream

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 07:19:40PM +0200, wm4 wrote:
> On Thu, 16 Jul 2015 15:33:31 +0200
> Michael Niedermayer  wrote:
> 
> > On Thu, Jul 16, 2015 at 12:54:24PM +0200, wm4 wrote:
> > [...]
> > > > diff --git a/libavcodec/webp.c b/libavcodec/webp.c
> > > > index 723a847..8caa6a2 100644
> > > > --- a/libavcodec/webp.c
> > > > +++ b/libavcodec/webp.c
> > > > @@ -1417,6 +1417,7 @@ static int webp_decode_frame(AVCodecContext 
> > > > *avctx, void *data, int *got_frame,
> > > >  chunk_size, 0);
> > > >  if (ret < 0)
> > > >  return ret;
> > > > +avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
> > > >  }
> > > >  bytestream2_skip(&gb, chunk_size);
> > > >  break;
> > > 
> > > The lossless mode can apparently change mid-stream, so it should NOT be
> > > an AVCodecContext field. Use per-frame side-data instead.
> > 
> > "everything" can change mid stream, this field is not about if a frame
> 
> Which is why the current bloated AVCodecContext approach is wrong.
> 
> > is lossless or even if the whole file is guranteed to be lossless
> > (for such gurantee the whole file would need to be parsed which is
> >  not practical for gathering some secondary bit of information about a
> >  stream)
> > 
> > This field is simply to indicate if a stream appears to be lossless
> > based on parsing headers or the first keyframe.
> > So it is a property of the stream or decoder instance, similar to
> > the width, height, format, sample rate, bit rate, ... fields in
> > AVCodecContext are properties of a stream or codec instance even
> > though they too could and do change per frame.
> 
> So it exists for ffprobe? If ffprobe (or similar things) want to gather
> information based on the first frame, they should just decode the first
> frame, instead of requiring tons of fragile magic in libavformat.

ffprobe, yes but also anything that chooses a stream out of several
may be interrested if a stream is likely lossless or not.
and that potentially could be interresting for most tools using
the libs.
That choosing also can be automatic or manual both need some knowledge
over a stream to choose which to use if there are several

and yes all these tools could decode the first frame (and 2nd if the
first isnt a keyframe, and 3rd, ... until width/height/... is known
but i think its better if libavformat is able to do that and it
doesnt need to be duplicated in each tool which is interrested in
such information.


> 
> In any case, adding even more rarely set fields to an already big
> struct doesn't sound like a very good idea to me. With side-data at
> least there's a certain discoverability and orderliness. It gets
> obscure stuff out of the way.

i dont mind if side data or meta data is used if it is possible and
people prefer it

ATM i think its not possible as theres no side data in the structs
needed. also the reason why iam not a big fan of side data is that
its a quite heavy system, needing malloc(), needing to deal with
malloc failures, needing to iterate over lists of structs to find out
if a specific "key" is set.
It feels to me like total overkill to use all this for basically
setting a single bit flag for a stream/codec. But like i said, i
dont mind it if thats what people want to use for this and the people
who want it also do the work

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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


Re: [FFmpeg-devel] [PATCH] avfilter: Add reverse filter

2015-07-16 Thread Clément Bœsch
On Thu, Jul 16, 2015 at 05:43:59PM +, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis 
> ---
> The design is how ubitux requested. Use trim with it or risk using ALL THEM 
> MEMORY.

;)

> ---
>  doc/filters.texi |   4 ++
>  libavfilter/Makefile |   1 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/version.h|   2 +-
>  libavfilter/vf_reverse.c | 145 
> +++
>  5 files changed, 152 insertions(+), 1 deletion(-)
>  create mode 100644 libavfilter/vf_reverse.c
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 3b4ec2c..7b0410a 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -8247,6 +8247,10 @@ pixels will slow things down on a large logo.
>  This filter uses the repeat_field flag from the Video ES headers and hard 
> repeats
>  fields based on its value.
>  
> +@section reverse
> +
> +Reverses a clip. Requires memory to buffer the entire clip, so trimming is 
> suggested.

We use infinitive form, so "Reverse".

You might want to print "Warning: this filter requires ..."

Can you add an example to make sure users don't membomb too much their
OS?

> +
>  @section rotate
>  
>  Rotate video by an arbitrary angle expressed in radians.
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 058b9e9..1638ae8 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -185,6 +185,7 @@ OBJS-$(CONFIG_QP_FILTER) += vf_qp.o
>  OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o
>  OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o 
> lavfutils.o vf_removelogo.o
>  OBJS-$(CONFIG_REPEATFIELDS_FILTER)   += vf_repeatfields.o
> +OBJS-$(CONFIG_REVERSE_FILTER)+= vf_reverse.o
>  OBJS-$(CONFIG_ROTATE_FILTER) += vf_rotate.o
>  OBJS-$(CONFIG_SEPARATEFIELDS_FILTER) += vf_separatefields.o
>  OBJS-$(CONFIG_SAB_FILTER)+= vf_sab.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index b0d8410..5e2a322 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -200,6 +200,7 @@ void avfilter_register_all(void)
>  REGISTER_FILTER(REMOVEGRAIN,removegrain,vf);
>  REGISTER_FILTER(REMOVELOGO, removelogo, vf);
>  REGISTER_FILTER(REPEATFIELDS,   repeatfields,   vf);
> +REGISTER_FILTER(REVERSE,reverse,vf);
>  REGISTER_FILTER(ROTATE, rotate, vf);
>  REGISTER_FILTER(SAB,sab,vf);
>  REGISTER_FILTER(SCALE,  scale,  vf);
> diff --git a/libavfilter/version.h b/libavfilter/version.h
> index 618c626..d22b2c5 100644
> --- a/libavfilter/version.h
> +++ b/libavfilter/version.h
> @@ -30,7 +30,7 @@
>  #include "libavutil/version.h"
>  
>  #define LIBAVFILTER_VERSION_MAJOR  5
> -#define LIBAVFILTER_VERSION_MINOR  22
> +#define LIBAVFILTER_VERSION_MINOR  23
>  #define LIBAVFILTER_VERSION_MICRO 100
>  
>  #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
> diff --git a/libavfilter/vf_reverse.c b/libavfilter/vf_reverse.c
> new file mode 100644
> index 000..00512be
> --- /dev/null
> +++ b/libavfilter/vf_reverse.c
> @@ -0,0 +1,145 @@
> +/*
> + * Copyright (c) 2015 Derek Buitenhuis
> + *
> + * 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/opt.h"
> +#include "avfilter.h"
> +#include "formats.h"
> +#include "internal.h"
> +#include "video.h"
> +
> +#define DEFAULT_LENGTH 300
> +
> +typedef struct ReverseContext {
> +const AVClass *class;
> +
> +int nb_frames;
> +AVFrame **frames;
> +unsigned int frames_size;
> +unsigned int pts_size;
> +int64_t *pts;
> +int flush_idx;
> +} ReverseContext;
> +
> +static av_cold int init(AVFilterContext *ctx)
> +{
> +ReverseContext *s = ctx->priv;
> +
> +s->pts = av_fast_realloc(NULL, &s->pts_size,
> + DEFAULT_LENGTH * sizeof(*(s->pts)));
> +if (!s->pts)
> +return AVERROR(ENOMEM);
> +
> +s->frames = av_fast_realloc(NULL, &s->frames_size,
> +DEFAULT_LENGTH * sizeof(*(s->frames)));
> +if (!s->frames) {
> +av_freep(&s->pts);
> +  

Re: [FFmpeg-devel] [PATCH 2/3] avcodec/snappy: refactor so ff_snappy_uncompress uses an existing buffer

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 01:23:22PM +0100, Tom Butterworth wrote:
> Some uses of Snappy require uncompressing to positions within an existing 
> buffer. Also adds a function to get the uncompressed length of Snappy data.
> ---
>  libavcodec/hapdec.c |  7 ++-
>  libavcodec/snappy.c | 24 +---
>  libavcodec/snappy.h | 19 ++-
>  3 files changed, 37 insertions(+), 13 deletions(-)

applied

thanks

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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


Re: [FFmpeg-devel] [PATCH] Refactoring to move common QSV-related code part into libavcodec/qsvdec.c

2015-07-16 Thread Michael Niedermayer
On Tue, Jul 14, 2015 at 02:18:30PM +0300, Ivan Uskov wrote:
> Hello All,
> 
> Current implementation of qsvdec_h264.c does contain initialization
> code which is common for all qsv-based decoders. The attached patch
> moves common code into qsvdec.c. The declaration ff_qsv_decode_init
> has been unified with ff_qsv_encode_init.
> Please review.
> 
>   
> 
> -- 
> Best regards,
>  Ivan  mailto:ivan.us...@nablet.com

>  qsvdec.c  |   42 +-
>  qsvdec.h  |2 +-
>  qsvdec_h264.c |   15 +--
>  3 files changed, 19 insertions(+), 40 deletions(-)
> 3ce7ce1105ce384cd009e366c8d78e05a779debf  
> 0001-Refactoring-to-move-common-QSV-related-code-part-int.patch
> From 7110fc1d2e031a1b231e86aace693f655ee4151b Mon Sep 17 00:00:00 2001
> From: Ivan Uskov 
> Date: Tue, 14 Jul 2015 07:07:04 -0400
> Subject: [PATCH] Refactoring to move common QSV-related code part into
>  libavcodec/qsvdec.c

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH 1/5] concatdec: add support for specifying inpoint of files

2015-07-16 Thread Marton Balint


On Thu, 16 Jul 2015, Nicolas George wrote:


Le tridi 23 messidor, an CCXXIII, Marton Balint a écrit :

Signed-off-by: Marton Balint 
---
 doc/demuxers.texi   | 17 +
 libavformat/concatdec.c | 39 ++-
 2 files changed, 43 insertions(+), 13 deletions(-)



[...]


cat->files[fileno - 1].start_time +
cat->files[fileno - 1].duration;
+file->file_start_time = (avf->start_time == AV_NOPTS_VALUE) ? 0 : 
avf->start_time;



+file->file_inpoint = (file->file_inpoint == AV_NOPTS_VALUE) ? 
file->file_start_time : file->inpoint;


If I read this correctly, file->file_inpoint is always set.


Correct.

[...]


 cat->cur_file->duration = cat->avf->duration;



+if (cat->cur_file->inpoint != AV_NOPTS_VALUE)


... then this test is always true. Is it on purpose ?


Yes it is, because the check is done on file->inpoint (the inpoint the 
user provided) not file->file_inpoint which is the pre-calculated inpoint 
of the file.


 >

+cat->cur_file->duration -= (cat->cur_file->inpoint - 
cat->cur_file->file_start_time);
+}



LGTM apart from that.


Ok, thanks. I will send the merge request to Michael.

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


Re: [FFmpeg-devel] [PATCH] avfilter: add deband filter

2015-07-16 Thread Paul B Mahol
Dana 15. 7. 2015. 16:01 osoba "James Darnley" 
napisala je:
>
> On 2015-07-15 00:06, Paul B Mahol wrote:
> > Signed-off-by: Paul B Mahol 
> > ---
> >  doc/filters.texi |  35 ++
> >  libavfilter/Makefile |   1 +
> >  libavfilter/allfilters.c |   1 +
> >  libavfilter/vf_deband.c  | 312
+++
> >  4 files changed, 349 insertions(+)
> >  create mode 100644 libavfilter/vf_deband.c
> >
> > diff --git a/doc/filters.texi b/doc/filters.texi
> > index 9f7b976..0a07735 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -3678,6 +3678,41 @@ Violent denoise using a block size of
@code{16x16}:
> >  dctdnoiz=15:n=4
> >  @end example
> >
> > +@section deband
> > +
> > +Remove banding artifacts from input video.
> > +It works by replacing banded pixels with average value of referenced
pixels.
> > +
> > +The filter accepts the following options:
> > +
> > +@table @option
> > +@item 1thr
> > +@item 2thr
> > +@item 3thr
> > +@item 4thr
> > +Set banding detection threshold for each plane. Default is 0.02. Range
from
> > +which value can be selected is from 0.008 to 0.5.
>
> I would suggest dropping the second "from" or rewording the third
> sentence as "Valid range is 0.008 to 0.5."
>
> > +If difference between current pixel and reference pixel is less than
threshold,
> > +it will be considered as banded.
> > +
> > +@item range, r
> > +Banding detection range in pixels. Default is 16. If positive, random
number
> > +from range 0 to set value will be picked. If negative, exact of
absolute value
> > +will be used.
> > +The range defines square of four pixels around current pixel.
>
> "If positive, random number in range 0 to r will be used."
>
> "If negative, exact absolute value will be used."
>
> > +@item direction, d
> > +Set direction from which four pixel will be compared. If positive,
random
> > +direction from 0 to set direction will be picked. If negative, exact of
> > +absolute value will be picked.
>
> Similar to above.  Also, what does the direction mean?  It's a float and
> looks like it represents radians (there is a sine/cosine pair below).
> The range is -2*PI..2*PI (should that also be mentioned here?) but what
> does the 0 represent? Looking at the code 0 is up then increasing moves
> in a clockwise direction.
>
> > +@item blur
> > +If enabled current pixel is compared with average value of all four
> > +surrounding pixels. By default is enabled. If disabled current pixel is
>
> "The default is enabled."
>
> > diff --git a/libavfilter/vf_deband.c b/libavfilter/vf_deband.c
> > new file mode 100644
> > index 000..1fd05d1
> > --- /dev/null
> > +++ b/libavfilter/vf_deband.c
> > @@ -0,0 +1,312 @@
> > +/*
> > + * Copyright (c) 2015 Niklas Haas
> > + * Copyright (c) 2015 Paul B Mahol
> > + *
> > + * Permission is hereby granted, free of charge, to any person
obtaining a copy
> > + * of this software and associated documentation files (the
"Software"), to deal
> > + * in the Software without restriction, including without limitation
the rights
> > + * to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell
> > + * copies of the Software, and to permit persons to whom the Software
is
> > + * furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice shall be
included in
> > + * all copies or substantial portions of the Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
> > + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
> > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE
> > + * SOFTWARE.
> > + */
>
> This is the MIT license, right?  Do we specifically note these anywhere?
>
>

Nope, imho not needed.

>
> ___
> 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] avfilter: Add reverse filter

2015-07-16 Thread Paul B Mahol
Dana 16. 7. 2015. 20:43 osoba "Clément Bœsch"  napisala je:
>
> On Thu, Jul 16, 2015 at 05:43:59PM +, Derek Buitenhuis wrote:
> > Signed-off-by: Derek Buitenhuis 
> > ---
> > The design is how ubitux requested. Use trim with it or risk using ALL
THEM MEMORY.
>
> ;)
>
> > ---
> >  doc/filters.texi |   4 ++
> >  libavfilter/Makefile |   1 +
> >  libavfilter/allfilters.c |   1 +
> >  libavfilter/version.h|   2 +-
> >  libavfilter/vf_reverse.c | 145

Missing Changelog entry.
+++
> >  5 files changed, 152 insertions(+), 1 deletion(-)
> >  create mode 100644 libavfilter/vf_reverse.c
> >
> > diff --git a/doc/filters.texi b/doc/filters.texi
> > index 3b4ec2c..7b0410a 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -8247,6 +8247,10 @@ pixels will slow things down on a large logo.
> >  This filter uses the repeat_field flag from the Video ES headers and
hard repeats
> >  fields based on its value.
> >
> > +@section reverse
> > +
> > +Reverses a clip. Requires memory to buffer the entire clip, so
trimming is suggested.
>
> We use infinitive form, so "Reverse".
>
> You might want to print "Warning: this filter requires ..."
>
> Can you add an example to make sure users don't membomb too much their
> OS?
>
> > +
> >  @section rotate
> >
> >  Rotate video by an arbitrary angle expressed in radians.
> > diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> > index 058b9e9..1638ae8 100644
> > --- a/libavfilter/Makefile
> > +++ b/libavfilter/Makefile
> > @@ -185,6 +185,7 @@ OBJS-$(CONFIG_QP_FILTER) +=
vf_qp.o
> >  OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o
> >  OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o
lavfutils.o vf_removelogo.o
> >  OBJS-$(CONFIG_REPEATFIELDS_FILTER)   += vf_repeatfields.o
> > +OBJS-$(CONFIG_REVERSE_FILTER)+= vf_reverse.o
> >  OBJS-$(CONFIG_ROTATE_FILTER) += vf_rotate.o
> >  OBJS-$(CONFIG_SEPARATEFIELDS_FILTER) += vf_separatefields.o
> >  OBJS-$(CONFIG_SAB_FILTER)+= vf_sab.o
> > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> > index b0d8410..5e2a322 100644
> > --- a/libavfilter/allfilters.c
> > +++ b/libavfilter/allfilters.c
> > @@ -200,6 +200,7 @@ void avfilter_register_all(void)
> >  REGISTER_FILTER(REMOVEGRAIN,removegrain,vf);
> >  REGISTER_FILTER(REMOVELOGO, removelogo, vf);
> >  REGISTER_FILTER(REPEATFIELDS,   repeatfields,   vf);
> > +REGISTER_FILTER(REVERSE,reverse,vf);
> >  REGISTER_FILTER(ROTATE, rotate, vf);
> >  REGISTER_FILTER(SAB,sab,vf);
> >  REGISTER_FILTER(SCALE,  scale,  vf);
> > diff --git a/libavfilter/version.h b/libavfilter/version.h
> > index 618c626..d22b2c5 100644
> > --- a/libavfilter/version.h
> > +++ b/libavfilter/version.h
> > @@ -30,7 +30,7 @@
> >  #include "libavutil/version.h"
> >
> >  #define LIBAVFILTER_VERSION_MAJOR  5
> > -#define LIBAVFILTER_VERSION_MINOR  22
> > +#define LIBAVFILTER_VERSION_MINOR  23
> >  #define LIBAVFILTER_VERSION_MICRO 100
> >
> >  #define LIBAVFILTER_VERSION_INT
AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
> > diff --git a/libavfilter/vf_reverse.c b/libavfilter/vf_reverse.c
> > new file mode 100644
> > index 000..00512be
> > --- /dev/null
> > +++ b/libavfilter/vf_reverse.c
> > @@ -0,0 +1,145 @@
> > +/*
> > + * Copyright (c) 2015 Derek Buitenhuis
> > + *
> > + * 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/opt.h"
> > +#include "avfilter.h"
> > +#include "formats.h"
> > +#include "internal.h"
> > +#include "video.h"
> > +
> > +#define DEFAULT_LENGTH 300
> > +
> > +typedef struct ReverseContext {
> > +const AVClass *class;

Apparently not needed.

> > +
> > +int nb_frames;
> > +AVFrame **frames;
> > +unsigned int frames_size;
> > +unsigned int pts_size;
> > +int64_t *pts;
> > +int flush_idx;
> > +} ReverseContext;
> > +
> > +static av_cold int init(AVFilterContext *ctx)
> > +{
> > +ReverseContext *s = ctx->priv;
> > +
> > +s->pts = av_fast_realloc(NULL, &s-

Re: [FFmpeg-devel] [PATCH] avfilter: Add reverse filter

2015-07-16 Thread Derek Buitenhuis
On Thu, Jul 16, 2015 at 7:43 PM, Clément Bœsch  wrote:
>> +Reverses a clip. Requires memory to buffer the entire clip, so trimming is 
>> suggested.
>
> We use infinitive form, so "Reverse".

Done locally.

> You might want to print "Warning: this filter requires ..."

Is there any reasonable way to determine when to print such a warning? Seems
silly to warn over e.g. 40 frames.

> Can you add an example to make sure users don't membomb too much their
> OS?

How does this look:

-vf trim=end=10,reverse

>> +if (ret == AVERROR_EOF && !ctx->is_disabled && s->nb_frames > 0) {
>
> is_disabled suggest a timeline support. You could add that if you feel
> like it. That way, "reverse=enable='between(t,30,40)'" would reverse only
> between t=30 and t=40 and pass through the rest of the time.

So the other option is to remove the check for it?

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


[FFmpeg-devel] libavcodec/qsvdec_h264.c: SPS parsing now performs by MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

2015-07-16 Thread Ivan Uskov
Hello All,

Current implementation of libavcodec/qsvdec_h264.c does use external
SPS parser. It does not optimal since MFX library has own unified way
to parse headers of all supported formats. This performs by one
MFXVideoDECODE_DecodeHeader() call.
The suggested patch does replace stream specific code to one universal
function call located into the libavcodec/qsvdec.c. This opens an easy
way to implement qsv-accelerated mpeg2, hevc and vc1 decoders.
Please review.

-- 
Best regards,
 Ivan  mailto:ivan.us...@nablet.com

0001-libavcodec-qsvdec_h264.c-SPS-parsing-now-performs-by.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v4] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 08:31:45PM +0200, Nicolas George wrote:
> L'octidi 28 messidor, an CCXXIII, wm4 a écrit :
> > You dislike robust code?
> 
> This is not robust, this is defensive. I despise defensive programming.

i think its best if the author, Vesselin Bontchev decides if he
prefers to initialize them or not as it seems theres no consensus
what is better

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu


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


Re: [FFmpeg-devel] [PATCH] avfilter: Add reverse filter

2015-07-16 Thread Derek Buitenhuis
> Missing Changelog entry.

Added locally.

>> > +typedef struct ReverseContext {
>> > +const AVClass *class;
>
> Apparently not needed.

Woops. Yeah. Obviously. Removed.

>> > +AVFilterContext *ctx = inlink->dst;
>> > +ReverseContext *s= ctx->priv;
>> > +
>> > +
>
> Extra newline.

Fixed.

> Rest looks good.

[...]

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


Re: [FFmpeg-devel] [PATCH 1/5] concatdec: add support for specifying inpoint of files

2015-07-16 Thread Marton Balint

Hello Michael,

Please merge from my stable branch for the following patches:

53f2ef2 mxfdec: calculate the index in display order
f384132 concatdec: add support for specifying inpoint of files
1ea909a concatdec: store eof condition in context
52bc064 concatdec: add support for specifying outpoint of files
bd5e11e concatdec: add support for injecting packet metadata
7f6aef8 avformat: bump micro version after adding concatdec features

The mxf patch was reviewed by Tomas, the other ones are approved by 
Nicolas.


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


Re: [FFmpeg-devel] libavcodec/qsvdec_h264.c: SPS parsing now performs by MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

2015-07-16 Thread Hendrik Leppkes
On Thu, Jul 16, 2015 at 10:02 PM, Ivan Uskov  wrote:
> Hello All,
>
> Current implementation of libavcodec/qsvdec_h264.c does use external
> SPS parser. It does not optimal since MFX library has own unified way
> to parse headers of all supported formats. This performs by one
> MFXVideoDECODE_DecodeHeader() call.
> The suggested patch does replace stream specific code to one universal
> function call located into the libavcodec/qsvdec.c. This opens an easy
> way to implement qsv-accelerated mpeg2, hevc and vc1 decoders.
> Please review.

There was a specific reason this was done this way.
You should definitely inquire with the original author of this code
for the reason of not using the header parser, IIRC it was broken in
some cases.

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


Re: [FFmpeg-devel] [PATCH v4] Add support for Audible AAX (and AAX+) files

2015-07-16 Thread Nicolas George
L'octidi 28 messidor, an CCXXIII, Michael Niedermayer a écrit :
> i think its best if the author, Vesselin Bontchev decides if he
> prefers to initialize them or not as it seems theres no consensus
> what is better

Yes, of course. This exchange was just a discussion of principles.

Regards,

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


Re: [FFmpeg-devel] libavcodec/qsvdec_h264.c: SPS parsing now performs by MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 11:02:22PM +0300, Ivan Uskov wrote:
> Hello All,
> 
> Current implementation of libavcodec/qsvdec_h264.c does use external
> SPS parser. It does not optimal since MFX library has own unified way
> to parse headers of all supported formats. This performs by one
> MFXVideoDECODE_DecodeHeader() call.
> The suggested patch does replace stream specific code to one universal
> function call located into the libavcodec/qsvdec.c. This opens an easy
> way to implement qsv-accelerated mpeg2, hevc and vc1 decoders.
> Please review.
> 
> -- 
> Best regards,
>  Ivan  mailto:ivan.us...@nablet.com

>  qsvdec.c  |   68 -
>  qsvdec.h  |2 -
>  qsvdec_h264.c |   87 
> ++
>  3 files changed, 48 insertions(+), 109 deletions(-)
> f54e2ef059f3878b7e16f51e910dccdbf1335bbb  
> 0001-libavcodec-qsvdec_h264.c-SPS-parsing-now-performs-by.patch
> From 0e84c3e90849b2b59fd361c09c7684374b6229d3 Mon Sep 17 00:00:00 2001
> From: Ivan Uskov 
> Date: Wed, 15 Jul 2015 08:34:51 -0400
> Subject: [PATCH] libavcodec/qsvdec_h264.c: SPS parsing now performs by
>  MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

i dont know the qsv parser code but like hendrik suggested, it
is quite possible that our parser supports more cases.

did you test .mp4  and annex b (.h264) ? do both work ?

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


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


Re: [FFmpeg-devel] libavcodec/qsvdec_h264.c: SPS parsing now performs by MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

2015-07-16 Thread Ivan Uskov
Hello Hendrik,

Ok, no problem. I will ask. But in general it makes no sense. I have
got enough experience for MXF using and common transcoding developing
to see that current implementation is not good and dangerous.

I should to say that actually I see lot minor issues and quite ugly
code pieces into QSV-related modules.
I have got big doubts that all that was "by specific reason".

For example discussed code piece not able to handle a case when decoded
stream begins from arbitrary place, not from SPS. Decoding fails. It
is common scenario for MPEG TS decoding.
Also current code tries to handle dynamic SPS change at bad place (good
place should be into the qsvdec.c) and by bad way (no fifo flush).
My patch does not solve these issues but at least I have got clear
roadmap in mind how to get qsv decoder more reliable and usable.
It is just question of another patches.
Should we keep this code which obvious bad?

Thursday, July 16, 2015, 11:57:25 PM, you wrote:

HL> There was a specific reason this was done this way.
HL> You should definitely inquire with the original author of this code
HL> for the reason of not using the header parser, IIRC it was broken in
HL> some cases.



-- 
Best regards,
 Ivanmailto:ivan.us...@nablet.com

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


Re: [FFmpeg-devel] libavcodec/qsvdec_h264.c: SPS parsing now performs by MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

2015-07-16 Thread Ivan Uskov
Hello Michael,

Usually I'm use annex-b streams to test. Since this functions calls
after bitstream filter which restore annex-b codes it *should* work for mp4 too.
But I did several tests just now and should to say that *both*
versions, original and patched fails on mp4 files. Looks like
bitstream filter uses by wrong way or does contain own issue. But for
any case this issue not related with patch. The patch touches code
where only annex-b bitstream allowed.

Friday, July 17, 2015, 12:57:58 AM, you wrote:

MN> i dont know the qsv parser code but like hendrik suggested, it
MN> is quite possible that our parser supports more cases.

MN> did you test .mp4  and annex b (.h264) ? do both work ?


-- 
Best regards,
 Ivanmailto:ivan.us...@nablet.com

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


[FFmpeg-devel] [PATCH]Rename FF_CODEC_PROPERTY_* as AV_CODEC_PROPERTY_*

2015-07-16 Thread Carl Eugen Hoyos
Hi!

I am not really happy with attached patch as most defines in avcodec.h 
use the FF_ prefix.

Please comment, Carl Eugen
diff --git a/doc/APIchanges b/doc/APIchanges
index 340515c..2748bcf 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2015-07-17 -  - lavc 56.50.100
+  Rename FF_CODEC_PROPERTY_LOSSLESS and FF_CODEC_PROPERTY_CLOSED_CAPTIONS
+  as AV_CODEC_PROPERTY_LOSSLESS and AV_CODEC_PROPERTY_CLOSED_CAPTIONS
+
 2015-07-16 -  - lavc 56.49.100
   Add av_codec_get_codec_properties(), FF_CODEC_PROPERTY_LOSSLESS
   and FF_CODEC_PROPERTY_CLOSED_CAPTIONS
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ad2f5b5..81e8174 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3181,8 +3181,8 @@ typedef struct AVCodecContext {
  * - decoding: set by libavcodec
  */
 unsigned properties;
-#define FF_CODEC_PROPERTY_LOSSLESS0x0001
-#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x0002
+#define AV_CODEC_PROPERTY_LOSSLESS0x0001
+#define AV_CODEC_PROPERTY_CLOSED_CAPTIONS 0x0002
 } AVCodecContext;
 
 AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index eb834f1..511134b 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -886,7 +886,7 @@ static void decode_postinit(H264Context *h, int 
setup_finished)
 memcpy(sd->data, h->a53_caption, h->a53_caption_size);
 av_freep(&h->a53_caption);
 h->a53_caption_size = 0;
-h->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
+h->avctx->properties |= AV_CODEC_PROPERTY_CLOSED_CAPTIONS;
 }
 
 cur->mmco_reset = h->mmco_reset;
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index cc82a43..82d1ff0 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2059,7 +2059,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 goto fail;
 break;
 case SOF3:
-s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
+s->avctx->properties |= AV_CODEC_PROPERTY_LOSSLESS;
 s->lossless= 1;
 s->ls  = 0;
 s->progressive = 0;
@@ -2067,7 +2067,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 goto fail;
 break;
 case SOF48:
-s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
+s->avctx->properties |= AV_CODEC_PROPERTY_LOSSLESS;
 s->lossless= 1;
 s->ls  = 1;
 s->progressive = 0;
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 480cf41..7b07e0e 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1685,7 +1685,7 @@ static int mpeg_field_start(MpegEncContext *s, const 
uint8_t *buf, int buf_size)
 if (sd)
 memcpy(sd->data, s1->a53_caption, s1->a53_caption_size);
 av_freep(&s1->a53_caption);
-avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
+avctx->properties |= AV_CODEC_PROPERTY_CLOSED_CAPTIONS;
 }
 
 if (s1->has_stereo3d) {
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index e4eb772..dca0ebc 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -3153,10 +3153,10 @@ void avcodec_string(char *buf, int buf_size, 
AVCodecContext *enc, int encode)
 snprintf(buf + strlen(buf), buf_size - strlen(buf),
  ", q=%d-%d", enc->qmin, enc->qmax);
 } else {
-if (enc->properties & FF_CODEC_PROPERTY_CLOSED_CAPTIONS)
+if (enc->properties & AV_CODEC_PROPERTY_CLOSED_CAPTIONS)
 snprintf(buf + strlen(buf), buf_size - strlen(buf),
  ", Closed Captions");
-if (enc->properties & FF_CODEC_PROPERTY_LOSSLESS)
+if (enc->properties & AV_CODEC_PROPERTY_LOSSLESS)
 snprintf(buf + strlen(buf), buf_size - strlen(buf),
  ", lossless");
 }
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 778293a..df0f252 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR  49
+#define LIBAVCODEC_VERSION_MINOR  50
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 5b5ad99..84432f3 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -734,7 +734,7 @@ static int decode_frame_header(AVCodecContext *ctx,
 s->lossless= s->yac_qi == 0 && s->ydc_qdelta == 0 &&
  s->uvdc_qdelta == 0 && s->uvac_qdelta == 0;
 if (s->lossless)
-ctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
+  

[FFmpeg-devel] [PATCH]lavf/rtpenc_jpeg: Warn if number of present quantization tables is not two

2015-07-16 Thread Carl Eugen Hoyos
Hi!

The RFC requires jpeg-over-rtp to provide exactly two quantization 
tables, one for luma, one for chroma.

Please comment, Carl Eugen
diff --git a/libavformat/rtpenc_jpeg.c b/libavformat/rtpenc_jpeg.c
index e6b3177..a6f2b32 100644
--- a/libavformat/rtpenc_jpeg.c
+++ b/libavformat/rtpenc_jpeg.c
@@ -119,6 +119,10 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t 
*buf, int size)
 break;
 }
 }
+if (nb_qtables && nb_qtables != 2)
+av_log(s1, AV_LOG_WARNING,
+   "RFC 2435 suggests two quantization tables, %d provided\n",
+   nb_qtables);
 
 /* skip JPEG header */
 buf  += i;
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Save properties of the decoded stream

2015-07-16 Thread Carl Eugen Hoyos
Carl Eugen Hoyos  ag.or.at> writes:

> Attached patch allows users to know about 
> specific properties of a decoded stream, two 
> examples included.

The patch was merged by Michael, I just sent a 
patch for the renaming of FF_CODEC_PROPERTY_*.

Carl Eugen

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


[FFmpeg-devel] Fwd: Re: libavcodec/qsvdec_h264.c: SPS parsing now performs by MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

2015-07-16 Thread Ivan Uskov
Hi guys!

I'm currently working under extension of QSV support in ffmpeg.
Could please anybody say, are there any serious reasons to use external SPS
parser into the qsv_process_data() of libavcodec/qsvdec_h264.c instead
nice MFXVideoDECODE_DecodeHeader() function? Looks like it is just
rudiment of initial implementation but may be it is really important by some 
reason?
Thank!

This is a forwarded message
From: Hendrik Leppkes 
To: FFmpeg development discussions and patches 
CC: 
Date: Thursday, July 16, 2015, 11:57:25 PM
Subject: [FFmpeg-devel] libavcodec/qsvdec_h264.c: SPS parsing now performs by 
MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

===8<==Original message text===
On Thu, Jul 16, 2015 at 10:02 PM, Ivan Uskov  wrote:
> Hello All,
>
> Current implementation of libavcodec/qsvdec_h264.c does use external
> SPS parser. It does not optimal since MFX library has own unified way
> to parse headers of all supported formats. This performs by one
> MFXVideoDECODE_DecodeHeader() call.
> The suggested patch does replace stream specific code to one universal
> function call located into the libavcodec/qsvdec.c. This opens an easy
> way to implement qsv-accelerated mpeg2, hevc and vc1 decoders.
> Please review.

There was a specific reason this was done this way.
You should definitely inquire with the original author of this code
for the reason of not using the header parser, IIRC it was broken in
some cases.

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

===8<===End of original message text===



-- 
Best regards,
 Ivanmailto:ivan.us...@nablet.com

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


Re: [FFmpeg-devel] [PATCH 1/5] concatdec: add support for specifying inpoint of files

2015-07-16 Thread Michael Niedermayer
On Thu, Jul 16, 2015 at 10:53:28PM +0200, Marton Balint wrote:
> Hello Michael,
> 
> Please merge from my stable branch for the following patches:
> 
> 53f2ef2 mxfdec: calculate the index in display order
> f384132 concatdec: add support for specifying inpoint of files
> 1ea909a concatdec: store eof condition in context
> 52bc064 concatdec: add support for specifying outpoint of files
> bd5e11e concatdec: add support for injecting packet metadata
> 7f6aef8 avformat: bump micro version after adding concatdec features
> 
> The mxf patch was reviewed by Tomas, the other ones are approved by
> Nicolas.

merged with a small typo fix

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

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf


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


Re: [FFmpeg-devel] normalize-audio and video files

2015-07-16 Thread Emanuel Berg
This zsh, using ffmpeg and normalize-audio, seems to
do it. But it is slow. Remember normalize-audio is
lightning fast so time is spent getting and putting
together the audio with the movie. Perhaps it can be
optimized somehow - do tell, if you know...

The file: http://user.it.uu.se/~embe8573/conf/.zsh/audio

The code:

normalize-audio-in-movies () {
local -a movies
local -a songs
local name
local audio
local ext=mp3
movies=($@)
songs=()
for m in $movies; do
get-audio-from-movie $m
name=${m:r}
audio=$name.$ext
songs+=($audio)
done
normalize-audio $songs
for m in $movies; do
name=${m:r}
audio=$name.$ext
put-song-into-movie $audio $m
done
}

put-song-into-movie () {
local song=$1
local movie=$2
local name=${movie:r}
local ext=${movie:e}
ffmpeg -i $song -i $movie ${name}-norm.$ext
}

get-song-from-movie () {
local movie=$1
local name=${movie:r}
local song=$name.mp3
ffmpeg -i $movie $song
}

-- 
underground experts united
http://user.it.uu.se/~embe8573

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


Re: [FFmpeg-devel] libavcodec/qsvdec_h264.c: SPS parsing now performs by MFXVideoDECODE_DecodeHeader() into libavcodec/qsvdec.c

2015-07-16 Thread Michael Niedermayer
On Fri, Jul 17, 2015 at 01:13:41AM +0300, Ivan Uskov wrote:
> Hello Hendrik,
> 
> Ok, no problem. I will ask. But in general it makes no sense. I have
> got enough experience for MXF using and common transcoding developing
> to see that current implementation is not good and dangerous.
> 
> I should to say that actually I see lot minor issues and quite ugly
> code pieces into QSV-related modules.
> I have got big doubts that all that was "by specific reason".
> 
> For example discussed code piece not able to handle a case when decoded
> stream begins from arbitrary place, not from SPS. Decoding fails. It
> is common scenario for MPEG TS decoding.
> Also current code tries to handle dynamic SPS change at bad place (good
> place should be into the qsvdec.c) and by bad way (no fifo flush).
> My patch does not solve these issues but at least I have got clear
> roadmap in mind how to get qsv decoder more reliable and usable.
> It is just question of another patches.

> Should we keep this code which obvious bad?

no, bad code should be replaced by good or improved to become good

also maybe you want to send a patch to add yourself to the
MAINTAINERs file for qsv*

thanks

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

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


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


Re: [FFmpeg-devel] FFmpeg/MPlayer/rtmpdump possibly searching for a new server and hosting

2015-07-16 Thread Michael Niedermayer
On Wed, Jul 15, 2015 at 02:46:39AM +0200, Michael Niedermayer wrote:
> On Tue, Jul 14, 2015 at 11:42:30PM +0100, Kieran Kunhya wrote:
> > OVH has poor quality connectivity by the way - this could lead to
> > performance issues in some countries.
> 
> Has anyone done some hoster connectivity comparissions /tests ?
> it would be interresting to see what the differences are.
> 

> Also which hosters/providers does the community recommand?

noone ?
nothing ?

thats ok but then i hope also noone will complain if we end up
with a poor hoster, because we will likely

I did look a bit around and i was not able to find anything that
made me smarter to make this choice. libnova said they had no
problems with OVH, noone else suggested anything else.
kieran said OVH has poor connectivity, timothys tests dont really
point in any clear direction either

If people would suggest which hosters are good
(quality, hw, service, connectivity, in a legally stable region not
too hostile to free multimedia sw, ...)
then we could suggest these to sponsors in the absence of the sponsor
having a preferrance.


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


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


[FFmpeg-devel] [PATCH 1/5] lavu/bprint: add XML escaping

2015-07-16 Thread Rodger Combs
---
 libavutil/avstring.h |  7 +++
 libavutil/bprint.c   | 30 ++
 2 files changed, 37 insertions(+)

diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index 466edaf..4d809d9 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -290,6 +290,7 @@ enum AVEscapeMode {
 AV_ESCAPE_MODE_AUTO,  ///< Use auto-selected escaping mode.
 AV_ESCAPE_MODE_BACKSLASH, ///< Use backslash escaping.
 AV_ESCAPE_MODE_QUOTE, ///< Use single-quote escaping.
+AV_ESCAPE_MODE_XML,   ///< Use XML ampersand-escaping.
 };
 
 /**
@@ -310,6 +311,12 @@ enum AVEscapeMode {
 #define AV_ESCAPE_FLAG_STRICT 0x02
 
 /**
+ * In addition to the provided list, escape all characters outside the range of
+ * U+0020 to U+007E. This only applies to XML-escaping.
+ */
+#define AV_ESCAPE_FLAG_NON_ASCII 0x04
+
+/**
  * Escape string in src, and put the escaped string in an allocated
  * string in *dst, which must be freed with av_free().
  *
diff --git a/libavutil/bprint.c b/libavutil/bprint.c
index 0a0d078..64d2ab1 100644
--- a/libavutil/bprint.c
+++ b/libavutil/bprint.c
@@ -261,6 +261,7 @@ int av_bprint_finalize(AVBPrint *buf, char **ret_str)
 }
 
 #define WHITESPACES " \n\t"
+#define XML_ESCAPES "&<>\"'"
 
 void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char 
*special_chars,
   enum AVEscapeMode mode, int flags)
@@ -271,6 +272,35 @@ void av_bprint_escape(AVBPrint *dstbuf, const char *src, 
const char *special_cha
 mode = AV_ESCAPE_MODE_BACKSLASH; /* TODO: implement a heuristic */
 
 switch (mode) {
+case AV_ESCAPE_MODE_XML:
+/* &;-escape characters */
+if (!special_chars)
+special_chars = XML_ESCAPES;
+
+while (*src) {
+uint8_t tmp;
+uint32_t cp;
+GET_UTF8(cp, (uint8_t)*src++, goto err;);
+
+if ((cp < 0xFF && strchr(special_chars, cp)) ||
+((flags & AV_ESCAPE_FLAG_NON_ASCII) && (cp < 0x20 || cp > 
0x7e))) {
+switch (cp) {
+case '&' : av_bprintf(dstbuf, "&");  break;
+case '<' : av_bprintf(dstbuf, "<");   break;
+case '>' : av_bprintf(dstbuf, ">");   break;
+case '"' : av_bprintf(dstbuf, """); break;
+case '\'': av_bprintf(dstbuf, "'"); break;
+default:   av_bprintf(dstbuf, "&#%"PRIu32";", cp); break;
+}
+} else {
+PUT_UTF8(cp, tmp, av_bprint_chars(dstbuf, tmp, 1);)
+}
+continue;
+err:
+av_bprint_chars(dstbuf, '?', 1);
+}
+break;
+
 case AV_ESCAPE_MODE_QUOTE:
 /* enclose the string between '' */
 av_bprint_chars(dstbuf, '\'', 1);
-- 
2.4.1

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


[FFmpeg-devel] [PATCH 2/5] lavu/bprint: add XML escape convenience function

2015-07-16 Thread Rodger Combs
---
 libavutil/bprint.c | 7 +++
 libavutil/bprint.h | 9 +
 2 files changed, 16 insertions(+)

diff --git a/libavutil/bprint.c b/libavutil/bprint.c
index 64d2ab1..746868b 100644
--- a/libavutil/bprint.c
+++ b/libavutil/bprint.c
@@ -334,6 +334,13 @@ void av_bprint_escape(AVBPrint *dstbuf, const char *src, 
const char *special_cha
 }
 }
 
+const char *av_xml_escape_str(AVBPrint *dst, const char *src)
+{
+av_bprint_clear(dst);
+av_bprint_escape(dst, src, NULL, AV_ESCAPE_MODE_XML, 0);
+return dst->str;
+}
+
 #ifdef TEST
 
 #undef printf
diff --git a/libavutil/bprint.h b/libavutil/bprint.h
index c09b1ac..006fa8c 100644
--- a/libavutil/bprint.h
+++ b/libavutil/bprint.h
@@ -216,4 +216,13 @@ int av_bprint_finalize(AVBPrint *buf, char **ret_str);
 void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char 
*special_chars,
   enum AVEscapeMode mode, int flags);
 
+/**
+ * Clear the contents of dst, use it to XML-escape a string, and return the 
result.
+ * This is a convenience function that escapes only the default XML special 
characters.
+ *
+ * @param dst   already inited destination bprint buffer
+ * @param src   string containing the text to escape
+ */
+const char *av_xml_escape_str(AVBPrint *dst, const char *src);
+
 #endif /* AVUTIL_BPRINT_H */
-- 
2.4.1

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


[FFmpeg-devel] [PATCH 4/5] ffprobe: switch from static function to av_xml_escape_str

2015-07-16 Thread Rodger Combs
---
 ffprobe.c | 25 +++--
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index 3e5324e..cc7c9b9 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1543,24 +1543,6 @@ static av_cold int xml_init(WriterContext *wctx)
 return 0;
 }
 
-static const char *xml_escape_str(AVBPrint *dst, const char *src, void 
*log_ctx)
-{
-const char *p;
-
-for (p = src; *p; p++) {
-switch (*p) {
-case '&' : av_bprintf(dst, "%s", "&");  break;
-case '<' : av_bprintf(dst, "%s", "<");   break;
-case '>' : av_bprintf(dst, "%s", ">");   break;
-case '"' : av_bprintf(dst, "%s", """); break;
-case '\'': av_bprintf(dst, "%s", "'"); break;
-default: av_bprint_chars(dst, *p, 1);
-}
-}
-
-return dst->str;
-}
-
 #define XML_INDENT() printf("%*c", xml->indent_level * 4, ' ')
 
 static void xml_print_section_header(WriterContext *wctx)
@@ -1633,13 +1615,12 @@ static void xml_print_str(WriterContext *wctx, const 
char *key, const char *valu
 if (section->flags & SECTION_FLAG_HAS_VARIABLE_FIELDS) {
 XML_INDENT();
 printf("<%s key=\"%s\"",
-   section->element_name, xml_escape_str(&buf, key, wctx));
-av_bprint_clear(&buf);
-printf(" value=\"%s\"/>\n", xml_escape_str(&buf, value, wctx));
+   section->element_name, av_xml_escape_str(&buf, key));
+printf(" value=\"%s\"/>\n", av_xml_escape_str(&buf, value));
 } else {
 if (wctx->nb_item[wctx->level])
 printf(" ");
-printf("%s=\"%s\"", key, xml_escape_str(&buf, value, wctx));
+printf("%s=\"%s\"", key, av_xml_escape_str(&buf, value));
 }
 
 av_bprint_finalize(&buf, NULL);
-- 
2.4.1

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


[FFmpeg-devel] [PATCH 3/5] lavu: bump version for XML escaping

2015-07-16 Thread Rodger Combs
---
 libavutil/version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/version.h b/libavutil/version.h
index e7155c2..4799250 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,7 +56,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  54
-#define LIBAVUTIL_VERSION_MINOR  28
+#define LIBAVUTIL_VERSION_MINOR  29
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
2.4.1

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


[FFmpeg-devel] [PATCH 5/5] lavc/webvttenc: XML-escape text output

2015-07-16 Thread Rodger Combs
---
 libavcodec/webvttenc.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c
index 9f67a2e..555e7c7 100644
--- a/libavcodec/webvttenc.c
+++ b/libavcodec/webvttenc.c
@@ -112,7 +112,12 @@ static void webvtt_style_apply(WebVTTContext *s, const 
char *style)
 static void webvtt_text_cb(void *priv, const char *text, int len)
 {
 WebVTTContext *s = priv;
-av_bprint_append_data(&s->buffer, text, len);
+char *buf = av_strndup(text, len);
+if (!buf)
+return;
+
+av_bprint_escape(&s->buffer, buf, NULL, AV_ESCAPE_MODE_XML, 0);
+av_free(buf);
 }
 
 static void webvtt_new_line_cb(void *priv, int forced)
-- 
2.4.1

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


Re: [FFmpeg-devel] normalize-audio and video files

2015-07-16 Thread James Darnley
On 2015-07-17 02:01, Emanuel Berg wrote:
> This zsh, using ffmpeg and normalize-audio, seems to
> do it. But it is slow. Remember normalize-audio is
> lightning fast so time is spent getting and putting
> together the audio with the movie. Perhaps it can be
> optimized somehow - do tell, if you know...

> ffmpeg -i $song -i $movie ${name}-norm.$ext

> ffmpeg -i $movie $song

If these are too slow for you try not encoding everything every time you
run ffmpeg.  You want to look at using "copy" as the codec.

Also, this is a user question.



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


Re: [FFmpeg-devel] [PATCH] avfilter: add convolution filter

2015-07-16 Thread Michael Niedermayer
On Wed, Jul 15, 2015 at 07:48:52PM +, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
[...]
> +static void filter_3x3(ConvolutionContext *s, AVFrame *in, AVFrame *out, int 
> plane)
> +{
> +const uint8_t *src = in->data[plane];
> +uint8_t *dst = out->data[plane];
> +const int stride = in->linesize[plane];
> +const int bstride = s->bstride;
> +const int height = s->planeheight[plane];
> +const int width  = s->planewidth[plane];
> +uint8_t *p0 = s->buffer + 16;
> +uint8_t *p1 = p0 + bstride;
> +uint8_t *p2 = p1 + bstride;
> +uint8_t *orig = p0, *end = p2;
> +const int *matrix = s->matrix[plane];
> +const float rdiv = s->rdiv;
> +const float bias = s->bias;
> +int y, x;
> +
> +line_copy8(p0, src + stride, width, 1);
> +line_copy8(p1, src, width, 1);
> +
> +for (y = 0; y < height; y++) {
> +src += stride * (y < height - 1 ? 1 : -1);
> +line_copy8(p2, src, width, 1);
> +
> +for (x = 0; x < width; x++) {
> +int sum = p0[x - 1] * matrix[0] +
> +  p0[x] * matrix[1] +
> +  p0[x + 1] * matrix[2] +
> +  p1[x - 1] * matrix[3] +
> +  p1[x] * matrix[4] +
> +  p1[x + 1] * matrix[5] +
> +  p2[x - 1] * matrix[6] +
> +  p2[x] * matrix[7] +
> +  p2[x + 1] * matrix[8];
> +sum = (int)(sum * rdiv + bias + 0.5f);

> +dst[x] = av_clip(sum, 0, 255);

could use av_clip_uint8()

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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


[FFmpeg-devel] [PATCH] [RFC] doc: add a section about async protocol

2015-07-16 Thread Zhang Rui
---
 doc/protocols.texi | 12 
 1 file changed, 12 insertions(+)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 453dbcf..f152f5a 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -19,6 +19,18 @@ supported protocols.
 
 A description of the currently available protocols follows.
 
+@section async
+
+Asynchronous data filling wrapper for input stream.
+
+Fill data in a background thread, to decouple I/O operation from demux thread.
+
+@example
+async:@var{URL}
+async:http://host/resource
+async:cache:http://host/resource
+@end example
+
 @section bluray
 
 Read BluRay playlist.
-- 
2.0.0

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


Re: [FFmpeg-devel] [PATCH] [RFC] avformat/async: support filling with a background thread.

2015-07-16 Thread Zhang Rui
2015-07-16 22:00 GMT+08:00 Michael Niedermayer :
> On Thu, Jul 16, 2015 at 03:04:42PM +0800, Zhang Rui wrote:
>> ---
>>  configure|   1 +
>>  libavformat/Makefile |   1 +
>>  libavformat/allformats.c |   1 +
>>  libavformat/async.c  | 380 
>> +++
>>  4 files changed, 383 insertions(+)
>>  create mode 100644 libavformat/async.c
>
> please add some information about this and an example to the docs

OK

> a fate test also could be added

fate rsync is a little slow from my home network, I'll add one in a week or two.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Raise max channels to 64

2015-07-16 Thread Carl Eugen Hoyos
Carl Eugen Hoyos  ag.or.at> writes:

> A user claims that attached patch helps him 
> with a 64-channel software input device on 
> avfoundation that does not work with current 
> git head.

The patch was merged by Michael.

Thank you, Carl Eugen

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