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

2015-03-13 Thread Claudio Freire
On Tue, Mar 10, 2015 at 10:08 AM, Claudio Freire  wrote:
> On Tue, Mar 10, 2015 at 8:05 AM, Michael Niedermayer  wrote:
>>> I cannot test myself yet (cannot build against mips, it will
>>> probably take me a long while before I can set up qemu for that), but
>>> the patch should bring both implementations in sync, at least enough
>>> for the test to pass without the -b:a 88k
>>
>> if you use a debian based distro then the packages from
>> http://www.emdebian.org/
>> can probably be used to cross compile to mips
>> (you might need to force some versions manually during install, at
>>  least in the past the binary packages referred to many non existing
>>  package versions so only some versions of the packages had all
>>  dependancies available)
>
> I don't have any debian or its derivatives at hand sadly. I may
> unearth an old laptop that had some form of ubuntu at some point, it's
> old and slow but that shouldn't be a problem for this sort of thing,
> but that will have to wait until next week.
>
> In the meantime I'm trying to make cross-mips-linux-gcc work on
> openSuse without much luck yet.


I got lucky and was able to cross-build in openSUSE.

Just in case others also use openSUSE, I put the instructions on the
wiki (I hadn't found any, if there are, I'll welcome pointers and I'll
merge them): http://trac.ffmpeg.org/wiki/CompilationGuide/MIPS

I confirmed that the previous patch does fix the test on mips.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] ismindex and multiple audio streams

2015-03-13 Thread Martin Bene
Hi,

at the moment the ismindex program included in the ffmpeg tools folder supports 
multiple audio streams only as separate quality levels; there is another use 
that isn't supported however: generating alternative audio streams, for example 
for streams in multiple languages.

I'm wondering how to add this functionality to ismindex without breaking the 
current behavior.

* Add a command line switch to select quality level vs. alternate audio?

o   What about a use case where each language would be available in multiple 
audio qualities - how could that be specified?

* Check the bit rate of audio streams and treat multiple streams with 
(aprox.) identical bitrate as alternate streams?

When encoding  audio streams using ffmpeg, the streams end up with slightly 
different bitrate declarations (see below) - would it make sense to round these 
to the nearest 1000 for output to the ism/ismc files (another ism indexer 
(mp4split) seems to do this)?

I've also added the ability to use the language attribute of the input audio 
streams to extend the generated .ism and .ismc files; will have to make sure to 
avoid duplicate names for the quality level case.

.ism fragment with added language attributes:
   
   
   
   
   
   
   
   

.ismc for alternate audio:

   
   
   
   


   
   
   


I'd like to end up with a patch that I can  contribute to the ffmpeg project.

Thanks for any hints on how best to proceed.


[http://transfer.icomedias.com/icomedias-email-banner/icomedias-HYBRID-FORMS.png]Sofort
 digital. Kein Papier!

Vorteil: Ihre Anwender gewinnen mehr Zeit f?r die wesentlichen Aufgaben
durch mobile Formulare und Datenerfassung vor Ort mit vollst?ndig digitalem 
Workflow.

Nutzen Sie die Kombination aus SharePoint Server und Windows 8 Client App f?r 
die online + offline Datenerfassung. Mit Formular-Workflow sind die Daten schon 
w?hrend der Eingabe in Ihren Backend-Anwendungen. Sicher mit den Standards 
HTML5, XML, Adobe PDF und Microsoft SQL Server f?r den Datenaustausch.
Testen Sie die HYBRID.FORMS Version 2.0 mit Musterformularen - jetzt kostenlos 
im Windows Store.
Mehr dazu finden Sie hier: http://go.icomedias.com/hfstore


icomedias.com | icomedias(r) Gruppe | icomedias GmbH | 
Entenplatz 1 | 8020 Graz. FB: LG.ZRS Graz FN 217 305t, UID ATU 5328 0701, 
GF/CEO Christian Ekhart. Disclaimer.icomedias Diese Nachricht ist vertraulich 
und nur f?r den beabsichtigten Empf?nger bestimmt. Sie dr?ckt die pers?nliche 
Meinung des Schreibers aus und ist keine Stellungnahme des jeweiligen 
Unternehmens. F?r dieses kann nur ein Gesch?ftsf?hrer in firmenm??iger 
Zeichnung mit Unterschrift in Schriftform rechtsverbindlich sprechen. Eine 
m?gliche digitale Signatur der Nachricht dient nur der Sicherstellung der 
Unversehrtheit, ordnet aber weder Unternehmen noch Personen zu und stellt keine 
Unterschrift dar. Irrtum und Fehler sind vorbehalten.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Do not list mov codecs in riff.c

2015-03-13 Thread Carl Eugen Hoyos
Michael Niedermayer  gmx.at> writes:

> >  avidec.c |7 +++
> >  riff.c   |3 ---
> >  2 files changed, 7 insertions(+), 3 deletions(-)
> > 7c301d00fc64be53584b4f6a2f54461bb85447e7  patchproresavi.diff
> > diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> > index 5c9443a..00f0037 100644
> 
> LGTM

Patch applied.

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH]Do not list mov codecs in riff.c

2015-03-13 Thread wm4
On Fri, 13 Mar 2015 02:46:32 +0100
Carl Eugen Hoyos  wrote:

> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> index 5c9443a..00f0037 100644
> --- a/libavformat/avidec.c
> +++ b/libavformat/avidec.c
> @@ -36,6 +36,7 @@
>  #include "riff.h"
>  #include "libavcodec/bytestream.h"
>  #include "libavcodec/exif.h"
> +#include "libavformat/isom.h"
>  
>  typedef struct AVIStream {
>  int64_t frame_offset;   /* current frame (video) or byte (audio) counter
> @@ -773,6 +774,12 @@ static int avi_read_header(AVFormatContext *s)
>  st->codec->codec_tag  = tag1;
>  st->codec->codec_id   = 
> ff_codec_get_id(ff_codec_bmp_tags,
>  tag1);
> +if (!st->codec->codec_id) {
> +st->codec->codec_id = 
> ff_codec_get_id(ff_codec_movvideo_tags,
> +  tag1);
> +if (st->codec->codec_id)
> +   av_log(s, AV_LOG_WARNING, "mov tag found in 
> avi\n");
> +}

Nice warning, but why do we accept this in the first place? This looks
so very wrong.

>  /* This is needed to get the pict type which is necessary
>   * for generating correct pts. */
>  st->need_parsing = AVSTREAM_PARSE_HEADERS;
> diff --git a/libavformat/riff.c b/libavformat/riff.c
> index 399523c..696b06b 100644
> --- a/libavformat/riff.c
> +++ b/libavformat/riff.c
> @@ -362,9 +362,6 @@ const AVCodecTag ff_codec_bmp_tags[] = {
>  { AV_CODEC_ID_G2M,  MKTAG('G', '2', 'M', '4') },
>  { AV_CODEC_ID_G2M,  MKTAG('G', '2', 'M', '5') },
>  { AV_CODEC_ID_FIC,  MKTAG('F', 'I', 'C', 'V') },
> -{ AV_CODEC_ID_PRORES,   MKTAG('A', 'P', 'C', 'N') },
> -{ AV_CODEC_ID_PRORES,   MKTAG('A', 'P', 'C', 'H') },
> -{ AV_CODEC_ID_QTRLE,MKTAG('r', 'l', 'e', ' ') },
>  { AV_CODEC_ID_HQX,  MKTAG('C', 'H', 'Q', 'X') },
>  { AV_CODEC_ID_NONE, 0 }
>  };

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


Re: [FFmpeg-devel] [PATCH]Do not list mov codecs in riff.c

2015-03-13 Thread Carl Eugen Hoyos
wm4  googlemail.com> writes:

> > +if (!st->codec->codec_id) {
> > +st->codec->codec_id = ff_codec_get_id(ff_codec_movvideo_tags,
> > +  tag1);
> > +if (st->codec->codec_id)
> > +av_log(s, AV_LOG_WARNING, "mov tag found in avi\n");
> > +}
> 
> Nice warning, but why do we accept this in 
> the first place? This looks so very wrong.

I don't understand:
You mean we should change (patch) FFmpeg so 
that it only accepts valid files in the 
future? This is a major task imo given that 
we spent so much time supporting even the 
most broken streams (see ts without PMT / 
PAT).
And how do you define valid? Nowadays, WMP 
plays many files that do not conform to 
standards (including some that FFmpeg 
refuses to decode). I believe FFmpeg should 
not be more strict by default than WMP (or 
QT).

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] libavformat/mxfdec: export user comments metadata

2015-03-13 Thread Tomas Härdin
On Fri, 2015-03-06 at 13:24 -0800, Mark Reid wrote:
> +static int mxf_read_indirect_value(void *arg, AVIOContext *pb, int size)
> +{
> +MXFTaggedValue *tagged_value = arg;
> +uint8_t key[17];
> +
> +if (size <= 17)
> +return 0;
> +
> +avio_read(pb, key, 17);

Really Avid, 17 byte keys? OK..

> +/* TODO: handle other types of of indirect values */
> +if (memcmp(key, mxf_indirect_value_utf16le, 17) == 0) {
> +return mxf_read_utf16le_string(pb, size - 17, &tagged_value->value);
> +} else if (memcmp(key, mxf_indirect_value_utf16be, 17) == 0) {
> +return mxf_read_utf16be_string(pb, size - 17, &tagged_value->value);
> +}
> +return 0;
> +}

> +static int mxf_parse_package_comments(MXFContext *mxf, AVDictionary **pm, 
> MXFPackage *package)
> +{
> +MXFTaggedValue *tag;
> +int size, i;
> +const char *prefix = "comment_";
> +char *key = NULL;
> +
> +for (i = 0; i < package->comment_count; i++) {
> +tag = mxf_resolve_strong_ref(mxf, &package->comment_refs[i], 
> TaggedValue);
> +if (!tag || !tag->name || !tag->value)
> +continue;
> +
> +size = strlen(prefix) + strlen(tag->name) + 1;
> +key = av_mallocz(size);
> +if (!key)
> +return AVERROR(ENOMEM);
> +
> +strcpy(key, prefix);
> +strlcat(key, tag->name, size);

snprintf() would make this one line only, or use av_strlcat() like
Michael suggests. Come to think of it, I'm not sure snprintf() exists on
all platforms..

> +av_dict_set(pm, key, tag->value, AV_DICT_DONT_STRDUP_KEY);
> +}
> +return 0;
> +}

Looks good overall, even if I wasn't aware of this Avid feature before.

/Tomas


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


Re: [FFmpeg-devel] [PATCH] mxfenc: ensure mxf->body_partition_offset is not NULL before using it

2015-03-13 Thread Tomas Härdin
On Thu, 2015-03-12 at 17:48 +0100, Andreas Cadhalpun wrote:
> This fixes a crash, when trying to mux h264 into mxf_opatom.
> 
> Signed-off-by: Andreas Cadhalpun 
> ---
>  libavformat/mxfenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index 898951c..2891f5d 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -2358,7 +2358,7 @@ static int mxf_write_footer(AVFormatContext *s)
>  mxf_write_random_index_pack(s);
> 
>  if (s->pb->seekable) {
> -if (s->oformat == &ff_mxf_opatom_muxer){
> +if (s->oformat == &ff_mxf_opatom_muxer && 
> mxf->body_partition_offset){
>  /* rewrite body partition to update lengths */
>  avio_seek(pb, mxf->body_partition_offset[0], SEEK_SET);
>  if ((err = mxf_write_opatom_body_partition(s)) < 0)

Doesn't this need to happen for H.264 as well? A better solution would
be to figure out why mxf->body_partition_offset becomes NULL so that
index tables and such can be rewritten properly.

/Tomas



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


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

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 04:42:36AM -0300, Claudio Freire wrote:
> On Tue, Mar 10, 2015 at 10:08 AM, Claudio Freire  
> wrote:
> > On Tue, Mar 10, 2015 at 8:05 AM, Michael Niedermayer  
> > wrote:
> >>> I cannot test myself yet (cannot build against mips, it will
> >>> probably take me a long while before I can set up qemu for that), but
> >>> the patch should bring both implementations in sync, at least enough
> >>> for the test to pass without the -b:a 88k
> >>
> >> if you use a debian based distro then the packages from
> >> http://www.emdebian.org/
> >> can probably be used to cross compile to mips
> >> (you might need to force some versions manually during install, at
> >>  least in the past the binary packages referred to many non existing
> >>  package versions so only some versions of the packages had all
> >>  dependancies available)
> >
> > I don't have any debian or its derivatives at hand sadly. I may
> > unearth an old laptop that had some form of ubuntu at some point, it's
> > old and slow but that shouldn't be a problem for this sort of thing,
> > but that will have to wait until next week.
> >
> > In the meantime I'm trying to make cross-mips-linux-gcc work on
> > openSuse without much luck yet.
> 
> 
> I got lucky and was able to cross-build in openSUSE.
> 
> Just in case others also use openSUSE, I put the instructions on the
> wiki (I hadn't found any, if there are, I'll welcome pointers and I'll
> merge them): http://trac.ffmpeg.org/wiki/CompilationGuide/MIPS
> 

> I confirmed that the previous patch does fix the test on mips.

i tried again:

43a1cc5 Add AAC tests for 7350hz sampling rates and M/S
 tests/fate/aac.mak |   29 +
 1 file changed, 29 insertions(+)
c5e02b1 AAC: [PATCH] AAC: Add support for 7350Hz sampling rates
 libavcodec/mips/aaccoder_mips.c |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

i tried 2 qemu versions, i tried with and without
--disable-mipsdspr1 --disable-mipsdspr2 --disable-mipsfpu

but i still get this

stddev:  443.22 PSNR: 43.40 MAXDIFF: 5038 bytes:   176400/   180224
stddev: |443.22 - 414| >= 5
Test aac-s7350-encode failed. Look at tests/data/fate/aac-s7350-encode.err for 
details.

mips-linux-gnu-gcc-4.4 (Debian 4.4.5-8) 4.4.5

btw, i use the qemu from https://github.com/ssvb/QEMU.git
for mips as it at least years ago supported more extensions, i
would have guessed these where merged into main qemu but as you list
all the disables in the wiki, maybe i was guessing wrong

can you repost the patchset that works for you ?
so to make double sure we use the same code

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


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


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

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 12:30:30PM +0100, Michael Niedermayer wrote:
> On Fri, Mar 13, 2015 at 04:42:36AM -0300, Claudio Freire wrote:
> > On Tue, Mar 10, 2015 at 10:08 AM, Claudio Freire  
> > wrote:
> > > On Tue, Mar 10, 2015 at 8:05 AM, Michael Niedermayer  
> > > wrote:
> > >>> I cannot test myself yet (cannot build against mips, it will
> > >>> probably take me a long while before I can set up qemu for that), but
> > >>> the patch should bring both implementations in sync, at least enough
> > >>> for the test to pass without the -b:a 88k
> > >>
> > >> if you use a debian based distro then the packages from
> > >> http://www.emdebian.org/
> > >> can probably be used to cross compile to mips
> > >> (you might need to force some versions manually during install, at
> > >>  least in the past the binary packages referred to many non existing
> > >>  package versions so only some versions of the packages had all
> > >>  dependancies available)
> > >
> > > I don't have any debian or its derivatives at hand sadly. I may
> > > unearth an old laptop that had some form of ubuntu at some point, it's
> > > old and slow but that shouldn't be a problem for this sort of thing,
> > > but that will have to wait until next week.
> > >
> > > In the meantime I'm trying to make cross-mips-linux-gcc work on
> > > openSuse without much luck yet.
> > 
> > 
> > I got lucky and was able to cross-build in openSUSE.
> > 
> > Just in case others also use openSUSE, I put the instructions on the
> > wiki (I hadn't found any, if there are, I'll welcome pointers and I'll
> > merge them): http://trac.ffmpeg.org/wiki/CompilationGuide/MIPS
> > 
> 
> > I confirmed that the previous patch does fix the test on mips.
> 
> i tried again:
> 
> 43a1cc5 Add AAC tests for 7350hz sampling rates and M/S
>  tests/fate/aac.mak |   29 +
>  1 file changed, 29 insertions(+)
> c5e02b1 AAC: [PATCH] AAC: Add support for 7350Hz sampling rates
>  libavcodec/mips/aaccoder_mips.c |   26 +-
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> i tried 2 qemu versions, i tried with and without
> --disable-mipsdspr1 --disable-mipsdspr2 --disable-mipsfpu
> 
> but i still get this
> 
> stddev:  443.22 PSNR: 43.40 MAXDIFF: 5038 bytes:   176400/   180224
> stddev: |443.22 - 414| >= 5
> Test aac-s7350-encode failed. Look at tests/data/fate/aac-s7350-encode.err 
> for details.
> 
> mips-linux-gnu-gcc-4.4 (Debian 4.4.5-8) 4.4.5
> 
> btw, i use the qemu from https://github.com/ssvb/QEMU.git
> for mips as it at least years ago supported more extensions, i
> would have guessed these where merged into main qemu but as you list
> all the disables in the wiki, maybe i was guessing wrong
> 
> can you repost the patchset that works for you ?
> so to make double sure we use the same code

tried with --disable-optimizations and --arch=generic
so that define ARCH_MIPS 0
it still fails the same way with mips-linux-gnu-gcc-4.4

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


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

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 12:36:58PM +0100, Michael Niedermayer wrote:
> On Fri, Mar 13, 2015 at 12:30:30PM +0100, Michael Niedermayer wrote:
> > On Fri, Mar 13, 2015 at 04:42:36AM -0300, Claudio Freire wrote:
> > > On Tue, Mar 10, 2015 at 10:08 AM, Claudio Freire  
> > > wrote:
> > > > On Tue, Mar 10, 2015 at 8:05 AM, Michael Niedermayer  
> > > > wrote:
> > > >>> I cannot test myself yet (cannot build against mips, it will
> > > >>> probably take me a long while before I can set up qemu for that), but
> > > >>> the patch should bring both implementations in sync, at least enough
> > > >>> for the test to pass without the -b:a 88k
> > > >>
> > > >> if you use a debian based distro then the packages from
> > > >> http://www.emdebian.org/
> > > >> can probably be used to cross compile to mips
> > > >> (you might need to force some versions manually during install, at
> > > >>  least in the past the binary packages referred to many non existing
> > > >>  package versions so only some versions of the packages had all
> > > >>  dependancies available)
> > > >
> > > > I don't have any debian or its derivatives at hand sadly. I may
> > > > unearth an old laptop that had some form of ubuntu at some point, it's
> > > > old and slow but that shouldn't be a problem for this sort of thing,
> > > > but that will have to wait until next week.
> > > >
> > > > In the meantime I'm trying to make cross-mips-linux-gcc work on
> > > > openSuse without much luck yet.
> > > 
> > > 
> > > I got lucky and was able to cross-build in openSUSE.
> > > 
> > > Just in case others also use openSUSE, I put the instructions on the
> > > wiki (I hadn't found any, if there are, I'll welcome pointers and I'll
> > > merge them): http://trac.ffmpeg.org/wiki/CompilationGuide/MIPS
> > > 
> > 
> > > I confirmed that the previous patch does fix the test on mips.
> > 
> > i tried again:
> > 
> > 43a1cc5 Add AAC tests for 7350hz sampling rates and M/S
> >  tests/fate/aac.mak |   29 +
> >  1 file changed, 29 insertions(+)
> > c5e02b1 AAC: [PATCH] AAC: Add support for 7350Hz sampling rates
> >  libavcodec/mips/aaccoder_mips.c |   26 +-
> >  1 file changed, 13 insertions(+), 13 deletions(-)
> > 
> > i tried 2 qemu versions, i tried with and without
> > --disable-mipsdspr1 --disable-mipsdspr2 --disable-mipsfpu
> > 
> > but i still get this
> > 
> > stddev:  443.22 PSNR: 43.40 MAXDIFF: 5038 bytes:   176400/   180224
> > stddev: |443.22 - 414| >= 5
> > Test aac-s7350-encode failed. Look at tests/data/fate/aac-s7350-encode.err 
> > for details.
> > 
> > mips-linux-gnu-gcc-4.4 (Debian 4.4.5-8) 4.4.5
> > 
> > btw, i use the qemu from https://github.com/ssvb/QEMU.git
> > for mips as it at least years ago supported more extensions, i
> > would have guessed these where merged into main qemu but as you list
> > all the disables in the wiki, maybe i was guessing wrong
> > 
> > can you repost the patchset that works for you ?
> > so to make double sure we use the same code
> 
> tried with --disable-optimizations and --arch=generic
> so that define ARCH_MIPS 0
> it still fails the same way with mips-linux-gnu-gcc-4.4

with sh4-linux-gnu-gcc-4.7 (Debian 4.7.2-5) 4.7.2
it fails like this:
stddev:  440.58 PSNR: 43.45 MAXDIFF: 5794 bytes:   176400/   180224
stddev: |440.58 - 414| >= 5

so this is not mips or big endian specific

[...]

-- 
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 2/2] avformat/flvdec: re enable flv_data_packet() and use AVMEDIA_TYPE_SUBTITLE

2015-03-13 Thread Andreas Cadhalpun
On 21.01.2015 00:10, Michael Niedermayer wrote:
> Found-by: kurosu
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/flvdec.c |   15 +--
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index 572268f..f98cb97 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -482,7 +482,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
> *astream,
>   0 <= (int)(num_val * 1024.0))
>  acodec->bit_rate = num_val * 1024.0;
>  else if (!strcmp(key, "datastream")) {
> -AVStream *st = create_stream(s, AVMEDIA_TYPE_DATA);
> +AVStream *st = create_stream(s, AVMEDIA_TYPE_SUBTITLE);
>  if (!st)
>  return AVERROR(ENOMEM);
>  st->codec->codec_id = AV_CODEC_ID_TEXT;
> @@ -749,12 +749,12 @@ static int flv_data_packet(AVFormatContext *s, AVPacket 
> *pkt,
>  
>  for (i = 0; i < s->nb_streams; i++) {
>  st = s->streams[i];
> -if (st->codec->codec_type == AVMEDIA_TYPE_DATA)
> +if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE)
>  break;
>  }
>  
>  if (i == s->nb_streams) {
> -st = create_stream(s, AVMEDIA_TYPE_DATA);
> +st = create_stream(s, AVMEDIA_TYPE_SUBTITLE);
>  if (!st)
>  return AVERROR(ENOMEM);
>  st->codec->codec_id = AV_CODEC_ID_TEXT;

The changes above seem to be unrelated to those below, so please split.
Also there are more occurrences of AVMEDIA_TYPE_DATA in flvdec.c.
Why are those not changed as well?

> @@ -830,11 +830,14 @@ static int flv_read_packet(AVFormatContext *s, AVPacket 
> *pkt)
>  goto skip;
>  } else if (type == FLV_TAG_TYPE_META) {
>  stream_type=FLV_STREAM_TYPE_DATA;
> -if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata 
> stuff
> +if (size > 13 + 1 + 4) { // Header-type metadata stuff
> +int type;
>  meta_pos = avio_tell(s->pb);
> -if (flv_read_metabody(s, next) <= 0) {
> +type = flv_read_metabody(s, next);
> +if (type == 0 && dts == 0 || type < 0) {
>  goto skip;
> -}
> +} else if (type == TYPE_ONTEXTDATA)
> +return flv_data_packet(s, pkt, dts, next);
>  avio_seek(s->pb, meta_pos, SEEK_SET);
>  }
>  } else {
> 

The only difference to my attempt to fix this is the handling of dts == 0.
I think it's more correct in this patch, so this part looks good to me.

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mxfenc: ensure mxf->body_partition_offset is not NULL before using it

2015-03-13 Thread Andreas Cadhalpun
On 13.03.2015 11:59, Tomas Härdin wrote:
> On Thu, 2015-03-12 at 17:48 +0100, Andreas Cadhalpun wrote:
>> This fixes a crash, when trying to mux h264 into mxf_opatom.
>>
>> Signed-off-by: Andreas Cadhalpun 
>> ---
>>  libavformat/mxfenc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
>> index 898951c..2891f5d 100644
>> --- a/libavformat/mxfenc.c
>> +++ b/libavformat/mxfenc.c
>> @@ -2358,7 +2358,7 @@ static int mxf_write_footer(AVFormatContext *s)
>>  mxf_write_random_index_pack(s);
>>
>>  if (s->pb->seekable) {
>> -if (s->oformat == &ff_mxf_opatom_muxer){
>> +if (s->oformat == &ff_mxf_opatom_muxer && 
>> mxf->body_partition_offset){
>>  /* rewrite body partition to update lengths */
>>  avio_seek(pb, mxf->body_partition_offset[0], SEEK_SET);
>>  if ((err = mxf_write_opatom_body_partition(s)) < 0)
> 
> Doesn't this need to happen for H.264 as well?

Maybe, but the seek can't work if mxf->body_partition_offset is NULL.
Would it be better to add the check only around the seek?

> A better solution would
> be to figure out why mxf->body_partition_offset becomes NULL so that
> index tables and such can be rewritten properly.

It can always happen that mxf->body_partition_offset is NULL, e.g. if
no memory is left, or if something else fails. Try e.g.:
ffmpeg -f lavfi -i testsrc -c:v libx264 -f mxf_opatom

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Do not list mov codecs in riff.c

2015-03-13 Thread compn
On Fri, 13 Mar 2015 10:11:47 +0100
wm4  wrote:

> Nice warning, but why do we accept this in the first place? This looks
> so very wrong.

suggestions are welcome.

1) refuse all "invalid" files
2) duplicate all riff/isom lists
3) do this instead

maybe people use old software or run into crashes in proprietary
software and sticking mov codecs in avi works around some bug?

in the end people just want it to 'work', and when they get "Could not
find codec parameters for stream 1 (Video: none.." , thats not helping.
especially when we already have a decoder and it uses the same tag.

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


Re: [FFmpeg-devel] [PATCH 2/4] x86: xvid_idct: port MMX IDCT to yasm

2015-03-13 Thread Michael Niedermayer
On Wed, Mar 11, 2015 at 01:06:23PM -0300, James Almer wrote:
> On 11/03/15 11:29 AM, Christophe Gisquet wrote:
> > Hi,
> > 
> > 2015-03-11 15:20 GMT+01:00 Michael Niedermayer :
> >> personally iam in favor of more things being tested, but iam fine
> >> with either
> > 
> > I'll see what the opinions are in ~30H then. It looks to be around
> > 4.5KB more data, which isn't huge, and doesn't cause a noticeable
> > increase in compile time.
> 
> As discussed before, mmx, mmxext and sse functions that have also an sse2 
> version, and 
> 3dnow/3dnowext functions that have also an sse version, have no reason to 
> exist in an 
> x86_64 build.

> They will not be used in any real world scenario.

well it could be usefull in debuging in same cases
especially if all mmx code is disabled on x86_64, for any single
function its not too likely

consider this hypothetical scenario, theres a bug
testing reveals it is reproduceable
testing with cpuflags 0 shows its likely in the ASM
testing with cpuflags mmxext shows it works
testing with cpuflags sse2 shows it fails limiting this down to sse2
specific code

vs.
testing reveals it is reproduceable
testing with cpuflags 0 shows its likely in the ASM
rebuilding for x86_32
testing with cpuflags mmxext shows it works
testing with cpuflags sse2 shows it works
testing with cpuflags all shows it works
we realize the bug is not reproduceable on x86_32
rebuilding for x86_64
the bug now can be in any asm code


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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


Re: [FFmpeg-devel] [PATCH] Add ability to pause transcoding via keyboard interaction

2015-03-13 Thread Jeremy Luce
It's been a couple days, so I wanted to follow up. Would someone mind
providing some feedback on this? Thanks!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avformat/flvdec: re enable flv_data_packet() and use AVMEDIA_TYPE_SUBTITLE

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 01:49:39PM +0100, Andreas Cadhalpun wrote:
> On 21.01.2015 00:10, Michael Niedermayer wrote:
> > Found-by: kurosu
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/flvdec.c |   15 +--
> >  1 file changed, 9 insertions(+), 6 deletions(-)
> > 
> > diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> > index 572268f..f98cb97 100644
> > --- a/libavformat/flvdec.c
> > +++ b/libavformat/flvdec.c
> > @@ -482,7 +482,7 @@ static int amf_parse_object(AVFormatContext *s, 
> > AVStream *astream,
> >   0 <= (int)(num_val * 1024.0))
> >  acodec->bit_rate = num_val * 1024.0;
> >  else if (!strcmp(key, "datastream")) {
> > -AVStream *st = create_stream(s, AVMEDIA_TYPE_DATA);
> > +AVStream *st = create_stream(s, AVMEDIA_TYPE_SUBTITLE);
> >  if (!st)
> >  return AVERROR(ENOMEM);
> >  st->codec->codec_id = AV_CODEC_ID_TEXT;
> > @@ -749,12 +749,12 @@ static int flv_data_packet(AVFormatContext *s, 
> > AVPacket *pkt,
> >  
> >  for (i = 0; i < s->nb_streams; i++) {
> >  st = s->streams[i];
> > -if (st->codec->codec_type == AVMEDIA_TYPE_DATA)
> > +if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE)
> >  break;
> >  }
> >  
> >  if (i == s->nb_streams) {
> > -st = create_stream(s, AVMEDIA_TYPE_DATA);
> > +st = create_stream(s, AVMEDIA_TYPE_SUBTITLE);
> >  if (!st)
> >  return AVERROR(ENOMEM);
> >  st->codec->codec_id = AV_CODEC_ID_TEXT;
> 
> The changes above seem to be unrelated to those below, so please split.
> Also there are more occurrences of AVMEDIA_TYPE_DATA in flvdec.c.
> Why are those not changed as well?

a lack of testcases, but i just found some files that trigger subsets
of the code. Ill add avpriv_request_sample() where i lack testcases
and update the other AVMEDIA_TYPE_DATA


> 
> > @@ -830,11 +830,14 @@ static int flv_read_packet(AVFormatContext *s, 
> > AVPacket *pkt)
> >  goto skip;
> >  } else if (type == FLV_TAG_TYPE_META) {
> >  stream_type=FLV_STREAM_TYPE_DATA;
> > -if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata 
> > stuff
> > +if (size > 13 + 1 + 4) { // Header-type metadata stuff
> > +int type;
> >  meta_pos = avio_tell(s->pb);
> > -if (flv_read_metabody(s, next) <= 0) {
> > +type = flv_read_metabody(s, next);
> > +if (type == 0 && dts == 0 || type < 0) {
> >  goto skip;
> > -}
> > +} else if (type == TYPE_ONTEXTDATA)
> > +return flv_data_packet(s, pkt, dts, next);
> >  avio_seek(s->pb, meta_pos, SEEK_SET);
> >  }
> >  } else {
> > 
> 
> The only difference to my attempt to fix this is the handling of dts == 0.
> I think it's more correct in this patch, so this part looks good to me.

ok, will split,
test as far as i can with the samples i have
and apply

thanks

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

No snowflake in an avalanche ever feels responsible. -- Voltaire


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


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

2015-03-13 Thread Nedeljko Babic
> btw, i use the qemu from https://github.com/ssvb/QEMU.git
> for mips as it at least years ago supported more extensions, i
> would have guessed these where merged into main qemu but as you list
> all the disables in the wiki, maybe i was guessing wrong

I can confirm that main qemu supports both fpu and dspr1/dspr2 extension.
Appropriate cpu model needs to be selected in order for the extension to be 
available.
74Kf supports all extensions, so adding "-cpu 74Kf" in "--target-exec" should 
enable fpu, dspr1 and dspr2 extensions.

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


Re: [FFmpeg-devel] [PATCH] Add ability to pause transcoding via keyboard interaction

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 08:34:48AM -0500, Jeremy Luce wrote:
> It's been a couple days, so I wanted to follow up. Would someone mind
> providing some feedback on this? Thanks!

what is the advantage of this compared to simply stoping the process?
like by hiting ctrl-z ?

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


[FFmpeg-devel] [PATCH] lavfi/eq: factorize code in process_command through a macro

2015-03-13 Thread Stefano Sabatini
---
 libavfilter/vf_eq.c | 56 ++---
 1 file changed, 15 insertions(+), 41 deletions(-)

diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c
index 980e9ca..e1aa206 100644
--- a/libavfilter/vf_eq.c
+++ b/libavfilter/vf_eq.c
@@ -282,48 +282,22 @@ static int process_command(AVFilterContext *ctx, const 
char *cmd, const char *ar
 EQContext *eq = ctx->priv;
 int ret;
 
-if (!strcmp(cmd, "contrast")) {
-ret = set_expr(&eq->contrast_pexpr, args, cmd, ctx);
-set_contrast(eq);
-return ret;
-}
-else if (!strcmp(cmd, "brightness")) {
-ret = set_expr(&eq->brightness_pexpr, args, cmd, ctx);
-set_brightness(eq);
-return ret;
-}
-else if (!strcmp(cmd, "saturation")) {
-ret = set_expr(&eq->saturation_pexpr, args, cmd, ctx);
-set_saturation(eq);
-return ret;
-}
-else if (!strcmp(cmd, "gamma")) {
-ret = set_expr(&eq->gamma_pexpr, args, cmd, ctx);
-set_gamma(eq);
-return ret;
-}
-else if (!strcmp(cmd, "gamma_r")) {
-ret = set_expr(&eq->gamma_r_pexpr, args, cmd, ctx);
-set_gamma(eq);
-return ret;
+#define SET_PARAM(param_name, set_name) \
+if (!strcmp(cmd, #param_name)) {\
+ret = set_expr(&eq->param_name##_pexpr, args, cmd, ctx);\
+set_##set_name(eq); \
+return ret; \
 }
-else if (!strcmp(cmd, "gamma_g")) {
-ret = set_expr(&eq->gamma_g_pexpr, args, cmd, ctx);
-set_gamma(eq);
-return ret;
-}
-else if (!strcmp(cmd, "gamma_b")) {
-ret = set_expr(&eq->gamma_b_pexpr, args, cmd, ctx);
-set_gamma(eq);
-return ret;
-}
-else if (!strcmp(cmd, "gamma_weight")) {
-ret = set_expr(&eq->gamma_weight_pexpr, args, cmd, ctx);
-set_gamma(eq);
-return ret;
-}
-else
-return AVERROR(ENOSYS);
+
+ SET_PARAM(contrast, contrast)
+else SET_PARAM(brightness, brightness)
+else SET_PARAM(saturation, saturation)
+else SET_PARAM(gamma, gamma)
+else SET_PARAM(gamma_r, gamma)
+else SET_PARAM(gamma_g, gamma)
+else SET_PARAM(gamma_b, gamma)
+else SET_PARAM(gamma_weight, gamma)
+else return AVERROR(ENOSYS);
 }
 
 static const AVFilterPad eq_inputs[] = {
-- 
1.8.3.2

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


Re: [FFmpeg-devel] [PATCH] lavfi: Add support to process_command in vf_eq.c

2015-03-13 Thread Stefano Sabatini
On date Friday 2015-03-13 11:46:42 +0530, Arwa Arif encoded:
> I have added the variable options. I have not done the refactoring part yet.

> From 00052c1bbe5fe87d86fcff6f5e810290468d0251 Mon Sep 17 00:00:00 2001
> From: Arwa Arif 
> Date: Fri, 13 Mar 2015 11:37:40 +0530
> Subject: [PATCH] Add variables to process_command in vf_eq
> 
> ---
>  doc/filters.texi|   16 +--
>  libavfilter/vf_eq.c |   55 
> ++-
>  libavfilter/vf_eq.h |   36 -
>  3 files changed, 64 insertions(+), 43 deletions(-)

Check attached modified patch.
-- 
FFmpeg = Formidable & Free Murdering Problematic Enhanced Gem
>From bca3c330b3ab60c84ab69f4da2fe04caa848f6e5 Mon Sep 17 00:00:00 2001
From: arwa arif 
Date: Fri, 13 Mar 2015 11:46:42 +0530
Subject: [PATCH] lavfi/eq: rework expression evaluation

In particular, add support for t, pos, n, r parameters, and add an eval
mode option.

Also, partially reword option documentation.

With several major edit by Stefano Sabatini.

Signed-off-by: Stefano Sabatini 
---
 doc/filters.texi| 70 ++---
 libavfilter/vf_eq.c | 70 +++--
 libavfilter/vf_eq.h | 39 ++---
 3 files changed, 118 insertions(+), 61 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index dbcd391..653b985 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4366,40 +4366,72 @@ The filter accepts the following options:
 
 @table @option
 @item contrast
-Set the contrast value. It accepts a float value in range @code{-2.0} to
-@code{2.0}. The default value is @code{0.0}.
+Set the contrast expression. The value must be a float value in range
+@code{-2.0} to @code{2.0}. The default value is "0".
 
 @item brightness
-Set the brightness value. It accepts a float value in range @code{-1.0} to
-@code{1.0}. The default value is @code{0.0}.
+Set the brightness expression. The value must be a float value in
+range @code{-1.0} to @code{1.0}. The default value is "0".
 
 @item saturation
-Set the saturation value. It accepts a float value in range @code{0.0} to
-@code{3.0}. The default value is @code{1.0}.
+Set the saturation expression. The value must be a float in
+range @code{0.0} to @code{3.0}. The default value is "1".
 
 @item gamma
-Set the gamma value. It accepts a float value in range @code{0.1} to @code{10.0}.
-The default value is @code{1.0}.
+Set the gamma expression. The value must be a float in range
+@code{0.1} to @code{10.0}.  The default value is "1".
 
 @item gamma_r
-Set the gamma value for red. It accepts a float value in range
-@code{0.1} to @code{10.0}. The default value is @code{1.0}.
+Set the gamma expression for red. The value must be a float in
+range @code{0.1} to @code{10.0}. The default value is "1".
 
 @item gamma_g
-Set the gamma value for green. It accepts a float value in range
-@code{0.1} to @code{10.0}. The default value is @code{1.0}.
+Set the gamma expression for green. The value must be a float in range
+@code{0.1} to @code{10.0}. The default value is "1".
 
 @item gamma_b
-Set the gamma value for blue. It accepts a float value in range
-@code{0.1} to @code{10.0}. The default value is @code{1.0}.
+Set the gamma expression for blue. The value must be a float in range
+@code{0.1} to @code{10.0}. The default value is "1".
 
 @item gamma_weight
-Can be used to reduce the effect of a high gamma value on bright image areas,
-e.g. keep them from getting overamplified and just plain white. It accepts a
-float value in range @code{0.0} to @code{1.0}.A value of @code{0.0} turns the
-gamma correction all the way down while @code{1.0} leaves it at its full strength.
-Default is @code{1.0}.
+Set the gamma weight expression. It can be used to reduce the effect
+of a high gamma value on bright image areas, e.g. keep them from
+getting overamplified and just plain white. The value must be a float
+in range @code{0.0} to @code{1.0}. A value of @code{0.0} turns the
+gamma correction all the way down while @code{1.0} leaves it at its
+full strength. Default is "1".
 
+@item eval
+Set when the expressions for brightness, contrast, saturation and
+gamma expressions are evaluated.
+
+It accepts the following values:
+@table @samp
+@item init
+only evaluate expressions once during the filter initialization or
+when a command is processed
+
+@item frame
+evaluate expressions for each incoming frame
+@end table
+
+Default value is @samp{init}.
+@end table
+
+The expressions accept the following parameters:
+@table @option
+@item n
+frame count of the input frame starting from 0
+
+@item pos
+byte position of the corresponding packet in the input file, NAN if
+unspecified
+
+@item r
+frame rate of the input video, NAN if the input frame rate is unknown
+
+@item t
+timestamp expressed in seconds, NAN if the input timestamp is unknown
 @end table
 
 @subsection Commands
diff --git a/libavfilter/vf_eq.c 

Re: [FFmpeg-devel] [PATCH] Add ability to pause transcoding via keyboard interaction

2015-03-13 Thread Jeremy Luce
In my case it would be used by a multi-platform application that does
on-the-fly transcoding. It would be nice if this behavior was platform
agnostic (there's no ctrl-z equivalent in Windows that I know of).
Doing this with OS-specific keys or at the thread level in the
application code is less than ideal.
Jeremy


On Fri, Mar 13, 2015 at 11:12 AM, Michael Niedermayer  wrote:
> On Fri, Mar 13, 2015 at 08:34:48AM -0500, Jeremy Luce wrote:
>> It's been a couple days, so I wanted to follow up. Would someone mind
>> providing some feedback on this? Thanks!
>
> what is the advantage of this compared to simply stoping the process?
> like by hiting ctrl-z ?
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The bravest are surely those who have the clearest vision
> of what is before them, glory and danger alike, and yet
> notwithstanding go out to meet it. -- Thucydides
>
> ___
> 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] AAC: [PATCH] AAC: Add support for 7350Hz sampling rates

2015-03-13 Thread Claudio Freire
On Fri, Mar 13, 2015 at 2:34 PM, Claudio Freire  wrote:
> On Fri, Mar 13, 2015 at 12:39 PM, Nedeljko Babic
>  wrote:
>>> btw, i use the qemu from https://github.com/ssvb/QEMU.git
>>> for mips as it at least years ago supported more extensions, i
>>> would have guessed these where merged into main qemu but as you list
>>> all the disables in the wiki, maybe i was guessing wrong
>>
>> I can confirm that main qemu supports both fpu and dspr1/dspr2 extension.
>> Appropriate cpu model needs to be selected in order for the extension to be 
>> available.
>> 74Kf supports all extensions, so adding "-cpu 74Kf" in "--target-exec" 
>> should enable fpu, dspr1 and dspr2 extensions.
>
> As I was building on a more complete reply, the problem I have is with
> the glibc, which is built with the soft float ABI.
>
> As soon as I finish all the tests (they take a while) I'll post more
> details. But I've run the thing several times built in different ways,
> and when it runs at all, it runs fine (the tests are fixed), so I
> don't know why they're not fixed fo r

..for you.

Sorry, hand slipped and sent the email prematurely.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-03-13 Thread Claudio Freire
On Fri, Mar 13, 2015 at 12:39 PM, Nedeljko Babic
 wrote:
>> btw, i use the qemu from https://github.com/ssvb/QEMU.git
>> for mips as it at least years ago supported more extensions, i
>> would have guessed these where merged into main qemu but as you list
>> all the disables in the wiki, maybe i was guessing wrong
>
> I can confirm that main qemu supports both fpu and dspr1/dspr2 extension.
> Appropriate cpu model needs to be selected in order for the extension to be 
> available.
> 74Kf supports all extensions, so adding "-cpu 74Kf" in "--target-exec" should 
> enable fpu, dspr1 and dspr2 extensions.

As I was building on a more complete reply, the problem I have is with
the glibc, which is built with the soft float ABI.

As soon as I finish all the tests (they take a while) I'll post more
details. But I've run the thing several times built in different ways,
and when it runs at all, it runs fine (the tests are fixed), so I
don't know why they're not fixed fo r
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Add ability to pause transcoding via keyboard interaction

2015-03-13 Thread Michael Niedermayer
On Wed, Mar 11, 2015 at 08:34:39AM -0500, Jeremy Luce wrote:
> Resubmitting with [PATCH] tag and unified diff.
> 
> Adds functionality to pause transcoding with 'p' key and upause with 'u'
> key over stdin. Pauses in the main transcode loop as well as the
> input_thread loop.
[...]

> @@ -3346,7 +3371,9 @@ static int check_keyboard_interaction(int64_t cur_time)
>  "C  Send/Que command to all matching filters\n"
>  "D  cycle through available debug modes\n"
>  "h  dump packets/hex press to cycle
> through the 3 states\n"
> +"p  pause transcoding\n"

this looks like the diff has been corrupted with line breaks

also this is missing documentation in doc/*

[...]
-- 
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] AAC: [PATCH] AAC: Add support for 7350Hz sampling rates

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 02:34:08PM -0300, Claudio Freire wrote:
> On Fri, Mar 13, 2015 at 12:39 PM, Nedeljko Babic
>  wrote:
> >> btw, i use the qemu from https://github.com/ssvb/QEMU.git
> >> for mips as it at least years ago supported more extensions, i
> >> would have guessed these where merged into main qemu but as you list
> >> all the disables in the wiki, maybe i was guessing wrong
> >
> > I can confirm that main qemu supports both fpu and dspr1/dspr2 extension.
> > Appropriate cpu model needs to be selected in order for the extension to be 
> > available.
> > 74Kf supports all extensions, so adding "-cpu 74Kf" in "--target-exec" 
> > should enable fpu, dspr1 and dspr2 extensions.
> 
> As I was building on a more complete reply, the problem I have is with
> the glibc, which is built with the soft float ABI.
> 

> As soon as I finish all the tests (they take a while) I'll post more

they really shouldnt take much time

a build (with ccache) should be quite fast and you only need to test
make -j fate-aac-s7350-encode

can it be that theres some float rounding somewhere that leads to a
different decission that causes this ?


> details. But I've run the thing several times built in different ways,
> and when it runs at all, it runs fine (the tests are fixed), so I
> don't know why they're not fixed fo r
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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


[FFmpeg-devel] [FFMpeg-Devel] [PATCH 6/7] Added asm file with some useful macros

2015-03-13 Thread Tucker DiNapoli
---
 libpostproc/x86/PPUtil.asm | 116 +
 1 file changed, 116 insertions(+)
 create mode 100644 libpostproc/x86/PPUtil.asm

diff --git a/libpostproc/x86/PPUtil.asm b/libpostproc/x86/PPUtil.asm
new file mode 100644
index 000..090ee18
--- /dev/null
+++ b/libpostproc/x86/PPUtil.asm
@@ -0,0 +1,116 @@
+;**
+;*
+;* Copyright (c) 2015 Tucker DiNapoli
+;*
+;* Utility code/marcos used in asm files for libpostproc
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or modify
+;* it under the terms of the GNU General Public License as published by
+;* the Free Software Foundation; either version 2 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 General Public License for more details.
+;*
+;* You should have received a copy of the GNU 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/x86/x86util.asm"
+%include "PPContext.asm"
+;; Macros to simplify moving packed data
+
+;; copy low quadword to upper quadword(s)
+%macro dup_low_quadword 1
+%if cpuflag(sse2)
+pshufpd %1, %1, 0x00
+%elif cpuflag(avx2)
+vpermq %1, %1, 01010101b
+%endif
+%endmacro
+
+;; move the low half of the mmx/xmm/ymm register in %2 into %1
+;; %1 should be a memory location
+%macro mov_vector_low_half 2
+%if mmsize == 32
+vextractf128 %1, %2, 0x00
+%elif mmsize == 16
+movlpd %1, %2
+%elif mmsize == 8
+movd %1, %2
+%else
+%error "mmsize defined to unsupported value"
+%endif
+%endmacro
+;; move the high half of the mmx/xmm/ymm register in %2 into %1
+;; %1 should be a memory location
+%macro mov_vector_high_half 2-3 m0
+%if mmsize == 32
+vextractf128 %1, %2, 0x01
+%elif mmsize == 16
+movhpd %1, %2
+%elif mmsize == 8
+;; there's no instruction, pre sse4.1, to move the high 32 bits of an mmx
+;; register, so use the optional third argument as a temporary register
+;; shift it right by 32 bits and extract the low doubleword
+movq %3, %2
+psrl %3, 32
+movd %1, %3
+%else
+%error "mmsize defined to unsupported value"
+%endif
+%endmacro
+
+;; define packed conditional moves, of the form:
+;; pcmovXXS dst, src, arg1, arg2, tmp
+;; where XX is a comparision (eq,ne,gt,...) and S is a size(b,w,d,q)
+;; copy src to dest, then compare arg1 with arg2 and store
+;; the result in tmp, finally AND src with tmp.
+%macro do_simd_sizes 2
+%1 %2b
+%1 %2w
+%1 %2d
+%1 %2q
+%endmacro
+;; macro generating macro
+%macro gen_pcmovxx 1 
+%macro pcmov%1 4-6 ,%1 ;;dst, src, cmp1, cmp2, [tmp = cmp2]
+%if %0 == 5
+%ifnidn %5,%3
+mova %5,%3
+%endif
+%endif
+pcmp%6 %5,%4
+mova %1, %2
+pand %1, %5
+%endmacro
+%endmacro
+do_simd_sizes gen_pcmovxx,eq
+do_simd_sizes gen_pcmovxx,ne
+do_simd_sizes gen_pcmovxx,lt
+do_simd_sizes gen_pcmovxx,le
+do_simd_sizes gen_pcmovxx,gt
+do_simd_sizes gen_pcmovxx,ge
+
+;; Macros for defining simd constants
+%macro define_qword_vector_constant 5
+%if cpuflag(avx2)
+SECTION_RODATA 32
+%else
+SECTION_RODATA 16
+%endif
+%1: 
+dq %2
+%if cpuflag(sse2)
+dq %3
+%if cpuflag(avx2)
+dq %4
+dq %5
+%endif
+%endif
+SECTION_TEXT
+%endmacro
-- 
2.2.1

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


[FFmpeg-devel] [PATCH 1/4] libavdevice/avfoundation: add framerate and video size options

2015-03-13 Thread matthieu . bouron
From: Matthieu Bouron 

Support framerate ands video size options on AVCaptureDevices for
OSX >= 10.7 and iOS >= 7.0.

For screen captures, only the framerate option is taken into account.
---
 libavdevice/avfoundation.m | 103 +
 1 file changed, 103 insertions(+)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index e00cc3b..41fe9c3 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -33,6 +33,7 @@
 #include "libavutil/avstring.h"
 #include "libavformat/internal.h"
 #include "libavutil/internal.h"
+#include "libavutil/parseutils.h"
 #include "libavutil/time.h"
 #include "avdevice.h"
 
@@ -90,6 +91,9 @@ typedef struct
 id  avf_delegate;
 id  avf_audio_delegate;
 
+AVRational  framerate;
+int width, height;
+
 int list_devices;
 int video_device_index;
 int video_stream_index;
@@ -263,9 +267,76 @@ static void parse_device_name(AVFormatContext *s)
 }
 }
 
+/*
+ * Configure the video device using a run-time approach to access properties
+ * since formats, activeFormat are available since  iOS >= 7.0 or OSX >= 10.7
+ * and activeVideoMaxFrameDuration is available since i0S >= 7.0 and OSX >= 
10.9
+ *
+ * The NSUndefinedKeyException must be handled by the caller of this function.
+ *
+ */
+static int configure_video_device(AVFormatContext *s, AVCaptureDevice 
*video_device)
+{
+AVFContext *ctx = (AVFContext*)s->priv_data;
+
+double framerate = av_q2d(ctx->framerate);
+NSObject *selected_format = nil, *selected_range = nil;
+
+for (NSObject *format in [video_device valueForKey:@"formats"]) {
+CMFormatDescriptionRef formatDescription;
+CMVideoDimensions dimensions;
+
+formatDescription = (CMFormatDescriptionRef) [format 
performSelector:@selector(formatDescription)];
+dimensions = CMVideoFormatDescriptionGetDimensions(formatDescription);
+
+if ((ctx->width == 0 && ctx->height == 0) ||
+(dimensions.width == ctx->width && dimensions.height == 
ctx->height)) {
+
+selected_format = format;
+
+for (NSObject *range in [format 
valueForKey:@"videoSupportedFrameRateRanges"]) {
+double max_framerate;
+
+[[range valueForKey:@"maxFrameRate"] getValue:&max_framerate];
+if (framerate == 0.0 || abs (framerate - max_framerate) < 
0.1) {
+
+selected_range = range;
+break;
+}
+}
+}
+}
+
+if (!selected_format) {
+av_log(s, AV_LOG_ERROR, "Selected video size (%dx%d) is not supported 
by the device\n",
+ctx->width, ctx->height);
+return AVERROR(EINVAL);
+}
+
+if (!selected_range) {
+av_log(s, AV_LOG_ERROR, "Selected framerate (%f) is not supported by 
the device\n",
+framerate);
+return AVERROR(EINVAL);
+}
+
+if ([video_device lockForConfiguration:NULL] == YES) {
+NSValue *min_frame_duration = [selected_range 
valueForKey:@"minFrameDuration"];
+
+[video_device setValue:selected_format forKey:@"activeFormat"];
+[video_device setValue:min_frame_duration 
forKey:@"activeVideoMinFrameDuration"];
+[video_device setValue:min_frame_duration 
forKey:@"activeVideoMaxFrameDuration"];
+} else {
+av_log(s, AV_LOG_ERROR, "Could not lock device for configuration");
+return AVERROR(EINVAL);
+}
+
+return 0;
+}
+
 static int add_video_device(AVFormatContext *s, AVCaptureDevice *video_device)
 {
 AVFContext *ctx = (AVFContext*)s->priv_data;
+int ret;
 NSError *error  = nil;
 AVCaptureInput* capture_input = nil;
 struct AVFPixelFormatSpec pxl_fmt_spec;
@@ -300,6 +371,18 @@ static int add_video_device(AVFormatContext *s, 
AVCaptureDevice *video_device)
 return 1;
 }
 
+// Configure device framerate and video size
+@try {
+if ((ret = configure_video_device(s, video_device)) < 0) {
+return ret;
+}
+} @catch (NSException *exception) {
+if (![[exception name] isEqualToString:NSUndefinedKeyException]) {
+  av_log (s, AV_LOG_ERROR, "An error occured: %s", [exception.reason 
UTF8String]);
+  return AVERROR_EXTERNAL;
+}
+}
+
 // select pixel format
 pxl_fmt_spec.ff_id = AV_PIX_FMT_NONE;
 
@@ -549,6 +632,7 @@ static int get_audio_config(AVFormatContext *s)
 static int avf_read_header(AVFormatContext *s)
 {
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+int capture_screen  = 0;
 uint32_t num_screens= 0;
 AVFContext *ctx = (AVFContext*)s->priv_data;
 AVCaptureDevice *video_device = nil;
@@ -616,7 +700,13 @@ static int avf_read_header(AVFormatContext *s)
 CGDirectDisplayID screens[num_screens];
 CGGetActiveDisplayList(num_screens,

[FFmpeg-devel] [PATCH 2/4] libavdevice/avfoundation: add capture_screen_cursor option

2015-03-13 Thread matthieu . bouron
From: Matthieu Bouron 

Add support for cursor capturing while recording a screen for OSX >=
10.8.
---
 libavdevice/avfoundation.m | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 41fe9c3..e574518 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -94,6 +94,8 @@ typedef struct
 AVRational  framerate;
 int width, height;
 
+int capture_screen_cursor;
+
 int list_devices;
 int video_device_index;
 int video_stream_index;
@@ -705,6 +707,14 @@ static int avf_read_header(AVFormatContext *s)
 capture_screen_input.minFrameDuration = 
CMTimeMake(ctx->framerate.den, ctx->framerate.num);
 }
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+if (ctx->capture_screen_cursor) {
+capture_screen_input.capturesCursor = YES;
+} else {
+capture_screen_input.capturesCursor = NO;
+}
+#endif
+
 video_device = (AVCaptureDevice*) capture_screen_input;
 capture_screen = 1;
 #endif
@@ -740,6 +750,14 @@ static int avf_read_header(AVFormatContext *s)
 if (ctx->framerate.num > 0) {
 capture_screen_input.minFrameDuration = 
CMTimeMake(ctx->framerate.den, ctx->framerate.num);
 }
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+if (ctx->capture_screen_cursor) {
+capture_screen_input.capturesCursor = YES;
+} else {
+capture_screen_input.capturesCursor = NO;
+}
+#endif
 }
 }
 #endif
@@ -956,6 +974,7 @@ static const AVOption options[] = {
 { "pixel_format", "set pixel format", offsetof(AVFContext, pixel_format), 
AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_YUV420P}, 0, INT_MAX, 
AV_OPT_FLAG_DECODING_PARAM},
 { "framerate", "set frame rate", offsetof(AVFContext, framerate), 
AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
 { "size", "set video size", offsetof(AVFContext, width), 
AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
+{ "capture_screen_cursor", "capture the screen cursor", 
offsetof(AVFContext, capture_screen_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, 
AV_OPT_FLAG_DECODING_PARAM },
 { NULL },
 };
 
-- 
2.3.2

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


[FFmpeg-devel] [FFMpeg-Devel] [PATCH 1/7] Moved postprocessing routines from postprocess.c to seperate file

2015-03-13 Thread Tucker DiNapoli
This is a somewhat large patchset, mostly because I've tried to break each
patch down into the smallest set of changes I could. On my machine (x86_64
linux, with AVX2), everything compiles after each patch. Whenever I configure
ffmpeg libpostproc is always disabled and I have to manually change config.mak
to fix this. I'm not sure if this is an issue on my end or just the default
setting.  

This is ultimately a qualifing task for the google summer of code, so I know I
still have a lot of things to work on, I just want to make sure I'm following
the proper coding conventions and everything for now.

This moves c functions to process blocks horozontally into a seperate
file, so that none of the postprocessing algorithms are in the main
postprecess.c file
---
 libpostproc/postprocess.c   | 352 +
 libpostproc/postprocess_c.c | 373 
 2 files changed, 374 insertions(+), 351 deletions(-)
 create mode 100644 libpostproc/postprocess_c.c

diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index 9d89782..86c0520 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -199,357 +199,7 @@ static inline void prefetcht2(const void *p)
 }
 #endif
 
-/* The horizontal functions exist only in C because the MMX
- * code is faster with vertical filters and transposing. */
-
-/**
- * Check if the given 8x8 Block is mostly "flat"
- */
-static inline int isHorizDC_C(const uint8_t src[], int stride, const PPContext 
*c)
-{
-int numEq= 0;
-int y;
-const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
-const int dcThreshold= dcOffset*2 + 1;
-
-for(y=0; y c->ppMode.flatnessThreshold;
-}
-
-/**
- * Check if the middle 8x8 Block in the given 8x16 block is flat
- */
-static inline int isVertDC_C(const uint8_t src[], int stride, const PPContext 
*c)
-{
-int numEq= 0;
-int y;
-const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
-const int dcThreshold= dcOffset*2 + 1;
-
-src+= stride*4; // src points to begin of the 8x8 Block
-for(y=0; y c->ppMode.flatnessThreshold;
-}
-
-static inline int isHorizMinMaxOk_C(const uint8_t src[], int stride, int QP)
-{
-int i;
-for(i=0; i<2; i++){
-if((unsigned)(src[0] - src[5] + 2*QP) > 4*QP) return 0;
-src += stride;
-if((unsigned)(src[2] - src[7] + 2*QP) > 4*QP) return 0;
-src += stride;
-if((unsigned)(src[4] - src[1] + 2*QP) > 4*QP) return 0;
-src += stride;
-if((unsigned)(src[6] - src[3] + 2*QP) > 4*QP) return 0;
-src += stride;
-}
-return 1;
-}
-
-static inline int isVertMinMaxOk_C(const uint8_t src[], int stride, int QP)
-{
-int x;
-src+= stride*4;
-for(x=0; x 
4*QP) return 0;
-if((unsigned)(src[1+x + 2*stride] - src[1+x + 7*stride] + 2*QP) > 
4*QP) return 0;
-if((unsigned)(src[2+x + 4*stride] - src[2+x + 1*stride] + 2*QP) > 
4*QP) return 0;
-if((unsigned)(src[3+x + 6*stride] - src[3+x + 3*stride] + 2*QP) > 
4*QP) return 0;
-}
-return 1;
-}
-
-static inline int horizClassify_C(const uint8_t src[], int stride, const 
PPContext *c)
-{
-if( isHorizDC_C(src, stride, c) ){
-return isHorizMinMaxOk_C(src, stride, c->QP);
-}else{
-return 2;
-}
-}
-
-static inline int vertClassify_C(const uint8_t src[], int stride, const 
PPContext *c)
-{
-if( isVertDC_C(src, stride, c) ){
-return isVertMinMaxOk_C(src, stride, c->QP);
-}else{
-return 2;
-}
-}
-
-static inline void doHorizDefFilter_C(uint8_t dst[], int stride, const 
PPContext *c)
-{
-int y;
-for(y=0; yQP){
-const int q=(dst[3] - dst[4])/2;
-const int leftEnergy=  5*(dst[2] - dst[1]) + 2*(dst[0] - dst[3]);
-const int rightEnergy= 5*(dst[6] - dst[5]) + 2*(dst[4] - dst[7]);
-
-int d= FFABS(middleEnergy) - FFMIN( FFABS(leftEnergy), 
FFABS(rightEnergy) );
-d= FFMAX(d, 0);
-
-d= (5*d + 32) >> 6;
-d*= FFSIGN(-middleEnergy);
-
-if(q>0)
-{
-d = FFMAX(d, 0);
-d = FFMIN(d, q);
-}
-else
-{
-d = FFMIN(d, 0);
-d = FFMAX(d, q);
-}
-
-dst[3]-= d;
-dst[4]+= d;
-}
-dst+= stride;
-}
-}
-
-/**
- * Do a horizontal low pass filter on the 10x8 block (dst points to middle 8x8 
Block)
- * using the 9-Tap Filter (1,1,2,2,4,2,2,1,1)/16 (C version)
- */
-static inline void doHorizLowPass_C(uint8_t dst[], int stride, const PPContext 
*c)
-{
-int y;
-for(y=0; yQP ? dst[-1] : dst[0];
-const int last= FFABS(dst[8] - dst[7]) < c->QP ? dst[8] : dst[7];
-
-int sums[10];
-sums[0] = 4*first + dst[0] + dst[1] + dst[2] + 4;
-sums[1] = sums[0] - first  + dst[3];
-sums[2] = sums[1] - first  + dst[4];
-sums[3] = sums[2] - f

[FFmpeg-devel] [FFMpeg-Devel] [PATCH 4/7] Replaced BLOCK_HEIGHT macro with block_height and block_width variables

2015-03-13 Thread Tucker DiNapoli
This change is to allow support for different sized blocks, which will
be necessary for sse and avx. My plan is for the code to still act on
8x8 blocks, but to process multiple 8x8 blocks in parallel when using
sse/avx.
---
 libpostproc/postprocess.c  |  3 ---
 libpostproc/postprocess_c.c| 36 ++--
 libpostproc/postprocess_internal.h | 17 -
 libpostproc/postprocess_template.c | 18 +-
 4 files changed, 43 insertions(+), 31 deletions(-)

diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index 2cdd988..3090869 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -115,9 +115,6 @@ const char *postproc_license(void)
 
 #define GET_MODE_BUFFER_SIZE 500
 #define OPTIONS_ARRAY_SIZE 10
-#define BLOCK_SIZE 8
-#define TEMP_STRIDE 8
-//#define NUM_BLOCKS_AT_ONCE 16 //not used yet
 
 #if ARCH_X86 && HAVE_INLINE_ASM
 DECLARE_ASM_CONST(8, uint64_t, w05)= 0x0005000500050005LL;
diff --git a/libpostproc/postprocess_c.c b/libpostproc/postprocess_c.c
index 3d3b738..5660c64 100644
--- a/libpostproc/postprocess_c.c
+++ b/libpostproc/postprocess_c.c
@@ -32,7 +32,7 @@ static inline int isHorizDC_C(const uint8_t src[], int 
stride, const PPContext *
 const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
 const int dcThreshold= dcOffset*2 + 1;
 
-for(y=0; y 
4*QP) return 0;
 if((unsigned)(src[1+x + 2*stride] - src[1+x + 7*stride] + 2*QP) > 
4*QP) return 0;
 if((unsigned)(src[2+x + 4*stride] - src[2+x + 1*stride] + 2*QP) > 
4*QP) return 0;
@@ -120,7 +120,7 @@ static inline int vertClassify_C(const uint8_t src[], int 
stride, const PPContex
 static inline void doHorizDefFilter_C(uint8_t dst[], int stride, const 
PPContext *c)
 {
 int y;
-for(y=0; yQP){
@@ -159,7 +159,7 @@ static inline void doHorizDefFilter_C(uint8_t dst[], int 
stride, const PPContext
 static inline void doHorizLowPass_C(uint8_t dst[], int stride, const PPContext 
*c)
 {
 int y;
-for(y=0; yQP ? dst[-1] : dst[0];
 const int last= FFABS(dst[8] - dst[7]) < c->QP ? dst[8] : dst[7];
 
@@ -229,7 +229,7 @@ static inline void horizX1Filter(uint8_t *src, int stride, 
int QP)
 }
 }
 
-for(y=0; yQP ? src[0] : src[l1];
 const int last= FFABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8];
 
@@ -443,7 +443,7 @@ static inline void vertX1Filter_C(uint8_t *src, int stride, 
PPContext *co)
 int x;
 
 src+= stride*3;
-for(x=0; xQP){
 const int q=(src[l4] - src[l5])/2;
@@ -881,13 +881,13 @@ static inline void blockCopy_C(uint8_t dst[], int 
dstStride, const uint8_t src[]
 {
 int i;
 if(levelFix){
-for(i=0; i<8; i++)
+for(i=0; i>qpHShift];
diff --git a/libpostproc/postprocess_internal.h 
b/libpostproc/postprocess_internal.h
index 1ebd974..5a7be1f 100644
--- a/libpostproc/postprocess_internal.h
+++ b/libpostproc/postprocess_internal.h
@@ -174,5 +174,20 @@ static inline void linecpy(void *dest, const void *src, 
int lines, int stride) {
 memcpy((uint8_t*)dest+(lines-1)*stride, (const 
uint8_t*)src+(lines-1)*stride, -lines*stride);
 }
 }
-
+/*
+   Currently blocks are always 8xN bytes, where N is determined by the size of
+   the simd registers being used
+*/
+static const int block_height = 8;
+#if ARCH_X86 && !CONFIG_RUNTIME_CPUDETECT
+#if HAVE_AVX2
+static const int block_width = 32;
+#elif HAVE_SSE2
+static const int block_width = 16;
+#else
+static const int block_width = 8;
+#endif
+#else
+static int block_width; //determined at runtime
+#endif
 #endif /* POSTPROC_POSTPROCESS_INTERNAL_H */
diff --git a/libpostproc/postprocess_template.c 
b/libpostproc/postprocess_template.c
index 25f60ab..cafc9c6 100644
--- a/libpostproc/postprocess_template.c
+++ b/libpostproc/postprocess_template.c
@@ -364,7 +364,7 @@ static inline void RENAME(doVertLowPass)(uint8_t *src, int 
stride, PPContext *c)
 const int l9= stride + l8;
 int x;
 src+= stride*3;
-for(x=0; xQP ? src[0] : src[l1];
 const int last= FFABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8];
 
@@ -505,7 +505,7 @@ static inline void RENAME(vertX1Filter)(uint8_t *src, int 
stride, PPContext *co)
 int x;
 
 src+= stride*3;
-for(x=0; xQP){
 const int q=(src[l4] - src[l5])/2;
@@ -3175,7 +3175,7 @@ SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGd, %5), 
(%%REGd, %5, 2))
 #else //TEMPLATE_PP_MMX && HAVE_6REGS
 for(i=0; i<8; i++)
 memcpy( &(dst[dstStride*i]),
-&(src[srcStride*i]), BLOCK_SIZE);
+&(src[srcStride*i]), block_width);
 #endif //TEMPLATE_PP_MMX && HAVE_6REGS
 }else{
 #if TEMPLATE_PP_MMX && HAVE_6REGS
@@ -3208,7 +3208,7 @@ SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGd, %3), 
(%%REGd, %3, 2))
 #else //TEMPLATE_PP_MMX && HAVE_6REGS
 for(i=0; i<8; i++)
 memcpy( &(dst[dstStride*i]),
-&(src[srcStride*i]), BLOCK_SIZE);
+&(src[srcStride*i]), block_wid

[FFmpeg-devel] [FFMpeg-Devel] [PATCH 5/7] created x86 directory in libpostproc for standalone asm files

2015-03-13 Thread Tucker DiNapoli
I also put one file into the directory, which just defines the layout of
the structs used in libpostproc using the struc and endstruc macros.
---
 libpostproc/x86/PPContext.asm | 70 +++
 1 file changed, 70 insertions(+)
 create mode 100644 libpostproc/x86/PPContext.asm

diff --git a/libpostproc/x86/PPContext.asm b/libpostproc/x86/PPContext.asm
new file mode 100644
index 000..022dddb
--- /dev/null
+++ b/libpostproc/x86/PPContext.asm
@@ -0,0 +1,70 @@
+;*
+;* Definition of the PPContext and PPMode structs in assembly
+;* Copyright (C) 2015 Tucker DiNapoli (T.Dinapoli at gmail.com)
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or modify
+;* it under the terms of the GNU General Public License as published by
+;* the Free Software Foundation; either version 2 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 General Public License for more details.
+;*
+;* You should have received a copy of the GNU 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
+;*
+%if ARCH_X86_64
+%define pointer resq
+%else
+%define pointer resd
+%endif
+struc PPMode
+.lum_mode: resd 1
+.chrom_mode: resd 1
+.error: resd 1
+.min_allowed_y: resd 1
+.max_allowed_y: resd 1
+.max_clipped_threshold: resd 1
+.max_tmp_noise: resd 3
+.base_dc_diff: resd 1
+.flatness_threshold: resd 1
+.forced_quant: resd 1
+endstruc
+
+struc PPContext
+.av_class pointer 1
+.temp_blocks pointer 1
+.y_historgam pointer 1
+alignb 8
+.packed_yoffset resq 1
+.packed_yscale resq 1; 8 byte aligned by default
+.temp_blurred pointer 3
+.temp_blurred_past pointer 3
+.temp_dst pointer 1
+.temp_src pointer 1
+.deint_temp pointer 1
+alignb 8
+.pQPb resq 1
+.pQPb2 resq 1
+;; These next fields & next alignment may need to be changed for 128/256 bit 
registers
+alignb 8
+.mmx_dc_offset resq 64
+.mmx_dc_threshold resq 64
+.std_QP_table pointer 1
+.non_BQP_table pointer 1
+.forced_QP_table pointer 1
+.QP resd 1
+.nonBQP resd 1
+.frame_num resd 1
+.cpu_caps resd 1
+.qp_stride resd 1
+.stride resd 1
+.h_chroma_subsample resd 1
+.v_chroma_subsample resd 1
+.ppMode resd PPMode_size
+endstruc
-- 
2.2.1

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


[FFmpeg-devel] [FFMpeg-Devel] [PATCH 2/7] Moved templated c postprocessing routines into seperate file

2015-03-13 Thread Tucker DiNapoli
Currently different versions of the postprocessing routines are
generated from a template. Ultimately I intend to remove this by
replacing the inline assembly with seperate yasm files. The c routines
will still be needed, so they need to be moved to a seperate file.
The routines were added to the file introduced by the last commit.
---
 libpostproc/postprocess.c   |   7 +-
 libpostproc/postprocess_c.c | 829 
 2 files changed, 830 insertions(+), 6 deletions(-)

diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index 86c0520..2cdd988 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -198,14 +198,9 @@ static inline void prefetcht2(const void *p)
 );
 }
 #endif
-
+//Plain C versions
 #include "postprocess_c.c"
-
 //Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one
-//Plain C versions
-//we always compile C for testing which needs bitexactness
-#define TEMPLATE_PP_C 1
-#include "postprocess_template.c"
 
 #if HAVE_ALTIVEC
 #   define TEMPLATE_PP_ALTIVEC 1
diff --git a/libpostproc/postprocess_c.c b/libpostproc/postprocess_c.c
index bf22e95..5f9cb18 100644
--- a/libpostproc/postprocess_c.c
+++ b/libpostproc/postprocess_c.c
@@ -371,3 +371,832 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, 
int step,
 STOP_TIMER("stepX")
 }*/
 }
+
+#define PAVGB(a,b) REAL_PAVGB(a,b)
+
+//FIXME? |255-0| = 1 (should not be a problem ...)
+
+/**
+ * Do a vertical low pass filter on the 8x16 block (only write to the 8x8 
block in the middle)
+ * using the 9-Tap Filter (1,1,2,2,4,2,2,1,1)/16
+ */
+static inline void doVertLowPass_C(uint8_t *src, int stride, PPContext *c)
+{
+const int l1= stride;
+const int l2= stride + l1;
+const int l3= stride + l2;
+const int l4= stride + l3;
+const int l5= stride + l4;
+const int l6= stride + l5;
+const int l7= stride + l6;
+const int l8= stride + l7;
+const int l9= stride + l8;
+int x;
+src+= stride*3;
+for(x=0; xQP ? src[0] : src[l1];
+const int last= FFABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8];
+
+int sums[10];
+sums[0] = 4*first + src[l1] + src[l2] + src[l3] + 4;
+sums[1] = sums[0] - first  + src[l4];
+sums[2] = sums[1] - first  + src[l5];
+sums[3] = sums[2] - first  + src[l6];
+sums[4] = sums[3] - first  + src[l7];
+sums[5] = sums[4] - src[l1] + src[l8];
+sums[6] = sums[5] - src[l2] + last;
+sums[7] = sums[6] - src[l3] + last;
+sums[8] = sums[7] - src[l4] + last;
+sums[9] = sums[8] - src[l5] + last;
+
+src[l1]= (sums[0] + sums[2] + 2*src[l1])>>4;
+src[l2]= (sums[1] + sums[3] + 2*src[l2])>>4;
+src[l3]= (sums[2] + sums[4] + 2*src[l3])>>4;
+src[l4]= (sums[3] + sums[5] + 2*src[l4])>>4;
+src[l5]= (sums[4] + sums[6] + 2*src[l5])>>4;
+src[l6]= (sums[5] + sums[7] + 2*src[l6])>>4;
+src[l7]= (sums[6] + sums[8] + 2*src[l7])>>4;
+src[l8]= (sums[7] + sums[9] + 2*src[l8])>>4;
+
+src++;
+}
+}
+
+/**
+ * Experimental Filter 1
+ * will not damage linear gradients
+ * Flat blocks should look like they were passed through the 
(1,1,2,2,4,2,2,1,1) 9-Tap filter
+ * can only smooth blocks at the expected locations (it cannot smooth them if 
they did move)
+ * MMX2 version does correct clipping C version does not
+ */
+static inline void vertX1Filter_C(uint8_t *src, int stride, PPContext *co)
+{
+
+const int l1= stride;
+const int l2= stride + l1;
+const int l3= stride + l2;
+const int l4= stride + l3;
+const int l5= stride + l4;
+const int l6= stride + l5;
+const int l7= stride + l6;
+//const int l8= stride + l7;
+//const int l9= stride + l8;
+int x;
+
+src+= stride*3;
+for(x=0; x>1);
+d= FFMAX(d, 0);
+
+if(d < co->QP*2){
+int v = d * FFSIGN(-b);
+
+src[l2] +=v>>3;
+src[l3] +=v>>2;
+src[l4] +=(3*v)>>3;
+src[l5] -=(3*v)>>3;
+src[l6] -=v>>2;
+src[l7] -=v>>3;
+}
+src++;
+}
+}
+
+static inline void doVertDefFilter_C(uint8_t src[], int stride, PPContext *c)
+{
+const int l1= stride;
+const int l2= stride + l1;
+const int l3= stride + l2;
+const int l4= stride + l3;
+const int l5= stride + l4;
+const int l6= stride + l5;
+const int l7= stride + l6;
+const int l8= stride + l7;
+//const int l9= stride + l8;
+int x;
+src+= stride*3;
+for(x=0; xQP){
+const int q=(src[l4] - src[l5])/2;
+const int leftEnergy=  5*(src[l3] - src[l2]) + 2*(src[l1] - 
src[l4]);
+const int rightEnergy= 5*(src[l7] - src[l6]) + 2*(src[l5] - 
src[l8]);
+
+int d= FFABS(middleEnergy) - FFMIN( FFABS(leftEnergy), 
FFABS(rightEnergy) );
+d= FFMAX(d, 0);
+
+d= (5*d + 32) >> 6;
+d*= FFSIGN(-middleEnergy);
+
+

[FFmpeg-devel] [FFMpeg-Devel] [PATCH 3/7] Fixed copyright on postprocess_c.c

2015-03-13 Thread Tucker DiNapoli
Also made it an error to try and generate C postprocessing routines from
postprocess_template.c
---
 libpostproc/postprocess_c.c| 41 +++---
 libpostproc/postprocess_template.c |  4 +---
 2 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/libpostproc/postprocess_c.c b/libpostproc/postprocess_c.c
index 5f9cb18..3d3b738 100644
--- a/libpostproc/postprocess_c.c
+++ b/libpostproc/postprocess_c.c
@@ -1,24 +1,23 @@
-/**
-* C implementation of postprocessing routines
-* Copyright (C) 2001-2002 Michael Niedermayer (michae...@gmx.at)
-* Copyright (c) 2015 Tucker DiNapoli
-*
-* 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
-**/
+/*  C implementation of postprocessing routines
+ *
+ * Copyright (C) 2001-2003 Michael Niedermayer (michae...@gmx.at)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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
+ */
 
 /* The horizontal functions exist only in C because the MMX
  * code is faster with vertical filters and transposing. */
diff --git a/libpostproc/postprocess_template.c 
b/libpostproc/postprocess_template.c
index 6722f96..25f60ab 100644
--- a/libpostproc/postprocess_template.c
+++ b/libpostproc/postprocess_template.c
@@ -31,9 +31,7 @@
  * TEMPLATE_PP_* need to be undef at the end. */
 
 #ifdef TEMPLATE_PP_C
-#   define RENAME(a) a ## _C
-#else
-#   define TEMPLATE_PP_C 0
+#   error "Use postprocess_c.c for C postprocessing functions not 
postprocess_template.c"
 #endif
 
 #ifdef TEMPLATE_PP_ALTIVEC
-- 
2.2.1

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


[FFmpeg-devel] [PATCH 4/4] libavdevice/avfoundation: use pts/dts provided by the CMSampleBuffer API

2015-03-13 Thread matthieu . bouron
From: Matthieu Bouron 

---
 libavdevice/avfoundation.m | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 8112229..5bcd6a4 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -881,9 +881,14 @@ static int avf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 return AVERROR(EIO);
 }
 
-pkt->pts = pkt->dts = av_rescale_q(av_gettime() - ctx->first_pts,
-   AV_TIME_BASE_Q,
-   avf_time_base_q);
+CMItemCount count;
+CMSampleTimingInfo timing_info;
+
+if 
(CMSampleBufferGetOutputSampleTimingInfoArray(ctx->current_frame, 1, 
&timing_info, &count) == noErr) {
+AVRational timebase_q = av_make_q(1, 
timing_info.presentationTimeStamp.timescale);
+pkt->pts = pkt->dts = 
av_rescale_q(timing_info.presentationTimeStamp.value, timebase_q, 
avf_time_base_q);
+}
+
 pkt->stream_index  = ctx->video_stream_index;
 pkt->flags|= AV_PKT_FLAG_KEY;
 
@@ -911,9 +916,13 @@ static int avf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 return AVERROR(EIO);
 }
 
-pkt->pts = pkt->dts = av_rescale_q(av_gettime() - 
ctx->first_audio_pts,
-   AV_TIME_BASE_Q,
-   avf_time_base_q);
+CMItemCount count;
+CMSampleTimingInfo timing_info;
+
+if 
(CMSampleBufferGetOutputSampleTimingInfoArray(ctx->current_audio_frame, 1, 
&timing_info, &count) == noErr) {
+AVRational timebase_q = av_make_q(1, 
timing_info.presentationTimeStamp.timescale);
+pkt->pts = pkt->dts = 
av_rescale_q(timing_info.presentationTimeStamp.value, timebase_q, 
avf_time_base_q);
+}
 
 pkt->stream_index  = ctx->audio_stream_index;
 pkt->flags|= AV_PKT_FLAG_KEY;
-- 
2.3.2

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


[FFmpeg-devel] [FFMpeg-Devel] [PATCH 7/7] Added asm implmentations of some deinterlace functions

2015-03-13 Thread Tucker DiNapoli
I also added a makefile which assembles this file into libpostproc. I
haven't yet modified the c code to use these functions yet.
---
 libpostproc/x86/Makefile|   1 +
 libpostproc/x86/deinterlace.asm | 167 
 2 files changed, 168 insertions(+)
 create mode 100644 libpostproc/x86/Makefile
 create mode 100644 libpostproc/x86/deinterlace.asm

diff --git a/libpostproc/x86/Makefile b/libpostproc/x86/Makefile
new file mode 100644
index 000..06838ca
--- /dev/null
+++ b/libpostproc/x86/Makefile
@@ -0,0 +1 @@
+YASM-OBJS-$(CONFIG_POSTPROC) += x86/deinterlace.o
diff --git a/libpostproc/x86/deinterlace.asm b/libpostproc/x86/deinterlace.asm
new file mode 100644
index 000..6e669bb
--- /dev/null
+++ b/libpostproc/x86/deinterlace.asm
@@ -0,0 +1,167 @@
+;*
+;* DeInterlacing filters written using SIMD extensions
+;* Copyright (C) 2015 Tucker DiNapoli (T.Dinapoli at gmail.com)
+;*
+;* Adapted from inline assembly:
+;* Copyright (C) 2001-2002 Michael Niedermayer (michae...@gmx.at)
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or modify
+;* it under the terms of the GNU General Public License as published by
+;* the Free Software Foundation; either version 2 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 General Public License for more details.
+;*
+;* You should have received a copy of the GNU 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 "PPUtil.asm"
+;; All deinterlace functions operate on N 8x8 blocks at a time, where N
+;; is the size (in bytes) of the simd registers being used divided
+;; by 8, so 2 for xmm, and 4 for ymm.
+
+;; NOTE: The function names are camel case for compatibility with existing 
+;; postprocessing code, eventually the names of postprocessing functions
+;; will be changed to use lowercase and underscores
+
+;; Deinterlace blocks using linear interpolation
+;; Set each line 2n+1 to (line 2n + line 2n+2)/2
+%macro gen_deinterlace_interpolate_linear 0
+cglobal deInterlaceInterpolateLinear, 2, 4, 2;, src, stride
+lea r1, [r1 + r2 * 4]
+lea r3, [r1 + r2]
+lea r4, [r3 + r2 * 4]
+mova m0, [r1]
+mova m1, [r3 + r2]
+pavgb m0,m1
+mova [r3], m0
+mova m0, [r1 + r2 * 4]
+pavgb m1,m0
+mova [r3 + r2 * 2],m1
+mova m1, [r4 + r2]
+pavgb m0,m1
+mova [r4], m0
+mova m1, [r1 + r2 * 8]
+pavgb m0,m1
+mova [r4 + r2 * 2], m0
+RET
+%endmacro
+;; Deinterlace blocks using cubic interpolation
+;; Line 2n+1 = (9(2n) + 9(2n+2) - (2n-2) - (2n+4))/16
+%macro gen_deinterlace_interpolate_cubic 0
+cglobal deInterlaceInterpolateCubic, 2, 5, 5;, src, stride
+lea r3, [r2 + r2 * 2]
+add r1,r3
+lea r3, [r1 + r2]
+lea r4, [r3 + r2 * 4]
+lea r5, [r4 + r2 * 4]
+pxor m4,m4
+%ifnmacro deint_cubic
+;; given 5 lines a,b,c,d,e: a = c-3, b = c-1, d = c+1, e = c + 2
+;; set c = (9b + 9d - a - b)/16
+%macro deint_cubic 5
+mova m0,%1
+mova m1,%2
+mova m2,%4
+mova m3,%5
+pavgb m1,m2 ;(b+d)/2
+pavgb m0,m3 ;(a+e)/2
+;; convert each byte into a word
+mova m2,m1
+punpcklbw m1, m4
+punpckhbw m2, m4
+mova m0,m3
+punpcklbw m0, m4
+punpckhbw m3, m4
+;; calculate the pixel values
+psubw m0, m1 ;L(a+e - (b+d))/2
+psubw m3, m2 ;H(a+e - (b+d))/2
+psraw m0, 3
+psraw m3, 3
+psubw m1, m0 ;L(9(b+d) - (a+e))/16
+psubw m3, m2 ;H(9(b+d) - (a+e))/16
+;; convert the words back into bytes using unsigned saturation
+packuswb m1, m3
+mova %3, m1
+%endmacro
+%endif
+deint_cubic [r1], [r3 + r2], [r3 + r2 *2],\
+[r1 + r2 *4], [r4 + r2]
+deint_cubic [r3 + r2], [r1 + r2 * 4], [r4],\
+[r4 + r2], [r1 + r2 * 8]
+deint_cubic [r1 + r2 * 4], [r4 + r2], [r4 + r2 * 2],\
+[r1 + r2 * 8], [r5]
+deint_cubic [r4 + r2], [r1 + r2 * 8], [r4 + r2 * 4],\
+[r5], [r5 + r2 * 2]
+RET
+%endmacro
+
+;; deinterlace blocks by seting every line n to (n-1 + 2n + n+1)/4
+%macro gen_deinterlace_blend_linear 0
+cglobal deInterlaceBlendLinear, 3, 5, 2 ;src, stride, tmp
+lea r1, [r1 + r2 * 4]
+lea r4, [r1 + r2]
+lea r5, [r4 + r2 * 4]
+mova m0, [r3] ;L0
+mova m1, [r4] ;L2
+mova m2, [r1] ;L1
+pavgb m0, m1 ;L0+L2
+pavgb m0, m2 ;L0 + 2L1 + L2 / 4
+mova [r1], m0
+mova m0, [r4 + r2 * 2] ;L3
+pavgb m2, m0
+pavgb m2, m1
+mova [r4], m2 ;L4
+mova m2, [r4 + r2 * 2]
+pavgb m1, m2
+pavgb m1, m0
+mova [r4+r2], m1 ;L5
+mova m1, [r1 + r2 * 4]
+pavgb m0, m1
+pavgb m0, m2
+mova [r4 + r2 * 2], m0 ;L6
+mova m0, [r5]
+pavgb m2, m0
+ 

[FFmpeg-devel] [PATCH 3/4] libavdevice/avfoundation: add capture_screen_mouse_clicks option

2015-03-13 Thread matthieu . bouron
From: Matthieu Bouron 

Support mouse clicks capture while recording a screen on OSX >= 10.7.
---
 libavdevice/avfoundation.m | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index e574518..8112229 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -95,6 +95,7 @@ typedef struct
 int width, height;
 
 int capture_screen_cursor;
+int capture_screen_mouse_clicks;
 
 int list_devices;
 int video_device_index;
@@ -715,6 +716,12 @@ static int avf_read_header(AVFormatContext *s)
 }
 #endif
 
+if (ctx->capture_screen_mouse_clicks) {
+capture_screen_input.capturesMouseClicks = YES;
+} else {
+capture_screen_input.capturesMouseClicks = NO;
+}
+
 video_device = (AVCaptureDevice*) capture_screen_input;
 capture_screen = 1;
 #endif
@@ -758,6 +765,12 @@ static int avf_read_header(AVFormatContext *s)
 capture_screen_input.capturesCursor = NO;
 }
 #endif
+
+if (ctx->capture_screen_mouse_clicks) {
+capture_screen_input.capturesMouseClicks = YES;
+} else {
+capture_screen_input.capturesMouseClicks = NO;
+}
 }
 }
 #endif
@@ -975,6 +988,8 @@ static const AVOption options[] = {
 { "framerate", "set frame rate", offsetof(AVFContext, framerate), 
AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
 { "size", "set video size", offsetof(AVFContext, width), 
AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
 { "capture_screen_cursor", "capture the screen cursor", 
offsetof(AVFContext, capture_screen_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, 
AV_OPT_FLAG_DECODING_PARAM },
+{ "capture_screen_mouse_clicks", "capture the screen mouse clicks", 
offsetof(AVFContext, capture_screen_mouse_clicks), AV_OPT_TYPE_INT, {.i64=0}, 
0, 1, AV_OPT_FLAG_DECODING_PARAM },
+
 { NULL },
 };
 
-- 
2.3.2

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


Re: [FFmpeg-devel] [PATCH] avformat/http: support auto reconnect

2015-03-13 Thread Michael Niedermayer
On Thu, Mar 12, 2015 at 11:39:55AM +0800, Zhang Rui wrote:
> ---
>  libavformat/http.c | 32 +++-
>  1 file changed, 27 insertions(+), 5 deletions(-)

applied

thanks

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

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


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


[FFmpeg-devel] [PATCH] lavf/segment: [WIP] add support to segmentation expression

2015-03-13 Thread Stefano Sabatini
TODO: add documentation, add support to chapters.
---
 libavformat/segment.c | 57 +++
 1 file changed, 57 insertions(+)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index b65a2eb..794504a 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -33,6 +33,7 @@
 #include "internal.h"
 
 #include "libavutil/avassert.h"
+#include "libavutil/eval.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "libavutil/avstring.h"
@@ -62,6 +63,28 @@ typedef enum {
 LIST_TYPE_NB,
 } ListType;
 
+static const char *const var_names[] = {
+"segment_n",///< segment count
+"segment_packets_n",
+"segment_size",
+
+"packet_pos",   ///< position in the file
+"packet_n",
+"packet_t",
+NULL
+};
+
+enum var_name {
+VAR_SEGMENT_N,
+VAR_SEGMENT_PACKETS_N,
+VAR_SEGMENT_SIZE,
+
+VAR_PACKET_POS,
+VAR_PACKET_N,
+VAR_PACKET_T,
+VAR_VARS_NB
+};
+
 #define SEGMENT_LIST_FLAG_CACHE 1
 #define SEGMENT_LIST_FLAG_LIVE  2
 
@@ -71,6 +94,11 @@ typedef struct SegmentContext {
 int segment_idx_wrap;  ///< number after which the index wraps
 int segment_idx_wrap_nb;  ///< number of time the index has wraped
 int segment_count; ///< number of segment files already written
+
+char *segment_expr;
+AVExpr *segment_pexpr;
+double var_values[VAR_VARS_NB];
+
 AVOutputFormat *oformat;
 AVFormatContext *avf;
 char *format;  ///< format to use for output segment files
@@ -225,6 +253,10 @@ static int segment_start(AVFormatContext *s, int 
write_header)
 }
 
 seg->segment_idx++;
+
+seg->var_values[VAR_SEGMENT_SIZE] = 0;
+seg->var_values[VAR_SEGMENT_PACKETS_N] = 0;
+
 if ((seg->segment_idx_wrap) && (seg->segment_idx%seg->segment_idx_wrap == 
0))
 seg->segment_idx_wrap_nb++;
 
@@ -606,6 +638,15 @@ static int seg_write_header(AVFormatContext *s)
 } else if (seg->frames_str) {
 if ((ret = parse_frames(s, &seg->frames, &seg->nb_frames, 
seg->frames_str)) < 0)
 return ret;
+} else if (seg->segment_expr) {
+ret = av_expr_parse(&seg->segment_pexpr, seg->segment_expr, var_names,
+NULL, NULL, NULL, NULL, 0, s);
+if (ret < 0) {
+av_log(s, AV_LOG_ERROR,
+   "Error when evaluating the segment expression '%s'\n",
+   seg->segment_expr);
+return ret;
+}
 } else {
 /* set default value if not specified */
 if (!seg->time_str)
@@ -732,12 +773,26 @@ static int seg_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (!seg->avf)
 return AVERROR(EINVAL);
 
+#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb))
+seg->var_values[VAR_SEGMENT_N] = seg->segment_count;
+
+seg->var_values[VAR_SEGMENT_SIZE] += pkt->size;
+seg->var_values[VAR_SEGMENT_PACKETS_N] += 1;
+
+seg->var_values[VAR_PACKET_POS] = pkt->pos;
+seg->var_values[VAR_PACKET_T] = TS2T(pkt->pts, st->time_base);
+seg->var_values[VAR_PACKET_N] += 1;
+
 if (seg->times) {
 end_pts = seg->segment_count < seg->nb_times ?
 seg->times[seg->segment_count] : INT64_MAX;
 } else if (seg->frames) {
 start_frame = seg->segment_count < seg->nb_frames ?
 seg->frames[seg->segment_count] : INT_MAX;
+} else if (seg->segment_expr) {
+double res = av_expr_eval(seg->segment_pexpr, seg->var_values, NULL);
+if (res != 0)
+seg->cut_pending = 1;
 } else {
 if (seg->use_clocktime) {
 int64_t avgt = av_gettime();
@@ -855,6 +910,7 @@ fail:
 av_opt_free(seg);
 av_freep(&seg->times);
 av_freep(&seg->frames);
+av_expr_free(seg->segment_pexpr); seg->segment_pexpr = NULL;
 
 cur = seg->segment_list_entries;
 while (cur) {
@@ -891,6 +947,7 @@ static const AVOption options[] = {
 { "m3u8", "M3U8 format", 0, AV_OPT_TYPE_CONST, {.i64=LIST_TYPE_M3U8 }, 
INT_MIN, INT_MAX, E, "list_type" },
 { "hls", "Apple HTTP Live Streaming compatible", 0, AV_OPT_TYPE_CONST, 
{.i64=LIST_TYPE_M3U8 }, INT_MIN, INT_MAX, E, "list_type" },
 
+{ "segment_expr",   "set segmentation expression",   
OFFSET(segment_expr), AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,   E },
 { "segment_atclocktime",  "set segment to be cut at clocktime",  
OFFSET(use_clocktime), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, E},
 { "segment_time",  "set segment duration",   
OFFSET(time_str),AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,   E },
 { "segment_time_delta","set approximation value used for the segment 
times", OFFSET(time_delta), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, 0, E },
-- 
1.8.3.2

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


Re: [FFmpeg-devel] [FFMpeg-Devel] [PATCH 3/7] Fixed copyright on postprocess_c.c

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 02:15:10PM -0400, Tucker DiNapoli wrote:
> Also made it an error to try and generate C postprocessing routines from
> postprocess_template.c
> ---
>  libpostproc/postprocess_c.c| 41 
> +++---
>  libpostproc/postprocess_template.c |  4 +---
>  2 files changed, 21 insertions(+), 24 deletions(-)

the license fix should be combined with the patch that adds the
wrong license so that no wrong license is added in the first place

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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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


Re: [FFmpeg-devel] [FFMpeg-Devel] [PATCH 1/7] Moved postprocessing routines from postprocess.c to seperate file

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 02:15:08PM -0400, Tucker DiNapoli wrote:
> This is a somewhat large patchset, mostly because I've tried to break each

> patch down into the smallest set of changes I could. On my machine (x86_64
> linux, with AVX2), everything compiles after each patch. Whenever I configure
> ffmpeg libpostproc is always disabled and I have to manually change config.mak
> to fix this. I'm not sure if this is an issue on my end or just the default
> setting.  

you probably are missing --enable-gpl when running configure

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

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


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


Re: [FFmpeg-devel] [PATCH] Add ability to pause transcoding via keyboard interaction

2015-03-13 Thread Jeremy Luce
I'll fix the breaks and resubmit.

I don't see the keyboard interaction documented anywhere but in the
source code. Where would be the desired location for this info?
Jeremy


On Fri, Mar 13, 2015 at 1:02 PM, Michael Niedermayer  wrote:
> On Wed, Mar 11, 2015 at 08:34:39AM -0500, Jeremy Luce wrote:
>> Resubmitting with [PATCH] tag and unified diff.
>>
>> Adds functionality to pause transcoding with 'p' key and upause with 'u'
>> key over stdin. Pauses in the main transcode loop as well as the
>> input_thread loop.
> [...]
>
>> @@ -3346,7 +3371,9 @@ static int check_keyboard_interaction(int64_t cur_time)
>>  "C  Send/Que command to all matching filters\n"
>>  "D  cycle through available debug modes\n"
>>  "h  dump packets/hex press to cycle
>> through the 3 states\n"
>> +"p  pause transcoding\n"
>
> this looks like the diff has been corrupted with line breaks
>
> also this is missing documentation in doc/*
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I am the wisest man alive, for I know one thing, and that is that I know
> nothing. -- Socrates
>
> ___
> 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] [FFMpeg-Devel] [PATCH 4/7] Replaced BLOCK_HEIGHT macro with block_height and block_width variables

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 02:15:11PM -0400, Tucker DiNapoli wrote:
> This change is to allow support for different sized blocks, which will
> be necessary for sse and avx. My plan is for the code to still act on
> 8x8 blocks, but to process multiple 8x8 blocks in parallel when using
> sse/avx.
> ---
>  libpostproc/postprocess.c  |  3 ---
>  libpostproc/postprocess_c.c| 36 ++--
>  libpostproc/postprocess_internal.h | 17 -
>  libpostproc/postprocess_template.c | 18 +-
>  4 files changed, 43 insertions(+), 31 deletions(-)
> 
> diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
> index 2cdd988..3090869 100644
> --- a/libpostproc/postprocess.c
> +++ b/libpostproc/postprocess.c
> @@ -115,9 +115,6 @@ const char *postproc_license(void)
>  
>  #define GET_MODE_BUFFER_SIZE 500
>  #define OPTIONS_ARRAY_SIZE 10
> -#define BLOCK_SIZE 8
> -#define TEMP_STRIDE 8
> -//#define NUM_BLOCKS_AT_ONCE 16 //not used yet
>  
>  #if ARCH_X86 && HAVE_INLINE_ASM
>  DECLARE_ASM_CONST(8, uint64_t, w05)= 0x0005000500050005LL;
> diff --git a/libpostproc/postprocess_c.c b/libpostproc/postprocess_c.c
> index 3d3b738..5660c64 100644
> --- a/libpostproc/postprocess_c.c
> +++ b/libpostproc/postprocess_c.c
> @@ -32,7 +32,7 @@ static inline int isHorizDC_C(const uint8_t src[], int 
> stride, const PPContext *
>  const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
>  const int dcThreshold= dcOffset*2 + 1;
>  
> -for(y=0; y +for(y=0; y  numEq += ((unsigned)(src[0] - src[1] + dcOffset)) < dcThreshold;
>  numEq += ((unsigned)(src[1] - src[2] + dcOffset)) < dcThreshold;
>  numEq += ((unsigned)(src[2] - src[3] + dcOffset)) < dcThreshold;
> @@ -56,7 +56,7 @@ static inline int isVertDC_C(const uint8_t src[], int 
> stride, const PPContext *c
>  const int dcThreshold= dcOffset*2 + 1;
>  
>  src+= stride*4; // src points to begin of the 8x8 Block
> -for(y=0; y +for(y=0; y  numEq += ((unsigned)(src[0] - src[0+stride] + dcOffset)) < 
> dcThreshold;
>  numEq += ((unsigned)(src[1] - src[1+stride] + dcOffset)) < 
> dcThreshold;
>  numEq += ((unsigned)(src[2] - src[2+stride] + dcOffset)) < 
> dcThreshold;
> @@ -90,7 +90,7 @@ static inline int isVertMinMaxOk_C(const uint8_t src[], int 
> stride, int QP)
>  {
>  int x;
>  src+= stride*4;
> -for(x=0; x +for(x=0; x  if((unsigned)(src[  x + 0*stride] - src[  x + 5*stride] + 2*QP) > 
> 4*QP) return 0;
>  if((unsigned)(src[1+x + 2*stride] - src[1+x + 7*stride] + 2*QP) > 
> 4*QP) return 0;
>  if((unsigned)(src[2+x + 4*stride] - src[2+x + 1*stride] + 2*QP) > 
> 4*QP) return 0;
> @@ -120,7 +120,7 @@ static inline int vertClassify_C(const uint8_t src[], int 
> stride, const PPContex
>  static inline void doHorizDefFilter_C(uint8_t dst[], int stride, const 
> PPContext *c)
>  {
>  int y;
> -for(y=0; y +for(y=0; y  const int middleEnergy= 5*(dst[4] - dst[3]) + 2*(dst[2] - dst[5]);
>  
>  if(FFABS(middleEnergy) < 8*c->QP){
> @@ -159,7 +159,7 @@ static inline void doHorizDefFilter_C(uint8_t dst[], int 
> stride, const PPContext
>  static inline void doHorizLowPass_C(uint8_t dst[], int stride, const 
> PPContext *c)
>  {
>  int y;
> -for(y=0; y +for(y=0; y  const int first= FFABS(dst[-1] - dst[0]) < c->QP ? dst[-1] : dst[0];
>  const int last= FFABS(dst[8] - dst[7]) < c->QP ? dst[8] : dst[7];
>  
> @@ -229,7 +229,7 @@ static inline void horizX1Filter(uint8_t *src, int 
> stride, int QP)
>  }
>  }
>  
> -for(y=0; y +for(y=0; y  int a= src[1] - src[2];
>  int b= src[3] - src[4];
>  int c= src[5] - src[6];
> @@ -392,7 +392,7 @@ static inline void doVertLowPass_C(uint8_t *src, int 
> stride, PPContext *c)
>  const int l9= stride + l8;
>  int x;
>  src+= stride*3;
> -for(x=0; x +for(x=0; x  const int first= FFABS(src[0] - src[l1]) < c->QP ? src[0] : src[l1];
>  const int last= FFABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8];
>  
> @@ -443,7 +443,7 @@ static inline void vertX1Filter_C(uint8_t *src, int 
> stride, PPContext *co)
>  int x;
>  
>  src+= stride*3;
> -for(x=0; x +for(x=0; x  int a= src[l3] - src[l4];
>  int b= src[l4] - src[l5];
>  int c= src[l5] - src[l6];
> @@ -478,7 +478,7 @@ static inline void doVertDefFilter_C(uint8_t src[], int 
> stride, PPContext *c)
>  //const int l9= stride + l8;
>  int x;
>  src+= stride*3;
> -for(x=0; x +for(x=0; x  const int middleEnergy= 5*(src[l5] - src[l4]) + 2*(src[l3] - 
> src[l6]);
>  if(FFABS(middleEnergy) < 8*c->QP){
>  const int q=(src[l4] - src[l5])/2;
> @@ -881,13 +881,13 @@ static inline void blockCopy_C(uint8_t dst[], int 
> dstStride, const uint8_t src[]
>  {
>  int i;
>  if(levelFix){
> -for(i=0; i<8; i++)
> +for(i

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

2015-03-13 Thread Claudio Freire
On Fri, Mar 13, 2015 at 3:06 PM, Michael Niedermayer  wrote:
> On Fri, Mar 13, 2015 at 02:34:08PM -0300, Claudio Freire wrote:
>> On Fri, Mar 13, 2015 at 12:39 PM, Nedeljko Babic
>>  wrote:
>> >> btw, i use the qemu from https://github.com/ssvb/QEMU.git
>> >> for mips as it at least years ago supported more extensions, i
>> >> would have guessed these where merged into main qemu but as you list
>> >> all the disables in the wiki, maybe i was guessing wrong
>> >
>> > I can confirm that main qemu supports both fpu and dspr1/dspr2 extension.
>> > Appropriate cpu model needs to be selected in order for the extension to 
>> > be available.
>> > 74Kf supports all extensions, so adding "-cpu 74Kf" in "--target-exec" 
>> > should enable fpu, dspr1 and dspr2 extensions.
>>
>> As I was building on a more complete reply, the problem I have is with
>> the glibc, which is built with the soft float ABI.
>>
>
>> As soon as I finish all the tests (they take a while) I'll post more
>
> they really shouldnt take much time
>
> a build (with ccache) should be quite fast and you only need to test
> make -j fate-aac-s7350-encode
>
> can it be that theres some float rounding somewhere that leads to a
> different decission that causes this ?

Soft float is slow, add emulation and it's worse. The build is fast
enough, it's the tests the ones that are slow.

I'm going to try adding a hard-float version of the glibc in
opensuse's build service.

But first I want to get the patch that fixes mips tests verified.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [FFMpeg-Devel] [PATCH 2/7] Moved templated c postprocessing routines into seperate file

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 02:15:09PM -0400, Tucker DiNapoli wrote:
> Currently different versions of the postprocessing routines are
> generated from a template. Ultimately I intend to remove this by
> replacing the inline assembly with seperate yasm files. The c routines
> will still be needed, so they need to be moved to a seperate file.
> The routines were added to the file introduced by the last commit.
> ---
>  libpostproc/postprocess.c   |   7 +-
>  libpostproc/postprocess_c.c | 829 
> 
>  2 files changed, 830 insertions(+), 6 deletions(-)

why do you duplicate this code ?
it should be removed from where it is now in the same patch that
adds it elsewhere.

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


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


Re: [FFmpeg-devel] [PATCH] lavfi/eq: factorize code in process_command through a macro

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 05:16:53PM +0100, Stefano Sabatini wrote:
> ---
>  libavfilter/vf_eq.c | 56 
> ++---
>  1 file changed, 15 insertions(+), 41 deletions(-)

i would be more in favor of a function than a macro but LGTM either
way, macros are harder to debug and all kind of line number based
outputs are basically useless with multiline macros, be that
static analyzers of dynamic ...



set_param(cmd, "gamma_g", &eq->gamma_g_pexp, args, ctx, eq, &ret);
set_param(cmd, "gamma_r", &eq->gamma_r_pexp, args, ctx, eq, &ret);
if (ret < 0)


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

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


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


Re: [FFmpeg-devel] [PATCH] Add ability to pause transcoding via keyboard interaction

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 01:48:48PM -0500, Jeremy Luce wrote:
> I'll fix the breaks and resubmit.
> 
> I don't see the keyboard interaction documented anywhere but in the
> source code. Where would be the desired location for this info?

somewhere hmm, in the ffmpeg docs, doc/ffmpeg.texi seems the obvious
option

Thanks

[]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


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


Re: [FFmpeg-devel] [PATCH 2/4] x86: xvid_idct: port MMX IDCT to yasm

2015-03-13 Thread Christophe Gisquet
Hi,

2015-03-13 14:34 GMT+01:00 Michael Niedermayer :
>> They will not be used in any real world scenario.
>
> well it could be usefull in debuging in same cases
> especially if all mmx code is disabled on x86_64, for any single
> function its not too likely

I believe fate and proper bug reports are here for that, even with
your scenarios. I mean, for instance I can only test Win32/64, but
neither linux x86, PPC nor ARM, so I haven't bought much improvement
with this.

So I'd, as well as several x86 implementers, prefer the MMX* code not
to be built under ARCH_X86_32. You seemed to be fine with either.

And this was accepted as an intermediate ground between not keeping
all optimizations that only apply to 15+ yo systems (there are several
people of that opinion), and keeping everything as is.

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


Re: [FFmpeg-devel] [PATCH 2/4] x86: xvid_idct: port MMX IDCT to yasm

2015-03-13 Thread Ronald S. Bultje
Hi,

On Fri, Mar 13, 2015 at 3:19 PM, Christophe Gisquet <
christophe.gisq...@gmail.com> wrote:

> Hi,
>
> 2015-03-13 14:34 GMT+01:00 Michael Niedermayer :
> >> They will not be used in any real world scenario.
> >
> > well it could be usefull in debuging in same cases
> > especially if all mmx code is disabled on x86_64, for any single
> > function its not too likely
>
> I believe fate and proper bug reports are here for that, even with
> your scenarios. I mean, for instance I can only test Win32/64, but
> neither linux x86, PPC nor ARM, so I haven't bought much improvement
> with this.
>
> So I'd, as well as several x86 implementers, prefer the MMX* code not
> to be built under ARCH_X86_32. You seemed to be fine with either.
>
> And this was accepted as an intermediate ground between not keeping
> all optimizations that only apply to 15+ yo systems (there are several
> people of that opinion), and keeping everything as is.


I think the "smaller binary" is sufficiently enough of a reason to disable
building that code on 64bit systems.

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


Re: [FFmpeg-devel] [PATCH] lavfi: Add support to process_command in vf_eq.c

2015-03-13 Thread arwa arif
On Fri, Mar 13, 2015 at 9:50 PM, Stefano Sabatini 
wrote:

> On date Friday 2015-03-13 11:46:42 +0530, Arwa Arif encoded:
> > I have added the variable options. I have not done the refactoring part
> yet.
>
> > From 00052c1bbe5fe87d86fcff6f5e810290468d0251 Mon Sep 17 00:00:00 2001
> > From: Arwa Arif 
> > Date: Fri, 13 Mar 2015 11:37:40 +0530
> > Subject: [PATCH] Add variables to process_command in vf_eq
> >
> > ---
> >  doc/filters.texi|   16 +--
> >  libavfilter/vf_eq.c |   55
> ++-
> >  libavfilter/vf_eq.h |   36 -
> >  3 files changed, 64 insertions(+), 43 deletions(-)
>
> Check attached modified patch.
>

Nice. I now understood what was expected to be done.


> --
> FFmpeg = Formidable & Free Murdering Problematic Enhanced Gem
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext

2015-03-13 Thread Andreas Cadhalpun
The AC3DecodeContext has a float (USE_FIXED=0) and an integer
(USE_FIXED=1) variant, both of which can be present in the same binary.
This is not only very confusing, but it also breaks horribly, when one
variant is used by code expecting the other.

This currently happens, because eac3dec.c is only compiled for the float
variant, but also used from ac3dec_fixed.c, which uses the integer
variant.

The result is memory corruption, leading to crashes.

So compile eac3dec.c once for each variant and adapt it, so that it
works with the integer variant.

Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/Makefile   |  2 +-
 libavcodec/ac3dec.h   |  6 +++---
 libavcodec/ac3dec_fixed.c |  1 +
 libavcodec/ac3dec_float.c |  1 +
 libavcodec/eac3dec.c  | 22 +++---
 5 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index d15ef49..3451697 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -217,7 +217,7 @@ OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o 
dvdata.o
 OBJS-$(CONFIG_DVVIDEO_ENCODER) += dvenc.o dv.o dvdata.o
 OBJS-$(CONFIG_DXA_DECODER) += dxa.o
 OBJS-$(CONFIG_DXTORY_DECODER)  += dxtory.o
-OBJS-$(CONFIG_EAC3_DECODER)+= eac3dec.o eac3_data.o
+OBJS-$(CONFIG_EAC3_DECODER)+= eac3_data.o
 OBJS-$(CONFIG_EAC3_ENCODER)+= eac3enc.o eac3_data.o
 OBJS-$(CONFIG_EACMV_DECODER)   += eacmv.o
 OBJS-$(CONFIG_EAMAD_DECODER)   += eamad.o eaidct.o mpeg12.o \
diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h
index be29f00..5259c60 100644
--- a/libavcodec/ac3dec.h
+++ b/libavcodec/ac3dec.h
@@ -243,19 +243,19 @@ typedef struct AC3DecodeContext {
  * Parse the E-AC-3 frame header.
  * This parses both the bit stream info and audio frame header.
  */
-int ff_eac3_parse_header(AC3DecodeContext *s);
+static int ff_eac3_parse_header(AC3DecodeContext *s);
 
 /**
  * Decode mantissas in a single channel for the entire frame.
  * This is used when AHT mode is enabled.
  */
-void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
+static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int 
ch);
 
 /**
  * Apply spectral extension to each channel by copying lower frequency
  * coefficients to higher frequency bins and applying side information to
  * approximate the original high frequency signal.
  */
-void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
+static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
 
 #endif /* AVCODEC_AC3DEC_H */
diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c
index cb3b251..b4beee6 100644
--- a/libavcodec/ac3dec_fixed.c
+++ b/libavcodec/ac3dec_fixed.c
@@ -164,6 +164,7 @@ static void ac3_downmix_c_fixed16(int16_t **samples, 
int16_t (*matrix)[2],
 }
 }
 
+#include "eac3dec.c"
 #include "ac3dec.c"
 
 static const AVOption options[] = {
diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c
index e7fc5cb..d74a0df 100644
--- a/libavcodec/ac3dec_float.c
+++ b/libavcodec/ac3dec_float.c
@@ -28,6 +28,7 @@
  * Upmix delay samples from stereo to original channel layout.
  */
 #include "ac3dec.h"
+#include "eac3dec.c"
 #include "ac3dec.c"
 
 static const AVOption options[] = {
diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
index 8e931fd..a6095b5 100644
--- a/libavcodec/eac3dec.c
+++ b/libavcodec/eac3dec.c
@@ -63,11 +63,11 @@ typedef enum {
 
 #define EAC3_SR_CODE_REDUCED  3
 
-void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
+static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
 {
 int bin, bnd, ch, i;
 uint8_t wrapflag[SPX_MAX_BANDS]={1,0,}, num_copy_sections, 
copy_sizes[SPX_MAX_BANDS];
-float rms_energy[SPX_MAX_BANDS];
+INTFLOAT rms_energy[SPX_MAX_BANDS];
 
 /* Set copy index mapping table. Set wrap flags to apply a notch filter at
wrap points later on. */
@@ -101,7 +101,7 @@ void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
 for (i = 0; i < num_copy_sections; i++) {
 memcpy(&s->transform_coeffs[ch][bin],
&s->transform_coeffs[ch][s->spx_dst_start_freq],
-   copy_sizes[i]*sizeof(float));
+   copy_sizes[i]*sizeof(INTFLOAT));
 bin += copy_sizes[i];
 }
 
@@ -109,9 +109,9 @@ void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
 bin = s->spx_src_start_freq;
 for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
 int bandsize = s->spx_band_sizes[bnd];
-float accum = 0.0f;
+INTFLOAT accum = 0.0f;
 for (i = 0; i < bandsize; i++) {
-float coeff = s->transform_coeffs[ch][bin++];
+INTFLOAT coeff = s->transform_coeffs[ch][bin++];
 accum += coeff * coeff;
 }
 rms_energy[bnd] = sqrtf(accum / bandsize);
@@ -124,7 +124,7 @@ void ff_eac3_apply_spectral_extension(AC3DecodeCont

Re: [FFmpeg-devel] [PATCH] ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext

2015-03-13 Thread Christophe Gisquet
Hi,

2015-03-13 22:28 GMT+01:00 Andreas Cadhalpun :
> -int ff_eac3_parse_header(AC3DecodeContext *s);
> +static int ff_eac3_parse_header(AC3DecodeContext *s);

It's somewhat cosmetics, but if these functions become static, they
would better drop the ff_ prefix.

> -float accum = 0.0f;
> +INTFLOAT accum = 0.0f;
[...]
>  for (i = 0; i < bandsize; i++) {
> -float coeff = s->transform_coeffs[ch][bin++];
> +INTFLOAT coeff = s->transform_coeffs[ch][bin++];
>  accum += coeff * coeff;
[...]
> -float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * 
> (1.0f / INT32_MIN);
> -float sscale = s->spx_signal_blend[ch][bnd];
> +INTFLOAT nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] 
> * (1.0f / INT32_MIN);
> +INTFLOAT sscale = s->spx_signal_blend[ch][bnd];
>  for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
> -float noise  = nscale * (int32_t)av_lfg_get(&s->dith_state);
> +INTFLOAT noise  = nscale * 
> (int32_t)av_lfg_get(&s->dith_state);

Does that work at all? I mean, if it's fixedpoint, I would have
expected some renormalization, various things to avoid overflows,
potential warnings because of casts, etc.

And is the output on eac3 samples, eg here:
http://samples.mplayerhq.hu/A-codecs/AC3/eac3/
(particularly the spx ones)
anything listenable?

Maybe the extensions should simply be declared as unsupported by the fp version?

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


Re: [FFmpeg-devel] [PATCH] ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext

2015-03-13 Thread Andreas Cadhalpun
Hi,

On 13.03.2015 22:46, Christophe Gisquet wrote:
> 2015-03-13 22:28 GMT+01:00 Andreas Cadhalpun 
> :
>> -int ff_eac3_parse_header(AC3DecodeContext *s);
>> +static int ff_eac3_parse_header(AC3DecodeContext *s);
> 
> It's somewhat cosmetics, but if these functions become static, they
> would better drop the ff_ prefix.

I don't mind the names, but I tried to keep the changes minimal, to
ease backporting the fix.
The names can be changed in a follow-up patch.

>> -float accum = 0.0f;
>> +INTFLOAT accum = 0.0f;
> [...]
>>  for (i = 0; i < bandsize; i++) {
>> -float coeff = s->transform_coeffs[ch][bin++];
>> +INTFLOAT coeff = s->transform_coeffs[ch][bin++];
>>  accum += coeff * coeff;
> [...]
>> -float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * 
>> (1.0f / INT32_MIN);
>> -float sscale = s->spx_signal_blend[ch][bnd];
>> +INTFLOAT nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] 
>> * (1.0f / INT32_MIN);
>> +INTFLOAT sscale = s->spx_signal_blend[ch][bnd];
>>  for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
>> -float noise  = nscale * (int32_t)av_lfg_get(&s->dith_state);
>> +INTFLOAT noise  = nscale * 
>> (int32_t)av_lfg_get(&s->dith_state);
> 
> Does that work at all? I mean, if it's fixedpoint, I would have
> expected some renormalization, various things to avoid overflows,
> potential warnings because of casts, etc.
> 
> And is the output on eac3 samples, eg here:
> http://samples.mplayerhq.hu/A-codecs/AC3/eac3/
> (particularly the spx ones)
> anything listenable?
> 
> Maybe the extensions should simply be declared as unsupported by the fp 
> version?

It works well enough, I think.
Without this patch:
$ ffmpeg -c:a ac3_fixed -i ./rio_bravo_mono_64_spx.ac3 broken.ac3
[eac3 @ 0x2401560] Estimating duration from bitrate, this may be inaccurate
Input #0, eac3, from '/tmp/rio_bravo_mono_64_spx.ac3':
  Duration: 00:04:22.18, start: 0.00, bitrate: 64 kb/s
Stream #0:0: Audio: ac3, 48000 Hz, mono, s16p, 64 kb/s
Output #0, ac3, to '/tmp/broken.ac3':
  Metadata:
encoder : Lavf56.25.101
Stream #0:0: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
Metadata:
  encoder : Lavc56.26.100 ac3
Stream mapping:
  Stream #0:0 -> #0:0 (ac3 (ac3_fixed) -> ac3 (native))
Press [q] to stop, [?] for help
[ac3_fixed @ 0x24024c0] exponent out-of-range
[ac3_fixed @ 0x24024c0] error decoding the audio block
...
many more such errors
...
[ac3_fixed @ 0x24024c0] exponent out-of-range
[ac3_fixed @ 0x24024c0] error decoding the audio block
Segmentation fault (core dumped)


Make sure the volume is at a low level, when playing the
broken.ac3, or your ears will hurt.

With this patch:
$ ffmpeg -c:a ac3_fixed -i ./rio_bravo_mono_64_spx.ac3 out.ac3
[eac3 @ 0xb5b560] Estimating duration from bitrate, this may be inaccurate
Input #0, eac3, from '/tmp/rio_bravo_mono_64_spx.ac3':
  Duration: 00:04:22.18, start: 0.00, bitrate: 64 kb/s
Stream #0:0: Audio: ac3, 48000 Hz, mono, s16p, 64 kb/s
Output #0, ac3, to '/tmp/out.ac3':
  Metadata:
encoder : Lavf56.25.101
Stream #0:0: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
Metadata:
  encoder : Lavc56.26.100 ac3
Stream mapping:
  Stream #0:0 -> #0:0 (ac3 (ac3_fixed) -> ac3 (native))
Press [q] to stop, [?] for help
size=3072kB time=00:04:22.17 bitrate=  96.0kbits/s
video:0kB audio:3072kB subtitle:0kB other streams:0kB global headers:0kB muxing 
overhead: 0.00%

The out.ac3 sounds much like the input.

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/mxfdec: export user comments metadata

2015-03-13 Thread Mark Reid
On Fri, Mar 13, 2015 at 3:57 AM, Tomas Härdin 
wrote:

> On Fri, 2015-03-06 at 13:24 -0800, Mark Reid wrote:
> > +static int mxf_read_indirect_value(void *arg, AVIOContext *pb, int size)
> > +{
> > +MXFTaggedValue *tagged_value = arg;
> > +uint8_t key[17];
> > +
> > +if (size <= 17)
> > +return 0;
> > +
> > +avio_read(pb, key, 17);
>
> Really Avid, 17 byte keys? OK..
>

Its not really a 17 byte key, the first byte is the endianness, (0x4c == le
and 0x42 == be). I added the byte to the front of the key because I thought
it made identifying the indirect type logic simpler.


> > +/* TODO: handle other types of of indirect values */
> > +if (memcmp(key, mxf_indirect_value_utf16le, 17) == 0) {
> > +return mxf_read_utf16le_string(pb, size - 17,
> &tagged_value->value);
> > +} else if (memcmp(key, mxf_indirect_value_utf16be, 17) == 0) {
> > +return mxf_read_utf16be_string(pb, size - 17,
> &tagged_value->value);
> > +}
> > +return 0;
> > +}
>
> > +static int mxf_parse_package_comments(MXFContext *mxf, AVDictionary
> **pm, MXFPackage *package)
> > +{
> > +MXFTaggedValue *tag;
> > +int size, i;
> > +const char *prefix = "comment_";
> > +char *key = NULL;
> > +
> > +for (i = 0; i < package->comment_count; i++) {
> > +tag = mxf_resolve_strong_ref(mxf, &package->comment_refs[i],
> TaggedValue);
> > +if (!tag || !tag->name || !tag->value)
> > +continue;
> > +
> > +size = strlen(prefix) + strlen(tag->name) + 1;
> > +key = av_mallocz(size);
> > +if (!key)
> > +return AVERROR(ENOMEM);
> > +
> > +strcpy(key, prefix);
> > +strlcat(key, tag->name, size);
>
> snprintf() would make this one line only, or use av_strlcat() like
> Michael suggests. Come to think of it, I'm not sure snprintf() exists on
> all platforms..
>
>
I see snprintf being used quite a lot used throughout the project, I'll try
using that instead,


> > +av_dict_set(pm, key, tag->value, AV_DICT_DONT_STRDUP_KEY);
> > +}
> > +return 0;
> > +}
>
> Looks good overall, even if I wasn't aware of this Avid feature before.
>
>
great, I'm hoping to add setting these metadata keys to mxfenc as well,
because these tags show up in Avid bins as new columns.
I'll submit a new patch fixing the strlcat, thanks for taking the time to
review.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mxfenc: ensure mxf->body_partition_offset is not NULL before using it

2015-03-13 Thread Mark Reid
On Fri, Mar 13, 2015 at 6:02 AM, Andreas Cadhalpun <
andreas.cadhal...@googlemail.com> wrote:

> On 13.03.2015 11:59, Tomas Härdin wrote:
> > On Thu, 2015-03-12 at 17:48 +0100, Andreas Cadhalpun wrote:
> >> This fixes a crash, when trying to mux h264 into mxf_opatom.
> >>
> >> Signed-off-by: Andreas Cadhalpun 
> >> ---
> >>  libavformat/mxfenc.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> >> index 898951c..2891f5d 100644
> >> --- a/libavformat/mxfenc.c
> >> +++ b/libavformat/mxfenc.c
> >> @@ -2358,7 +2358,7 @@ static int mxf_write_footer(AVFormatContext *s)
> >>  mxf_write_random_index_pack(s);
> >>
> >>  if (s->pb->seekable) {
> >> -if (s->oformat == &ff_mxf_opatom_muxer){
> >> +if (s->oformat == &ff_mxf_opatom_muxer &&
> mxf->body_partition_offset){
> >>  /* rewrite body partition to update lengths */
> >>  avio_seek(pb, mxf->body_partition_offset[0], SEEK_SET);
> >>  if ((err = mxf_write_opatom_body_partition(s)) < 0)
> >
> > Doesn't this need to happen for H.264 as well?
>
> Maybe, but the seek can't work if mxf->body_partition_offset is NULL.
> Would it be better to add the check only around the seek?
>
> > A better solution would
> > be to figure out why mxf->body_partition_offset becomes NULL so that
> > index tables and such can be rewritten properly.
>
> It can always happen that mxf->body_partition_offset is NULL, e.g. if
> no memory is left, or if something else fails. Try e.g.:
> ffmpeg -f lavfi -i testsrc -c:v libx264 -f mxf_opatom
>
>
mxf->body_partition_offset is NULL because currently only AVC Intra 50/100
h264 is supported. The encoder figures out the h264 format by parsing the
h264 packet and doesn't write the body partiton (or even the header
partition) untill after it parses the first packet. If the packet is
invalid, nothing get written and mxf->body_partition_offset doesn't get
allocated.  perhaps mxf_write_footer should return a error if
mxf->body_partition_offset is NULL or just if mxf->header_written == 0
 before doing trying to write anything.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2] libavformat/mxfdec: export user comments metadata

2015-03-13 Thread Mark Reid
---
 libavformat/mxf.h|  1 +
 libavformat/mxfdec.c | 94 +---
 2 files changed, 91 insertions(+), 4 deletions(-)

diff --git a/libavformat/mxf.h b/libavformat/mxf.h
index d9e17c6..71a4084 100644
--- a/libavformat/mxf.h
+++ b/libavformat/mxf.h
@@ -47,6 +47,7 @@ enum MXFMetadataSetType {
 EssenceContainerData,
 TypeBottom,// add metadata type before this
 EssenceGroup,
+TaggedValue,
 };
 
 enum MXFFrameLayout {
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index e8fa731..216a9f1 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -144,6 +144,13 @@ typedef struct {
 typedef struct {
 UID uid;
 enum MXFMetadataSetType type;
+char *name;
+char *value;
+} MXFTaggedValue;
+
+typedef struct {
+UID uid;
+enum MXFMetadataSetType type;
 MXFSequence *sequence; /* mandatory, and only one */
 UID sequence_ref;
 int track_id;
@@ -206,6 +213,8 @@ typedef struct MXFPackage {
 MXFDescriptor *descriptor; /* only one */
 UID descriptor_ref;
 char *name;
+UID *comment_refs;
+int comment_count;
 } MXFPackage;
 
 typedef struct MXFMetadataSet {
@@ -282,6 +291,8 @@ static const uint8_t mxf_random_index_pack_key[]   
= { 0x06,0x0e,0x2b,0x
 static const uint8_t mxf_sony_mpeg4_extradata[]= { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 
};
 static const uint8_t mxf_avid_project_name[]   = { 
0xa5,0xfb,0x7b,0x25,0xf6,0x15,0x94,0xb9,0x62,0xfc,0x37,0x17,0x49,0x2d,0x42,0xbf 
};
 static const uint8_t mxf_jp2k_rsiz[]   = { 
0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 
};
+static const uint8_t mxf_indirect_value_utf16le[]  = { 
0x4c,0x00,0x02,0x10,0x01,0x00,0x00,0x00,0x00,0x06,0x0e,0x2b,0x34,0x01,0x04,0x01,0x01
 };
+static const uint8_t mxf_indirect_value_utf16be[]  = { 
0x42,0x01,0x10,0x02,0x00,0x00,0x00,0x00,0x00,0x06,0x0e,0x2b,0x34,0x01,0x04,0x01,0x01
 };
 
 #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
 
@@ -306,6 +317,10 @@ static void mxf_free_metadataset(MXFMetadataSet **ctx, int 
freectx)
 av_freep(&((MXFPackage *)*ctx)->tracks_refs);
 av_freep(&((MXFPackage *)*ctx)->name);
 break;
+case TaggedValue:
+av_freep(&((MXFTaggedValue *)*ctx)->name);
+av_freep(&((MXFTaggedValue *)*ctx)->value);
+break;
 case IndexTableSegment:
 seg = (MXFIndexTableSegment *)*ctx;
 av_freep(&seg->temporal_offset_entries);
@@ -803,7 +818,7 @@ static int mxf_read_essence_group(void *arg, AVIOContext 
*pb, int tag, int size,
 return 0;
 }
 
-static int mxf_read_utf16_string(AVIOContext *pb, int size, char** str)
+static inline int mxf_read_utf16_string(AVIOContext *pb, int size, char** str, 
int be)
 {
 int ret;
 size_t buf_size;
@@ -816,7 +831,12 @@ static int mxf_read_utf16_string(AVIOContext *pb, int 
size, char** str)
 if (!*str)
 return AVERROR(ENOMEM);
 
-if ((ret = avio_get_str16be(pb, size, *str, buf_size)) < 0) {
+if (be)
+ret = avio_get_str16be(pb, size, *str, buf_size);
+else
+ret = avio_get_str16le(pb, size, *str, buf_size);
+
+if (ret < 0) {
 av_freep(str);
 return ret;
 }
@@ -824,6 +844,15 @@ static int mxf_read_utf16_string(AVIOContext *pb, int 
size, char** str)
 return ret;
 }
 
+#define READ_STR16(type, big_endian)   
\
+static int mxf_read_utf16 ## type ##_string(AVIOContext *pb, int size, char** 
str) \
+{  
\
+return mxf_read_utf16_string(pb, size, str, big_endian);   
\
+}
+READ_STR16(be, 1)
+READ_STR16(le, 0)
+#undef READ_STR16
+
 static int mxf_read_package(void *arg, AVIOContext *pb, int tag, int size, UID 
uid, int64_t klv_offset)
 {
 MXFPackage *package = arg;
@@ -840,7 +869,10 @@ static int mxf_read_package(void *arg, AVIOContext *pb, 
int tag, int size, UID u
 avio_read(pb, package->descriptor_ref, 16);
 break;
 case 0x4402:
-return mxf_read_utf16_string(pb, size, &package->name);
+return mxf_read_utf16be_string(pb, size, &package->name);
+case 0x4406:
+return mxf_read_strong_ref_array(pb, &package->comment_refs,
+ &package->comment_count);
 }
 return 0;
 }
@@ -1012,6 +1044,36 @@ static int mxf_read_generic_descriptor(void *arg, 
AVIOContext *pb, int tag, int
 return 0;
 }
 
+static int mxf_read_indirect_value(void *arg, AVIOContext *pb, int size)
+{
+MXFTaggedValue *tagged_value = arg;
+uint8_t key[17];
+
+if (size <= 17)
+return 0;
+
+avio_read(pb, key, 17);
+/* TODO: handle other types of of indirect values */
+if (memcmp(key, mxf_indirect_value_utf16le, 17) == 0) {
+return mxf_read_utf16le_string(pb, 

[FFmpeg-devel] [PATCH v2] libavformat/mxfdec: export user comments metadata

2015-03-13 Thread Mark Reid
changes since v1:
* replaced nonportable strlcat with snprintf

Mark Reid (1):
  libavformat/mxfdec: export user comments metadata

 libavformat/mxf.h|  1 +
 libavformat/mxfdec.c | 94 +---
 2 files changed, 91 insertions(+), 4 deletions(-)

-- 
2.2.1

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


Re: [FFmpeg-devel] [PATCH] ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext

2015-03-13 Thread Michael Niedermayer
On Fri, Mar 13, 2015 at 11:27:22PM +0100, Andreas Cadhalpun wrote:
> Hi,
> 
> On 13.03.2015 22:46, Christophe Gisquet wrote:
> > 2015-03-13 22:28 GMT+01:00 Andreas Cadhalpun 
> > :
> >> -int ff_eac3_parse_header(AC3DecodeContext *s);
> >> +static int ff_eac3_parse_header(AC3DecodeContext *s);
> > 
> > It's somewhat cosmetics, but if these functions become static, they
> > would better drop the ff_ prefix.
> 
> I don't mind the names, but I tried to keep the changes minimal, to
> ease backporting the fix.
> The names can be changed in a follow-up patch.
> 
> >> -float accum = 0.0f;
> >> +INTFLOAT accum = 0.0f;
> > [...]
> >>  for (i = 0; i < bandsize; i++) {
> >> -float coeff = s->transform_coeffs[ch][bin++];
> >> +INTFLOAT coeff = s->transform_coeffs[ch][bin++];
> >>  accum += coeff * coeff;
> > [...]
> >> -float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] 
> >> * (1.0f / INT32_MIN);
> >> -float sscale = s->spx_signal_blend[ch][bnd];
> >> +INTFLOAT nscale = s->spx_noise_blend[ch][bnd] * 
> >> rms_energy[bnd] * (1.0f / INT32_MIN);
> >> +INTFLOAT sscale = s->spx_signal_blend[ch][bnd];
> >>  for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
> >> -float noise  = nscale * 
> >> (int32_t)av_lfg_get(&s->dith_state);
> >> +INTFLOAT noise  = nscale * 
> >> (int32_t)av_lfg_get(&s->dith_state);
> > 
> > Does that work at all? I mean, if it's fixedpoint, I would have
> > expected some renormalization, various things to avoid overflows,
> > potential warnings because of casts, etc.
> > 
> > And is the output on eac3 samples, eg here:
> > http://samples.mplayerhq.hu/A-codecs/AC3/eac3/
> > (particularly the spx ones)
> > anything listenable?
> > 
> > Maybe the extensions should simply be declared as unsupported by the fp 
> > version?
> 
> It works well enough, I think.
> Without this patch:
> $ ffmpeg -c:a ac3_fixed -i ./rio_bravo_mono_64_spx.ac3 broken.ac3
> [eac3 @ 0x2401560] Estimating duration from bitrate, this may be inaccurate
> Input #0, eac3, from '/tmp/rio_bravo_mono_64_spx.ac3':
>   Duration: 00:04:22.18, start: 0.00, bitrate: 64 kb/s
> Stream #0:0: Audio: ac3, 48000 Hz, mono, s16p, 64 kb/s
> Output #0, ac3, to '/tmp/broken.ac3':
>   Metadata:
> encoder : Lavf56.25.101
> Stream #0:0: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
> Metadata:
>   encoder : Lavc56.26.100 ac3
> Stream mapping:
>   Stream #0:0 -> #0:0 (ac3 (ac3_fixed) -> ac3 (native))
> Press [q] to stop, [?] for help
> [ac3_fixed @ 0x24024c0] exponent out-of-range
> [ac3_fixed @ 0x24024c0] error decoding the audio block
> ...
> many more such errors
> ...
> [ac3_fixed @ 0x24024c0] exponent out-of-range
> [ac3_fixed @ 0x24024c0] error decoding the audio block
> Segmentation fault (core dumped)
> 
> 
> Make sure the volume is at a low level, when playing the
> broken.ac3, or your ears will hurt.
> 
> With this patch:
> $ ffmpeg -c:a ac3_fixed -i ./rio_bravo_mono_64_spx.ac3 out.ac3
> [eac3 @ 0xb5b560] Estimating duration from bitrate, this may be inaccurate
> Input #0, eac3, from '/tmp/rio_bravo_mono_64_spx.ac3':
>   Duration: 00:04:22.18, start: 0.00, bitrate: 64 kb/s
> Stream #0:0: Audio: ac3, 48000 Hz, mono, s16p, 64 kb/s
> Output #0, ac3, to '/tmp/out.ac3':
>   Metadata:
> encoder : Lavf56.25.101
> Stream #0:0: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
> Metadata:
>   encoder : Lavc56.26.100 ac3
> Stream mapping:
>   Stream #0:0 -> #0:0 (ac3 (ac3_fixed) -> ac3 (native))
> Press [q] to stop, [?] for help
> size=3072kB time=00:04:22.17 bitrate=  96.0kbits/s
> video:0kB audio:3072kB subtitle:0kB other streams:0kB global headers:0kB 
> muxing overhead: 0.00%
> 
> The out.ac3 sounds much like the input.

for the case i tested the fixed and float differed by stddev ~ 500
fixed that and applied stddev is ~8 now

i think theres something wrong with sscale though as its always 0
even for float

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.


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


Re: [FFmpeg-devel] [PATCH] [PATCH] lavfi: add inverse telecine filter

2015-03-13 Thread Michael Niedermayer
On Wed, Mar 11, 2015 at 03:20:47AM +0530, Himangi Saraogi wrote:
> This is an exact inverse of the telecine filter unlike previously existing
> pullup and fieldmatch ones.
> 
> The algorithm was briefly discussed with Carl. The algorithm is not completely
> tested, though I do have a some sample suggestions and will be testing on
> them soon. Documentation is yet to be added.
> ---
>  Changelog   |   1 +
>  libavfilter/Makefile|   1 +
>  libavfilter/allfilters.c|   1 +
>  libavfilter/vf_detelecine.c | 323 
> 
>  4 files changed, 326 insertions(+)
>  create mode 100644 libavfilter/vf_detelecine.c



> 
> diff --git a/Changelog b/Changelog
> index e88359d..341faca 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -3,6 +3,7 @@ releases are sorted from youngest to oldest.
>  
>  version :
>  - FFT video filter
> +- Detelecine filter
>  
>  
>  version 2.6:
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index b184f07..399072c 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -112,6 +112,7 @@ OBJS-$(CONFIG_DECIMATE_FILTER)   += 
> vf_decimate.o
>  OBJS-$(CONFIG_DEJUDDER_FILTER)   += vf_dejudder.o
>  OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
>  OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
> +OBJS-$(CONFIG_DETELECINE_FILTER)+= vf_detelecine.o
>  OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
>  OBJS-$(CONFIG_DRAWGRID_FILTER)   += vf_drawbox.o
>  OBJS-$(CONFIG_DRAWTEXT_FILTER)   += vf_drawtext.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 043ac56..2e4e2f6 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -128,6 +128,7 @@ void avfilter_register_all(void)
>  REGISTER_FILTER(DEJUDDER,   dejudder,   vf);
>  REGISTER_FILTER(DELOGO, delogo, vf);
>  REGISTER_FILTER(DESHAKE,deshake,vf);
> +REGISTER_FILTER(DETELECINE, detelecine, vf);
>  REGISTER_FILTER(DRAWBOX,drawbox,vf);
>  REGISTER_FILTER(DRAWGRID,   drawgrid,   vf);
>  REGISTER_FILTER(DRAWTEXT,   drawtext,   vf);
> diff --git a/libavfilter/vf_detelecine.c b/libavfilter/vf_detelecine.c
> new file mode 100644
> index 000..ce9ba74
> --- /dev/null
> +++ b/libavfilter/vf_detelecine.c
> @@ -0,0 +1,323 @@
> +/*
> + * Copyright (c) 2015 Himangi Saraogi 
> + *
> + * 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
> + */
> +
> +/**
> + * @file detelecine filter.
> + */
> +
> +#include "libavutil/avstring.h"
> +#include "libavutil/imgutils.h"
> +#include "libavutil/opt.h"
> +#include "libavutil/pixdesc.h"
> +#include "avfilter.h"
> +#include "formats.h"
> +#include "internal.h"
> +#include "video.h"
> +
> +typedef struct {
> +const AVClass *class;
> +int first_field;
> +char *pattern;
> +unsigned int pattern_pos;
> +unsigned int nskip_fields;
> +
> +AVRational pts;
> +double ts_unit;
> +int occupied;
> +
> +int nb_planes;
> +int planeheight[4];
> +int stride[4];
> +
> +AVFrame *frame;
> +AVFrame *temp;
> +} DetelecineContext;
> +
> +#define OFFSET(x) offsetof(DetelecineContext, x)
> +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
> +
> +static const AVOption detelecine_options[] = {
> +{"first_field", "select first field", OFFSET(first_field), 
> AV_OPT_TYPE_INT,   {.i64=0}, 0, 1, FLAGS, "field"},
> +{"top","select top field first",0, 
> AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "field"},
> +{"t",  "select top field first",0, 
> AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "field"},
> +{"bottom", "select bottom field first", 0, 
> AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "field"},
> +{"b",  "select bottom field first", 0, 
> AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "field"},
> +{"pattern", "pattern that describe for how many fields a frame is to be 
> displayed", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str="23"}, 0, 0, FLAGS},
> +{NULL}
> +};
> +
> +AVFILTER_DEFINE_CLASS(detelecine);
> +
> +static av_co