Re: [FFmpeg-devel] [PATCH] define AVPixelFormat aliases as enumerators instead of macros

2016-01-16 Thread wm4
On Fri, 15 Jan 2016 10:39:59 -0800
Richard Smith  wrote:

> On Fri Jan 15 08:51:07 CET 2016 wm4  wrote;
> > On Thu, 14 Jan 2016 13:58:14 -0800 Richard Smith  
> > wrote:  
> > > libavutil/pixfmt.h defines a collection of endian-specific pixel formats 
> > > as
> > > macros. These macro names can cause conflicts with external projects that
> > > use those identifiers for their own purposes. Here's a patch to define
> > > these aliases as enumerators instead of macros, please consider merging:
> > >
> > >
> > > https://github.com/zygoloid/FFmpeg/commit/c20a0e2e66e52c45b9193bc750165b7ecf7f3ca4
> > >
> > > (Note that AV_PIX_FMT_Y400A was already defined as an enumerator in the
> > > PixelFormat enumeration, so I deleted its (no-op) macro entirely.)  
> >
> > API users might check for the existence of such pixfmts with #ifdef,  
> 
> That would be a very odd thing for them to do, as most pixfmts do not
> have #defines.
> 
> > and I don't understand the reasoning behind your patch. Why would
> > external projects redefine these macros?  
> 
> The project in question has its own enumeration:
> 
> namespace MyProject {
>   enum PixelFormatToUse {
> // ... some other values ...
> AV_PIX_FMT_RGB32, // use ffmpeg's AV_PIX_FMT_RGB32
> // ...
>   };
> }

Then maybe it shouldn't do that, or if it does, this source file
shouldn't include any ffmpeg related headers. This is just asking for
trouble big-time. Use a different prefix if you really want to do this.
FFmpeg uses preprocessor defines for a lot of things, and you just have
to expect that FFmpeg will add macros prefixed with AV_ as it pleases.

> The names are intentionally chosen to be in 1-1 correspondence with
> ffmpeg's names. But ffmpeg's macro sometimes renames this project's
> enumerator, depending on whether its header is included before that
> file.

This is not a question of what should be, it's question of
compatibility. We try not to break downstream projects unnecessarily.

I'd just suggest defining aliases with names that do not violate
ffmpeg's namespace.

If you want to do this change, you IMHO need to keep the defines under a
compatibility ifdef, that will remain active until the next major
library bump. (Major bumps are when we change the API/ABI in
incompatible ways. Look e.g. into libavutil/version.h for a bunch of
APIs that will be removed or changed on the next bump.)

I don't know if others shares my opinion whether compatibility is
needed here.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] remove the deprecated avpicture_get_size() function

2016-01-16 Thread wm4
On Fri, 15 Jan 2016 23:34:01 -0800
Eddie Hao  wrote:

> ---
>  libavcodec/avcodec.h | 6 --
>  libavcodec/avpicture.c   | 5 -
>  libavcodec/libutvideodec.cpp | 3 ++-
>  libavcodec/libutvideoenc.cpp | 3 ++-
>  libavdevice/decklink_dec.cpp | 2 +-
>  libavdevice/lavfi.c  | 3 ++-
>  libavformat/frmdec.c | 3 ++-
>  7 files changed, 9 insertions(+), 16 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index f365775..6fab787 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -4908,12 +4908,6 @@ int avpicture_layout(const AVPicture *src, enum 
> AVPixelFormat pix_fmt,
>   unsigned char *dest, int dest_size);
>  
>  /**
> - * @deprecated use av_image_get_buffer_size() instead.
> - */
> -attribute_deprecated
> -int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
> -
> -/**

Replacing uses of this function is welcome, but it can't be fully
removed yet. This would break API users. It has to happen on the next
major bump instead.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1-bit raw QuickTime video

2016-01-16 Thread Michael Niedermayer
On Wed, Jan 13, 2016 at 01:42:24PM +0100, Mats Peterson wrote:
> Match the use of AV_PIX_FMT_PAL8 for 1-bit QuickTime Animation in
> lavc/qtrle. To reiterate, 1-bit video is not necessary black & white in
> QuickTime, merely bi-level. The two colors can be any color. The palette,
> either included in the sample description, or the default Macintosh
> palette (black & white for 1-bit video) will be set in lavf/qtpalette.
> See the QuickTime File Format Specification for details.
> 
> Mats

>  raw.c|4 ++--
>  rawdec.c |   28 
>  2 files changed, 22 insertions(+), 10 deletions(-)
> de416185ecb440201cd8235d6e8dbb01b733aec9  
> 0001-lavf-rawdec-Use-AV_PIX_FMT_PAL8-for-1-bit-QuickTime-.patch
> From d1f62ac4a51329eff0c12fbab19ac8f22329d791 Mon Sep 17 00:00:00 2001
> From: Mats Peterson 
> Date: Wed, 13 Jan 2016 13:29:13 +0100
> Subject: [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1-bit raw QuickTime 
> video
> 
> Match the use of AV_PIX_FMT_PAL8 for 1-bit QuickTime Animation in
> lavc/qtrle. To reiterate, 1-bit video is not necessary black & white in
> QuickTime, merely bi-level. The two colors can be any color. The palette,
> either included in the sample description, or the default Macintosh
> palette (black & white for 1-bit video) will be set in lavf/qtpalette.
> See the QuickTime File Format Specification for details.

breaks
https://trac.ffmpeg.org/raw-attachment/ticket/823/1bpp.mov
and
https://trac.ffmpeg.org/raw-attachment/ticket/823/1bpp_129.mov

do you have a file that this fixes ?

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1-bit raw QuickTime video

2016-01-16 Thread Mats Peterson

On 01/16/2016 12:10 PM, Michael Niedermayer wrote:


breaks
https://trac.ffmpeg.org/raw-attachment/ticket/823/1bpp.mov
and
https://trac.ffmpeg.org/raw-attachment/ticket/823/1bpp_129.mov

do you have a file that this fixes ?



Interesting. Well, I don't have a file that gets "fixed" in any way, but 
I do have a 1 bpp raw file that works OK here:


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

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


Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1-bit raw QuickTime video

2016-01-16 Thread Mats Peterson

On 01/16/2016 12:10 PM, Michael Niedermayer wrote:


breaks
https://trac.ffmpeg.org/raw-attachment/ticket/823/1bpp.mov
and
https://trac.ffmpeg.org/raw-attachment/ticket/823/1bpp_129.mov

do you have a file that this fixes ?

Could it have something to do with the "linesize_align" variable that is 
4 by default? I have no idea.


Mats

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


Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1-bit raw QuickTime video

2016-01-16 Thread Mats Peterson

On 01/16/2016 12:24 PM, Mats Peterson wrote:

Could it have something to do with the "linesize_align" variable that is
4 by default? I have no idea.

I suppose since the width of both these files is an odd value, there has 
to be some alignment to even boundaries. I'll try various values of 
linesize_align.


Mats

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


Re: [FFmpeg-devel] [PATCH] lavf/matroskadec: Get sample size from private data

2016-01-16 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 11:31:49PM +0100, Mats Peterson wrote:
> Since track->audio.bitdepth is zero for A_QUICKTIME, the sample size
> has to be retrieved from the private data. Also, 'twos' and 'sowt'
> audio can be signed 8-bit.
> 
> Mats

>  matroskadec.c |   10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)
> f0b9dab8756fd89584300e3c934c3149e1983ed8  
> 0001-lavf-matroskadec-Get-sample-size-from-private-data.patch
> From dbddf5d5fba7992e52bb25db214e7b4debfb8023 Mon Sep 17 00:00:00 2001
> From: Mats Peterson 
> Date: Fri, 15 Jan 2016 23:25:38 +0100
> Subject: [PATCH] lavf/matroskadec: Get sample size from private data

applied

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


Re: [FFmpeg-devel] [PATCH] lavf/mov: Don't limit fourcc 0 -> raw/twos to version 0 sample descriptions

2016-01-16 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 11:35:08PM +0100, Mats Peterson wrote:
> I had the notion that the fourcc 0x to raw/twos mapping was
> only valid for version 0 sound sample descriptions. However, the
> documentation is quite foggy regarding this subject, so it's better
> to do this mapping regardless of sample description version.
> 
> Mats
> 
> -- 
> Mats Peterson
> http://matsp888.no-ip.org/~mats/

>  mov.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 8e959656435f6511d5fa0efa4bacf963bda828d2  
> 0001-lavf-mov-Don-t-limit-fourcc-0-raw-twos-to-version-0-.patch
> From 9e3354877146b29a30810a886342145c74d1a7bd Mon Sep 17 00:00:00 2001
> From: Mats Peterson 
> Date: Fri, 15 Jan 2016 23:28:06 +0100
> Subject: [PATCH] lavf/mov: Don't limit fourcc 0 -> raw/twos to version 0 
> sample descriptions

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin


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: Add an option to toggle dref opening

2016-01-16 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 05:03:49PM +, Derek Buitenhuis wrote:
> This feature is mostly only used by NLE software, and is
> both of dubious value being enabled by default, and a
> possible security risk.
> 
> Signed-off-by: Derek Buitenhuis 
> ---
>  libavformat/isom.h|  1 +
>  libavformat/mov.c | 22 +-
>  libavformat/version.h |  4 ++--
>  3 files changed, 20 insertions(+), 7 deletions(-)

i wonder if this should not be a generic option for all demuxers
or maybe a whitelist of what pathes are allowed to be opened, maybe
similar to the existing codec/format whitelists

but thats not a objection to the dref option here ...

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 


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


Re: [FFmpeg-devel] [PATCH] News entry for FFmpeg 2.8.5, 2.7.5, 2.6.7, 2.5.10

2016-01-16 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 09:22:27PM -0500, Ganesh Ajjanagadde wrote:
> On Fri, Jan 15, 2016 at 9:15 PM, Michael Niedermayer  wrote:
> > From: Michael Niedermayer 
> >
> > ---
> >  src/index |   14 ++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/src/index b/src/index
> > index 554ad0e..56a7956 100644
> > --- a/src/index
> > +++ b/src/index
> > @@ -37,6 +37,20 @@
> >  News
> >
> >
> > +  January 16, 2015, FFmpeg 2.8.5, 2.7.5, 2.6.7, 
> > 2.5.10
> > +  
> > +We have made several new point releases ( > href="download.html#release_2.8">2.8.5,
> > +  2.7.5,
> > +  2.6.7,
> > +  2.5.10).
> > +They fix various bugs, as well as CVE-2016-1897 and CVE-2016-1898.
> > +Please see the changelog for more details.
> 
> Super minor, but filename is Changelog, and/or it can be ref'ed like
> in the 2.8 major entry.

the text is copy and pasted from previous announcments where it was
lowercase. I think it was intended to refer to the english word
"changelog" not the file
linking isnt trivial because its not one changelog, each release has
its own changelog so it would require 4 links,
ive reworded it slightly to be a bit clearer
pushed

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH 2/2] fate: add fixed-dsp test

2016-01-16 Thread Ronald S. Bultje
Hi,

On Fri, Jan 15, 2016 at 8:10 PM, James Almer  wrote:

> Adapted from float-dsp


So, it seems this just compares C vs. SIMD, right? Shouldn't we use
checkasm for that?

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


Re: [FFmpeg-devel] [PATCH] lavf/mov: Don't limit fourcc 0 -> raw/twos to version 0 sample descriptions

2016-01-16 Thread Mats Peterson

On 01/16/2016 02:17 PM, Michael Niedermayer wrote:

applied

thanks

Thanks, Michael.

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


Re: [FFmpeg-devel] [PATCH] lavf/matroskadec: Get sample size from private data

2016-01-16 Thread Mats Peterson

On 01/16/2016 02:16 PM, Michael Niedermayer wrote:

applied

thx

Thanks, Michael.

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


Re: [FFmpeg-devel] [PATCH] mov: Add an option to toggle dref opening

2016-01-16 Thread wm4
On Sat, 16 Jan 2016 14:22:21 +0100
Michael Niedermayer  wrote:

> On Fri, Jan 15, 2016 at 05:03:49PM +, Derek Buitenhuis wrote:
> > This feature is mostly only used by NLE software, and is
> > both of dubious value being enabled by default, and a
> > possible security risk.
> > 
> > Signed-off-by: Derek Buitenhuis 
> > ---
> >  libavformat/isom.h|  1 +
> >  libavformat/mov.c | 22 +-
> >  libavformat/version.h |  4 ++--
> >  3 files changed, 20 insertions(+), 7 deletions(-)  
> 
> i wonder if this should not be a generic option for all demuxers
> or maybe a whitelist of what pathes are allowed to be opened, maybe
> similar to the existing codec/format whitelists
> 
> but thats not a objection to the dref option here ...
> 
> [...]

There's a AVFormatContext.open_cb callback, which an API user can use
to decide whether opening a certain URL is fine. (Unfortunately, HLS
doesn't use it, but mov does.)

It might be fine to make opening as strict as possible (if that
callback is not set, which can be used to override it).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] fate: add fixed-dsp test

2016-01-16 Thread James Almer
On 1/16/2016 10:43 AM, Ronald S. Bultje wrote:
> Hi,
> 
> On Fri, Jan 15, 2016 at 8:10 PM, James Almer  wrote:
> 
>> Adapted from float-dsp
> 
> 
> So, it seems this just compares C vs. SIMD, right? Shouldn't we use
> checkasm for that?
> 
> Ronald

I guess that'd be best, yeah. I'll port this one and let someone else
port the float-dsp one to checkasm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1-bit raw QuickTime video

2016-01-16 Thread Mats Peterson

On 01/16/2016 12:10 PM, Michael Niedermayer wrote:


do you have a file that this fixes ?



I do have a file, *now*. I've added a palette with blue color to a raw 
1-bit QuickTime file just to have something to work on.


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

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


[FFmpeg-devel] [PATCH] avformat/hls: Require the file extension to be m3u / m3u8 for probing to succeed

2016-01-16 Thread Michael Niedermayer
From: Michael Niedermayer 

If the filename isnt set by the user application then the code behaves like 
before

Signed-off-by: Michael Niedermayer 
---
 libavformat/hls.c |4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 7a8610c..846d884 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1983,6 +1983,10 @@ static int hls_probe(AVProbeData *p)
  * somewhere for a proper match. */
 if (strncmp(p->buf, "#EXTM3U", 7))
 return 0;
+
+if (p->filename && !av_match_ext(p->filename, "m3u8,m3u"))
+return 0;
+
 if (strstr(p->buf, "#EXT-X-STREAM-INF:") ||
 strstr(p->buf, "#EXT-X-TARGETDURATION:") ||
 strstr(p->buf, "#EXT-X-MEDIA-SEQUENCE:"))
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH] videodsp: fix 1-byte overread in top/bottom READ_NUM_BYTES iterations.

2016-01-16 Thread Ronald S. Bultje
This can overread (either before start or beyond end) of the buffer in
Nx1 (i.e. height=1) images.

Fixes mozilla bug 1240080.
---
 libavcodec/x86/videodsp.asm | 21 ++---
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/libavcodec/x86/videodsp.asm b/libavcodec/x86/videodsp.asm
index 48f5ac0..a807d3b 100644
--- a/libavcodec/x86/videodsp.asm
+++ b/libavcodec/x86/videodsp.asm
@@ -193,14 +193,10 @@ hvar_fn
 movvalb, [srcq+%2-1]
 %elif (%2-%%off) == 2
 movvalw, [srcq+%2-2]
-%elifidn %1, body
+%else
 movvalb, [srcq+%2-1]
-salvald, 16
+rorvald, 16
 movvalw, [srcq+%2-3]
-%elifidn %1, bottom
-movd mm %+ %%mmx_idx, [srcq+%2-4]
-%else ; top
-movd mm %+ %%mmx_idx, [srcq+%2-3]
 %endif
 %endif ; (%2-%%off) >= 1
 %endmacro ; READ_NUM_BYTES
@@ -253,18 +249,13 @@ hvar_fn
 mov [dstq+%2-1], valb
 %elif (%2-%%off) == 2
 mov [dstq+%2-2], valw
-%elifidn %1, body
-mov [dstq+%2-3], valw
-sarvald, 16
-mov [dstq+%2-1], valb
 %else
-movd   vald, mm %+ %%mmx_idx
-%ifidn %1, bottom
-sarvald, 8
-%endif
 mov [dstq+%2-3], valw
-sarvald, 16
+rorvald, 16
 mov [dstq+%2-1], valb
+%ifnidn %1, body
+rorvald, 16
+%endif
 %endif
 %endif ; (%2-%%off) >= 1
 %endmacro ; WRITE_NUM_BYTES
-- 
2.1.2

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


Re: [FFmpeg-devel] [PATCH] mov: Add an option to toggle dref opening

2016-01-16 Thread Marton Balint

On Sat, 16 Jan 2016, wm4 wrote:

On Sat, 16 Jan 2016 14:22:21 +0100
Michael Niedermayer  wrote:


On Fri, Jan 15, 2016 at 05:03:49PM +, Derek Buitenhuis wrote:
> This feature is mostly only used by NLE software, and is
> both of dubious value being enabled by default, and a
> possible security risk.
> 
> Signed-off-by: Derek Buitenhuis 

> ---
>  libavformat/isom.h|  1 +
>  libavformat/mov.c | 22 +-
>  libavformat/version.h |  4 ++--
>  3 files changed, 20 insertions(+), 7 deletions(-) 


i wonder if this should not be a generic option for all demuxers
or maybe a whitelist of what pathes are allowed to be opened, maybe
similar to the existing codec/format whitelists

but thats not a objection to the dref option here ...

[...]


There's a AVFormatContext.open_cb callback, which an API user can use
to decide whether opening a certain URL is fine. (Unfortunately, HLS
doesn't use it, but mov does.)

It might be fine to make opening as strict as possible (if that
callback is not set, which can be used to override it).


CLI users still going to need an option for it.

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


[FFmpeg-devel] [PATCH] avfilter: add afftfilter

2016-01-16 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 configure |   3 +
 libavfilter/Makefile  |   1 +
 libavfilter/af_afftfilt.c | 363 ++
 libavfilter/allfilters.c  |   1 +
 4 files changed, 368 insertions(+)
 create mode 100644 libavfilter/af_afftfilt.c

diff --git a/configure b/configure
index 7cef6f5..ec0b350 100755
--- a/configure
+++ b/configure
@@ -2838,6 +2838,8 @@ unix_protocol_deps="sys_un_h"
 unix_protocol_select="network"
 
 # filters
+afftfilt_filter_deps="avcodec"
+afftfilt_filter_select="fft"
 amovie_filter_deps="avcodec avformat"
 aresample_filter_deps="swresample"
 ass_filter_deps="libass"
@@ -6061,6 +6063,7 @@ done
 enabled zlib && add_cppflags -DZLIB_CONST
 
 # conditional library dependencies, in linking order
+enabled afftfilt_filter && prepend avfilter_deps "avcodec"
 enabled amovie_filter   && prepend avfilter_deps "avformat avcodec"
 enabled aresample_filter&& prepend avfilter_deps "swresample"
 enabled asyncts_filter  && prepend avfilter_deps "avresample"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index e3e3561..242f56d 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_AFFTFILT_FILTER)   += af_afftfilt.o window_func.o
 OBJS-$(CONFIG_ANEQUALIZER_FILTER)+= af_anequalizer.o
 OBJS-$(CONFIG_AEVAL_FILTER)  += aeval.o
 OBJS-$(CONFIG_AFADE_FILTER)  += af_afade.o
diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c
new file mode 100644
index 000..1a8828a
--- /dev/null
+++ b/libavfilter/af_afftfilt.c
@@ -0,0 +1,363 @@
+/*
+ * Copyright (c) 2016 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/audio_fifo.h"
+#include "libavutil/avstring.h"
+#include "libavfilter/internal.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+#include "libavcodec/avfft.h"
+#include "libavutil/eval.h"
+#include "audio.h"
+#include "window_func.h"
+
+typedef struct AFFTFiltContext {
+const AVClass *class;
+char *expr_str;
+int fft_bits;
+
+FFTContext *fft, *ifft;
+FFTComplex **fft_data;
+int nb_exprs;
+int window_size;
+AVExpr **expr;
+AVAudioFifo *fifo;
+int64_t pts;
+int hop_size;
+float overlap;
+AVFrame *buffer;
+int start, end;
+int win_func;
+float *window_func_lut;
+} AFFTFiltContext;
+
+static const char *const var_names[] = {"sr", "b",
"ch","chs",   "pts",NULL };
+enum   { VAR_SAMPLE_RATE, VAR_BIN, 
VAR_CHANNEL, VAR_CHANNELS, VAR_PTS, VAR_VARS_NB };
+
+#define OFFSET(x) offsetof(AFFTFiltContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption afftfilt_options[] = {
+{ "exprs", "set channels expressions", OFFSET(expr_str), 
AV_OPT_TYPE_STRING, {.str = "1" }, 0, 0, A },
+{ "win_size", "set window size", OFFSET(fft_bits), AV_OPT_TYPE_INT, 
{.i64=12}, 4, 16, A, "fft" },
+{ "w16",0, 0, AV_OPT_TYPE_CONST, {.i64=4},  0, 0, A, "fft" },
+{ "w32",0, 0, AV_OPT_TYPE_CONST, {.i64=5},  0, 0, A, "fft" },
+{ "w64",0, 0, AV_OPT_TYPE_CONST, {.i64=6},  0, 0, A, "fft" },
+{ "w128",   0, 0, AV_OPT_TYPE_CONST, {.i64=7},  0, 0, A, "fft" },
+{ "w256",   0, 0, AV_OPT_TYPE_CONST, {.i64=8},  0, 0, A, "fft" },
+{ "w512",   0, 0, AV_OPT_TYPE_CONST, {.i64=9},  0, 0, A, "fft" },
+{ "w1024",  0, 0, AV_OPT_TYPE_CONST, {.i64=10}, 0, 0, A, "fft" },
+{ "w2048",  0, 0, AV_OPT_TYPE_CONST, {.i64=11}, 0, 0, A, "fft" },
+{ "w4096",  0, 0, AV_OPT_TYPE_CONST, {.i64=12}, 0, 0, A, "fft" },
+{ "w8192",  0, 0, AV_OPT_TYPE_CONST, {.i64=13}, 0, 0, A, "fft" },
+{ "w16384", 0, 0, AV_OPT_TYPE_CONST, {.i64=14}, 0, 0, A, "fft" },
+{ "w32768", 0, 0, AV_OPT_TYPE_CONST, {.i64=15}, 0, 0, A, "fft" },
+{ "w65536", 0, 0, AV_OPT_TYPE_CONST, {.i64=16}, 0, 0, A, "fft" },
+{ "wi

Re: [FFmpeg-devel] [PATCH 1/2] ffplay: Seek only when pressing the right mouse button on the video window.

2016-01-16 Thread Marton Balint

On Fri, 15 Jan 2016, Vittorio Gambaletta (VittGam) wrote:


Seeking by clicking on the video window can be annoying, because
the user might click on it accidentally while eg. trying to get
focus on it, and ffplay seeks instead.

This commit changes that behaviour to seek only when the right
mouse button is used to click and drag on the window.

Signed-off-by: Vittorio Gambaletta 



Looks good, I will apply in a few days if no one steps up against it.

However your patch seem to have some whitespace errors probably caused by 
your mailer, and because of that it does not apply cleanly so you might 
consider sending patches next time as an attachment if your mailer messes 
something up inline.


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


Re: [FFmpeg-devel] [PATCH 2/2] ffplay: Toggle full screen when double-clicking the video window with the left mouse button.

2016-01-16 Thread Marton Balint

On Fri, 15 Jan 2016, Vittorio Gambaletta (VittGam) wrote:

Now that the seek only happens with the right mouse button, it makes
sense to toggle full screen when double-clicking with the left mouse
button, like other video players do.



I am not against this.


Signed-off-by: Vittorio Gambaletta 

---
 ffplay.c |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/ffplay.c b/ffplay.c
index 2fa7165..582ca39 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3473,6 +3473,24 @@ static void event_loop(VideoState *cur_stream)
 do_exit(cur_stream);
 break;
 }
+{


Whitespace and indentation seems messed up in this patch as well.


+static int mouse_left_click_status = 0;
+static double mouse_left_click_last_x, mouse_left_click_last_y;
+if (event.button.button == SDL_BUTTON_LEFT) {
+if (mouse_left_click_status == 1 && av_gettime_relative() - 
cursor_last_shown <= 50
+&& fabs(event.button.x - mouse_left_click_last_x) <= 1 && 
fabs(event.button.y - mouse_left_click_last_y) <= 1) {
+toggle_full_screen(cur_stream);
+cur_stream->force_refresh = 1;
+mouse_left_click_status = 0;
+} else {
+mouse_left_click_status = 1;
+mouse_left_click_last_x = event.button.x;
+mouse_left_click_last_y = event.button.y;
+}
+} else {
+mouse_left_click_status = 0;
+}
+}


I don't think we need the complex stuff about not clicking too far out of 
the first click, what are the chances of a fast moving mouse with double 
clicking? Slim to none I guess. Are you aware of a case when this matters?


I think it is enough if you just store the timestamp of the last left 
click in an int64_t and check the time difference next time the user do a 
left click, this way you can detect double clicking with a single variable 
and you don't have to use cursor_last_shown which is updated on every 
motion as well.


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


[FFmpeg-devel] [PATCH] lavf/img2dec: change the default pattern to none

2016-01-16 Thread Marton Balint
The current default pattern type, glob_sequence is deprecated for almost 3.5
years, before removing it, we need a new, sensible pattern default. I suggest
"none" which turns off pattern matching, because using the filename as a
pattern can be a security risk exposing other files in the source directory,
and can also cause problems for file names which are patterns by themselves.

Signed-off-by: Marton Balint 
---
 doc/demuxers.texi   |   2 +-
 libavformat/img2dec.c   |   2 +-
 libavformat/seek-test.c |   1 +
 tests/fate-run.sh   |   2 +-
 tests/fate/filter-video.mak | 196 ++--
 tests/fate/utvideo.mak  |   2 +-
 tests/fate/video.mak|   4 +-
 tests/ffserver.conf |   2 +-
 tests/lavf-regression.sh|  18 ++--
 9 files changed, 115 insertions(+), 114 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index fb1e4fb..d544436 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -377,7 +377,7 @@ This pattern type is deprecated in favor of @var{glob} and
 @var{sequence}.
 @end table
 
-Default value is @var{glob_sequence}.
+Default value is @var{none}.
 @item pixel_format
 Set the pixel format of the images to read. If not specified the pixel
 format is guessed from the first image file in the sequence.
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index db4b4b7..258f741 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -557,7 +557,7 @@ const AVOption ff_img_options[] = {
 { "framerate","set the video framerate", 
OFFSET(framerate),AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0,   DEC },
 { "loop", "force loop over input file sequence", OFFSET(loop), 
AV_OPT_TYPE_BOOL,   {.i64 = 0   }, 0, 1,   DEC },
 
-{ "pattern_type", "set pattern type",
OFFSET(pattern_type), AV_OPT_TYPE_INT,{.i64=PT_GLOB_SEQUENCE}, 0,   
INT_MAX, DEC, "pattern_type"},
+{ "pattern_type", "set pattern type",
OFFSET(pattern_type), AV_OPT_TYPE_INT,{.i64=PT_NONE}, 0,   INT_MAX, 
DEC, "pattern_type"},
 { "glob_sequence","select glob/sequence pattern type",   0, 
AV_OPT_TYPE_CONST,  {.i64=PT_GLOB_SEQUENCE}, INT_MIN, INT_MAX, DEC, 
"pattern_type" },
 { "glob", "select glob pattern type",0, 
AV_OPT_TYPE_CONST,  {.i64=PT_GLOB }, INT_MIN, INT_MAX, DEC, 
"pattern_type" },
 { "sequence", "select sequence pattern type",0, 
AV_OPT_TYPE_CONST,  {.i64=PT_SEQUENCE }, INT_MIN, INT_MAX, DEC, 
"pattern_type" },
diff --git a/libavformat/seek-test.c b/libavformat/seek-test.c
index bfd06db..f9de804 100644
--- a/libavformat/seek-test.c
+++ b/libavformat/seek-test.c
@@ -87,6 +87,7 @@ int main(int argc, char **argv)
 
 av_dict_set(&format_opts, "channels", "1", 0);
 av_dict_set(&format_opts, "sample_rate", "22050", 0);
+av_dict_set(&format_opts, "pattern_type", "sequence", 0);
 
 /* initialize libavcodec, and register all codecs and formats */
 av_register_all();
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 16087cb..a353440 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -191,7 +191,7 @@ video_filter(){
 label=${test#filter-}
 raw_src="${target_path}/tests/vsynth1/%02d.pgm"
 printf '%-20s' $label
-ffmpeg $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
+ffmpeg $DEC_OPTS -f image2 -vcodec pgmyuv -pattern_type sequence -i 
$raw_src \
 $FLAGS $ENC_OPTS -vf "$filters" -vcodec rawvideo -frames:v 5 $* -f nut 
md5:
 }
 
diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index 4186996..ae0d228 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -81,23 +81,23 @@ fate-filter-lavd-scalenorm: CMD = framecrc -f lavfi 
-graph_file $(TARGET_PATH)/t
 
 
 FATE_FILTER_VSYNTH-$(CONFIG_BOXBLUR_FILTER) += fate-filter-boxblur
-fate-filter-boxblur: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf boxblur=2:1
+fate-filter-boxblur: CMD = framecrc -c:v pgmyuv -pattern_type sequence -i 
$(SRC) -vf boxblur=2:1
 
 FATE_FILTER_VSYNTH-$(call ALLYES, COLORCHANNELMIXER_FILTER FORMAT_FILTER 
PERMS_FILTER) += fate-filter-colorchannelmixer
-fate-filter-colorchannelmixer: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf 
format=rgb24,perms=random,colorchannelmixer=.31415927:.4:.31415927:0:.27182818:.8:.27182818:0:.2:.6:.2:0
 -flags +bitexact -sws_flags +accurate_rnd+bitexact
+fate-filter-colorchannelmixer: CMD = framecrc -c:v pgmyuv -pattern_type 
sequence -i $(SRC) -vf 
format=rgb24,perms=random,colorchannelmixer=.31415927:.4:.31415927:0:.27182818:.8:.27182818:0:.2:.6:.2:0
 -flags +bitexact -sws_flags +accurate_rnd+bitexact
 
 FATE_FILTER_VSYNTH-$(CONFIG_DRAWBOX_FILTER) += fate-filter-drawbox
-fate-filter-drawbox: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf 
drawbox=224:24:88:72:red@0.5
+fate-filter-drawbox: CMD = framecrc -c:v pgmyuv -pattern_type sequence -i 
$(SRC) -vf drawbox=224:24:88:72:red@0.5
 
 FATE_FILTER_VS

Re: [FFmpeg-devel] [PATCH 1/2] ffplay: Seek only when pressing the right mouse button on the video window.

2016-01-16 Thread Vittorio Gambaletta (VittGam)

Hi,

On 16/01/2016 21:13:14 CET, Marton Balint wrote:

On Fri, 15 Jan 2016, Vittorio Gambaletta (VittGam) wrote:


Seeking by clicking on the video window can be annoying, because
the user might click on it accidentally while eg. trying to get
focus on it, and ffplay seeks instead.

This commit changes that behaviour to seek only when the right
mouse button is used to click and drag on the window.

Signed-off-by: Vittorio Gambaletta 



Looks good, I will apply in a few days if no one steps up against it.

However your patch seem to have some whitespace errors probably caused by your 
mailer, and because of that it does not apply cleanly so you might consider 
sending patches next time as an attachment if your mailer messes something up 
inline.


Thank you for your suggestion, I thought I finally fixed that problem with my 
mailer while in fact I failed again...

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


Re: [FFmpeg-devel] [PATCH 2/2] ffplay: Toggle full screen when double-clicking the video window with the left mouse button.

2016-01-16 Thread Vittorio Gambaletta (VittGam)

Hi,

On 16/01/2016 21:25:00 CET, Marton Balint wrote:

On Fri, 15 Jan 2016, Vittorio Gambaletta (VittGam) wrote:

Now that the seek only happens with the right mouse button, it makes
sense to toggle full screen when double-clicking with the left mouse
button, like other video players do.



I am not against this.


Signed-off-by: Vittorio Gambaletta 

---
 ffplay.c |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/ffplay.c b/ffplay.c
index 2fa7165..582ca39 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3473,6 +3473,24 @@ static void event_loop(VideoState *cur_stream)
 do_exit(cur_stream);
 break;
 }
+{


Whitespace and indentation seems messed up in this patch as well.


+static int mouse_left_click_status = 0;
+static double mouse_left_click_last_x, mouse_left_click_last_y;
+if (event.button.button == SDL_BUTTON_LEFT) {
+if (mouse_left_click_status == 1 && av_gettime_relative() - 
cursor_last_shown <= 50
+&& fabs(event.button.x - mouse_left_click_last_x) <= 1 && 
fabs(event.button.y - mouse_left_click_last_y) <= 1) {
+toggle_full_screen(cur_stream);
+cur_stream->force_refresh = 1;
+mouse_left_click_status = 0;
+} else {
+mouse_left_click_status = 1;
+mouse_left_click_last_x = event.button.x;
+mouse_left_click_last_y = event.button.y;
+}
+} else {
+mouse_left_click_status = 0;
+}
+}


I don't think we need the complex stuff about not clicking too far out of the 
first click, what are the chances of a fast moving mouse with double clicking? 
Slim to none I guess. Are you aware of a case when this matters?


I don't know, I just looked at how the click counter is implemented in SDL2 and 
emulated that behaviour with SDL1. But it can be overkill, yes; in fact VLC 
does not seem to check this.

By the way, VLC doesn't even clear the status/timestamp when clicking another 
button, so maybe that is overkill too.


I think it is enough if you just store the timestamp of the last left click in 
an int64_t and check the time difference next time the user do a left click, 
this way you can detect double clicking with a single variable and you don't 
have to use cursor_last_shown which is updated on every motion as well.


Right, also I didn't think twice about the fact that cursor_last_shown is 
updated on motion too.

Thanks for the suggestions, I will send an updated patch soon.

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


Re: [FFmpeg-devel] [PATCH] lavf/img2dec: change the default pattern to none

2016-01-16 Thread wm4
On Sat, 16 Jan 2016 21:42:48 +0100
Marton Balint  wrote:

> The current default pattern type, glob_sequence is deprecated for almost 3.5
> years, before removing it, we need a new, sensible pattern default. I suggest
> "none" which turns off pattern matching, because using the filename as a
> pattern can be a security risk exposing other files in the source directory,
> and can also cause problems for file names which are patterns by themselves.
> 
> Signed-off-by: Marton Balint 

I'm very much in favor of this, but doesn't it break compatibility big
time?

Also, if we break this, maybe this should be reimplemented as protocol
prefix? So you would use e.g. "ffmpeg -i pattern:%02d.jpg".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 1/2] ffplay: Seek only when pressing the right mouse button on the video window.

2016-01-16 Thread Vittorio Gambaletta (VittGam)
Seeking by clicking on the video window can be annoying, because
the user might click on it accidentally while eg. trying to get
focus on it, and ffplay seeks instead.

This commit changes that behaviour to seek only when the right
mouse button is used to click and drag on the window.

Signed-off-by: Vittorio Gambaletta 

---
 ffplay.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index d2e3dc6..2fa7165 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3480,9 +3480,11 @@ static void event_loop(VideoState *cur_stream)
 }
 cursor_last_shown = av_gettime_relative();
 if (event.type == SDL_MOUSEBUTTONDOWN) {
+if (event.button.button != SDL_BUTTON_RIGHT)
+break;
 x = event.button.x;
 } else {
-if (event.motion.state != SDL_PRESSED)
+if (!(event.motion.state & SDL_BUTTON_RMASK))
 break;
 x = event.motion.x;
 }
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 2/2] ffplay: Toggle full screen when double-clicking the video window with the left mouse button.

2016-01-16 Thread Vittorio Gambaletta (VittGam)
Now that the seek only happens with the right mouse button, it makes
sense to toggle full screen when double-clicking with the left mouse
button, like other video players do.

Signed-off-by: Vittorio Gambaletta 

---
 ffplay.c |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/ffplay.c b/ffplay.c
index 2fa7165..5b473e9 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3473,6 +3473,16 @@ static void event_loop(VideoState *cur_stream)
 do_exit(cur_stream);
 break;
 }
+if (event.button.button == SDL_BUTTON_LEFT) {
+static int64_t last_mouse_left_click = 0;
+if (av_gettime_relative() - last_mouse_left_click <= 50) {
+toggle_full_screen(cur_stream);
+cur_stream->force_refresh = 1;
+last_mouse_left_click = 0;
+} else {
+last_mouse_left_click = av_gettime_relative();
+}
+}
 case SDL_MOUSEMOTION:
 if (cursor_hidden) {
 SDL_ShowCursor(1);
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 1/2] ffplay: Seek only when pressing the right mouse button on the video window.

2016-01-16 Thread Vittorio Gambaletta (VittGam)

Hi,

It seems to me that whitespace was right on my end in the other
patches...

This time I've literally piped the mails to my mailserver using
netcat, like I always do with OpenWrt patches anyway, so please
check if I'm still getting something wrong with whitespace now.

Thank you,
Vittorio

On 16/01/2016 22:41:30 CET, Vittorio Gambaletta (VittGam) wrote:

Seeking by clicking on the video window can be annoying, because
the user might click on it accidentally while eg. trying to get
focus on it, and ffplay seeks instead.

This commit changes that behaviour to seek only when the right
mouse button is used to click and drag on the window.

Signed-off-by: Vittorio Gambaletta 

---
 ffplay.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index d2e3dc6..2fa7165 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3480,9 +3480,11 @@ static void event_loop(VideoState *cur_stream)
 }
 cursor_last_shown = av_gettime_relative();
 if (event.type == SDL_MOUSEBUTTONDOWN) {
+if (event.button.button != SDL_BUTTON_RIGHT)
+break;
 x = event.button.x;
 } else {
-if (event.motion.state != SDL_PRESSED)
+if (!(event.motion.state & SDL_BUTTON_RMASK))
 break;
 x = event.motion.x;
 }
___
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 1/2] x86/fixed_dsp: add ff_butterflies_fixed_sse2

2016-01-16 Thread Paul B Mahol
On 1/16/16, James Almer  wrote:
> Signed-off-by: James Almer 
> ---
>  libavutil/fixed_dsp.c  |  3 +++
>  libavutil/fixed_dsp.h  |  2 ++
>  libavutil/x86/Makefile |  2 ++
>  libavutil/x86/fixed_dsp.asm| 48
> ++
>  libavutil/x86/fixed_dsp_init.c | 35 ++
>  5 files changed, 90 insertions(+)
>  create mode 100644 libavutil/x86/fixed_dsp.asm
>  create mode 100644 libavutil/x86/fixed_dsp_init.c
>

looks ok, assuming its bitexact with c
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] x86/fixed_dsp: add ff_butterflies_fixed_sse2

2016-01-16 Thread James Almer
On 1/16/2016 8:55 PM, Paul B Mahol wrote:
> On 1/16/16, James Almer  wrote:
>> Signed-off-by: James Almer 
>> ---
>>  libavutil/fixed_dsp.c  |  3 +++
>>  libavutil/fixed_dsp.h  |  2 ++
>>  libavutil/x86/Makefile |  2 ++
>>  libavutil/x86/fixed_dsp.asm| 48
>> ++
>>  libavutil/x86/fixed_dsp_init.c | 35 ++
>>  5 files changed, 90 insertions(+)
>>  create mode 100644 libavutil/x86/fixed_dsp.asm
>>  create mode 100644 libavutil/x86/fixed_dsp_init.c
>>
> 
> looks ok, assuming its bitexact with c

It is. You can check it with the second patch (that i'm not going to commit
since i need to make it a checkasm test instead).

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


[FFmpeg-devel] [PATCH] libavutil: add mastering display metadata sidedata

2016-01-16 Thread Neil Birkbeck
Adding mastering display metadata struct to avutil. The mastering display 
metadata contains information 
about the mastering display color volume (SMPTE 2086:2014). 

This info comes from HEVC in the SEI_TYPE_MASTERING_DISPLAY_INFO and is soon to 
be included in MKV:
https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&index=sZyfPTM-QY69P-0omfOIiTN622o
so it is similar to SEI FPA / stereo_mode in MKV and as such this patch follows 
how AVStereo3D is implemented.

I'll add support to HEVC in a follow-up (and MKV when spec is approved).

Signed-off-by: Neil Birkbeck 
---
 libavutil/Makefile |  2 +
 libavutil/frame.h  |  7 ++-
 libavutil/mastering_display_metadata.c | 43 +
 libavutil/mastering_display_metadata.h | 87 ++
 libavutil/version.h|  2 +-
 5 files changed, 139 insertions(+), 2 deletions(-)
 create mode 100644 libavutil/mastering_display_metadata.c
 create mode 100644 libavutil/mastering_display_metadata.h

diff --git a/libavutil/Makefile b/libavutil/Makefile
index bf8c713..65b2d25 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -38,6 +38,7 @@ HEADERS = adler32.h   
  \
   log.h \
   macros.h  \
   mathematics.h \
+  mastering_display_metadata.h  \
   md5.h \
   mem.h \
   motion_vector.h   \
@@ -115,6 +116,7 @@ OBJS = adler32.o
\
log.o\
log2_tab.o   \
mathematics.o\
+   mastering_display_metadata.o \
md5.o\
mem.o\
murmur3.o\
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 9c6061a..308355b 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -106,12 +106,17 @@ enum AVFrameSideDataType {
  * @endcode
  */
 AV_FRAME_DATA_SKIP_SAMPLES,
-
 /**
  * This side data must be associated with an audio frame and corresponds to
  * enum AVAudioServiceType defined in avcodec.h.
  */
 AV_FRAME_DATA_AUDIO_SERVICE_TYPE,
+/**
+ * Mastering display metadata associated with a video frame. The payload is
+ * an AVMasteringDisplayMetadata type and contains information about the
+ * mastering display color volume.
+ */
+AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
 };
 
 enum AVActiveFormatDescription {
diff --git a/libavutil/mastering_display_metadata.c 
b/libavutil/mastering_display_metadata.c
new file mode 100644
index 000..f7114f6
--- /dev/null
+++ b/libavutil/mastering_display_metadata.c
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2016 Neil Birkbeck 
+ *
+ * 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 
+#include 
+
+#include "mastering_display_metadata.h"
+#include "mem.h"
+
+AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void)
+{
+return av_mallocz(sizeof(AVMasteringDisplayMetadata));
+}
+
+AVMasteringDisplayMetadata 
*av_mastering_display_metadata_create_side_data(AVFrame *frame)
+{
+AVFrameSideData *side_data = av_frame_new_side_data(frame,
+
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA,
+
sizeof(AVMasteringDisplayMetadata));
+if (!side_data)
+return NULL;
+
+memset(side_data->data, 0, sizeof(AVMasteringDisplayMetadata));
+
+return (AVMasteringDisplayMetadata *)side_data->data;
+}
diff --git a/libavutil/mastering_display_metadata.

Re: [FFmpeg-devel] [PATCH 1/4] fate: add 10-bit v210 encoder tests

2016-01-16 Thread James Darnley
On 2016-01-15 20:07, James Darnley wrote:
> ...

If nobody has further comments about the patches I will probably push
these after I wake up.



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


[FFmpeg-devel] [PATCH] remove the deprecated avpicture_get_size() function

2016-01-16 Thread Eddie Hao
---
 libavcodec/libutvideodec.cpp | 3 ++-
 libavcodec/libutvideoenc.cpp | 3 ++-
 libavdevice/decklink_dec.cpp | 2 +-
 libavdevice/lavfi.c  | 3 ++-
 libavformat/frmdec.c | 3 ++-
 5 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp
index 47261a6..7c60f4f 100644
--- a/libavcodec/libutvideodec.cpp
+++ b/libavcodec/libutvideodec.cpp
@@ -27,6 +27,7 @@
 
 extern "C" {
 #include "avcodec.h"
+#include "libavutil/imgutils.h"
 }
 
 #include "libutvideo.h"
@@ -93,7 +94,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
 }
 
 /* Only allocate the buffer once */
-utv->buf_size = avpicture_get_size(avctx->pix_fmt, avctx->width, 
avctx->height);
+utv->buf_size = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, 
avctx->height, 1);
 #ifdef UTVF_UQY2
 if (format == UTVF_v210)
 utv->buf_size += avctx->height * ((avctx->width + 47) / 48) * 128; // 
the linesize used by the decoder, this does not seem to be exported
diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp
index 8746247..96d8fe1 100644
--- a/libavcodec/libutvideoenc.cpp
+++ b/libavcodec/libutvideoenc.cpp
@@ -27,6 +27,7 @@
 
 extern "C" {
 #include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "internal.h"
 }
@@ -94,7 +95,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
  * We use this buffer to hold the data that Ut Video returns,
  * since we cannot decode planes separately with it.
  */
-ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
+ret = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, 
avctx->height, 1);
 if (ret < 0) {
 av_free(info);
 return ret;
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 89f93de..6c5bc5d 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -473,7 +473,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
 
 st->codec->time_base.den  = ctx->bmd_tb_den;
 st->codec->time_base.num  = ctx->bmd_tb_num;
-st->codec->bit_rate= avpicture_get_size(st->codec->pix_fmt, 
ctx->bmd_width, ctx->bmd_height) * 1/av_q2d(st->codec->time_base) * 8;
+st->codec->bit_rate= av_image_get_buffer_size(st->codec->pix_fmt, 
ctx->bmd_width, ctx->bmd_height, 1) * 1/av_q2d(st->codec->time_base) * 8;
 
 if (cctx->v210) {
 st->codec->codec_id= AV_CODEC_ID_V210;
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 3453b4d..077879e 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -30,6 +30,7 @@
 #include "libavutil/bprint.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/file.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/internal.h"
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
@@ -430,7 +431,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, 
AVPacket *pkt)
 stream_idx = lavfi->sink_stream_map[min_pts_sink_idx];
 
 if (frame->width /* FIXME best way of testing a video */) {
-size = avpicture_get_size(frame->format, frame->width, frame->height);
+size = av_image_get_buffer_size(frame->format, frame->width, 
frame->height, 1);
 if ((ret = av_new_packet(pkt, size)) < 0)
 return ret;
 
diff --git a/libavformat/frmdec.c b/libavformat/frmdec.c
index a6f19af..260afbc 100644
--- a/libavformat/frmdec.c
+++ b/libavformat/frmdec.c
@@ -25,6 +25,7 @@
  */
 
 #include "libavcodec/raw.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
 
@@ -80,7 +81,7 @@ static int frm_read_packet(AVFormatContext *avctx, AVPacket 
*pkt)
 if (s->count)
 return AVERROR_EOF;
 
-packet_size = avpicture_get_size(stc->pix_fmt, stc->width, stc->height);
+packet_size = av_image_get_buffer_size(stc->pix_fmt, stc->width, 
stc->height, 1);
 if (packet_size < 0)
 return AVERROR_INVALIDDATA;
 
-- 
2.5.0

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