[FFmpeg-devel] [PATCH] [release/2.6] Add release notes

2015-03-05 Thread Clément Bœsch
---
 RELEASE_NOTES | 59 +++
 1 file changed, 59 insertions(+)
 create mode 100644 RELEASE_NOTES

diff --git a/RELEASE_NOTES b/RELEASE_NOTES
new file mode 100644
index 000..c1e9248
--- /dev/null
+++ b/RELEASE_NOTES
@@ -0,0 +1,59 @@
+
+  ┌─┐
+  │ RELEASE NOTES for FFmpeg 2.6 Grothendieck │
+  └─┘
+
+   The FFmpeg Project proudly presents FFmpeg 2.6 Grothendieck.
+
+   A lot of important work got in this time, so let's start talking about what
+   we like to brag the most about: features.
+
+   A lot of people will probably be happy to hear that we now have support for
+   the NVENC — the Nvidia Video Encoder interface — for H.264 encoding, thanks
+   to Timo Rothenpieler, with some little help from NVIDIA and Philip Langdale.
+
+   People in the broadcasting industry might also be interested in the first
+   steps of closed captions support with the introduction of a decoder.
+
+   Regarding filters love, we improved and added many. We could talk about the
+   10-bit support in spp, but maybe it's more important to mention the addition
+   of colorlevels (yet another color handling filter), tblend (allowing you
+   to for example run a diff between successive frames of a video stream), or
+   eventually the dcshift audio filter.
+
+   There is also two other important filters landing in libavfilter: palettegen
+   and paletteuse, submitted by the Stupeflix company. These filters will be
+   very useful in case you are looking for creating high quality GIF, a format
+   that still bravely fights annihilation in 2015.
+
+   There are many other features, but now let's follow-up on one big cleanup
+   achievement: libmpcodecs (MPlayer filters) wrapper is finally dead. The last
+   remaining filters (softpulldown/repeatfields, eq*, and various
+   postprocessing filters) were ported by Arwa Arif (OPW student) and Paul B
+   Mahol.
+
+   Concerning API changes, not much things to mention. Thought, the
+   introduction of devices inputs and outputs listing is a notable addition
+   (try ffmpeg -sources or ffmpeg -sinks for an example of usage). See
+   doc/APIchanges for more information.
+
+   Now let's talk about optimizations. Ronald S. Bultje made the VP9 codec
+   usable on x86 32-bit systems and pre-ssse3 CPUs like Phenom (even dual core
+   Athlons can run 1080p 30fps VP9 content now), so we now secretely hope for
+   Google and Mozilla to use ffvp9 instead of libvpx.
+
+   But VP9 is not the center of attention anymore, and HEVC is also getting
+   many improvements, which includes optimizations, both in C and x86 ASM,
+   mainly from James Almer and Christophe Gisquet.
+
+   And finally, our Supreme Leader Michael Niedermayer is still fixing many
+   bugs, dealing with most of the boring work such as making releases, applying
+   tons of contributors patches, and daily merging the changes from the Libav
+   project.
+
+   A more complete Changelog is available at the root of the project, and the
+   complete Git history on http://source.ffmpeg.org.
+
+   As usual, if you have any question on this release or any FFmpeg related
+   topic, feel free to join us on the #ffmpeg IRC channel (on
+   irc.freenode.net) or ask on the mailing-lists.
-- 
2.3.1

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


Re: [FFmpeg-devel] [PATCH] configure: Check linking against CoreGraphics or, ApplicationServices framework for avfoundation input device.

2015-03-05 Thread Thilo Borgmann
Am 08.02.15 um 15:19 schrieb Carl Eugen Hoyos:
 Hi!
 
 On Wednesday 04 February 2015 01:48:53 pm Thilo Borgmann wrote:

 fixes Ticket #4238.

 Testing for CGImageGetTypeID function is questionable (see trac
 discussion). If someone has a better idea, please let me know.
 
 Alternative patch attached.
 
 Also attached is a patch that I believe is necessary for 
 iOS audio capture, but it is mostly untested.
 (It allows device listing though.)
 
 Please comment, Carl Eugen

Please apply patchavfs16.diff anyone.

Thanks!
-Thilo

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


Re: [FFmpeg-devel] [PATCH] configure: Check linking against CoreGraphics or, ApplicationServices framework for avfoundation input device.

2015-03-05 Thread Michael Niedermayer
On Thu, Mar 05, 2015 at 08:18:26PM +0100, Thilo Borgmann wrote:
 Am 08.02.15 um 15:19 schrieb Carl Eugen Hoyos:
  Hi!
  
  On Wednesday 04 February 2015 01:48:53 pm Thilo Borgmann wrote:
 
  fixes Ticket #4238.
 
  Testing for CGImageGetTypeID function is questionable (see trac
  discussion). If someone has a better idea, please let me know.
  
  Alternative patch attached.
  
  Also attached is a patch that I believe is necessary for 
  iOS audio capture, but it is mostly untested.
  (It allows device listing though.)
  
  Please comment, Carl Eugen
 
 Please apply patchavfs16.diff anyone.

id do it, but i dont know what commit message to use

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable


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


Re: [FFmpeg-devel] [PATCH] webp: ensure that each transform is only used once

2015-03-05 Thread Michael Niedermayer
On Thu, Mar 05, 2015 at 11:02:20PM +0100, Andreas Cadhalpun wrote:
 Hi,
 
 according to the WebP Lossless Bitstream Specification [1] each
 transform is allowed to be used only once. Attached patch adds
 checks for this to avoid crashes decoding broken files.
 
 Best regards,
 Andreas
 
 1: 
 https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#3_transformations

  webp.c |   39 +++
  1 file changed, 35 insertions(+), 4 deletions(-)
 75151057a49b79fb058771e0f9e59d8fd68bd5c2  
 0001-webp-ensure-that-each-transform-is-only-used-once.patch
 From d80baa7f786ca326891e145a000fbecdde55da80 Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 Date: Thu, 5 Mar 2015 22:48:28 +0100
 Subject: [PATCH] webp: ensure that each transform is only used once
 
 According to the WebP Lossless Bitstream Specification
 each transform is allowed to be used only once.
 
 If a transform is more than once this can lead to memory
 corruption.
 
 Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 ---
  libavcodec/webp.c | 39 +++
  1 file changed, 35 insertions(+), 4 deletions(-)
 
 diff --git a/libavcodec/webp.c b/libavcodec/webp.c
 index 9549c0e..2cd976f 100644
 --- a/libavcodec/webp.c
 +++ b/libavcodec/webp.c
 @@ -1104,7 +1104,7 @@ static int vp8_lossless_decode_frame(AVCodecContext 
 *avctx, AVFrame *p,
   unsigned int data_size, int 
 is_alpha_chunk)
  {
  WebPContext *s = avctx-priv_data;
 -int w, h, ret, i;
 +int w, h, ret, i, used;
  
  if (!is_alpha_chunk) {
  s-lossless = 1;
 @@ -1154,18 +1154,49 @@ static int vp8_lossless_decode_frame(AVCodecContext 
 *avctx, AVFrame *p,
  /* parse transformations */
  s-nb_transforms = 0;
  s-reduced_width = 0;
 +used = 0;
  while (get_bits1(s-gb)) {
  enum TransformType transform = get_bits(s-gb, 2);
  s-transforms[s-nb_transforms++] = transform;
  switch (transform) {
  case PREDICTOR_TRANSFORM:
 -ret = parse_transform_predictor(s);
 +if (used  1) {
 +av_log(avctx, AV_LOG_ERROR,
 +   Predictor transform used more than once\n);
 +ret = AVERROR_INVALIDDATA;
 +} else {
 +used |= 1;
 +ret = parse_transform_predictor(s);
 +}

can be simplified to something like

if (used  (1transform)) {
av_log(avctx, AV_LOG_ERROR, %s used more than once\n, name[transform]);
ret = AVERROR_INVALIDDATA;
goto free_and_return;
}
used |= 1transform;

or
if(used[transform]++)
even

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


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


Re: [FFmpeg-devel] [PATCH] configure: Check linking against CoreGraphics or, ApplicationServices framework for avfoundation input device.

2015-03-05 Thread Thilo Borgmann
Am 05.03.15 um 22:57 schrieb Michael Niedermayer:
 On Thu, Mar 05, 2015 at 08:18:26PM +0100, Thilo Borgmann wrote:
 Am 08.02.15 um 15:19 schrieb Carl Eugen Hoyos:
 Hi!

 On Wednesday 04 February 2015 01:48:53 pm Thilo Borgmann wrote:

 fixes Ticket #4238.

 Testing for CGImageGetTypeID function is questionable (see trac
 discussion). If someone has a better idea, please let me know.

 Alternative patch attached.

 Also attached is a patch that I believe is necessary for 
 iOS audio capture, but it is mostly untested.
 (It allows device listing though.)

 Please comment, Carl Eugen

 Please apply patchavfs16.diff anyone.
 
 id do it, but i dont know what commit message to use

lavd/avfoundation: Add support for 16bit integer input.

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


[FFmpeg-devel] [PATCH] is_compiled flag not being cleared in av_opencl_uninit

2015-03-05 Thread Srikanth G
When OpenCL kernels are compiled, is_compiled flag is being set for each
kernel. But, in opencl uninit, this flag is not being cleared.
This causes an error when an OpenCL kernel is tried on different OpenCL
devices on same platform.

Here is the patch with a fix

From df43e0aaad951c43fa7f4c9d9e074fd6b2d09792 Mon Sep 17 00:00:00 2001
From: srikanth gska...@gmail.com
Date: Wed, 4 Mar 2015 17:46:13 -0600
Subject: [PATCH] Bug Fix: When OpenCL kernels are compiled, is_compiled flag
 is being set. But, on opencl uninit, this flag is not being cleared. When
 openCl uninit is done and again use OpenCl for different device on same
 platform, we get an error as is_compiled flag stays set.

---
 libavutil/opencl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/opencl.c b/libavutil/opencl.c
index 36cb6fe..a56029c 100644
--- a/libavutil/opencl.c
+++ b/libavutil/opencl.c
@@ -611,6 +611,9 @@ void av_opencl_uninit(void)
 }
 opencl_ctx.context = NULL;
 }
+ for (i = 0; i  opencl_ctx.kernel_code_count; i++) {
+opencl_ctx.kernel_code[i].is_compiled = 0;
+}
 free_device_list(opencl_ctx.device_list);
 end:
 if (opencl_ctx.init_count = 0)
-- 
1.9.0.msysgit.0

Regards
Srikanth


0001-Bug-Fix-When-OpenCL-kernels-are-compiled-is_compiled.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2] hls: detect SAMPLE-AES encryption

2015-03-05 Thread Michael Niedermayer
On Thu, Mar 05, 2015 at 07:49:57PM +0100, selsta wrote:
 SAMPLE-AES encryption is not commonly used yet, but without this patch
 ffmpeg is thinking that the hls segments are not encrypted which
 produces broken files.
 ---
  libavformat/hls.c | 9 -
  1 file changed, 8 insertions(+), 1 deletion(-)

applied

thanks

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


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


Re: [FFmpeg-devel] [PATCH] configure: Check linking against CoreGraphics or, ApplicationServices framework for avfoundation input device.

2015-03-05 Thread Carl Eugen Hoyos
Thilo Borgmann thilo.borgmann at mail.de writes:

 lavd/avfoundation: Add support for 16bit integer input.

I used this commit message for my patch and also 
pushed John Robinson's patch with a similar message.

Carl Eugen

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


[FFmpeg-devel] [PATCH] webp: ensure that each transform is only used once

2015-03-05 Thread Andreas Cadhalpun

Hi,

according to the WebP Lossless Bitstream Specification [1] each 
transform is allowed to be used only once. Attached patch adds checks 
for this to avoid crashes decoding broken files.


Best regards,
Andreas

1: 
https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#3_transformations
From d80baa7f786ca326891e145a000fbecdde55da80 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Thu, 5 Mar 2015 22:48:28 +0100
Subject: [PATCH] webp: ensure that each transform is only used once

According to the WebP Lossless Bitstream Specification
each transform is allowed to be used only once.

If a transform is more than once this can lead to memory
corruption.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavcodec/webp.c | 39 +++
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 9549c0e..2cd976f 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1104,7 +1104,7 @@ static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
  unsigned int data_size, int is_alpha_chunk)
 {
 WebPContext *s = avctx-priv_data;
-int w, h, ret, i;
+int w, h, ret, i, used;
 
 if (!is_alpha_chunk) {
 s-lossless = 1;
@@ -1154,18 +1154,49 @@ static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
 /* parse transformations */
 s-nb_transforms = 0;
 s-reduced_width = 0;
+used = 0;
 while (get_bits1(s-gb)) {
 enum TransformType transform = get_bits(s-gb, 2);
 s-transforms[s-nb_transforms++] = transform;
 switch (transform) {
 case PREDICTOR_TRANSFORM:
-ret = parse_transform_predictor(s);
+if (used  1) {
+av_log(avctx, AV_LOG_ERROR,
+   Predictor transform used more than once\n);
+ret = AVERROR_INVALIDDATA;
+} else {
+used |= 1;
+ret = parse_transform_predictor(s);
+}
 break;
 case COLOR_TRANSFORM:
-ret = parse_transform_color(s);
+if (used  2) {
+av_log(avctx, AV_LOG_ERROR,
+   Color transform used more than once\n);
+ret = AVERROR_INVALIDDATA;
+} else {
+used |= 2;
+ret = parse_transform_color(s);
+}
+break;
+case SUBTRACT_GREEN:
+if (used  4) {
+av_log(avctx, AV_LOG_ERROR,
+   Subtract green used more than once\n);
+ret = AVERROR_INVALIDDATA;
+} else {
+used |= 4;
+}
 break;
 case COLOR_INDEXING_TRANSFORM:
-ret = parse_transform_color_indexing(s);
+if (used  8) {
+av_log(avctx, AV_LOG_ERROR,
+   Color indexing transform used more than once\n);
+ret = AVERROR_INVALIDDATA;
+} else {
+used |= 8;
+ret = parse_transform_color_indexing(s);
+}
 break;
 }
 if (ret  0)
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] [release/2.6] Add release notes

2015-03-05 Thread James Almer
On 05/03/15 6:26 PM, Clément Bœsch wrote:
 +   Now let's talk about optimizations. Ronald S. Bultje made the VP9 codec
 +   usable on x86 32-bit systems and pre-ssse3 CPUs like Phenom (even dual 
 core
 +   Athlons can run 1080p 30fps VP9 content now), so we now secretely hope for

I think play is better than run (And yes, i know i originally wrote that 
:P).

 +   Google and Mozilla to use ffvp9 instead of libvpx.
 +
 +   But VP9 is not the center of attention anymore, and HEVC is also getting
 +   many improvements, which includes optimizations, both in C and x86 ASM,
 +   mainly from James Almer and Christophe Gisquet.

Pierre-Edouard Lepere and Seppo Tomperi should be mentioned as well, the latter 
for 
his ARM assembly work (The first ARM code to make it to the tree for that 
matter, 
so worth pointing out here).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [libav-devel] [PATCH] webp: ensure that each transform is only used once

2015-03-05 Thread Andreas Cadhalpun

On 05.03.2015 23:12, Justin Ruggles wrote:

On 03/05/2015 05:02 PM, Andreas Cadhalpun wrote:

From d80baa7f786ca326891e145a000fbecdde55da80 Mon Sep 17 00:00:00 2001

From: Andreas Cadhalpunandreas.cadhal...@googlemail.com
Date: Thu, 5 Mar 2015 22:48:28 +0100
Subject: [PATCH] webp: ensure that each transform is only used once

According to the WebP Lossless Bitstream Specification
each transform is allowed to be used only once.

If a transform is more than once this can lead to memory
corruption.


Can you give more details about the memory corruption?


Yes, but I think it's not really important, because the code was never 
meant to handle the same transform twice.
Anyway: If e.g. the color indexing transform is used twice, then 
parse_transform_color_indexing is called twice, which calls 
decode_entropy_coded_image with different parameters w.
There av_frame_get_buffer(img-frame, 1) is called, which the first time 
allocates a buffer for the first w, but the second time, 
img-frame-linesize[0] is not 0, so it is not updated in 
get_video_buffer, which means a buffer of the wrong size (e.g. too 
small) is allocated.
When this buffer is later written to, it just writes after the end of 
the buffer, overwriting whatever is there, e.g. pointers to other 
buffers, which then leads to crashes if these are accessed/freed.



Signed-off-by: Andreas Cadhalpunandreas.cadhal...@googlemail.com
---
  libavcodec/webp.c | 39 +++
  1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 9549c0e..2cd976f 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1104,7 +1104,7 @@ static int
vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
   unsigned int data_size, int
is_alpha_chunk)
  {
  WebPContext *s = avctx-priv_data;
-int w, h, ret, i;
+int w, h, ret, i, used;

  if (!is_alpha_chunk) {
  s-lossless = 1;
@@ -1154,18 +1154,49 @@ static int
vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
  /* parse transformations */
  s-nb_transforms = 0;
  s-reduced_width = 0;
+used = 0;
  while (get_bits1(s-gb)) {
  enum TransformType transform = get_bits(s-gb, 2);
  s-transforms[s-nb_transforms++] = transform;
  switch (transform) {
  case PREDICTOR_TRANSFORM:
-ret = parse_transform_predictor(s);
+if (used  1) {


Use (1  transform) and move all of these checks to a single check
before the switch.


That's a good idea. Update patch attached.

Best regards,
Andreas

From de11cf3ffbdf9d5c2118e42b8c0e59297c7e28ee Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
Date: Thu, 5 Mar 2015 22:48:28 +0100
Subject: [PATCH] webp: ensure that each transform is only used once

According to the WebP Lossless Bitstream Specification
each transform is allowed to be used only once.

If a transform is more than once this can lead to memory
corruption.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
---
 libavcodec/webp.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 9549c0e..2483055 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1104,7 +1104,7 @@ static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
  unsigned int data_size, int is_alpha_chunk)
 {
 WebPContext *s = avctx-priv_data;
-int w, h, ret, i;
+int w, h, ret, i, used;
 
 if (!is_alpha_chunk) {
 s-lossless = 1;
@@ -1154,9 +1154,17 @@ static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
 /* parse transformations */
 s-nb_transforms = 0;
 s-reduced_width = 0;
+used = 0;
 while (get_bits1(s-gb)) {
 enum TransformType transform = get_bits(s-gb, 2);
 s-transforms[s-nb_transforms++] = transform;
+if (used  (1  transform)) {
+av_log(avctx, AV_LOG_ERROR, Transform %d used more than once\n,
+   transform);
+ret = AVERROR_INVALIDDATA;
+goto free_and_return;
+}
+used |= (1  transform);
 switch (transform) {
 case PREDICTOR_TRANSFORM:
 ret = parse_transform_predictor(s);
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] [release/2.6] Add release notes

2015-03-05 Thread Lou Logan
On Thu, Mar 5, 2015, at 12:26 PM, Clément Bœsch wrote:
 ---
  RELEASE_NOTES | 59
  +++
  1 file changed, 59 insertions(+)
  create mode 100644 RELEASE_NOTES
...
 +   Concerning API changes, not much things to mention. Thought, the

Typo: Though

Looks great. I really just wanted to suggest that the release notes
would be good fodder for the news page. People like reading this stuff.

I'd do it, but I need to pack. I'll be back March 16. Prod compn to look
at the ML queue at least once, the lazy bastard.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] lavf/concatdef: pass options to nested input

2015-03-05 Thread Zhang Rui
2015-03-05 20:34 GMT+08:00 Nicolas George geo...@nsup.org:
 Le quintidi 15 ventôse, an CCXXIII, Zhang Rui a écrit :

 Your solution is enough for my case.
 And as you said, my patch may be not desirable.

 I believe it depends on the use case, and it is not completely obvious which
 side your example falls on.

In my situation, all segments are deployed on same http server,
and need same options. So both sides are OK for me.

In my own project, I would use read_header2 to specify options
for all segments which is convenient, and use per-file option for
special situations.

I'm also trying to introduce read_header2 into libavformat/hls.c,
which has been setting internal input options manually, incompletely
and dependently.
Obviously, we have no chance, and may have no need to set per-file
ffmpeg option in hls.

But I'm not sure read_headers2 is OK as an ffmpeg API,
Besides your concern about same options for all segments,
There is also a concern about same options for upper and lower inputs.

Would you mind to share more ideas about read_headers2 callback?

 But in the meantime I have started implementing per-file options for the
 concat demuxer, see the attached patch.

Looks great to me.
Do you have more WIP / plans / ideas on concatdec to share?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [libav-devel] [PATCH] webp: ensure that each transform is only used once

2015-03-05 Thread Michael Niedermayer
On Fri, Mar 06, 2015 at 12:20:06AM +0100, Andreas Cadhalpun wrote:
 On 05.03.2015 23:12, Justin Ruggles wrote:
 On 03/05/2015 05:02 PM, Andreas Cadhalpun wrote:
 From d80baa7f786ca326891e145a000fbecdde55da80 Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpunandreas.cadhal...@googlemail.com
 Date: Thu, 5 Mar 2015 22:48:28 +0100
 Subject: [PATCH] webp: ensure that each transform is only used once
 
 According to the WebP Lossless Bitstream Specification
 each transform is allowed to be used only once.
 
 If a transform is more than once this can lead to memory
 corruption.
 
 Can you give more details about the memory corruption?
 
 Yes, but I think it's not really important, because the code was
 never meant to handle the same transform twice.
 Anyway: If e.g. the color indexing transform is used twice, then
 parse_transform_color_indexing is called twice, which calls
 decode_entropy_coded_image with different parameters w.
 There av_frame_get_buffer(img-frame, 1) is called, which the first
 time allocates a buffer for the first w, but the second time,
 img-frame-linesize[0] is not 0, so it is not updated in
 get_video_buffer, which means a buffer of the wrong size (e.g. too
 small) is allocated.
 When this buffer is later written to, it just writes after the end
 of the buffer, overwriting whatever is there, e.g. pointers to other
 buffers, which then leads to crashes if these are accessed/freed.
 
 Signed-off-by: Andreas Cadhalpunandreas.cadhal...@googlemail.com
 ---
   libavcodec/webp.c | 39 +++
   1 file changed, 35 insertions(+), 4 deletions(-)
 
 diff --git a/libavcodec/webp.c b/libavcodec/webp.c
 index 9549c0e..2cd976f 100644
 --- a/libavcodec/webp.c
 +++ b/libavcodec/webp.c
 @@ -1104,7 +1104,7 @@ static int
 vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
unsigned int data_size, int
 is_alpha_chunk)
   {
   WebPContext *s = avctx-priv_data;
 -int w, h, ret, i;
 +int w, h, ret, i, used;
 
   if (!is_alpha_chunk) {
   s-lossless = 1;
 @@ -1154,18 +1154,49 @@ static int
 vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
   /* parse transformations */
   s-nb_transforms = 0;
   s-reduced_width = 0;
 +used = 0;
   while (get_bits1(s-gb)) {
   enum TransformType transform = get_bits(s-gb, 2);
   s-transforms[s-nb_transforms++] = transform;
   switch (transform) {
   case PREDICTOR_TRANSFORM:
 -ret = parse_transform_predictor(s);
 +if (used  1) {
 
 Use (1  transform) and move all of these checks to a single check
 before the switch.
 
 That's a good idea. Update patch attached.
 
 Best regards,
 Andreas
 

  webp.c |   10 +-
  1 file changed, 9 insertions(+), 1 deletion(-)
 9614f4dbed6f3bc6c8902afddf1d079b0d87419f  
 0001-webp-ensure-that-each-transform-is-only-used-once.patch
 From de11cf3ffbdf9d5c2118e42b8c0e59297c7e28ee Mon Sep 17 00:00:00 2001
 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com
 Date: Thu, 5 Mar 2015 22:48:28 +0100
 Subject: [PATCH] webp: ensure that each transform is only used once
 
 According to the WebP Lossless Bitstream Specification
 each transform is allowed to be used only once.
 
 If a transform is more than once this can lead to memory
 corruption.
 
 Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


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


[FFmpeg-devel] [GSOC] Qualification tasks

2015-03-05 Thread Michael Niedermayer
Hi Mentors and Students

please make sure to keep track of who is doing which qualification
task to minimize the amount of duplicates,
that is to add an entry for each student doing a qualification task at:

https://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2015-Qualis

thanks

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


[FFmpeg-devel] [PATCH] hls: detect SAMPLE-AES encryption

2015-03-05 Thread selst
From 0f207df3c13a9c05a9ef3f740995b4bc991a6312 Mon Sep 17 00:00:00 2001
From: selsta selsta@home
Date: Thu, 5 Mar 2015 01:26:47 +0100
Subject: [PATCH] hls: detect SAMPLE-AES encryption

SAMPLE-AES encryption is not commonly used yet, but without this patch
ffmpeg is thinking that the hls segments are not encrypted which
produces broken files.

I'll try to implement an actual decryption in the next weeks.

Sample url to test this patch:
http://demo.unified-streaming.com/video/caminandes/caminandes-
sample-aes.ism/caminandes-sample-aes.m3u8

---
 libavformat/hls.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 4fdda34..0dfcfc7 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -62,6 +62,7 @@
 enum KeyType {
 KEY_NONE,
 KEY_AES_128,
+KEY_SAMPLE_AES
 };
 
 struct segment {
@@ -329,7 +330,7 @@ static void handle_variant_args(struct variant_info
*info, const char *key,
 
 struct key_info {
  char uri[MAX_URL_SIZE];
- char method[10];
+ char method[11];
  char iv[35];
 };
 
@@ -556,6 +557,8 @@ static int parse_playlist(HLSContext *c, const char
*url,
 has_iv = 0;
 if (!strcmp(info.method, AES-128))
 key_type = KEY_AES_128;
+if (!strcmp(info.method, SAMPLE-AES))
+key_type = KEY_SAMPLE_AES;
 if (!strncmp(info.iv, 0x, 2) || !strncmp(info.iv, 0X,
 2)) {
 ff_hex_to_data(iv, info.iv + 2);
 has_iv = 1;
@@ -967,7 +970,13 @@ static int open_input(HLSContext *c, struct
playlist *pls)
 goto cleanup;
 }
 ret = 0;
+} 
+
+else if (seg-key_type == KEY_SAMPLE_AES) {
+av_log(NULL, AV_LOG_ERROR, SAMPLE-AES encryption is not
supported\n);
+ret = AVERROR_PATCHWELCOME;
 }
+
 else
   ret = AVERROR(ENOSYS);
 
-- 
2.3.1
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] hls: detect SAMPLE-AES encryption

2015-03-05 Thread Derek Buitenhuis
On 3/5/2015 5:32 PM, selst wrote:
 From: selsta selsta@home

Configure your name and email.

 Date: Thu, 5 Mar 2015 01:26:47 +0100
 Subject: [PATCH] hls: detect SAMPLE-AES encryption

This doesn't look like it was sent with git send-email?

 SAMPLE-AES encryption is not commonly used yet, but without this patch
 ffmpeg is thinking that the hls segments are not encrypted which
 produces broken files.
 
 I'll try to implement an actual decryption in the next weeks.

[...]

 Sample url to test this patch:
 http://demo.unified-streaming.com/video/caminandes/caminandes-
 sample-aes.ism/caminandes-sample-aes.m3u8

URLs in commit messages tend not to be useful later on.

 +} 
 +
 +else if (seg-key_type == KEY_SAMPLE_AES) {

Should be on same line.

 +av_log(NULL, AV_LOG_ERROR, SAMPLE-AES encryption is not
 supported\n);

Use the AVFormatContext, not NULL.

 +ret = AVERROR_PATCHWELCOME;
  }
 +
  else

else and { on the same line.

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


[FFmpeg-devel] [PATCH v2 3/4] mips: port optimizations to mips n64

2015-03-05 Thread James Cowgill
This mainly consists of replacing all the pointer arithmatic 'addiu'
instructions with PTR_ADDIU which will handle the differences in pointer
sizes when compiled on 64 bit mips systems.

The header asmdefs.h contains the PTR_ macros which expend to the correct mips
instructions to manipulate registers containing pointers.

Signed-off-by: James Cowgill james...@cowgill.org.uk
---
 libavcodec/mips/aacdec_mips.c | 21 +--
 libavcodec/mips/aacdec_mips.h |  9 ++---
 libavcodec/mips/aacpsdsp_mips.c   | 43 +++---
 libavcodec/mips/aacpsy_mips.h |  6 ++--
 libavcodec/mips/aacsbr_mips.c | 53 +--
 libavcodec/mips/aacsbr_mips.h | 17 -
 libavcodec/mips/ac3dsp_mips.c | 59 ---
 libavcodec/mips/acelp_filters_mips.c  | 13 +++
 libavcodec/mips/acelp_vectors_mips.c  |  7 ++--
 libavcodec/mips/celp_filters_mips.c   | 13 +++
 libavcodec/mips/celp_math_mips.c  |  5 +--
 libavcodec/mips/compute_antialias_float.h |  4 ++-
 libavcodec/mips/fft_mips.c| 13 +++
 libavcodec/mips/fmtconvert_mips.c |  6 ++--
 libavcodec/mips/lsp_mips.h|  6 ++--
 libavcodec/mips/mpegaudiodsp_mips_fixed.c | 11 +++---
 libavcodec/mips/mpegaudiodsp_mips_float.c | 25 ++---
 libavcodec/mips/sbrdsp_mips.c | 45 +++
 libavutil/mips/asmdefs.h  | 48 +
 libavutil/mips/float_dsp_mips.c   | 21 +--
 20 files changed, 247 insertions(+), 178 deletions(-)
 create mode 100644 libavutil/mips/asmdefs.h

diff --git a/libavcodec/mips/aacdec_mips.c b/libavcodec/mips/aacdec_mips.c
index 93947be..253cdeb 100644
--- a/libavcodec/mips/aacdec_mips.c
+++ b/libavcodec/mips/aacdec_mips.c
@@ -56,6 +56,7 @@
 #include aacdec_mips.h
 #include libavcodec/aactab.h
 #include libavcodec/sinewin.h
+#include libavutil/mips/asmdefs.h
 
 #if HAVE_INLINE_ASM
 static av_always_inline void float_copy(float *dst, const float *src, int 
count)
@@ -80,7 +81,7 @@ static av_always_inline void float_copy(float *dst, const 
float *src, int count)
 lw  %[temp5],20(%[src]) \n\t
 lw  %[temp6],24(%[src]) \n\t
 lw  %[temp7],28(%[src]) \n\t
-addiu   %[src],  %[src],  32\n\t
+PTR_ADDIU %[src],%[src],  32\n\t
 sw  %[temp0],0(%[dst])  \n\t
 sw  %[temp1],4(%[dst])  \n\t
 sw  %[temp2],8(%[dst])  \n\t
@@ -90,7 +91,7 @@ static av_always_inline void float_copy(float *dst, const 
float *src, int count)
 sw  %[temp6],24(%[dst]) \n\t
 sw  %[temp7],28(%[dst]) \n\t
 bne %[src],  %[loop_end], 1b\n\t
-addiu   %[dst],  %[dst],  32\n\t
+PTR_ADDIU %[dst],%[dst],  32\n\t
 .set pop\n\t
 
 : [temp0]=r(temp[0]), [temp1]=r(temp[1]),
@@ -250,7 +251,7 @@ static void apply_ltp_mips(AACContext *ac, 
SingleChannelElement *sce)
 sw  $0,  4(%[p_predTime])\n\t
 sw  $0,  8(%[p_predTime])\n\t
 sw  $0,  12(%[p_predTime])   \n\t
-addiu   %[p_predTime],   %[p_predTime], 16   \n\t
+PTR_ADDIU %[p_predTime], %[p_predTime], 16   \n\t
 
 : [p_predTime]+r(p_predTime)
 :
@@ -261,7 +262,7 @@ static void apply_ltp_mips(AACContext *ac, 
SingleChannelElement *sce)
 
 __asm__ volatile (
 sw  $0,  0(%[p_predTime])\n\t
-addiu   %[p_predTime],   %[p_predTime], 4\n\t
+PTR_ADDIU %[p_predTime], %[p_predTime], 4\n\t
 
 : [p_predTime]+r(p_predTime)
 :
@@ -315,9 +316,9 @@ static av_always_inline void fmul_and_reverse(float *dst, 
const float *src0, con
 swc1%[temp9],4(%[ptr1])\n\t
 swc1%[temp10],   8(%[ptr1])\n\t
 swc1%[temp11],   12(%[ptr1])   \n\t
-addiu   %[ptr1], %[ptr1],  16  \n\t
-addiu   %[ptr2], %[ptr2],  -16 \n\t
-addiu   %[ptr3], %[ptr3],  -16 \n\t
+PTR_ADDIU %[ptr1],   %[ptr1],  16  \n\t
+PTR_ADDIU %[ptr2],   %[ptr2],  -16 \n\t
+PTR_ADDIU %[ptr3],   %[ptr3],  -16 \n\t
 
 : [temp0]=f(temp[0]), [temp1]=f(temp[1]),
   [temp2]=f(temp[2]), [temp3]=f(temp[3]),
@@ -358,7 +359,7 @@ static void update_ltp_mips(AACContext *ac, 
SingleChannelElement *sce)
 sw $0,  20(%[p_saved_ltp])   \n\t

[FFmpeg-devel] [PATCH v2 1/4] mips/aacdec: remove uses of mips32r2 specific ext instructions

2015-03-05 Thread James Cowgill
Removing these removes the dependency of this code on mips32r2 which would
allow it to be used on processors which have FPU instructions, but not r2
instructions (like the mips64el debian port for instance).

Signed-off-by: James Cowgill james...@cowgill.org.uk
---
 libavcodec/mips/aacdec_mips.h | 49 ++-
 1 file changed, 25 insertions(+), 24 deletions(-)

diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
index 9ba3079..c9efdbb 100644
--- a/libavcodec/mips/aacdec_mips.h
+++ b/libavcodec/mips/aacdec_mips.h
@@ -68,10 +68,10 @@ static inline float *VMUL2_mips(float *dst, const float *v, 
unsigned idx,
 float *ret;
 
 __asm__ volatile(
-andi%[temp3],  %[idx],   15   \n\t
-ext %[temp4],  %[idx],   4,  4\n\t
+andi%[temp3],  %[idx],   0x0F \n\t
+andi%[temp4],  %[idx],   0xF0 \n\t
 sll %[temp3],  %[temp3], 2\n\t
-sll %[temp4],  %[temp4], 2\n\t
+srl %[temp4],  %[temp4], 2\n\t
 lwc1%[temp2],  0(%[scale])\n\t
 lwxc1   %[temp0],  %[temp3](%[v]) \n\t
 lwxc1   %[temp1],  %[temp4](%[v]) \n\t
@@ -99,14 +99,13 @@ static inline float *VMUL4_mips(float *dst, const float *v, 
unsigned idx,
 float *ret;
 
 __asm__ volatile(
-andi%[temp0],  %[idx],   3   \n\t
-ext %[temp1],  %[idx],   2,  2   \n\t
-ext %[temp2],  %[idx],   4,  2   \n\t
-ext %[temp3],  %[idx],   6,  2   \n\t
+andi%[temp0],  %[idx],   0x03\n\t
+andi%[temp1],  %[idx],   0x0C\n\t
+andi%[temp2],  %[idx],   0x30\n\t
+andi%[temp3],  %[idx],   0xC0\n\t
 sll %[temp0],  %[temp0], 2   \n\t
-sll %[temp1],  %[temp1], 2   \n\t
-sll %[temp2],  %[temp2], 2   \n\t
-sll %[temp3],  %[temp3], 2   \n\t
+srl %[temp2],  %[temp2], 2   \n\t
+srl %[temp3],  %[temp3], 4   \n\t
 lwc1%[temp4],  0(%[scale])   \n\t
 lwxc1   %[temp5],  %[temp0](%[v])\n\t
 lwxc1   %[temp6],  %[temp1](%[v])\n\t
@@ -142,14 +141,14 @@ static inline float *VMUL2S_mips(float *dst, const float 
*v, unsigned idx,
 float *ret;
 
 __asm__ volatile(
-andi%[temp0],  %[idx],   15 \n\t
-ext %[temp1],  %[idx],   4, 4   \n\t
+andi%[temp0],  %[idx],   0x0F   \n\t
+andi%[temp1],  %[idx],   0xF0   \n\t
 lw  %[temp4],  0(%[scale])  \n\t
 srl %[temp2],  %[sign],  1  \n\t
 sll %[temp3],  %[sign],  31 \n\t
 sll %[temp2],  %[temp2], 31 \n\t
 sll %[temp0],  %[temp0], 2  \n\t
-sll %[temp1],  %[temp1], 2  \n\t
+srl %[temp1],  %[temp1], 2  \n\t
 lwxc1   %[temp8],  %[temp0](%[v])   \n\t
 lwxc1   %[temp9],  %[temp1](%[v])   \n\t
 xor %[temp5],  %[temp4], %[temp2]   \n\t
@@ -185,22 +184,24 @@ static inline float *VMUL4S_mips(float *dst, const float 
*v, unsigned idx,
 
 __asm__ volatile(
 lw  %[temp0],   0(%[scale])   \n\t
-and %[temp1],   %[idx],   3   \n\t
-ext %[temp2],   %[idx],   2,  2   \n\t
-ext %[temp3],   %[idx],   4,  2   \n\t
-ext %[temp4],   %[idx],   6,  2   \n\t
-sll %[temp1],   %[temp1], 2   \n\t
-sll %[temp2],   %[temp2], 2   \n\t
-sll %[temp3],   %[temp3], 2   \n\t
-sll %[temp4],   %[temp4], 2   \n\t
+andi%[temp1],  %[idx],   0x03 \n\t
+andi%[temp2],  %[idx],   0x0C \n\t
+andi%[temp3],  %[idx],   0x30 \n\t
+andi%[temp4],  %[idx],   0xC0 \n\t
+sll %[temp1],  %[temp1], 2\n\t
+srl %[temp3],  %[temp3], 2\n\t
+srl %[temp4],  %[temp4], 4\n\t
 lwxc1   %[temp10],  %[temp1](%[v])\n\t
 lwxc1   %[temp11],  %[temp2](%[v])\n\t
 lwxc1   %[temp12],  %[temp3](%[v])\n\t
 lwxc1   %[temp13],  %[temp4](%[v])\n\t
 and %[temp1],   %[sign],  %[mask] \n\t
-ext %[temp2],   %[idx],   12, 1   \n\t
-ext %[temp3],   %[idx],   13, 1   \n\t
-ext %[temp4],   %[idx],   14, 1   \n\t
+srl %[temp2],   

[FFmpeg-devel] [PATCH v2 2/4] configure, mips: remove MIPS32R2, merging it with MIPSFPU

2015-03-05 Thread James Cowgill
There are no independant uses of mips32r2 instructions except for the
FPU parts. Due to the heavy use of mips32r2 specifc fpu extensions, I
am guessing the original author intended MIPSFPU to imply MIPS32R2 anyway.

Since these fpu instructions are available on mips64 (non-r2), enable them
there as well.

Also remove the last occurence of HAVE_MIPS32R2 (which is coupled to
HAVE_MIPSFPU anyway).

mips32r2 is left in the list of options form compatability so that using
--disable-mips32r2 doesn't break anything.

Signed-off-by: James Cowgill james...@cowgill.org.uk
---
 Makefile  |  2 +-
 arch.mak  |  1 -
 configure | 18 +-
 libavcodec/mips/ac3dsp_mips.c |  4 ++--
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 845a274..ca2ce59 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS 
TOOLS  \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS\
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS MMX-OBJS YASM-OBJS   \
-   MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS  \
+   MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS\
OBJS SLIBOBJS HOSTOBJS TESTOBJS
 
 define RESET
diff --git a/arch.mak b/arch.mak
index 0e866d8..48bc2d3 100644
--- a/arch.mak
+++ b/arch.mak
@@ -5,7 +5,6 @@ OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
 OBJS-$(HAVE_NEON)+= $(NEON-OBJS)$(NEON-OBJS-yes)
 
 OBJS-$(HAVE_MIPSFPU)   += $(MIPSFPU-OBJS)$(MIPSFPU-OBJS-yes)
-OBJS-$(HAVE_MIPS32R2)  += $(MIPS32R2-OBJS)   $(MIPS32R2-OBJS-yes)
 OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS)  $(MIPSDSPR1-OBJS-yes)
 OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS)  $(MIPSDSPR2-OBJS-yes)
 
diff --git a/configure b/configure
index d641d9f..ce745d2 100755
--- a/configure
+++ b/configure
@@ -358,7 +358,6 @@ Optimization options (experts only):
   --disable-neon   disable NEON optimizations
   --disable-inline-asm disable use of inline assembly
   --disable-yasm   disable use of nasm/yasm assembly
-  --disable-mips32r2   disable MIPS32R2 optimizations
   --disable-mipsdspr1  disable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
   --disable-mipsfpudisable floating point MIPS optimizations
@@ -1999,7 +1998,6 @@ setend_deps=arm
 map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
 
 mipsfpu_deps=mips
-mips32r2_deps=mips
 mipsdspr1_deps=mips
 mipsdspr2_deps=mips
 
@@ -4569,8 +4567,19 @@ EOF
 elif enabled mips; then
 
 check_inline_asm loongson 'dmult.g $1, $2, $3'
-enabled mips32r2   add_cflags -mips32r2  add_asflags -mips32r2 
- check_inline_asm mips32r2  'rotr $t0, $t1, 1'
+
+# Enable minimum ISA based on selected options
+if enabled mips64  (enabled mipsdspr1 || enabled mipsdspr2); then
+add_cflags -mips64r2
+add_asflags -mips64r2
+elif enabled mips64  enabled mipsfpu; then
+add_cflags -mips64
+add_asflags -mips64
+elif enabled mipsfpu || enabled mipsdspr1 || enabled mipsdspr2; then
+add_cflags -mips32r2
+add_asflags -mips32r2
+fi
+
 enabled mipsdspr1  add_cflags -mdsp  add_asflags -mdsp 
  check_inline_asm mipsdspr1 'addu.qb $t0, $t1, $t2'
 enabled mipsdspr2  add_cflags -mdspr2  add_asflags -mdspr2 
@@ -5522,7 +5531,6 @@ if enabled arm; then
 fi
 if enabled mips; then
 echo MIPS FPU enabled  ${mipsfpu-no}
-echo MIPS32R2 enabled  ${mips32r2-no}
 echo MIPS DSP R1 enabled   ${mipsdspr1-no}
 echo MIPS DSP R2 enabled   ${mipsdspr2-no}
 fi
diff --git a/libavcodec/mips/ac3dsp_mips.c b/libavcodec/mips/ac3dsp_mips.c
index f33c6f1..bd2a611 100644
--- a/libavcodec/mips/ac3dsp_mips.c
+++ b/libavcodec/mips/ac3dsp_mips.c
@@ -199,7 +199,7 @@ static void ac3_update_bap_counts_mips(uint16_t 
mant_cnt[16], uint8_t *bap,
 }
 #endif
 
-#if HAVE_MIPSFPU  HAVE_MIPS32R2
+#if HAVE_MIPSFPU
 static void float_to_fixed24_mips(int32_t *dst, const float *src, unsigned int 
len)
 {
 const float scale = 1  24;
@@ -403,7 +403,7 @@ void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact) {
 c-bit_alloc_calc_bap = ac3_bit_alloc_calc_bap_mips;
 c-update_bap_counts  = ac3_update_bap_counts_mips;
 #endif
-#if HAVE_MIPSFPU  HAVE_MIPS32R2
+#if HAVE_MIPSFPU
 c-float_to_fixed24 = float_to_fixed24_mips;
 c-downmix  = ac3_downmix_mips;
 #endif
-- 
2.1.4

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


[FFmpeg-devel] [PATCH v2 4/4] changelog: add mips 64-bit port

2015-03-05 Thread James Cowgill
---
 Changelog | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Changelog b/Changelog
index 1374cbc..2a5d6b8 100644
--- a/Changelog
+++ b/Changelog
@@ -36,6 +36,7 @@ version next:
 - Canopus HQX decoder
 - RTP depacketization of T.140 text (RFC 4103)
 - VP9 RTP payload format (draft 0) experimental depacketizer
+- Port MIPS opttimizations to 64-bit
 
 
 version 2.5:
-- 
2.1.4

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


[FFmpeg-devel] [PATCH v2 0/4] mips cleanups and port to mips64

2015-03-05 Thread James Cowgill
Hi,

This is the second version of the mips patches without the ones which
were already accepted.

Changes:
 - Keep mips32r2 in the list of configure options so it doesn't break
   anything (although now it's a no op).
 - Drop float dsp patch and just do the normal 64-bit porting.
   This would be good to do properly in generic code at some point. I have
   a feeling that using restrict in the way I did could result in undefined
   behavior in certain cases though.
 - Move asmdefs.h to libavutil/mips to allow for the above change.
 - Rebase the 64-bit porting and fix the conflicts.
 - Add entry in the changelog for the mips 64-bit port.

Thanks,
James

James Cowgill (4):
  mips/aacdec: remove uses of mips32r2 specific ext instructions
  configure, mips: remove MIPS32R2, merging it with MIPSFPU
  mips: port optimizations to mips n64
  changelog: add mips 64-bit port

 Changelog |  1 +
 Makefile  |  2 +-
 arch.mak  |  1 -
 configure | 18 ++---
 libavcodec/mips/aacdec_mips.c | 21 ++-
 libavcodec/mips/aacdec_mips.h | 58 ++--
 libavcodec/mips/aacpsdsp_mips.c   | 43 ++---
 libavcodec/mips/aacpsy_mips.h |  6 ++-
 libavcodec/mips/aacsbr_mips.c | 53 +-
 libavcodec/mips/aacsbr_mips.h | 17 +
 libavcodec/mips/ac3dsp_mips.c | 63 ---
 libavcodec/mips/acelp_filters_mips.c  | 13 ---
 libavcodec/mips/acelp_vectors_mips.c  |  7 ++--
 libavcodec/mips/celp_filters_mips.c   | 13 ---
 libavcodec/mips/celp_math_mips.c  |  5 ++-
 libavcodec/mips/compute_antialias_float.h |  4 +-
 libavcodec/mips/fft_mips.c| 13 ---
 libavcodec/mips/fmtconvert_mips.c |  6 +--
 libavcodec/mips/lsp_mips.h|  6 ++-
 libavcodec/mips/mpegaudiodsp_mips_fixed.c | 11 +++---
 libavcodec/mips/mpegaudiodsp_mips_float.c | 25 ++--
 libavcodec/mips/sbrdsp_mips.c | 45 +++---
 libavutil/mips/asmdefs.h  | 48 +++
 libavutil/mips/float_dsp_mips.c   | 21 ++-
 24 files changed, 289 insertions(+), 211 deletions(-)
 create mode 100644 libavutil/mips/asmdefs.h

-- 
2.1.4

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


Re: [FFmpeg-devel] [libav-devel] [PATCH 2/2] lavf: move internal fields from public to internal context

2015-03-05 Thread Bálint Réczey
Hi,

2015-03-05 0:02 GMT+01:00 Andreas Cadhalpun andreas.cadhal...@googlemail.com:
 On 04.03.2015 23:13, Luca Barbato wrote:

 On 04/03/15 21:49, Andreas Cadhalpun wrote:

 So what do you think about resurrecting this patch (add avformat_flush)?


 I see no patch about it, my email client chewed it?


 It has been a while ago [1]. It just adds a public API for
 ff_read_frame_flush.

 It seems to have only stalled on the associated documentation and the
 XBMC developers are apparently not the only ones who would find it
 useful.


 The function is useful if somebody wants to implement some custom seek
 and in order to do that probably is using some of the fields being
 hidden so I'm not sure just exposing that function would do anything
 good for that use case.

 I'd rather check with the XBMC (I guess now the name is Kodi, let's try
 to move to use the new name) people why they need it and if the problem
 they have with the seeking functions can't be solved otherwise.


 To me it seems that this is the only internal API they need, but asking
 can't hurt. So CC'ing the Debian XBMC/Kodi maintainer.
I would welcome the resurrection of avformat flush. This is the only
internal API used by XBMC/Kodi indeed.
To work wih the public API I carry a patch [2] reimplementing the
function in Kodi, but I would prefer using it as part of the public
API.

CC-ing Joakim who started using the function in XBMC and FernetMenta
who also worked on this part of the code.

First related commit I found was tnis one:

commit ba44e48ca680512dad789dda504020bf59570986
Author: elupus elupus@svn
Date:   Mon Feb 1 04:41:03 2010 +

changed: use lavf's proper method to flush data after input stream seek
changed: make sure we flush demuxer on dvd seeks

git-svn-id:
https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27348
568bbfeb-2a22-0410-94d2-cc84cf5bfa90


Cheers,
Balint


 Best regards,
 Andreas


 1: https://ffmpeg.org/pipermail/ffmpeg-devel/2014-September/163635.html
[2] 
https://anonscm.debian.org/cgit/pkg-multimedia/kodi.git/commit/?id=dc8ea7b87cf03f034bd7b07cfa246f1760b30f31
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2] hls: detect SAMPLE-AES encryption

2015-03-05 Thread selsta
SAMPLE-AES encryption is not commonly used yet, but without this patch
ffmpeg is thinking that the hls segments are not encrypted which
produces broken files.
---
 libavformat/hls.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 4fdda34..3e78d2f 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -62,6 +62,7 @@
 enum KeyType {
 KEY_NONE,
 KEY_AES_128,
+KEY_SAMPLE_AES
 };
 
 struct segment {
@@ -329,7 +330,7 @@ static void handle_variant_args(struct variant_info *info, 
const char *key,
 
 struct key_info {
  char uri[MAX_URL_SIZE];
- char method[10];
+ char method[11];
  char iv[35];
 };
 
@@ -556,6 +557,8 @@ static int parse_playlist(HLSContext *c, const char *url,
 has_iv = 0;
 if (!strcmp(info.method, AES-128))
 key_type = KEY_AES_128;
+if (!strcmp(info.method, SAMPLE-AES))
+key_type = KEY_SAMPLE_AES;
 if (!strncmp(info.iv, 0x, 2) || !strncmp(info.iv, 0X, 2)) {
 ff_hex_to_data(iv, info.iv + 2);
 has_iv = 1;
@@ -967,6 +970,10 @@ static int open_input(HLSContext *c, struct playlist *pls)
 goto cleanup;
 }
 ret = 0;
+} else if (seg-key_type == KEY_SAMPLE_AES) {
+av_log(pls-parent, AV_LOG_ERROR, SAMPLE-AES encryption is not
+supported yet\n);
+ret = AVERROR_PATCHWELCOME;
 }
 else
   ret = AVERROR(ENOSYS);
-- 
2.3.1

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


Re: [FFmpeg-devel] [PATCH v5] libavformat/mxfenc: write package name metadata

2015-03-05 Thread Mark Reid



 if (size = UINT16_MAX/2) {


that makes way more sense :p, I'll send a new patch
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v6] libavformat/mxfenc: write package name metadata

2015-03-05 Thread Mark Reid
---
 libavformat/mxfenc.c  | 97 +--
 tests/ref/lavf/mxf|  6 +--
 tests/ref/lavf/mxf_d10|  2 +-
 tests/ref/lavf/mxf_opatom |  2 +-
 4 files changed, 91 insertions(+), 16 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 7d35af4..898951c 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -624,14 +624,61 @@ static void mxf_write_preface(AVFormatContext *s)
 }
 
 /*
- * Write a local tag containing an ascii string as utf-16
+ * Returns the length of the UTF-16 string, in 16-bit characters, that would 
result
+ * from decoding the utf-8 string.
+ */
+static uint64_t mxf_utf16len(const char *utf8_str)
+{
+const uint8_t *q = utf8_str;
+uint64_t size = 0;
+while (*q) {
+uint32_t ch;
+GET_UTF8(ch, *q++, goto invalid;)
+if (ch  0x1)
+size++;
+else
+size += 2;
+continue;
+invalid:
+av_log(NULL, AV_LOG_ERROR, Invaid UTF8 sequence in mxf_utf16len\n\n);
+}
+size += 1;
+return size;
+}
+
+/*
+ * Returns the calculated length a local tag containing an utf-8 string as 
utf-16
+ */
+static int mxf_utf16_local_tag_length(const char *utf8_str)
+{
+uint64_t size;
+
+if (!utf8_str)
+return 0;
+
+size = mxf_utf16len(utf8_str);
+if (size = UINT16_MAX/2) {
+av_log(NULL, AV_LOG_ERROR, utf16 local tag size %PRIx64 invalid 
(too large), ignoring\n, size);
+return 0;
+}
+
+return 4 + size * 2;
+}
+
+/*
+ * Write a local tag containing an utf-8 string as utf-16
  */
 static void mxf_write_local_tag_utf16(AVIOContext *pb, int tag, const char 
*value)
 {
-int i, size = strlen(value);
+uint64_t size = mxf_utf16len(value);
+
+if (size = UINT16_MAX/2) {
+av_log(NULL, AV_LOG_ERROR, utf16 local tag size %PRIx64 invalid 
(too large), ignoring\n, size);
+return;
+}
+
 mxf_write_local_tag(pb, size*2, tag);
-for (i = 0; i  size; i++)
-avio_wb16(pb, value[i]);
+avio_put_str16be(pb, value);
 }
 
 static void mxf_write_identification(AVFormatContext *s)
@@ -648,7 +695,9 @@ static void mxf_write_identification(AVFormatContext *s)
 
 version = s-flags  AVFMT_FLAG_BITEXACT ?
 0.0.0 : AV_STRINGIFY(LIBAVFORMAT_VERSION);
-length = 84 + (strlen(company)+strlen(product)+strlen(version))*2; // 
utf-16
+length = 72 + mxf_utf16_local_tag_length(company) +
+  mxf_utf16_local_tag_length(product) +
+  mxf_utf16_local_tag_length(version);
 klv_encode_ber_length(pb, length);
 
 // write uid
@@ -659,7 +708,6 @@ static void mxf_write_identification(AVFormatContext *s)
 // write generation uid
 mxf_write_local_tag(pb, 16, 0x3C09);
 mxf_write_uuid(pb, Identification, 1);
-
 mxf_write_local_tag_utf16(pb, 0x3C01, company); // Company Name
 mxf_write_local_tag_utf16(pb, 0x3C02, product); // Product Name
 mxf_write_local_tag_utf16(pb, 0x3C04, version); // Version String
@@ -1092,20 +1140,21 @@ static void 
mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st)
 mxf_write_generic_sound_common(s, st, mxf_generic_sound_descriptor_key, 0);
 }
 
-static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type)
+static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType 
type, const char *package_name)
 {
 MXFContext *mxf = s-priv_data;
 AVIOContext *pb = s-pb;
 int i, track_count = s-nb_streams+1;
+int name_size = mxf_utf16_local_tag_length(package_name);
 
 if (type == MaterialPackage) {
 mxf_write_metadata_key(pb, 0x013600);
 PRINT_KEY(s, Material Package key, pb-buf_ptr - 16);
-klv_encode_ber_length(pb, 92 + 16*track_count);
+klv_encode_ber_length(pb, 92 + name_size + (16*track_count));
 } else {
 mxf_write_metadata_key(pb, 0x013700);
 PRINT_KEY(s, Source Package key, pb-buf_ptr - 16);
-klv_encode_ber_length(pb, 112 + 16*track_count); // 20 bytes length 
for descriptor reference
+klv_encode_ber_length(pb, 112 + name_size + (16*track_count)); // 20 
bytes length for descriptor reference
 }
 
 // write uid
@@ -1119,6 +1168,10 @@ static void mxf_write_package(AVFormatContext *s, enum 
MXFMetadataSetType type)
 mxf_write_umid(s, type == SourcePackage);
 PRINT_KEY(s, package umid second part, pb-buf_ptr - 16);
 
+// package name
+if (name_size)
+mxf_write_local_tag_utf16(pb, 0x4402, package_name);
+
 // package creation date
 mxf_write_local_tag(pb, 8, 0x4405);
 avio_wb64(pb, mxf-timestamp);
@@ -1187,11 +1240,33 @@ static int 
mxf_write_essence_container_data(AVFormatContext *s)
 
 static int mxf_write_header_metadata_sets(AVFormatContext *s)
 {
+const char *material_package_name = NULL;
+const char *file_package_name = NULL;
+AVDictionaryEntry *entry = NULL;
+AVStream *st = NULL;
+int i;
+
+if (entry = 

[FFmpeg-devel] [PATCH v6] libavformat/mxfenc: write package name metadata

2015-03-05 Thread Mark Reid
changes since v5
* use size = UINT16_MAX/2 instead

Mark Reid (1):
  libavformat/mxfenc: write package name metadata

 libavformat/mxfenc.c  | 97 +--
 tests/ref/lavf/mxf|  6 +--
 tests/ref/lavf/mxf_d10|  2 +-
 tests/ref/lavf/mxf_opatom |  2 +-
 4 files changed, 91 insertions(+), 16 deletions(-)

-- 
2.2.1

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


Re: [FFmpeg-devel] [PATCH] optionally write QuickTime gama atom (was Re: Gamma function)

2015-03-05 Thread Michael Niedermayer
On Thu, Mar 05, 2015 at 10:51:43AM +, Kevin Wheatley wrote:
 Michael, wm4,
 
 Thank you for your feedback, I believe I've addressed your concerns,
 please let me know if there is anything else that needs fixing.
 
 Kevin

  libavcodec/pngenc.c |   29 +++---
  libavutil/Makefile  |1 
  libavutil/color_utils.c |   52 
 
  libavutil/color_utils.h |   39 
  libavutil/version.h |2 -
  5 files changed, 97 insertions(+), 26 deletions(-)
 897f68b1bebfca8adafa83a8cc228b664123fe22  
 0001-Extract-gamma-determination-from-PNG-encoder-for-fut.patch
 From 079ff77a1885b5ef879a8cd3b4c032a3182e8e67 Mon Sep 17 00:00:00 2001
 From: Kevin Wheatley kevin.j.wheat...@gmail.com
 Date: Thu, 5 Mar 2015 10:37:51 +
 Subject: [PATCH 1/2] Extract gamma determination from PNG encoder for future 
 use.
  Adds private avpriv_get_gamma_from_trc() function to libavutil.

all 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


Re: [FFmpeg-devel] [PATCH 2/2] lavf/concatdef: pass options to nested input

2015-03-05 Thread Nicolas George
Le quintidi 15 ventôse, an CCXXIII, Zhang Rui a écrit :
 Subject: [FFmpeg-devel] [PATCH 2/2] lavf/concatdef: pass options to

concatdec I suppose?

 ---
  libavformat/concatdec.c | 24 +---
  1 file changed, 17 insertions(+), 7 deletions(-)

Can you explain the use case you have in mind? The current code, if I
understand correctly, uses the same options for all concatenated segments,
which may or may not desirable.

My intent, regarding options, was to allow per-file options in the concat
script. Maybe something like that:

  file seg1.vob
  option analyzeduration 50M

  file seg2.vob
  option analyzeduration 20M

  ...

Regards,

-- 
  Nicolas George


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] lavf/concatdef: pass options to nested input

2015-03-05 Thread Nicolas George
Le quintidi 15 ventôse, an CCXXIII, Zhang Rui a écrit :
 I'm using concatdec for streaming http segments.
 which need options like timeout, user_agent.

Ok.

 Your solution is enough for my case.
 And as you said, my patch may be not desirable.

I believe it depends on the use case, and it is not completely obvious which
side your example falls on.

But in the meantime I have started implementing per-file options for the
concat demuxer, see the attached patch.

Regards,

-- 
  Nicolas George
From fbbc4d5a4f99a0c58af63477a4daf056ceeea479 Mon Sep 17 00:00:00 2001
From: Nicolas George geo...@nsup.org
Date: Thu, 5 Mar 2015 13:31:35 +0100
Subject: [PATCH] lavf/concatdec: add per-file options. [WIP]

Signed-off-by: Nicolas George geo...@nsup.org
---
 libavformat/concatdec.c | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index f07cfd7..d0a7f1e 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -44,6 +44,7 @@ typedef struct {
 int64_t duration;
 ConcatStream *streams;
 int nb_streams;
+AVDictionary *options;
 } ConcatFile;
 
 typedef struct {
@@ -279,6 +280,7 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
 {
 ConcatContext *cat = avf-priv_data;
 ConcatFile *file = cat-files[fileno];
+AVDictionary *options = NULL;
 int ret;
 
 if (cat-avf)
@@ -290,15 +292,17 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
 
 cat-avf-interrupt_callback = avf-interrupt_callback;
 
+av_dict_copy(options, file-options, 0);
 if ((ret = ff_copy_whitelists(cat-avf, avf))  0)
 return ret;
 
-if ((ret = avformat_open_input(cat-avf, file-url, NULL, NULL))  0 ||
+if ((ret = avformat_open_input(cat-avf, file-url, NULL, options))  0 ||
 (ret = avformat_find_stream_info(cat-avf, NULL))  0) {
 av_log(avf, AV_LOG_ERROR, Impossible to open '%s'\n, file-url);
 avformat_close_input(cat-avf);
 return ret;
 }
+/* TODO report unused options */
 cat-cur_file = file;
 if (file-start_time == AV_NOPTS_VALUE)
 file-start_time = !fileno ? 0 :
@@ -332,6 +336,7 @@ static int concat_read_header(AVFormatContext *avf)
 int ret, line = 0, i;
 unsigned nb_files_alloc = 0;
 ConcatFile *file = NULL;
+AVDictionary *common_options = NULL, **options = common_options;
 int64_t time = 0;
 
 while (1) {
@@ -351,6 +356,8 @@ static int concat_read_header(AVFormatContext *avf)
 }
 if ((ret = add_file(avf, filename, file, nb_files_alloc))  0)
 goto fail;
+av_dict_copy(file-options, common_options, 0);
+options = file-options;
 } else if (!strcmp(keyword, duration)) {
 char *dur_str = get_keyword(cursor);
 int64_t dur;
@@ -376,6 +383,18 @@ static int concat_read_header(AVFormatContext *avf)
 }
 avf-streams[avf-nb_streams - 1]-id =
 strtol(get_keyword(cursor), NULL, 0);
+} else if (!strcmp(keyword, option)) {
+char *key = get_keyword(cursor);
+char *val = av_get_token((const char **)cursor, SPACE_CHARS);
+if (!val) {
+av_log(avf, AV_LOG_ERROR, Line %d: option value required\n, line);
+FAIL(AVERROR_INVALIDDATA);
+}
+ret = av_dict_set(options, key, val, AV_DICT_DONT_STRDUP_VAL);
+if (ret  0) {
+av_free(val);
+goto fail;
+}
 } else if (!strcmp(keyword, ffconcat)) {
 char *ver_kw  = get_keyword(cursor);
 char *ver_val = get_keyword(cursor);
@@ -395,6 +414,7 @@ static int concat_read_header(AVFormatContext *avf)
 goto fail;
 if (!cat-nb_files)
 FAIL(AVERROR_INVALIDDATA);
+av_dict_free(common_options);
 
 for (i = 0; i  cat-nb_files; i++) {
 if (cat-files[i].start_time == AV_NOPTS_VALUE)
@@ -417,6 +437,7 @@ static int concat_read_header(AVFormatContext *avf)
 return 0;
 
 fail:
+av_dict_free(common_options);
 concat_read_close(avf);
 return ret;
 }
-- 
2.1.4



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


Re: [FFmpeg-devel] [PATCH] mov: write colr by default

2015-03-05 Thread Michael Niedermayer
On Thu, Mar 05, 2015 at 10:23:02AM +0100, Robert Krüger wrote:
 On Wed, Mar 4, 2015 at 7:14 PM, Michael Niedermayer michae...@gmx.at
 wrote:
 
  On Wed, Mar 04, 2015 at 07:07:35PM +0100, Robert Krüger wrote:
   On Wed, Mar 4, 2015 at 6:57 PM, Michael Niedermayer michae...@gmx.at
   wrote:
  
On Wed, Mar 04, 2015 at 06:19:19PM +0100, Robert Krüger wrote:
 On Wed, Mar 4, 2015 at 5:34 PM, Michael Niedermayer 
  michae...@gmx.at
 wrote:

  On Wed, Mar 04, 2015 at 03:40:09PM +0100, Robert Krüger wrote:
   On Wed, Mar 4, 2015 at 11:05 AM, Michael Niedermayer 
michae...@gmx.at
   wrote:
  
On Wed, Mar 04, 2015 at 10:22:26AM +0100, Robert Krüger wrote:
 On Tue, Mar 3, 2015 at 9:27 PM, Michael Niedermayer 
  michae...@gmx.at
 wrote:

  On Tue, Mar 03, 2015 at 09:24:17PM +0100, Robert Krüger
  wrote:
   On Tue, Mar 3, 2015 at 7:23 PM, Michael Niedermayer 
michae...@gmx.at
   wrote:
  
On Tue, Mar 03, 2015 at 06:17:22PM +0100, Robert Krüger
wrote:
   
 This is based on an earlier patch by Derek
   
please mention this in the commit message
   
  
   OK, I will change that
  
  
   
   
 that never went in because it
 was argumented earlier that api breakage is not
acceptable.
However,
  that
 was more or less relaxed after Michael noted that the
  replaced
flag
  had
 never been part of a release and since a number of
  people
  seem to
  agree,
 this is the better default, I am submitting this
  patch
now,
  to
have
  it in
 before the upcoming release.

   
 Let me know if that will be accepted and I will
  modify
the
respective
fate
 tests as well.
   
have you tested the generated mov and mp4 files with
  some
  common
software packages ?
   
checking random files on my disk it seems more than
  half
the
  mov
files contain a colr atom but i found just a single mp4
with a
  colr
atom, so especially testing the compatibility of the
  mp4
files
would
be optimal before this is changed
   
   
   OK, I will do some tests with VLC, Quicktime, Final Cut,
Final
  Cut X,
   Premiere and After Effects and maybe something else I
  find.
 
  thanks
 
 
 I tried an mp4 file with a colr atom with VLC, Quicktime,
  Final
Cut
  X,
 Compressor, Premiere, After Effects and Adobe Media Encoder.
None of
those
 had any problems with the file and colors looked normal too.
   
ok then please submit a patch that also updates fate
   
   
   here it is.
 
b/libavformat/movenc.c|6 +--
b/libavformat/movenc.h|2 -
b/libavformat/version.h   |4 +-
b/tests/fate/vcodec.mak   |8 ++--
b/tests/ref/lavf/mov  |   16
  
b/tests/ref/seek/lavf-mov |   44
  +++---
b/tests/ref/vsynth/vsynth1-avui   |4 +-
b/tests/ref/vsynth/vsynth1-dnxhd-1080i|8 ++--
b/tests/ref/vsynth/vsynth1-dnxhd-1080i-nocolr |4 ++
b/tests/ref/vsynth/vsynth1-mpeg4  |4 +-
b/tests/ref/vsynth/vsynth1-prores |4 +-
b/tests/ref/vsynth/vsynth1-prores_ks  |4 +-
b/tests/ref/vsynth/vsynth1-qtrle  |4 +-
b/tests/ref/vsynth/vsynth1-qtrlegray  |4 +-
b/tests/ref/vsynth/vsynth1-svq1   |4 +-
b/tests/ref/vsynth/vsynth2-avui   |4 +-
b/tests/ref/vsynth/vsynth2-dnxhd-1080i|8 ++--
b/tests/ref/vsynth/vsynth2-dnxhd-1080i-nocolr |4 ++
b/tests/ref/vsynth/vsynth2-mpeg4  |4 +-
b/tests/ref/vsynth/vsynth2-prores |4 +-
b/tests/ref/vsynth/vsynth2-prores_ks  |4 +-
b/tests/ref/vsynth/vsynth2-qtrle  |4 +-
b/tests/ref/vsynth/vsynth2-qtrlegray  |4 +-
b/tests/ref/vsynth/vsynth2-svq1   |4 +-
b/tests/ref/vsynth/vsynth3-dnxhd-1080i-nocolr |4 ++
b/tests/ref/vsynth/vsynth3-mpeg4  |4 +-
b/tests/ref/vsynth/vsynth3-prores |4 +-
b/tests/ref/vsynth/vsynth3-prores_ks

Re: [FFmpeg-devel] [PATCH] avformat/mxfdec: Detect XYZ pixel format for digital cinema files

2015-03-05 Thread Tomas Härdin
On Thu, 2015-03-05 at 00:36 +0200, Vilius Grigaliūnas wrote:
 While the native jpeg2000 decoder can determine pixel format correctly
 from the codestream, libopenjpeg wrapper cannot. To make sure that
 the output is correct when using libopenjpeg to decode digital
 cinema files, we do detection from the metadata included in the MXF
 wrapper.
 
 If the container has JPEG 2000 Coding Parameters metadata element
 with Rsiz value set to one of digital cinema profiles, we can safely
 assume that the given input file is DCI compliant, therefore the
 pixel format should be XYZ.
 ---
  libavformat/mxfdec.c |7 +++
  1 file changed, 7 insertions(+)
 
 diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
 index f3501da..2e8dd05 100644
 --- a/libavformat/mxfdec.c
 +++ b/libavformat/mxfdec.c
 @@ -281,6 +281,7 @@ static const uint8_t mxf_encrypted_essence_container[]
  = { 0x06,0x0e,0x2b,0x
  static const uint8_t mxf_random_index_pack_key[]   = { 
 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x11,0x01,0x00
  };
  static const uint8_t mxf_sony_mpeg4_extradata[]= { 
 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00
  };
  static const uint8_t mxf_avid_project_name[]   = { 
 0xa5,0xfb,0x7b,0x25,0xf6,0x15,0x94,0xb9,0x62,0xfc,0x37,0x17,0x49,0x2d,0x42,0xbf
  };
 +static const uint8_t mxf_jp2k_rsiz[]   = { 
 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00
  };
  
  #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
  
 @@ -1000,6 +1001,12 @@ static int mxf_read_generic_descriptor(void *arg, 
 AVIOContext *pb, int tag, int
  descriptor-extradata_size = size;
  avio_read(pb, descriptor-extradata, size);
  }
 +if (IS_KLV_KEY(uid, mxf_jp2k_rsiz)) {
 +uint32_t rsiz = avio_rb16(pb);
 +if (rsiz == FF_PROFILE_JPEG2000_DCINEMA_2K ||
 +rsiz == FF_PROFILE_JPEG2000_DCINEMA_4K)
 +descriptor-pix_fmt = AV_PIX_FMT_XYZ12;
 +}
  break;
  }
  return 0;

Nice, simple and commit message explains exactly what is going on.
10/10 :)

Is there a sample file so this can be covered by FATE?

/Tomas


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


Re: [FFmpeg-devel] [PATCH] optionally write QuickTime gama atom (was Re: Gamma function)

2015-03-05 Thread Kevin Wheatley
Michael, wm4,

Thank you for your feedback, I believe I've addressed your concerns,
please let me know if there is anything else that needs fixing.

Kevin
From 079ff77a1885b5ef879a8cd3b4c032a3182e8e67 Mon Sep 17 00:00:00 2001
From: Kevin Wheatley kevin.j.wheat...@gmail.com
Date: Thu, 5 Mar 2015 10:37:51 +
Subject: [PATCH 1/2] Extract gamma determination from PNG encoder for future use.
 Adds private avpriv_get_gamma_from_trc() function to libavutil.


Signed-off-by: Kevin Wheatley kevin.j.wheat...@gmail.com
---
 libavcodec/pngenc.c |   29 +++--
 libavutil/Makefile  |1 +
 libavutil/color_utils.c |   52 +++
 libavutil/color_utils.h |   39 +++
 libavutil/version.h |2 +-
 5 files changed, 97 insertions(+), 26 deletions(-)
 create mode 100644 libavutil/color_utils.c
 create mode 100644 libavutil/color_utils.h

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 6c9f43e..9bdefc4 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -28,6 +28,7 @@
 #include libavutil/avassert.h
 #include libavutil/libm.h
 #include libavutil/opt.h
+#include libavutil/color_utils.h
 
 #include zlib.h
 
@@ -277,31 +278,9 @@ static int png_get_chrm(enum AVColorPrimaries prim,  uint8_t *buf)
 
 static int png_get_gama(enum AVColorTransferCharacteristic trc, uint8_t *buf)
 {
-double gamma;
-switch (trc) {
-case AVCOL_TRC_BT709:
-case AVCOL_TRC_SMPTE170M:
-case AVCOL_TRC_SMPTE240M:
-case AVCOL_TRC_BT1361_ECG:
-case AVCOL_TRC_BT2020_10:
-case AVCOL_TRC_BT2020_12:
-/* these share a segmented TRC, but gamma 1.961 is a close
-  approximation, and also more correct for decoding content */
-gamma = 1.961;
-break;
-case AVCOL_TRC_GAMMA22:
-case AVCOL_TRC_IEC61966_2_1:
-gamma = 2.2;
-break;
-case AVCOL_TRC_GAMMA28:
-gamma = 2.8;
-break;
-case AVCOL_TRC_LINEAR:
-gamma = 1.0;
-break;
-default:
-return 0;
-}
+double gamma = avpriv_get_gamma_from_trc(trc);
+if (gamma = 1e-6)
+return 0;
 
 AV_WB32_PNG(buf, 1.0 / gamma);
 return 1;
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 6caf896..df85cd1 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -88,6 +88,7 @@ OBJS = adler32.o\
cast5.o  \
camellia.o   \
channel_layout.o \
+   color_utils.o\
cpu.o\
crc.o\
des.o\
diff --git a/libavutil/color_utils.c b/libavutil/color_utils.c
new file mode 100644
index 000..59146be
--- /dev/null
+++ b/libavutil/color_utils.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015 Kevin Wheatley kevin.j.wheat...@gmail.com
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include libavutil/color_utils.h
+#include libavutil/pixfmt.h
+
+double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc)
+{
+double gamma;
+switch (trc) {
+case AVCOL_TRC_BT709:
+case AVCOL_TRC_SMPTE170M:
+case AVCOL_TRC_SMPTE240M:
+case AVCOL_TRC_BT1361_ECG:
+case AVCOL_TRC_BT2020_10:
+case AVCOL_TRC_BT2020_12:
+/* these share a segmented TRC, but gamma 1.961 is a close
+  approximation, and also more correct for decoding content */
+gamma = 1.961;
+break;
+case AVCOL_TRC_GAMMA22:
+case AVCOL_TRC_IEC61966_2_1:
+gamma = 2.2;
+break;
+case AVCOL_TRC_GAMMA28:
+gamma = 2.8;
+break;
+case AVCOL_TRC_LINEAR:
+gamma = 1.0;
+break;
+default:
+gamma = 0.0; // Unknown 

Re: [FFmpeg-devel] [PATCH] avformat/mxfdec: Detect XYZ pixel format for digital cinema files

2015-03-05 Thread Michael Niedermayer
On Thu, Mar 05, 2015 at 11:41:35AM +0100, Tomas Härdin wrote:
 On Thu, 2015-03-05 at 00:36 +0200, Vilius Grigaliūnas wrote:
  While the native jpeg2000 decoder can determine pixel format correctly
  from the codestream, libopenjpeg wrapper cannot. To make sure that
  the output is correct when using libopenjpeg to decode digital
  cinema files, we do detection from the metadata included in the MXF
  wrapper.
  
  If the container has JPEG 2000 Coding Parameters metadata element
  with Rsiz value set to one of digital cinema profiles, we can safely
  assume that the given input file is DCI compliant, therefore the
  pixel format should be XYZ.
  ---
   libavformat/mxfdec.c |7 +++
   1 file changed, 7 insertions(+)
  
  diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
  index f3501da..2e8dd05 100644
  --- a/libavformat/mxfdec.c
  +++ b/libavformat/mxfdec.c
  @@ -281,6 +281,7 @@ static const uint8_t mxf_encrypted_essence_container[]  
 = { 0x06,0x0e,0x2b,0x
   static const uint8_t mxf_random_index_pack_key[]   = { 
  0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x11,0x01,0x00
   };
   static const uint8_t mxf_sony_mpeg4_extradata[]= { 
  0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00
   };
   static const uint8_t mxf_avid_project_name[]   = { 
  0xa5,0xfb,0x7b,0x25,0xf6,0x15,0x94,0xb9,0x62,0xfc,0x37,0x17,0x49,0x2d,0x42,0xbf
   };
  +static const uint8_t mxf_jp2k_rsiz[]   = { 
  0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00
   };
   
   #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
   
  @@ -1000,6 +1001,12 @@ static int mxf_read_generic_descriptor(void *arg, 
  AVIOContext *pb, int tag, int
   descriptor-extradata_size = size;
   avio_read(pb, descriptor-extradata, size);
   }
  +if (IS_KLV_KEY(uid, mxf_jp2k_rsiz)) {
  +uint32_t rsiz = avio_rb16(pb);
  +if (rsiz == FF_PROFILE_JPEG2000_DCINEMA_2K ||
  +rsiz == FF_PROFILE_JPEG2000_DCINEMA_4K)
  +descriptor-pix_fmt = AV_PIX_FMT_XYZ12;
  +}
   break;
   }
   return 0;
 
 Nice, simple and commit message explains exactly what is going on.
 10/10 :)

applied

thanks

[...]

-- 
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


[FFmpeg-devel] [PATCH 1/2] lavf/avformat: add support for passing options to nested input

2015-03-05 Thread Zhang Rui
---
 libavformat/avformat.h |  5 +
 libavformat/utils.c| 14 --
 libavformat/version.h  |  2 +-
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 4211a95..035e2d4 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -638,6 +638,11 @@ typedef struct AVInputFormat {
 int (*read_header)(struct AVFormatContext *);
 
 /**
+ * Used by format which open further nested input.
+ */
+int (*read_header2)(struct AVFormatContext *, AVDictionary **options);
+
+/**
  * Read one packet and put it in 'pkt'. pts and flags are also
  * set. 'avformat_new_stream' can be called only if the flag
  * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 17ae300..6a962c7 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -404,6 +404,7 @@ int avformat_open_input(AVFormatContext **ps, const char 
*filename,
 AVFormatContext *s = *ps;
 int ret = 0;
 AVDictionary *tmp = NULL;
+AVDictionary *tmp2 = NULL;
 ID3v2ExtraMeta *id3v2_extra_meta = NULL;
 
 if (!s  !(s = avformat_alloc_context()))
@@ -462,9 +463,16 @@ int avformat_open_input(AVFormatContext **ps, const char 
*filename,
 if (s-pb)
 ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, id3v2_extra_meta, 0);
 
-if (!(s-flagsAVFMT_FLAG_PRIV_OPT)  s-iformat-read_header)
-if ((ret = s-iformat-read_header(s))  0)
+if (!(s-flagsAVFMT_FLAG_PRIV_OPT)) {
+if (s-iformat-read_header2) {
+if (options)
+av_dict_copy(tmp2, *options, 0);
+
+if ((ret = s-iformat-read_header2(s, tmp2))  0)
+goto fail;
+} else if (s-iformat-read_header  (ret = 
s-iformat-read_header(s))  0)
 goto fail;
+}
 
 if (id3v2_extra_meta) {
 if (!strcmp(s-iformat-name, mp3) || !strcmp(s-iformat-name, 
aac) ||
@@ -487,6 +495,7 @@ int avformat_open_input(AVFormatContext **ps, const char 
*filename,
 if (options) {
 av_dict_free(options);
 *options = tmp;
+av_dict_free(tmp2);
 }
 *ps = s;
 return 0;
@@ -494,6 +503,7 @@ int avformat_open_input(AVFormatContext **ps, const char 
*filename,
 fail:
 ff_id3v2_free_extra_meta(id3v2_extra_meta);
 av_dict_free(tmp);
+av_dict_free(tmp2);
 if (s-pb  !(s-flags  AVFMT_FLAG_CUSTOM_IO))
 avio_closep(s-pb);
 avformat_free_context(s);
diff --git a/libavformat/version.h b/libavformat/version.h
index ba4c7c8..81fb7b2 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,7 +30,7 @@
 #include libavutil/version.h
 
 #define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR  25
+#define LIBAVFORMAT_VERSION_MINOR 26
 #define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-- 
2.0.0

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


[FFmpeg-devel] [PATCH 2/2] lavf/concatdef: pass options to nested input

2015-03-05 Thread Zhang Rui
---
 libavformat/concatdec.c | 24 +---
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index f07cfd7..a6bf6ee 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -56,6 +56,7 @@ typedef struct {
 int seekable;
 ConcatMatchMode stream_match_mode;
 unsigned auto_convert;
+AVDictionary *options;
 } ConcatContext;
 
 static int concat_probe(AVProbeData *probe)
@@ -280,6 +281,7 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
 ConcatContext *cat = avf-priv_data;
 ConcatFile *file = cat-files[fileno];
 int ret;
+AVDictionary *tmp = NULL;
 
 if (cat-avf)
 avformat_close_input(cat-avf);
@@ -293,11 +295,14 @@ static int open_file(AVFormatContext *avf, unsigned 
fileno)
 if ((ret = ff_copy_whitelists(cat-avf, avf))  0)
 return ret;
 
-if ((ret = avformat_open_input(cat-avf, file-url, NULL, NULL))  0 ||
-(ret = avformat_find_stream_info(cat-avf, NULL))  0) {
+if (cat-options)
+av_dict_copy(tmp, cat-options, 0);
+
+if ((ret = avformat_open_input(cat-avf, file-url, NULL, tmp))  0 ||
+(ret = avformat_find_stream_info(cat-avf, tmp))  0) {
 av_log(avf, AV_LOG_ERROR, Impossible to open '%s'\n, file-url);
 avformat_close_input(cat-avf);
-return ret;
+goto fail;
 }
 cat-cur_file = file;
 if (file-start_time == AV_NOPTS_VALUE)
@@ -305,8 +310,10 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
cat-files[fileno - 1].start_time +
cat-files[fileno - 1].duration;
 if ((ret = match_streams(avf))  0)
-return ret;
-return 0;
+goto fail;
+fail:
+av_dict_free(tmp);
+return ret;
 }
 
 static int concat_read_close(AVFormatContext *avf)
@@ -320,11 +327,12 @@ static int concat_read_close(AVFormatContext *avf)
 av_freep(cat-files[i].url);
 av_freep(cat-files[i].streams);
 }
+av_dict_free(cat-options);
 av_freep(cat-files);
 return 0;
 }
 
-static int concat_read_header(AVFormatContext *avf)
+static int concat_read_header(AVFormatContext *avf, AVDictionary **options)
 {
 ConcatContext *cat = avf-priv_data;
 uint8_t buf[4096];
@@ -412,6 +420,8 @@ static int concat_read_header(AVFormatContext *avf)
 
 cat-stream_match_mode = avf-nb_streams ? MATCH_EXACT_ID :
MATCH_ONE_TO_ONE;
+if (options)
+av_dict_copy(cat-options, *options, 0);
 if ((ret = open_file(avf, 0))  0)
 goto fail;
 return 0;
@@ -644,7 +654,7 @@ AVInputFormat ff_concat_demuxer = {
 .long_name  = NULL_IF_CONFIG_SMALL(Virtual concatenation script),
 .priv_data_size = sizeof(ConcatContext),
 .read_probe = concat_probe,
-.read_header= concat_read_header,
+.read_header2   = concat_read_header,
 .read_packet= concat_read_packet,
 .read_close = concat_read_close,
 .read_seek2 = concat_seek,
-- 
2.0.0

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


Re: [FFmpeg-devel] [PATCH v5] libavformat/mxfenc: write package name metadata

2015-03-05 Thread Tomas Härdin
On Wed, 2015-03-04 at 12:31 -0800, Mark Reid wrote:
 +/*
 + * Returns the calculated length a local tag containing an utf-8 string as 
 utf-16
 + */
 +static int mxf_utf16_local_tag_length(const char *utf8_str)
 +{
 +uint64_t size;
 +
 +if (!utf8_str)
 +return 0;
 +
 +size = mxf_utf16len(utf8_str);
 +if (size = UINT16_MAX || size * 2 = UINT16_MAX) {

if (size = UINT16_MAX/2) {

 +av_log(NULL, AV_LOG_ERROR, utf16 local tag size %PRIx64 invalid 
 (too large), ignoring\n, size);
 +return 0;
 +}
 +
 +return 4 + size * 2;
 +}
 +
 +/*
 + * Write a local tag containing an utf-8 string as utf-16
   */
  static void mxf_write_local_tag_utf16(AVIOContext *pb, int tag, const char 
 *value)
  {
 -int i, size = strlen(value);
 +uint64_t size = mxf_utf16len(value);
 +
 +if (size = UINT16_MAX || size * 2 = UINT16_MAX) {

if (size = UINT16_MAX/2) {

 +av_log(NULL, AV_LOG_ERROR, utf16 local tag size %PRIx64 invalid 
 (too large), ignoring\n, size);
 +return;
 +}
 +
  mxf_write_local_tag(pb, size*2, tag);
 -for (i = 0; i  size; i++)
 -avio_wb16(pb, value[i]);
 +avio_put_str16be(pb, value);
  }

The rest looks OK to me. Nice work :)

/Tomas


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


Re: [FFmpeg-devel] [PATCH] mov: write colr by default

2015-03-05 Thread Robert Krüger
On Thu, Mar 5, 2015 at 10:32 AM, Michael Niedermayer michae...@gmx.at
wrote:

 On Thu, Mar 05, 2015 at 10:23:02AM +0100, Robert Krüger wrote:
  On Wed, Mar 4, 2015 at 7:14 PM, Michael Niedermayer michae...@gmx.at
  wrote:
 
   On Wed, Mar 04, 2015 at 07:07:35PM +0100, Robert Krüger wrote:
On Wed, Mar 4, 2015 at 6:57 PM, Michael Niedermayer 
 michae...@gmx.at
wrote:
   
 On Wed, Mar 04, 2015 at 06:19:19PM +0100, Robert Krüger wrote:
  On Wed, Mar 4, 2015 at 5:34 PM, Michael Niedermayer 
   michae...@gmx.at
  wrote:
 
   On Wed, Mar 04, 2015 at 03:40:09PM +0100, Robert Krüger wrote:
On Wed, Mar 4, 2015 at 11:05 AM, Michael Niedermayer 
 michae...@gmx.at
wrote:
   
 On Wed, Mar 04, 2015 at 10:22:26AM +0100, Robert Krüger
 wrote:
  On Tue, Mar 3, 2015 at 9:27 PM, Michael Niedermayer 
   michae...@gmx.at
  wrote:
 
   On Tue, Mar 03, 2015 at 09:24:17PM +0100, Robert Krüger
   wrote:
On Tue, Mar 3, 2015 at 7:23 PM, Michael Niedermayer 
 michae...@gmx.at
wrote:
   
 On Tue, Mar 03, 2015 at 06:17:22PM +0100, Robert
 Krüger
 wrote:

  This is based on an earlier patch by Derek

 please mention this in the commit message

   
OK, I will change that
   
   


  that never went in because it
  was argumented earlier that api breakage is not
 acceptable.
 However,
   that
  was more or less relaxed after Michael noted
 that the
   replaced
 flag
   had
  never been part of a release and since a number
 of
   people
   seem to
   agree,
  this is the better default, I am submitting this
   patch
 now,
   to
 have
   it in
  before the upcoming release.
 

  Let me know if that will be accepted and I will
   modify
 the
 respective
 fate
  tests as well.

 have you tested the generated mov and mp4 files
 with
   some
   common
 software packages ?

 checking random files on my disk it seems more than
   half
 the
   mov
 files contain a colr atom but i found just a
 single mp4
 with a
   colr
 atom, so especially testing the compatibility of
 the
   mp4
 files
 would
 be optimal before this is changed


OK, I will do some tests with VLC, Quicktime, Final
 Cut,
 Final
   Cut X,
Premiere and After Effects and maybe something else I
   find.
  
   thanks
  
  
  I tried an mp4 file with a colr atom with VLC, Quicktime,
   Final
 Cut
   X,
  Compressor, Premiere, After Effects and Adobe Media
 Encoder.
 None of
 those
  had any problems with the file and colors looked normal
 too.

 ok then please submit a patch that also updates fate


here it is.
  
 b/libavformat/movenc.c|6 +--
 b/libavformat/movenc.h|2 -
 b/libavformat/version.h   |4 +-
 b/tests/fate/vcodec.mak   |8
 ++--
 b/tests/ref/lavf/mov  |   16
   
 b/tests/ref/seek/lavf-mov |   44
   +++---
 b/tests/ref/vsynth/vsynth1-avui   |4 +-
 b/tests/ref/vsynth/vsynth1-dnxhd-1080i|8
 ++--
 b/tests/ref/vsynth/vsynth1-dnxhd-1080i-nocolr |4 ++
 b/tests/ref/vsynth/vsynth1-mpeg4  |4 +-
 b/tests/ref/vsynth/vsynth1-prores |4 +-
 b/tests/ref/vsynth/vsynth1-prores_ks  |4 +-
 b/tests/ref/vsynth/vsynth1-qtrle  |4 +-
 b/tests/ref/vsynth/vsynth1-qtrlegray  |4 +-
 b/tests/ref/vsynth/vsynth1-svq1   |4 +-
 b/tests/ref/vsynth/vsynth2-avui   |4 +-
 b/tests/ref/vsynth/vsynth2-dnxhd-1080i|8
 ++--
 b/tests/ref/vsynth/vsynth2-dnxhd-1080i-nocolr |4 ++
 b/tests/ref/vsynth/vsynth2-mpeg4  |4 +-
 b/tests/ref/vsynth/vsynth2-prores |4 +-
 b/tests/ref/vsynth/vsynth2-prores_ks  |4 +-
 b/tests/ref/vsynth/vsynth2-qtrle  |4 +-
 b/tests/ref/vsynth/vsynth2-qtrlegray  |4 +-
 b/tests/ref/vsynth/vsynth2-svq1   |4 +-
 

[FFmpeg-devel] [PATCH] mips/float_dsp: fix a bug in vector_fmul_window_mips

2015-03-05 Thread Nedeljko Babic
Loop was unrolled eight times although in heder there is assumption
that len is multiple of 4.
This is fixed, and assembly code is rewritten to be more optimal and
to simplify clobber list.

Signed-off-by: Nedeljko Babic nedeljko.ba...@imgtec.com
---
 libavutil/mips/float_dsp_mips.c | 180 +---
 1 file changed, 74 insertions(+), 106 deletions(-)

diff --git a/libavutil/mips/float_dsp_mips.c b/libavutil/mips/float_dsp_mips.c
index 06d52dc..a54f959 100644
--- a/libavutil/mips/float_dsp_mips.c
+++ b/libavutil/mips/float_dsp_mips.c
@@ -144,114 +144,82 @@ static void vector_fmul_scalar_mips(float *dst, const 
float *src, float mul,
 }
 
 static void vector_fmul_window_mips(float *dst, const float *src0,
-const float *src1, const float *win, int len)
+const float *src1, const float *win, int 
len)
 {
-int i, j;
-/*
- * variables used in inline assembler
- */
-float * dst_i, * dst_j, * dst_i2, * dst_j2;
-float temp, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
+float * dst_j, *win_j, *src0_i, *src1_j, *dst_i, *win_i;
+float temp, temp1, temp2, temp3;
+float s0, s01, s1, s11;
+float wi, wi1, wi2, wi3;
+float wj, wj1, wj2, wj3;
+const float * lp_end = win + len;
+
+win_i  = (float *)win;
+win_j  = (float *)(win + 2 * len -1);
+src1_j = (float *)(src1 + len - 1);
+src0_i = (float *)src0;
+dst_i  = (float *)dst;
+dst_j  = (float *)(dst + 2 * len -1);
 
-dst  += len;
-win  += len;
-src0 += len;
-
-for (i = -len, j = len - 1; i  0; i += 8, j -= 8) {
-
-dst_i = dst + i;
-dst_j = dst + j;
-
-dst_i2 = dst + i + 4;
-dst_j2 = dst + j - 4;
-
-__asm__ volatile (
-mul.s   %[temp],   %[s1],   %[wi]\n\t
-mul.s   %[temp1],  %[s1],   %[wj]\n\t
-mul.s   %[temp2],  %[s11],  %[wi1]   \n\t
-mul.s   %[temp3],  %[s11],  %[wj1]   \n\t
-
-msub.s  %[temp],   %[temp], %[s0],  %[wj]\n\t
-madd.s  %[temp1],  %[temp1],%[s0],  %[wi]\n\t
-msub.s  %[temp2],  %[temp2],%[s01], %[wj1]   \n\t
-madd.s  %[temp3],  %[temp3],%[s01], %[wi1]   \n\t
-
-swc1%[temp],   0(%[dst_i])   \n\t /* dst[i] 
= s0*wj - s1*wi; */
-swc1%[temp1],  0(%[dst_j])   \n\t /* dst[j] 
= s0*wi + s1*wj; */
-swc1%[temp2],  4(%[dst_i])   \n\t /* 
dst[i+1] = s01*wj1 - s11*wi1; */
-swc1%[temp3], -4(%[dst_j])   \n\t /* 
dst[j-1] = s01*wi1 + s11*wj1; */
-
-mul.s   %[temp4],  %[s12],  %[wi2]   \n\t
-mul.s   %[temp5],  %[s12],  %[wj2]   \n\t
-mul.s   %[temp6],  %[s13],  %[wi3]   \n\t
-mul.s   %[temp7],  %[s13],  %[wj3]   \n\t
-
-msub.s  %[temp4],  %[temp4],%[s02], %[wj2]   \n\t
-madd.s  %[temp5],  %[temp5],%[s02], %[wi2]   \n\t
-msub.s  %[temp6],  %[temp6],%[s03], %[wj3]   \n\t
-madd.s  %[temp7],  %[temp7],%[s03], %[wi3]   \n\t
-
-swc1%[temp4],  8(%[dst_i])   \n\t /* 
dst[i+2] = s02*wj2 - s12*wi2; */
-swc1%[temp5], -8(%[dst_j])   \n\t /* 
dst[j-2] = s02*wi2 + s12*wj2; */
-swc1%[temp6],  12(%[dst_i])  \n\t /* 
dst[i+2] = s03*wj3 - s13*wi3; */
-swc1%[temp7], -12(%[dst_j])  \n\t /* 
dst[j-3] = s03*wi3 + s13*wj3; */
-: [temp]=f(temp),  [temp1]=f(temp1), [temp2]=f(temp2),
-  [temp3]=f(temp3), [temp4]=f(temp4), [temp5]=f(temp5),
-  [temp6]=f(temp6), [temp7]=f(temp7)
-: [dst_j]r(dst_j), [dst_i]r (dst_i),
-  [s0] f(src0[i]), [wj] f(win[j]), [s1] f(src1[j]),
-  [wi] f(win[i]),  [s01]f(src0[i + 1]),[wj1]f(win[j - 
1]),
-  [s11]f(src1[j - 1]), [wi1]f(win[i + 1]), [s02]f(src0[i + 
2]),
-  [wj2]f(win[j - 2]),  [s12]f(src1[j - 2]),[wi2]f(win[i + 
2]),
-  [s03]f(src0[i + 3]), [wj3]f(win[j - 3]), [s13]f(src1[j - 
3]),
-  [wi3]f(win[i + 3])
-: memory
-);
-
-__asm__ volatile (
-mul.s  %[temp],   %[s1],   %[wi]\n\t
-mul.s  %[temp1],  %[s1],   %[wj]\n\t
-mul.s  %[temp2],  %[s11],  %[wi1]   \n\t
-mul.s  %[temp3],  %[s11],  %[wj1]   \n\t
-
-msub.s %[temp],   %[temp], %[s0],  %[wj]\n\t
-madd.s %[temp1],  %[temp1],%[s0],  %[wi]\n\t
-msub.s %[temp2],  %[temp2],%[s01], %[wj1]   \n\t
-madd.s %[temp3],  %[temp3],%[s01], %[wi1]   \n\t
-
-swc1   %[temp],   0(%[dst_i2])  

Re: [FFmpeg-devel] [PATCH 2/2] lavf/concatdef: pass options to nested input

2015-03-05 Thread Zhang Rui
2015-03-05 19:06 GMT+08:00 Nicolas George geo...@nsup.org:
 Le quintidi 15 ventôse, an CCXXIII, Zhang Rui a écrit :
 Subject: [FFmpeg-devel] [PATCH 2/2] lavf/concatdef: pass options to

 concatdec I suppose?

Sorry, my fault.


 ---
  libavformat/concatdec.c | 24 +---
  1 file changed, 17 insertions(+), 7 deletions(-)

 Can you explain the use case you have in mind? The current code, if I
 understand correctly, uses the same options for all concatenated segments,
 which may or may not desirable.

I'm using concatdec for streaming http segments.
which need options like timeout, user_agent.


 My intent, regarding options, was to allow per-file options in the concat
 script. Maybe something like that:

   file seg1.vob
   option analyzeduration 50M

   file seg2.vob
   option analyzeduration 20M

Your solution is enough for my case.
And as you said, my patch may be not desirable.

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


Re: [FFmpeg-devel] [PATCH] mips/float_dsp: fix a bug in vector_fmul_window_mips

2015-03-05 Thread Michael Niedermayer
On Thu, Mar 05, 2015 at 12:23:59PM +0100, Nedeljko Babic wrote:
 Loop was unrolled eight times although in heder there is assumption
 that len is multiple of 4.
 This is fixed, and assembly code is rewritten to be more optimal and
 to simplify clobber list.
 
 Signed-off-by: Nedeljko Babic nedeljko.ba...@imgtec.com
 ---
  libavutil/mips/float_dsp_mips.c | 180 
 +---
  1 file changed, 74 insertions(+), 106 deletions(-)

applied

thanks

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

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


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


[FFmpeg-devel] [PATCH] Fixed the output format in sexagesimal to match the documentation

2015-03-05 Thread Ole Andre Birkedal
There is an issue in ffprobe when extracting the duration in sexagesimal
format, example:
ffprobe test.mp4 -show_entries format=duration -v quiet -of csv=p=0
-sexagesimal
Output is 0:02:07.896000 when it should be 00:02:07.896000.

- Ole Andre Birkedal
From 3934c5d937f97ebc61cc2b185e7a1a05a045b7f9 Mon Sep 17 00:00:00 2001
From: Ole Andre Birkedal birke...@extab.net
Date: Thu, 5 Mar 2015 15:52:33 +0100
Subject: [PATCH] Fixed the output format in sexagesimal to match the
 documentation (HH:MM:SS)

---
 ffprobe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffprobe.c b/ffprobe.c
index 1227f59..8d56fe5 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -251,7 +251,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
 secs  = secs - mins * 60;
 hours = mins / 60;
 mins %= 60;
-snprintf(buf, buf_size, %d:%02d:%09.6f, hours, mins, secs);
+snprintf(buf, buf_size, %02d:%02d:%09.6f, hours, mins, secs);
 } else {
 const char *prefix_string = ;
 
-- 
1.9.1

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


[FFmpeg-devel] [PATCH] avformat/flvenc: Allow muxing video codecs which are not explicitly supported by the muxer

2015-03-05 Thread Michael Niedermayer
This allows stream copying video codecs before they are explicitly
supported. The same feature was in the past useful for audio codecs
in flv

This partly reverts the changes from 735ab7c5e04e2316afbd56643c13de17a7ac89cd

Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 libavformat/flvenc.c |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index e4717ca..9ee27bf 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -336,6 +336,13 @@ static int unsupported_codec(AVFormatContext *s,
 return AVERROR(ENOSYS);
 }
 
+static int check_video_codec_tag(int codec_tag) {
+if (codec_tag = 0 || codec_tag  15) {
+return AVERROR(ENOSYS);
+} else
+return 0;
+}
+
 static int flv_write_header(AVFormatContext *s)
 {
 int i;
@@ -358,7 +365,7 @@ static int flv_write_header(AVFormatContext *s)
 return AVERROR(EINVAL);
 }
 flv-video_enc = enc;
-if (!ff_codec_get_tag(flv_video_codec_ids, enc-codec_id))
+if (check_video_codec_tag(enc-codec_tag)  0)
 return unsupported_codec(s, Video, enc-codec_id);
 
 if (enc-codec_id == AV_CODEC_ID_MPEG4 ||
@@ -542,7 +549,9 @@ static int flv_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 case AVMEDIA_TYPE_VIDEO:
 avio_w8(pb, FLV_TAG_TYPE_VIDEO);
 
-flags = ff_codec_get_tag(flv_video_codec_ids, enc-codec_id);
+flags = enc-codec_tag;
+if (check_video_codec_tag(flags)  0)
+return unsupported_codec(s, Video, enc-codec_id);
 
 flags |= pkt-flags  AV_PKT_FLAG_KEY ? FLV_FRAME_KEY : 
FLV_FRAME_INTER;
 break;
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH] AAC: [PATCH] AAC: Add support for 7350Hz sampling rates

2015-03-05 Thread Claudio Freire
AAC: Add support for 7350Hz sampling rates, no error on too hight bitrate.

Instead, warn that bitrate will be clamped down to the maximum allowed.

Patch is mostly work of Kamendo2 in issue #2686, quite tested within that issue.

Tested with abtest.sh and confirmed it does work as intended.
From df43314a67ad625775795561d960c30408fcf892 Mon Sep 17 00:00:00 2001
From: Claudio Freire klaussfre...@gmail.com
Date: Fri, 6 Mar 2015 04:05:32 -0300
Subject: [PATCH] AAC: Add support for 7350Hz sampling rates, no error on too
 hight bitrate.

Instead, warn that bitrate will be clamped down to the maximum allowed.

Patch is mostly work of Kamendo2 in issue #2686, quite tested within that issue.
---
 libavcodec/aacenc.c | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 7c286aa..7015a27 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -53,6 +53,11 @@
 return AVERROR(EINVAL); \
 }
 
+#define WARN_IF(cond, ...) \
+if (cond) { \
+av_log(avctx, AV_LOG_WARNING, __VA_ARGS__); \
+}
+
 float ff_aac_pow34sf_tab[428];
 
 static const uint8_t swb_size_1024_96[] = {
@@ -102,7 +107,8 @@ static const uint8_t *swb_size_1024[] = {
 swb_size_1024_96, swb_size_1024_96, swb_size_1024_64,
 swb_size_1024_48, swb_size_1024_48, swb_size_1024_32,
 swb_size_1024_24, swb_size_1024_24, swb_size_1024_16,
-swb_size_1024_16, swb_size_1024_16, swb_size_1024_8
+swb_size_1024_16, swb_size_1024_16, swb_size_1024_8,
+swb_size_1024_8
 };
 
 static const uint8_t swb_size_128_96[] = {
@@ -131,7 +137,8 @@ static const uint8_t *swb_size_128[] = {
 swb_size_128_96, swb_size_128_96, swb_size_128_96,
 swb_size_128_48, swb_size_128_48, swb_size_128_48,
 swb_size_128_24, swb_size_128_24, swb_size_128_16,
-swb_size_128_16, swb_size_128_16, swb_size_128_8
+swb_size_128_16, swb_size_128_16, swb_size_128_8,
+swb_size_128_8
 };
 
 /** default channel configurations */
@@ -754,14 +761,20 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
 
 s-channels = avctx-channels;
 
-ERROR_IF(i = 12,
+ERROR_IF(i == 16
+|| i = (sizeof(swb_size_1024) / sizeof(*swb_size_1024))
+|| i = (sizeof(swb_size_128) / sizeof(*swb_size_128)),
  Unsupported sample rate %d\n, avctx-sample_rate);
 ERROR_IF(s-channels  AAC_MAX_CHANNELS,
  Unsupported number of channels: %d\n, s-channels);
 ERROR_IF(avctx-profile != FF_PROFILE_UNKNOWN  avctx-profile != FF_PROFILE_AAC_LOW,
  Unsupported profile %d\n, avctx-profile);
-ERROR_IF(1024.0 * avctx-bit_rate / avctx-sample_rate  6144 * s-channels,
- Too many bits per frame requested\n);
+WARN_IF(1024.0 * avctx-bit_rate / avctx-sample_rate  6144 * s-channels,
+ Too many bits per frame requested, clamping to max\n);
+
+avctx-bit_rate = (int)FFMIN(
+6144 * s-channels / 1024.0 * avctx-sample_rate,
+avctx-bit_rate);
 
 s-samplerate_index = i;
 
-- 
1.8.4.5

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