Re: [FFmpeg-devel] support for reading / writing encrypted MP4 files

2015-12-21 Thread Carl Eugen Hoyos
Eran Kornblau  kaltura.com> writes:

> Bumping up this thread, would love to see this getting merged
> (attaching the same patch files)

Weren't patches 1&2 already applied?
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=23ac99dc
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=4469e8eb

Carl Eugen

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


[FFmpeg-devel] Question about FATE

2015-12-21 Thread Mats Peterson
The following configuration causes the FATE tests to fail (not so when 
using a plain './configure' without anything else):


#!/bin/sh
PKG_CONFIG_PATH='/home/mats/lib/pkgconfig' \
CPPFLAGS='-I/home/mats/include' \
LDFLAGS='-L/home/mats/lib -Wl,-rpath,/home/mats/lib' \
./configure --prefix=/home/mats --enable-shared \
--enable-libx264 --enable-libxvid --enable-libtheora \
--enable-libvpx --enable-libmp3lame --enable-libvorbis \
--enable-libfaac --enable-libfdk-aac --enable-libopus \
--enable-gpl --enable-nonfree

Is it "normal" that pulling in external libraries might cause FATE to fail?

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Question about FATE

2015-12-21 Thread Mats Peterson

On 12/21/2015 08:07 PM, Clément Bœsch wrote:

On Mon, Dec 21, 2015 at 07:39:40PM +0100, Mats Peterson wrote:

The following configuration causes the FATE tests to fail (not so when using
a plain './configure' without anything else):

#!/bin/sh
PKG_CONFIG_PATH='/home/mats/lib/pkgconfig' \
 CPPFLAGS='-I/home/mats/include' \
 LDFLAGS='-L/home/mats/lib -Wl,-rpath,/home/mats/lib' \
 ./configure --prefix=/home/mats --enable-shared \
 --enable-libx264 --enable-libxvid --enable-libtheora \
 --enable-libvpx --enable-libmp3lame --enable-libvorbis \
 --enable-libfaac --enable-libfdk-aac --enable-libopus \
 --enable-gpl --enable-nonfree

Is it "normal" that pulling in external libraries might cause FATE to fail?



No. Use make fate- V=1 for more information on how the
test run and why it fails.



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



I see. OK, thanks for the answer and instructions.

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] support for reading / writing encrypted MP4 files

2015-12-21 Thread Eran Kornblau
> 
> Weren't patches 1&2 already applied?
> http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=23ac99dc
> http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=4469e8eb
> 
You're right, didn't know that.
Please let me know if there are any changes you want me to apply in order to 
push the third one (decryption support).

> Carl Eugen

Thanks Carl !

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


Re: [FFmpeg-devel] Question about FATE

2015-12-21 Thread Clément Bœsch
On Mon, Dec 21, 2015 at 07:39:40PM +0100, Mats Peterson wrote:
> The following configuration causes the FATE tests to fail (not so when using
> a plain './configure' without anything else):
> 
> #!/bin/sh
> PKG_CONFIG_PATH='/home/mats/lib/pkgconfig' \
> CPPFLAGS='-I/home/mats/include' \
> LDFLAGS='-L/home/mats/lib -Wl,-rpath,/home/mats/lib' \
> ./configure --prefix=/home/mats --enable-shared \
> --enable-libx264 --enable-libxvid --enable-libtheora \
> --enable-libvpx --enable-libmp3lame --enable-libvorbis \
> --enable-libfaac --enable-libfdk-aac --enable-libopus \
> --enable-gpl --enable-nonfree
> 
> Is it "normal" that pulling in external libraries might cause FATE to fail?
> 

No. Use make fate- V=1 for more information on how the
test run and why it fails.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCHv2] lavu/libm: add erf hack and make dynaudnorm available everywhere

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 9:18 AM, James Almer  wrote:
> On 12/21/2015 2:08 PM, Ganesh Ajjanagadde wrote:
>> Pushed with slight modifications.
>>
>> This is a request to any running MSVC/other platform lacking erf: can
>> you please test to make sure this works?
>
> Check http://fate.ffmpeg.org/ for new failures later today. Look for VS2012
> and VS2013.

Seems to work:
http://fatebeta.ffmpeg.org/report/x86_32-msvc11-windows-native/20151221200119,
vs
http://fatebeta.ffmpeg.org/report/x86_32-msvc11-windows-native/20151221155919.

Do these things deserve a changelog modification: the change is user
facing in the sense that dynaudnorm is now available to all clients?

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


[FFmpeg-devel] RTP Hole Punching from SDP file

2015-12-21 Thread Joel Loeshelle
I am trying to stream from a local SDP file that contains the information
necessary for streaming from an IP camera on a separate network. The IP
camera is behind a NAT router so I first need to send dummy packets to set
up the connection. I see that libavformat/rtpdec.h contains a method
“ff_rtp_send_punch_packets” to do this, but it is only utilized when
playing from an RTSP stream and not from an SDP file.

It seems like the best place for this is at the end of sdp_read_header in
libavformat/rtsp.c after we open up the RTP streams. However, I’m not
really familiar with this code so I wanted to get your feedback on this
before submitting a patch. I see that there is a condition when doing this
in RTSP streaming to exclude Windows Media Server streams above 1.
Does this apply for SDP as well?

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


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 2:10 PM, Mats Peterson
 wrote:
> On 12/21/2015 10:57 PM, Michael Niedermayer wrote:
>>
>>
>> the patch is corrupted by newlines
>> attaching the patch uncompressed should solve this
>> disabling automatic line/word wraping in your editor instead might as
>> well
>>
>
> Since I've seen others include the patches inline, I thought it would be
> safe to do so myself. It looks good at my side at least. Anyway, I'll attach
> it instead. Better luck this time.

alternatively use git send-email:
https://burzalodowa.wordpress.com/2013/10/05/how-to-send-patches-with-git-send-email/.

>
>
> Mats
>
> --
> Mats Peterson
> http://matsp888.no-ip.org/~mats/
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Ganesh Ajjanagadde
Hi,

While hunting through configure for some easy to remove filter
dependencies, I came across asyncts which depends on avresample. So I
started some work to port it over to swresample, and get rid of this
unnecessary dependency.

But then I saw the docs:
https://www.ffmpeg.org/ffmpeg-filters.html#asyncts which effectively
claims that aresample subsumes it. What I don't understand is the
following:

1. swresample dates to 2012, and was utilized for aresample around
then. If aresample indeed subsumes asyncts, why not mark asyncts
deprecated, issue a warning telling users to switch to aresample, and
phase it out after some time. If it is indeed obsolete, it is useless
maintainence burden (with even some recent activity that is wasted
energy).
2. The craziness of having 3 filters for essentially the same task:
aresample, resample, asyncts. Seems like resample is the avresample
equivalent of the swresample based aresample. Same remark above
applies to resample.

This is a request for resolution on this topic.

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


Re: [FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 4:10 PM, Nicolas George  wrote:
> Le primidi 1er nivôse, an CCXXIV, Ganesh Ajjanagadde a écrit :
>> 1. swresample dates to 2012, and was utilized for aresample around
>> then. If aresample indeed subsumes asyncts, why not mark asyncts
>> deprecated, issue a warning telling users to switch to aresample, and
>> phase it out after some time. If it is indeed obsolete, it is useless
>> maintainence burden (with even some recent activity that is wasted
>> energy).
>> 2. The craziness of having 3 filters for essentially the same task:
>> aresample, resample, asyncts. Seems like resample is the avresample
>> equivalent of the swresample based aresample. Same remark above
>> applies to resample.
>>
>> This is a request for resolution on this topic.
>
> Just look at git blame: resample and asyncts come from the fork.

They do, but since we have stopped compatibility and are subsumed by
better alternatives (as per the docs), I see no reason why FFmpeg
developers should work on them, and they should be phased out IMHO
(hence the thread). If asyncts actually does something not subsumed by
aresample, the docs should be updated.

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


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Michael Niedermayer
On Mon, Dec 21, 2015 at 06:04:28PM +0100, Mats Peterson wrote:
> Alright then, let's see how this turns out:
> 
> ---
>  libavformat/Makefile  |1 +
>  libavformat/matroskadec.c |   30 -
>  libavformat/mov.c |   95 ++---
>  libavformat/qtpalette.c   |  102
> +
>  libavformat/qtpalette.h   |2 +
>  5 files changed, 155 insertions(+), 75 deletions(-)
>  create mode 100644 libavformat/qtpalette.c
> 
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 110e9e3..e03c73e 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -18,6 +18,7 @@ OBJS = allformats.o \
> mux.o\
> options.o\
> os_support.o \
> +   qtpalette.o  \
> riff.o   \
> sdp.o\
> url.o\
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index c574749..f94f7fb 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -64,6 +64,8 @@
>  #include 
>  #endif
> 
> +#include "qtpalette.h"
> +
>  typedef enum {
>  EBML_NONE,
>  EBML_UINT,
> @@ -312,6 +314,9 @@ typedef struct MatroskaDemuxContext {
> 
>  /* WebM DASH Manifest live flag/ */
>  int is_live;
> +
> +uint32_t palette[256];
> +int has_palette;
>  } MatroskaDemuxContext;
> 
>  typedef struct MatroskaBlock {
> @@ -1856,7 +1861,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
>  fourcc   = st->codec->codec_tag;
>  extradata_offset = FFMIN(track->codec_priv.size, 18);
>  } else if (!strcmp(track->codec_id, "A_QUICKTIME")
> -   && (track->codec_priv.size >= 86)
> +   && (track->codec_priv.size >= 36)
> && (track->codec_priv.data)) {
>  fourcc = AV_RL32(track->codec_priv.data + 4);
>  codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
> @@ -1865,7 +1870,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
>  codec_id = ff_codec_get_id(ff_codec_movaudio_tags,
> fourcc);
>  }
>  } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
> -   (track->codec_priv.size >= 21)  &&
> +   (track->codec_priv.size >= 86)  &&
> (track->codec_priv.data)) {
>  fourcc   = AV_RL32(track->codec_priv.data + 4);
>  codec_id = ff_codec_get_id(ff_codec_movvideo_tags, fourcc);
> @@ -1881,6 +1886,18 @@ static int matroska_parse_tracks(AVFormatContext *s)
>  av_log(matroska->ctx, AV_LOG_ERROR,
> "mov FourCC not found %s.\n", buf);
>  }
> +bit_depth = AV_RB16(track->codec_priv.data + 82);
> +if (get_qtpalette(codec_id, track->codec_priv.data + 16,
> +matroska->palette)) {
> +bit_depth &= 0x1F;
> +/* Behave like V_MS/VFW/FOURCC; copy the palette to
> + * extradata */
> +if (! (extradata = av_malloc(AVPALETTE_SIZE)))
> +return AVERROR(ENOMEM);
> +memcpy(extradata, matroska->palette, AVPALETTE_SIZE);
> +extradata_size = AVPALETTE_SIZE;
> +matroska->has_palette = 1;
> +}
>  } else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
>  switch (track->audio.bitdepth) {
>  case  8:
> @@ -2326,6 +2343,15 @@ static int
> matroska_deliver_packet(MatroskaDemuxContext *matroska,

the patch is corrupted by newlines
attaching the patch uncompressed should solve this
disabling automatic line/word wraping in your editor instead might as
well

Applying: libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, 
palettized QuickTime video in Matroska
fatal: corrupt patch at line 57
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue 
with, palettized QuickTime video in Matroska
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

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

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


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


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Michael Niedermayer
On Mon, Dec 21, 2015 at 11:10:45PM +0100, Mats Peterson wrote:
> On 12/21/2015 10:57 PM, Michael Niedermayer wrote:
> >
> >the patch is corrupted by newlines
> >attaching the patch uncompressed should solve this
> >disabling automatic line/word wraping in your editor instead might as
> >well
> >
> 
> Since I've seen others include the patches inline, I thought it
> would be safe to do so myself. It looks good at my side at least.
> Anyway, I'll attach it instead. Better luck this time.
> 
> Mats
> 
> -- 
> Mats Peterson
> http://matsp888.no-ip.org/~mats/

>  Makefile  |1 
>  matroskadec.c |   30 +++--
>  mov.c |   95 --
>  qtpalette.c   |  102 
> ++
>  qtpalette.h   |2 +
>  5 files changed, 155 insertions(+), 75 deletions(-)

this still breaks demuxing of output-ffmpeg-20140109-git-c0a33c4.mkv
please change the patch so that it does not break that

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] vaapi: Add VP9 hwaccell support

2015-12-21 Thread Philip Langdale

On 2015-12-22 00:53, Timo Rothenpieler wrote:

ping

Is any further review required, or is it fine to just push?



Good to push as far as I'm concerned.

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


Re: [FFmpeg-devel] support for reading / writing encrypted MP4 files

2015-12-21 Thread Michael Niedermayer
On Mon, Dec 21, 2015 at 07:19:45PM +, Eran Kornblau wrote:
> > 
> > Weren't patches 1&2 already applied?
> > http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=23ac99dc
> > http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=4469e8eb
> > 
> You're right, didn't know that.
> Please let me know if there are any changes you want me to apply in order to 
> push the third one (decryption support).

sounds like you missed:
http://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/185235.html
http://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/185238.html


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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


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


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Mats Peterson

On 12/21/2015 10:57 PM, Michael Niedermayer wrote:


the patch is corrupted by newlines
attaching the patch uncompressed should solve this
disabling automatic line/word wraping in your editor instead might as
well



Since I've seen others include the patches inline, I thought it would be 
safe to do so myself. It looks good at my side at least. Anyway, I'll 
attach it instead. Better luck this time.


Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From 5720c1f2b73fe576b9d09d10c68c662e98300083 Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Mon, 21 Dec 2015 18:02:25 +0100
Subject: [PATCH] libavformat/matroskadec.c,mov.c/qtpalette.c: Fix issue with
 palettized QuickTime video in Matroska

---
 libavformat/Makefile  |1 +
 libavformat/matroskadec.c |   30 -
 libavformat/mov.c |   95 ++---
 libavformat/qtpalette.c   |  102 +
 libavformat/qtpalette.h   |2 +
 5 files changed, 155 insertions(+), 75 deletions(-)
 create mode 100644 libavformat/qtpalette.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 110e9e3..e03c73e 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -18,6 +18,7 @@ OBJS = allformats.o \
mux.o\
options.o\
os_support.o \
+   qtpalette.o  \
riff.o   \
sdp.o\
url.o\
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index c574749..f94f7fb 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -64,6 +64,8 @@
 #include 
 #endif
 
+#include "qtpalette.h"
+
 typedef enum {
 EBML_NONE,
 EBML_UINT,
@@ -312,6 +314,9 @@ typedef struct MatroskaDemuxContext {
 
 /* WebM DASH Manifest live flag/ */
 int is_live;
+
+uint32_t palette[256];
+int has_palette;
 } MatroskaDemuxContext;
 
 typedef struct MatroskaBlock {
@@ -1856,7 +1861,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
 fourcc   = st->codec->codec_tag;
 extradata_offset = FFMIN(track->codec_priv.size, 18);
 } else if (!strcmp(track->codec_id, "A_QUICKTIME")
-   && (track->codec_priv.size >= 86)
+   && (track->codec_priv.size >= 36)
&& (track->codec_priv.data)) {
 fourcc = AV_RL32(track->codec_priv.data + 4);
 codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
@@ -1865,7 +1870,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
 codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
 }
 } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
-   (track->codec_priv.size >= 21)  &&
+   (track->codec_priv.size >= 86)  &&
(track->codec_priv.data)) {
 fourcc   = AV_RL32(track->codec_priv.data + 4);
 codec_id = ff_codec_get_id(ff_codec_movvideo_tags, fourcc);
@@ -1881,6 +1886,18 @@ static int matroska_parse_tracks(AVFormatContext *s)
 av_log(matroska->ctx, AV_LOG_ERROR,
"mov FourCC not found %s.\n", buf);
 }
+bit_depth = AV_RB16(track->codec_priv.data + 82);
+if (get_qtpalette(codec_id, track->codec_priv.data + 16,
+matroska->palette)) {
+bit_depth &= 0x1F;
+/* Behave like V_MS/VFW/FOURCC; copy the palette to
+ * extradata */
+if (! (extradata = av_malloc(AVPALETTE_SIZE)))
+return AVERROR(ENOMEM);
+memcpy(extradata, matroska->palette, AVPALETTE_SIZE);
+extradata_size = AVPALETTE_SIZE;
+matroska->has_palette = 1;
+}
 } else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
 switch (track->audio.bitdepth) {
 case  8:
@@ -2326,6 +2343,15 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
 if (matroska->num_packets > 0) {
 memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
 av_freep(>packets[0]);
+if (matroska->has_palette) {
+uint8_t *pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);
+if (!pal) {
+av_log(matroska->ctx, AV_LOG_ERROR, "Cannot append palette to packet\n");
+} else {
+memcpy(pal, matroska->palette, AVPALETTE_SIZE);
+}
+matroska->has_palette = 0;
+}
 if (matroska->num_packets > 1) {
 void *newpackets;
 memmove(>packets[0], >packets[1],
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 06e80c8..1c54bb7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1751,13 +1751,21 @@ static int mov_codec_id(AVStream *st, uint32_t format)
 

Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Paul B Mahol
On 12/21/15, Mats Peterson  wrote:
> On 12/21/2015 10:57 PM, Michael Niedermayer wrote:
>>
>> the patch is corrupted by newlines
>> attaching the patch uncompressed should solve this
>> disabling automatic line/word wraping in your editor instead might as
>> well
>>
>
> Since I've seen others include the patches inline, I thought it would be
> safe to do so myself. It looks good at my side at least. Anyway, I'll
> attach it instead. Better luck this time.
>
> Mats
>
> --
> Mats Peterson
> http://matsp888.no-ip.org/~mats/
>

You can't put only your copyright on something that is efectively derived work.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Kieran Kunhya
On 21 December 2015 at 22:32, Ganesh Ajjanagadde  wrote:
> 2. The craziness of having 3 filters for essentially the same task:
> aresample, resample, asyncts. Seems like resample is the avresample
> equivalent of the swresample based aresample. Same remark above
> applies to resample.

This might appear crazy to you but for some in this project it is
perfectly reasonable (see also: Prores etc).

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


Re: [FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 3:53 PM, Kieran Kunhya  wrote:
> On 21 December 2015 at 22:32, Ganesh Ajjanagadde  wrote:
>> 2. The craziness of having 3 filters for essentially the same task:
>> aresample, resample, asyncts. Seems like resample is the avresample
>> equivalent of the swresample based aresample. Same remark above
>> applies to resample.
>
> This might appear crazy to you but for some in this project it is
> perfectly reasonable (see also: Prores etc).

Hmm, ok. I would still like to hear a different perspective.

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


Re: [FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Nicolas George
Le primidi 1er nivôse, an CCXXIV, Ganesh Ajjanagadde a écrit :
> 1. swresample dates to 2012, and was utilized for aresample around
> then. If aresample indeed subsumes asyncts, why not mark asyncts
> deprecated, issue a warning telling users to switch to aresample, and
> phase it out after some time. If it is indeed obsolete, it is useless
> maintainence burden (with even some recent activity that is wasted
> energy).
> 2. The craziness of having 3 filters for essentially the same task:
> aresample, resample, asyncts. Seems like resample is the avresample
> equivalent of the swresample based aresample. Same remark above
> applies to resample.
> 
> This is a request for resolution on this topic.

Just look at git blame: resample and asyncts come from the fork.

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] phasing out asyntcs, resample

2015-12-21 Thread Nicolas George
Le primidi 1er nivôse, an CCXXIV, Kieran Kunhya a écrit :
> This might appear crazy to you but for some in this project it is
> perfectly reasonable (see also: Prores etc).

What would you do? Flip a coin and remove one of the Prores encoder at
random. At first glance, there is not one that is obviously superior to the
other. Do you know someone who volunteered to make an extensive comparison
to find out exactly which one is the better? And someone who would import
the few features of the other before actually discarding it?

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] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Mats Peterson

On 12/21/2015 11:15 PM, Ganesh Ajjanagadde wrote:

On Mon, Dec 21, 2015 at 2:10 PM, Mats Peterson
 wrote:

On 12/21/2015 10:57 PM, Michael Niedermayer wrote:



the patch is corrupted by newlines
attaching the patch uncompressed should solve this
disabling automatic line/word wraping in your editor instead might as
well



Since I've seen others include the patches inline, I thought it would be
safe to do so myself. It looks good at my side at least. Anyway, I'll attach
it instead. Better luck this time.


alternatively use git send-email:
https://burzalodowa.wordpress.com/2013/10/05/how-to-send-patches-with-git-send-email/.
Yes, I'm aware of that option. I suspect Thunderbird messes with the 
newlines in unwanted ways. Thanks.


Mats

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


Re: [FFmpeg-devel] [PATCH] lavf/img2enc: add atomic_writing option

2015-12-21 Thread Clément Bœsch
On Tue, Dec 08, 2015 at 07:01:40PM +0100, Michael Niedermayer wrote:
> On Tue, Dec 08, 2015 at 10:47:23AM +0100, Clément Bœsch wrote:
> > From: Clément Bœsch 
> > 
> > This behaviour change caused a regression on our side recently, we might
> > want to disable the option by default.
> > ---
> >  libavformat/img2enc.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> should be ok
> 

applied, thx

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 9:49 AM, Mats Peterson
 wrote:
> On 12/21/2015 06:04 PM, Mats Peterson wrote:
>>
>> Alright then, let's see how this turns out:
>>
>
> Perhaps I should once again explain the issue:
>
> Palettized QuickTime video in Matroska has hitherto not been recognized
> whatsoever, and the "palette" used has been completely random.
>
> The patch for matroskadec.c fixes this issue by adding a palette side data
> packet in matroska_deliver_packet(), much in the same way as it's done in
> mov.c.
>
> The change to mov.c consists mainly of moving the palette handling from the
> mov_parse_stsd_video() function to a new get_qtpalette() function in the new
> file qtpalette.c, which is shared by both matroskadec.c and mov.c.
>
> In matroskadec.c, I'm also putting the palette in 'extradata', like it's
> done for V_MS/VFW/FOURCC; this is a requirement in order for MPlayer to
> recognize the palette.

Please add such things to the commit message, i.e while doing git
commit, it fires up your editor. Write the rationale in the same place
you wrote: "Alright then, let's see how this turns out:".

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


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Mats Peterson

On 12/21/2015 07:02 PM, Ganesh Ajjanagadde wrote:

On Mon, Dec 21, 2015 at 9:49 AM, Mats Peterson
 wrote:

On 12/21/2015 06:04 PM, Mats Peterson wrote:


Alright then, let's see how this turns out:



Perhaps I should once again explain the issue:

Palettized QuickTime video in Matroska has hitherto not been recognized
whatsoever, and the "palette" used has been completely random.

The patch for matroskadec.c fixes this issue by adding a palette side data
packet in matroska_deliver_packet(), much in the same way as it's done in
mov.c.

The change to mov.c consists mainly of moving the palette handling from the
mov_parse_stsd_video() function to a new get_qtpalette() function in the new
file qtpalette.c, which is shared by both matroskadec.c and mov.c.

In matroskadec.c, I'm also putting the palette in 'extradata', like it's
done for V_MS/VFW/FOURCC; this is a requirement in order for MPlayer to
recognize the palette.


Please add such things to the commit message, i.e while doing git
commit, it fires up your editor. Write the rationale in the same place
you wrote: "Alright then, let's see how this turns out:".



Mats

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

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



Good to know for the future. Thanks.

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv2] lavu/libm: add erf hack and make dynaudnorm available everywhere

2015-12-21 Thread James Almer
On 12/21/2015 6:15 PM, Ganesh Ajjanagadde wrote:
> On Mon, Dec 21, 2015 at 9:18 AM, James Almer  wrote:
>> On 12/21/2015 2:08 PM, Ganesh Ajjanagadde wrote:
>>> Pushed with slight modifications.
>>>
>>> This is a request to any running MSVC/other platform lacking erf: can
>>> you please test to make sure this works?
>>
>> Check http://fate.ffmpeg.org/ for new failures later today. Look for VS2012
>> and VS2013.
> 
> Seems to work:
> http://fatebeta.ffmpeg.org/report/x86_32-msvc11-windows-native/20151221200119,
> vs
> http://fatebeta.ffmpeg.org/report/x86_32-msvc11-windows-native/20151221155919.
> 
> Do these things deserve a changelog modification: the change is user
> facing in the sense that dynaudnorm is now available to all clients?

Ask Paul about the changelog entry.

I checked and there's no dynaudnorm FATE test (libavfilter coverage is pretty 
bad
for that matter), so the links above only confirm it builds on msvc and not that
the function actually works as intended.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Derek Buitenhuis
On 12/21/2015 10:32 PM, Ganesh Ajjanagadde wrote:
> If aresample indeed subsumes asyncts, why not mark asyncts
> deprecated, issue a warning telling users to switch to aresample, and
> phase it out after some time.

asyncts provides some features currently that aresample does not, such as
the 'first_pts' option.

See filters.texi.

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


Re: [FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 5:27 PM, Derek Buitenhuis
 wrote:
> On 12/21/2015 10:32 PM, Ganesh Ajjanagadde wrote:
>> If aresample indeed subsumes asyncts, why not mark asyncts
>> deprecated, issue a warning telling users to switch to aresample, and
>> phase it out after some time.
>
> asyncts provides some features currently that aresample does not, such as
> the 'first_pts' option.
>
> See filters.texi.

May be missing something, but "See the ffmpeg-resampler manual for the
complete list of supported options. " followed by man ffmpeg-resampler
shows first_pts as a supported option.

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


Re: [FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Derek Buitenhuis
On 12/22/2015 1:44 AM, Ganesh Ajjanagadde wrote:
> May be missing something, but "See the ffmpeg-resampler manual for the
> complete list of supported options. " followed by man ffmpeg-resampler
> shows first_pts as a supported option.

Oh, indeed; never used to be. Apologies.

Looks like the public documents on ffmpeg.org lack a link to it from the 
filter's
page, and I missed it (saying see 'ffmpeg-resample' on an HTML page isn't very
useful when it's not actually called that outside of the man page).

As a side note, I'm not sure to whom this is a 'maintenance burden' to. There 
are
far sillier things that are actually maintenance burdens, if that's what you're 
aiming
to fix (e.g. 2x prores encoder/decoder, 2x asf demuxers, etc.).

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


Re: [FFmpeg-devel] [PATCHv2] lavu/libm: add erf hack and make dynaudnorm available everywhere

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 8:14 PM, James Almer  wrote:
> On 12/21/2015 6:15 PM, Ganesh Ajjanagadde wrote:
>> On Mon, Dec 21, 2015 at 9:18 AM, James Almer  wrote:
>>> On 12/21/2015 2:08 PM, Ganesh Ajjanagadde wrote:
 Pushed with slight modifications.

 This is a request to any running MSVC/other platform lacking erf: can
 you please test to make sure this works?
>>>
>>> Check http://fate.ffmpeg.org/ for new failures later today. Look for VS2012
>>> and VS2013.
>>
>> Seems to work:
>> http://fatebeta.ffmpeg.org/report/x86_32-msvc11-windows-native/20151221200119,
>> vs
>> http://fatebeta.ffmpeg.org/report/x86_32-msvc11-windows-native/20151221155919.
>>
>> Do these things deserve a changelog modification: the change is user
>> facing in the sense that dynaudnorm is now available to all clients?
>
> Ask Paul about the changelog entry.
>
> I checked and there's no dynaudnorm FATE test (libavfilter coverage is pretty 
> bad
> for that matter), so the links above only confirm it builds on msvc and not 
> that
> the function actually works as intended.

The build was the chief cause of worry for me; the function's
correctness I am much more confident of. Nevertheless, only a proper
test can confirm the status.

I unfortunately do not see an easy solution to avfilter testing in
general: Paul seems to be the only person actively pushing new filters
into the code base. If we enforce the policy of having FATE tests at
the time of filter inclusion, or more pedantic issues like the
"theoretical" memleaks I noticed plaguing avfilter, development speed
will slow down. I have thus let these things slide from my end.
Ultimately, it is really a question of priorities.

I personally favor fast development at some cost to thorough testing
and review in these cases.

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


Re: [FFmpeg-devel] phasing out asyntcs, resample

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 5:53 PM, Derek Buitenhuis
 wrote:
> On 12/22/2015 1:44 AM, Ganesh Ajjanagadde wrote:
>> May be missing something, but "See the ffmpeg-resampler manual for the
>> complete list of supported options. " followed by man ffmpeg-resampler
>> shows first_pts as a supported option.
>
> Oh, indeed; never used to be. Apologies.
>
> Looks like the public documents on ffmpeg.org lack a link to it from the 
> filter's
> page, and I missed it (saying see 'ffmpeg-resample' on an HTML page isn't very
> useful when it's not actually called that outside of the man page).
>
> As a side note, I'm not sure to whom this is a 'maintenance burden' to. There 
> are
> far sillier things that are actually maintenance burdens, if that's what 
> you're aiming
> to fix (e.g. 2x prores encoder/decoder, 2x asf demuxers, etc.).

True enough. However, I picked this since it was something I
encountered, and because it is gratuitous unlike prores. In the case
of prores for instance, see Nicolas's comments above: how does one
even go about picking one of them?

I am trying to take things one step at a time, easier things first -
felt this was one of the easier ones now that compatibility is less of
a goal. Of course, I could have been wrong in my assessment of which
is easiest to tackle.

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


Re: [FFmpeg-devel] [GSoC] BDA (DTV) Capture / tuning -- work-in-progress

2015-12-21 Thread Roger Pack
On 12/17/15, Roger Pack  wrote:
> On 8/22/15, Michael Niedermayer  wrote:
>> On Sat, Aug 22, 2015 at 05:18:04AM +0200, Máté Sebők wrote:
>>> >
>>> > fails to build with mingw due to missing header
>>> > In file included from ffmpeg/libavdevice/dshow.c:33:0:
>>> > ffmpeg/libavdevice/bdadefs.h:8:24: fatal error: combaseapi.h: No such
>>> > file or directory
>>> > compilation terminated.
>>> > make: *** [libavdevice/dshow.o] Error 1
>>> > maybe a header check is needed in configure
>>>
>>>
>>> Maybe fixed... unnecessary headers removed (also some cleanup in the
>>> interface-descriptions)
>>
>> i can confirm, the new patch builds fine with mingw here
>>
>>
>> [...]
>>
>>> > +
>>> > > +gfilename = malloc((strlen(ctx->dtv_graph_
>>> > file)+4)*sizeof(WCHAR));
>>> > is this intended to be malloc() instead of av_malloc() ?
>>>
>>>
>>> Yes, it was intended, only a filename buffer for char-to-widechar
>>> conversion.
>>
>> normally code in FFmpeg uses av_malloc() unless there is need for
>> the buffer to be passed into external functions which require a
>> different allocation
>>
>> full review left to roger and anyone else who wants to review
>
> OK I had this great idea to capture the incoming MPEG2 transport
> stream from the digital TV capture device.  Kind of like "raw" stream,
> so FFmpeg could have access to, for instance, all the audio stream.
>
> It appears that the type coming out of the tuner is:
> MEDIATYPE_Stream
> with subtype
> KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT
> which is apparently treated the same as MEDIASUBTYPE_MPEG2_TRANSPORT
> by the built in directshow mpeg demuxer [1] so I assume is some kind
> of typical MPEG2 TS stream.
>
> I had hoped that if I set dshow's AVStream's codec_id to
>  codec->codec_id = AV_CODEC_ID_NONE;
>  codec->codec_type = AVMEDIA_TYPE_DATA;
>
> That it would somehow recognize that I was sending it an MPEG stream
> and insert an appropriate demuxer for me.
>
> However, when I run it, it fails like this:
>
> Input #0, dshow, from 'video=Hauppauge WinTV 885 BDA Tuner/Demod':
>   Duration: N/A, bitrate: N/A
> Codec 0x2 is not in the full list.
> Stream #0:0, 0, 1/2700: Data: unknown_codec, 0/1

I guess to avoid this I can expose my device as a "URLProtocol" as
well as a AVInputFormat or some odd?

One option to work around it is to capture from the "mpeg2video" pin
in the graph.

My next problem appears to be that directshow "feeds" me the
mpeg2video packets in "ts" sized chunks (i.e. 8K or smaller).  It
appears to me that the native mpeg2video decoder doesn't know how to
handle partial packets like that and proceeds to basically just render
the top part of frames.  Any suggestions there?

Also even if I dump the mpeg stream "to file" and play that with
ffmpeg, a few artifacts appear to be introduced.  Anybody know if
libmpeg2 is better at decoding, somehow, than the native mpeg2video
decoder, by chance, artifact wise?  I doubt it but thought I'd check.

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


[FFmpeg-devel] [PATCH][RFC] lavu/libm: add exp10 support

2015-12-21 Thread Ganesh Ajjanagadde
exp10 is a function available in GNU libm. Looks like no other common
libm has it. As such, I am mostly neutral about its inclusion, with a
very slight bias in favor since I am actually posting this.

pros:
1. It is faster than pow, and has less of a chance of going into one of
the terribly slow paths:
https://github.com/andikleen/glibc/blob/rtm-devel9/sysdeps/ieee754/dbl-64/e_exp10.c
vs
https://github.com/andikleen/glibc/blob/rtm-devel9/sysdeps/ieee754/dbl-64/e_pow.c.
Speedup is roughly 30% of the original execution time for an "average"
benchmark over 1e8 arguments uniformly spaced from -1 to 1
(similar results for other intervals):
./test  4.07s user 0.00s system 100% cpu 4.068 total (exp10)
./test  5.71s user 0.00s system 100% cpu 5.711 total (pow)

cons:
1. It is GNU libm only, and requires -D_GNU_SOURCE.
2. Speedup is not that impressive.
3. pow(10, x) is not terribly common in the code, and still cheaper
approximation (not as accurate, but often reasonable) exp(ln(10)*x) is
much faster:
./test  2.55s user 0.00s system 99% cpu 2.548 total (exp(ln(10)*x))
4. It (AFAIK) does not lie in speed critical code anyway, and for table
generation purposes, there often exist tailored, much faster approaches
anyway.

Signed-off-by: Ganesh Ajjanagadde 
---
 configure|  2 ++
 libavutil/libm.h | 14 ++
 2 files changed, 16 insertions(+)

diff --git a/configure b/configure
index 46021c4..f63741d 100755
--- a/configure
+++ b/configure
@@ -1796,6 +1796,8 @@ MATH_FUNCS="
 copysign
 cosf
 erf
+exp10
+exp10f
 exp2
 exp2f
 expf
diff --git a/libavutil/libm.h b/libavutil/libm.h
index 146768a..c05acea 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -282,6 +282,20 @@ static inline double erf(double z)
 #define expf(x) ((float)exp(x))
 #endif
 
+#if !HAVE_EXP10
+static av_always_inline double exp10(double x)
+{
+return pow(10, x);
+}
+#endif
+
+#if !HAVE_EXP10F
+static av_always_inline float exp10f(float x)
+{
+return powf(10, x);
+}
+#endif
+
 #if !HAVE_EXP2
 #undef exp2
 #define exp2(x) exp((x) * 0.693147180559945)
-- 
2.6.4

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


Re: [FFmpeg-devel] [PATCHv2] lavu/libm: add erf hack and make dynaudnorm available everywhere

2015-12-21 Thread Clément Bœsch
On Mon, Dec 21, 2015 at 08:31:47PM -0800, Ganesh Ajjanagadde wrote:
[...]
> I unfortunately do not see an easy solution to avfilter testing in
> general: Paul [...]

The problem with testing filters is not even remotely close to Paul; the
main issue is that many filters are actually using floats, which causes
different accuracy problems across platforms. Someone needs to add some
code in FATE to handle visually approximate sound or image.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] lavfi/scale: add nb_slices debug option

2015-12-21 Thread Clément Bœsch
On Sat, Dec 19, 2015 at 11:00:53AM +0100, Nicolas George wrote:
> L'octidi 28 frimaire, an CCXXIV, Clement Boesch a écrit :
> > +}else if (scale->nb_slices) {
> > +int i;
> > +const int nb_slices = FFMIN(scale->nb_slices, link->h);
> > +for (i = 0; i < nb_slices; i++) {
> > +const int slice_start = (link->h *  i   ) / nb_slices;
> > +const int slice_end   = (link->h * (i+1)) / nb_slices;
> > +const int slice_h = slice_end - slice_start;
> > +scale_slice(link, out, in, scale->sws, slice_start, slice_h, 
> > 1, 0);
> > +}
> 
> You can do simpler and more robust by computing the boundary only once
> (using av_rescale to also avoid overflows):
> 
>   int i, slice_start, slice_end = slice_start;
>   for (i = 0; i < nb_slices; i++) {
>   slice_start = slice_end;
>   slice_end = av_rescale(link->h, i + 1, nb_slices);
>   ...
>   }
> 

Changed and applied. I didn't pick the av_rescale change though, since I'm
not exactly sure about the rounding. Also, such overflows are not handled
in so many part of lavfi that many things will explode before this if they
can be triggered.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] lavc: add text encoder

2015-12-21 Thread Clément Bœsch
On Thu, Dec 17, 2015 at 12:30:27PM +0100, Clément Bœsch wrote:
> ---
>  libavcodec/Makefile|   1 +
>  libavcodec/allcodecs.c |   2 +-
>  libavcodec/srtenc.c|  37 +++-
>  libavcodec/version.h   |   2 +-
>  tests/fate/subtitles.mak   |   3 +
>  tests/ref/fate/sub-textenc | 213 
> +

fate test fixed (-c:s text misplaced) and applied

-- 
Clément B.


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


[FFmpeg-devel] [PATCH] lavfi/af_aemphasis: remove unnecessary complex number usage

2015-12-21 Thread Ganesh Ajjanagadde
complex is not available on all platforms. Furthermore, it is trivial to
rewrite complex number expressions to real arithmetic, and in fact
sometimes advantageous for performance reasons: by wrapping as a complex,
one forces a particular Cartesian representation that is not necessarily 
optimal for the purpose.

Configure tests are also removed, and aemphasis is now available across
all platforms.

Signed-off-by: Ganesh Ajjanagadde 
---
 configure  | 26 --
 libavfilter/af_aemphasis.c | 13 ++---
 2 files changed, 6 insertions(+), 33 deletions(-)

diff --git a/configure b/configure
index 0227540..46021c4 100755
--- a/configure
+++ b/configure
@@ -1070,21 +1070,6 @@ int main(void){ $func(); }
 EOF
 }
 
-check_complexfunc(){
-log check_complexfunc "$@"
-func=$1
-narg=$2
-shift 2
-test $narg = 2 && args="f, g" || args="f * I"
-disable $func
-check_ld "cc" "$@" <
-#include 
-float foo(complex float f, complex float g) { return $func($args); }
-int main(void){ return (int) foo; }
-EOF
-}
-
 check_mathfunc(){
 log check_mathfunc "$@"
 func=$1
@@ -1803,11 +1788,6 @@ INTRINSICS_LIST="
 intrinsics_neon
 "
 
-COMPLEX_FUNCS="
-cabs
-cexp
-"
-
 MATH_FUNCS="
 atanf
 atan2f
@@ -1944,7 +1924,6 @@ HAVE_LIST="
 $ARCH_FEATURES
 $ATOMICS_LIST
 $BUILTIN_LIST
-$COMPLEX_FUNCS
 $HAVE_LIST_CMDLINE
 $HAVE_LIST_PUB
 $HEADERS_LIST
@@ -2835,7 +2814,6 @@ unix_protocol_deps="sys_un_h"
 unix_protocol_select="network"
 
 # filters
-aemphasis_filter_deps="cabs cexp"
 amovie_filter_deps="avcodec avformat"
 aresample_filter_deps="swresample"
 ass_filter_deps="libass"
@@ -5379,10 +5357,6 @@ for func in $MATH_FUNCS; do
 eval check_mathfunc $func \${${func}_args:-1}
 done
 
-for func in $COMPLEX_FUNCS; do
-eval check_complexfunc $func \${${func}_args:-1}
-done
-
 # these are off by default, so fail if requested and not available
 enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h 
|| disable avfoundation_indev; }
 enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h 
CGGetActiveDisplayList -framework CoreGraphics ||
diff --git a/libavfilter/af_aemphasis.c b/libavfilter/af_aemphasis.c
index 2966f77..a5b8e30 100644
--- a/libavfilter/af_aemphasis.c
+++ b/libavfilter/af_aemphasis.c
@@ -18,8 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include 
-
 #include "libavutil/opt.h"
 #include "avfilter.h"
 #include "internal.h"
@@ -189,14 +187,15 @@ static inline void set_lp_rbj(BiquadD2 *bq, double fc, 
double q, double sr, doub
 
 static double freq_gain(BiquadCoeffs *c, double freq, double sr)
 {
-double complex z, w;
+double zr, zi;
 
 freq *= 2.0 * M_PI / sr;
-w = 0 + I * freq;
-z = 1.0 / cexp(w);
+zr = cos(freq);
+zi = -sin(freq);
 
-return cabs(((double complex)c->a0 + c->a1 * z + c->a2 * z*z) /
-((double complex)1.0 + c->b1 * z + c->b2 * z*z));
+/* |(a0 + a1*z + a2*z^2)/(1 + b1*z + b2*z^2)| */
+return hypot(c->a0 + c->a1*zr + c->a2*(zr*zr-zi*zi), c->a1*zi + 
2*c->a2*zr*zi) /
+   hypot(1 + c->b1*zr + c->b2*(zr*zr-zi*zi), c->b1*zi + 2*c->b2*zr*zi);
 }
 
 static int config_input(AVFilterLink *inlink)
-- 
2.6.4

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


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Mats Peterson

On 12/21/2015 11:49 PM, Paul B Mahol wrote:

On 12/21/15, Mats Peterson  wrote:

On 12/21/2015 10:57 PM, Michael Niedermayer wrote:


the patch is corrupted by newlines
attaching the patch uncompressed should solve this
disabling automatic line/word wraping in your editor instead might as
well



Since I've seen others include the patches inline, I thought it would be
safe to do so myself. It looks good at my side at least. Anyway, I'll
attach it instead. Better luck this time.

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/



You can't put only your copyright on something that is efectively derived work.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



I know. I will fix that. I actually thought of it myself. It's not like 
Iwant to elevate myself or something.


Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat: palettized QuickTime in Matroska, round 2

2015-12-21 Thread Mats Peterson
Alright, this is take two of my fix for palettized QuickTime video in 
Matroska. I have reset the lower limit of V_QUICKTIME private data to 21 
in matroskadec.c, in order to make that broken file pass, Michael. The 
minimum size of a video sample description in QuickTime is really 86, 
for the record.


Also, I've added copyright notices of the former authors of mov.c to the 
new file qtpalette.c, since the code in that file is borrowed from mov.c 
to a major extent, albeit with some modifications.


Original explanation of the patch follows:

Palettized QuickTime video in Matroska has hitherto not been recognized 
whatsoever, and the "palette" used has been completely random.


The patch for matroskadec.c fixes this issue by adding a palette side 
data packet in matroska_deliver_packet(), much in the same way as it's 
done in mov.c.


The change to mov.c consists mainly of moving the palette handling from 
the mov_parse_stsd_video() function to a new get_qtpalette() function in 
the new file qtpalette.c, which is shared by both matroskadec.c and mov.c.


In matroskadec.c, I'm also putting the palette in 'extradata', like it's 
done for V_MS/VFW/FOURCC; this is a requirement in order for MPlayer to 
recognize the palette.


--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From db9bf69d274fd4eda8511064111a6ad78b6ad1d1 Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Tue, 22 Dec 2015 03:46:41 +0100
Subject: [PATCH] libavformat: palettized QuickTime in Matroska, round 2

---
 libavformat/Makefile  |1 +
 libavformat/matroskadec.c |   30 -
 libavformat/mov.c |   95 ++---
 libavformat/qtpalette.c   |  104 +
 libavformat/qtpalette.h   |2 +
 5 files changed, 158 insertions(+), 74 deletions(-)
 create mode 100644 libavformat/qtpalette.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 110e9e3..e03c73e 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -18,6 +18,7 @@ OBJS = allformats.o \
mux.o\
options.o\
os_support.o \
+   qtpalette.o  \
riff.o   \
sdp.o\
url.o\
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index c574749..7cdcf31 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -64,6 +64,8 @@
 #include 
 #endif
 
+#include "qtpalette.h"
+
 typedef enum {
 EBML_NONE,
 EBML_UINT,
@@ -312,6 +314,9 @@ typedef struct MatroskaDemuxContext {
 
 /* WebM DASH Manifest live flag/ */
 int is_live;
+
+uint32_t palette[256];
+int has_palette;
 } MatroskaDemuxContext;
 
 typedef struct MatroskaBlock {
@@ -1856,7 +1861,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
 fourcc   = st->codec->codec_tag;
 extradata_offset = FFMIN(track->codec_priv.size, 18);
 } else if (!strcmp(track->codec_id, "A_QUICKTIME")
-   && (track->codec_priv.size >= 86)
+   && (track->codec_priv.size >= 36)
&& (track->codec_priv.data)) {
 fourcc = AV_RL32(track->codec_priv.data + 4);
 codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
@@ -1881,6 +1886,20 @@ static int matroska_parse_tracks(AVFormatContext *s)
 av_log(matroska->ctx, AV_LOG_ERROR,
"mov FourCC not found %s.\n", buf);
 }
+if (track->codec_priv.size >= 86) {
+bit_depth = AV_RB16(track->codec_priv.data + 82);
+if (get_qtpalette(codec_id, track->codec_priv.data + 16,
+matroska->palette)) {
+bit_depth &= 0x1F;
+/* Behave like V_MS/VFW/FOURCC; copy the palette to
+ * extradata */
+if (! (extradata = av_malloc(AVPALETTE_SIZE)))
+return AVERROR(ENOMEM);
+memcpy(extradata, matroska->palette, AVPALETTE_SIZE);
+extradata_size = AVPALETTE_SIZE;
+matroska->has_palette = 1;
+}
+}
 } else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
 switch (track->audio.bitdepth) {
 case  8:
@@ -2326,6 +2345,15 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
 if (matroska->num_packets > 0) {
 memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
 av_freep(>packets[0]);
+if (matroska->has_palette) {
+uint8_t *pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);
+if (!pal) {
+av_log(matroska->ctx, AV_LOG_ERROR, "Cannot append palette to packet\n");
+} else {
+memcpy(pal, matroska->palette, AVPALETTE_SIZE);
+}
+

Re: [FFmpeg-devel] support for reading / writing encrypted MP4 files

2015-12-21 Thread Eran Kornblau
> > You're right, didn't know that.
> > Please let me know if there are any changes you want me to apply in order 
> > to push the third one (decryption support).
> 
> sounds like you missed:
> http://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/185235.html
> http://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/185238.html
> 
Correct, I missed it. It's just that I'm not getting any emails from this 
mailing list 
(verified they are not getting to the junk folder...). 
So I've been polling the page of the last message of this thread in ffmpeg.org,
and guess these posts were added to a different leaf of the message tree...
Would really appreciate it if this could be resolved, either add my work email -
eran dot kornblau at kaltura dot com or my personal email - 
erankor at gmail dot com.

> if you want to maintain the code in the future then please send a
> patch that adds you to the maintainers file
> 
Attached
> 
> > +id = mov_codec_id(st, format);
> > +st->codec->codec_id = id;
> 
> doesnt this allow changing the codec id to anything from anything ?
> this seems potentially risky
> 
I see options to address this:
1. overwrite the codec_id only when it's AV_CODEC_ID_NONE
2. (stricter) save the format 4cc (that is loaded in ff_mov_read_stsd_entries) 
to some member of 
MOVStreamContext, and overwrite the codec id only when the format is 'encv' or 
'enca'

please let me know which one you prefer, and I will update the patch.

> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
Thanks a lot, Michael !

Eran


0001-add-Eran-Kornblau-to-maintainers.patch
Description: 0001-add-Eran-Kornblau-to-maintainers.patch
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter: add N bands audio parametric equalizer filter

2015-12-21 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi |  49 
 libavfilter/Makefile |   1 +
 libavfilter/af_anequalizer.c | 534 +++
 libavfilter/allfilters.c |   1 +
 4 files changed, 585 insertions(+)
 create mode 100644 libavfilter/af_anequalizer.c

diff --git a/doc/filters.texi b/doc/filters.texi
index a55cad4..49921e2 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -992,6 +992,55 @@ stream ends. The default value is 2 seconds.
 
 @end table
 
+@section anequalizer
+
+Parametric equalizer with unlimited number of bands for each channel.
+
+It accepts single option string in format:
+"c=@var{chn} f=@var{cf} w=@var{w} g=@var{g} t=@var{f} | ..."
+Each equalization filter is separated by '|'.
+
+@table @option
+@item chn
+Set channel number to which equalization will be applied.
+If input doesn't have that channel the entry is ignored.
+
+@item cf
+Set central frequency for band.
+If input doesn't have that frequency the entry is ignored.
+
+@item w
+Set band width in hertz
+
+@item g
+Set gain in dB
+
+@item f
+Set filter type, can be:
+
+@table @samp
+@item 0
+Butterworth.
+
+@item 1
+Chebyshev type 1.
+
+@item 2
+Chebyshev type 2.
+@end table
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Lower gain by 10 of central frequency 200Hz and width 100 Hz
+for first 2 channels using Chebyshev type 1 filter:
+@example
+anequalizer=args=c=0 f=200 w=100 g=-10 t=1|c=0 f=200 w=100 g=-10 t=1
+@end example
+@end itemize
+
 @section anull
 
 Pass the audio source unchanged to the output.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index dea012a..adbbc39 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -29,6 +29,7 @@ OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o
 OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o
 OBJS-$(CONFIG_AECHO_FILTER)  += af_aecho.o
 OBJS-$(CONFIG_AEMPHASIS_FILTER)  += af_aemphasis.o
+OBJS-$(CONFIG_ANEQUALIZER_FILTER)+= af_anequalizer.o
 OBJS-$(CONFIG_AEVAL_FILTER)  += aeval.o
 OBJS-$(CONFIG_AFADE_FILTER)  += af_afade.o
 OBJS-$(CONFIG_AFORMAT_FILTER)+= af_aformat.o
diff --git a/libavfilter/af_anequalizer.c b/libavfilter/af_anequalizer.c
new file mode 100644
index 000..31f4134
--- /dev/null
+++ b/libavfilter/af_anequalizer.c
@@ -0,0 +1,534 @@
+/*
+ * Copyright (c) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald 
Johansen and others
+ * Copyright (c) 2015 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/avstring.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "internal.h"
+#include "audio.h"
+
+enum FilterType {
+BUTTERWORTH,
+CHEBYSHEV1,
+CHEBYSHEV2,
+NB_TYPES
+};
+
+typedef struct FoSection {
+double a0, a1, a2, a3, a4;
+double b0, b1, b2, b3, b4;
+
+double num[4];
+double denum[4];
+} FoSection;
+
+typedef struct EqualizatorFilter {
+int ignore;
+int channel;
+int type;
+
+double freq;
+double gain;
+double width;
+
+FoSection section[2];
+} EqualizatorFilter;
+
+typedef struct AudioNEqualizerContext {
+const AVClass *class;
+char *args;
+
+int nb_filters;
+int nb_allocated;
+EqualizatorFilter *filters;
+} AudioNEqualizerContext;
+
+#define OFFSET(x) offsetof(AudioNEqualizerContext, x)
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption anequalizer_options[] = {
+{ "args", NULL, OFFSET(args), AV_OPT_TYPE_STRING, {.str=""}, 0, 0, FLAGS },
+{ NULL }
+};
+
+AVFILTER_DEFINE_CLASS(anequalizer);
+
+static int query_formats(AVFilterContext *ctx)
+{
+AVFilterFormats *formats;
+AVFilterChannelLayouts *layouts;
+static const enum AVSampleFormat sample_fmts[] = {
+AV_SAMPLE_FMT_DBLP,
+AV_SAMPLE_FMT_NONE
+};
+int ret;
+
+layouts = ff_all_channel_counts();
+if (!layouts)
+return AVERROR(ENOMEM);
+ret = ff_set_common_channel_layouts(ctx, layouts);
+if (ret < 0)
+return ret;
+
+formats = ff_make_format_list(sample_fmts);
+if (!formats)
+return AVERROR(ENOMEM);
+
+ret = 

Re: [FFmpeg-devel] [PATCH] Some minor fixes of my "patchset" for palettized QuickTime video in Matroska

2015-12-21 Thread Clément Bœsch
On Mon, Dec 21, 2015 at 05:16:36PM +0100, Mats Peterson wrote:
[...]
> As if that wasn't enough, here is another update. This time it's passing the
> FATE tests, unlike the old one. In order to refresh your memories, this
> patch fixes the long-standing issue regarding not recognizing palettized
> QuickTime video in Matroska. I have created a new function get_qtpalette()
> in a new file qtpalette.c, that is shared by both matroskadec.c and mov.c.
> And just like before, I'm not really in the mood to learn Git just to
> contribute with these simple patches, but I would be happy if someone could
> take a look at it, and, if it looks decent enough, submit proper patches in
> the right format for Git.
> 

No one will open your zip. The problem with the tar wasn't the archive
format but the fact that it was an archive.

Also, if you don't submit a proper patch (it's 2 git command¹, nothing
crazy), you will get ignored like the dozen of mails you already sent.

Regards,

[1]: git commit -a -m "lavf/matroska: ..." && git format-patch -1

-- 
lément B.


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


Re: [FFmpeg-devel] [PATCH] Some minor fixes of my "patchset" for palettized QuickTime video in Matroska

2015-12-21 Thread Ganesh Ajjanagadde
On Mon, Dec 21, 2015 at 8:25 AM, Clément Bœsch  wrote:
> On Mon, Dec 21, 2015 at 05:16:36PM +0100, Mats Peterson wrote:
> [...]
>> As if that wasn't enough, here is another update. This time it's passing the
>> FATE tests, unlike the old one. In order to refresh your memories, this
>> patch fixes the long-standing issue regarding not recognizing palettized
>> QuickTime video in Matroska. I have created a new function get_qtpalette()
>> in a new file qtpalette.c, that is shared by both matroskadec.c and mov.c.
>> And just like before, I'm not really in the mood to learn Git just to
>> contribute with these simple patches, but I would be happy if someone could
>> take a look at it, and, if it looks decent enough, submit proper patches in
>> the right format for Git.
>>
>
> No one will open your zip. The problem with the tar wasn't the archive
> format but the fact that it was an archive.
>
> Also, if you don't submit a proper patch (it's 2 git command¹, nothing
> crazy), you will get ignored like the dozen of mails you already sent.
>
> Regards,
>
> [1]: git commit -a -m "lavf/matroska: ..." && git format-patch -1

To add to Clement's message, Lou has already given you a complete git tutorial.

>
> --
> lément B.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 03/12] lavfi/vf_colorlevels: replace round by lrint

2015-12-21 Thread Ganesh Ajjanagadde
On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
 wrote:
> lrint is more accurate, and is not slower on non-broken libm's. Thus this
> represents a Pareto improvement.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavfilter/vf_colorlevels.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
> index cb3314b..dedbe30 100644
> --- a/libavfilter/vf_colorlevels.c
> +++ b/libavfilter/vf_colorlevels.c
> @@ -132,10 +132,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
> *in)
>  const uint8_t offset = s->rgba_map[i];
>  const uint8_t *srcrow = in->data[0];
>  uint8_t *dstrow = out->data[0];
> -int imin = round(r->in_min  * UINT8_MAX);
> -int imax = round(r->in_max  * UINT8_MAX);
> -int omin = round(r->out_min * UINT8_MAX);
> -int omax = round(r->out_max * UINT8_MAX);
> +int imin = lrint(r->in_min  * UINT8_MAX);
> +int imax = lrint(r->in_max  * UINT8_MAX);
> +int omin = lrint(r->out_min * UINT8_MAX);
> +int omax = lrint(r->out_max * UINT8_MAX);
>  double coeff;
>
>  if (imin < 0) {
> @@ -179,10 +179,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
> *in)
>  const uint8_t offset = s->rgba_map[i];
>  const uint8_t *srcrow = in->data[0];
>  uint8_t *dstrow = out->data[0];
> -int imin = round(r->in_min  * UINT16_MAX);
> -int imax = round(r->in_max  * UINT16_MAX);
> -int omin = round(r->out_min * UINT16_MAX);
> -int omax = round(r->out_max * UINT16_MAX);
> +int imin = lrint(r->in_min  * UINT16_MAX);
> +int imax = lrint(r->in_max  * UINT16_MAX);
> +int omin = lrint(r->out_min * UINT16_MAX);
> +int omax = lrint(r->out_max * UINT16_MAX);
>  double coeff;
>
>  if (imin < 0) {
> --
> 2.6.4
>

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


Re: [FFmpeg-devel] [PATCH 04/12] lavfi/vf_drawtext: replace round by llrint

2015-12-21 Thread Ganesh Ajjanagadde
On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
 wrote:
> llrint is at least as fast, and better accuracy wise.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavfilter/vf_drawtext.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index fc77be4..d5770ad 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -812,7 +812,7 @@ static int func_pts(AVFilterContext *ctx, AVBPrint *bp,
>  if (isnan(pts)) {
>  av_bprintf(bp, " ??:??:??.???");
>  } else {
> -int64_t ms = round(pts * 1000);
> +int64_t ms = llrint(pts * 1000);
>  char sign = ' ';
>  if (ms < 0) {
>  sign = '-';
> --
> 2.6.4
>

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


Re: [FFmpeg-devel] [PATCH 12/12] lavd/pulse_audio_enc: replace lround by lrint

2015-12-21 Thread Ganesh Ajjanagadde
On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
 wrote:
> Here it is mostly a cosmetic change, but there might be benefits in that
> there are no compat hacks for lround, while there are for lrint.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavdevice/pulse_audio_enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c
> index bc4d1f0..d8501e3 100644
> --- a/libavdevice/pulse_audio_enc.c
> +++ b/libavdevice/pulse_audio_enc.c
> @@ -333,7 +333,7 @@ static int pulse_set_volume(PulseData *s, double volume)
>  pa_volume_t vol;
>  const pa_sample_spec *ss = pa_stream_get_sample_spec(s->stream);
>
> -vol = pa_sw_volume_multiply(lround(volume * PA_VOLUME_NORM), 
> s->base_volume);
> +vol = pa_sw_volume_multiply(lrint(volume * PA_VOLUME_NORM), 
> s->base_volume);
>  pa_cvolume_set(, ss->channels, PA_VOLUME_NORM);
>  pa_sw_cvolume_multiply_scalar(, , vol);
>  pa_threaded_mainloop_lock(s->mainloop);
> --
> 2.6.4
>

again added the relevant header, and pushed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 11/12] lavfi/vf_histogram: replace round by lrint

2015-12-21 Thread Ganesh Ajjanagadde
On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
 wrote:
> lrint is at least as fast, and more accurate.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavfilter/vf_histogram.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/vf_histogram.c b/libavfilter/vf_histogram.c
> index 8e6f531..3f50f12 100644
> --- a/libavfilter/vf_histogram.c
> +++ b/libavfilter/vf_histogram.c
> @@ -281,7 +281,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
>  int col_height;
>
>  if (h->levels_mode)
> -col_height = round(h->level_height * (1. - 
> (log2(h->histogram[i] + 1) / max_hval_log)));
> +col_height = lrint(h->level_height * (1. - 
> (log2(h->histogram[i] + 1) / max_hval_log)));
>  else
>  col_height = h->level_height - (h->histogram[i] * 
> (int64_t)h->level_height + max_hval - 1) / max_hval;
>
> --
> 2.6.4
>

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


Re: [FFmpeg-devel] [PATCH 09/12] lavfi/af_dynaudnorm: replace round by lrint

2015-12-21 Thread Ganesh Ajjanagadde
On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
 wrote:
> lrint is at least as fast, and is more accurate.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavfilter/af_dynaudnorm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
> index 5f412f5..6401595 100644
> --- a/libavfilter/af_dynaudnorm.c
> +++ b/libavfilter/af_dynaudnorm.c
> @@ -135,7 +135,7 @@ static int query_formats(AVFilterContext *ctx)
>
>  static inline int frame_size(int sample_rate, int frame_len_msec)
>  {
> -const int frame_size = round((double)sample_rate * (frame_len_msec / 
> 1000.0));
> +const int frame_size = lrint((double)sample_rate * (frame_len_msec / 
> 1000.0));
>  return frame_size + (frame_size % 2);
>  }
>
> --
> 2.6.4
>

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


Re: [FFmpeg-devel] [PATCH 07/12] lavc/libvpxenc: replace round by lrint

2015-12-21 Thread Ganesh Ajjanagadde
On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
 wrote:
> Mostly cosmetic here.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/libvpxenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 96b1ac6..585c218 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -477,7 +477,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
>  enccfg.rc_dropframe_thresh = avctx->frame_skip_threshold;
>
>  //0-100 (0 => CBR, 100 => VBR)
> -enccfg.rc_2pass_vbr_bias_pct   = round(avctx->qcompress * 100);
> +enccfg.rc_2pass_vbr_bias_pct   = lrint(avctx->qcompress * 100);
>  if (avctx->bit_rate)
>  enccfg.rc_2pass_vbr_minsection_pct =
>  avctx->rc_min_rate * 100LL / avctx->bit_rate;
> @@ -497,7 +497,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
>  if (avctx->rc_buffer_aggressivity != 1.0) {
>  av_log(avctx, AV_LOG_WARNING, "The rc_buffer_aggressivity option is "
> "deprecated, use the undershoot-pct private option 
> instead.\n");
> -enccfg.rc_undershoot_pct = round(avctx->rc_buffer_aggressivity * 
> 100);
> +enccfg.rc_undershoot_pct = lrint(avctx->rc_buffer_aggressivity * 
> 100);
>  }
>  FF_ENABLE_DEPRECATION_WARNINGS
>  #endif
> --
> 2.6.4
>

Added a libavutil/internal.h include; no idea why avcodec/internal.h
does not do it already. Pushed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 08/12] lavfi/vf_crop: replace round by lrint

2015-12-21 Thread Ganesh Ajjanagadde
On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
 wrote:
> lrint is at least as fast, and more accurate.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavfilter/vf_crop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
> index 93a58da..01773fa 100644
> --- a/libavfilter/vf_crop.c
> +++ b/libavfilter/vf_crop.c
> @@ -126,7 +126,7 @@ static inline int normalize_double(int *n, double d)
>  *n = d > INT_MAX ? INT_MAX : INT_MIN;
>  ret = AVERROR(EINVAL);
>  } else
> -*n = round(d);
> +*n = lrint(d);
>
>  return ret;
>  }
> --
> 2.6.4
>

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


Re: [FFmpeg-devel] [PATCH 02/12] lavfi/vf_colorchannelmixer: replace round by lrint

2015-12-21 Thread Ganesh Ajjanagadde
On Sun, Dec 20, 2015 at 9:34 AM, Ganesh Ajjanagadde
 wrote:
> On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
>  wrote:
>> lrint is faster here on -ftree-vectorize with GCC. This is likely simply
>> an artifact of GCC's rather terrible auto-vectorizer, since as per the
>> instruction set manuals cvtsd2si and cvttsd2si (or their vector equivalents)
>> have identical cycle timings.
>>
>> Anyway, regardless of above, lrint is superior to round accuracy wise.
>>
>> Safety guaranteed as long int has at least 32 bits.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavfilter/vf_colorchannelmixer.c | 38 
>> +++---
>>  1 file changed, 19 insertions(+), 19 deletions(-)
>>
>> diff --git a/libavfilter/vf_colorchannelmixer.c 
>> b/libavfilter/vf_colorchannelmixer.c
>> index 0fffd34..cda972d 100644
>> --- a/libavfilter/vf_colorchannelmixer.c
>> +++ b/libavfilter/vf_colorchannelmixer.c
>> @@ -115,25 +115,25 @@ static int config_output(AVFilterLink *outlink)
>>  s->lut[i][j] = buffer;
>>
>>  for (i = 0; i < size; i++) {
>> -s->lut[R][R][i] = round(i * s->rr);
>> -s->lut[R][G][i] = round(i * s->rg);
>> -s->lut[R][B][i] = round(i * s->rb);
>> -s->lut[R][A][i] = round(i * s->ra);
>> -
>> -s->lut[G][R][i] = round(i * s->gr);
>> -s->lut[G][G][i] = round(i * s->gg);
>> -s->lut[G][B][i] = round(i * s->gb);
>> -s->lut[G][A][i] = round(i * s->ga);
>> -
>> -s->lut[B][R][i] = round(i * s->br);
>> -s->lut[B][G][i] = round(i * s->bg);
>> -s->lut[B][B][i] = round(i * s->bb);
>> -s->lut[B][A][i] = round(i * s->ba);
>> -
>> -s->lut[A][R][i] = round(i * s->ar);
>> -s->lut[A][G][i] = round(i * s->ag);
>> -s->lut[A][B][i] = round(i * s->ab);
>> -s->lut[A][A][i] = round(i * s->aa);
>> +s->lut[R][R][i] = lrint(i * s->rr);
>> +s->lut[R][G][i] = lrint(i * s->rg);
>> +s->lut[R][B][i] = lrint(i * s->rb);
>> +s->lut[R][A][i] = lrint(i * s->ra);
>> +
>> +s->lut[G][R][i] = lrint(i * s->gr);
>> +s->lut[G][G][i] = lrint(i * s->gg);
>> +s->lut[G][B][i] = lrint(i * s->gb);
>> +s->lut[G][A][i] = lrint(i * s->ga);
>> +
>> +s->lut[B][R][i] = lrint(i * s->br);
>> +s->lut[B][G][i] = lrint(i * s->bg);
>> +s->lut[B][B][i] = lrint(i * s->bb);
>> +s->lut[B][A][i] = lrint(i * s->ba);
>> +
>> +s->lut[A][R][i] = lrint(i * s->ar);
>> +s->lut[A][G][i] = lrint(i * s->ag);
>> +s->lut[A][B][i] = lrint(i * s->ab);
>> +s->lut[A][A][i] = lrint(i * s->aa);
>>  }
>>
>>  return 0;
>> --
>> 2.6.4
>>
>
> All remaining round patches (including this one) going in 2 days time.
> This is a request for reviews.

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


Re: [FFmpeg-devel] [PATCH] Some minor fixes of my "patchset" for palettized QuickTime video in Matroska

2015-12-21 Thread Mats Peterson

On 12/21/2015 05:25 PM, Clément Bœsch wrote:

On Mon, Dec 21, 2015 at 05:16:36PM +0100, Mats Peterson wrote:
[...]

As if that wasn't enough, here is another update. This time it's passing the
FATE tests, unlike the old one. In order to refresh your memories, this
patch fixes the long-standing issue regarding not recognizing palettized
QuickTime video in Matroska. I have created a new function get_qtpalette()
in a new file qtpalette.c, that is shared by both matroskadec.c and mov.c.
And just like before, I'm not really in the mood to learn Git just to
contribute with these simple patches, but I would be happy if someone could
take a look at it, and, if it looks decent enough, submit proper patches in
the right format for Git.



No one will open your zip. The problem with the tar wasn't the archive
format but the fact that it was an archive.

Also, if you don't submit a proper patch (it's 2 git command¹, nothing
crazy), you will get ignored like the dozen of mails you already sent.

Regards,

[1]: git commit -a -m "lavf/matroska: ..." && git format-patch -1



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



We will see about that.

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/avformat: add av_warn_unused_result to avformat_write_header

2015-12-21 Thread Ganesh Ajjanagadde
On Thu, Dec 17, 2015 at 1:53 PM, Ganesh Ajjanagadde
 wrote:
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavformat/avformat.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index ddf07b1..32bed01 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -2283,6 +2283,7 @@ void avformat_close_input(AVFormatContext **s);
>   *
>   * @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
>   */
> +av_warn_unused_result
>  int avformat_write_header(AVFormatContext *s, AVDictionary **options);
>
>  /**
> --
> 2.6.4
>

pushed with a commit message giving the rationale.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] support for reading / writing encrypted MP4 files

2015-12-21 Thread Eran Kornblau
Bumping up this thread, would love to see this getting merged
(attaching the same patch files)

Thank you

Eran



0001-libavutil-add-aes-ctr-support.patch
Description: 0001-libavutil-add-aes-ctr-support.patch


0002-movenc-support-cenc-common-encryption.patch
Description: 0002-movenc-support-cenc-common-encryption.patch


0003-mov-support-cenc-common-encryption.patch
Description: 0003-mov-support-cenc-common-encryption.patch
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vaapi: Add VP9 hwaccell support

2015-12-21 Thread Timo Rothenpieler
ping

Is any further review required, or is it fine to just push?



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


[FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Mats Peterson

Alright then, let's see how this turns out:

---
 libavformat/Makefile  |1 +
 libavformat/matroskadec.c |   30 -
 libavformat/mov.c |   95 ++---
 libavformat/qtpalette.c   |  102 
+

 libavformat/qtpalette.h   |2 +
 5 files changed, 155 insertions(+), 75 deletions(-)
 create mode 100644 libavformat/qtpalette.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 110e9e3..e03c73e 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -18,6 +18,7 @@ OBJS = allformats.o \
mux.o\
options.o\
os_support.o \
+   qtpalette.o  \
riff.o   \
sdp.o\
url.o\
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index c574749..f94f7fb 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -64,6 +64,8 @@
 #include 
 #endif

+#include "qtpalette.h"
+
 typedef enum {
 EBML_NONE,
 EBML_UINT,
@@ -312,6 +314,9 @@ typedef struct MatroskaDemuxContext {

 /* WebM DASH Manifest live flag/ */
 int is_live;
+
+uint32_t palette[256];
+int has_palette;
 } MatroskaDemuxContext;

 typedef struct MatroskaBlock {
@@ -1856,7 +1861,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
 fourcc   = st->codec->codec_tag;
 extradata_offset = FFMIN(track->codec_priv.size, 18);
 } else if (!strcmp(track->codec_id, "A_QUICKTIME")
-   && (track->codec_priv.size >= 86)
+   && (track->codec_priv.size >= 36)
&& (track->codec_priv.data)) {
 fourcc = AV_RL32(track->codec_priv.data + 4);
 codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
@@ -1865,7 +1870,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
 codec_id = ff_codec_get_id(ff_codec_movaudio_tags, 
fourcc);

 }
 } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
-   (track->codec_priv.size >= 21)  &&
+   (track->codec_priv.size >= 86)  &&
(track->codec_priv.data)) {
 fourcc   = AV_RL32(track->codec_priv.data + 4);
 codec_id = ff_codec_get_id(ff_codec_movvideo_tags, fourcc);
@@ -1881,6 +1886,18 @@ static int matroska_parse_tracks(AVFormatContext *s)
 av_log(matroska->ctx, AV_LOG_ERROR,
"mov FourCC not found %s.\n", buf);
 }
+bit_depth = AV_RB16(track->codec_priv.data + 82);
+if (get_qtpalette(codec_id, track->codec_priv.data + 16,
+matroska->palette)) {
+bit_depth &= 0x1F;
+/* Behave like V_MS/VFW/FOURCC; copy the palette to
+ * extradata */
+if (! (extradata = av_malloc(AVPALETTE_SIZE)))
+return AVERROR(ENOMEM);
+memcpy(extradata, matroska->palette, AVPALETTE_SIZE);
+extradata_size = AVPALETTE_SIZE;
+matroska->has_palette = 1;
+}
 } else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
 switch (track->audio.bitdepth) {
 case  8:
@@ -2326,6 +2343,15 @@ static int 
matroska_deliver_packet(MatroskaDemuxContext *matroska,

 if (matroska->num_packets > 0) {
 memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
 av_freep(>packets[0]);
+if (matroska->has_palette) {
+uint8_t *pal = av_packet_new_side_data(pkt, 
AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);

+if (!pal) {
+av_log(matroska->ctx, AV_LOG_ERROR, "Cannot append 
palette to packet\n");

+} else {
+memcpy(pal, matroska->palette, AVPALETTE_SIZE);
+}
+matroska->has_palette = 0;
+}
 if (matroska->num_packets > 1) {
 void *newpackets;
 memmove(>packets[0], >packets[1],
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 06e80c8..1c54bb7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1751,13 +1751,21 @@ static int mov_codec_id(AVStream *st, uint32_t 
format)

 return id;
 }

-static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
- AVStream *st, MOVStreamContext *sc)
+static int mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
+ AVStream *st, MOVStreamContext *sc,
+ int size)
 {
+uint8_t *stsd;
 uint8_t codec_name[32];
-unsigned int color_depth, len, j;
-int color_greyscale;
-int color_table_id;
+int64_t pos;
+unsigned int len;
+
+if (! (stsd = av_malloc(size)))
+return AVERROR(ENOMEM);
+
+pos = avio_tell(pb);
+avio_read(pb, stsd, size);
+avio_seek(pb, pos, 

Re: [FFmpeg-devel] [PATCHv2] lavu/libm: add erf hack and make dynaudnorm available everywhere

2015-12-21 Thread Ganesh Ajjanagadde
On Sun, Dec 20, 2015 at 4:04 PM, Ganesh Ajjanagadde
 wrote:
> On Sun, Dec 20, 2015 at 12:04 PM, Ganesh Ajjanagadde
>  wrote:
>> Source code is from Boost:
>> http://www.boost.org/doc/libs/1_46_1/boost/math/special_functions/erf.hpp
>> with appropriate modifications for FFmpeg.
>>
>> Tested on interval -6 to 6 (beyond which it saturates), +/-NAN, +/-INFINITY
>> under -fsanitize=undefined on clang to test for possible undefined behavior.
>>
>> (Below will be trimmed for actual commit, given for completeness here)
>>
>> Note that this will remove the erf dependency for dynaudnorm, making it
>> universally available for clients. I have not done this in this patch;
>> may be easily done once this is tested on a broken libm and reviewed.
>>
>> This function turns out to actually be more accurate and faster than the
>> libm (GNU/BSD's/Mac OS X), and I can think of 3 reasons why upstream
>> does not use this:
>> 1. They are not aware of it.
>> 2. They are concerned about licensing - this applies especially to GNU
>> libm.
>> 3. They do not know and/or appreciate the benefits of rational
>> approximations over polynomial approximations. Boost uses them to great
>> effect, see e.g swr/resample for bessel derived from them, which is also
>> similarly superior to libm variants.
>>
>> First, performance.
>> sample benchmark (clang -O3, Haswell, GNU/Linux):
>>
>> 3e8 values evenly spaced from 0 to 6
>> time (libm):
>> ./test  13.39s user 0.00s system 100% cpu 13.376 total
>> time (boost based):
>> ./test  9.20s user 0.00s system 100% cpu 9.190 total
>>
>> Second, accuracy.
>> 1e8 eval pts from 0 to 6
>> maxdiff (absolute): 2.2204460492503131e-16
>> illustration:
>> erf(0.6):
>> libm  : 0.60385609084792602
>> boost : 0.60385609084792591
>> real  : 0.60385609084792591
>>
>> i.e libm is actually incorrectly rounded. Note that this is clear from:
>> https://github.com/JuliaLang/openlibm/blob/master/src/s_erf.c (the Sun
>> implementation used by both BSD and GNU libm's), where only 1 ulp is
>> guaranteed.
>> I suspect Boost's is correctly rounded (0.5 ulp) based on their error
>> analysis but have not checked or verified formally that this is the
>> case.
>>
>> Reviewed-by: James Almer 
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  configure|   1 -
>>  libavutil/libm.h | 198 
>> +++
>>  2 files changed, 198 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index da74616..89c98d1 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2851,7 +2851,6 @@ cropdetect_filter_deps="gpl"
>>  delogo_filter_deps="gpl"
>>  deshake_filter_select="pixelutils"
>>  drawtext_filter_deps="libfreetype"
>> -dynaudnorm_filter_deps="erf"
>>  ebur128_filter_deps="gpl"
>>  eq_filter_deps="gpl"
>>  fftfilt_filter_deps="avcodec"
>> diff --git a/libavutil/libm.h b/libavutil/libm.h
>> index 37b8e86..f849bbb 100644
>> --- a/libavutil/libm.h
>> +++ b/libavutil/libm.h
>> @@ -1,4 +1,5 @@
>>  /*
>> + * erf function: Copyright (c) 2006 John Maddock
>>   * This file is part of FFmpeg.
>>   *
>>   * FFmpeg is free software; you can redistribute it and/or
>> @@ -76,6 +77,203 @@ static av_always_inline double copysign(double x, double 
>> y)
>>  #define cosf(x) ((float)cos(x))
>>  #endif
>>
>> +#if !HAVE_ERF
>> +static inline double ff_eval_poly(const double *coeff, int size, double x) {
>> +double sum = coeff[size-1];
>> +int i;
>> +for (i = size-2; i >= 0; --i) {
>> +sum *= x;
>> +sum += coeff[i];
>> +}
>> +return sum;
>> +}
>> +
>> +/**
>> + * erf function
>> + * Algorithm taken from the Boost project, source:
>> + * http://www.boost.org/doc/libs/1_46_1/boost/math/special_functions/erf.hpp
>> + * Use, modification and distribution are subject to the
>> + * Boost Software License, Version 1.0 (see notice below).
>> + * Boost Software License - Version 1.0 - August 17th, 2003
>> +Permission is hereby granted, free of charge, to any person or organization
>> +obtaining a copy of the software and accompanying documentation covered by
>> +this license (the "Software") to use, reproduce, display, distribute,
>> +execute, and transmit the Software, and to prepare derivative works of the
>> +Software, and to permit third-parties to whom the Software is furnished to
>> +do so, all subject to the following:
>> +
>> +The copyright notices in the Software and this entire statement, including
>> +the above license grant, this restriction and the following disclaimer,
>> +must be included in all copies of the Software, in whole or in part, and
>> +all derivative works of the Software, unless such copies or derivative
>> +works are solely in the form of machine-executable object code generated by
>> +a source language processor.
>> +
>> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>> +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 

Re: [FFmpeg-devel] [PATCHv2] lavu/libm: add erf hack and make dynaudnorm available everywhere

2015-12-21 Thread James Almer
On 12/21/2015 2:08 PM, Ganesh Ajjanagadde wrote:
> Pushed with slight modifications.
> 
> This is a request to any running MSVC/other platform lacking erf: can
> you please test to make sure this works?

Check http://fate.ffmpeg.org/ for new failures later today. Look for VS2012
and VS2013.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec.c, mov.c/qtpalette.c: Fix issue with, palettized QuickTime video in Matroska

2015-12-21 Thread Mats Peterson

On 12/21/2015 06:04 PM, Mats Peterson wrote:

Alright then, let's see how this turns out:



Perhaps I should once again explain the issue:

Palettized QuickTime video in Matroska has hitherto not been recognized 
whatsoever, and the "palette" used has been completely random.


The patch for matroskadec.c fixes this issue by adding a palette side 
data packet in matroska_deliver_packet(), much in the same way as it's 
done in mov.c.


The change to mov.c consists mainly of moving the palette handling from 
the mov_parse_stsd_video() function to a new get_qtpalette() function in 
the new file qtpalette.c, which is shared by both matroskadec.c and mov.c.


In matroskadec.c, I'm also putting the palette in 'extradata', like it's 
done for V_MS/VFW/FOURCC; this is a requirement in order for MPlayer to 
recognize the palette.


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