Re: [FFmpeg-devel] [PATCHv13] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-23 Thread Jorge Ramirez-Ortiz

On 09/22/2017 11:49 PM, wm4 wrote:

On Wed, 20 Sep 2017 18:55:40 -0700
Jorge Ramirez-Ortiz  wrote:


 This patchset enhances Alexis Ballier's original patch and validates
 it using Qualcomm's Venus hardware (driver recently landed upstream
 [1]).

Pushed to master.


thanks!
will add DRM support over the coming weeks.

btw would you know the process to add a new board to the fate farm?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] opusenc: (WIP) add a new psychoacoustic system for the native Opus encoder

2017-09-23 Thread Rostislav Pehlivanov
On 23 September 2017 at 03:08, Ricardo Constantino 
wrote:

> On 23 September 2017 at 00:46, Rostislav Pehlivanov 
> wrote:
>
> > On 12 April 2017 at 23:26, Rostislav Pehlivanov 
> > wrote:
> >
> > >
> > >
> > Here's the latest version, which I consider to be non-WIP now.
> > I plan to push it tomorrow morning if there are no objections.
> >
>
> This commit implement a psychoacoustic system for the native Opus
>
> implements*
>
> > encoder. Its unlike any other psychoacoustic system known since its
> >
> It's unlike any other psychoacoustic system known, since it's
>
> > capable of using a lookahead to make better choices on how to treat the
> > current frame and how many bits to allocate for it (and future frames).
> > Also, whilst the main bulk of the analysis function has to run in a
> > single thread, the per-frame anaylsis functions do not modify the main
> >
> analysis*; does not*
>
> > psychoacoustic context, so in the future it will be fairly trivial to
> > run those as slice threads.
>
>
>
> > ___
> > 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
>


Pushed with your suggestions, thanks
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure: Fix DEF file post-processing with LTO enabled.

2017-09-23 Thread Kacper Michajlow
2017-09-08 2:52 GMT+02:00 Michael Niedermayer :

> On Wed, Sep 06, 2017 at 08:03:18PM +0200, Kacper Michajlow wrote:
> > 2017-08-22 21:26 GMT+02:00 Kacper Michajłow :
> >
> > > With LTO enabled exported symbol entry looks like:
> > > av_audio_convert @3 DATA
> > >
> > > In order to maintain valid format we need to strip everything after @.
> > >
> > > This patch fixes linking libraries compiled with MinGW toolchain with
> LTO
> > > enabled.
> > >
> > > Signed-off-by: Kacper Michajłow 
> > > ---
> > >  configure | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > >
> > Bump after two weeks.
>
> in absence of anyone else applying this.
>
> can you provide a testcase / command line to reproduce the issue
> this fixes
> maybe if its easy to reproduce it will get a reply sooner
>
> thxs
>


Tested with latest nevcairiel's mingw build from files.1f0.de/mingw and
VS2017

Setup env for lib.exe and link.exe (adjust for your VS instalation):
"C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\Common7\Tools\VsDevCmd.bat"

configure (let's disable everything for this cruel example):
sh configure --enable-lto --enable-shared --disable-static
--disable-everything --disable-avdevice --disable-avcodec
--disable-swresample --disable-swscale --disable-postproc

compile:
make

And now try to link something like

ver.c:
int main()
{
return avfilter_version();
}

cl ver.c libavfilter\avfilter.lib -link

It will fail without the patch, because of trailing DATA in .def file
avfilter.lib was not correctly created by lib.exe and is not usable as it
doesn't have those symbols listed.

If you need real project to reproduce you can add --enable-lto to LAV
Filters configure options and built it. Without this patch it will fail.

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


Re: [FFmpeg-devel] [PATCHv13] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-23 Thread Michael Niedermayer
On Sat, Sep 23, 2017 at 12:28:01AM -0700, Jorge Ramirez-Ortiz wrote:
> On 09/22/2017 11:49 PM, wm4 wrote:
> >On Wed, 20 Sep 2017 18:55:40 -0700
> >Jorge Ramirez-Ortiz  wrote:
> >
> >> This patchset enhances Alexis Ballier's original patch and validates
> >> it using Qualcomm's Venus hardware (driver recently landed upstream
> >> [1]).
> >Pushed to master.
> 
> thanks!
> will add DRM support over the coming weeks.
> 
> btw would you know the process to add a new board to the fate farm?

If you wish to run the fate tests regularly and submit results to the
server see: https://ffmpeg.org/fate.html

[...]

-- 
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] change of deprecated log to debug level

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 08:20:24AM +0200, Thomas Hartwig wrote:
> Attached is the clean patchfile. I want to give some small
> background: the problem happens in javacpp. It looks like there is a
> problem handling pixelformats not correct at all when used for pixel
> grabbing. This is why I mentioned it in a streaming context.
> However this patch is a small workaround to this and really minimal.
> We will look more deeply into the wrapper to get rid of it but in
> the meantime

iam not against applying this patch, if people want it.
But iam not sure this is overall really a good idea ...

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange


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


Re: [FFmpeg-devel] [PATCH] swscale_unscaled: fix DITHER_COPY macro, use it only for dst_depth == 8

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 02:10:01AM +0200, Mateusz wrote:
> To reduce bit depth in planar YUV or gray pixel formats ffmpeg uses 
> DITHER_COPY macro.
> Now it makes images greener and with visible dither pattern.
> 
> In my opinion there is no point to use dither tables for destination bit 
> depth >= 9,
> we can use simple down-shift which is neutral in full and limited range -- 
> result images
> are with the same brightness and with the same colors.

Theres no reason why dither should mess up the average color tone.
And if the user asks for >= 9 bit depth and has >= 10 bit input the
user likely wants to get the best quality.
Thats more so in a world where computers get faster every few years,
this isnt 1995 where shaving off a add or a multiply per pixel was
actually making a difference in being able to play something in
realtime
More so coverting between bit depths might be memory speed limited and
not limited by arithmetic computations once its done in SIMD


[...]

-- 
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] option: allow to set slice_flags to video decoder

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 06:41:44AM +, Li, Zhong wrote:
> > -Original Message-
> > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> > Of Michael Niedermayer
> > Sent: Friday, September 22, 2017 6:30 AM
> > To: FFmpeg development discussions and patches
> > 
> > Subject: Re: [FFmpeg-devel] [PATCH] option: allow to set slice_flags to 
> > video
> > decoder
> > 
> > On Thu, Sep 21, 2017 at 02:17:53PM +0800, Zhong Li wrote:
> > > Make slice_flags setable as avcodec.h definition
> > >
> > > Signed-off-by: Zhong Li 
> > > ---
> > >  libavcodec/options_table.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> > > index 12712fb541..5b9e344554 100644
> > > --- a/libavcodec/options_table.h
> > > +++ b/libavcodec/options_table.h
> > > @@ -340,7 +340,7 @@ static const AVOption avcodec_options[] = {  #if
> > > FF_API_PRIVATE_OPT  {"context", "context model",
> > > OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN,
> > > INT_MAX, V|E},  #endif -{"slice_flags", NULL, OFFSET(slice_flags),
> > > AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
> > > +{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 =
> > > +DEFAULT }, INT_MIN, INT_MAX, V|D},
> > >  #if FF_API_XVMC
> > 
> > This is incorrect, the slice flags specify user application support.
> > A user cannot just override this
> 
> I am confused the slice_flags (as comment it is set by user) is listed in 
> options table but can't be overrode in any case.
> Should it be removed from the options table?

It can be set by the user application through the AVOption API

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- 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 1/2] avfilter/vf_fps: clean-up filter options

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 08:52:26AM +0200, Tobias Rapp wrote:
> On 22.09.2017 01:58, Michael Niedermayer wrote:
> >On Thu, Sep 21, 2017 at 04:55:51PM +0200, Tobias Rapp wrote:
> >>Align order of "start_time" option to documentation and add missing
> >>AV_OPT_FLAG_FILTERING_PARAM flag. Fix indent of "round" named constants
> >>and clear unused field values.
> >>
> >>Also fix some documentation cosmetics.
> >>
> >>Signed-off-by: Tobias Rapp 
> >>---
> >>  doc/filters.texi |  4 ++--
> >>  libavfilter/vf_fps.c | 12 ++--
> >>  2 files changed, 8 insertions(+), 8 deletions(-)
> >>
> >>diff --git a/doc/filters.texi b/doc/filters.texi
> >>index 830de54..96b3dfd 100644
> >>--- a/doc/filters.texi
> >>+++ b/doc/filters.texi
> >>@@ -8670,12 +8670,12 @@ It accepts the following parameters:
> >>  The desired output frame rate. The default is @code{25}.
> >>  @item round
> >>-Rounding method.
> >>+Timestamp (PTS) rounding method.
> >>  Possible values are:
> >>  @table @option
> >>  @item zero
> >>-zero round towards 0
> >>+round towards 0
> >>  @item inf
> >>  round away from 0
> >>  @item down
> >>diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
> >>index 1e5d07e..0db2b48 100644
> >>--- a/libavfilter/vf_fps.c
> >>+++ b/libavfilter/vf_fps.c
> >>@@ -65,13 +65,13 @@ typedef struct FPSContext {
> >>  #define F AV_OPT_FLAG_FILTERING_PARAM
> >>  static const AVOption fps_options[] = {
> >>  { "fps", "A string describing desired output framerate", 
> >> OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, 
> >> V|F },
> >>-{ "start_time", "Assume the first PTS should be this value.", 
> >>OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, 
> >>DBL_MAX, V },
> >>  { "round", "set rounding method for timestamps", OFFSET(rounding), 
> >> AV_OPT_TYPE_INT, { .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
> >>-{ "zero", "round towards 0",  OFFSET(rounding), AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_ZERO }, 0, 5, V|F, "round" },
> >>-{ "inf",  "round away from 0",OFFSET(rounding), AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_INF  }, 0, 5, V|F, "round" },
> >>-{ "down", "round towards -infty", OFFSET(rounding), AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_DOWN }, 0, 5, V|F, "round" },
> >>-{ "up",   "round towards +infty", OFFSET(rounding), AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_UP   }, 0, 5, V|F, "round" },
> >>-{ "near", "round to nearest", OFFSET(rounding), AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
> >>+{ "zero", "round towards 0", 0, AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_ZERO }, 0, 0, V|F, "round" },
> >>+{ "inf",  "round away from 0",   0, AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_INF  }, 0, 0, V|F, "round" },
> >>+{ "down", "round towards -infty",0, AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_DOWN }, 0, 0, V|F, "round" },
> >>+{ "up",   "round towards +infty",0, AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_UP   }, 0, 0, V|F, "round" },
> >>+{ "near", "round to nearest",0, AV_OPT_TYPE_CONST, 
> >>{ .i64 = AV_ROUND_NEAR_INF }, 0, 0, V|F, "round" },
> >>+{ "start_time", "Assume the first PTS should be this value.", 
> >>OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, 
> >>DBL_MAX, V|F },
> >>  { NULL }
> >
> >This breaks shorthand notation like fps=30:-0.01
> 
> The order of options according to the documentation is
> [fps]:[round]:[start_time] (see
> https://ffmpeg.org/ffmpeg-filters.html#fps). It even explicitly
> says:
> 
> "Alternatively, the options can be specified as a flat string: fps[:round]."
> 
> But if preferred I can update the documentation instead.

Whichever makes more users happy.

(we maybe should avoid 2 different implementation behaviours if we
 dont already have 2, i have not checked if we had a different order in
 the code in the past)

[...]
-- 
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] libavcodec/als: remove check for predictor order of a block

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 01:54:27PM +0530, Umair Khan wrote:
> On Thu, Sep 21, 2017 at 6:30 PM, Paul B Mahol  wrote:
> > On 9/21/17, Umair Khan  wrote:
> >> Hi Ronald,
> >>
> >> On Mon, Sep 11, 2017 at 10:27 PM, Ronald S. Bultje 
> >> wrote:
> >>> Hi Umair,
> >>>
> >>> On Mon, Sep 11, 2017 at 4:06 AM, Umair Khan  wrote:
> >>>
>  On Sun, Sep 10, 2017 at 10:30 PM, Paul B Mahol  wrote:
>  > On 9/10/17, Umair Khan  wrote:
>  >> On Sun, Sep 10, 2017 at 9:52 PM, Thilo Borgmann
>  >>   >
>  >> wrote:
>  >>>
>  >>> Hi,
>  >>>
>  >>> > This patch fixes this bug - https://trac.ffmpeg.org/ticket/5297
>  >>>
>  >>> this is yet another iteration of
>  >>>
>  >>> http://ffmpeg.org/pipermail/ffmpeg-devel/2017-June/213005.html
>  >>
>  >> I see. I was keepnig reference codec as the source of truth.
>  >>
>  >> How do I reproduce this segfault? -
>  >> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-November/202530.html
>  >> Is it one of the fate tests failing?
>  >
>  > No.
> 
>  In that case there's not much which can be done with this bug.
>  That being said, I'm pretty sure we will anyways end up removing this
>  check.
> >>>
> >>>
> >>> I think your question is "how do I get access to this sample", right? You
> >>> could ask Michael.
> >>
> >> Paul also tried to fix this bug, hence I'm assuming that he already
> >> asked Michael about the sample file. Anyways, it'd not be difficult to
> >> fix this bug if we can reproduce it.
> >
> > Thilo do not want to apply Michael fix because he do not understand his 
> > patch.
> 
> Which fix are you talking about?
> 
> I see that Michael added this check in the first place -
> http://git.videolan.org/?p=ffmpeg.git;a=commit;h=18f94df8af
> If someone can provide me with the file which is causing the segfault,
> maybe I can look into it.

file sent privatly to umair

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

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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


[FFmpeg-devel] [PATCH 2/2] movenc-test: Add tests for negative cts offsets

2017-09-23 Thread Jan Ekström
From: Martin Storsjö 

Signed-off-by: Martin Storsjö 
---
 libavformat/tests/movenc.c | 19 +++
 tests/ref/fate/movenc  | 11 +++
 2 files changed, 30 insertions(+)

diff --git a/libavformat/tests/movenc.c b/libavformat/tests/movenc.c
index 7a66395efd..8e59b74259 100644
--- a/libavformat/tests/movenc.c
+++ b/libavformat/tests/movenc.c
@@ -766,6 +766,25 @@ int main(int argc, char **argv)
 clear_duration = 0;
 do_interleave = 0;
 
+// Write a fragmented file with b-frames and audio preroll,
+// with negative cts values, removing the edit list for the
+// video track.
+init_out("delay-moov-elst-neg-cts");
+av_dict_set(&opts, "movflags", 
"frag_keyframe+delay_moov+negative_cts_offsets", 0);
+init(1, 1);
+mux_gops(2);
+finish();
+close_out();
+
+// Write a fragmented file with b-frames without audio preroll,
+// with negative cts values, avoiding any edit lists, allowing
+// to use empty_moov instead of delay_moov.
+init_out("empty-moov-neg-cts");
+av_dict_set(&opts, "movflags", 
"frag_keyframe+empty_moov+negative_cts_offsets", 0);
+init(1, 0);
+mux_gops(2);
+finish();
+close_out();
 
 av_free(md5);
 
diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
index 47bcf9d515..872796ebce 100644
--- a/tests/ref/fate/movenc
+++ b/tests/ref/fate/movenc
@@ -140,3 +140,14 @@ write_data len 668, time 157, type sync atom moof
 write_data len 440, time 223, type boundary atom moof
 write_data len 262, time nopts, type trailer atom -
 edd19deae2b70afcf2cd744b89b7013d 4209 vfr-noduration-interleave
+write_data len 1231, time nopts, type header atom ftyp
+write_data len 916, time 0, type sync atom moof
+write_data len 908, time 100, type sync atom moof
+write_data len 148, time nopts, type trailer atom -
+781dbfd228f36903178e29faa727d78b 3203 delay-moov-elst-neg-cts
+write_data len 36, time nopts, type header atom ftyp
+write_data len 1123, time nopts, type header atom -
+write_data len 1188, time 0, type sync atom moof
+write_data len 908, time 103, type sync atom moof
+write_data len 148, time nopts, type trailer atom -
+7630fdf358e02c79e88f312f82a260b7 3403 empty-moov-neg-cts
-- 
2.13.5

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


[FFmpeg-devel] [PATCH 1/2] movenc: Add an option for enabling negative CTS offsets

2017-09-23 Thread Jan Ekström
From: Martin Storsjö 

This reduces the need for an edit list; streams that start with
e.g. dts=-1, pts=0 can be encoded as dts=0, pts=0 (which is valid
in mov/mp4) by shifting the dts values of all packets forward.
This avoids the need for edit lists for such streams (while they
still are needed for audio streams with encoder delay).

This eases conformance with the DASH-IF interoperability guidelines.

Signed-off-by: Martin Storsjö 
---
 libavformat/movenc.c | 28 
 libavformat/movenc.h |  2 ++
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 10b959ad02..917486384a 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -77,6 +77,7 @@ static const AVOption options[] = {
 { "write_gama", "Write deprecated gama atom", 0, AV_OPT_TYPE_CONST, {.i64 
= FF_MOV_FLAG_WRITE_GAMA}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
"movflags" },
 { "use_metadata_tags", "Use mdta atom for metadata.", 0, 
AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_USE_MDTA}, INT_MIN, INT_MAX, 
AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
 { "skip_trailer", "Skip writing the mfra/tfra/mfro trailer for fragmented 
files", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_SKIP_TRAILER}, INT_MIN, 
INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
+{ "negative_cts_offsets", "Use negative CTS offsets (reducing the need for 
edit lists)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS}, 
INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
 FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
 { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, 
iods_skip), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
 { "iods_audio_profile", "iods audio profile atom.", 
offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 
255, AV_OPT_FLAG_ENCODING_PARAM},
@@ -2094,8 +2095,9 @@ static int mov_write_stsd_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContext
 return update_size(pb, pos);
 }
 
-static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
+static int mov_write_ctts_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack 
*track)
 {
+MOVMuxContext *mov = s->priv_data;
 MOVStts *ctts_entries;
 uint32_t entries = 0;
 uint32_t atom_size;
@@ -2119,7 +2121,11 @@ static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack 
*track)
 atom_size = 16 + (entries * 8);
 avio_wb32(pb, atom_size); /* size */
 ffio_wfourcc(pb, "ctts");
-avio_wb32(pb, 0); /* version & flags */
+if (mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS)
+avio_w8(pb, 1); /* version */
+else
+avio_w8(pb, 0); /* version */
+avio_wb24(pb, 0); /* flags */
 avio_wb32(pb, entries); /* entry count */
 for (i = 0; i < entries; i++) {
 avio_wb32(pb, ctts_entries[i].count);
@@ -2303,7 +2309,7 @@ static int mov_write_stbl_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContext
 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO &&
 track->flags & MOV_TRACK_CTTS && track->entry) {
 
-if ((ret = mov_write_ctts_tag(pb, track)) < 0)
+if ((ret = mov_write_ctts_tag(s, pb, track)) < 0)
 return ret;
 }
 mov_write_stsc_tag(pb, track);
@@ -4044,7 +4050,10 @@ static int mov_write_trun_tag(AVIOContext *pb, 
MOVMuxContext *mov,
 
 avio_wb32(pb, 0); /* size placeholder */
 ffio_wfourcc(pb, "trun");
-avio_w8(pb, 0); /* version */
+if (mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS)
+avio_w8(pb, 1); /* version */
+else
+avio_w8(pb, 0); /* version */
 avio_wb24(pb, flags);
 
 avio_wb32(pb, end - first); /* sample count */
@@ -4489,6 +4498,8 @@ static int mov_write_ftyp_tag(AVIOContext *pb, 
AVFormatContext *s)
 ffio_wfourcc(pb, "MSNV");
 else if (mov->mode == MODE_MP4 && mov->flags & 
FF_MOV_FLAG_DEFAULT_BASE_MOOF)
 ffio_wfourcc(pb, "iso5"); // Required when using default-base-is-moof
+else if (mov->mode == MODE_MP4 && mov->flags & 
FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS)
+ffio_wfourcc(pb, "iso4");
 else if (mov->mode == MODE_MP4)
 ffio_wfourcc(pb, "isom");
 else if (mov->mode == MODE_IPOD)
@@ -4759,6 +4770,8 @@ static int mov_flush_fragment(AVFormatContext *s, int 
force)
 if (!track->end_reliable) {
 AVPacket pkt;
 if (!ff_interleaved_peek(s, i, &pkt, 1)) {
+if (track->dts_shift != AV_NOPTS_VALUE)
+pkt.dts += track->dts_shift;
 track->track_duration = pkt.dts - track->start_dts;
 if (pkt.pts != AV_NOPTS_VALUE)
 track->end_pts = pkt.pts;
@@ -5282,6 +5295,12 @@ static int mov_write_single_packet(AVFormatContext *s, 
AVPacket *pkt)
 mov->flags &= ~FF_MOV_FLAG_FRAG_DISCONT;
 }
 
+if (mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS) {
+if (trk->dts_shift == AV_NOPTS_VALUE)
+

Re: [FFmpeg-devel] [PATCH 1/2] libavfilter/scale: More descriptive in/ref/out logging

2017-09-23 Thread Ronald S. Bultje
Hi Kevin,

On Sat, Sep 23, 2017 at 2:22 AM, Kevin Mark  wrote:

> Hey Ronald,
>
> Was this able to solve the issue for you?
>
> On Mon, Jul 24, 2017 at 6:27 AM, Kevin Mark  wrote:
> > Hi Ronald,
> >
> > On Wed, Jul 19, 2017 at 3:44 AM, Ronald S. Bultje 
> wrote:
> >> But my grep (Mac) has no -P option... I'd encourage you to keep things
> >> simple and use a non-\n delimiter between the lines so non-GNU grep can
> >> continue to be used for this also...
> >
> > Does this work for you:
> >
> > On Tue, Jun 6, 2017 at 1:17 PM, Kevin Mark  wrote:
> >> It also works with BSD grep 2.5.1-FreeBSD included in macOS if you use
> >> the -E option instead of -P.
>

Yes, -E works on Mac.

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


Re: [FFmpeg-devel] [PATCH] swscale_unscaled: fix DITHER_COPY macro, use it only for dst_depth == 8

2017-09-23 Thread Mateusz
W dniu 2017-09-23 o 17:01, Michael Niedermayer pisze:
> On Fri, Sep 22, 2017 at 02:10:01AM +0200, Mateusz wrote:
>> To reduce bit depth in planar YUV or gray pixel formats ffmpeg uses 
>> DITHER_COPY macro.
>> Now it makes images greener and with visible dither pattern.
>>
>> In my opinion there is no point to use dither tables for destination bit 
>> depth >= 9,
>> we can use simple down-shift which is neutral in full and limited range -- 
>> result images
>> are with the same brightness and with the same colors.
> 
> Theres no reason why dither should mess up the average color tone.

In theory -- yes, I agree.
In reality -- current version of DITHER_COPY mess up the average color tone.
It's one of the reasons why I sending these patches.

> And if the user asks for >= 9 bit depth and has >= 10 bit input the
> user likely wants to get the best quality.
> Thats more so in a world where computers get faster every few years,
> this isnt 1995 where shaving off a add or a multiply per pixel was
> actually making a difference in being able to play something in
> realtime
> More so coverting between bit depths might be memory speed limited and
> not limited by arithmetic computations once its done in SIMD

Yes, I agree. Now I can't write patches in NASM syntax, but I started reading 
and learning.
I hope I'll back in a few months...

Mateusz

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


Re: [FFmpeg-devel] [PATCH 2/2] avformat/mxfdec: use the common packet pts setter function for opatom files

2017-09-23 Thread Marton Balint


On Thu, 14 Sep 2017, Tomas Härdin wrote:


On 2017-09-13 21:31, Marton Balint wrote:


On Fri, 8 Sep 2017, Michael Niedermayer wrote:


On Thu, Sep 07, 2017 at 05:11:40PM +0200, Marton Balint wrote:

Fixes ticket #6631.

Signed-off-by: Marton Balint 
---
 libavformat/mxfdec.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)


please add a fate this if you push this


Unfortunately we only have a sample which is around 16 MB but it seems 
like an overkill to add such a big sample to the fate suite for such a 
minor feature. And I am also not very fond of truncating the file and 
adding truncated files to the fate suite... So unless somebody can 
provide an opAtom AVC intra file which is only a few frames long, I 
see no good way to fate test this. Do you have an idea how to proceed?


Try having the user that reported the bug generate a smaller + lower res 
sample?


These are P2 camera files, the reporter can't provide smaller files.

Anyway I pushed the patch series as is, fate test can be added later if 
somebody comes up with a similar but smaller intra-frame OpAtom file.


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


Re: [FFmpeg-devel] [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12 bit

2017-09-23 Thread Michael Niedermayer
On Tue, Sep 19, 2017 at 10:35:30PM +0200, Thomas Mundt wrote:
> 2017-09-19 17:53 GMT+02:00 James Almer :
> 
> > On 9/19/2017 5:02 AM, Thomas Mundt wrote:
> > > 2017-09-19 4:09 GMT+02:00 James Almer :
> > >
> > >> On 9/18/2017 10:41 PM, Thomas Mundt wrote:
> > >>> I tried to set up MIPS compiler for two days on windows and linux
> > without
> > >>> success.
> > >>> Now I try it blind. This solution is based on the first suggestion
> > James
> > >>> gave me at IRC.
> > >>> There might be room for improvement and an alternative solution with
> > >>> AV_RL16() / AV_WL16().
> > >>> I used av_le2ne16() because it will be ignored for little endian.
> > >>>
> > >>> Regards,
> > >>> Thomas
> > >>
> > >>> From a2be5859266b1a2f7048b81ced6770ab4b90a5a4 Mon Sep 17 00:00:00 2001
> > >>> From: Thomas Mundt 
> > >>> Date: Tue, 19 Sep 2017 00:25:25 +0200
> > >>> Subject: [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12
> > bit
> > >>>
> > >>> Signed-off-by: Thomas Mundt 
> > >>> ---
> > >>>  libavfilter/interlace.h|  5 +-
> > >>>  libavfilter/tinterlace.h   |  5 +-
> > >>>  libavfilter/vf_interlace.c | 92
> > >> ++
> > >>>  libavfilter/vf_tinterlace.c| 73
> > ++--
> > >>>  libavfilter/x86/vf_interlace.asm   | 80
> > >> --
> > >>>  libavfilter/x86/vf_interlace_init.c| 51 ++
> > >>>  libavfilter/x86/vf_tinterlace_init.c   | 51 ++
> > >>>  tests/ref/fate/filter-pixfmts-tinterlace_cvlpf | 11 +++
> > >>>  tests/ref/fate/filter-pixfmts-tinterlace_merge | 11 +++
> > >>>  tests/ref/fate/filter-pixfmts-tinterlace_pad   | 11 +++
> > >>>  tests/ref/fate/filter-pixfmts-tinterlace_vlpf  | 11 +++
> > >>>  11 files changed, 345 insertions(+), 56 deletions(-)
> > >>>
> > >>> diff --git a/libavfilter/interlace.h b/libavfilter/interlace.h
> > >>> index 2101b79..90a0198 100644
> > >>> --- a/libavfilter/interlace.h
> > >>> +++ b/libavfilter/interlace.h
> > >>> @@ -25,9 +25,11 @@
> > >>>  #ifndef AVFILTER_INTERLACE_H
> > >>>  #define AVFILTER_INTERLACE_H
> > >>>
> > >>> +#include "libavutil/bswap.h"
> > >>>  #include "libavutil/common.h"
> > >>>  #include "libavutil/imgutils.h"
> > >>>  #include "libavutil/opt.h"
> > >>> +#include "libavutil/pixdesc.h"
> > >>>
> > >>>  #include "avfilter.h"
> > >>>  #include "formats.h"
> > >>> @@ -55,8 +57,9 @@ typedef struct InterlaceContext {
> > >>>  enum ScanMode scan;// top or bottom field first scanning
> > >>>  int lowpass;   // enable or disable low pass filtering
> > >>>  AVFrame *cur, *next;   // the two frames from which the new one is
> > >> obtained
> > >>> +const AVPixFmtDescriptor *csp;
> > >>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const
> > >> uint8_t *srcp,
> > >>> - ptrdiff_t mref, ptrdiff_t pref);
> > >>> + ptrdiff_t mref, ptrdiff_t pref, int
> > clip_max);
> > >>>  } InterlaceContext;
> > >>>
> > >>>  void ff_interlace_init_x86(InterlaceContext *interlace);
> > >>> diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
> > >>> index cc13a6c..b5c39aa 100644
> > >>> --- a/libavfilter/tinterlace.h
> > >>> +++ b/libavfilter/tinterlace.h
> > >>> @@ -27,7 +27,9 @@
> > >>>  #ifndef AVFILTER_TINTERLACE_H
> > >>>  #define AVFILTER_TINTERLACE_H
> > >>>
> > >>> +#include "libavutil/bswap.h"
> > >>>  #include "libavutil/opt.h"
> > >>> +#include "libavutil/pixdesc.h"
> > >>>  #include "drawutils.h"
> > >>>  #include "avfilter.h"
> > >>>
> > >>> @@ -60,8 +62,9 @@ typedef struct TInterlaceContext {
> > >>>  int black_linesize[4];
> > >>>  FFDrawContext draw;
> > >>>  FFDrawColor color;
> > >>> +const AVPixFmtDescriptor *csp;
> > >>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t
> > >> *srcp,
> > >>> - ptrdiff_t mref, ptrdiff_t pref);
> > >>> + ptrdiff_t mref, ptrdiff_t pref, int
> > clip_max);
> > >>>  } TInterlaceContext;
> > >>>
> > >>>  void ff_tinterlace_init_x86(TInterlaceContext *interlace);
> > >>> diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
> > >>> index 55bf782..bfba054 100644
> > >>> --- a/libavfilter/vf_interlace.c
> > >>> +++ b/libavfilter/vf_interlace.c
> > >>> @@ -61,8 +61,8 @@ static const AVOption interlace_options[] = {
> > >>>  AVFILTER_DEFINE_CLASS(interlace);
> > >>>
> > >>>  static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize,
> > >>> -   const uint8_t *srcp,
> > >>> -   ptrdiff_t mref, ptrdiff_t pref)
> > >>> +   const uint8_t *srcp, ptrdiff_t mref,
> > >>> +   ptrdiff_t pref, int clip_max)
> > >>>  {
> > >>>  const uint8_t *srcp_above = srcp + mref;
> > >>>  const uint8_t *srcp_below = srcp + pref;
> > >>> @@ -75,9 +75,28 @@ static void lowpas

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/avpacket: fix leaks when copying side data if src == dst

2017-09-23 Thread James Almer
On 9/21/2017 7:04 PM, James Almer wrote:
> The scenario makes no sense and produces all kinds of memory leaks.
> Return 0 instead of an error as the process is pretty much a nop.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/avpacket.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index 5ce3228166..a68e2501ad 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -225,14 +225,14 @@ failed_alloc:
>  
>  int av_copy_packet_side_data(AVPacket *pkt, const AVPacket *src)
>  {
> +if (src == pkt)
> +return 0;
> +
>  if (src->side_data_elems) {
>  int i;
> -DUP_DATA(pkt->side_data, src->side_data,
> -src->side_data_elems * sizeof(*src->side_data), 0, 
> ALLOC_MALLOC);
> -if (src != pkt) {
> -memset(pkt->side_data, 0,
> -   src->side_data_elems * sizeof(*src->side_data));
> -}
> +pkt->side_data = av_mallocz_array(src->side_data_elems, 
> sizeof(*src->side_data));
> +if (!pkt->side_data)
> +goto failed_alloc;
>  for (i = 0; i < src->side_data_elems; i++) {
>  DUP_DATA(pkt->side_data[i].data, src->side_data[i].data,
>  src->side_data[i].size, 1, ALLOC_MALLOC);
> 

Right, so there's one scenario for src == dst, but it's a hacky one.
Basically, something like

AVPacket tmp = *pkt;
av_copy_packet_side_data(pkt, pkt);

Which means there will be no leaks as long as tmp is properly freed
afterguards.

Changing that behavior will potentially break existing code using the
function (commit fdd1aaf87aa hints that there are some uses of this
kind), so seeing it's already inside relevant guards I'm going to
effectively deprecate it in favor of the saner av_packet_copy_props().
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/avpacket: fix leaks on side data copying failure

2017-09-23 Thread James Almer
On 9/21/2017 7:04 PM, James Almer wrote:
> pkt->side_data_elems being set at the very end of the process will leak memory
> if some side data elements were already copied before an error ocurrs.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/avpacket.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index a68e2501ad..13e830b781 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -230,17 +230,20 @@ int av_copy_packet_side_data(AVPacket *pkt, const 
> AVPacket *src)
>  
>  if (src->side_data_elems) {
>  int i;
> +
> +pkt->side_data_elems = 0;
>  pkt->side_data = av_mallocz_array(src->side_data_elems, 
> sizeof(*src->side_data));
>  if (!pkt->side_data)
>  goto failed_alloc;
> +
>  for (i = 0; i < src->side_data_elems; i++) {
>  DUP_DATA(pkt->side_data[i].data, src->side_data[i].data,
>  src->side_data[i].size, 1, ALLOC_MALLOC);
>  pkt->side_data[i].size = src->side_data[i].size;
>  pkt->side_data[i].type = src->side_data[i].type;
> +pkt->side_data_elems++;
>  }
>  }
> -pkt->side_data_elems = src->side_data_elems;
>  return 0;
>  
>  failed_alloc:
> 

Dropped alongside patch 1/2.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12 bit

2017-09-23 Thread Thomas Mundt
2017-09-23 20:24 GMT+02:00 Michael Niedermayer :

> On Tue, Sep 19, 2017 at 10:35:30PM +0200, Thomas Mundt wrote:
> > 2017-09-19 17:53 GMT+02:00 James Almer :
> >
> > > On 9/19/2017 5:02 AM, Thomas Mundt wrote:
> > > > 2017-09-19 4:09 GMT+02:00 James Almer :
> > > >
> > > >> On 9/18/2017 10:41 PM, Thomas Mundt wrote:
> > > >>> I tried to set up MIPS compiler for two days on windows and linux
> > > without
> > > >>> success.
> > > >>> Now I try it blind. This solution is based on the first suggestion
> > > James
> > > >>> gave me at IRC.
> > > >>> There might be room for improvement and an alternative solution
> with
> > > >>> AV_RL16() / AV_WL16().
> > > >>> I used av_le2ne16() because it will be ignored for little endian.
> > > >>>
> > > >>> Regards,
> > > >>> Thomas
> > > >>
> > > >>> From a2be5859266b1a2f7048b81ced6770ab4b90a5a4 Mon Sep 17 00:00:00
> 2001
> > > >>> From: Thomas Mundt 
> > > >>> Date: Tue, 19 Sep 2017 00:25:25 +0200
> > > >>> Subject: [PATCH 3/3 v2] avfilter/interlace: add support for 10 and
> 12
> > > bit
> > > >>>
> > > >>> Signed-off-by: Thomas Mundt 
> > > >>> ---
> > > >>>  libavfilter/interlace.h|  5 +-
> > > >>>  libavfilter/tinterlace.h   |  5 +-
> > > >>>  libavfilter/vf_interlace.c | 92
> > > >> ++
> > > >>>  libavfilter/vf_tinterlace.c| 73
> > > ++--
> > > >>>  libavfilter/x86/vf_interlace.asm   | 80
> > > >> --
> > > >>>  libavfilter/x86/vf_interlace_init.c| 51
> ++
> > > >>>  libavfilter/x86/vf_tinterlace_init.c   | 51
> ++
> > > >>>  tests/ref/fate/filter-pixfmts-tinterlace_cvlpf | 11 +++
> > > >>>  tests/ref/fate/filter-pixfmts-tinterlace_merge | 11 +++
> > > >>>  tests/ref/fate/filter-pixfmts-tinterlace_pad   | 11 +++
> > > >>>  tests/ref/fate/filter-pixfmts-tinterlace_vlpf  | 11 +++
> > > >>>  11 files changed, 345 insertions(+), 56 deletions(-)
> > > >>>
> > > >>> diff --git a/libavfilter/interlace.h b/libavfilter/interlace.h
> > > >>> index 2101b79..90a0198 100644
> > > >>> --- a/libavfilter/interlace.h
> > > >>> +++ b/libavfilter/interlace.h
> > > >>> @@ -25,9 +25,11 @@
> > > >>>  #ifndef AVFILTER_INTERLACE_H
> > > >>>  #define AVFILTER_INTERLACE_H
> > > >>>
> > > >>> +#include "libavutil/bswap.h"
> > > >>>  #include "libavutil/common.h"
> > > >>>  #include "libavutil/imgutils.h"
> > > >>>  #include "libavutil/opt.h"
> > > >>> +#include "libavutil/pixdesc.h"
> > > >>>
> > > >>>  #include "avfilter.h"
> > > >>>  #include "formats.h"
> > > >>> @@ -55,8 +57,9 @@ typedef struct InterlaceContext {
> > > >>>  enum ScanMode scan;// top or bottom field first scanning
> > > >>>  int lowpass;   // enable or disable low pass filtering
> > > >>>  AVFrame *cur, *next;   // the two frames from which the new
> one is
> > > >> obtained
> > > >>> +const AVPixFmtDescriptor *csp;
> > > >>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const
> > > >> uint8_t *srcp,
> > > >>> - ptrdiff_t mref, ptrdiff_t pref);
> > > >>> + ptrdiff_t mref, ptrdiff_t pref, int
> > > clip_max);
> > > >>>  } InterlaceContext;
> > > >>>
> > > >>>  void ff_interlace_init_x86(InterlaceContext *interlace);
> > > >>> diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
> > > >>> index cc13a6c..b5c39aa 100644
> > > >>> --- a/libavfilter/tinterlace.h
> > > >>> +++ b/libavfilter/tinterlace.h
> > > >>> @@ -27,7 +27,9 @@
> > > >>>  #ifndef AVFILTER_TINTERLACE_H
> > > >>>  #define AVFILTER_TINTERLACE_H
> > > >>>
> > > >>> +#include "libavutil/bswap.h"
> > > >>>  #include "libavutil/opt.h"
> > > >>> +#include "libavutil/pixdesc.h"
> > > >>>  #include "drawutils.h"
> > > >>>  #include "avfilter.h"
> > > >>>
> > > >>> @@ -60,8 +62,9 @@ typedef struct TInterlaceContext {
> > > >>>  int black_linesize[4];
> > > >>>  FFDrawContext draw;
> > > >>>  FFDrawColor color;
> > > >>> +const AVPixFmtDescriptor *csp;
> > > >>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const
> uint8_t
> > > >> *srcp,
> > > >>> - ptrdiff_t mref, ptrdiff_t pref);
> > > >>> + ptrdiff_t mref, ptrdiff_t pref, int
> > > clip_max);
> > > >>>  } TInterlaceContext;
> > > >>>
> > > >>>  void ff_tinterlace_init_x86(TInterlaceContext *interlace);
> > > >>> diff --git a/libavfilter/vf_interlace.c
> b/libavfilter/vf_interlace.c
> > > >>> index 55bf782..bfba054 100644
> > > >>> --- a/libavfilter/vf_interlace.c
> > > >>> +++ b/libavfilter/vf_interlace.c
> > > >>> @@ -61,8 +61,8 @@ static const AVOption interlace_options[] = {
> > > >>>  AVFILTER_DEFINE_CLASS(interlace);
> > > >>>
> > > >>>  static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize,
> > > >>> -   const uint8_t *srcp,
> > > >>> -   ptrdiff_t mref, ptrdiff_t pref)
> > > >>> + 

Re: [FFmpeg-devel] [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12 bit

2017-09-23 Thread James Almer
On 9/23/2017 3:24 PM, Michael Niedermayer wrote:
> On Tue, Sep 19, 2017 at 10:35:30PM +0200, Thomas Mundt wrote:
>> 2017-09-19 17:53 GMT+02:00 James Almer :
>>
>>> On 9/19/2017 5:02 AM, Thomas Mundt wrote:
 2017-09-19 4:09 GMT+02:00 James Almer :

> On 9/18/2017 10:41 PM, Thomas Mundt wrote:
>> I tried to set up MIPS compiler for two days on windows and linux
>>> without
>> success.
>> Now I try it blind. This solution is based on the first suggestion
>>> James
>> gave me at IRC.
>> There might be room for improvement and an alternative solution with
>> AV_RL16() / AV_WL16().
>> I used av_le2ne16() because it will be ignored for little endian.
>>
>> Regards,
>> Thomas
>
>> From a2be5859266b1a2f7048b81ced6770ab4b90a5a4 Mon Sep 17 00:00:00 2001
>> From: Thomas Mundt 
>> Date: Tue, 19 Sep 2017 00:25:25 +0200
>> Subject: [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12
>>> bit
>>
>> Signed-off-by: Thomas Mundt 
>> ---
>>  libavfilter/interlace.h|  5 +-
>>  libavfilter/tinterlace.h   |  5 +-
>>  libavfilter/vf_interlace.c | 92
> ++
>>  libavfilter/vf_tinterlace.c| 73
>>> ++--
>>  libavfilter/x86/vf_interlace.asm   | 80
> --
>>  libavfilter/x86/vf_interlace_init.c| 51 ++
>>  libavfilter/x86/vf_tinterlace_init.c   | 51 ++
>>  tests/ref/fate/filter-pixfmts-tinterlace_cvlpf | 11 +++
>>  tests/ref/fate/filter-pixfmts-tinterlace_merge | 11 +++
>>  tests/ref/fate/filter-pixfmts-tinterlace_pad   | 11 +++
>>  tests/ref/fate/filter-pixfmts-tinterlace_vlpf  | 11 +++
>>  11 files changed, 345 insertions(+), 56 deletions(-)
>>
>> diff --git a/libavfilter/interlace.h b/libavfilter/interlace.h
>> index 2101b79..90a0198 100644
>> --- a/libavfilter/interlace.h
>> +++ b/libavfilter/interlace.h
>> @@ -25,9 +25,11 @@
>>  #ifndef AVFILTER_INTERLACE_H
>>  #define AVFILTER_INTERLACE_H
>>
>> +#include "libavutil/bswap.h"
>>  #include "libavutil/common.h"
>>  #include "libavutil/imgutils.h"
>>  #include "libavutil/opt.h"
>> +#include "libavutil/pixdesc.h"
>>
>>  #include "avfilter.h"
>>  #include "formats.h"
>> @@ -55,8 +57,9 @@ typedef struct InterlaceContext {
>>  enum ScanMode scan;// top or bottom field first scanning
>>  int lowpass;   // enable or disable low pass filtering
>>  AVFrame *cur, *next;   // the two frames from which the new one is
> obtained
>> +const AVPixFmtDescriptor *csp;
>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const
> uint8_t *srcp,
>> - ptrdiff_t mref, ptrdiff_t pref);
>> + ptrdiff_t mref, ptrdiff_t pref, int
>>> clip_max);
>>  } InterlaceContext;
>>
>>  void ff_interlace_init_x86(InterlaceContext *interlace);
>> diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
>> index cc13a6c..b5c39aa 100644
>> --- a/libavfilter/tinterlace.h
>> +++ b/libavfilter/tinterlace.h
>> @@ -27,7 +27,9 @@
>>  #ifndef AVFILTER_TINTERLACE_H
>>  #define AVFILTER_TINTERLACE_H
>>
>> +#include "libavutil/bswap.h"
>>  #include "libavutil/opt.h"
>> +#include "libavutil/pixdesc.h"
>>  #include "drawutils.h"
>>  #include "avfilter.h"
>>
>> @@ -60,8 +62,9 @@ typedef struct TInterlaceContext {
>>  int black_linesize[4];
>>  FFDrawContext draw;
>>  FFDrawColor color;
>> +const AVPixFmtDescriptor *csp;
>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t
> *srcp,
>> - ptrdiff_t mref, ptrdiff_t pref);
>> + ptrdiff_t mref, ptrdiff_t pref, int
>>> clip_max);
>>  } TInterlaceContext;
>>
>>  void ff_tinterlace_init_x86(TInterlaceContext *interlace);
>> diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
>> index 55bf782..bfba054 100644
>> --- a/libavfilter/vf_interlace.c
>> +++ b/libavfilter/vf_interlace.c
>> @@ -61,8 +61,8 @@ static const AVOption interlace_options[] = {
>>  AVFILTER_DEFINE_CLASS(interlace);
>>
>>  static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize,
>> -   const uint8_t *srcp,
>> -   ptrdiff_t mref, ptrdiff_t pref)
>> +   const uint8_t *srcp, ptrdiff_t mref,
>> +   ptrdiff_t pref, int clip_max)
>>  {
>>  const uint8_t *srcp_above = srcp + mref;
>>  const uint8_t *srcp_below = srcp + pref;
>> @@ -75,9 +75,28 @@ static void lowpass_line_c(uint8_t *dstp, ptrdiff_t
> linesize,
>

Re: [FFmpeg-devel] [PATCH 2/3 v2] avfilter/tinterlace: use drawutils for pad mode

2017-09-23 Thread James Almer
On 9/18/2017 10:28 PM, Thomas Mundt wrote:
> Patch 1/3 has already been applied.
> Patch attached.

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


Re: [FFmpeg-devel] libavcodec/hapdec : add support for HapAphaOnly decoding

2017-09-23 Thread Martin Vignali
Sorry, i made a mistake in the previous patchs

Correct patchs in attach

Martin


0001-libavformat-add-mov-dataformat-tag-for-HapAlphaOnly-.patch
Description: Binary data


0002-libavcodec-hapdec-add-support-HapAlphaOnly.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] fate/hapdec : add test for hap alpha only

2017-09-23 Thread Martin Vignali
Hello,

sample can be found here :
https://we.tl/cP0pW9IfBJ

and need to be put inside ./fate-suite/hap

both sample are hap alpha only,
one is without snappy compression and the other with snappy (1 chunk)

Need to be apply after patchs in discussion :
libavcodec/hapdec : add support for HapAphaOnly decoding


Martin
Jokyo Images


0003-fate-hap-add-test-for-HapAlphaOnly.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] libavcodec/hapdec : add support for HapAphaOnly decoding

2017-09-23 Thread Martin Vignali
Hello,

Following this doc :
https://github.com/Vidvox/hap/blob/master/documentation/HapVideoDRAFT.md

Hap Alpha Only, is only an rgtc1 texture with or without snappy compression


Samples can found here (these samples have been create using the second
texture of an hapqa file (generate with Hap Quicktime plugin))
https://we.tl/cP0pW9IfBJ

These two samples can be decode in OpenGL mode with
the "reference" decoder : HapInAVF Test App
https://github.com/Vidvox/hap-in-avfoundation


I split the patch in two
one for libavformat, in order to add two data format tag for mov
HapA : for HAP Alpha Only
HAPM : for HAPQAlpha


In the hapdec patch, i add the lines to decode hapA, and more precise error
message
for HapM (i not split it in two patch, because there is only few lines in
each one)


Martin
Jokyo Images


0001-libavformat-add-mov-dataformat-tag-for-HapAlphaOnly-.patch
Description: Binary data


0002-libavcodec-hapdec-add-support-HapAlphaOnly.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] avformat/librtmp : new option (swfhash and swfsize)

2017-09-23 Thread Sinan Aksu
Hi,

I am not a developer, I am a user. I am trying to solve a problem that I am
experiencing myself. I need your help on this.

I am trying to record a live rtmp stream with FFmpeg. Live stream source
requires swf validation. But I have a compressed swf. FFmpeg can not find
the correct hash / size values.

For this reason, I have to manually assign these two values. In the Librtmp
library these options are available as manually adjustable. But FFmpeg does
not offer these options.

I followed these steps to add these options;

Step 1: I downloaded releases ffmpeg-snapshot.tar.bz2

Step 2: I reviewed ffmpeg \ libavformat \ rtmpproto.c.

I found these lines:
Line 109 ::: char*  swfhash;///< SHA256 hash of the
decompressed SWF file (32 bytes)
Line 110 ::: intswfhash_len;///< length of the SHA256 hash
Line 111 ::: intswfsize;///< size of the decompressed
SWF file

Line 3130 ::{"rtmp_swfhash", "SHA256 hash of the decompressed SWF file
(32 bytes).", OFFSET(swfhash), AV_OPT_TYPE_BINARY, .flags = DEC},
Line 3131 ::{"rtmp_swfsize", "Size of the decompressed SWF file,
required for SWFVerification.", OFFSET(swfsize), AV_OPT_TYPE_INT, {.i64 =
0}, 0, INT_MAX, DEC},


Step 3: I have reviewed ffmpeg \ libavformat \ librtmp.c.
Result: There were no rtmp_swfhash and rtmp_swfsize options.
I have added the following lines:

++  char *swfhash;
++  int swfsize;

++  {"rtmp_swfhash", "SHA256 hash of the decompressed SWF file (32
bytes).", OFFSET(swfhash), AV_OPT_TYPE_BINARY, .flags = DEC},
++  {"rtmp_swfsize", "Size of the decompressed SWF file, required for
SWFVerification.", OFFSET(swfsize), AV_OPT_TYPE_INT, {.i64 = 0}, 0,
INT_MAX, DEC},

Step 4: I compiled it again on ubuntu.
Step 5: I tested it.
Result: Accepted the options. He did not make a mistake. But it did not
work. The values ​​I assign to options are not included in the rtmp package.

WHERE DO I MISTAKE? Rtmpdump packet adds many options. But sending ffmpeg
package is missing.

FFmpeg Librtmp Result

Command : ./ffmpeg -loglevel debug  -i "rtmpe://ip/xlive" -rtmp_tcurl
"rtmpe://ip/xlive" -rtmp_app xlive -rtmp_flashver "WIN 23,0,0,162"
-rtmp_swfurl "http://local/Player.swf"; -rtmp_swfverify "
http://local/Player.swf"; -rtmp_swfhash
"50102110f085d9284d7f069e5e3a9150e4a241d7557d6d1f9e460fdf315875c8"
-rtmp_swfsize 611197 -rtmp_pageurl "http://local/?v=139363695"; -rtmp_conn
S:client -rtmp_conn S:3.1.0.10 -rtmp_conn S:en -rtmp_live live -live 1
-rtmp_playpath "raw:878162" -f flv -y aa.flv

Output Packet : RTMP_SendPacket: fd=4, size=172
  :  03 00 00 00 00 00 ac 14  00 00 00 00   
  :  02 00 07 63 6f 6e 6e 65  63 74 00 3f f0 00 00 00   ...connect.?
  0010:  00 00 00 03 00 03 61 70  70 02 00 05 78 6c 69 76   ..app...xliv
  0020:  65 00 05 74 63 55 72 6c  02 00 1b 72 74 6d 70 65   e..tcUrl...rtmpe
  0030:  3a 2f 2f 39 31 2e 31 39  32 2e 38 30 2e 32 31 30   ://ip
  0040:  2f 78 6c 69 76 65 00 04  66 70 61 64 01 00 00 0c   /xlive..fpad
  0050:  63 61 70 61 62 69 6c 69  74 69 65 73 00 40 2e 00   capabilities.@..
  0060:  00 00 00 00 00 00 0b 61  75 64 69 6f 43 6f 64 65   ...audioCode
  0070:  63 73 00 40 a8 ee 00 00  00 00 00 00 0b 76 69 64   c...@.vid
  :  c3 .
  :  65 6f 43 6f 64 65 63 73  00 40 6f 80 00 00 00 00   eoCodecs.@o.
  0010:  00 00 0d 76 69 64 65 6f  46 75 6e 63 74 69 6f 6e   ...videoFunction
  0020:  00 3f f0 00 00 00 00 00  00 00 00 09   .?..
Invoking connect


RTMPDump Librtmp Result

Command : rtmpdump --debug -r rtmpe://ip/xlive -a xlive -f WIN 23,0,0,162
-s "http://local/Player.swf"; -w
50102110f085d9284d7f069e5e3a9150e4a241d7557d6d1f9e460fdf315875c8 -x 611197
-p "http://local/?v=139363695"; -C S:client -C S:3.1.0.10 -C S:en --live -y
raw:"878162"


Output Packet : DEBUG2: RTMP_SendPacket: fd=328, size=373
DEBUG2:   :  03 00 00 00 00 01 75 14  00 00 00 00
..u.
DEBUG2:   :  02 00 07 63 6f 6e 6e 65  63 74 00 3f f0 00 00 00
...connect.?
DEBUG2:   0010:  00 00 00 03 00 03 61 70  70 02 00 05 78 6c 69 76
..app...xliv
DEBUG2:   0020:  65 00 08 66 6c 61 73 68  56 65 72 02 00 03 57 49
e..flashVer...WI
DEBUG2:   0030:  4e 00 06 73 77 66 55 72  6c 02 00 3c 68 74 74 70
N..swfUrl..http://local/?v
DEBUG2:   0020:  6f 72 74 33 36 35 2e 63  6f 6d 2f 76 69 65 77 65
=xxx
DEBUG2:   0030:  72 3f 67 61 6d 65 3d 31  33 39 32 39 37 34 35 37

DEBUG2:   0040:  00 0e 6f 62 6a 65 63 74  45 6e 63 6f 64 69 6e 67
..objectEncoding
DEBUG2:   0050:  00 40 08 00 00 00 00 00  00 00 00 09 02 00 06 63
.@.c
DEBUG2:   0060:  6c 69 65 6e 74 02 00 08  33 2e 31 2e 30 2e 31 30
lient...3.1.0.10
DEBUG2:   0070:  02 00 02 65 6e ...en
DEBUG: Invoking connect
INFO: Connected...

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

[FFmpeg-devel] libavcodec/hapenc : add support for hap alpha only encoding

2017-09-23 Thread Martin Vignali
Hello,

In attach patch for Hap Alpha encoding

Patch 1 : 0004-libavcodec-texturedspenc-add-rgtc1u-encoding
Add rgtc1u encoding in the texture dsp enc

Patch 2 : 0005-libavcodec-hapenc-add-support-for-hap-alpha-only-enc
enable hap alpha only encoding in hapenc (and doc)
Ratio need to be 8 for RGTC1 otherwise, only ffmpeg can decode the frame
(the official hap lib failed to read the frame)

To test :
FFmpeg need to be compile with snappy library (--enable-libsnappy)

./ffmpeg -i fileRgba -c:v hap -format hap_alpha_only res.mov

I test the result in the 3 hap mode (with ffmpeg (with previous patch for
hap alpha only decoding decoding) and HapInAVFoundation test app (in OpenGL
mode))

compressor None
compressor snappy 1 chunk
compressor snappy 16 chunks


Martin
Jokyo Images


0004-libavcodec-texturedspenc-add-rgtc1u-encoding.patch
Description: Binary data


0005-libavcodec-hapenc-add-support-for-hap-alpha-only-enc.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Supporting DirecTV captioning.

2017-09-23 Thread Helmut K. C. Tessarek
On 2017-09-22 16:34, Joseph Van Riper wrote:
> I would prefer not to sprinkle changes throughout something
> if I can avoid it.

Have you thought about a third party library then?

This library can be maintained by the DirecTV folks and you can work on
the glue between ffmpeg and the lib.

The library can still use calls to existing functions...

Cheers,
  K. C.

-- 
regards Helmut K. C. Tessarek  KeyID 0xF7832007C11F128D
Key fingerprint = 28A3 1666 4FE8 D72C CFD5 8B23 F783 2007 C11F 128D

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavdevice/v4l2: fix invalid access to struct v4l2_buffer

2017-09-23 Thread Michael Niedermayer
On Wed, Sep 20, 2017 at 03:14:54PM +0200, Jaroslav Beran wrote:
> In case we are short of queued buffers, at first v4l2_buffer was enqueued to 
> kernel so it's not owned by
> user-space anymore. After that it's timestamp field was read, but it might be 
> overwritten by driver at
> that moment. It resulted in invalid timestamp sometimes.
> ---
>  libavdevice/v4l2.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

will apply

thanks

[...]
-- 
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


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/snowenc: Replace "return -1" by named constants

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 10:14:01PM -0300, James Almer wrote:
> On 9/22/2017 10:01 PM, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/snowenc.c | 10 +-
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
> > index bb113d0a2b..f5497f958c 100644
> > --- a/libavcodec/snowenc.c
> > +++ b/libavcodec/snowenc.c
> > @@ -50,7 +50,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
> > && (avctx->flags & AV_CODEC_FLAG_QSCALE)
> > && avctx->global_quality == 0){
> >  av_log(avctx, AV_LOG_ERROR, "The 9/7 wavelet is incompatible with 
> > lossless mode.\n");
> > -return -1;
> > +return AVERROR(EINVAL);
> >  }
> >  #if FF_API_MOTION_EST
> >  FF_DISABLE_DEPRECATION_WARNINGS
> > @@ -107,8 +107,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >  return AVERROR(ENOMEM);
> >  }
> >  if((avctx->flags&AV_CODEC_FLAG_PASS2) || 
> > !(avctx->flags&AV_CODEC_FLAG_QSCALE)){
> > -if(ff_rate_control_init(&s->m) < 0)
> > -return -1;
> > +if((ret = ff_rate_control_init(&s->m)) < 0)
> > +return ret;
> 
> ret = foo();
> if (ret < 0)
> return ret;
> 
> No more combined assignment and comparisons for new code if possible.
> It's too prone to mistakes.

I dont make that mistake (anymore), but yes it gives a bad example.
Will change


> 
> >  }
> >  s->pass1_rc= !(avctx->flags & 
> > (AV_CODEC_FLAG_QSCALE|AV_CODEC_FLAG_PASS2));
> >  
> > @@ -130,7 +130,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >  break;*/
> >  default:
> >  av_log(avctx, AV_LOG_ERROR, "pixel format not supported\n");
> > -return -1;
> > +return AVERROR_PATCHWELCOME;
> >  }
> >  avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, 
> > &s->chroma_v_shift);
> >  
> > @@ -833,7 +833,7 @@ static int encode_subband_c0run(SnowContext *s, SubBand 
> > *b, const IDWTELEM *src,
> >  for(y=0; y >  if(s->c.bytestream_end - s->c.bytestream < w*40){
> >  av_log(s->avctx, AV_LOG_ERROR, "encoded frame too 
> > large\n");
> > -return -1;
> > +return AVERROR(ENOMEM);
> >  }
> >  for(x=0; x >  int v, p=0;
> > 
> 
> Should be good aside from the above.

will apply

thanks

[...]
-- 
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] [PATCH 1/2] avcodec/flacenc: Replace "return -1" by named constant

2017-09-23 Thread Michael Niedermayer
On Sat, Sep 23, 2017 at 03:01:53AM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/flacenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


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


Re: [FFmpeg-devel] [PATCH] avcodec/hevc_sei: Support HEVC paired fields.

2017-09-23 Thread Michael Niedermayer
On Thu, Sep 14, 2017 at 08:39:19PM -0500, Brian Matherly wrote:
> Correctly set frame.interlaced and frame.top_field_first when pic_struct
> indicates paired fields.

Do you have a (small) sample that gets fixed by this ?

Can you make a fate test for this case ?

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

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


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


[FFmpeg-devel] [PATCH 2/3] avformat: replace all uses of av_copy_packet()

2017-09-23 Thread James Almer
Signed-off-by: James Almer 
---
 libavformat/aiffenc.c   | 2 +-
 libavformat/apngenc.c   | 4 ++--
 libavformat/gif.c   | 4 ++--
 libavformat/img2enc.c   | 2 +-
 libavformat/movenc.c| 4 ++--
 libavformat/mp3enc.c| 2 +-
 libavformat/subtitles.c | 2 +-
 libavformat/webpenc.c   | 2 +-
 libavformat/wtvenc.c| 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index fcadf149a0..7687e71b76 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -233,7 +233,7 @@ static int aiff_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (!pict_list)
 return AVERROR(ENOMEM);
 
-if ((ret = av_copy_packet(&pict_list->pkt, pkt)) < 0) {
+if ((ret = av_packet_ref(&pict_list->pkt, pkt)) < 0) {
 av_freep(&pict_list);
 return ret;
 }
diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c
index d4191c02cc..77c1c916c2 100644
--- a/libavformat/apngenc.c
+++ b/libavformat/apngenc.c
@@ -218,7 +218,7 @@ static int flush_packet(AVFormatContext *format_context, 
AVPacket *packet)
 
 av_packet_unref(apng->prev_packet);
 if (packet)
-av_copy_packet(apng->prev_packet, packet);
+av_packet_ref(apng->prev_packet, packet);
 return 0;
 }
 
@@ -232,7 +232,7 @@ static int apng_write_packet(AVFormatContext 
*format_context, AVPacket *packet)
 if (!apng->prev_packet)
 return AVERROR(ENOMEM);
 
-av_copy_packet(apng->prev_packet, packet);
+av_packet_ref(apng->prev_packet, packet);
 } else {
 ret = flush_packet(format_context, packet);
 if (ret < 0)
diff --git a/libavformat/gif.c b/libavformat/gif.c
index d6113dbc85..01d98a27b0 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -175,7 +175,7 @@ static int flush_packet(AVFormatContext *s, AVPacket *new)
 
 av_packet_unref(gif->prev_pkt);
 if (new)
-av_copy_packet(gif->prev_pkt, new);
+av_packet_ref(gif->prev_pkt, new);
 
 return 0;
 }
@@ -206,7 +206,7 @@ static int gif_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 gif_image_write_header(s->pb, video_st, gif->loop, palette);
 }
 
-return av_copy_packet(gif->prev_pkt, pkt);
+return av_packet_ref(gif->prev_pkt, pkt);
 }
 return flush_packet(s, pkt);
 }
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 87b5ec2317..9b60bfc75c 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -161,7 +161,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 st->id = pkt->stream_index;
 
 fmt->pb = pb[0];
-if ((ret = av_copy_packet(&pkt2, pkt))< 0 
||
+if ((ret = av_packet_ref(&pkt2, pkt)) < 0 
||
 (ret = av_dup_packet(&pkt2))  < 0 
||
 (ret = avcodec_parameters_copy(st->codecpar, 
s->streams[0]->codecpar)) < 0 ||
 (ret = avformat_write_header(fmt, NULL))  < 0 
||
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 10b959ad02..aa0b60c345 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -438,7 +438,7 @@ concatenate:
 
 if (!info->num_blocks) {
 int ret;
-if ((ret = av_copy_packet(&info->pkt, pkt)) < 0)
+if ((ret = av_packet_ref(&info->pkt, pkt)) < 0)
 return ret;
 info->num_blocks = num_blocks;
 return 0;
@@ -454,7 +454,7 @@ concatenate:
 if (info->num_blocks != 6)
 return 0;
 av_packet_unref(pkt);
-if ((ret = av_copy_packet(pkt, &info->pkt)) < 0)
+if ((ret = av_packet_ref(pkt, &info->pkt)) < 0)
 return ret;
 av_packet_unref(&info->pkt);
 info->num_blocks = 0;
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 3cbf7bd137..826878eca1 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -523,7 +523,7 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 return mp3_write_audio_packet(s, pkt);
 }
 
-ret = av_copy_packet(&pktl->pkt, pkt);
+ret = av_packet_ref(&pktl->pkt, pkt);
 if (ret < 0) {
 av_freep(&pktl);
 return ret;
diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c
index 108f909c84..93c9ef05cf 100644
--- a/libavformat/subtitles.c
+++ b/libavformat/subtitles.c
@@ -211,7 +211,7 @@ int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue 
*q, AVPacket *pkt)
 
 if (q->current_sub_idx == q->nb_subs)
 return AVERROR_EOF;
-if (av_copy_packet(pkt, sub) < 0) {
+if (av_packet_ref(pkt, sub) < 0) {
 return AVERROR(ENOMEM);
 }
 
diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c
index 2e0147cefd..9fb472257d 100644
--- a/libavformat/webpenc.c
+++ b/libavformat/webpenc.c
@@ -158,7 +158,7 @@ static int webp_write_packet(

[FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: deprecate av_copy_packet()

2017-09-23 Thread James Almer
It does the same thing as av_packet_ref().

Signed-off-by: James Almer 
---
 libavcodec/avcodec.h  | 3 +++
 libavcodec/avpacket.c | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bca9f30de3..693e988c09 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -4614,7 +4614,10 @@ int av_dup_packet(AVPacket *pkt);
  * Copy packet, including contents
  *
  * @return 0 on success, negative AVERROR on fail
+ *
+ * @deprecated Use av_packet_ref
  */
+attribute_deprecated
 int av_copy_packet(AVPacket *dst, const AVPacket *src);
 
 /**
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 5ce3228166..b07180eac8 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -247,8 +247,6 @@ failed_alloc:
 av_packet_unref(pkt);
 return AVERROR(ENOMEM);
 }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 
 int av_dup_packet(AVPacket *pkt)
 {
@@ -266,6 +264,8 @@ int av_copy_packet(AVPacket *dst, const AVPacket *src)
 *dst = *src;
 return copy_packet_data(dst, src, 0);
 }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
 void av_packet_free_side_data(AVPacket *pkt)
 {
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 3/3] ffplay: replace use of av_copy_packet()

2017-09-23 Thread James Almer
Signed-off-by: James Almer 
---
 ffplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 45f2d78443..9f7774613c 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2978,7 +2978,7 @@ static int read_thread(void *arg)
 if (is->queue_attachments_req) {
 if (is->video_st && is->video_st->disposition & 
AV_DISPOSITION_ATTACHED_PIC) {
 AVPacket copy = { 0 };
-if ((ret = av_copy_packet(©, &is->video_st->attached_pic)) 
< 0)
+if ((ret = av_packet_ref(©, &is->video_st->attached_pic)) 
< 0)
 goto fail;
 packet_queue_put(&is->videoq, ©);
 packet_queue_put_nullpacket(&is->videoq, is->video_stream);
-- 
2.14.1

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


Re: [FFmpeg-devel] [PATCH] avformat/async: allow to set buffer size [v2]

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 04:25:33PM +0900, Takayuki 'January June' Suwa wrote:
> - add "-asyncbufsize" option to async:
> - refactor async.c
>   - remove READ_BACK_CAPACITY and the 3rd arg of ring_init()
>   - replace some magicnums with symconst macros

This should be several patches as they are independant changes

[...]
> @@ -466,6 +469,7 @@ static int64_t async_seek(URLContext *h, int64_t pos, int 
> whence)
>  #define D AV_OPT_FLAG_DECODING_PARAM
>  
>  static const AVOption options[] = {

> +{ "asyncbufsize", "Amount in bytes that may be used for asynchronous 
> data buffering", OFFSET(asyncbufsize), AV_OPT_TYPE_INT, { .i64 = 
> BUFFER_CAPACITY }, 0, INT_MAX, D },

the minimum should probably be BUFFER_CAPACITY_MIN and not 0

[...]
-- 
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


Re: [FFmpeg-devel] [PATCH] avcodec/mips: Unrolled loops avc intra msa functions

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 11:37:54AM +, Manojkumar Bhosale wrote:
> LGTM

applied

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

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


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


Re: [FFmpeg-devel] [PATCH] avcodec/mips: Improve hevc uni-w copy mc msa functions

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 11:37:27AM +, Manojkumar Bhosale wrote:
> LGTM

applied

[...]
-- 
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] avcodec/mips: Improve avc chroma horiz mc msa functions

2017-09-23 Thread Michael Niedermayer
On Fri, Sep 22, 2017 at 11:38:09AM +, Manojkumar Bhosale wrote:
> LGTM

applied

thx

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato


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


[FFmpeg-devel] [PATCH] [PATCH v7] Add support for RockChip Media Process Platform

2017-09-23 Thread LongChair .
From: Lionel CHAZALLON 

This adds hardware decoding for h264 / HEVC / VP8 using MPP Rockchip API.
Will return frames holding an AVDRMFrameDescriptor struct in buf[0] that allows 
drm / dmabuf usage.
Was tested on RK3288 (TinkerBoard) and RK3328.

Changes from Previous patch :
- Frame colorspace info is now filled.
- Frame interlacing is now filled (Note : currently had a bug in mpp which will 
be fixed soon by rockchip, will set the to progressive).
- hw_frame_context returns none as format for the rockchip specific 10 bits.
- Added support for VP9 codec.
- removed MPG4 codec : it seems that MPP doesn't handle properly all the MPEG4 
formats
- removed MPEG2 : there is still an issue with MPEG2 decoder, this is being 
investigated by RockChip.
- the ION format has been kept for MPP init (rather than DRM) as this is the 
only one working right, using DRM format will cause assertions upon close.
- Other minor comments have been taken into account
---
 Changelog  |   2 +-
 configure  |  15 ++
 libavcodec/Makefile|   4 +
 libavcodec/allcodecs.c |   4 +
 libavcodec/rkmppdec.c  | 591 +
 5 files changed, 615 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/rkmppdec.c

diff --git a/Changelog b/Changelog
index 678dcda..0006430 100644
--- a/Changelog
+++ b/Changelog
@@ -50,7 +50,7 @@ version :
 - KMS screen grabber
 - CUDA thumbnail filter
 - V4L2 mem2mem HW assisted codecs
-
+- Rockchip MPP hardware decoding
 
 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/configure b/configure
index 16fc2bd..a08653c 100755
--- a/configure
+++ b/configure
@@ -316,6 +316,7 @@ External library support:
   --disable-nvenc  disable Nvidia video encoding code [autodetect]
   --enable-omx enable OpenMAX IL code [no]
   --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
+  --enable-rkmpp   enable Rockchip Media Process Platform code [no]
   --disable-vaapi  disable Video Acceleration API (mainly Unix/Intel) 
code [autodetect]
   --disable-vdadisable Apple Video Decode Acceleration code 
[autodetect]
   --disable-vdpau  disable Nvidia Video Decode and Presentation API 
for Unix code [autodetect]
@@ -1548,6 +1549,7 @@ EXTERNAL_LIBRARY_VERSION3_LIST="
 libopencore_amrnb
 libopencore_amrwb
 libvo_amrwbenc
+rkmpp
 "
 
 EXTERNAL_LIBRARY_GPLV3_LIST="
@@ -2782,6 +2784,8 @@ h264_qsv_decoder_deps="libmfx"
 h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec 
h264_qsv_hwaccel"
 h264_qsv_encoder_deps="libmfx"
 h264_qsv_encoder_select="qsvenc"
+h264_rkmpp_decoder_deps="rkmpp"
+h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
 h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
 h264_vaapi_encoder_select="vaapi_encode golomb"
 h264_vda_decoder_deps="vda"
@@ -2799,6 +2803,8 @@ hevc_qsv_decoder_deps="libmfx"
 hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec 
hevc_qsv_hwaccel"
 hevc_qsv_encoder_deps="libmfx"
 hevc_qsv_encoder_select="hevcparse qsvenc"
+hevc_rkmpp_decoder_deps="rkmpp"
+hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
 hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
 hevc_vaapi_encoder_select="vaapi_encode golomb"
 hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
@@ -2845,12 +2851,14 @@ vp8_cuvid_decoder_deps="cuda cuvid"
 vp8_mediacodec_decoder_deps="mediacodec"
 vp8_qsv_decoder_deps="libmfx"
 vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser"
+vp8_rkmpp_decoder_deps="rkmpp"
 vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
 vp8_vaapi_encoder_select="vaapi_encode"
 vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
 vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
 vp9_cuvid_decoder_deps="cuda cuvid"
 vp9_mediacodec_decoder_deps="mediacodec"
+vp9_rkmpp_decoder_deps="rkmpp"
 vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
 vp9_vaapi_encoder_select="vaapi_encode"
 vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
@@ -6060,6 +6068,13 @@ enabled openssl   && { use_pkg_config openssl 
openssl/ssl.h OPENSSL_init
check_lib openssl openssl/ssl.h 
SSL_library_init -lssl32 -leay32 ||
check_lib openssl openssl/ssl.h 
SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
+enabled rkmpp && { { require_pkg_config rockchip_mpp 
rockchip/rk_mpi.h mpp_create ||
+ die "ERROR : Rockchip MPP was not found."; } 
&&
+   { check_func_headers rockchip/rk_mpi_cmd.h 
"MPP_DEC_GET_FREE_PACKET_SLOT_COUNT" ||
+ die "ERROR: Rockchip MPP is outdated, please 
get a more recent one."; } &&
+   { enabled libdrm ||
+ die "ERROR: rkmpp requires --enable-libdrm"; }
+ }
 
 if enabled gcrypt