Re: [FFmpeg-devel] [PATCH 1/3] lavu/attributes: introduce av_likely, av_unlikely

2016-02-24 Thread wm4
On Thu, 25 Feb 2016 15:48:17 +1100
Matt Oliver  wrote:

> On 25 February 2016 at 13:20, Ganesh Ajjanagadde  wrote:
> 
> > From: Ganesh Ajjanagadde 
> >
> > These use __builtin_expect, and may be useful for optimizing nearly
> > certain branches, to yield size and/or speed improvements.
> >
> > Note that this is used in the Linux kernel for the same purpose. For
> > some idea as to potential benefits, see e.g
> > http://blog.man7.org/2012/10/how-much-do-builtinexpect-likely-and.html.
> >
> > Signed-off-by: Ganesh Ajjanagadde 
> > ---
> >  libavutil/attributes.h | 8 
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> > index 5c6b9de..1547033 100644
> > --- a/libavutil/attributes.h
> > +++ b/libavutil/attributes.h
> > @@ -58,6 +58,14 @@
> >  #define av_warn_unused_result
> >  #endif
> >
> > +#if AV_GCC_VERSION_AT_LEAST(3,0)
> > +#define av_likely(x) __builtin_expect(!!(x), 1)
> > +#define av_unlikely(x) __builtin_expect(!!(x), 0)
> > +#else
> > +#define av_likely(x) (x)
> > +#define av_unlikely(x) (x)
> > +#endif
> > +
> >  #if AV_GCC_VERSION_AT_LEAST(3,1)
> >  #define av_noinline __attribute__((noinline))
> >  #elif defined(_MSC_VER)
> >  
> 
> Ive used these builtins before and can confirm that they are useful
> (although requires devs to use them obviously). I will also point out that
> these are also supported by ICC/ICL as well.

They also make code ugly as fuck, and are more cargo-cult than anything
else. They might possibly be ok in some very critical parts of the
code, but otherwise not at all.

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


Re: [FFmpeg-devel] [PATCH 1/3] lavu/attributes: introduce av_likely, av_unlikely

2016-02-24 Thread Matt Oliver
On 25 February 2016 at 13:20, Ganesh Ajjanagadde  wrote:

> From: Ganesh Ajjanagadde 
>
> These use __builtin_expect, and may be useful for optimizing nearly
> certain branches, to yield size and/or speed improvements.
>
> Note that this is used in the Linux kernel for the same purpose. For
> some idea as to potential benefits, see e.g
> http://blog.man7.org/2012/10/how-much-do-builtinexpect-likely-and.html.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/attributes.h | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> index 5c6b9de..1547033 100644
> --- a/libavutil/attributes.h
> +++ b/libavutil/attributes.h
> @@ -58,6 +58,14 @@
>  #define av_warn_unused_result
>  #endif
>
> +#if AV_GCC_VERSION_AT_LEAST(3,0)
> +#define av_likely(x) __builtin_expect(!!(x), 1)
> +#define av_unlikely(x) __builtin_expect(!!(x), 0)
> +#else
> +#define av_likely(x) (x)
> +#define av_unlikely(x) (x)
> +#endif
> +
>  #if AV_GCC_VERSION_AT_LEAST(3,1)
>  #define av_noinline __attribute__((noinline))
>  #elif defined(_MSC_VER)
>

Ive used these builtins before and can confirm that they are useful
(although requires devs to use them obviously). I will also point out that
these are also supported by ICC/ICL as well.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] FFmpeg in Outreachy Round 12

2016-02-24 Thread Michael Niedermayer
On Thu, Feb 25, 2016 at 04:35:37AM +0100, Michael Niedermayer wrote:
> Hi Marina
> 
> Thu, Feb 18, 2016 at 08:29:53PM -0500, Marina Zhurakhinskaya wrote:
> > - Original Message -
> > > From: "Michael Niedermayer" 
> > > To: "FFmpeg development discussions and patches" 
> > > Cc: "outreachy-admins" , o...@ffmpeg.org
> > > Sent: Wednesday, February 17, 2016 11:09:31 PM
> > > Subject: Re: [FFmpeg-devel] FFmpeg in Outreachy Round 12
> > > 
> > > On Tue, Feb 09, 2016 at 09:14:57PM -0500, Marina Zhurakhinskaya wrote:
> > > > Hi,
> > > > 
> > > > Glad FFmpeg will participate in this round! Thank you for making a 
> > > > decision
> > > > to allocate the funds for Outreachy!
> > > > 
> > > > We can credit all three of you as coordinators. Please be sure to
> > > > coordinate among yourselves on making decisions and/or having each one 
> > > > of
> > > > you empowered to make decisions.
> > > > 
> > > > What should the updated description be, given the project ideas you have
> > > > this round? Last year, it was "FFmpeg is the universal multimedia 
> > > > toolkit:
> > > > a complete, cross-platform solution to record, convert, filter and 
> > > > stream
> > > > audio and video. Available projects like FFv1 codecs frame support and
> > > > postprocessing optimization involve coding in C."
> > > 
> > > not sure anyone replied already but the postprocessing optimization should
> > > probably be removed.
> > > Its still available if someone really wants to work on it but its
> > > not so trivial, requiring good knowledge of x86 asm ...
> > 
> > Thanks! I added FFmpeg with the following description:
> > 
> > "FFmpeg is the universal multimedia toolkit: a complete, cross-platform 
> > solution to record, convert, filter and stream audio and video. Available 
> > projects like FFv1 codecs frame support, scaling improvement, and adding 
> > selftests involve coding in C. Another project involves creating a fuzzing 
> > testsuite and a web interface for it in Python or node.js."
> 
> can you change the link for FFmpeg on
> https://wiki.gnome.org/action/login/Outreachy/2016/MayAugust
> to point to our outreachy page
> https://trac.ffmpeg.org/wiki/SponsoringPrograms/Outreachy/2016-05
> currently it points to an empty page, i didnt see a way to change it

speaking of the page

@kieran, our ideas page seems seriously not uptodate compared to our
GSoC page, it lists only a subset of projects and only a subset of
mentors compared to it
you are the admin this year ...

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes


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


Re: [FFmpeg-devel] FFmpeg in Outreachy Round 12

2016-02-24 Thread Michael Niedermayer
Hi Marina

Thu, Feb 18, 2016 at 08:29:53PM -0500, Marina Zhurakhinskaya wrote:
> - Original Message -
> > From: "Michael Niedermayer" 
> > To: "FFmpeg development discussions and patches" 
> > Cc: "outreachy-admins" , o...@ffmpeg.org
> > Sent: Wednesday, February 17, 2016 11:09:31 PM
> > Subject: Re: [FFmpeg-devel] FFmpeg in Outreachy Round 12
> > 
> > On Tue, Feb 09, 2016 at 09:14:57PM -0500, Marina Zhurakhinskaya wrote:
> > > Hi,
> > > 
> > > Glad FFmpeg will participate in this round! Thank you for making a 
> > > decision
> > > to allocate the funds for Outreachy!
> > > 
> > > We can credit all three of you as coordinators. Please be sure to
> > > coordinate among yourselves on making decisions and/or having each one of
> > > you empowered to make decisions.
> > > 
> > > What should the updated description be, given the project ideas you have
> > > this round? Last year, it was "FFmpeg is the universal multimedia toolkit:
> > > a complete, cross-platform solution to record, convert, filter and stream
> > > audio and video. Available projects like FFv1 codecs frame support and
> > > postprocessing optimization involve coding in C."
> > 
> > not sure anyone replied already but the postprocessing optimization should
> > probably be removed.
> > Its still available if someone really wants to work on it but its
> > not so trivial, requiring good knowledge of x86 asm ...
> 
> Thanks! I added FFmpeg with the following description:
> 
> "FFmpeg is the universal multimedia toolkit: a complete, cross-platform 
> solution to record, convert, filter and stream audio and video. Available 
> projects like FFv1 codecs frame support, scaling improvement, and adding 
> selftests involve coding in C. Another project involves creating a fuzzing 
> testsuite and a web interface for it in Python or node.js."

can you change the link for FFmpeg on
https://wiki.gnome.org/action/login/Outreachy/2016/MayAugust
to point to our outreachy page
https://trac.ffmpeg.org/wiki/SponsoringPrograms/Outreachy/2016-05
currently it points to an empty page, i didnt see a way to change it


[...]
-- 
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 3/3] lavu/rational: add more info regarding floor(x+0.5) usage

2016-02-24 Thread Ganesh Ajjanagadde
Add some more verbose info regarding why the imprecise and slow floor(x+0.5) 
hack
is used; helpful for future maintenance.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/rational.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/rational.c b/libavutil/rational.c
index 3e841ad..22cf665 100644
--- a/libavutil/rational.c
+++ b/libavutil/rational.c
@@ -115,7 +115,8 @@ AVRational av_d2q(double d, int max)
 frexp(d, );
 exponent = FFMAX(exponent-1, 0);
 den = 1LL << (61 - exponent);
-// (int64_t)rint() and llrint() do not work with gcc on ia64 and sparc64
+// (int64_t)rint() and llrint() do not work with gcc on ia64 and sparc64,
+// see Ticket2713 for affected gcc/glibc versions
 av_reduce(, , floor(d * den + 0.5), den, max);
 if ((!a.num || !a.den) && d && max>0 && max

[FFmpeg-devel] [PATCH 1/3] lavu/attributes: introduce av_likely, av_unlikely

2016-02-24 Thread Ganesh Ajjanagadde
From: Ganesh Ajjanagadde 

These use __builtin_expect, and may be useful for optimizing nearly
certain branches, to yield size and/or speed improvements.

Note that this is used in the Linux kernel for the same purpose. For
some idea as to potential benefits, see e.g
http://blog.man7.org/2012/10/how-much-do-builtinexpect-likely-and.html.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/attributes.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index 5c6b9de..1547033 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -58,6 +58,14 @@
 #define av_warn_unused_result
 #endif
 
+#if AV_GCC_VERSION_AT_LEAST(3,0)
+#define av_likely(x) __builtin_expect(!!(x), 1)
+#define av_unlikely(x) __builtin_expect(!!(x), 0)
+#else
+#define av_likely(x) (x)
+#define av_unlikely(x) (x)
+#endif
+
 #if AV_GCC_VERSION_AT_LEAST(3,1)
 #define av_noinline __attribute__((noinline))
 #elif defined(_MSC_VER)
-- 
2.7.1

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


[FFmpeg-devel] [PATCH 2/3] lavu/rational: use av_unlikely in av_d2q

2016-02-24 Thread Ganesh Ajjanagadde
From: Ganesh Ajjanagadde 

Merely a simple illustration of av_unlikely's utility; there are
certainly more interesting use cases.

Actual performance benefit is impossible to accurately quantify due to the
context-dependence of the branch predictor. Nonetheless, as a ballpark
estimate, it yields ~ 5% improvements in testing via FATE on x86-64, 
Haswell+GCC.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/rational.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/rational.c b/libavutil/rational.c
index 6b3f50a..3e841ad 100644
--- a/libavutil/rational.c
+++ b/libavutil/rational.c
@@ -108,9 +108,9 @@ AVRational av_d2q(double d, int max)
 AVRational a;
 int exponent;
 int64_t den;
-if (isnan(d))
+if (av_unlikely(isnan(d)))
 return (AVRational) { 0,0 };
-if (fabs(d) > INT_MAX + 3LL)
+if (av_unlikely(fabs(d) > INT_MAX + 3LL))
 return (AVRational) { d < 0 ? -1 : 1, 0 };
 frexp(d, );
 exponent = FFMAX(exponent-1, 0);
-- 
2.7.1

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


[FFmpeg-devel] [PATCH] fate: Add test for packed mp3 in mp4 demuxing

2016-02-24 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 tests/fate/demux.mak |3 +
 tests/ref/fate/mov-mp3-demux |  289 ++
 2 files changed, 292 insertions(+)
 create mode 100644 tests/ref/fate/mov-mp3-demux

diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index e48d398..10a8f33 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -56,6 +56,9 @@ fate-mkv: CMD = framecrc -i 
$(TARGET_SAMPLES)/mkv/test7_cut.mkv -c copy
 FATE_SAMPLES_DEMUX-$(CONFIG_MLV_DEMUXER) += fate-mlv-demux
 fate-mlv-demux: CMD = crc -i $(TARGET_SAMPLES)/mlv/M19-0333-cut.MLV -c copy
 
+FATE_SAMPLES_DEMUX-$(CONFIG_MOV_DEMUXER) += fate-mov-mp3-demux
+fate-mov-mp3-demux: CMD = framecrc -i 
$(TARGET_SAMPLES)/mpegaudio/packed_maindata.mp3.mp4 -c copy
+
 FATE_SAMPLES_DEMUX-$(CONFIG_MTV_DEMUXER) += fate-mtv
 fate-mtv: CMD = framecrc -i $(TARGET_SAMPLES)/mtv/comedian_auto-partial.mtv -c 
copy
 
diff --git a/tests/ref/fate/mov-mp3-demux b/tests/ref/fate/mov-mp3-demux
new file mode 100644
index 000..b4b2cef
--- /dev/null
+++ b/tests/ref/fate/mov-mp3-demux
@@ -0,0 +1,289 @@
+#tb 0: 1/44100
+0,  0,  0, 1152,   36, 0x8e260589
+0,   1152,   1152, 1152,   36, 0x8e260589
+0,   2304,   2304, 1152,   36, 0x8e260589
+0,   3456,   3456, 1152,   36, 0x8e260589
+0,   4608,   4608, 1152,   36, 0x8e260589
+0,   5760,   5760, 1152,   36, 0x8e260589
+0,   6912,   6912, 1152,   69, 0xdb550f09
+0,   8064,   8064, 1152,  104, 0xbaeb1aa8
+0,   9216,   9216, 1152,  104, 0xbaeb1aa8
+0,  10368,  10368, 1152,  104, 0xbaeb1aa8
+0,  11520,  11520, 1152,  104, 0xbaeb1aa8
+0,  12672,  12672, 1152,  104, 0xbaeb1aa8
+0,  13824,  13824, 1152,  104, 0xbaeb1aa8
+0,  14976,  14976, 1152,   36, 0x8e260589
+0,  16128,  16128, 1152,  601, 0xc34f1dc9
+0,  17280,  17280, 1152,  716, 0x6c2665e5
+0,  18432,  18432, 1152,  672, 0xf9873f4b
+0,  19584,  19584, 1152,  631, 0xd1cc
+0,  20736,  20736, 1152,  604, 0xc0bb13e5
+0,  21888,  21888, 1152,  642, 0x4e873319
+0,  23040,  23040, 1152,  631, 0xcf701e7d
+0,  24192,  24192, 1152,  632, 0x27773046
+0,  25344,  25344, 1152,  609, 0x7ec21e53
+0,  26496,  26496, 1152,  582, 0xd68e0d59
+0,  27648,  27648, 1152,  550, 0x5b1303ee
+0,  28800,  28800, 1152,  581, 0x73dc12e4
+0,  29952,  29952, 1152,  545, 0x530f085a
+0,  31104,  31104, 1152,  556, 0xff0cfd9a
+0,  32256,  32256, 1152,  567, 0x3c330743
+0,  33408,  33408, 1152,  564, 0x2c3a1144
+0,  34560,  34560, 1152,  913, 0x74b08ab7
+0,  35712,  35712, 1152,  681, 0x2669444a
+0,  36864,  36864, 1152,  615, 0x60a41b1a
+0,  38016,  38016, 1152,  670, 0x53793367
+0,  39168,  39168, 1152,  666, 0x8c453c1a
+0,  40320,  40320, 1152,  613, 0x679f17a4
+0,  41472,  41472, 1152,  561, 0x357405c0
+0,  42624,  42624, 1152,  527, 0x687afacb
+0,  43776,  43776, 1152,  515, 0xf99dfb73
+0,  44928,  44928, 1152,  560, 0xa9ca0767
+0,  46080,  46080, 1152,  550, 0xb1ce0990
+0,  47232,  47232, 1152,  494, 0x3fd2f2c8
+0,  48384,  48384, 1152,  518, 0x9c5b0242
+0,  49536,  49536, 1152,  520, 0xbfdc0877
+0,  50688,  50688, 1152,  512, 0x4988f94b
+0,  51840,  51840, 1152,  786, 0xf3cf61de
+0,  52992,  52992, 1152,  713, 0x2f1c46b4
+0,  54144,  54144, 1152,  616, 0x210327d8
+0,  55296,  55296, 1152,  632, 0x39d430d4
+0,  56448,  56448, 1152,  615, 0xd7231930
+0,  57600,  57600, 1152,  620, 0xb7023663
+0,  58752,  58752, 1152,  585, 0x9e90100a
+0,  59904,  59904, 1152,  583, 0xe4152b2a
+0,  61056,  61056, 1152,  614, 0x0d572ebf
+0,  62208,  62208, 1152,  636, 0x9d1f2e6b
+0,  63360,  63360, 1152,  603, 0x2e33240f
+0,  64512,  64512, 1152,  627, 0x2c7e204c
+0,  65664,  65664, 1152,  626, 0x5cc3254b
+0,  66816,  66816, 1152,  626, 0xe8fd34df
+0,  67968,  67968, 1152,  600, 0x33a926d5
+0,  69120,  69120, 1152,  777, 0x4cd66f53
+0,  70272,  70272, 1152,  753, 0x8b297901
+0,  71424,  71424, 1152,  657, 0xd10e302f
+0,  72576,  72576, 1152,  611, 0x484d2f44
+0,  73728,  73728, 1152,  640, 0x310b414a
+0,  74880, 

Re: [FFmpeg-devel] [PATCH] avfilter/hwupload_cuda: Add missing semicolon.

2016-02-24 Thread James Almer
On 2/24/2016 11:05 PM, Matt Oliver wrote:
> This is a really simple patch as apparently when the cuda hwcontext filter
> was added a semicolon was forgotten.
> 
> For such simple patches as this is it worth even posting to the mailing
> list or just directly applying it straight away?

Trivial patches like this can be applied straight away. Especially when they
fix compilation failures (Which i assume is the case here).

> 
> ---
>  libavfilter/vf_hwupload_cuda.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_hwupload_cuda.c b/libavfilter/vf_hwupload_cuda.c
> index 6f4176f..c1c 100644
> --- a/libavfilter/vf_hwupload_cuda.c
> +++ b/libavfilter/vf_hwupload_cuda.c
> @@ -195,7 +195,7 @@ static const AVOption cudaupload_options[] = {
>  { NULL },
>  };
> 
> -AVFILTER_DEFINE_CLASS(cudaupload)
> +AVFILTER_DEFINE_CLASS(cudaupload);
> 
>  static const AVFilterPad cudaupload_inputs[] = {
>  {
> --
> 
> 
> 
> ___
> 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


[FFmpeg-devel] [PATCH] avfilter/hwupload_cuda: Add missing semicolon.

2016-02-24 Thread Matt Oliver
This is a really simple patch as apparently when the cuda hwcontext filter
was added a semicolon was forgotten.

For such simple patches as this is it worth even posting to the mailing
list or just directly applying it straight away?

---
 libavfilter/vf_hwupload_cuda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_hwupload_cuda.c b/libavfilter/vf_hwupload_cuda.c
index 6f4176f..c1c 100644
--- a/libavfilter/vf_hwupload_cuda.c
+++ b/libavfilter/vf_hwupload_cuda.c
@@ -195,7 +195,7 @@ static const AVOption cudaupload_options[] = {
 { NULL },
 };

-AVFILTER_DEFINE_CLASS(cudaupload)
+AVFILTER_DEFINE_CLASS(cudaupload);

 static const AVFilterPad cudaupload_inputs[] = {
 {
--


0001-avfilter-hwupload_cuda-Add-missing-semicolon.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/3] avformat: set AVFMT_NEED_PARSED_CREATION_TIME flag for formats writing all format string metadata

2016-02-24 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/adtsenc.c   | 2 +-
 libavformat/aiffenc.c   | 1 +
 libavformat/cafenc.c| 1 +
 libavformat/flvenc.c| 2 +-
 libavformat/lrcenc.c| 3 ++-
 libavformat/mp3enc.c| 2 +-
 libavformat/nutenc.c| 3 ++-
 libavformat/omaenc.c| 2 +-
 libavformat/smjpegenc.c | 2 +-
 libavformat/wtvenc.c| 1 +
 libavformat/wvenc.c | 2 +-
 11 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index 242d738..e004914 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -207,5 +207,5 @@ AVOutputFormat ff_adts_muxer = {
 .write_packet  = adts_write_packet,
 .write_trailer = adts_write_trailer,
 .priv_class= _muxer_class,
-.flags = AVFMT_NOTIMESTAMPS,
+.flags = AVFMT_NOTIMESTAMPS | AVFMT_NEED_PARSED_CREATION_TIME,
 };
diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 25dc5e6..a9d4cbb 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -330,5 +330,6 @@ AVOutputFormat ff_aiff_muxer = {
 .write_packet  = aiff_write_packet,
 .write_trailer = aiff_write_trailer,
 .codec_tag = (const AVCodecTag* const []){ ff_codec_aiff_tags, 0 },
+.flags = AVFMT_NEED_PARSED_CREATION_TIME,
 .priv_class= _muxer_class,
 };
diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index 544bc4a..8975c4d 100644
--- a/libavformat/cafenc.c
+++ b/libavformat/cafenc.c
@@ -268,4 +268,5 @@ AVOutputFormat ff_caf_muxer = {
 .write_packet   = caf_write_packet,
 .write_trailer  = caf_write_trailer,
 .codec_tag  = (const AVCodecTag* const []){ff_codec_caf_tags, 0},
+.flags  = AVFMT_NEED_PARSED_CREATION_TIME,
 };
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 8fd5d29..a8d6aa0 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -714,6 +714,6 @@ AVOutputFormat ff_flv_muxer = {
   flv_video_codec_ids, flv_audio_codec_ids, 0
   },
 .flags  = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
-  AVFMT_TS_NONSTRICT,
+  AVFMT_TS_NONSTRICT | AVFMT_NEED_PARSED_CREATION_TIME,
 .priv_class = _muxer_class,
 };
diff --git a/libavformat/lrcenc.c b/libavformat/lrcenc.c
index b316ccd..ce75071 100644
--- a/libavformat/lrcenc.c
+++ b/libavformat/lrcenc.c
@@ -147,6 +147,7 @@ AVOutputFormat ff_lrc_muxer = {
 .write_header   = lrc_write_header,
 .write_packet   = lrc_write_packet,
 .flags  = AVFMT_VARIABLE_FPS | AVFMT_GLOBALHEADER |
-  AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
+  AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT |
+  AVFMT_NEED_PARSED_CREATION_TIME,
 .subtitle_codec = AV_CODEC_ID_SUBRIP
 };
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 71f5178..7d0d0b0 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -627,7 +627,7 @@ AVOutputFormat ff_mp3_muxer = {
 .write_packet  = mp3_write_packet,
 .write_trailer = mp3_write_trailer,
 .query_codec   = query_codec,
-.flags = AVFMT_NOTIMESTAMPS,
+.flags = AVFMT_NOTIMESTAMPS | AVFMT_NEED_PARSED_CREATION_TIME,
 .priv_class= _muxer_class,
 };
 #endif
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index b6582ef..ef1515a 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -1235,7 +1235,8 @@ AVOutputFormat ff_nut_muxer = {
 .write_packet   = nut_write_packet,
 .write_trailer  = nut_write_trailer,
 .deinit = nut_write_deinit,
-.flags  = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
+.flags  = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+  AVFMT_NEED_PARSED_CREATION_TIME,
 .codec_tag  = ff_nut_codec_tags,
 .priv_class = ,
 };
diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c
index fe0669f..d5fe783 100644
--- a/libavformat/omaenc.c
+++ b/libavformat/omaenc.c
@@ -103,5 +103,5 @@ AVOutputFormat ff_oma_muxer = {
 .write_header  = oma_write_header,
 .write_packet  = ff_raw_write_packet,
 .codec_tag = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
-.flags = AVFMT_NOTIMESTAMPS,
+.flags = AVFMT_NOTIMESTAMPS | AVFMT_NEED_PARSED_CREATION_TIME,
 };
diff --git a/libavformat/smjpegenc.c b/libavformat/smjpegenc.c
index 430a497..f1ec392 100644
--- a/libavformat/smjpegenc.c
+++ b/libavformat/smjpegenc.c
@@ -141,6 +141,6 @@ AVOutputFormat ff_smjpeg_muxer = {
 .write_header   = smjpeg_write_header,
 .write_packet   = smjpeg_write_packet,
 .write_trailer  = smjpeg_write_trailer,
-.flags  = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
+.flags  = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT | 
AVFMT_NEED_PARSED_CREATION_TIME,
 .codec_tag  = (const AVCodecTag 

[FFmpeg-devel] [PATCH 3/3] ffmpeg: remove hardcoded 'now' creation_time support

2016-02-24 Thread Marton Balint
Every date parsing routine now uses av_parse_time which handles 'now' and
provides greater precision as well. This change also enables the segmenter
muxer to set the proper 'now' creation time at the beginning of each segment.

Signed-off-by: Marton Balint 
---
 ffmpeg_opt.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index edbc4a0..00d91c8 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -40,7 +40,6 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/pixfmt.h"
-#include "libavutil/time_internal.h"
 
 #define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
 
@@ -2430,7 +2429,6 @@ loop_end:
 char type, *val;
 const char *stream_spec;
 int index = 0, j, ret = 0;
-char now_time[256];
 
 val = strchr(o->metadata[i].u.str, '=');
 if (!val) {
@@ -2440,17 +2438,6 @@ loop_end:
 }
 *val++ = 0;
 
-if (!strcmp(o->metadata[i].u.str, "creation_time") &&
-!strcmp(val, "now")) {
-time_t now = time(0);
-struct tm *ptm, tmbuf;
-ptm = localtime_r(, );
-if (ptm) {
-if (strftime(now_time, sizeof(now_time), "%Y-%m-%d %H:%M:%S", 
ptm))
-val = now_time;
-}
-}
-
 parse_meta_type(o->metadata[i].specifier, , , _spec);
 if (type == 's') {
 for (j = 0; j < oc->nb_streams; j++) {
-- 
2.6.2

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


[FFmpeg-devel] [PATCH 1/3] avformat/mux: add a format flag which ensure parsed and standardized creation time

2016-02-24 Thread Marton Balint
This can be used for formats which write all format metadata as string to
files, therefore non-standard creation times such as 'now' will be parsed.

The standardized creation time is UTC ISO 8601 with microsecond precision.

Signed-off-by: Marton Balint 
---
 libavformat/avformat.h |  1 +
 libavformat/mux.c  | 24 
 libavformat/version.h  |  2 +-
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 2b6533c..ea82181 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -502,6 +502,7 @@ typedef struct AVProbeData {
 The user or muxer can override this 
through
 AVFormatContext.avoid_negative_ts
 */
+#define AVFMT_NEED_PARSED_CREATION_TIME  0x8 /**< Format needs pre-parsed 
standardized creation time */
 
 #define AVFMT_SEEK_TO_PTS   0x400 /**< Seeking is based on PTS */
 
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 789c811..9a39064 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -36,10 +36,12 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/time.h"
+#include "libavutil/time_internal.h"
 #include "riff.h"
 #include "audiointerleave.h"
 #include "url.h"
 #include 
+#include 
 #if CONFIG_NETWORK
 #include "network.h"
 #endif
@@ -383,6 +385,28 @@ FF_ENABLE_DEPRECATION_WARNINGS
 }
 }
 
+/* pre-parse creation time for formats that need it */
+if (s->oformat->flags & AVFMT_NEED_PARSED_CREATION_TIME) {
+int64_t timestamp;
+if (ff_parse_creation_time_metadata(s, , 0) == 1) {
+time_t seconds = timestamp / 100;
+struct tm *ptm, tmbuf;
+ptm = gmtime_r(, );
+if (ptm) {
+char buf[32];
+if (!strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S", ptm)) {
+ret = AVERROR_EXTERNAL;
+goto fail;
+}
+av_strlcatf(buf, sizeof(buf), ".%06dZ", (int)(timestamp % 
100));
+av_dict_set(>metadata, "creation_time", buf, 0);
+} else {
+ret = AVERROR_EXTERNAL;
+goto fail;
+}
+}
+}
+
 /* set muxer identification string */
 if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
 av_dict_set(>metadata, "encoder", LIBAVFORMAT_IDENT, 0);
diff --git a/libavformat/version.h b/libavformat/version.h
index 82a8892..9f4ede7 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
 #define LIBAVFORMAT_VERSION_MINOR  26
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
2.6.2

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


Re: [FFmpeg-devel] [PATCH 2/6] lavc: allow subtitle text format to be ASS without timing

2016-02-24 Thread Michael Niedermayer
On Wed, Feb 24, 2016 at 03:37:53PM +0100, Clément Bœsch wrote:
> On Sun, Feb 21, 2016 at 06:34:43PM +0100, Michael Niedermayer wrote:
> > On Sun, Feb 21, 2016 at 01:08:29PM +0100, Clément Bœsch wrote:
> > [...]
> > > diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> > > index aa8bfac..b493dd1 100644
> > > --- a/libavcodec/options_table.h
> > > +++ b/libavcodec/options_table.h
> > > @@ -519,6 +519,9 @@ static const AVOption avcodec_options[] = {
> > >  {"do_nothing",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > > FF_SUB_CHARENC_MODE_DO_NOTHING},  INT_MIN, INT_MAX, S|D, 
> > > "sub_charenc_mode"},
> > >  {"auto",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > > FF_SUB_CHARENC_MODE_AUTOMATIC},   INT_MIN, INT_MAX, S|D, 
> > > "sub_charenc_mode"},
> > >  {"pre_decoder", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > > FF_SUB_CHARENC_MODE_PRE_DECODER}, INT_MIN, INT_MAX, S|D, 
> > > "sub_charenc_mode"},
> > > +{"sub_text_format", "set decoded text subtitle format", 
> > > OFFSET(sub_text_format), AV_OPT_TYPE_INT, {.i64 = 
> > > FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS}, 0, 1, S|D, "sub_text_format"},
> > > +{"ass",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > > FF_SUB_TEXT_FMT_ASS},  INT_MIN, INT_MAX, S|D, 
> > > "sub_text_format"},
> > > +{"ass_with_timings", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > > FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS}, INT_MIN, INT_MAX, S|D, 
> > > "sub_text_format"},
> > >  {"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_BOOL, 
> > > {.i64 = 0}, 0, 1, A|V|D },
> > 
> > Missing docs update in doc/
> > 
> 
> This is only for API users, so I'll add an entry in doc/APIChanges

they are shown in "./ffmpeg -h full"
you can s/S|D/0/ to avoid that
or some flag could be added that then prevents display


[...]

-- 
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] libavcodec:add packet level support for mastering metadata

2016-02-24 Thread Michael Niedermayer
On Mon, Feb 22, 2016 at 02:53:06PM -0800, Neil Birkbeck wrote:
> Some containers, like webm/mkv, will contain this mastering metadata.
> This is analogous to the way 3D fpa data is handled (in frame and
> packet side data).
> 
> Signed-off-by: Neil Birkbeck 
> ---
>  libavcodec/avcodec.h  |  7 +++
>  libavcodec/avpacket.c | 33 +
>  libavcodec/utils.c|  9 +
>  libavcodec/version.h  |  2 +-
>  4 files changed, 30 insertions(+), 21 deletions(-)

applied

thanks

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

No great genius has ever existed without some touch of madness. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Fix decoding images with Adobe_CM tag

2016-02-24 Thread Michael Niedermayer
On Wed, Feb 24, 2016 at 06:52:13PM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes ticket #5267 for me.
> 
> Please comment, Carl Eugen

>  mjpegdec.c |6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 1fc8e89404661529f72eac63b74ab7c2ae300b8f  patchadobecm.diff
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index 69c9cf3..87c1501 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -1677,7 +1677,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)

LGTM
thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


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


Re: [FFmpeg-devel] [PATCH] Revert "Merge commit '3ef98937f512184f80d3bd30015f5ec83dc11eb0'"

2016-02-24 Thread Michael Niedermayer
On Wed, Feb 24, 2016 at 05:01:22PM -0300, James Almer wrote:
> On 2/24/2016 4:53 PM, Michael Niedermayer wrote:
> > This broke packed_maindata.mp3.mp4
> > Its unknown to me what this commit would have fixed
> 
> Should have been a no-op i guess, seeing how right below there's code
> setting AVSTREAM_PARSE_FULL if some conditions are met.

applied

thanks

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


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


[FFmpeg-devel] [PATCH] Revert "Merge commit '3ef98937f512184f80d3bd30015f5ec83dc11eb0'"

2016-02-24 Thread Michael Niedermayer
This broke packed_maindata.mp3.mp4
Its unknown to me what this commit would have fixed

This reverts commit 79127dbbeffa87243c92af2befc09ad63bcbd1a1, reversing
changes made to 9fad1ce7c95adeec440f51af77f730340a6d27b8.
---
 libavformat/mov.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index e26cc10..b1a2ea7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3100,9 +3100,6 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 st->codec->width = 0; /* let decoder init width/height */
 st->codec->height= 0;
 break;
-case AV_CODEC_ID_MP3:
-st->need_parsing = AVSTREAM_PARSE_FULL;
-break;
 }
 
 // If the duration of the mp3 packets is not constant, then they could 
need a parser
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] lavf/matroskadec: Process QuickTime palette per track

2016-02-24 Thread Mats Peterson

On 02/24/2016 06:16 PM, Mats Peterson wrote:

The QuickTime palette was incorrectly stored in the MatroskaDemuxContext
instead of a MatroskaTrack.




Sample Matroska file with two 8 bpp QuickTime video tracks:

https://drive.google.com/open?id=0B3_pEBoLs0faY1JKQXBfRy1QYUk

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


Re: [FFmpeg-devel] [PATCH] avutil/md5: fix unaligned loads

2016-02-24 Thread Nicolas George
Le sextidi 6 ventôse, an CCXXIV, James Almer a écrit :
> It may result in a slight speed boost, so it would be nice if someone with
> a ppc machine could test it.

I can access this:

gcc110 2TB 4x16x3.55 GHz IBM POWER7 / 64 GB RAM /
IBM Power 730 Express server / Fedora 18 ppc64

processor   : 0
cpu : POWER7 (architected), altivec supported
clock   : 3550.00MHz
revision: 2.1 (pvr 003f 0201)

But I can no

The time for 760 Mo are:

Original:

2.24user 0.14system 0:02.39elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
2.26user 0.11system 0:02.38elapsed 99%CPU (0avgtext+0avgdata 2688maxresident)k
2.23user 0.15system 0:02.38elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
2.25user 0.12system 0:02.38elapsed 100%CPU (0avgtext+0avgdata 2624maxresident)k
2.20user 0.15system 0:02.36elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k

Patched:

1.86user 0.13system 0:02.00elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
1.89user 0.11system 0:02.01elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
1.85user 0.14system 0:02.00elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
1.84user 0.15system 0:01.99elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
1.89user 0.13system 0:02.02elapsed 99%CPU (0avgtext+0avgdata 2688maxresident)k

I keep the build tree and shell open for some time just in case.

Regards,

-- 
  Nicolas George


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


[FFmpeg-devel] [PATCH]lavc/mjpegdec: Fix decoding images with Adobe_CM tag

2016-02-24 Thread Carl Eugen Hoyos
Hi!

Attached patch fixes ticket #5267 for me.

Please comment, Carl Eugen
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 69c9cf3..87c1501 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1677,7 +1677,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
 goto out;
 }
 
-if (id == AV_RB32("Adob") && (get_bits(>gb, 8) == 'e')) {
+if (   id == AV_RB32("Adob")
+&& len >= 7
+&& show_bits(>gb, 8) == 'e'
+&& show_bits(>gb, 24) != 'e' << 24 | '_' << 16 | 'C') {
+skip_bits(>gb,  8); /* 'e' */
 skip_bits(>gb, 16); /* version */
 skip_bits(>gb, 16); /* flags0 */
 skip_bits(>gb, 16); /* flags1 */
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavf/matroskadec: Process QuickTime palette per track

2016-02-24 Thread Mats Peterson
The QuickTime palette was incorrectly stored in the MatroskaDemuxContext 
instead of a MatroskaTrack.


--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From 079df7d5971a6ff0136597dfe1dbefc1e2c239f9 Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Wed, 24 Feb 2016 18:14:05 +0100
Subject: [PATCH] lavf/matroskadec: Process QuickTime palette per track

---
 libavformat/matroskadec.c |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index d788232..d20568c 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -190,6 +190,9 @@ typedef struct MatroskaTrack {
 int64_t end_timecode;
 int ms_compat;
 uint64_t max_block_additional_id;
+
+uint32_t palette[AVPALETTE_COUNT];
+int has_palette;
 } MatroskaTrack;
 
 typedef struct MatroskaAttachment {
@@ -314,9 +317,6 @@ typedef struct MatroskaDemuxContext {
 
 /* WebM DASH Manifest live flag/ */
 int is_live;
-
-uint32_t palette[AVPALETTE_COUNT];
-int has_palette;
 } MatroskaDemuxContext;
 
 typedef struct MatroskaBlock {
@@ -1930,9 +1930,9 @@ static int matroska_parse_tracks(AVFormatContext *s)
 ffio_init_context(, track->codec_priv.data,
   track->codec_priv.size,
   0, NULL, NULL, NULL, NULL);
-if (ff_get_qtpalette(codec_id, , matroska->palette)) {
+if (ff_get_qtpalette(codec_id, , track->palette)) {
 bit_depth &= 0x1F;
-matroska->has_palette = 1;
+track->has_palette = 1;
 }
 }
 } else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
@@ -2378,16 +2378,19 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
AVPacket *pkt)
 {
 if (matroska->num_packets > 0) {
+MatroskaTrack *tracks = matroska->tracks.elem;
+MatroskaTrack *track;
 memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
 av_freep(>packets[0]);
-if (matroska->has_palette) {
+track = [pkt->stream_index];
+if (track->has_palette) {
 uint8_t *pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);
 if (!pal) {
 av_log(matroska->ctx, AV_LOG_ERROR, "Cannot append palette to packet\n");
 } else {
-memcpy(pal, matroska->palette, AVPALETTE_SIZE);
+memcpy(pal, track->palette, AVPALETTE_SIZE);
 }
-matroska->has_palette = 0;
+track->has_palette = 0;
 }
 if (matroska->num_packets > 1) {
 void *newpackets;
-- 
1.7.10.4

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


Re: [FFmpeg-devel] [RFC] gitlog merges

2016-02-24 Thread Michael Niedermayer
Hi jb, thresh

ive attached a simple patch which should make merges reviewable on
the maiing list
if you agree with the change, please apply
if you see a problem or if it misbehaves then dont hesitate to revert

i have locally tested it on a few commits and it added usefull
diffs to merges while leaving other changes as they where but i only
lightly tested

Thanks

On Mon, Feb 22, 2016 at 03:02:12PM +0100, Michael Niedermayer wrote:
> On Thu, Feb 18, 2016 at 03:06:33AM +0100, Michael Niedermayer wrote:
> > Hi
> > 
> > currently merges on the ML do not contain any diff
> > should this be changed ?
> > 
> > what diff command makes most sense ?
> > git log -p --first-parent -1 -m -M -C --patience
> > 
> > jb, (in CC), would it be possible for us to edit the script which
> > creates the git log mails for ffmpeg so the changes due to merges can
> > be reviewed by anyone interrested on the ML ?
> > (that is obtain the current script and provide a patch or something
> >  like that)
> > in case people want to change this
> 
> Heres a suggested patch, note! iam not a perl developer
> comments, review and testing welcome
> 
> Iam not sure iam supposed to share the original script from vlc
> as i was sent a link privately, but various versions of the script
> can be found by searching for
> '"Tool to send git commit notifications"'
> 
> 
> @@ -242,14 +242,23 @@ sub send_commit_notice($$)
>  "---",
>  "";
> 
> -open STAT, "-|" or exec "git", "diff-tree", "--stat", "-M", 
> "--no-commit-id", $obj or die "cannot exec git-diff-tree";
> +open STAT, "-|" or exec "git", "diff-tree", "--stat", "-M", "-m", 
> "--first-parent", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
>  push @notice, join("", );
>  close STAT;
> 
> -open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", 
> "--no-commit-id", $obj or die "cannot exec git-diff-tree";
> +open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "-m", 
> "--first-parent", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
>  my $diff = join( "",  );
>  close DIFF;
> 
> +open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "-m", 
> "--cc", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
> +my $diffcc = join( "",  );
> +close DIFF;
> +
> +if ($diff ne $diffcc)
> +{
> +$diff = join 
> "\n\n==\n\n",
>  $diff, $diffcc
> +}
> +
>  if (($max_diff_size == -1) || (length($diff) < $max_diff_size))
>  {
>  push @notice, $diff;
> 
> [...]
> 
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> In a rich man's house there is no place to spit but his face.
> -- Diogenes of Sinope



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


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
From 395fee0264f69415ea61229a9113576306bc08c8 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer 
Date: Wed, 24 Feb 2016 17:56:05 +0100
Subject: [PATCH] ffmpeg-git-notify: Display diffs for merges to allow easy
 reviewing

Signed-off-by: Michael Niedermayer 
---
 ffmpeg-git-notify |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/ffmpeg-git-notify b/ffmpeg-git-notify
index 96ec05e..378c59d 100644
--- a/ffmpeg-git-notify
+++ b/ffmpeg-git-notify
@@ -242,14 +242,23 @@ sub send_commit_notice($$)
 "---",
 "";
 
-open STAT, "-|" or exec "git", "diff-tree", "--stat", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
+open STAT, "-|" or exec "git", "diff-tree", "--stat", "-M", "-m", "--first-parent", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
 push @notice, join("", );
 close STAT;
 
-open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
+open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "-m", "--first-parent", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
 my $diff = join( "",  );
 close DIFF;
 
+open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "-m", "--cc", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
+my $diffcc = join( "",  );
+close DIFF;
+
+if ($diff ne $diffcc)
+{
+$diff = join "\n\n==\n\n", $diff, $diffcc
+}
+
 if (($max_diff_size == -1) || (length($diff) < $max_diff_size))
 

Re: [FFmpeg-devel] [PATCH] avutil/md5: fix unaligned loads

2016-02-24 Thread James Almer
On 2/24/2016 1:15 PM, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, Feb 24, 2016 at 10:47 AM, James Almer  wrote:
> 
>> On 2/24/2016 12:13 PM, Ronald S. Bultje wrote:
>>> Hi,
>>>
>>> On Tue, Feb 23, 2016 at 8:40 PM, James Almer  wrote:
>>>
 Tested on x86 and benched with no apparent speed loss
>>>
>>>
>>> That's because x86 supports unaligned loads.
>>>
>>> How come you get unaligned loads? Shouldn't this prevent it?
>>>
>>> -if (HAVE_BIGENDIAN || (!HAVE_FAST_UNALIGNED && ((intptr_t)src &
>> 3))) {
>>> +if (!HAVE_FAST_UNALIGNED && ((intptr_t)src & 3)) {
>>> while (src < end) {
>>> memcpy(ctx->block, src, 64);
>>> body(ctx->ABCD, (uint32_t *) ctx->block, 1);
>>>
>>> Ronald
>>
>> That code is never compiled/executed on x86 because HAVE_FAST_UNALIGNED is
>> 1
>> there.
> 
> 
> So then I don't understand what ubsan is complaining about? Maybe
> HAVE_FAST_UNALIGNED should be disabled when running under ubsan?
> 
> Ronald

That codepath is slower because it memcpys to an aligned temp buffer.
The memcpy calls alongside the body() calls with length 1 are probably
slow, so using it is not a good idea.

Ubsan is complaining about unaligned loads done by body() when src is
passed as argument instead of the temp buffer from the AVMD5 struct.
See the codepath right below the one quoted above.
The errors in question are variations of "src/libavutil/md5.c:128:21391:
runtime error: load of misaligned address 0x06b30b26 for type
'uint32_t', which requires 4 byte alignment".
Using t = AV_RL32(X) instead of t = X[0] where X is of type 'uint32_t *'
solves this, since the AV_RN macros are meant for unaligned loads.
Are they bogus errors? I don't really know.

By using AV_RL32 i also removed the need for big endian systems to use
the temp buffer codepath, since the AV_RN macros do the bswap as required.
It may result in a slight speed boost, so it would be nice if someone with
a ppc machine could test it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] ffmpeg mixing a/v streams from multiple IP but same port for multiple IP camera source

2016-02-24 Thread Aswin Thoudam
I have used ffmpeg 2.6.3 to record audio and video from multiple IP camera
multicast over respective multicast IP but on same audio and video port on
a PC having RHEL 6.6 OS.

I found that for single camera it is working fine but when 2 or more camera
is used then the video is getting mixed. On further searching I found some
material about some disagreement on the implementation of multicast
receiving between some application developers and kernel developer on who
should own this problem. I don't know if this problem is resolved or not
now or whether this is problem or not in the first place. But I needed to
get it working and found that the socket parameter IP_MULTICAST_ALL can
help in this situation. Also since I am making audio/video recording I
found that sometimes but very rarely ffmpeg is not able to get the video
codec information so it records audio only. So I made it to quit if it
didn't record video. I am uploading/sharing the patch I did for what I
need. Hope it might help any who needs similar behavior. I can't say if
what I did is correct or not but it is working for what I need.

The patch is

diff -crB ffmpeg-2.6.3-orig/libavformat/udp.c ffmpeg-2.5.3/libavformat/udp.c
*** ffmpeg-2.6.3-orig/libavformat/udp.c2015-03-03 15:54:00.0
+0530
--- ffmpeg-2.6.3/libavformat/udp.c2015-04-08 14:46:30.0 +0530
***
*** 181,186 
--- 181,191 
  log_net_error(NULL, AV_LOG_ERROR,
"setsockopt(IP_ADD_MEMBERSHIP)");
  return -1;
  }
+ int mc=0;
+  if(setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_ALL, (const void
*), sizeof(mc)) < 0)
+   {
+   log_net_error(NULL, AV_LOG_ERROR,
"setsockopt(IP_MULTICAST_ALL)");
+  }
  }
  #endif
  #if HAVE_STRUCT_IPV6_MREQ && defined(IPPROTO_IPV6)
diff -crB ffmpeg-2.6.3-orig/libavformat/utils.c
ffmpeg-2.5.3/libavformat/utils.c
*** ffmpeg-2.6.3-orig/libavformat/utils.c2015-01-10 09:51:16.0
+0530
--- ffmpeg-2.6.3/libavformat/utils.c2015-04-08 19:29:17.763130726 +0530
***
*** 3431,3437 
  if (ret >= 0 && ic->nb_streams)
  /* We could not have all the codec parameters before EOF. */
  ret = -1;
! for (i = 0; i < ic->nb_streams; i++) {
  const char *errmsg;
  st = ic->streams[i];
  if (!has_codec_parameters(st, )) {
--- 3431,3438 
  if (ret >= 0 && ic->nb_streams)
  /* We could not have all the codec parameters before EOF. */
  ret = -1;
! int breakloop = 0;
! for (i = 0; i < ic->nb_streams&==0; i++) {
  const char *errmsg;
  st = ic->streams[i];
  if (!has_codec_parameters(st, )) {
***
*** 3441,3446 
--- 3442,3452 
 "Could not find codec parameters for stream %d (%s):
%s\n"
 "Consider increasing the value for the
'analyzeduration' and 'probesize' options\n",
 i, buf, errmsg);
+ if(strstr(buf,"h264"))
+ {
+ av_log(ic, AV_LOG_WARNING,"Quitting as video stream could
not be decoded\n");
+ breakloop = 1;
+ }
  } else {
  ret = 0;
  }
***
*** 3460,3465 
--- 3466,3476 
  if (ic->pb)
  av_log(ic, AV_LOG_DEBUG, "After avformat_find_stream_info() pos:
%"PRId64" bytes read:%"PRId64" seeks:%d frames:%d\n",
 avio_tell(ic->pb), ic->pb->bytes_read, ic->pb->seek_count,
count);
+ if(breakloop!=0)
+ {
+ ret = -1;
+ ic->nb_streams=0;
+ }
  return ret;
  }

udp.c is for mixing of stream and utils.c is for making ffmpeg quit


ffmpeg.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] GPL license violation

2016-02-24 Thread Andrea Lazzarotto
2016-02-24 14:36 GMT+01:00 Ronald S. Bultje :

> Please file a bug report on trac.ffmpeg.org for license violations. I'm
> not guaranteeing that anything will happen, but at least it's easier to
> keep track of than ML.
>

Hi Ronald,

thank you for your message. I did it here:
https://trac.ffmpeg.org/ticket/5265

Best regards

-- 
Andrea Lazzarotto
http://andrealazzarotto.com
http://lazza.dk
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v7 3/3] mips: add support for R6

2016-02-24 Thread Vicente Olivert Riera
Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v7:
 - Nothing.

 libavcodec/mips/aaccoder_mips.c   |  4 
 libavcodec/mips/aacdec_mips.h |  2 ++
 libavcodec/mips/aacpsdsp_mips.c   |  4 
 libavcodec/mips/aacpsy_mips.h |  2 ++
 libavcodec/mips/aacsbr_mips.c |  4 
 libavcodec/mips/aacsbr_mips.h |  2 ++
 libavcodec/mips/ac3dsp_mips.c |  6 +-
 libavcodec/mips/acelp_filters_mips.c  |  4 
 libavcodec/mips/acelp_vectors_mips.c  |  4 
 libavcodec/mips/amrwbdec_mips.c   |  2 ++
 libavcodec/mips/amrwbdec_mips.h   |  2 ++
 libavcodec/mips/celp_filters_mips.c   |  4 
 libavcodec/mips/celp_math_mips.c  |  4 
 libavcodec/mips/compute_antialias_float.h |  2 ++
 libavcodec/mips/fft_mips.c|  4 
 libavcodec/mips/iirfilter_mips.c  |  4 
 libavcodec/mips/lsp_mips.h|  2 ++
 libavcodec/mips/mpegaudiodsp_mips_fixed.c | 10 ++
 libavcodec/mips/mpegaudiodsp_mips_float.c | 10 ++
 libavcodec/mips/sbrdsp_mips.c |  4 
 libavutil/mips/float_dsp_mips.c   |  4 
 21 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c
index 8fbdfd2..d690c8c 100644
--- a/libavcodec/mips/aaccoder_mips.c
+++ b/libavcodec/mips/aaccoder_mips.c
@@ -66,6 +66,7 @@
 #include "libavcodec/aacenc_utils.h"
 
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 typedef struct BandCodingPath {
 int prev_idx;
 float cost;
@@ -2477,10 +2478,12 @@ static void search_for_ms_mips(AACEncContext *s, 
ChannelElement *cpe)
 
 #include "libavcodec/aaccoder_trellis.h"
 
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 
 void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 AACCoefficientsEncoder *e = c->coder;
 int option = c->options.coder;
 
@@ -2494,5 +2497,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_MIPSFPU
 e->search_for_ms= search_for_ms_mips;
 #endif /* HAVE_MIPSFPU */
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
index c4f6438..758266f 100644
--- a/libavcodec/mips/aacdec_mips.h
+++ b/libavcodec/mips/aacdec_mips.h
@@ -61,6 +61,7 @@
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM && HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
const float *scale)
 {
@@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float 
*v, unsigned idx,
 #define VMUL4 VMUL4_mips
 #define VMUL2S VMUL2S_mips
 #define VMUL4S VMUL4S_mips
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
 
 #endif /* AVCODEC_MIPS_AACDEC_MIPS_H */
diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
index 695f9ef..83fdc2f 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float 
out[2][38][64],
 }
 
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
 {
 int i;
@@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float 
(*r)[2],
 : "memory"
 );
 }
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 
@@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
 s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
 s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 s->add_squares= ps_add_squares_mips;
 s->mul_pair_single= ps_mul_pair_single_mips;
 s->decorrelate= ps_decorrelate_mips;
 s->stereo_interpolate[0]  = ps_stereo_interpolate_mips;
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacpsy_mips.h b/libavcodec/mips/aacpsy_mips.h
index 42ff442..a1fe5cc 100644
--- a/libavcodec/mips/aacpsy_mips.h
+++ b/libavcodec/mips/aacpsy_mips.h
@@ -59,6 +59,7 @@
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM && HAVE_MIPSFPU && ( PSY_LAME_FIR_LEN == 21 )
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static void calc_thr_3gpp_mips(const 

[FFmpeg-devel] [PATCH v7 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-02-24 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v6 -> v7:
 - Do not pass -msoft-float. Leave the mipsfpu handling as it was
   before, so nothing changes. This could be improbed in the future.

Changes v5 -> v6:
 - Multiple changes:
   - Use separate if blocks when detecting the MIPS ISA, this way when a block
 disables one ISA it will be detected by the next one. Before the elif was
 preventing this to be done.
   - Don't use check_cflags and use only check_ldflags instead, which will
 check if that flag is valid for compiling and linking. The compiler may
 accept some cflags for compiling but not for linking, so if we check first
 for the cflags it will succeed, and the cflags will be added to the CFLAGS
 variable despite of the check_ldflags failing after that. This can cause
 problems because of having multiple incompatible cflags enabled at the same
 time.
   - Check if mipsfpu has been disabled, and if so, then use -msoft-float. This
 way we override the compiler default behavious which can be building for
 hard-float.
   - Explicitly disable the features that fail any check by adding "|| disable
 $feature" at the end of the checks chain.

Changes v4 -> v5:
 - Check for msa.h and disable msa if not found.

Changes v3 -> v4:
 - Nothing.

Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Add a block of code for mipsdspr2 which was previously placed in the
   first patch of this series causing a syntax error in the configure
   script.
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html

 configure | 101 +++---
 1 file changed, 83 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 857b683..ee0d00f 100755
--- a/configure
+++ b/configure
@@ -5076,27 +5076,92 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options
-if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
-add_cflags "-mips64r2"
-add_asflags "-mips64r2"
-elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled 
loongson3; then
-add_cflags "-mips64"
-add_asflags "-mips64"
-elif enabled mipsdsp || enabled mipsdspr2; then
-add_cflags "-mips32r2 -mfp32"
-add_asflags "-mips32r2 -mfp32"
+if enabled mips64; then
+if enabled mips64r6; then
+check_ldflags "-mips64r6" &&
+add_cflags "-mips64r6" &&
+add_asflags "-mips64r6" &&
+check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' ||
+disable mips64r6
+fi
+if disabled mips64r6 && enabled mips64r2; then
+check_ldflags "-mips64r2" &&
+add_cflags "-mips64r2" &&
+add_asflags "-mips64r2" &&
+check_inline_asm mips64r2 '"dext $0, $0, 0, 1"' ||
+disable mips64r2
+fi
+if disabled mips64r6 && disabled mips64r2; then
+check_ldflags "-mips64" &&
+add_cflags "-mips64" &&
+add_asflags "-mips64" &&
+check_inline_asm mips64r1 '"daddi $0, $0, 0"' ||
+disable mips64r1
+fi
+else
+if enabled mips32r6; then
+check_ldflags "-mips32r6" &&
+add_cflags "-mips32r6" &&
+add_asflags "-mips32r6" &&
+check_inline_asm mips32r6 '"aui $0, $0, 0"' ||
+disable mips32r6
+fi
+if disabled mips32r6 && enabled mips32r2; then
+check_ldflags "-mips32r2" &&
+add_cflags "-mips32r2" &&
+add_asflags "-mips32r2" &&
+check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' ||
+disable mips32r2
+fi
+if disabled mips32r6 && disabled mips32r2; then
+check_ldflags "-mips32" &&
+add_cflags "-mips32" &&
+add_asflags "-mips32" &&
+check_inline_asm mips32r1 '"addi $0, $0, 0"' ||
+disable mips32r1
+fi
 fi
 
-enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
- check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
-enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
- check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
-enabled mipsfpu   && add_cflags "-mhard-float" && add_asflags 
"-mhard-float" &&
- check_inline_asm mipsfpu   '"madd.d $f0, $f2, $f4, $f6"'
-enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
- check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
+# MIPS FPU
+if enabled mipsfpu; then
+check_ldflags "-mhard-float" &&
+add_cflags "-mhard-float" &&
+add_asflags "-mhard-float" &&
+check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"' ||
+disable mipsfpu
+fi
+
+# MSA and DSP support require ISA revision level 2 or greater
+if 

[FFmpeg-devel] [PATCH v7 2/3] mips: do not disable any feature for generic cores

2016-02-24 Thread Vicente Olivert Riera
We don't know which features are available when the user selects a
generic core, so don't disable anything by default and let the user
decide.

Signed-off-by: Vicente Olivert Riera 
---
Changes v4 -> v7:
 - Nothing.

Changes v3 -> v4:
 - Minor change in the commit log: remove "let's".

Changes v2 -> v3:
 - Change the logic of this patch. Instead of removing the generic core,
   do not disable any feature and add a warning message to state that.
   The patch subject has also changed accordingly.

Changes v1 -> v2:
 - Nothing.

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index ee0d00f..6167f7c 100755
--- a/configure
+++ b/configure
@@ -4251,8 +4251,8 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips64r6
-disable msa
+# We do not disable anything. Is up to the user to disable
+# the unwanted features.
 ;;
 *)
 # Unknown CPU. Disable everything.
-- 
2.4.10

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


Re: [FFmpeg-devel] [PATCH] configure: add missing --strip option to show_help()

2016-02-24 Thread Michael Niedermayer
On Wed, Feb 24, 2016 at 11:40:12AM +0100, Matthieu Bouron wrote:
> From: Matthieu Bouron 
> 
> ---
>  configure | 1 +
>  1 file changed, 1 insertion(+)

probably ok

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

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


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


Re: [FFmpeg-devel] [PATCH] avutil/md5: fix unaligned loads

2016-02-24 Thread Ronald S. Bultje
Hi,

On Wed, Feb 24, 2016 at 10:47 AM, James Almer  wrote:

> On 2/24/2016 12:13 PM, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Tue, Feb 23, 2016 at 8:40 PM, James Almer  wrote:
> >
> >> Tested on x86 and benched with no apparent speed loss
> >
> >
> > That's because x86 supports unaligned loads.
> >
> > How come you get unaligned loads? Shouldn't this prevent it?
> >
> > -if (HAVE_BIGENDIAN || (!HAVE_FAST_UNALIGNED && ((intptr_t)src &
> 3))) {
> > +if (!HAVE_FAST_UNALIGNED && ((intptr_t)src & 3)) {
> > while (src < end) {
> > memcpy(ctx->block, src, 64);
> > body(ctx->ABCD, (uint32_t *) ctx->block, 1);
> >
> > Ronald
>
> That code is never compiled/executed on x86 because HAVE_FAST_UNALIGNED is
> 1
> there.


So then I don't understand what ubsan is complaining about? Maybe
HAVE_FAST_UNALIGNED should be disabled when running under ubsan?

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


Re: [FFmpeg-devel] [PATCH] avcodec/avpacket: clear priv in av_init_packet()

2016-02-24 Thread Michael Niedermayer
On Wed, Feb 24, 2016 at 03:12:56PM +, Derek Buitenhuis wrote:
> On 2/24/2016 3:10 PM, Michael Niedermayer wrote:
> > This should fix leaving uninitialized pointers in priv which can confuse
> > user applications.
> > See: https://github.com/golang/go/issues/14426
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/avpacket.c |1 +
> >  1 file changed, 1 insertion(+)
> 
> Should be noted this is only for release branches.
> 
> LGTM, though.

applied ad pushed to 2.8 (ive locally applied it to older ones too)

thanks

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

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


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


Re: [FFmpeg-devel] [PATCH] avutil/md5: fix unaligned loads

2016-02-24 Thread James Almer
On 2/24/2016 12:13 PM, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Feb 23, 2016 at 8:40 PM, James Almer  wrote:
> 
>> Tested on x86 and benched with no apparent speed loss
> 
> 
> That's because x86 supports unaligned loads.
> 
> How come you get unaligned loads? Shouldn't this prevent it?
> 
> -if (HAVE_BIGENDIAN || (!HAVE_FAST_UNALIGNED && ((intptr_t)src & 3))) {
> +if (!HAVE_FAST_UNALIGNED && ((intptr_t)src & 3)) {
> while (src < end) {
> memcpy(ctx->block, src, 64);
> body(ctx->ABCD, (uint32_t *) ctx->block, 1);
> 
> Ronald

That code is never compiled/executed on x86 because HAVE_FAST_UNALIGNED is 1
there.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] img2dec: Add mime_type to image formats

2016-02-24 Thread Carl Eugen Hoyos
Derek Buitenhuis  gmail.com> writes:

> Improves probing, especially over http when there is a 
> Content-Type header

(Do you have an example where the probing fails?)

The idea of these additional demuxers is that they probe 
the content instead of relying on the file suffix. 
File suffix provides a score of _EXTENSION (50), so if probing 
is possible and uses more than 16 bit, _EXTENSION + 1 is 
returned to allow a better detection.
AV_SCORE_MIME is 75, so iiuc this patch would just disable 
autodetection (except for png, dds and webp which compare 
64 bit and return _MAX) in favour of the mimetype.
Or am I reading the code incorrectly and mimetype doesn't 
lead to a score of 75?

Why aren't the mimetypes added to the (original) image2 
demuxer if they are really needed?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avutil/md5: fix unaligned loads

2016-02-24 Thread Ronald S. Bultje
Hi,

On Tue, Feb 23, 2016 at 8:40 PM, James Almer  wrote:

> Tested on x86 and benched with no apparent speed loss


That's because x86 supports unaligned loads.

How come you get unaligned loads? Shouldn't this prevent it?

-if (HAVE_BIGENDIAN || (!HAVE_FAST_UNALIGNED && ((intptr_t)src & 3))) {
+if (!HAVE_FAST_UNALIGNED && ((intptr_t)src & 3)) {
while (src < end) {
memcpy(ctx->block, src, 64);
body(ctx->ABCD, (uint32_t *) ctx->block, 1);

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


Re: [FFmpeg-devel] [PATCH] avcodec/avpacket: clear priv in av_init_packet()

2016-02-24 Thread Derek Buitenhuis
On 2/24/2016 3:10 PM, Michael Niedermayer wrote:
> This should fix leaving uninitialized pointers in priv which can confuse
> user applications.
> See: https://github.com/golang/go/issues/14426
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/avpacket.c |1 +
>  1 file changed, 1 insertion(+)

Should be noted this is only for release branches.

LGTM, though.

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


[FFmpeg-devel] [PATCH] avcodec/avpacket: clear priv in av_init_packet()

2016-02-24 Thread Michael Niedermayer
This should fix leaving uninitialized pointers in priv which can confuse
user applications.
See: https://github.com/golang/go/issues/14426

Signed-off-by: Michael Niedermayer 
---
 libavcodec/avpacket.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 10be9d5..ad0a7d7 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -58,6 +58,7 @@ void av_init_packet(AVPacket *pkt)
 #if FF_API_DESTRUCT_PACKET
 FF_DISABLE_DEPRECATION_WARNINGS
 pkt->destruct = NULL;
+pkt->priv = NULL;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 pkt->buf  = NULL;
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH 2/6] lavc: allow subtitle text format to be ASS without timing

2016-02-24 Thread Clément Bœsch
On Sun, Feb 21, 2016 at 06:34:43PM +0100, Michael Niedermayer wrote:
> On Sun, Feb 21, 2016 at 01:08:29PM +0100, Clément Bœsch wrote:
> [...]
> > diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> > index aa8bfac..b493dd1 100644
> > --- a/libavcodec/options_table.h
> > +++ b/libavcodec/options_table.h
> > @@ -519,6 +519,9 @@ static const AVOption avcodec_options[] = {
> >  {"do_nothing",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > FF_SUB_CHARENC_MODE_DO_NOTHING},  INT_MIN, INT_MAX, S|D, 
> > "sub_charenc_mode"},
> >  {"auto",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > FF_SUB_CHARENC_MODE_AUTOMATIC},   INT_MIN, INT_MAX, S|D, 
> > "sub_charenc_mode"},
> >  {"pre_decoder", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > FF_SUB_CHARENC_MODE_PRE_DECODER}, INT_MIN, INT_MAX, S|D, 
> > "sub_charenc_mode"},
> > +{"sub_text_format", "set decoded text subtitle format", 
> > OFFSET(sub_text_format), AV_OPT_TYPE_INT, {.i64 = 
> > FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS}, 0, 1, S|D, "sub_text_format"},
> > +{"ass",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > FF_SUB_TEXT_FMT_ASS},  INT_MIN, INT_MAX, S|D, 
> > "sub_text_format"},
> > +{"ass_with_timings", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS}, INT_MIN, INT_MAX, S|D, 
> > "sub_text_format"},
> >  {"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_BOOL, 
> > {.i64 = 0}, 0, 1, A|V|D },
> 
> Missing docs update in doc/
> 

This is only for API users, so I'll add an entry in doc/APIChanges

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] Killing ASS timings in AVSubtitle ass text field

2016-02-24 Thread Clément Bœsch
On Sun, Feb 21, 2016 at 01:08:27PM +0100, Clément Bœsch wrote:
> [PATCH 1/6] Kill timed SSA
> 
> This one is an old patch, which kills the usage of the old and unused
> AV_CODEC_ID_SSA
> 
> [PATCH 2/6] lavc: allow subtitle text format to be ASS without timing
> 
> The big commit. Text based decoders do not have to rescale and insert the
> timing in the ASS text anymore. A compatibility function
> (convert_sub_to_old_ass_form()) is used to actually re-insert them. After this
> commit, you can get clean AVSubtitle by setting sub_text_format=ass in decoder
> context.
> 
> [PATCH 3/6] lavc/options: add ass_ro_flush_noop to flags2
> 
> Apparently, mpv do not want to reset the ReadOrder of the decoded subtitles on
> flush. This addition of this option makes it possible.
> 
> [PATCH 4/6] ffmpeg: set sub_text_format to ass (without timing) by default
> 
> Make use of the newly introduced option. The nice side effect is that it fixes
> all kind of long standing timing inaccuracy issues.
> 
> [PATCH 5/6] lavfi/ass: use ass_process_chunk() instead of ass_process_data()
> 
> libass has been willing to drop this since a long time...
> 
> [PATCH 6/6] lavc: deprecate decoded ass subtitles with timings
> 
> And the final deprecation to kill that code automatically at next major bump.
> Compilation and FATE tested when set to 0.

I'll push this patchset by the end of the week if I see no objection.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH 1/2] img2dec: Support Progressive JPEG in jpeg_probe

2016-02-24 Thread Carl Eugen Hoyos
Derek Buitenhuis  gmail.com> writes:

> From: Justin Ruggles  gmail.com>
> 
> There can be multiple SOS markers, so do not return 0 in that case.

Looks good to me.

Thank you, Carl Eugen

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


[FFmpeg-devel] [PATCH 0/2] img2dec improvements

2016-02-24 Thread Derek Buitenhuis
Justin Ruggles (2):
  img2dec: Support Progressive JPEG in jpeg_probe
  img2dec: Add mime_type to image formats

 libavformat/img2dec.c | 33 +
 1 file changed, 17 insertions(+), 16 deletions(-)

-- 
2.7.0

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


[FFmpeg-devel] [PATCH 2/2] img2dec: Add mime_type to image formats

2016-02-24 Thread Derek Buitenhuis
From: Justin Ruggles 

Improves probing, especially over http when there is a Content-Type header

Signed-off-by: Derek Buitenhuis 
---
 libavformat/img2dec.c | 31 ---
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index a755b6f..25cc82e 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -837,7 +837,7 @@ static int webp_probe(AVProbeData *p)
 return 0;
 }
 
-#define IMAGEAUTO_DEMUXER(imgname, codecid)\
+#define IMAGEAUTO_DEMUXER(imgname, codecid, mimetype)\
 static const AVClass imgname ## _class = {\
 .class_name = AV_STRINGIFY(imgname) " demuxer",\
 .item_name  = av_default_item_name,\
@@ -854,19 +854,20 @@ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
 .priv_class = & imgname ## _class,\
 .flags  = AVFMT_GENERIC_INDEX, \
 .raw_codec_id   = codecid,\
+.mime_type  = mimetype,\
 };
 
-IMAGEAUTO_DEMUXER(bmp, AV_CODEC_ID_BMP)
-IMAGEAUTO_DEMUXER(dds, AV_CODEC_ID_DDS)
-IMAGEAUTO_DEMUXER(dpx, AV_CODEC_ID_DPX)
-IMAGEAUTO_DEMUXER(exr, AV_CODEC_ID_EXR)
-IMAGEAUTO_DEMUXER(j2k, AV_CODEC_ID_JPEG2000)
-IMAGEAUTO_DEMUXER(jpeg,AV_CODEC_ID_MJPEG)
-IMAGEAUTO_DEMUXER(jpegls,  AV_CODEC_ID_JPEGLS)
-IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR)
-IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
-IMAGEAUTO_DEMUXER(qdraw,   AV_CODEC_ID_QDRAW)
-IMAGEAUTO_DEMUXER(sgi, AV_CODEC_ID_SGI)
-IMAGEAUTO_DEMUXER(sunrast, AV_CODEC_ID_SUNRAST)
-IMAGEAUTO_DEMUXER(tiff,AV_CODEC_ID_TIFF)
-IMAGEAUTO_DEMUXER(webp,AV_CODEC_ID_WEBP)
+IMAGEAUTO_DEMUXER(bmp, AV_CODEC_ID_BMP,  "image/bmp")
+IMAGEAUTO_DEMUXER(dds, AV_CODEC_ID_DDS,  "image/vnd-ms.dds")
+IMAGEAUTO_DEMUXER(dpx, AV_CODEC_ID_DPX,  "image/dpx")
+IMAGEAUTO_DEMUXER(exr, AV_CODEC_ID_EXR,  "image/x-exr")
+IMAGEAUTO_DEMUXER(j2k, AV_CODEC_ID_JPEG2000, "image/jp2")
+IMAGEAUTO_DEMUXER(jpeg,AV_CODEC_ID_MJPEG,"image/jpeg")
+IMAGEAUTO_DEMUXER(jpegls,  AV_CODEC_ID_JPEGLS,   NULL)
+IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR,   NULL)
+IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG,  "image/png")
+IMAGEAUTO_DEMUXER(qdraw,   AV_CODEC_ID_QDRAW,"image/x-pict")
+IMAGEAUTO_DEMUXER(sgi, AV_CODEC_ID_SGI,  "image/x-sgi")
+IMAGEAUTO_DEMUXER(sunrast, AV_CODEC_ID_SUNRAST,  "image/x-sun-raster")
+IMAGEAUTO_DEMUXER(tiff,AV_CODEC_ID_TIFF, "image/tiff")
+IMAGEAUTO_DEMUXER(webp,AV_CODEC_ID_WEBP, "image/webp")
-- 
2.7.0

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


Re: [FFmpeg-devel] GPL license violation

2016-02-24 Thread Ronald S. Bultje
On Tue, Feb 23, 2016 at 8:44 PM, Andrea Lazzarotto <
andrea.lazzaro...@gmail.com> wrote:

> 2016-02-21 21:39 GMT+01:00 Andrea Lazzarotto  >:
>
> > I recently discovered a proprietary software violating multiple licenses
> > of several open source projects, including Mplayer, FFmpeg and XviD.
> >
>
> Unfortunately, the traffic of this ML is too high for me, therefore I am
> unsubscribing. I would appreciate if someone could CC me to the thread if
> there is some activity.


Please file a bug report on trac.ffmpeg.org for license violations. I'm not
guaranteeing that anything will happen, but at least it's easier to keep
track of than ML.

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


[FFmpeg-devel] [PATCH v26] lavf/movenc: Add palette to video sample description

2016-02-24 Thread Mats Peterson
Small fix. Sorry for my spam-like patch posting, but that's the way I 
work at the moment. I'll try to limit myself in the future.


Mats
>From 0cf62b279e2577655e3867e8b0287c191784eeaa Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Wed, 24 Feb 2016 12:49:50 +0100
Subject: [PATCH v26] lavf/movenc: Add palette to video sample description

---
 libavformat/movenc.c |   63 --
 libavformat/movenc.h |5 
 2 files changed, 66 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b9c0f7a..f9b16b4 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1711,10 +1711,29 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr
 avio_write(pb, compressor_name, 31);
 
 if (track->mode == MODE_MOV && track->enc->bits_per_coded_sample)
-avio_wb16(pb, track->enc->bits_per_coded_sample);
+avio_wb16(pb, track->enc->bits_per_coded_sample |
+  (track->enc->pix_fmt == AV_PIX_FMT_GRAY8 ? 0x20 : 0));
 else
 avio_wb16(pb, 0x18); /* Reserved */
-avio_wb16(pb, 0x); /* Reserved */
+
+if (track->is_unaligned_qt_rgb && track->enc->pix_fmt == AV_PIX_FMT_PAL8) {
+int i;
+avio_wb16(pb, 0); /* Color table ID */
+avio_wb32(pb, 0); /* Color table seed */
+avio_wb16(pb, 0x8000);/* Color table flags */
+avio_wb16(pb, 255);   /* Color table size (zero-relative) */
+for (i = 0; i < 256; i++) {
+uint16_t r = (track->palette[i] >> 16) & 0xff;
+uint16_t g = (track->palette[i] >> 8)  & 0xff;
+uint16_t b = track->palette[i] & 0xff;
+avio_wb16(pb, 0);
+avio_wb16(pb, (r << 8) | r);
+avio_wb16(pb, (g << 8) | g);
+avio_wb16(pb, (b << 8) | b);
+}
+} else
+avio_wb16(pb, 0x); /* Reserved */
+
 if (track->tag == MKTAG('m','p','4','v'))
 mov_write_esds_tag(pb, track);
 else if (track->enc->codec_id == AV_CODEC_ID_H263)
@@ -4703,6 +4722,7 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
 } else {
 int i;
 MOVMuxContext *mov = s->priv_data;
+MOVTrack *trk = >tracks[pkt->stream_index];
 
 if (!pkt->size)
 return mov_write_single_packet(s, pkt); /* Passthrough. */
@@ -4739,6 +4759,31 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
 }
 }
 
+if (trk->is_unaligned_qt_rgb) {
+const uint8_t *data = pkt->data;
+int size = pkt->size;
+int64_t bpc = trk->enc->bits_per_coded_sample != 15 ? trk->enc->bits_per_coded_sample : 16;
+int expected_stride = ((trk->enc->width * bpc + 15) >> 4)*2;
+int ret = ff_reshuffle_raw_rgb(s, , trk->enc, expected_stride);
+if (ret < 0)
+return ret;
+if (ret == CONTAINS_PAL && !trk->pal_done) {
+int pal_size = 1 << trk->enc->bits_per_coded_sample;
+memset(trk->palette, 0, AVPALETTE_SIZE);
+memcpy(trk->palette, data + size - 4*pal_size, 4*pal_size);
+trk->pal_done++;
+} else if (trk->enc->pix_fmt == AV_PIX_FMT_GRAY8 ||
+   trk->enc->pix_fmt == AV_PIX_FMT_MONOBLACK) {
+for (i = 0; i < pkt->size; i++)
+pkt->data[i] = ~pkt->data[i];
+}
+if (ret) {
+ret = mov_write_single_packet(s, pkt);
+av_packet_free();
+return ret;
+}
+}
+
 return mov_write_single_packet(s, pkt);
 }
 }
@@ -5249,6 +5294,20 @@ static int mov_write_header(AVFormatContext *s)
"WARNING codec timebase is very high. If duration is too long,\n"
"file may not be playable by quicktime. Specify a shorter timebase\n"
"or choose different container.\n");
+if (track->mode == MODE_MOV &&
+track->enc->codec_id == AV_CODEC_ID_RAWVIDEO &&
+track->tag == MKTAG('r','a','w',' ')) {
+enum AVPixelFormat pix_fmt = track->enc->pix_fmt;
+if (pix_fmt == AV_PIX_FMT_NONE && track->enc->bits_per_coded_sample == 1)
+pix_fmt = AV_PIX_FMT_MONOWHITE;
+track->is_unaligned_qt_rgb =
+pix_fmt == AV_PIX_FMT_RGB24 ||
+pix_fmt == AV_PIX_FMT_BGR24 ||
+pix_fmt == AV_PIX_FMT_PAL8 ||
+pix_fmt == AV_PIX_FMT_GRAY8 ||
+pix_fmt == AV_PIX_FMT_MONOWHITE ||
+pix_fmt == AV_PIX_FMT_MONOBLACK;
+}
 } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
 track->timescale = st->codec->sample_rate;
  

Re: [FFmpeg-devel] [PATCH v25] lavf/movenc: Add palette to video sample description

2016-02-24 Thread Mats Peterson

On 02/24/2016 12:40 PM, Mats Peterson wrote:

On 02/24/2016 12:33 PM, Mats Peterson wrote:

Sorry, Moritz. Use the same logic as riffenc.c, treating pixel format as
AV_PIX_FMT_MONOWHITE if not set.

And the bit detph is 1 bpp, that is.



depth

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


Re: [FFmpeg-devel] [PATCH v25] lavf/movenc: Add palette to video sample description

2016-02-24 Thread Mats Peterson

On 02/24/2016 12:33 PM, Mats Peterson wrote:

Sorry, Moritz. Use the same logic as riffenc.c, treating pixel format as
AV_PIX_FMT_MONOWHITE if not set.

And the bit detph is 1 bpp, that is.

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


[FFmpeg-devel] [PATCH v25] lavf/movenc: Add palette to video sample description

2016-02-24 Thread Mats Peterson
Sorry, Moritz. Use the same logic as riffenc.c, treating pixel format as 
AV_PIX_FMT_MONOWHITE if not set.


--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From 00c5fe1e377d37c292417e41290c72039a55b899 Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Wed, 24 Feb 2016 12:31:09 +0100
Subject: [PATCH v25] lavf/movenc: Add palette to video sample description

---
 libavformat/movenc.c |   63 --
 libavformat/movenc.h |5 
 2 files changed, 66 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b9c0f7a..920613e 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1711,10 +1711,29 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr
 avio_write(pb, compressor_name, 31);
 
 if (track->mode == MODE_MOV && track->enc->bits_per_coded_sample)
-avio_wb16(pb, track->enc->bits_per_coded_sample);
+avio_wb16(pb, track->enc->bits_per_coded_sample |
+  (track->enc->pix_fmt == AV_PIX_FMT_GRAY8 ? 0x20 : 0));
 else
 avio_wb16(pb, 0x18); /* Reserved */
-avio_wb16(pb, 0x); /* Reserved */
+
+if (track->is_unaligned_qt_rgb && track->enc->pix_fmt == AV_PIX_FMT_PAL8) {
+int i;
+avio_wb16(pb, 0); /* Color table ID */
+avio_wb32(pb, 0); /* Color table seed */
+avio_wb16(pb, 0x8000);/* Color table flags */
+avio_wb16(pb, 255);   /* Color table size (zero-relative) */
+for (i = 0; i < 256; i++) {
+uint16_t r = (track->palette[i] >> 16) & 0xff;
+uint16_t g = (track->palette[i] >> 8)  & 0xff;
+uint16_t b = track->palette[i] & 0xff;
+avio_wb16(pb, 0);
+avio_wb16(pb, (r << 8) | r);
+avio_wb16(pb, (g << 8) | g);
+avio_wb16(pb, (b << 8) | b);
+}
+} else
+avio_wb16(pb, 0x); /* Reserved */
+
 if (track->tag == MKTAG('m','p','4','v'))
 mov_write_esds_tag(pb, track);
 else if (track->enc->codec_id == AV_CODEC_ID_H263)
@@ -4703,6 +4722,7 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
 } else {
 int i;
 MOVMuxContext *mov = s->priv_data;
+MOVTrack *trk = >tracks[pkt->stream_index];
 
 if (!pkt->size)
 return mov_write_single_packet(s, pkt); /* Passthrough. */
@@ -4739,6 +4759,31 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
 }
 }
 
+if (trk->is_unaligned_qt_rgb) {
+const uint8_t *data = pkt->data;
+int size = pkt->size;
+int64_t bpc = trk->enc->bits_per_coded_sample != 15 ? trk->enc->bits_per_coded_sample : 16;
+int expected_stride = ((trk->enc->width * bpc + 15) >> 4)*2;
+int ret = ff_reshuffle_raw_rgb(s, , trk->enc, expected_stride);
+if (ret < 0)
+return ret;
+if (ret == CONTAINS_PAL && !trk->pal_done) {
+int pal_size = 1 << trk->enc->bits_per_coded_sample;
+memset(trk->palette, 0, AVPALETTE_SIZE);
+memcpy(trk->palette, data + size - 4*pal_size, 4*pal_size);
+trk->pal_done++;
+} else if (trk->enc->pix_fmt == AV_PIX_FMT_GRAY8 ||
+   trk->enc->pix_fmt == AV_PIX_FMT_MONOBLACK) {
+for (i = 0; i < pkt->size; i++)
+pkt->data[i] = ~pkt->data[i];
+}
+if (ret) {
+ret = mov_write_single_packet(s, pkt);
+av_packet_free();
+return ret;
+}
+}
+
 return mov_write_single_packet(s, pkt);
 }
 }
@@ -5249,6 +5294,20 @@ static int mov_write_header(AVFormatContext *s)
"WARNING codec timebase is very high. If duration is too long,\n"
"file may not be playable by quicktime. Specify a shorter timebase\n"
"or choose different container.\n");
+if (track->mode == MODE_MOV &&
+track->enc->codec_id == AV_CODEC_ID_RAWVIDEO &&
+(!track->enc->codec_tag || track->enc->codec_tag == MKTAG('r','a','w',' '))) {
+enum AVPixelFormat pix_fmt = track->enc->pix_fmt;
+if (pix_fmt == AV_PIX_FMT_NONE && track->enc->bits_per_coded_sample == 1)
+pix_fmt = AV_PIX_FMT_MONOWHITE;
+track->is_unaligned_qt_rgb =
+pix_fmt == AV_PIX_FMT_RGB24 ||
+pix_fmt == AV_PIX_FMT_BGR24 ||
+pix_fmt == AV_PIX_FMT_PAL8 ||
+pix_fmt == AV_PIX_FMT_GRAY8 ||
+pix_fmt == AV_PIX_FMT_MONOWHITE ||
+pix_fmt == AV_PIX_FMT_MONOBLACK;
+}
 } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
  

[FFmpeg-devel] [PATCH] configure: add missing --strip option to show_help()

2016-02-24 Thread Matthieu Bouron
From: Matthieu Bouron 

---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 3d1ee49..337a060 100755
--- a/configure
+++ b/configure
@@ -309,6 +309,7 @@ Toolchain options:
   --nm=NM  use nm tool NM [$nm_default]
   --ar=AR  use archive tool AR [$ar_default]
   --as=AS  use assembler AS [$as_default]
+  --strip=STRIPuse strip tool STRIP [$strip_default]
   --windres=WINDRESuse windows resource compiler WINDRES 
[$windres_default]
   --yasmexe=EXEuse yasm-compatible assembler EXE [$yasmexe_default]
   --cc=CC  use C compiler CC [$cc_default]
-- 
2.7.1

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


Re: [FFmpeg-devel] [PATCH]lavf/img2enc: Allow to reverse frame order

2016-02-24 Thread Carl Eugen Hoyos
Ronald S. Bultje  gmail.com> writes:

> > As requested on ffmpeg-user.
> 
> I'm a little ambivalent to this. Let me explain. You can 
> easily fix this with a shell script that creates links 
> from img-{1000...1}.jpg to img_2_{1...1000}.jpg and deletes 
> them after the ffmpeg run. This is super-trivial.

But the fact that this can be solved with other (non-FFmpeg) 
tools never seemed to be an argument here (and I believe this 
was usually a good thing): What has changed?
And don't you agree that using two steps to work around a 
smalls self-contained patch is generally a very bad idea?

> The problem I have with this is that we're slowly, and very 
> very hackishly, extending the sequential image support without 
> addressing its fundamental weakness as a non-unix tool:

I am not sure I understand so far, but it may be related.

> it doesn't use shell expansion. I'd want to use 
> ffmpeg -i img-*.jpg so it skips non-existing frames, 

Could you elaborate?
I believe this either cannot work, or does already work, 
depending on what you mean.
In any case, how is this muxer-related patch related to a 
demuxing issue you see?

> or use other unix tools to rev the order or whatever, 
> shell syntax is great for this but ffmpeg.exe does not 
> support any of that.

(I find it striking that you use "shell syntax" and "exe" 
in the same sentence...)

> So why hack in this one silly thing if we don't address 
> the fundamental problem instead, which would also fix this?

How would fix a demuxing issue (that I don't think was ever 
reported, but as said I may just misunderstand you) solve a 
real enhancement request by a real user that sounds easily 
understandable to me?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avutil/md5: fix unaligned loads

2016-02-24 Thread Clément Bœsch
On Tue, Feb 23, 2016 at 10:40:08PM -0300, James Almer wrote:
[...]
> That aside, note that these runtime erros happen with every test using md5 and
> don't make ubsan register them as failed. In the link above something else 
> made
> it fail. It makes me wonder how many other ubsan errors are hidden this way.

Ah this was because there were no option to do it differently when the
option was introduced. I can probably use
-fsanitize-undefined-trap-on-error or similar on error nowadays. Maybe I
should use that.

-- 
Clément B.


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