Re: [FFmpeg-devel] [PATCH] libavfilter/af_ambisonic.c Added File for Ambisonic Filter

2017-08-15 Thread Paul B Mahol
Hi,

subject of patch file is wrong.

Why is code for rotation so limited? One should be able to rotate by
all 3 directions at once.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] swresample/resample: Fix flush refelction length

2017-08-15 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libswresample/resample.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 39c242bf41..df49505bf9 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -544,18 +544,21 @@ static int64_t get_out_samples(struct SwrContext *s, int 
in_samples) {
 }
 
 static int resample_flush(struct SwrContext *s) {
+ResampleContext *c = s->resample;
 AudioData *a= &s->in_buffer;
 int i, j, ret;
-if((ret = swri_realloc_audio(a, s->in_buffer_index + 
2*s->in_buffer_count)) < 0)
+int reflection = (FFMIN(s->in_buffer_count, c->filter_length) + 1) / 2;
+
+if((ret = swri_realloc_audio(a, s->in_buffer_index + s->in_buffer_count + 
reflection)) < 0)
 return ret;
 av_assert0(a->planar);
 for(i=0; ich_count; i++){
-for(j=0; jin_buffer_count; j++){
+for(j=0; jch[i] + (s->in_buffer_index+s->in_buffer_count+j  
)*a->bps,
 a->ch[i] + (s->in_buffer_index+s->in_buffer_count-j-1)*a->bps, 
a->bps);
 }
 }
-s->in_buffer_count += (s->in_buffer_count+1)/2;
+s->in_buffer_count += reflection;
 return 0;
 }
 
-- 
2.14.1

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


[FFmpeg-devel] Need consultant for converting 'Nielsen watermarks' to ID3 tags in HLS

2017-08-15 Thread Pat Ransil
We have a working system that takes broadcast TV video from an antenna and
outputs HLS. Some streams have Nielsen watermarks in audio (left and half
of center). We are looking for a consultant who has experience working with
the Nielsen Transcoder SDK
,
extracting the watermarks and inserting ID3 tags into an HLS stream.

Nielsen has provided us with the Transcoder SDK, test streams and analysis
software. Once we are satisfied with our testing, it will take Nielsen
about a week to certify compliance, if no bugs are found.

There may be a follow-on job optimizing our current system. It works, but
could probably be improved.

We would like to get started sometime in the next few weeks and prefer
someone located in the US. We are in California, near San Francisco.

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


[FFmpeg-devel] [PATCH] Improved EXT-X-TARGETDURATION generation

2017-08-15 Thread Artem Skoretskiy
It improves EXT-X-TARGETDURATION when some chunk duration is bigger than 
requested -hls_time N

In the current implementation, it is ceiling the value (if float part is bigger 
than 0.001) but it should be rounded. Specification 
​https://tools.ietf.org/html/draft-pantos-http-live-streaming-22#page-49 allows 
both implementation, but rounding is more precise and better matches user needs 
(especially having in mind that HLS segmenter could generate slightly longer 
than requested).

See conversation https://trac.ffmpeg.org/ticket/6533
---
 libavformat/hlsenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 74a3249b73..1c36ae4a12 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1038,8 +1038,8 @@ static int hls_window(AVFormatContext *s, int last)
 goto fail;
 
 for (en = hls->segments; en; en = en->next) {
-if (target_duration <= en->duration)
-target_duration = get_int_from_double(en->duration);
+if (target_duration < en->duration)
+target_duration = (int)round(en->duration);
 }
 
 hls->discontinuity_set = 0;
-- 
2.11.0 (Apple Git-81)

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


Re: [FFmpeg-devel] [PATCH] libavfilter/af_ambisonic.c Added File for Ambisonic Filter

2017-08-15 Thread Sanchit Sinha
On Tue, Aug 15, 2017 at 4:46 PM, Paul B Mahol  wrote:

> Hi,
>
> subject of patch file is wrong.
>
> Why is code for rotation so limited? One should be able to rotate by
> all 3 directions at once.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>



-- 
Sanchit Sinha
B.Tech- CSE
IIIT-Delhi
Roll-2015083
https://sinhaaftersanchit.com/
From c802c29bd9d6b141cf0d273d480f00fef97d617f Mon Sep 17 00:00:00 2001
From: Sanchit Sinha 
Date: Tue, 15 Aug 2017 23:55:44 +0530
Subject: [PATCH] libavfilter/af_ambisonic.c:Added File for Ambisonic Decoding

Signed-off-by: Sanchit Sinha 
---
 Changelog  |   1 +
 libavfilter/Makefile   |   1 +
 libavfilter/af_ambisonic.c | 732 +
 libavfilter/allfilters.c   |   1 +
 4 files changed, 735 insertions(+)
 create mode 100644 libavfilter/af_ambisonic.c

diff --git a/Changelog b/Changelog
index c797d68..e09c48b 100644
--- a/Changelog
+++ b/Changelog
@@ -32,6 +32,7 @@ version :
 - unpremultiply video filter
 - tlut2 video filter
 - floodfill video filter
+- Ambisonic Decoder
 
 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 06b915f..c1ca5ea 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -45,6 +45,7 @@ OBJS-$(CONFIG_AINTERLEAVE_FILTER)+= f_interleave.o
 OBJS-$(CONFIG_ALIMITER_FILTER)   += af_alimiter.o
 OBJS-$(CONFIG_ALLPASS_FILTER)+= af_biquads.o
 OBJS-$(CONFIG_ALOOP_FILTER)  += f_loop.o
+OBJS-$(CONFIG_AMBISONIC_FILTER)  += af_ambisonic.o
 OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o
 OBJS-$(CONFIG_AMETADATA_FILTER)  += f_metadata.o
 OBJS-$(CONFIG_AMIX_FILTER)   += af_amix.o
diff --git a/libavfilter/af_ambisonic.c b/libavfilter/af_ambisonic.c
new file mode 100644
index 000..3097268
--- /dev/null
+++ b/libavfilter/af_ambisonic.c
@@ -0,0 +1,732 @@
+/*
+ * Copyright (c) 2017 Sanchit Sinha
+ * 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/channel_layout.h"
+#include "libavutil/opt.h"
+#include "libavutil/avassert.h"
+#include "audio.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include 
+#include 
+
+enum FilterType {
+shelf,
+nearfield
+};
+
+enum InputFormat {
+  N3D,
+  SN3D   ,
+  FURMUL
+};
+
+enum Rotate {
+TILT  ,
+TUMBLE,
+YAW
+};
+
+enum Layouts {
+MONO,
+STEREO  ,
+TRIANGLE,
+SQUARE  ,
+PENTAGON,
+HEXAGON ,
+HEPTAGON,
+OCTAGON ,
+TETRAHEDRON ,
+OCTAHEDRON  ,
+CUBE,
+DODECAHEDRON,
+ICOSAHEDRON
+};
+
+typedef struct Cache {
+double i1, i2;
+double o1, o2;
+} Cache;
+
+/*Decoding matrix for 1st order files. Similar can be done for 2nd, 3rd etc*/
+static const struct {
+  int speakers;
+float matrix[22][15];
+} ambisonic_matrix[]= {
+[MONO]={
+  .speakers=1,
+.matrix={
+{0.22156, 0, 0, 0},
+},
+},
+[TRIANGLE]={
+  .speakers=3,
+.matrix={
+{0.17836, 0.32555, 0.18795, 0},
+{0.17836, 0  ,-0.37591, 0},
+{0.17836,-0.32555, 0.18795, 0},
+},
+},
+[SQUARE]={
+  .speakers=4,
+.matrix={
+{0.39388, 0.18690, 0.18690, 0},
+{0.39388,-0.18690, 0.18690, 0},
+{0.39388,-0.18690,-0.18690, 0},
+{0.39388, 0.18690,-0.18690, 0},
+},
+},
+[PENTAGON]={
+  .speakers=5,
+.matrix={
+{0.20195, 0  , 0.33420, 0},
+{0.11356, 0.2901 , 0.04186, 0},
+{0.19654,-0.07993,-0.34782, 0},
+{0.19654, 0.07993,-0.34782, 0},
+{0.19654,-0.2901 , 0.04186, 0},
+},
+},
+[HEXAGON]={
+  .speakers=6,
+.matrix={
+{0.26259, 0  ,  0.31326, 0},
+{0.26259, 0.27129,  0.15663, 0},
+{0.26259, 0.27129, -0.15663, 0},
+{0.26259, 0  , -0.31326, 0},
+{0.26259,-0.27129, -0.15663, 0},
+{0.26259,-0.27129,  0.15663,

Re: [FFmpeg-devel] [PATCH] mpegtsenc add synchronous metadata - retry

2017-08-15 Thread Moritz Barsnick
On Wed, Aug 02, 2017 at 10:40:48 +0200, Mark Timmerman wrote:
> +} else if (st->codecpar->codec_id ==
> AV_CODEC_ID_SYNCHRONOUS_METADATA) {

Again, your patch is corrupted by newlines. Please use git send-email
(preferred), or use git format-patch to create a patch to attach.

Otherwise, chances for a review are low.

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


[FFmpeg-devel] [PATCH] Fix memory leak when reading DDTS box.

2017-08-15 Thread Nikolas Bowe
---
 libavformat/mov.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 63f84be782..c02caf6719 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -889,6 +889,7 @@ static int mov_read_ddts(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 init_get_bits(&gb, buf, 8*ddts_size);
 
 if (c->fc->nb_streams < 1) {
+av_free(buf);
 return 0;
 }
 st = c->fc->streams[c->fc->nb_streams-1];
@@ -896,6 +897,7 @@ static int mov_read_ddts(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 st->codecpar->sample_rate = get_bits_long(&gb, 32);
 if (st->codecpar->sample_rate <= 0) {
 av_log(c->fc, AV_LOG_ERROR, "Invalid sample rate %d\n", 
st->codecpar->sample_rate);
+av_free(buf);
 return AVERROR_INVALIDDATA;
 }
 skip_bits_long(&gb, 32); /* max bitrate */
@@ -923,6 +925,7 @@ static int mov_read_ddts(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 ((channel_layout_code & 0x8) ? AV_CH_LOW_FREQUENCY : 0);
 
 st->codecpar->channels = 
av_get_channel_layout_nb_channels(st->codecpar->channel_layout);
+av_free(buf);
 
 return 0;
 }
-- 
2.14.1.480.gb18f417b89-goog

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


Re: [FFmpeg-devel] [WIP] libcodec2 wrapper + de/muxer in FFmpeg

2017-08-15 Thread Moritz Barsnick
On Tue, Aug 08, 2017 at 23:49:45 +0200, Tomas Härdin wrote:
> Feel free to comment

Don't forget to mention #1959 in the commit message.

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


[FFmpeg-devel] [PATCH] avfilter/vf_transpose: rewrite for x86 SIMD

2017-08-15 Thread Paul B Mahol
Hi,

patch attached.


0001-avfilter-vf_transpose-rewrite-for-x86-SIMD.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_transpose: rewrite for x86 SIMD

2017-08-15 Thread Rostislav Pehlivanov
On 15 August 2017 at 21:25, Paul B Mahol  wrote:

> Hi,
>
> patch attached.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
LGTM, avoids branches
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] swresample/resample: Fix flush refelction length

2017-08-15 Thread Rostislav Pehlivanov
On 15 August 2017 at 16:17, Michael Niedermayer 
wrote:

> Signed-off-by: Michael Niedermayer 
> ---
>  libswresample/resample.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/libswresample/resample.c b/libswresample/resample.c
> index 39c242bf41..df49505bf9 100644
> --- a/libswresample/resample.c
> +++ b/libswresample/resample.c
> @@ -544,18 +544,21 @@ static int64_t get_out_samples(struct SwrContext *s,
> int in_samples) {
>  }
>
>  static int resample_flush(struct SwrContext *s) {
> +ResampleContext *c = s->resample;
>  AudioData *a= &s->in_buffer;
>  int i, j, ret;
> -if((ret = swri_realloc_audio(a, s->in_buffer_index +
> 2*s->in_buffer_count)) < 0)
> +int reflection = (FFMIN(s->in_buffer_count, c->filter_length) + 1) /
> 2;
> +
> +if((ret = swri_realloc_audio(a, s->in_buffer_index +
> s->in_buffer_count + reflection)) < 0)
>  return ret;
>  av_assert0(a->planar);
>  for(i=0; ich_count; i++){
> -for(j=0; jin_buffer_count; j++){
> +for(j=0; j  memcpy(a->ch[i] + (s->in_buffer_index+s->in_buffer_count+j
> )*a->bps,
>  a->ch[i] + 
> (s->in_buffer_index+s->in_buffer_count-j-1)*a->bps,
> a->bps);
>  }
>  }
> -s->in_buffer_count += (s->in_buffer_count+1)/2;
> +s->in_buffer_count += reflection;
>  return 0;
>  }
>
> --
> 2.14.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

LGTM, patch tested

Thanks, I'll send a patch to have a FATE test for this.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] JPEG200 encoding : added option for changing default codeblock size

2017-08-15 Thread Moritz Barsnick
On Mon, Aug 07, 2017 at 10:26:21 +0200, france...@bltitalia.com wrote:
> Subject: [FFmpeg-devel] [PATCH] JPEG200 encoding : added option for changing 
> default codeblock size

Is this your commit message? It's 2000, not 200. ;-) Actually, this
should read:
libavcodec/j2kenc: add option for changing codeblock size

> +i = codsty->log2_cblk_width + codsty->log2_cblk_height -4;
> +if ( i > 12 )
> +{
> +  av_log(avctx, AV_LOG_ERROR, "Invalid values for codeblocks size\n");
> +  return -1;
> +}

Bracket placement, indentation and whitespace all do not correspond to
ffmpeg style.

Apart from that: Isn't that a quite complicated way of saying
if (codsty->log2_cblk_width + codsty->log2_cblk_height > 16)
??

> +{ "log2_cblk_width",   "Codeblock Width",   
> OFFSET(codsty.log2_cblk_width),AV_OPT_TYPE_INT,   { .i64 = 4   }, 
> 0, 1<<10,   VE, },
> +{ "log2_cblk_height",  "Codeblock Height",  
> OFFSET(codsty.log2_cblk_height),   AV_OPT_TYPE_INT,   { .i64 = 4   }, 
> 0, 1<<10,   VE, },

I would suggest to drop the capital letters in the option descriptions,
but it appears to follow the style of the other options, so fine by me.

And what's with the upper limits? They don't seem sane. If you choose
either option at one of those limits, the check above will fail
(1<<10 + 0 - 4 is wy larger than 12).

Looking at the spec, you are mixing exponent and value. I read
"Dimension of the code-blocks is always a power of 2 with the minimum
height and width being 4 and and maximum height and width being 1024."
Furthermore the sum of the exponents needs to be less than or equal to
12.

So, the variable being log2, the limits are obviously 2 and 10, the
default 4 (as before). And your check actually needs to read
if (codsty->log2_cblk_width + codsty->log2_cblk_height > 12)
.

Or am I missing something?


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


Re: [FFmpeg-devel] [PATCH] fate: add overlay filter tests with alpha

2017-08-15 Thread Michael Niedermayer
On Sun, Aug 13, 2017 at 10:00:04PM +0200, Marton Balint wrote:
> Signed-off-by: Marton Balint 
> ---
>  tests/fate/filter-video.mak   | 19 +++
>  tests/ref/fate/filter-overlay_gbrap_gbrap |  6 ++
>  tests/ref/fate/filter-overlay_gbrp_gbrap  |  6 ++
>  tests/ref/fate/filter-overlay_rgb_rgba|  6 ++
>  tests/ref/fate/filter-overlay_rgba_rgba   |  6 ++
>  tests/ref/fate/filter-overlay_yuv420_yuva420  |  6 ++
>  tests/ref/fate/filter-overlay_yuv422_yuva422  |  6 ++
>  tests/ref/fate/filter-overlay_yuv444_yuva444  |  6 ++
>  tests/ref/fate/filter-overlay_yuva420_yuva420 |  6 ++
>  tests/ref/fate/filter-overlay_yuva422_yuva422 |  6 ++
>  tests/ref/fate/filter-overlay_yuva444_yuva444 |  6 ++
>  11 files changed, 79 insertions(+)
>  create mode 100644 tests/ref/fate/filter-overlay_gbrap_gbrap
>  create mode 100644 tests/ref/fate/filter-overlay_gbrp_gbrap
>  create mode 100644 tests/ref/fate/filter-overlay_rgb_rgba
>  create mode 100644 tests/ref/fate/filter-overlay_rgba_rgba
>  create mode 100644 tests/ref/fate/filter-overlay_yuv420_yuva420
>  create mode 100644 tests/ref/fate/filter-overlay_yuv422_yuva422
>  create mode 100644 tests/ref/fate/filter-overlay_yuv444_yuva444
>  create mode 100644 tests/ref/fate/filter-overlay_yuva420_yuva420
>  create mode 100644 tests/ref/fate/filter-overlay_yuva422_yuva422
>  create mode 100644 tests/ref/fate/filter-overlay_yuva444_yuva444

fails on arm & mips qemu

make -j12 -k `make fate-list | grep overlay`
TESTfilter-overlay
COPYtests/data/filtergraphs/overlay-dvdsub-2397
TESTfilter-overlay_gbrap_gbrap
TESTfilter-overlay_gbrp_gbrap
COPYtests/data/filtergraphs/overlay_nv12
COPYtests/data/filtergraphs/overlay_nv21
COPYtests/data/filtergraphs/overlay_rgb
TESTfilter-overlay_rgb_rgba
TESTfilter-overlay_rgba_rgba
COPYtests/data/filtergraphs/overlay_yuv420
TESTfilter-overlay_yuv420_yuva420
TESTfilter-overlay_yuv422_yuva422
COPYtests/data/filtergraphs/overlay_yuv422
COPYtests/data/filtergraphs/overlay_yuv444
TESTfilter-overlay_yuv444_yuva444
TESTfilter-overlay_yuva420_yuva420
TESTfilter-overlay_yuva422_yuva422
TESTfilter-overlay_yuva444_yuva444
TESTfilter-overlay-dvdsub-2397
TESTfilter-overlay_nv12
TESTfilter-overlay_nv21
TESTfilter-overlay_rgb
TESTfilter-overlay_yuv420
TESTfilter-overlay_yuv422
--- tests/ref/fate/filter-overlay_yuv420_yuva4202017-08-15 
23:26:52.967463242 +0200
+++ tests/data/fate/filter-overlay_yuv420_yuva420   2017-08-16 
00:07:12.303514211 +0200
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 128x128
 #sar 0: 1/1
-0,  0,  0,1,24576, 0xedb7ef1c
+0,  0,  0,1,24576, 0x1505f000
TESTfilter-overlay_yuv444
Test filter-overlay_yuv420_yuva420 failed. Look at 
tests/data/fate/filter-overlay_yuv420_yuva420.err for details.
--- tests/ref/fate/filter-overlay_yuva420_yuva420   2017-08-15 
23:26:52.967463242 +0200
+++ tests/data/fate/filter-overlay_yuva420_yuva420  2017-08-16 
00:07:12.307514211 +0200
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 128x128
 #sar 0: 1/1
-0,  0,  0,1,40960, 0xdf75b2dc
+0,  0,  0,1,40960, 0x0a1ab3c0
make: *** [fate-filter-overlay_yuv420_yuva420] Error 1
Test filter-overlay_yuva420_yuva420 failed. Look at 
tests/data/fate/filter-overlay_yuva420_yuva420.err for details.
make: *** [fate-filter-overlay_yuva420_yuva420] Error 1

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

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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


Re: [FFmpeg-devel] [PATCH] swresample/resample: Fix flush refelction length

2017-08-15 Thread Michael Niedermayer
On Tue, Aug 15, 2017 at 09:45:47PM +0100, Rostislav Pehlivanov wrote:
> On 15 August 2017 at 16:17, Michael Niedermayer 
> wrote:
> 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libswresample/resample.c | 9 ++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/libswresample/resample.c b/libswresample/resample.c
> > index 39c242bf41..df49505bf9 100644
> > --- a/libswresample/resample.c
> > +++ b/libswresample/resample.c
> > @@ -544,18 +544,21 @@ static int64_t get_out_samples(struct SwrContext *s,
> > int in_samples) {
> >  }
> >
> >  static int resample_flush(struct SwrContext *s) {
> > +ResampleContext *c = s->resample;
> >  AudioData *a= &s->in_buffer;
> >  int i, j, ret;
> > -if((ret = swri_realloc_audio(a, s->in_buffer_index +
> > 2*s->in_buffer_count)) < 0)
> > +int reflection = (FFMIN(s->in_buffer_count, c->filter_length) + 1) /
> > 2;
> > +
> > +if((ret = swri_realloc_audio(a, s->in_buffer_index +
> > s->in_buffer_count + reflection)) < 0)
> >  return ret;
> >  av_assert0(a->planar);
> >  for(i=0; ich_count; i++){
> > -for(j=0; jin_buffer_count; j++){
> > +for(j=0; j >  memcpy(a->ch[i] + (s->in_buffer_index+s->in_buffer_count+j
> > )*a->bps,
> >  a->ch[i] + 
> > (s->in_buffer_index+s->in_buffer_count-j-1)*a->bps,
> > a->bps);
> >  }
> >  }
> > -s->in_buffer_count += (s->in_buffer_count+1)/2;
> > +s->in_buffer_count += reflection;
> >  return 0;
> >  }
> >
> > --
> > 2.14.1
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> LGTM, patch tested

will apply


> 
> Thanks, I'll send a patch to have a FATE test for this.

thanks

[...]
-- 
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] fate: add overlay filter tests with alpha

2017-08-15 Thread Marton Balint


On Wed, 16 Aug 2017, Michael Niedermayer wrote:


On Sun, Aug 13, 2017 at 10:00:04PM +0200, Marton Balint wrote:

Signed-off-by: Marton Balint 
---
 tests/fate/filter-video.mak   | 19 +++
 tests/ref/fate/filter-overlay_gbrap_gbrap |  6 ++
 tests/ref/fate/filter-overlay_gbrp_gbrap  |  6 ++
 tests/ref/fate/filter-overlay_rgb_rgba|  6 ++
 tests/ref/fate/filter-overlay_rgba_rgba   |  6 ++
 tests/ref/fate/filter-overlay_yuv420_yuva420  |  6 ++
 tests/ref/fate/filter-overlay_yuv422_yuva422  |  6 ++
 tests/ref/fate/filter-overlay_yuv444_yuva444  |  6 ++
 tests/ref/fate/filter-overlay_yuva420_yuva420 |  6 ++
 tests/ref/fate/filter-overlay_yuva422_yuva422 |  6 ++
 tests/ref/fate/filter-overlay_yuva444_yuva444 |  6 ++
 11 files changed, 79 insertions(+)
 create mode 100644 tests/ref/fate/filter-overlay_gbrap_gbrap
 create mode 100644 tests/ref/fate/filter-overlay_gbrp_gbrap
 create mode 100644 tests/ref/fate/filter-overlay_rgb_rgba
 create mode 100644 tests/ref/fate/filter-overlay_rgba_rgba
 create mode 100644 tests/ref/fate/filter-overlay_yuv420_yuva420
 create mode 100644 tests/ref/fate/filter-overlay_yuv422_yuva422
 create mode 100644 tests/ref/fate/filter-overlay_yuv444_yuva444
 create mode 100644 tests/ref/fate/filter-overlay_yuva420_yuva420
 create mode 100644 tests/ref/fate/filter-overlay_yuva422_yuva422
 create mode 100644 tests/ref/fate/filter-overlay_yuva444_yuva444


fails on arm & mips qemu


If you add -sws_flags +accurate_rnd+bitexact to the framecrc command does 
that help?


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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_transpose: rewrite for x86 SIMD

2017-08-15 Thread James Almer
On 8/15/2017 5:25 PM, Paul B Mahol wrote:
> From f25f0022fbc675affd65b95f097fa62e55788a37 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol 
> Date: Tue, 15 Aug 2017 20:12:32 +0200
> Subject: [PATCH] avfilter/vf_transpose: rewrite for x86 SIMD
> 
> Transpose first in chunks of 8x8 blocks.
> 15% faster overall.
> ---
>  libavfilter/vf_transpose.c | 184 
> +++--
>  1 file changed, 143 insertions(+), 41 deletions(-)
> 
> diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c
> index 75b4dda41f..2fa751c925 100644
> --- a/libavfilter/vf_transpose.c
> +++ b/libavfilter/vf_transpose.c
> @@ -58,6 +58,12 @@ typedef struct TransContext {
>  
>  int passthrough;///< PassthroughType, landscape passthrough mode 
> enabled
>  int dir;///< TransposeDir
> +
> +void (*transpose_8x8)(uint8_t *src, ptrdiff_t src_linesize,
> +  uint8_t *dst, ptrdiff_t dst_linesize);
> +void (*transpose_block)(uint8_t *src, ptrdiff_t src_linesize,
> +uint8_t *dst, ptrdiff_t dst_linesize,
> +int w, int h);
>  } TransContext;
>  
>  static int query_formats(AVFilterContext *ctx)
> @@ -79,6 +85,109 @@ static int query_formats(AVFilterContext *ctx)
>  return ff_set_common_formats(ctx, pix_fmts);
>  }
>  
> +static av_always_inline void transpose_block_8_c(uint8_t *src, ptrdiff_t 
> src_linesize,

Is always_inline needed? Shouldn't inline be enough for the 8x8 functions?

> + uint8_t *dst, ptrdiff_t 
> dst_linesize,
> + int w, int h)
> +{
> +int x, y;
> +for (y = 0; y < h; y++, dst += dst_linesize, src++)
> +for (x = 0; x < w; x++)
> +dst[x] = src[x*src_linesize];
> +}
> +
> +static void transpose_8x8_8_c(uint8_t *src, ptrdiff_t src_linesize,
> +  uint8_t *dst, ptrdiff_t dst_linesize)
> +{
> +transpose_block_8_c(src, src_linesize, dst, dst_linesize, 8, 8);
> +}
> +
> +static av_always_inline void transpose_block_16_c(uint8_t *src, ptrdiff_t 
> src_linesize,
> +  uint8_t *dst, ptrdiff_t 
> dst_linesize,
> +  int w, int h)
> +{
> +int x, y;
> +for (y = 0; y < h; y++, dst += dst_linesize, src += 2)
> +for (x = 0; x < w; x++)
> +*((uint16_t *)(dst + 2*x)) = *((uint16_t *)(src + 
> x*src_linesize));

Use local uint16_t* pointers instead of casting inside the loop. It will
probably make no difference for compilers but it helps readability.

Same for the cases below.

> +}
> +
> +static void transpose_8x8_16_c(uint8_t *src, ptrdiff_t src_linesize,
> +   uint8_t *dst, ptrdiff_t dst_linesize)
> +{
> +transpose_block_16_c(src, src_linesize, dst, dst_linesize, 8, 8);
> +}
> +
> +static av_always_inline void transpose_block_24_c(uint8_t *src, ptrdiff_t 
> src_linesize,
> +  uint8_t *dst, ptrdiff_t 
> dst_linesize,
> +  int w, int h)
> +{
> +int x, y;
> +for (y = 0; y < h; y++, dst += dst_linesize) {
> +for (x = 0; x < w; x++) {
> +int32_t v = AV_RB24(src + x*src_linesize + y*3);
> +AV_WB24(dst + 3*x, v);
> +}
> +}
> +}
> +
> +static void transpose_8x8_24_c(uint8_t *src, ptrdiff_t src_linesize,
> +   uint8_t *dst, ptrdiff_t dst_linesize)
> +{
> +transpose_block_24_c(src, src_linesize, dst, dst_linesize, 8, 8);
> +}
> +
> +static av_always_inline void transpose_block_32_c(uint8_t *src, ptrdiff_t 
> src_linesize,
> +  uint8_t *dst, ptrdiff_t 
> dst_linesize,
> +  int w, int h)
> +{
> +int x, y;
> +for (y = 0; y < h; y++, dst += dst_linesize, src += 4) {
> +for (x = 0; x < w; x++)
> +*((uint32_t *)(dst + 4*x)) = *((uint32_t *)(src + 
> x*src_linesize));
> +}
> +}
> +
> +static void transpose_8x8_32_c(uint8_t *src, ptrdiff_t src_linesize,
> +   uint8_t *dst, ptrdiff_t dst_linesize)
> +{
> +transpose_block_32_c(src, src_linesize, dst, dst_linesize, 8, 8);
> +}
> +
> +static av_always_inline void transpose_block_48_c(uint8_t *src, ptrdiff_t 
> src_linesize,
> +  uint8_t *dst, ptrdiff_t 
> dst_linesize,
> +  int w, int h)
> +{
> +int x, y;
> +for (y = 0; y < h; y++, dst += dst_linesize, src += 6) {
> +for (x = 0; x < w; x++) {
> +int64_t v = AV_RB48(src + x*src_linesize);
> +AV_WB48(dst + 6*x, v);
> +}
> +}
> +}
> +
> +static void transpose_8x8_48_c(uint8_t *src, ptrdiff_t src_linesize,
> +   

Re: [FFmpeg-devel] [PATCH] encoders.texi: Replace x264 --full-help suggestion with --fullhelp

2017-08-15 Thread Michael Niedermayer
On Fri, Aug 11, 2017 at 08:02:40AM +0800, Steven Liu wrote:
> 2017-08-11 0:40 GMT+08:00 Leo Izen :
> > ---
> >  doc/encoders.texi | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/doc/encoders.texi b/doc/encoders.texi
> > index 690cca83dc..f20be54ce8 100644
> > --- a/doc/encoders.texi
> > +++ b/doc/encoders.texi
> > @@ -1793,7 +1793,7 @@ the documentation of the undocumented generic 
> > options, see
> >  @ref{codec-options,,the Codec Options chapter}.
> >
> >  To get a more accurate and extensive documentation of the libx264
> > -options, invoke the command @command{x264 --full-help} or consult
> > +options, invoke the command @command{x264 --fullhelp} or consult
> >  the libx264 documentation.
> >
> >  @table @option
> > --
> > 2.14.0
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> Ah, fix typo,  LGTM

will apply

thx

[...]

--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


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


Re: [FFmpeg-devel] [PATCH] Fix memory leak when reading DDTS box.

2017-08-15 Thread Michael Niedermayer
On Tue, Aug 15, 2017 at 12:08:44PM -0700, Nikolas Bowe wrote:
> ---
>  libavformat/mov.c | 3 +++
>  1 file changed, 3 insertions(+)

applied

thx

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

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.


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


[FFmpeg-devel] [PATCH V3 1/2] lavc/vaapi_encode_h264: add "coder" option support

2017-08-15 Thread Jun Zhao
V3: Clean the code and add docs for "coder" option base on Steven code review.
V2: Follow libx264 "coder" option style, base on Hendrik Leppkes code review.
From 5a8927c04ed7b7f4820d26a124df99b5419deab1 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Tue, 8 Aug 2017 03:33:53 -0400
Subject: [PATCH V3 1/2] lavc/vaapi_encode_h264: add "coder" option support

Follow libx264 style to support "coder" option, and set it to
cabac by default.

Signed-off-by: Yi A Wang 
Signed-off-by: Jun Zhao 
---
 libavcodec/vaapi_encode_h264.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index f9fcd805a4..c658e4e4d6 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -168,6 +168,8 @@ typedef struct VAAPIEncodeH264Options {
 int qp;
 int quality;
 int low_power;
+// Entropy encoder type
+int coder;
 } VAAPIEncodeH264Options;
 
 
@@ -783,6 +785,8 @@ static int 
vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
 VAEncPictureParameterBufferH264   *vpic = ctx->codec_picture_params;
 VAAPIEncodeH264Context*priv = ctx->priv_data;
 VAAPIEncodeH264MiscSequenceParams *mseq = &priv->misc_sequence_params;
+VAAPIEncodeH264Options *opt =
+(VAAPIEncodeH264Options*)ctx->codec_options_data;
 int i;
 
 {
@@ -927,8 +931,8 @@ static int 
vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
 vpic->num_ref_idx_l0_active_minus1 = 0;
 vpic->num_ref_idx_l1_active_minus1 = 0;
 
-vpic->pic_fields.bits.entropy_coding_mode_flag =
-((avctx->profile & 0xff) != 66);
+vpic->pic_fields.bits.entropy_coding_mode_flag
+= opt->coder ? ((avctx->profile & 0xff) != 66) : 0;
 vpic->pic_fields.bits.weighted_pred_flag = 0;
 vpic->pic_fields.bits.weighted_bipred_idc = 0;
 vpic->pic_fields.bits.transform_8x8_mode_flag =
@@ -1283,6 +1287,12 @@ static const AVOption vaapi_encode_h264_options[] = {
 { "low_power", "Use low-power encoding mode (experimental: only supported "
   "on some platforms, does not support all features)",
   OFFSET(low_power), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
+{ "coder", "Entropy coder type",
+  OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS, "coder" },
+{ "cavlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, 
FLAGS, "coder" },
+{ "cabac", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, 
FLAGS, "coder" },
+{ "vlc",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, 
FLAGS, "coder" },
+{ "ac",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, 
FLAGS, "coder" },
 { NULL },
 };
 
-- 
2.11.0

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


[FFmpeg-devel] [PATCH V3 2/2] doc/encoders: add "coder" option documentation for h264_vaapi

2017-08-15 Thread Jun Zhao
From 64dc352ba30e3cf179784c19009bf9a771801f20 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Tue, 15 Aug 2017 21:49:08 -0400
Subject: [PATCH V3 2/2] doc/encoders: add "coder" option documentation for
 h264_vaapi

add "coder" option documentation for h264_vaapi.

Signed-off-by: Jun Zhao 
---
 doc/encoders.texi | 12 
 1 file changed, 12 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 690cca83dc..cec483c9ef 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2580,6 +2580,18 @@ Set the local encoding quality/speed tradeoff (range 
1-8, higher values are fast
 systems implement all levels).
 @item low_power
 Use low-power encoding mode.
+@item coder
+Set entropy encoder (default is @emph{cabac}). Possible values:
+
+@table @samp
+@item ac
+@item cabac
+Enable CABAC.
+
+@item vlc
+@item cavlc
+Enable CAVLC and disable CABAC.
+@end table
 @end table
 
 @item hevc_vaapi
-- 
2.11.0

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


[FFmpeg-devel] [PATCH] avcodec/zmbv: Check decomp_size

2017-08-15 Thread Michael Niedermayer
Fixes: OOM
Fixes: 2710/clusterfuzz-testcase-minimized-4750001420894208

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/zmbv.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index f126515bd1..861098a0f2 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -589,8 +589,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
 // Needed if zlib unused or init aborted before inflateInit
 memset(&c->zstream, 0, sizeof(z_stream));
 
-c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);
+if ((avctx->width + 255ULL) * (avctx->height + 64ULL) > avctx->max_pixels) 
{
+av_log(avctx, AV_LOG_ERROR, "Internal buffer larger than 
max_pixels\n");
+return AVERROR_INVALIDDATA;
+}
 
+c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);
 /* Allocate decompression buffer */
 if (c->decomp_size) {
 if (!(c->decomp_buf = av_mallocz(c->decomp_size))) {
-- 
2.14.1

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


Re: [FFmpeg-devel] [PATCH] libavcodec: fix field_order labelling

2017-08-15 Thread Alex Converse
On Sat, Aug 12, 2017 at 9:47 AM, Dave Rice  wrote:
>
> Hello all,
> This issue originated in this thread 
> https://github.com/amiaopensource/vrecord/issues/170. On Field Order, in the 
> QuickTime specification at 
> https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
>  (and similarly in the Matroska specification which adopted similar language) 
> it states the following meanings for field order values:
>
> > 9 – B is displayed earliest, T is stored first in the file. 14 – T is 
> > displayed earliest, B is stored first in the file.
>
>  This definition is contradicted by other Apple documentation such as 
> https://developer.apple.com/library/content/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG10-THE__FIEL__IMAGEDESCRIPTION_EXTENSION__FIELD_FRAME_INFORMATION.
>
> An Apple engineer confirmed that the QuickTime specification’s definitions 
> for those Field Order values is wrong and does not match Apple’s (of 
> FFmpeg’s) practice, see 
> https://github.com/amiaopensource/vrecord/issues/170#issuecomment-321937668.
>
> However I think that some of the commenting in ffmpeg is based upon the 
> inaccurate definitions from Apple. For instance, in that thread David Singer 
> confirms:
>
> > Ah, not quite. 1 and 6 are indeed 'planar' (all of one field before all of 
> > the other). They don't concern us. Both 9 and 14 are stored in spatial 
> > order (i.e. you could do terrible de-interlacing by simply displaying the 
> > buffer as a frame), and the 9 or 14 value tells you which field is to be 
> > displayed first.
> >
> > 9 – T is earlier than B. 14 – B is earlier than T
>
> mov.c associates AV_FIELD_TB with 9 and AV_FIELD_BT with 14 (similar 
> associations in matroska.h), but avcodec.h states:
>
> > AV_FIELD_TB,  //< Top coded first, bottom displayed first
> > AV_FIELD_BT,  //< Bottom coded first, bottom displayed first
>
> IMHO in both cases of AV_FIELD_TB and AV_FIELD_BT the coding should be 
> referred as interleaved rather than ‘bottom coded first’ or ‘top coded 
> first’. In the case of AV_FIELD_TT and AV_FIELD_BB the fields are stored as 
> planar images where storage order is notable, but with TB and BT the fields 
> are interleaved.
>
> Also utils.c associates these field order values with the following labels:
>
> > AV_FIELD_TB  -> "top coded first (swapped)";
> > AV_FIELD_BT -> "bottom coded first (swapped)";
>
> From my reading, I infer that "top coded first (swapped)” means "top coded 
> first, bottom displayed first”; however in practice from files generated by 
> QuickTime and FFmpeg files with a value of TB have the top field displayed 
> first, so I think the labels are swapped. In the patch below I suggest using 
> “top first (interleaved)” for TB and “bottom first (interleaved)” for BT.
>
> Comments?
>

Icefloe019 agrees with your changes:
http://mirror.informatimago.com/next/developer.apple.com/quicktime/icefloe/dispatch019.html#fiel

They seems reasonable to me. when I made this change originally my
primary concern was getting the field info out of extradata.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V3 1/2] lavc/vaapi_encode_h264: add "coder" option support

2017-08-15 Thread Steven Liu
2017-08-16 10:47 GMT+08:00 Jun Zhao :
> V3: Clean the code and add docs for "coder" option base on Steven code review.
> V2: Follow libx264 "coder" option style, base on Hendrik Leppkes code review.



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


Re: [FFmpeg-devel] [PATCH V3 2/2] doc/encoders: add "coder" option documentation for h264_vaapi

2017-08-15 Thread Steven Liu
2017-08-16 10:47 GMT+08:00 Jun Zhao :
>


I saw there have one option name is "coder", the option have four
flags: cavlc cabac, vlc, ac, but the doc only two options?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V3 2/2] doc/encoders: add "coder" option documentation for h264_vaapi

2017-08-15 Thread Jun Zhao


On 2017/8/16 13:56, Steven Liu wrote:
> 2017-08-16 10:47 GMT+08:00 Jun Zhao :
>>
> 
> 
> I saw there have one option name is "coder", the option have four
> flags: cavlc cabac, vlc, ac, but the doc only two options?
> 

ac == cabac, vlc == cavlc in the docs.

And I've put all 4 options in the docs, please double-check.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V3 2/2] doc/encoders: add "coder" option documentation for h264_vaapi

2017-08-15 Thread 刘歧

> 在 2017年8月16日,14:36,Jun Zhao  写道:
> 
> 
> 
> On 2017/8/16 13:56, Steven Liu wrote:
>> 2017-08-16 10:47 GMT+08:00 Jun Zhao :
>>> 
>> 
>> 
>> I saw there have one option name is "coder", the option have four
>> flags: cavlc cabac, vlc, ac, but the doc only two options?
>> 
> 
> ac == cabac, vlc == cavlc in the docs.
> 
> And I've put all 4 options in the docs, please double-check.
That’s my mistake.


LGTM :)
>  ___
> 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 V2] doc/examples: Add a qsv encoder example

2017-08-15 Thread Li, Zhong
> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Steven Liu
> Sent: Monday, August 7, 2017 11:49 AM
> To: FFmpeg development discussions and patches
> 
> Subject: Re: [FFmpeg-devel] [PATCH V2] doc/examples: Add a qsv encoder
> example
> 
> 2017-08-07 10:45 GMT+08:00 Li, Zhong :
> >> -Original Message-
> >> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> Behalf
> >> Of Steven Liu
> >> Sent: Wednesday, August 2, 2017 2:01 PM
> >> To: FFmpeg development discussions and patches
> >> 
> >> Subject: Re: [FFmpeg-devel] [PATCH V2] doc/examples: Add a qsv
> >> encoder example
> >>
> >> 2017-08-03 1:27 GMT+08:00 Zhong Li :
> >> > It is an evolution from the exmaple "encode_video.c" to support qsv
> >> encoder.
> >> >
> >> > V1->V2: Split to a separated qsv encoding example, instead of a
> >> > V1->patch
> >> > based on encode_video.c
> >> >
> >> > Signed-off-by: Zhong Li 
> >> > ---
> >> >  configure |   2 +
> >> >  doc/Makefile  |   1 +
> >> >  doc/examples/qsvenc.c | 211
> >> > ++
> >> >  3 files changed, 214 insertions(+)  create mode 100644
> >> > doc/examples/qsvenc.c
> >> >
> >> > diff --git a/configure b/configure
> >> > index 66c7b94..676cd85 100755
> >> > --- a/configure
> >> > +++ b/configure
> >> > @@ -1472,6 +1472,7 @@ EXAMPLE_LIST="
> >> >  metadata_example
> >> >  muxing_example
> >> >  qsvdec_example
> >> > +qsvenc_example
> >> >  remuxing_example
> >> >  resampling_audio_example
> >> >  scaling_video_example
> >> > @@ -3213,6 +3214,7 @@ hw_decode_example_deps="avcodec
> avformat
> >> avutil"
> >> >  metadata_example_deps="avformat avutil"
> >> >  muxing_example_deps="avcodec avformat avutil swscale"
> >> >  qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder"
> >> > +qsvenc_example_deps="avcodec avutil libmfx"
> >> >  remuxing_example_deps="avcodec avformat avutil"
> >> >  resampling_audio_example_deps="avutil swresample"
> >> >  scaling_video_example_deps="avutil swscale"
> >> > diff --git a/doc/Makefile b/doc/Makefile index b670f0b..ed41763
> >> > 100644
> >> > --- a/doc/Makefile
> >> > +++ b/doc/Makefile
> >> > @@ -52,6 +52,7 @@
> DOC_EXAMPLES-$(CONFIG_HW_DECODE_EXAMPLE)
> >> += hw_decode
> >> >  DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)  +=
> >> metadata
> >> >  DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE)+=
> >> muxing
> >> >  DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)+=
> qsvdec
> >> > +DOC_EXAMPLES-$(CONFIG_QSVENC_EXAMPLE)+=
> qsvenc
> >> >  DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE)  +=
> >> remuxing
> >> >  DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE)  +=
> >> resampling_audio
> >> >  DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE) +=
> >> scaling_video
> >> > diff --git a/doc/examples/qsvenc.c b/doc/examples/qsvenc.c new file
> >> > mode 100644 index 000..3b94cc8
> >> > --- /dev/null
> >> > +++ b/doc/examples/qsvenc.c
> >> > @@ -0,0 +1,211 @@
> >> > +/*
> >> > + * Copyright (c) 2017 Fabrice Bellard, Zhong Li
> >> > + *
> >> > + * 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.
> >> > + */
> >> > +
> >> > +/**
> >> > + * @file
> >> > + * Intel QSV-accelerated encoding example
> >> > + *
> >> > + * @example qsvenc.c
> >> > + */
> >> > +
> >> > +#include 
> >> > +#include 
> >> > +#include 
> >> > +
> >> > +#include 
> >> > +
> >> > +#include 
> >> > +#include 
> >> > +#include "libavutil/buffer.h"
> >> > +#include "libavutil/hwcontext.h"
> >> > +
> >> > +static void encode(AVCodecContext *enc_ctx, AVFrame *frame,
> >> > +AVPacket
> >> *pkt,
> >> > +   FILE *outfile)
> >> > +{
> >> > +int ret;
> >> > +