Re: [FFmpeg-devel] Proposed vf_decimate enhancement

2015-09-29 Thread Anshul



On 09/29/2015 12:46 PM, Paul B Mahol wrote:

On 9/29/15, Ray Cole  wrote:

I hope this is the appropriate place to propose an enhancement. This is the
first time I've offered up code to any open source project...so be gentle
:-)

First, I love ffmpeg. Wonderful software and thank you for your efforts.

I have been pulling down a number of movies back to 24 FPS (24000/1001)
using fieldmatch and decimate. However decimate seemed to drop incorrect
frames from time-to-time particularly on scenes with little motion. The
pullup filter likewise made poor decisions under similar circumstances.

So...I modified vf_decimate and it is working very well for me. I make no
claims that the enhancements would work for anyone else. My source is 1080i
29.97 fps movies recording from component video. I'm pulling down to 24 fps
(24000/1001 actually).

The changes are:
1) The total and max diffs are used to find the lowest frame to drop rather
than just the max diff. If these two methods disagree with one another then
it goes through a 'conflict resolution'. The conflict resolution checks to
see if either method matches the most commonly-dropped frame (a simple
short-term history of drops is retained for this purpose). If so, the most
commonly-dropped frame is assumed to be correct. If they do not match then
it uses the last dropped frame. This keeps the filter from varying the frame
drop so often and made a big difference in detection, at least with the
stuff I'm working with.

2) The existing vf_decimate allows frame 4 to be dropped immediately
followed by frame 0 whereas frame 3 dropped could never be followed by frame
4 dropped - similar with frames 0 through 2. Having 2 frames in a row
eligible to be dropped seems wrong and the biggest issue I had was when the
drop cycle was hitting frame 4. So I put in some code that says if the last
frame dropped was frame 4 then frame 0 and frame 1 is not eligible for drop.
If frame 3 was last dropped then frame 0 is not dropped. This enforces 2
undropped frames between drops. I'm not "married" to this...but it did help
quite a bit.

3) I had one movie where frame 4 was ALWAYS the correct frame to drop...so I
added an option to 'lock on' to a pattern in 1 of 2 ways. The first way is
for someone to pass force_drop=x where x is the frame number to drop each
time. The other is passing lock_on=1 to tell it to figure out what frame it
should lock onto. I mainly used this to assist in finding places where the
code was dropping incorrect frames. I'm not sure I really consider this
'useful' for anything other than such testing where you know what should be
dropped. It still goes through all the computations as before but insists on
dropping the specified frame and noting if the computations resulted in a
different frame than requested.

I realize the attached code needs cleanup to conform to standards but I just
wanted to put it up for discussion. The first change above is really the
major change and it could (obviously) be enabled/disabled by an option to
decimate if desired.

-- Ray Cole


Whole file is unacceptable, how one can find what changed?, please
learn how to produce patches.

To produce patch
Hint: > git add
> git commit
> git send mail or > git format   patch

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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix undefined left shifts of negative numbers

2015-09-29 Thread Paul B Mahol
On 9/25/15, Ganesh Ajjanagadde  wrote:
> On Sat, Sep 19, 2015 at 10:18 PM, Ganesh Ajjanagadde
>  wrote:
>> This fixes -Wshift-negative-value reported with clang 3.7+, e.g
>> http://fate.ffmpeg.org/log.cgi?time=20150919172459=compile=x86_64-darwin-clang-polly-notiling-3.7.
>> Note that the patch crucially depends on int >= 32 bits,
>> an assumption made in many places in the codebase.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavcodec/apedec.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
>> index 5536e0f..7b34d26 100644
>> --- a/libavcodec/apedec.c
>> +++ b/libavcodec/apedec.c
>> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
>> version, APEFilter *f,
>>  /* Update the adaption coefficients */
>>  absres = FFABS(res);
>>  if (absres)
>> -*f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
>> +*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>>(25 + (absres <= f->avg*3) + (absres <=
>> f->avg*4/3));
>>  else
>>  *f->adaptcoeffs = 0;
>> --
>> 2.5.2
>>
>
> ping
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

I guess its fine if fate passes.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Proposed vf_decimate enhancement

2015-09-29 Thread Paul B Mahol
On 9/29/15, Ray Cole  wrote:
> I hope this is the appropriate place to propose an enhancement. This is the
> first time I've offered up code to any open source project...so be gentle
> :-)
>
> First, I love ffmpeg. Wonderful software and thank you for your efforts.
>
> I have been pulling down a number of movies back to 24 FPS (24000/1001)
> using fieldmatch and decimate. However decimate seemed to drop incorrect
> frames from time-to-time particularly on scenes with little motion. The
> pullup filter likewise made poor decisions under similar circumstances.
>
> So...I modified vf_decimate and it is working very well for me. I make no
> claims that the enhancements would work for anyone else. My source is 1080i
> 29.97 fps movies recording from component video. I'm pulling down to 24 fps
> (24000/1001 actually).
>
> The changes are:
> 1) The total and max diffs are used to find the lowest frame to drop rather
> than just the max diff. If these two methods disagree with one another then
> it goes through a 'conflict resolution'. The conflict resolution checks to
> see if either method matches the most commonly-dropped frame (a simple
> short-term history of drops is retained for this purpose). If so, the most
> commonly-dropped frame is assumed to be correct. If they do not match then
> it uses the last dropped frame. This keeps the filter from varying the frame
> drop so often and made a big difference in detection, at least with the
> stuff I'm working with.
>
> 2) The existing vf_decimate allows frame 4 to be dropped immediately
> followed by frame 0 whereas frame 3 dropped could never be followed by frame
> 4 dropped - similar with frames 0 through 2. Having 2 frames in a row
> eligible to be dropped seems wrong and the biggest issue I had was when the
> drop cycle was hitting frame 4. So I put in some code that says if the last
> frame dropped was frame 4 then frame 0 and frame 1 is not eligible for drop.
> If frame 3 was last dropped then frame 0 is not dropped. This enforces 2
> undropped frames between drops. I'm not "married" to this...but it did help
> quite a bit.
>
> 3) I had one movie where frame 4 was ALWAYS the correct frame to drop...so I
> added an option to 'lock on' to a pattern in 1 of 2 ways. The first way is
> for someone to pass force_drop=x where x is the frame number to drop each
> time. The other is passing lock_on=1 to tell it to figure out what frame it
> should lock onto. I mainly used this to assist in finding places where the
> code was dropping incorrect frames. I'm not sure I really consider this
> 'useful' for anything other than such testing where you know what should be
> dropped. It still goes through all the computations as before but insists on
> dropping the specified frame and noting if the computations resulted in a
> different frame than requested.
>
> I realize the attached code needs cleanup to conform to standards but I just
> wanted to put it up for discussion. The first change above is really the
> major change and it could (obviously) be enabled/disabled by an option to
> decimate if desired.
>
> -- Ray Cole
>

Whole file is unacceptable, how one can find what changed?, please
learn how to produce patches.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Adding Closed Caption support to Decklink output

2015-09-29 Thread Carl Eugen Hoyos
Deron  pagestream.org> writes:

> For this to work, I have to output 10 bit YUV ‘v210’ 
> 4:2:2 representation (twelve 10-bit unsigned components 
> packed into four 32-bit little-endian words).

Can't you use the v210 encoder to produce this format?

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


Re: [FFmpeg-devel] [PATCH] ffmpeg/web/index: add news describing GSoC 2015 program outcome

2015-09-29 Thread Lou Logan
On Sun, Sep 27, 2015, at 08:55 AM, Stefano Sabatini wrote:
>
> + 0001-ffmpeg-web-index-add-news-describing-GSoC-2015-progr.patch
>   10k (text/x-diff)

LGTM. Thanks for writing this.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg/web/index: add news describing GSoC 2015 program outcome

2015-09-29 Thread Stefano Sabatini
On date Monday 2015-09-28 22:20:53 -0800, Lou Logan encoded:
> On Sun, Sep 27, 2015, at 08:55 AM, Stefano Sabatini wrote:
> >
> > + 0001-ffmpeg-web-index-add-news-describing-GSoC-2015-progr.patch
> >   10k (text/x-diff)
> 
> LGTM. Thanks for writing this.

Thanks all for the reviews, finally applied.
-- 
FFmpeg = Faithful Formidable Multipurpose Purposeless Exciting Gladiator
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Proposed vf_decimate enhancement

2015-09-29 Thread Carl Eugen Hoyos
Ray Cole  gmail.com> writes:

> I hope this is the appropriate place to propose an enhancement.

Yes but please read https://ffmpeg.org/developer.html

Carl Eugen

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


[FFmpeg-devel] [PATCH v2 3/8] libkvazaar: Remove unnecessary NULL checks

2015-09-29 Thread Arttu Ylä-Outinen
Signed-off-by: Arttu Ylä-Outinen 
---
 libavcodec/libkvazaar.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 7430e0a..aaaf1f7 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -106,8 +106,8 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
 cfg = NULL;
 
 done:
-if (cfg) api->config_destroy(cfg);
-if (enc) api->encoder_close(enc);
+api->config_destroy(cfg);
+api->encoder_close(enc);
 
 return retval;
 }
@@ -215,8 +215,8 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 }
 
 done:
-if (img_in) ctx->api->picture_free(img_in);
-if (data_out) ctx->api->chunk_free(data_out);
+ctx->api->picture_free(img_in);
+ctx->api->chunk_free(data_out);
 return retval;
 }
 
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH v2 7/8] libkvazaar: Fix setting framerate

2015-09-29 Thread Arttu Ylä-Outinen
The divisor and dividend in the equation had been swapped, making the
result the inverse of the actual framerate.

Signed-off-by: Arttu Ylä-Outinen 
---
v2: Fix error in the commit message (bitrate --> framerate).
---
 libavcodec/libkvazaar.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 0879844..0cf890f 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -73,7 +73,7 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
 cfg->width = avctx->width;
 cfg->height = avctx->height;
 cfg->framerate =
-  (double)(avctx->time_base.num * avctx->ticks_per_frame) / 
avctx->time_base.den;
+  avctx->time_base.den / (double)(avctx->time_base.num * 
avctx->ticks_per_frame);
 cfg->threads = avctx->thread_count;
 cfg->target_bitrate = avctx->bit_rate;
 cfg->vui.sar_width = avctx->sample_aspect_ratio.num;
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH v2 8/8] doc/encoders: Fix libkvazaar documentation

2015-09-29 Thread Arttu Ylä-Outinen
The -threads option is ignored with libkvazaar since it does not have
any of the AV_CODEC_CAP_{FRAME,SLICE,AUTO}_THREADS capabilities. This
commit removes the incorrect documentation as well as the no-op of
setting the number of threads in libkvazaar encoder.

Signed-off-by: Arttu Ylä-Outinen 
---
v2: Rewrite the commit message to communicate why the parameter did not
work and that the patch also touches libkvazaar.c.
---
 doc/encoders.texi   |3 ---
 libavcodec/libkvazaar.c |1 -
 2 files changed, 4 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 3550bcc..bf364fd 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2397,9 +2397,6 @@ configuration. You need to explicitly configure the build 
with
 @item b
 Set target video bitrate in bit/s and enable rate control.
 
-@item threads
-Set number of encoding threads.
-
 @item kvazaar-params
 Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
 by commas (,). See kvazaar documentation for a list of options.
diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 0cf890f..3000f6a 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -74,7 +74,6 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
 cfg->height = avctx->height;
 cfg->framerate =
   avctx->time_base.den / (double)(avctx->time_base.num * 
avctx->ticks_per_frame);
-cfg->threads = avctx->thread_count;
 cfg->target_bitrate = avctx->bit_rate;
 cfg->vui.sar_width = avctx->sample_aspect_ratio.num;
 cfg->vui.sar_height = avctx->sample_aspect_ratio.den;
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH v2 4/8] libkvazaar: Replace asserts with proper errors

2015-09-29 Thread Arttu Ylä-Outinen
Changes function libkvazaar_encode to return proper error codes instead
of crashing when the video dimensions or pixel format change in the
middle of encoding.

Signed-off-by: Arttu Ylä-Outinen 
---
 libavcodec/libkvazaar.c |   24 +---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index aaaf1f7..a15700a 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -26,6 +26,7 @@
 #include "libavutil/avassert.h"
 #include "libavutil/dict.h"
 #include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "internal.h"
 
@@ -149,9 +150,26 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 if (frame) {
 int i = 0;
 
-av_assert0(frame->width == ctx->config->width);
-av_assert0(frame->height == ctx->config->height);
-av_assert0(frame->format == avctx->pix_fmt);
+if (frame->width != ctx->config->width ||
+frame->height != ctx->config->height) {
+av_log(avctx, AV_LOG_ERROR,
+   "Changing video dimensions during encoding is not 
supported. "
+   "(changed from %dx%d to %dx%d)\n",
+   ctx->config->width, ctx->config->height,
+   frame->width, frame->height);
+retval = AVERROR_INVALIDDATA;
+goto done;
+}
+
+if (frame->format != avctx->pix_fmt) {
+av_log(avctx, AV_LOG_ERROR,
+   "Changing pixel format during encoding is not supported. "
+   "(changed from %s to %s)\n",
+   av_get_pix_fmt_name(avctx->pix_fmt),
+   av_get_pix_fmt_name(frame->format));
+retval = AVERROR_INVALIDDATA;
+goto done;
+}
 
 // Allocate input picture for kvazaar.
 img_in = ctx->api->picture_alloc(frame->width, frame->height);
-- 
1.7.9.5

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


Re: [FFmpeg-devel] Proposed vf_decimate enhancement

2015-09-29 Thread Ray Cole

Thank you.

I know I have a number of coding style things to clean up before this could be 
accepted (as well as removing some output I'm logging as info) but perhaps 
those familiar with the decimate filter can see if the changes being proposed 
make sense.

-- Ray

On 09/29/2015 07:32 AM, compn wrote:

On Mon, 28 Sep 2015 21:31:59 -0500
Ray Cole  wrote:


This is the first time I've offered up code to any open source
project...so be gentle :-)

ehe, patches are what the devs want, either git diff or diff -u...

i've downloaded and diff'ed your filter to ffmpeg git master and
attached it in this mail.

-compn


___
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] lavf/img2dec: Fix memory leak

2015-09-29 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 12:29:52PM +0200, Przemysław Sobala wrote:
> W dniu 29.09.2015 o 12:22, Hendrik Leppkes pisze:
> >On Tue, Sep 29, 2015 at 12:14 PM, Przemysław Sobala
> > wrote:
> >>Fixes #4886
> >>---
> >>  libavformat/img2dec.c | 6 +-
> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >>
> >>diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> >>index 70f0b09..fcd2b76 100644
> >>--- a/libavformat/img2dec.c
> >>+++ b/libavformat/img2dec.c
> >>@@ -444,8 +444,12 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket 
> >>*pkt)
> >>  }
> >>
> >>  res = av_new_packet(pkt, size[0] + size[1] + size[2]);
> >>-if (res < 0)
> >>+if (res < 0) {
> >>+for (i = 0; i < 3; i++) {
> >>+avio_closep([i]);
> >>+}
> >>  return res;
> >>+}
> >>  pkt->stream_index = 0;
> >>  pkt->flags   |= AV_PKT_FLAG_KEY;
> >>  if (s->ts_from_file) {
> >>--
> >>1.8.3.1
> >>
> >
> >This needs a !s->is_pipe check, otherwise it shall not be closed.
> 
> OK. New patch attached,
> 
> 
> Główne Spółki Grupy Wirtualna Polska:
> 
> Wirtualna Polska Holding Spółka Akcyjna z siedzibą w Warszawie, ul. Jutrzenki 
> 137A, 02-231 Warszawa, wpisana do Krajowego Rejestru Sądowego - Rejestru 
> Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. Warszawy w 
> Warszawie pod nr KRS: 407130, kapitał zakładowy: 1 245 651,90 zł (w 
> całości wpłacony), Numer Identyfikacji Podatkowej (NIP): 521-31-11-513
> 
> Grupa Wirtualna Polska Spółka z ograniczoną odpowiedzialnością z siedzibą w 
> Warszawie, ul. Jutrzenki 137A, 02-231 Warszawa, wpisana do Krajowego Rejestru 
> Sądowego - Rejestru Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. 
> Warszawy w Warszawie pod nr KRS: 373814, kapitał zakładowy: 317 957 
> 800,00 zł, Numer Identyfikacji Podatkowej (NIP): 527-26-45-593
> 
> WP Shopping Spółka z ograniczoną odpowiedzialnością z siedzibą w Gdańsku, ul. 
> Romualda Traugutta 115 C, 80-226 Gdańsk, wpisana do Krajowego Rejestru 
> Sądowego - Rejestru Przedsiębiorców prowadzonego przez Sąd Rejonowy Gdańsk - 
> Północ w Gdańsku pod nr KRS: 546914, kapitał zakładowy: 170.000,00 
> złotych (w całości wpłacony), Numer Identyfikacji Podatkowej (NIP): 
> 957-07-51-216

>  img2dec.c |8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 00cb9e3142332355e507c989c285ffe34a44de80  
> 0001-lavf-img2dec-Fix-memory-leak.patch
> From c7b66f88c21498b2ef603c2753cc24337e05ac07 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Przemys=C5=82aw=20Sobala?= 
> Date: Tue, 29 Sep 2015 10:49:49 +0200
> Subject: [PATCH] lavf/img2dec: Fix memory leak
> 
> Fixes #4886
> ---
>  libavformat/img2dec.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> index 70f0b09..a0a4c71 100644
> --- a/libavformat/img2dec.c
> +++ b/libavformat/img2dec.c
> @@ -444,8 +444,14 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket 
> *pkt)
>  }
>  
>  res = av_new_packet(pkt, size[0] + size[1] + size[2]);
> -if (res < 0)
> +if (res < 0) {
> +if (!s->is_pipe) {
> +for (i = 0; i < 3; i++) {
> +avio_closep([i]);
> +}
> +}
>  return res;
> +}

there are more return pathes in the function,
if they need this too then it should be placed at the end of the
function and goto-ed to


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix undefined left shifts of negative numbers

2015-09-29 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 08:08:54AM -0400, Ganesh Ajjanagadde wrote:
> On Tue, Sep 29, 2015 at 4:11 AM, Paul B Mahol  wrote:
> > On 9/25/15, Ganesh Ajjanagadde  wrote:
> >> On Sat, Sep 19, 2015 at 10:18 PM, Ganesh Ajjanagadde
> >>  wrote:
> >>> This fixes -Wshift-negative-value reported with clang 3.7+, e.g
> >>> http://fate.ffmpeg.org/log.cgi?time=20150919172459=compile=x86_64-darwin-clang-polly-notiling-3.7.
> >>> Note that the patch crucially depends on int >= 32 bits,
> >>> an assumption made in many places in the codebase.
> >>>
> >>> Signed-off-by: Ganesh Ajjanagadde 
> >>> ---
> >>>  libavcodec/apedec.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
> >>> index 5536e0f..7b34d26 100644
> >>> --- a/libavcodec/apedec.c
> >>> +++ b/libavcodec/apedec.c
> >>> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
> >>> version, APEFilter *f,
> >>>  /* Update the adaption coefficients */
> >>>  absres = FFABS(res);
> >>>  if (absres)
> >>> -*f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
> >>> +*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
> >>>(25 + (absres <= f->avg*3) + (absres <=
> >>> f->avg*4/3));
> >>>  else
> >>>  *f->adaptcoeffs = 0;
> >>> --
> >>> 2.5.2
> >>>
> >>
> >> ping
> >> ___
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >
> > I guess its fine if fate passes.
> 
> Can't confirm that on my end, since I don't know if my fate runs a
> test for this. Can someone tell me an easy way to check if make fate
> tests a particular code or note for future reference?

easy way: add abort() in the codepath that changes
and run fate, if it passes it was not tested

> 
> On the other hand, note that -(1 << n) and (-1 << n) are identical at
> least on GCC and clang, so I think this should be fine.

yes

applied

thx

[...]
-- 
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] lavf/img2dec: Fix memory leak

2015-09-29 Thread Przemysław Sobala
Fixes #4886
---
 libavformat/img2dec.c | 32 +++-
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 70f0b09..2c0fd9a 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -444,14 +444,17 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
 }
 
 res = av_new_packet(pkt, size[0] + size[1] + size[2]);
-if (res < 0)
-return res;
+if (res < 0) {
+goto fail;
+}
 pkt->stream_index = 0;
 pkt->flags   |= AV_PKT_FLAG_KEY;
 if (s->ts_from_file) {
 struct stat img_stat;
-if (stat(filename, _stat))
-return AVERROR(EIO);
+if (stat(filename, _stat)) {
+res = AVERROR(EIO);
+goto fail;
+}
 pkt->pts = (int64_t)img_stat.st_mtime;
 #if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
 if (s->ts_from_file == 2)
@@ -485,18 +488,29 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
 if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) {
 av_free_packet(pkt);
 if (ret[0] < 0) {
-return ret[0];
+res = ret[0];
 } else if (ret[1] < 0) {
-return ret[1];
-} else if (ret[2] < 0)
-return ret[2];
-return AVERROR_EOF;
+res = ret[1];
+} else if (ret[2] < 0) {
+res = ret[2];
+} else {
+res = AVERROR_EOF;
+}
+goto fail;
 } else {
 s->img_count++;
 s->img_number++;
 s->pts++;
 return 0;
 }
+
+fail:
+if (!s->is_pipe) {
+for (i = 0; i < 3; i++) {
+avio_closep([i]);
+}
+}
+return res;
 }
 
 static int img_read_close(struct AVFormatContext* s1)
-- 
1.8.3.1

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


[FFmpeg-devel] [PATCH v2 6/8] libkvazaar: Use av_image_copy for copying pixels

2015-09-29 Thread Arttu Ylä-Outinen
Replaces a for loop for copying pixels by a call to av_image_copy.

Signed-off-by: Arttu Ylä-Outinen 
---
 libavcodec/libkvazaar.c |   24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 9c59cad..0879844 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -24,6 +24,7 @@
 #include 
 
 #include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/dict.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
@@ -149,8 +150,6 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 *got_packet_ptr = 0;
 
 if (frame) {
-int i = 0;
-
 if (frame->width != ctx->config->width ||
 frame->height != ctx->config->height) {
 av_log(avctx, AV_LOG_ERROR,
@@ -181,17 +180,16 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 }
 
 // Copy pixels from frame to img_in.
-for (i = 0; i < 3; ++i) {
-uint8_t *dst = img_in->data[i];
-uint8_t *src = frame->data[i];
-int width = (i == 0) ? frame->width : (frame->width / 2);
-int height = (i == 0) ? frame->height : (frame->height / 2);
-int y = 0;
-for (y = 0; y < height; ++y) {
-memcpy(dst, src, width);
-src += frame->linesize[i];
-dst += width;
-}
+{
+int dst_linesizes[4] = {
+  frame->width,
+  frame->width / 2,
+  frame->width / 2,
+  0
+};
+av_image_copy(img_in->data, dst_linesizes,
+  frame->data, frame->linesize,
+  frame->format, frame->width, frame->height);
 }
 
 img_in->pts = frame->pts;
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH v2 5/8] libkvazaar: Set pts and dts

2015-09-29 Thread Arttu Ylä-Outinen
Signed-off-by: Arttu Ylä-Outinen 
---
 libavcodec/libkvazaar.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index a15700a..9c59cad 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -141,6 +141,7 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 
 kvz_data_chunk *data_out = NULL;
 uint32_t len_out = 0;
+kvz_picture *recon_pic = NULL;
 kvz_frame_info frame_info;
 
 LibkvazaarContext *ctx = avctx->priv_data;
@@ -192,11 +193,13 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 dst += width;
 }
 }
+
+img_in->pts = frame->pts;
 }
 
 if (!ctx->api->encoder_encode(ctx->encoder, img_in,
   _out, _out,
-  NULL, NULL,
+  _pic, NULL,
   _info)) {
 av_log(avctx, AV_LOG_ERROR, "Failed to encode frame.\n");
 retval = AVERROR_EXTERNAL;
@@ -223,6 +226,9 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 ctx->api->chunk_free(data_out);
 data_out = NULL;
 
+avpkt->pts = recon_pic->pts;
+avpkt->dts = recon_pic->dts;
+
 avpkt->flags = 0;
 // IRAP VCL NAL unit types span the range
 // [BLA_W_LP (16), RSV_IRAP_VCL23 (23)].
@@ -234,6 +240,7 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 
 done:
 ctx->api->picture_free(img_in);
+ctx->api->picture_free(recon_pic);
 ctx->api->chunk_free(data_out);
 return retval;
 }
-- 
1.7.9.5

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


Re: [FFmpeg-devel] Proposed vf_decimate enhancement

2015-09-29 Thread compn
On Mon, 28 Sep 2015 21:31:59 -0500
Ray Cole  wrote:

> This is the first time I've offered up code to any open source
> project...so be gentle :-)

ehe, patches are what the devs want, either git diff or diff -u...

i've downloaded and diff'ed your filter to ffmpeg git master and
attached it in this mail.

-compn--- vf_decimate.c   Tue Sep 29 08:30:08 2015
+++ vf_decimatex.c  Tue Sep 29 08:28:22 2015
@@ -51,6 +51,10 @@
 int bdiffsize;
 int64_t *bdiffs;
 
+/* Ray */
+int lastdrop;
+int64_t drop_count[5]; // drop counts
+
 /* options */
 int cycle;
 double dupthresh_flt;
@@ -60,6 +64,9 @@
 int blockx, blocky;
 int ppsrc;
 int chroma;
+int force_drop;
+int lock_on;
+
 } DecimateContext;
 
 #define OFFSET(x) offsetof(DecimateContext, x)
@@ -71,9 +78,13 @@
 { "scthresh",  "set scene change threshold", OFFSET(scthresh_flt),  
AV_OPT_TYPE_DOUBLE, {.dbl = 15.0}, 0, 100, FLAGS },
 { "blockx","set the size of the x-axis blocks used during metric 
calculations", OFFSET(blockx), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
 { "blocky","set the size of the y-axis blocks used during metric 
calculations", OFFSET(blocky), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
-{ "ppsrc", "mark main input as a pre-processed input and activate 
clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, 
FLAGS },
-{ "chroma","set whether or not chroma is considered in the metric 
calculations", OFFSET(chroma), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
+{ "ppsrc", "mark main input as a pre-processed input and activate 
clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, 
FLAGS },
+{ "chroma","set whether or not chroma is considered in the metric 
calculations", OFFSET(chroma), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+{ "force_drop","set to forcefully drop frame X in cycle", 
OFFSET(force_drop), AV_OPT_TYPE_INT, {.i64=-1}, -1, 4, FLAGS },
+{ "lock_on","set to lock on to a cycle", OFFSET(lock_on), 
AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
+
 { NULL }
+
 };
 
 AVFILTER_DEFINE_CLASS(decimate);
@@ -140,13 +151,15 @@
 q->totdiff = 0;
 for (i = 0; i < dm->bdiffsize; i++)
 q->totdiff += bdiffs[i];
+
 q->maxbdiff = maxdiff;
+
 }
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 {
 int scpos = -1, duppos = -1;
-int drop = INT_MIN, i, lowest = 0, ret;
+int drop = INT_MIN, i, lowest = 0, lowest_tot = 0, ret =0;
 AVFilterContext *ctx  = inlink->dst;
 AVFilterLink *outlink = ctx->outputs[0];
 DecimateContext *dm   = ctx->priv;
@@ -176,17 +189,166 @@
 dm->last = av_frame_clone(in);
 dm->fid = 0;
 
+
+// The major change starts here
+
+// First we will NOT consider the 'next' frame in the drop detection because 
that would be wrong.
+// The old code would allow frame 0 to be dropped immediately after frame 4. 
I've not seen a case where that makes sense and
+// frame 0 could never be followed by a drop of 1, nor could frame 1 be 
followed by 2, etc. because of the way detection is
+// performed 5 frames at a time. So first we start at what _should_ be a 
reasonable point to be closer inline with what can
+// happen when frames 0, 1 and 2 are the drops.
+
+   int iStart = 0;
+
+   if (dm->lastdrop == (dm->cycle - 1))  // Do NOT allow it to drop 2 
frames in a row...because that WOULD be wrong...
+  iStart = 2;// Last frame of cycle runs 
chance of consecutive frame drop without this...
+ // Perhaps should force 2 frames 
inbetween? Sure - let's start at 2 for 4, 1 for 3
+   else
+   if (dm->lastdrop == (dm->cycle - 2))  // Do NOT allow it to drop 2 
frames in a row...because that WOULD be wrong...
+  iStart = 1;// Make sure 2 frames skipped 
before next drop
+   
 /* we have a complete cycle, select the frame to drop */
-lowest = 0;
+lowest = iStart; 
+lowest_tot = iStart;
+
+// We will now locate the lowest frame by diff and by total. 
+
 for (i = 0; i < dm->cycle; i++) {
 if (dm->queue[i].totdiff > dm->scthresh)
 scpos = i;
-if (dm->queue[i].maxbdiff < dm->queue[lowest].maxbdiff)
-lowest = i;
+
+   if (i >= iStart || scpos >= 0)  // if in range of eligible for 
pattern drop
+   {
+   if (dm->queue[lowest].maxbdiff == 0 ||
+   dm->queue[i].maxbdiff < dm->queue[lowest].maxbdiff)
+   lowest = i;
+
+   if (dm->queue[lowest_tot].totdiff == 0 ||
+   dm->queue[i].totdiff < dm->queue[lowest_tot].totdiff)
+   lowest_tot = i;
+   };
 }
+
 if (dm->queue[lowest].maxbdiff < 

Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix undefined left shifts of negative numbers

2015-09-29 Thread Ganesh Ajjanagadde
On Tue, Sep 29, 2015 at 9:08 AM, Michael Niedermayer  wrote:
> On Tue, Sep 29, 2015 at 08:08:54AM -0400, Ganesh Ajjanagadde wrote:
>> On Tue, Sep 29, 2015 at 4:11 AM, Paul B Mahol  wrote:
>> > On 9/25/15, Ganesh Ajjanagadde  wrote:
>> >> On Sat, Sep 19, 2015 at 10:18 PM, Ganesh Ajjanagadde
>> >>  wrote:
>> >>> This fixes -Wshift-negative-value reported with clang 3.7+, e.g
>> >>> http://fate.ffmpeg.org/log.cgi?time=20150919172459=compile=x86_64-darwin-clang-polly-notiling-3.7.
>> >>> Note that the patch crucially depends on int >= 32 bits,
>> >>> an assumption made in many places in the codebase.
>> >>>
>> >>> Signed-off-by: Ganesh Ajjanagadde 
>> >>> ---
>> >>>  libavcodec/apedec.c | 2 +-
>> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>>
>> >>> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
>> >>> index 5536e0f..7b34d26 100644
>> >>> --- a/libavcodec/apedec.c
>> >>> +++ b/libavcodec/apedec.c
>> >>> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
>> >>> version, APEFilter *f,
>> >>>  /* Update the adaption coefficients */
>> >>>  absres = FFABS(res);
>> >>>  if (absres)
>> >>> -*f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
>> >>> +*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>> >>>(25 + (absres <= f->avg*3) + (absres 
>> >>> <=
>> >>> f->avg*4/3));
>> >>>  else
>> >>>  *f->adaptcoeffs = 0;
>> >>> --
>> >>> 2.5.2
>> >>>
>> >>
>> >> ping
>> >> ___
>> >> ffmpeg-devel mailing list
>> >> ffmpeg-devel@ffmpeg.org
>> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> >>
>> >
>> > I guess its fine if fate passes.
>>
>> Can't confirm that on my end, since I don't know if my fate runs a
>> test for this. Can someone tell me an easy way to check if make fate
>> tests a particular code or note for future reference?
>
> easy way: add abort() in the codepath that changes
> and run fate, if it passes it was not tested

thanks for the tip.

>
>>
>> On the other hand, note that -(1 << n) and (-1 << n) are identical at
>> least on GCC and clang, so I think this should be fine.
>
> yes
>
> applied
>
> thx
>
> [...]
> --
> 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] Proposed vf_decimate enhancement

2015-09-29 Thread wm4
On Tue, 29 Sep 2015 06:42:53 -0500
Stephen Cole  wrote:

> Thank you for the responses. I assumed the comments would suffice for 
> discussing it initially so one wouldn't have to interpret the patch. I'll 
> produce a diff and resubmit.

A patch is _much_ easier to read.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 0/8] libkvazaar improvements

2015-09-29 Thread Arttu Ylä-Outinen
These patches fix some problems in libkvazaar encoder and update it to work
with the latest git version of Kvazaar. Most notable changes are setting
pts, dts and keyframe flag on the output packets and fixing the calculation
of the framerate.

v2: Add libkvazaar version check and fix descriptions of patches
"libkvazaar: Fix setting target bitrate" and
"doc/encoders: Fix libkvazaar documentation."

Thanks for the comments!

Arttu Ylä-Outinen (8):
  libkvazaar: Update to work with the latest version
  configure: Add version check for libkvazaar
  libkvazaar: Remove unnecessary NULL checks
  libkvazaar: Replace asserts with proper errors
  libkvazaar: Set pts and dts
  libkvazaar: Use av_image_copy for copying pixels
  libkvazaar: Fix setting framerate
  doc/encoders: Fix libkvazaar documentation

 configure   |2 ++
 doc/encoders.texi   |3 --
 libavcodec/libkvazaar.c |   80 ++-
 3 files changed, 60 insertions(+), 25 deletions(-)

-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH v2 1/8] libkvazaar: Update to work with the latest version

2015-09-29 Thread Arttu Ylä-Outinen
Function encoder_encode in Kvazaar API was changed to have new output
parameters: source picture and frame info. Frame info is used to set the
keyframe flag and source picture is ignored.

Signed-off-by: Arttu Ylä-Outinen 
---
 libavcodec/libkvazaar.c |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 9fb5be7..7430e0a 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -137,8 +137,11 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 {
 int retval = 0;
 kvz_picture *img_in = NULL;
+
 kvz_data_chunk *data_out = NULL;
 uint32_t len_out = 0;
+kvz_frame_info frame_info;
+
 LibkvazaarContext *ctx = avctx->priv_data;
 
 *got_packet_ptr = 0;
@@ -173,7 +176,10 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 }
 }
 
-if (!ctx->api->encoder_encode(ctx->encoder, img_in, _out, _out, 
NULL)) {
+if (!ctx->api->encoder_encode(ctx->encoder, img_in,
+  _out, _out,
+  NULL, NULL,
+  _info)) {
 av_log(avctx, AV_LOG_ERROR, "Failed to encode frame.\n");
 retval = AVERROR_EXTERNAL;
 goto done;
@@ -198,6 +204,14 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 
 ctx->api->chunk_free(data_out);
 data_out = NULL;
+
+avpkt->flags = 0;
+// IRAP VCL NAL unit types span the range
+// [BLA_W_LP (16), RSV_IRAP_VCL23 (23)].
+if (frame_info.nal_unit_type >= KVZ_NAL_BLA_W_LP &&
+frame_info.nal_unit_type <= KVZ_NAL_RSV_IRAP_VCL23) {
+avpkt->flags |= AV_PKT_FLAG_KEY;
+}
 }
 
 done:
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH v2 2/8] configure: Add version check for libkvazaar

2015-09-29 Thread Arttu Ylä-Outinen
Signed-off-by: Arttu Ylä-Outinen 
---
v2: Add this patch.
---
 configure |2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index b572d59..30576c1 100755
--- a/configure
+++ b/configure
@@ -5272,6 +5272,8 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
"gsm/gsm.h"; do
done || die "ERROR: libgsm not found"; }
 enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
-lilbc
 enabled libkvazaar&& require_pkg_config kvazaar kvazaar.h kvz_api_get
+ { check_cpp_condition kvazaar.h "KVZ_API_VERSION 
>= 7" ||
+   die "ERROR: kvazaar API version must be at 
least 7."; }
 enabled libmfx&& require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
 enabled libmodplug&& require_pkg_config libmodplug 
libmodplug/modplug.h ModPlug_Load
 enabled libmp3lame&& require "libmp3lame >= 3.98.3" lame/lame.h 
lame_set_VBR_quality -lmp3lame
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix undefined left shifts of negative numbers

2015-09-29 Thread Hendrik Leppkes
On Sun, Sep 20, 2015 at 4:18 AM, Ganesh Ajjanagadde
 wrote:
> This fixes -Wshift-negative-value reported with clang 3.7+, e.g
> http://fate.ffmpeg.org/log.cgi?time=20150919172459=compile=x86_64-darwin-clang-polly-notiling-3.7.
> Note that the patch crucially depends on int >= 32 bits,
> an assumption made in many places in the codebase.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/apedec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
> index 5536e0f..7b34d26 100644
> --- a/libavcodec/apedec.c
> +++ b/libavcodec/apedec.c
> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int 
> version, APEFilter *f,
>  /* Update the adaption coefficients */
>  absres = FFABS(res);
>  if (absres)
> -*f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
> +*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>(25 + (absres <= f->avg*3) + (absres <= 
> f->avg*4/3));
>  else
>  *f->adaptcoeffs = 0;
> --
> 2.5.2
>

After this patch (GCC 5.2, x86)

libavcodec/apedec.c: In function 'do_apply_filter':
libavcodec/apedec.c:1284:44: warning: integer overflow in expression
[-Woverflow]
 *f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 2/8] configure: Add version check for libkvazaar

2015-09-29 Thread Clément Bœsch
On Tue, Sep 29, 2015 at 04:29:09PM +0300, Arttu Ylä-Outinen wrote:
> Signed-off-by: Arttu Ylä-Outinen 
> ---
> v2: Add this patch.
> ---
>  configure |2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/configure b/configure
> index b572d59..30576c1 100755
> --- a/configure
> +++ b/configure
> @@ -5272,6 +5272,8 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
> "gsm/gsm.h"; do
> done || die "ERROR: libgsm not found"; }
>  enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
> -lilbc

>  enabled libkvazaar&& require_pkg_config kvazaar kvazaar.h kvz_api_get
> + { check_cpp_condition kvazaar.h 
> "KVZ_API_VERSION >= 7" ||
> +   die "ERROR: kvazaar API version must be at 
> least 7."; }

Can you do something like require_pkg_config "kvazaar >= 1.2.3" instead?
(see pkg-config --modversion kvazaar)

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix undefined left shifts of negative numbers

2015-09-29 Thread Ganesh Ajjanagadde
On Tue, Sep 29, 2015 at 4:11 AM, Paul B Mahol  wrote:
> On 9/25/15, Ganesh Ajjanagadde  wrote:
>> On Sat, Sep 19, 2015 at 10:18 PM, Ganesh Ajjanagadde
>>  wrote:
>>> This fixes -Wshift-negative-value reported with clang 3.7+, e.g
>>> http://fate.ffmpeg.org/log.cgi?time=20150919172459=compile=x86_64-darwin-clang-polly-notiling-3.7.
>>> Note that the patch crucially depends on int >= 32 bits,
>>> an assumption made in many places in the codebase.
>>>
>>> Signed-off-by: Ganesh Ajjanagadde 
>>> ---
>>>  libavcodec/apedec.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
>>> index 5536e0f..7b34d26 100644
>>> --- a/libavcodec/apedec.c
>>> +++ b/libavcodec/apedec.c
>>> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
>>> version, APEFilter *f,
>>>  /* Update the adaption coefficients */
>>>  absres = FFABS(res);
>>>  if (absres)
>>> -*f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
>>> +*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>>>(25 + (absres <= f->avg*3) + (absres <=
>>> f->avg*4/3));
>>>  else
>>>  *f->adaptcoeffs = 0;
>>> --
>>> 2.5.2
>>>
>>
>> ping
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
> I guess its fine if fate passes.

Can't confirm that on my end, since I don't know if my fate runs a
test for this. Can someone tell me an easy way to check if make fate
tests a particular code or note for future reference?

On the other hand, note that -(1 << n) and (-1 << n) are identical at
least on GCC and clang, so I think this should be fine.

> ___
> 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]select attribute of tee pseudo demuxer may contain multiple stream specifiers

2015-09-29 Thread Bodecs Bela

ping

2015.09.25. 13:28 keltezéssel, Bodecs Bela írta:

Hi All,

currently, select option of tee pseudo muxer may contain only one 
stream specifier. Sometimes I need to use more than one stream specifier.
So I made the following patch. It makes possible to put multiple 
stream specifier into select option separated by comma.

eg. select=\'a:0,v\'
(I choose the comma character as separator because it is similar to 
tee's bsf option separator. bsf option allows multiple values 
separated by comma)


Please consider that put this patch into the official ffmpeg source tree.


thank you,

Bela Bodecs


p.s.:the documentation/web also should alter by this, but I do not 
know where to send this:


select

   Select the streams that should be mapped to the slave output,
   specified by a stream specifier. If not specified, this defaults to
   all the input streams.

+++
 You may use multiple stream specifiers separated by commas (,)  
eg.: a:0,v




From 45330b5bdf77f0b424d2631bddfc61bfdcc5901d Mon Sep 17 00:00:00 2001
From: Bela Bodecs 
Date: Tue, 29 Sep 2015 11:04:05 +0200
Subject: [PATCH]select attribute of tee pseudo demuxer may contain multiple 
stream specifiers
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="1.8.3.1"

This is a multi-part message in MIME format.
--1.8.3.1
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
 libavformat/tee.c | 32 +++-
 1 file changed, 23 insertions(+), 9 deletions(-)


--1.8.3.1
Content-Type: text/x-patch; name="0001-select-by-bb.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-select-by-bb.patch"

diff --git a/libavformat/tee.c b/libavformat/tee.c
index e3d466a..cdbbf86 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -47,6 +47,7 @@ static const char *const slave_opt_open  = "[";
 static const char *const slave_opt_close = "]";
 static const char *const slave_opt_delim = ":]"; /* must have the close too */
 static const char *const slave_bsfs_spec_sep = "/";
+static const char *const slave_select_sep = ",";
 
 static const AVClass tee_muxer_class = {
 .class_name = "Tee muxer",
@@ -142,7 +143,9 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 AVFormatContext *avf2 = NULL;
 AVStream *st, *st2;
 int stream_count;
-
+int fullret;
+char *subselect = NULL, *next_subselect = NULL, *first_subselect;
+
 if ((ret = parse_slave_options(avf, slave, , )) < 0)
 return ret;
 
@@ -172,15 +175,26 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 for (i = 0; i < avf->nb_streams; i++) {
 st = avf->streams[i];
 if (select) {
-ret = avformat_match_stream_specifier(avf, avf->streams[i], 
select);
-if (ret < 0) {
-av_log(avf, AV_LOG_ERROR,
-   "Invalid stream specifier '%s' for output '%s'\n",
-   select, slave);
-goto end;
-}
+fullret = 0;
+first_subselect = select;
+next_subselect = NULL;
+while (subselect = strtok_r(first_subselect, slave_select_sep, 
_subselect)) {
+first_subselect = NULL;
+
+ret = avformat_match_stream_specifier(avf, avf->streams[i], 
subselect);
+if (ret < 0) {
+av_log(avf, AV_LOG_ERROR,
+"Invalid stream specifier '%s' for output '%s'\n",
+subselect, slave);
+goto end;
+}
+if (ret != 0) {
+fullret = 1; // match
+break;
+}
 
-if (ret == 0) { /* no match */
+}
+if (fullret == 0) { /* no match */
 tee_slave->stream_map[i] = -1;
 continue;
 }

--1.8.3.1--


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


[FFmpeg-devel] [PATCH] lavf/img2dec: Fix memory leak

2015-09-29 Thread Przemysław Sobala
Fixes #4886
---
 libavformat/img2dec.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 70f0b09..fcd2b76 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -444,8 +444,12 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
 }
 
 res = av_new_packet(pkt, size[0] + size[1] + size[2]);
-if (res < 0)
+if (res < 0) {
+for (i = 0; i < 3; i++) {
+avio_closep([i]);
+}
 return res;
+}
 pkt->stream_index = 0;
 pkt->flags   |= AV_PKT_FLAG_KEY;
 if (s->ts_from_file) {
-- 
1.8.3.1

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


Re: [FFmpeg-devel] [PATCH] lavf/img2dec: Fix memory leak

2015-09-29 Thread Hendrik Leppkes
On Tue, Sep 29, 2015 at 12:14 PM, Przemysław Sobala
 wrote:
> Fixes #4886
> ---
>  libavformat/img2dec.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> index 70f0b09..fcd2b76 100644
> --- a/libavformat/img2dec.c
> +++ b/libavformat/img2dec.c
> @@ -444,8 +444,12 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket 
> *pkt)
>  }
>
>  res = av_new_packet(pkt, size[0] + size[1] + size[2]);
> -if (res < 0)
> +if (res < 0) {
> +for (i = 0; i < 3; i++) {
> +avio_closep([i]);
> +}
>  return res;
> +}
>  pkt->stream_index = 0;
>  pkt->flags   |= AV_PKT_FLAG_KEY;
>  if (s->ts_from_file) {
> --
> 1.8.3.1
>

This needs a !s->is_pipe check, otherwise it shall not be closed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/img2dec: Fix memory leak

2015-09-29 Thread Przemysław Sobala

W dniu 29.09.2015 o 12:22, Hendrik Leppkes pisze:

On Tue, Sep 29, 2015 at 12:14 PM, Przemysław Sobala
 wrote:

Fixes #4886
---
  libavformat/img2dec.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 70f0b09..fcd2b76 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -444,8 +444,12 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
  }

  res = av_new_packet(pkt, size[0] + size[1] + size[2]);
-if (res < 0)
+if (res < 0) {
+for (i = 0; i < 3; i++) {
+avio_closep([i]);
+}
  return res;
+}
  pkt->stream_index = 0;
  pkt->flags   |= AV_PKT_FLAG_KEY;
  if (s->ts_from_file) {
--
1.8.3.1



This needs a !s->is_pipe check, otherwise it shall not be closed.


OK. New patch attached,


Główne Spółki Grupy Wirtualna Polska:

Wirtualna Polska Holding Spółka Akcyjna z siedzibą w Warszawie, ul. Jutrzenki 
137A, 02-231 Warszawa, wpisana do Krajowego Rejestru Sądowego - Rejestru 
Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. Warszawy w Warszawie 
pod nr KRS: 407130, kapitał zakładowy: 1 245 651,90 zł (w całości 
wpłacony), Numer Identyfikacji Podatkowej (NIP): 521-31-11-513

Grupa Wirtualna Polska Spółka z ograniczoną odpowiedzialnością z siedzibą w 
Warszawie, ul. Jutrzenki 137A, 02-231 Warszawa, wpisana do Krajowego Rejestru 
Sądowego - Rejestru Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. 
Warszawy w Warszawie pod nr KRS: 373814, kapitał zakładowy: 317 957 800,00 
zł, Numer Identyfikacji Podatkowej (NIP): 527-26-45-593

WP Shopping Spółka z ograniczoną odpowiedzialnością z siedzibą w Gdańsku, ul. 
Romualda Traugutta 115 C, 80-226 Gdańsk, wpisana do Krajowego Rejestru Sądowego 
- Rejestru Przedsiębiorców prowadzonego przez Sąd Rejonowy Gdańsk - Północ w 
Gdańsku pod nr KRS: 546914, kapitał zakładowy: 170.000,00 złotych (w 
całości wpłacony), Numer Identyfikacji Podatkowej (NIP): 957-07-51-216
>From c7b66f88c21498b2ef603c2753cc24337e05ac07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Przemys=C5=82aw=20Sobala?= 
Date: Tue, 29 Sep 2015 10:49:49 +0200
Subject: [PATCH] lavf/img2dec: Fix memory leak

Fixes #4886
---
 libavformat/img2dec.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 70f0b09..a0a4c71 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -444,8 +444,14 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
 }
 
 res = av_new_packet(pkt, size[0] + size[1] + size[2]);
-if (res < 0)
+if (res < 0) {
+if (!s->is_pipe) {
+for (i = 0; i < 3; i++) {
+avio_closep([i]);
+}
+}
 return res;
+}
 pkt->stream_index = 0;
 pkt->flags   |= AV_PKT_FLAG_KEY;
 if (s->ts_from_file) {
-- 
1.8.3.1

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


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/x86/rnd_template: silence -Wunused-function on --disable-mmx

2015-09-29 Thread Ganesh Ajjanagadde
On Sat, Sep 19, 2015 at 11:39 AM, Ganesh Ajjanagadde
 wrote:
> This silences some of the -Wunused-function warnings when compiled with 
> --disable-mmx, e.g
> http://fate.ffmpeg.org/log.cgi?time=20150919094617=compile=x86_64-archlinux-gcc-disable-mmx.
> Header guards are too brittle and ugly for this case.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/x86/rnd_template.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/x86/rnd_template.c b/libavcodec/x86/rnd_template.c
> index c9fd71e..ddca4eb 100644
> --- a/libavcodec/x86/rnd_template.c
> +++ b/libavcodec/x86/rnd_template.c
> @@ -30,7 +30,7 @@
>  #include "inline_asm.h"
>
>  // put_pixels
> -STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
> +av_unused STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t 
> *pixels,
>ptrdiff_t line_size, int h)
>  {
>  MOVQ_ZERO(mm7);
> @@ -99,7 +99,7 @@ STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const 
> uint8_t *pixels,
>
>  // avg_pixels
>  // this routine is 'slightly' suboptimal but mostly unused
> -STATIC void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
> +av_unused STATIC void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t 
> *pixels,
>ptrdiff_t line_size, int h)
>  {
>  MOVQ_ZERO(mm7);
> --
> 2.5.2
>

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


Re: [FFmpeg-devel] Proposed vf_decimate enhancement

2015-09-29 Thread Stephen Cole
Thank you for the responses. I assumed the comments would suffice for 
discussing it initially so one wouldn't have to interpret the patch. I'll 
produce a diff and resubmit.

> On Sep 29, 2015, at 2:16 AM, Paul B Mahol  wrote:
> 
>> On 9/29/15, Ray Cole  wrote:
>> I hope this is the appropriate place to propose an enhancement. This is the
>> first time I've offered up code to any open source project...so be gentle
>> :-)
>> 
>> First, I love ffmpeg. Wonderful software and thank you for your efforts.
>> 
>> I have been pulling down a number of movies back to 24 FPS (24000/1001)
>> using fieldmatch and decimate. However decimate seemed to drop incorrect
>> frames from time-to-time particularly on scenes with little motion. The
>> pullup filter likewise made poor decisions under similar circumstances.
>> 
>> So...I modified vf_decimate and it is working very well for me. I make no
>> claims that the enhancements would work for anyone else. My source is 1080i
>> 29.97 fps movies recording from component video. I'm pulling down to 24 fps
>> (24000/1001 actually).
>> 
>> The changes are:
>> 1) The total and max diffs are used to find the lowest frame to drop rather
>> than just the max diff. If these two methods disagree with one another then
>> it goes through a 'conflict resolution'. The conflict resolution checks to
>> see if either method matches the most commonly-dropped frame (a simple
>> short-term history of drops is retained for this purpose). If so, the most
>> commonly-dropped frame is assumed to be correct. If they do not match then
>> it uses the last dropped frame. This keeps the filter from varying the frame
>> drop so often and made a big difference in detection, at least with the
>> stuff I'm working with.
>> 
>> 2) The existing vf_decimate allows frame 4 to be dropped immediately
>> followed by frame 0 whereas frame 3 dropped could never be followed by frame
>> 4 dropped - similar with frames 0 through 2. Having 2 frames in a row
>> eligible to be dropped seems wrong and the biggest issue I had was when the
>> drop cycle was hitting frame 4. So I put in some code that says if the last
>> frame dropped was frame 4 then frame 0 and frame 1 is not eligible for drop.
>> If frame 3 was last dropped then frame 0 is not dropped. This enforces 2
>> undropped frames between drops. I'm not "married" to this...but it did help
>> quite a bit.
>> 
>> 3) I had one movie where frame 4 was ALWAYS the correct frame to drop...so I
>> added an option to 'lock on' to a pattern in 1 of 2 ways. The first way is
>> for someone to pass force_drop=x where x is the frame number to drop each
>> time. The other is passing lock_on=1 to tell it to figure out what frame it
>> should lock onto. I mainly used this to assist in finding places where the
>> code was dropping incorrect frames. I'm not sure I really consider this
>> 'useful' for anything other than such testing where you know what should be
>> dropped. It still goes through all the computations as before but insists on
>> dropping the specified frame and noting if the computations resulted in a
>> different frame than requested.
>> 
>> I realize the attached code needs cleanup to conform to standards but I just
>> wanted to put it up for discussion. The first change above is really the
>> major change and it could (obviously) be enabled/disabled by an option to
>> decimate if desired.
>> 
>> -- Ray Cole
> 
> Whole file is unacceptable, how one can find what changed?, please
> learn how to produce patches.
> ___
> 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] avcodec/apedec: fix undefined left shifts of negative numbers

2015-09-29 Thread Ronald S. Bultje
Hi,

On Tue, Sep 29, 2015 at 11:04 AM, Ganesh Ajjanagadde 
wrote:

> On Tue, Sep 29, 2015 at 9:24 AM, Hendrik Leppkes 
> wrote:
> > On Sun, Sep 20, 2015 at 4:18 AM, Ganesh Ajjanagadde
> >  wrote:
> >> This fixes -Wshift-negative-value reported with clang 3.7+, e.g
> >>
> http://fate.ffmpeg.org/log.cgi?time=20150919172459=compile=x86_64-darwin-clang-polly-notiling-3.7
> .
> >> Note that the patch crucially depends on int >= 32 bits,
> >> an assumption made in many places in the codebase.
> >>
> >> Signed-off-by: Ganesh Ajjanagadde 
> >> ---
> >>  libavcodec/apedec.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
> >> index 5536e0f..7b34d26 100644
> >> --- a/libavcodec/apedec.c
> >> +++ b/libavcodec/apedec.c
> >> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
> version, APEFilter *f,
> >>  /* Update the adaption coefficients */
> >>  absres = FFABS(res);
> >>  if (absres)
> >> -*f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
> >> +*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
> >>(25 + (absres <= f->avg*3) + (absres
> <= f->avg*4/3));
> >>  else
> >>  *f->adaptcoeffs = 0;
> >> --
> >> 2.5.2
> >>
> >
> > After this patch (GCC 5.2, x86)
> >
> > libavcodec/apedec.c: In function 'do_apply_filter':
> > libavcodec/apedec.c:1284:44: warning: integer overflow in expression
> > [-Woverflow]
> >  *f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>
> Good catch - made an off by one error in my assumptions. I don't see a
> nice, clean way of dealing with -(1 << 31).
> I propose one of the following:
> 1. use INT32_MIN.
> 2. use an explicit binary/hexadecimal mask.
> 3. use e.g (-2)*(1<<30).


0x8000U is fine.

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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix undefined left shifts of negative numbers

2015-09-29 Thread Ganesh Ajjanagadde
On Tue, Sep 29, 2015 at 9:24 AM, Hendrik Leppkes  wrote:
> On Sun, Sep 20, 2015 at 4:18 AM, Ganesh Ajjanagadde
>  wrote:
>> This fixes -Wshift-negative-value reported with clang 3.7+, e.g
>> http://fate.ffmpeg.org/log.cgi?time=20150919172459=compile=x86_64-darwin-clang-polly-notiling-3.7.
>> Note that the patch crucially depends on int >= 32 bits,
>> an assumption made in many places in the codebase.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavcodec/apedec.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
>> index 5536e0f..7b34d26 100644
>> --- a/libavcodec/apedec.c
>> +++ b/libavcodec/apedec.c
>> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int 
>> version, APEFilter *f,
>>  /* Update the adaption coefficients */
>>  absres = FFABS(res);
>>  if (absres)
>> -*f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
>> +*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>>(25 + (absres <= f->avg*3) + (absres <= 
>> f->avg*4/3));
>>  else
>>  *f->adaptcoeffs = 0;
>> --
>> 2.5.2
>>
>
> After this patch (GCC 5.2, x86)
>
> libavcodec/apedec.c: In function 'do_apply_filter':
> libavcodec/apedec.c:1284:44: warning: integer overflow in expression
> [-Woverflow]
>  *f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>

Good catch - made an off by one error in my assumptions. I don't see a
nice, clean way of dealing with -(1 << 31).
I propose one of the following:
1. use INT32_MIN.
2. use an explicit binary/hexadecimal mask.
3. use e.g (-2)*(1<<30).

I have no preference, and will post updated patch within the next few
days, unless someone does the trivial fix and pushes before then.

> ___
> 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] Proposed vf_decimate enhancement

2015-09-29 Thread Ray Cole

Here is an updated patch. I cleaned the code up to hopefully be closer to 
standards. It works well for me, but your mileage may vary...

--- vf_decimate.c   2015-09-29 10:56:46.171698492 -0500
+++ vf_decimatex.c  2015-09-29 10:59:50.679695685 -0500
@@ -27,6 +27,7 @@
 
 #define INPUT_MAIN 0
 #define INPUT_CLEANSRC 1
+#define DROP_HISTORY   8
 
 struct qitem {
 AVFrame *frame;
@@ -51,6 +52,10 @@
 int bdiffsize;
 int64_t *bdiffs;
 
+/* Ray */
+int lastdrop;
+int64_t drop_count[25]; // drop counts
+
 /* options */
 int cycle;
 double dupthresh_flt;
@@ -60,6 +65,9 @@
 int blockx, blocky;
 int ppsrc;
 int chroma;
+int force_drop;
+int lock_on;
+
 } DecimateContext;
 
 #define OFFSET(x) offsetof(DecimateContext, x)
@@ -71,9 +79,13 @@
 { "scthresh",  "set scene change threshold", OFFSET(scthresh_flt),  
AV_OPT_TYPE_DOUBLE, {.dbl = 15.0}, 0, 100, FLAGS },
 { "blockx","set the size of the x-axis blocks used during metric 
calculations", OFFSET(blockx), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
 { "blocky","set the size of the y-axis blocks used during metric 
calculations", OFFSET(blocky), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
-{ "ppsrc", "mark main input as a pre-processed input and activate 
clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, 
FLAGS },
-{ "chroma","set whether or not chroma is considered in the metric 
calculations", OFFSET(chroma), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
+{ "ppsrc", "mark main input as a pre-processed input and activate 
clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, 
FLAGS },
+{ "chroma","set whether or not chroma is considered in the metric 
calculations", OFFSET(chroma), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+{ "force_drop","set to forcefully drop frame X in cycle", 
OFFSET(force_drop), AV_OPT_TYPE_INT, {.i64=-1}, -1, 4, FLAGS },
+{ "lock_on","set to lock on to a cycle", OFFSET(lock_on), 
AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
+
 { NULL }
+
 };
 
 AVFILTER_DEFINE_CLASS(decimate);
@@ -140,13 +152,15 @@
 q->totdiff = 0;
 for (i = 0; i < dm->bdiffsize; i++)
 q->totdiff += bdiffs[i];
+
 q->maxbdiff = maxdiff;
+
 }
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 {
-int scpos = -1, duppos = -1;
-int drop = INT_MIN, i, lowest = 0, ret;
+int scpos = -1, duppos = -1, common = 0, start = 0;
+int drop = INT_MIN, i, lowest = 0, lowest_tot = 0, ret =0;
 AVFilterContext *ctx  = inlink->dst;
 AVFilterLink *outlink = ctx->outputs[0];
 DecimateContext *dm   = ctx->priv;
@@ -176,17 +190,128 @@
 dm->last = av_frame_clone(in);
 dm->fid = 0;
 
+
+// The major change starts here
+
+// First we will NOT consider the 'next' frame in the drop detection because 
that would be wrong.
+// The old code would allow frame 0 to be dropped immediately after frame 4. 
I've not seen a case where that makes sense and
+// frame 0 could never be followed by a drop of 1, nor could frame 1 be 
followed by 2, etc. because of the way detection is
+// performed 5 frames at a time. So first we start at what _should_ be a 
reasonable point to be closer inline with what can
+// happen when frames 0, 1 and 2 are the drops.
+
+start = 0;
+
+if (dm->lastdrop == (dm->cycle - 1))  
+   start = 2; 
+else
+if (dm->lastdrop == (dm->cycle - 2))  
+   start = 1;
+
 /* we have a complete cycle, select the frame to drop */
-lowest = 0;
+lowest = start;  
+lowest_tot = start;
+
+// We will now locate the lowest frame by diff and by total. 
+
 for (i = 0; i < dm->cycle; i++) {
 if (dm->queue[i].totdiff > dm->scthresh)
 scpos = i;
-if (dm->queue[i].maxbdiff < dm->queue[lowest].maxbdiff)
-lowest = i;
+
+if (i >= start || scpos >= 0) {// if in range of eligible for 
pattern drop
+if (dm->queue[lowest].maxbdiff == 0 ||
+dm->queue[i].maxbdiff < dm->queue[lowest].maxbdiff)
+
+lowest = i;
+
+if (dm->queue[lowest_tot].totdiff == 0 ||
+dm->queue[i].totdiff < dm->queue[lowest_tot].totdiff)
+
+lowest_tot = i;
+}
+
 }
+
 if (dm->queue[lowest].maxbdiff < dm->dupthresh)
 duppos = lowest;
-drop = scpos >= 0 && duppos < 0 ? scpos : lowest;
+
+// If the lowest from by max and total do not agree, and this is not the first 
cycle,
+// then we need to figure out how to resolve the conflict.
+// To resolve it we first find out the most commonly dropped frame that we 
have been
+// seeing recently. If either of the two 'lowest' values match the 
commonly-dropped
+// frame then we assume the cycle 

Re: [FFmpeg-devel] PATCH: gdigrab work for DPI in windows

2015-09-29 Thread wm4
On Wed, 23 Sep 2015 12:04:43 -0600
Roger Pack  wrote:

> From 6a972dda58bd5ab31524cd4e5326b4bcdeaeaa8c Mon Sep 17 00:00:00 2001
> From: rogerdpack 
> Date: Wed, 23 Sep 2015 12:03:27 -0600
> Subject: [PATCH] gdigrab: grab right desktop size if DPI in use, based on
>  patch from Alexander Brotzge
> 
> Signed-off-by: rogerdpack 
> ---
>  libavdevice/gdigrab.c | 44 +---
>  1 file changed, 29 insertions(+), 15 deletions(-)
> 
> diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c
> index 9a185d4..b0faf45 100644
> --- a/libavdevice/gdigrab.c
> +++ b/libavdevice/gdigrab.c
> @@ -235,6 +235,9 @@ gdigrab_read_header(AVFormatContext *s1)
>  AVStream   *st   = NULL;
>  
>  int bpp;
> +int vertres;
> +int desktopvertres;
> +float scale;
>  RECT virtual_rect;
>  RECT clip_rect;
>  BITMAP bmp;
> @@ -263,14 +266,34 @@ gdigrab_read_header(AVFormatContext *s1)
>  goto error;
>  }
>  
> -if (hwnd) {
> -GetClientRect(hwnd, _rect);
> -} else {
> +/* This will get the device context for the selected window, or if
> + * none, the primary screen */
> +source_hdc = GetDC(hwnd);
> +if (!source_hdc) {
> +WIN32_API_ERROR("Couldn't get window device context");
> +ret = AVERROR(EIO);
> +goto error;
> +}
> +bpp = GetDeviceCaps(source_hdc, BITSPIXEL);
> +
> +scale = 1.0;
> +if (hwnd == NULL) {
> +  /* desktop -- get the right height and width for scaling DPI */
> +  vertres = GetDeviceCaps(source_hdc, VERTRES);
> +  desktopvertres = GetDeviceCaps(source_hdc, DESKTOPVERTRES);
> +  scale = (float) desktopvertres / (float) vertres;
> +}
> +
> + if (hwnd) {
> + GetClientRect(hwnd, _rect);
> + virtual_rect.right = virtual_rect.right * scale;
> + virtual_rect.bottom = virtual_rect.bottom * scale;
> + } else {
>  virtual_rect.left = GetSystemMetrics(SM_XVIRTUALSCREEN);
>  virtual_rect.top = GetSystemMetrics(SM_YVIRTUALSCREEN);
> -virtual_rect.right = virtual_rect.left + 
> GetSystemMetrics(SM_CXVIRTUALSCREEN);
> -virtual_rect.bottom = virtual_rect.top + 
> GetSystemMetrics(SM_CYVIRTUALSCREEN);
> -}
> +virtual_rect.right = (virtual_rect.left + 
> GetSystemMetrics(SM_CXVIRTUALSCREEN)) * scale;
> +virtual_rect.bottom = (virtual_rect.top + 
> GetSystemMetrics(SM_CYVIRTUALSCREEN)) * scale;
> + }
>  
>  /* If no width or height set, use full screen/window area */
>  if (!gdigrab->width || !gdigrab->height) {
> @@ -299,15 +322,6 @@ gdigrab_read_header(AVFormatContext *s1)
>  goto error;
>  }
>  
> -/* This will get the device context for the selected window, or if
> - * none, the primary screen */
> -source_hdc = GetDC(hwnd);
> -if (!source_hdc) {
> -WIN32_API_ERROR("Couldn't get window device context");
> -ret = AVERROR(EIO);
> -goto error;
> -}
> -bpp = GetDeviceCaps(source_hdc, BITSPIXEL);
>  
>  if (name) {
>  av_log(s1, AV_LOG_INFO,

I don't know the code, but IMO this is all kinds of fishy. Why are
there apparently two units involved, one scaled and one not? If it's
using always the same API (classic gdi/user stuff), why would it be
scaled in some cases?

Won't you run into rounding errors by using floats?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate: Add basic license header check

2015-09-29 Thread Michael Niedermayer
On Sun, Sep 27, 2015 at 02:06:54PM +0200, Michael Niedermayer wrote:
> From: Michael Niedermayer 
> 
> ---
>  tests/Makefile |1 +
>  tests/fate-run.sh  |5 +
>  tests/fate/source-check.sh |   20 
>  tests/fate/source.mak  |3 +++
>  tests/ref/fate/source  |   18 ++
>  5 files changed, 47 insertions(+)
>  create mode 100755 tests/fate/source-check.sh
>  create mode 100644 tests/fate/source.mak
>  create mode 100644 tests/ref/fate/source

applied


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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH] avformat/movenc: suppress -Wstrict-overflow warnings

2015-09-29 Thread Ganesh Ajjanagadde
On Sun, Sep 27, 2015 at 9:39 PM, Ganesh Ajjanagadde  wrote:
> On Sun, Sep 27, 2015 at 9:18 PM, Michael Niedermayer  wrote:
>> On Sun, Sep 27, 2015 at 01:23:03PM -0400, Ganesh Ajjanagadde wrote:
>>> On Sun, Sep 27, 2015 at 12:58 PM, Michael Niedermayer  
>>> wrote:
>>> > On Sat, Sep 26, 2015 at 10:55:26PM -0400, Ganesh Ajjanagadde wrote:
>>> >> On Sat, Sep 26, 2015 at 10:32 PM, Ronald S. Bultje  
>>> >> wrote:
>>> >> > Hi,
>>> >> >
>>> >> > On Sat, Sep 26, 2015 at 7:19 PM, Ganesh Ajjanagadde 
>>> >> > wrote:
>>> >> >
>>> >> >> On Sat, Sep 26, 2015 at 7:11 PM, Michael Niedermayer 
>>> >> >> 
>>> >> >> wrote:
>>> >> >> > On Fri, Sep 18, 2015 at 05:15:50PM -0400, Ganesh Ajjanagadde wrote:
>>> >> >> >> This patch results in identical behavior of movenc, and suppresses
>>> >> >> -Wstrict-overflow
>>> >> >> >> warnings observed in GCC 5.2.
>>> >> >> >> I have manually checked that all usages are safe, and overflow
>>> >> >> possibility does
>>> >> >> >> not exist with this expression rewrite.
>>> >> >> >>
>>> >> >> >> Signed-off-by: Ganesh Ajjanagadde 
>>> >> >> >> ---
>>> >> >> >>  libavformat/movenc.c | 2 +-
>>> >> >> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>>> >> >> >>
>>> >> >> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>>> >> >> >> index af03d1e..6e4a1a6 100644
>>> >> >> >> --- a/libavformat/movenc.c
>>> >> >> >> +++ b/libavformat/movenc.c
>>> >> >> >> @@ -854,7 +854,7 @@ static int get_cluster_duration(MOVTrack 
>>> >> >> >> *track,
>>> >> >> int cluster_idx)
>>> >> >> >>  {
>>> >> >> >>  int64_t next_dts;
>>> >> >> >>
>>> >> >> >> -if (cluster_idx >= track->entry)
>>> >> >> >> +if (cluster_idx - track->entry >= 0)
>>> >> >> >
>>> >> >> > i do not understand what this fixes or why
>>> >> >> > also plese quote the actual warnings which are fixed in the commit
>>> >> >> > message
>>> >> >>
>>> >> >> I have posted v2 with a more detailed commit message. It should be
>>> >> >> self explanatory.
>>> >> >
>>> >> >
>>> >> > Even with the new message, it's still not clear to me what's being 
>>> >> > fixed.
>>> >> > What does the warning check for? What is the problem in the initial
>>> >> > expression?
>>> >>
>>> >> Compilers make transformations on the statements in order to possibly
>>> >> get better performance when compiled with optimizations. However, some
>>> >> of these optimizations require assumptions in the code. In particular,
>>> >> the compiler is internally rewriting cluster_idx >= track->entry to
>>> >> cluster_idx - track->entry >= 0 internally for some reason (I am not
>>> >> an asm/instruction set guy, so I can't comment why it likes this).
>>> >> However, such a transformation is NOT always safe as integer
>>> >> arithmetic can overflow (try e.g extreme values close to INT_MIN,
>>> >> INT_MAX). The warning is spit out since the compiler can't be sure
>>> >> that this is safe, but it still wants to do it (I suspect only the
>>> >> -O3/-O2 level that try this, can check if you want).
>>> >
>>> > iam not sure i understand correctly but
>>> > if the compiler changes the code and then warns that what it just
>>> > did might be unsafe then the compiler is broken
>>>
>>> https://stackoverflow.com/questions/12984861/dont-understand-assuming-signed-overflow-warning
>>> - gives a detailed explanation.
>>>
>>> Some more info: this is triggered only when -finline-functions is
>>> enabled (done by default on -O3, not enabled by default on -O2).
>>> -finline-functions tries to inline stuff even when "inline" keyword is
>>> absent (like in this case).
>>> As for the warning, http://linux.die.net/man/1/gcc - search for
>>> -Wstrict-overflow. It is enabled due to -Wall, and as the man page
>>> suggests, it depends on optimization level as we can see in this
>>> example.
>>> I do consider the compiler broken in this case, but then again
>>> compilers are broken in so many different ways it is not even funny:
>>> see e.g -Warray-bounds, can't use the ISO C correct { 0 } initializer
>>> for compound data types, etc.
>>>
>>> If you don't like this, we should add a -Wnostrict-overflow either to
>>> configure, or a local enable/disable via pragmas/macros. I don't like
>>> either of these as compared to this simple workaround:
>>> 1. -Wnostrict-overflow: FFmpeg with the amount of integer arithmetic
>>> being done should benefit from this warning in general, so disabling
>>> it globally may be bad.
>>
>> how many actual bugs has Wstrict-overflow found ?
>
> No idea; maybe a good place to check is the Google fuzzing effort
> where many bugs were fixed.

See e.g your commit: 09ef98f1ae3c8a4e08b66f41c3bd97dd7b07405f -
Wstrict-overflow is indeed useful.
I am thus convinced that we should retain it.
Given the fact that local suppression is not worth it for just 2
instances and also that the patch does not reduce readability in any
way, I think this patch 

Re: [FFmpeg-devel] PATCH: gdigrab work for DPI in windows

2015-09-29 Thread Roger Pack
On 9/23/15, Roger Pack  wrote:
> See attached, tested locally.
> Cheers!

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


[FFmpeg-devel] [PATCH] x86/hevc_sao: move 10/12bit functions into a separate file

2015-09-29 Thread James Almer
Sorry for the attachment. git send-email is giving me an unusual error when
i try to send this.
>From 9e8ec4d51566cdda677b15e50240e8842ec6cd34 Mon Sep 17 00:00:00 2001
From: James Almer 
Date: Mon, 28 Sep 2015 00:58:01 -0300
Subject: [PATCH] x86/hevc_sao: move 10/12bit functions into a separate file

Signed-off-by: James Almer 
---
There's a bit of code duplication now (init functions), but it's cleaner
and should hopefully be easier to read.

 libavcodec/x86/Makefile   |   3 +-
 libavcodec/x86/hevc_sao.asm   | 394 +-
 libavcodec/x86/hevc_sao_10bit.asm | 433 ++
 3 files changed, 490 insertions(+), 340 deletions(-)
 create mode 100644 libavcodec/x86/hevc_sao_10bit.asm

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index b3cfb0b..febaccd 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -140,7 +140,8 @@ YASM-OBJS-$(CONFIG_HEVC_DECODER)   += x86/hevc_mc.o \
   x86/hevc_deblock.o\
   x86/hevc_idct.o   \
   x86/hevc_res_add.o\
-  x86/hevc_sao.o
+  x86/hevc_sao.o\
+  x86/hevc_sao_10bit.o
 YASM-OBJS-$(CONFIG_JPEG2000_DECODER)   += x86/jpeg2000dsp.o
 YASM-OBJS-$(CONFIG_MLP_DECODER)+= x86/mlpdsp.o
 YASM-OBJS-$(CONFIG_MPEG4_DECODER)  += x86/xvididct.o
diff --git a/libavcodec/x86/hevc_sao.asm b/libavcodec/x86/hevc_sao.asm
index fa45a24..888a28a 100644
--- a/libavcodec/x86/hevc_sao.asm
+++ b/libavcodec/x86/hevc_sao.asm
@@ -1,5 +1,5 @@
 ;**
-;* SIMD optimized SAO functions for HEVC decoding
+;* SIMD optimized SAO functions for HEVC 8bit decoding
 ;*
 ;* Copyright (c) 2013 Pierre-Edouard LEPERE
 ;* Copyright (c) 2014 James Almer
@@ -25,27 +25,18 @@
 
 SECTION_RODATA 32
 
-pw_mask10: times 16 dw 0x03FF
-pw_mask12: times 16 dw 0x0FFF
-pw_m2: times 16 dw -2
 pb_edge_shuffle: times 2 db 1, 2, 0, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
 pb_eo:   db -1, 0, 1, 0, 0, -1, 0, 1, -1, -1, 1, 1, 1, -1, -1, 1
-cextern pw_m1
-cextern pw_1
-cextern pw_2
 cextern pb_1
 cextern pb_2
 
 SECTION .text
 
-%define MAX_PB_SIZE  64
-%define PADDING_SIZE 32 ; AV_INPUT_BUFFER_PADDING_SIZE
-
 ;**
 ;SAO Band Filter
 ;**
 
-%macro HEVC_SAO_BAND_FILTER_INIT 1
+%macro HEVC_SAO_BAND_FILTER_INIT 0
 andleftq, 31
 movd xm0, leftd
 addleftq, 1
@@ -76,9 +67,6 @@ SECTION .text
 %endif
 
 %if ARCH_X86_64
-%if %1 > 8
-mova m13, [pw_mask %+ %1]
-%endif
 pxor m14, m14
 
 %else ; ARCH_X86_32
@@ -90,9 +78,6 @@ SECTION .text
 mova  [rsp+mmsize*5], m5
 mova  [rsp+mmsize*6], m6
 pxor  m0, m0
-%if %1 > 8
-mova  m1, [pw_mask %+ %1]
-%endif
 %assign MMSIZE mmsize
 %define m14 m0
 %define m13 m1
@@ -103,49 +88,49 @@ DEFINE_ARGS dst, src, dststride, srcstride, offset, height
 mov  heightd, r7m
 %endmacro
 
-%macro HEVC_SAO_BAND_FILTER_COMPUTE 3
-psraw %2, %3, %1-5
+%macro HEVC_SAO_BAND_FILTER_COMPUTE 2
+psraw %1, %2, 3
 %if ARCH_X86_64
-pcmpeqw  m10, %2, m0
-pcmpeqw  m11, %2, m1
-pcmpeqw  m12, %2, m2
-pcmpeqw   %2, m3
+pcmpeqw  m10, %1, m0
+pcmpeqw  m11, %1, m1
+pcmpeqw  m12, %1, m2
+pcmpeqw   %1, m3
 pand m10, m4
 pand m11, m5
 pand m12, m6
-pand  %2, m7
+pand  %1, m7
 por  m10, m11
-por  m12, %2
+por  m12, %1
 por  m10, m12
-paddw %3, m10
+paddw %2, m10
 %else ; ARCH_X86_32
-pcmpeqw   m4, %2, [rsp+MMSIZE*0]
-pcmpeqw   m5, %2, [rsp+MMSIZE*1]
-pcmpeqw   m6, %2, [rsp+MMSIZE*2]
-pcmpeqw   %2, [rsp+MMSIZE*3]
+pcmpeqw   m4, %1, [rsp+MMSIZE*0]
+pcmpeqw   m5, %1, [rsp+MMSIZE*1]
+pcmpeqw   m6, %1, [rsp+MMSIZE*2]
+pcmpeqw   %1, [rsp+MMSIZE*3]
 pand  m4, [rsp+MMSIZE*4]
 pand  m5, [rsp+MMSIZE*5]
 pand  m6, [rsp+MMSIZE*6]
-pand  %2, m7
+pand  %1, m7
 por   m4, m5
-por   m6, %2
+por   m6, %1
 por   m4, m6
-paddw %3, m4
+paddw %2, m4
 %endif ; ARCH
 

Re: [FFmpeg-devel] [PATCH] doc: fix spelling errors

2015-09-29 Thread Paul B Mahol
On 9/29/15, Moritz Barsnick  wrote:
> On Tue, Sep 29, 2015 at 20:34:09 +0200, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun 
>> ---
>>  doc/encoders.texi  |  2 +-
>>  doc/filters.texi   | 14 +++---
>>  libavcodec/g726.c  |  2 +-
>>  libavcodec/vaapi_hevc.c|  2 +-
>>  libavfilter/x86/vf_removegrain.asm |  4 ++--
>>  libavformat/asfdec_o.c |  6 +++---
>>  libavformat/ffmdec.c   |  2 +-
>>  libavformat/mov.c  |  4 ++--
>>  8 files changed, 18 insertions(+), 18 deletions(-)
>
> [Slightly highjacking this thread, sorry.]
>
> I also have a collection of a ton of spelling, grammar and
> comprehensibility errors. Is this the right way to submit them, or
> shoud they be grouped by source files, sections, types of error?

Just send them as you find one. No need to group them or send all of
them at once.

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


[FFmpeg-devel] [PATCH] avfilter: add setfps filter

2015-09-29 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/vf_setfps.c  | 119 +++
 3 files changed, 121 insertions(+)
 create mode 100644 libavfilter/vf_setfps.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 9125443..b1a0f9d 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -208,6 +208,7 @@ OBJS-$(CONFIG_SELECT_FILTER) += f_select.o
 OBJS-$(CONFIG_SENDCMD_FILTER)+= f_sendcmd.o
 OBJS-$(CONFIG_SETDAR_FILTER) += vf_aspect.o
 OBJS-$(CONFIG_SETFIELD_FILTER)   += vf_setfield.o
+OBJS-$(CONFIG_SETFPS_FILTER) += vf_setfps.o
 OBJS-$(CONFIG_SETPTS_FILTER) += setpts.o
 OBJS-$(CONFIG_SETSAR_FILTER) += vf_aspect.o
 OBJS-$(CONFIG_SETTB_FILTER)  += settb.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 612fc99..17748db 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -229,6 +229,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(SEPARATEFIELDS, separatefields, vf);
 REGISTER_FILTER(SETDAR, setdar, vf);
 REGISTER_FILTER(SETFIELD,   setfield,   vf);
+REGISTER_FILTER(SETFPS, setfps, vf);
 REGISTER_FILTER(SETPTS, setpts, vf);
 REGISTER_FILTER(SETSAR, setsar, vf);
 REGISTER_FILTER(SETTB,  settb,  vf);
diff --git a/libavfilter/vf_setfps.c b/libavfilter/vf_setfps.c
new file mode 100644
index 000..4360998
--- /dev/null
+++ b/libavfilter/vf_setfps.c
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2015 The FFmpeg Project
+ *
+ * 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
+ * a filter changing framerate and updating pts
+ */
+
+#include 
+#include 
+
+#include "libavutil/common.h"
+#include "libavutil/fifo.h"
+#include "libavutil/mathematics.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+
+#include "avfilter.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct SetFPSContext {
+const AVClass *class;
+
+AVRational framerate;
+int64_t first_pts;
+} SetFPSContext;
+
+#define OFFSET(x) offsetof(SetFPSContext, x)
+#define V AV_OPT_FLAG_VIDEO_PARAM
+#define F AV_OPT_FLAG_FILTERING_PARAM
+static const AVOption setfps_options[] = {
+{ "fps", "A string describing desired output framerate", 
OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, .flags = V|F },
+{ NULL }
+};
+
+AVFILTER_DEFINE_CLASS(setfps);
+
+static int config_props(AVFilterLink *outlink)
+{
+AVFilterContext *ctx = outlink->src;
+SetFPSContext *s = ctx->priv;
+AVFilterLink *inlink = ctx->inputs[0];
+
+outlink->time_base  = av_inv_q(s->framerate);
+outlink->frame_rate = s->framerate;
+s->first_pts = AV_NOPTS_VALUE;
+
+av_log(outlink->src, AV_LOG_VERBOSE, "fps:%d/%d -> fps:%d/%d\n",
+   inlink ->frame_rate.num, inlink ->frame_rate.den,
+   outlink->frame_rate.num, outlink->frame_rate.den);
+
+return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
+{
+AVFilterContext *ctx = inlink->dst;
+SetFPSContext *s = ctx->priv;
+AVFilterLink *outlink = ctx->outputs[0];
+
+if (av_cmp_q(inlink->time_base, outlink->time_base) && ((s->first_pts != 
AV_NOPTS_VALUE) || (frame->pts != AV_NOPTS_VALUE))) {
+int64_t orig_pts = frame->pts;
+
+if (s->first_pts == AV_NOPTS_VALUE)
+s->first_pts = frame->pts;
+
+frame->pts = av_rescale_q(s->first_pts, inlink->time_base, 
outlink->time_base) + outlink->frame_count;
+av_log(ctx, AV_LOG_DEBUG, "tb:%d/%d pts:%"PRId64" -> tb:%d/%d 
pts:%"PRId64"\n",
+   inlink ->time_base.num, inlink ->time_base.den, orig_pts,
+   outlink->time_base.num, outlink->time_base.den, frame->pts);
+}
+
+return ff_filter_frame(outlink, frame);
+}
+
+static const AVFilterPad setfps_inputs[] = {
+{
+.name = "default",
+.type = AVMEDIA_TYPE_VIDEO,
+.filter_frame = filter_frame,
+},
+{ NULL }
+};
+
+static const AVFilterPad setfps_outputs[] = {
+{
+

Re: [FFmpeg-devel] [PATCH] videotoolbox: require hardware acceleration

2015-09-29 Thread wm4
On Mon, 28 Sep 2015 22:24:14 +0200
wm4  wrote:

> From: Stefano Pigozzi 
> 
> VideoToolbox also implements a software decoder for h264, and will fallback to
> using it if the file cannot be doceded on the CPU. In these cases though
> we want the hwaccel to fail so that we can use the libavcodec software decoder
> instead.
> ---
>  libavcodec/videotoolbox.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> index b78238a..a910a33 100644
> --- a/libavcodec/videotoolbox.c
> +++ b/libavcodec/videotoolbox.c
> @@ -32,8 +32,8 @@
>  #include "h264.h"
>  #include "mpegvideo.h"
>  
> -#ifndef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder
> -#  define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder 
> CFSTR("EnableHardwareAcceleratedVideoDecoder")
> +#ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
> +#  define 
> kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder 
> CFSTR("RequireHardwareAcceleratedVideoDecoder")
>  #endif
>  
>  #define VIDEOTOOLBOX_ESDS_EXTRADATA_PADDING  12
> @@ -398,7 +398,7 @@ static CFDictionaryRef 
> videotoolbox_decoder_config_create(CMVideoCodecType codec
> 
> );
>  
>  CFDictionarySetValue(config_info,
> - 
> kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder,
> + 
> kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
>   kCFBooleanTrue);
>  
>  if (avctx->extradata_size) {

Pushed, with typos in the commit message fixed by the original author.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 6/7] dnxhddata: deduplicate table

2015-09-29 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 08:29:32PM +0200, Christophe Gisquet wrote:
> 2015-09-28 11:21 GMT+02:00 Christophe Gisquet :
> > Please ignore for now.
> 
> The specs explicitly says it is the same for luma and chroma. Here's a
> patch that confidently reflects that.
> 
> -- 
> Christophe

>  dnxhddata.c |   13 +
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 5384571f8a8554e84b3eb12b6c2c32b2043bd4b6  
> 0001-dnxhddata-deduplicate-table.patch
> From bfbb0bdde4eee8d44d9c158e04b50fb4177c428f Mon Sep 17 00:00:00 2001
> From: Christophe Gisquet 
> Date: Mon, 28 Sep 2015 17:30:55 +0200
> Subject: [PATCH 1/9] dnxhddata: deduplicate table
> 
> CID 1256 is specified as using the same table for luma and chroma,
> which is the same as CID 1235 luma table. This is consistent with
> the format supposedly being RGB, although most sequences seem to
> actually be YCbCr-encoded.
> ---
>  libavcodec/dnxhddata.c | 13 +
>  1 file changed, 1 insertion(+), 12 deletions(-)

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.


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


Re: [FFmpeg-devel] [PATCH] doc: fix spelling errors

2015-09-29 Thread Moritz Barsnick
On Tue, Sep 29, 2015 at 20:34:09 +0200, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun 
> ---
>  doc/encoders.texi  |  2 +-
>  doc/filters.texi   | 14 +++---
>  libavcodec/g726.c  |  2 +-
>  libavcodec/vaapi_hevc.c|  2 +-
>  libavfilter/x86/vf_removegrain.asm |  4 ++--
>  libavformat/asfdec_o.c |  6 +++---
>  libavformat/ffmdec.c   |  2 +-
>  libavformat/mov.c  |  4 ++--
>  8 files changed, 18 insertions(+), 18 deletions(-)

[Slightly highjacking this thread, sorry.]

I also have a collection of a ton of spelling, grammar and
comprehensibility errors. Is this the right way to submit them, or
shoud they be grouped by source files, sections, types of error?

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


[FFmpeg-devel] [PATCH] libavformat/mov.c: Add parsing for DDTS atom for DTS audio

2015-09-29 Thread Shawn Singh
The DDTS atom is defined in ETSI TS 102 114, v1.4.1, Annex E.
This is useful for DTS-HD formats, some of which cannot be
decoded by dcadec.c or libdcadec.

Signed-off-by: Shawn Singh 
---
 libavformat/mov.c | 56 +++
 1 file changed, 56 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index c57aaeb..da170a6 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -744,6 +744,61 @@ static int mov_read_dec3(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return 0;
 }
 
+static int mov_read_ddts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+const uint32_t ddts_size = 20;
+AVStream *st = NULL;
+uint8_t *buf = NULL;
+uint32_t frame_duration_code = 0;
+uint32_t channel_layout_code = 0;
+GetBitContext gb;
+
+buf = av_malloc(ddts_size + FF_INPUT_BUFFER_PADDING_SIZE);
+if (!buf) {
+return AVERROR(ENOMEM);
+}
+if (avio_read(pb, buf, ddts_size) < ddts_size) {
+av_free(buf);
+return AVERROR_INVALIDDATA;
+}
+
+init_get_bits(, buf, 8*ddts_size);
+
+if (c->fc->nb_streams < 1) {
+return 0;
+}
+st = c->fc->streams[c->fc->nb_streams-1];
+
+st->codec->sample_rate = get_bits_long(, 32);
+skip_bits_long(, 32); /* max bitrate */
+st->codec->bit_rate = get_bits_long(, 32);
+st->codec->bits_per_coded_sample = get_bits(, 8);
+frame_duration_code = get_bits(, 2);
+skip_bits(, 30); /* various fields */
+channel_layout_code = get_bits(, 16);
+
+st->codec->frame_size =
+(frame_duration_code == 0) ? 512 :
+(frame_duration_code == 1) ? 1024 :
+(frame_duration_code == 2) ? 2048 :
+(frame_duration_code == 3) ? 4096 : 0;
+
+if (channel_layout_code > 0xff) {
+av_log(c->fc, AV_LOG_WARNING, "Unsupported DTS audio channel layout");
+}
+st->codec->channel_layout =
+((channel_layout_code & 0x1) ? AV_CH_FRONT_CENTER : 0) |
+((channel_layout_code & 0x2) ? AV_CH_FRONT_LEFT : 0) |
+((channel_layout_code & 0x2) ? AV_CH_FRONT_RIGHT : 0) |
+((channel_layout_code & 0x4) ? AV_CH_SIDE_LEFT : 0) |
+((channel_layout_code & 0x4) ? AV_CH_SIDE_RIGHT : 0) |
+((channel_layout_code & 0x8) ? AV_CH_LOW_FREQUENCY : 0);
+
+st->codec->channels = 
av_get_channel_layout_nb_channels(st->codec->channel_layout);
+
+return 0;
+}
+
 static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 AVStream *st;
@@ -3824,6 +3879,7 @@ static const MOVParseTableEntry mov_default_parse_table[] 
= {
 { MKTAG('e','s','d','s'), mov_read_esds },
 { MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */
 { MKTAG('d','e','c','3'), mov_read_dec3 }, /* EAC-3 info */
+{ MKTAG('d','d','t','s'), mov_read_ddts }, /* DTS audio descriptor */
 { MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */
 { MKTAG('w','f','e','x'), mov_read_wfex },
 { MKTAG('c','m','o','v'), mov_read_cmov },
-- 
2.6.0.rc2.230.g3dd15c0

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


[FFmpeg-devel] [PATCH] avcodec/x86/hpeldsp_rnd_template: silence -Wunused-function on --disable-mmx

2015-09-29 Thread Ganesh Ajjanagadde
This silences some of the -Wunused-function warnings when compiled with 
--disable-mmx, e.g
http://fate.ffmpeg.org/log.cgi?time=20150919094617=compile=x86_64-archlinux-gcc-disable-mmx.
Header guards are too brittle and ugly for this case.

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

diff --git a/libavcodec/x86/hpeldsp_rnd_template.c 
b/libavcodec/x86/hpeldsp_rnd_template.c
index abe3bb1..e20d065 100644
--- a/libavcodec/x86/hpeldsp_rnd_template.c
+++ b/libavcodec/x86/hpeldsp_rnd_template.c
@@ -106,7 +106,7 @@ av_unused static void DEF(put, pixels16_x2)(uint8_t *block, 
const uint8_t *pixel
 :REG_a, "memory");
 }
 
-static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, 
ptrdiff_t line_size, int h)
+av_unused static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t 
*pixels, ptrdiff_t line_size, int h)
 {
 MOVQ_BFE(mm6);
 __asm__ volatile(
@@ -162,7 +162,7 @@ av_unused static void DEF(avg, pixels16_x2)(uint8_t *block, 
const uint8_t *pixel
 :"memory");
 }
 
-static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, 
ptrdiff_t line_size, int h)
+av_unused static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t 
*pixels, ptrdiff_t line_size, int h)
 {
 MOVQ_BFE(mm6);
 __asm__ volatile(
-- 
2.5.3

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


Re: [FFmpeg-devel] [PATCH 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread James Darnley
On 2015-09-29 21:56, Clément Bœsch wrote:
> On Tue, Sep 29, 2015 at 09:21:53PM +0200, Hendrik Leppkes wrote:
>> I agree, we have patchcheck for typo checking.
> 
> A lot of people do not run patchcheck (I personally never do, and given
> that we fix typo on a regular basis I'm probably not the only one in this
> situation); I think having it in FATE makes sense from a usage widespread
> PoV. But it might be relevant to drop the typo code from patchcheck then
> to avoid the duplication.

People could have it run as a post-commit git hook, then people can't
forget it (but it can be quite noisy).




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


[FFmpeg-devel] [PATCH] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-09-29 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/apedec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 7b34d26..4214ea6 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int version, 
APEFilter *f,
 /* Update the adaption coefficients */
 absres = FFABS(res);
 if (absres)
-*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
+*f->adaptcoeffs = ((res & 0x8000U) ^ (-(1<<30))) >>
   (25 + (absres <= f->avg*3) + (absres <= 
f->avg*4/3));
 else
 *f->adaptcoeffs = 0;
-- 
2.5.3

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


Re: [FFmpeg-devel] [PATCHv4] ffplay: add support for interactive volume control

2015-09-29 Thread Ganesh Ajjanagadde
On Sun, Sep 27, 2015 at 5:09 PM, Marton Balint  wrote:
>
> On Sun, 27 Sep 2015, Ganesh Ajjanagadde wrote:
>
>> This is a feature heavily inspired by the mpv player. At the moment,
>> methods
>> for adjusting volume in ffplay are rather clumsy: either one needs to set
>> it
>> system-wide, or one needs to set it via the volume filter.
>>
>> This patch adds key bindings identical to the mpv defaults for
>> muting/unmuting
>> and increasing/decreasing the volume interactively without any
>> introduction of
>> external dependencies.
>>
>> TODO: doc update, possible mouse button bindings (mpv has this).
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>> ffplay.c | 36 +++-
>> 1 file changed, 35 insertions(+), 1 deletion(-)
>>
>
> Applied, thanks.

BTW, just a heads up: I won't be writing code for mouse wheel
bindings. The reason is that it is more annoying to support:
https://wiki.libsdl.org/MigrationGuide - basically old SDL 1.2 (which
is what many users use) treated it as a button, a mistake corrected in
2.0. I think the code will need to differ accordingly. Thus, configure
will need to export the SDL version, some ifdefry will need to be
done, and all that is gained is a feature which many users in fact
find annoying and explicitly disable:
https://forum.videolan.org/viewtopic.php?f=12=108470 (the very first
link in a search for "vlc mouse volume control" :D ).

However, I won't object to a patch as long as it handles both SDL
versions correctly and by default disables mouse volume control.

Another side note on this business: VLC allows "boosting" volume to
125% (I recall even 400% in the past, not sure right now). I regard
this as a misfeature; even their devs later regretted it - maybe
that's why the 400 was toned down to 125. Note that ffplay still
supports such "boosting", but that needs to be done by a -af
volume=+xdB or something like that. I consider it a good thing: if
someone wants something extreme (which can clip the audio), they need
to explicitly enable it via a filter. Thus, I definitely did not
implement this and will object to a modification to ffplay trying to
do such a thing.

I will add a Changelog entry after a week, once bugs/issues with this
(if any) are handled.

>
> Marton
>
> ___
> 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] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-09-29 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 07:27:03PM -0400, Ganesh Ajjanagadde wrote:
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/apedec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

breaks fate

--- ./tests/ref/fate/lossless-monkeysaudio-399  2015-09-29 13:42:22.893972599 
+0200
+++ tests/data/fate/lossless-monkeysaudio-399   2015-09-30 03:06:06.950988548 
+0200
@@ -1 +1 @@
-a28d4e5f2192057f7d4bece870f40bd0
+df8663c29d7cd7268d6ae77edd742bb5
Test lossless-monkeysaudio-399 failed. Look at 
tests/data/fate/lossless-monkeysaudio-399.err for details.
make: *** [fate-lossless-monkeysaudio-399] Error 1

[...]
--
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] x86/hevc_sao: move 10/12bit functions into a separate file

2015-09-29 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 01:40:51PM -0300, James Almer wrote:
> Sorry for the attachment. git send-email is giving me an unusual error when
> i try to send this.

>  Makefile   |3 
>  hevc_sao.asm   |  394 ++--
>  hevc_sao_10bit.asm |  433 
> +
>  3 files changed, 490 insertions(+), 340 deletions(-)
> f12242898081e1241e29947a3f2e83cc7fe86013  
> 0001-x86-hevc_sao-move-10-12bit-functions-into-a-separate.patch
> From 9e8ec4d51566cdda677b15e50240e8842ec6cd34 Mon Sep 17 00:00:00 2001
> From: James Almer 
> Date: Mon, 28 Sep 2015 00:58:01 -0300
> Subject: [PATCH] x86/hevc_sao: move 10/12bit functions into a separate file
> 
> Signed-off-by: James Almer 
> ---
> There's a bit of code duplication now (init functions), but it's cleaner
> and should hopefully be easier to read.

tested, seems working


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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


Re: [FFmpeg-devel] [PATCH] libavformat/mov.c: Add parsing for DDTS atom for DTS audio

2015-09-29 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 02:44:38PM -0700, Shawn Singh wrote:
> The DDTS atom is defined in ETSI TS 102 114, v1.4.1, Annex E.
> This is useful for DTS-HD formats, some of which cannot be
> decoded by dcadec.c or libdcadec.
> 
> Signed-off-by: Shawn Singh 
> ---
>  libavformat/mov.c | 56 
> +++
>  1 file changed, 56 insertions(+)

applied

btw do you have a sample that you can share ?

thanks

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

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


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


Re: [FFmpeg-devel] [PATCH] libavformat/mov.c: Add parsing for DDTS atom for DTS audio

2015-09-29 Thread Yusuke Nakamura
2015-09-30 6:44 GMT+09:00 Shawn Singh :

> The DDTS atom is defined in ETSI TS 102 114, v1.4.1, Annex E.
> This is useful for DTS-HD formats, some of which cannot be
> decoded by dcadec.c or libdcadec.
>

How useful?
DTS audio has scalability, and 'ddts' box indicates only one of properties
of the stream.


>
> Signed-off-by: Shawn Singh 
> ---
>  libavformat/mov.c | 56
> +++
>  1 file changed, 56 insertions(+)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index c57aaeb..da170a6 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -744,6 +744,61 @@ static int mov_read_dec3(MOVContext *c, AVIOContext
> *pb, MOVAtom atom)
>  return 0;
>  }
>
> +static int mov_read_ddts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> +{
> +const uint32_t ddts_size = 20;
> +AVStream *st = NULL;
> +uint8_t *buf = NULL;
> +uint32_t frame_duration_code = 0;
> +uint32_t channel_layout_code = 0;
> +GetBitContext gb;
> +
> +buf = av_malloc(ddts_size + FF_INPUT_BUFFER_PADDING_SIZE);
> +if (!buf) {
> +return AVERROR(ENOMEM);
> +}
> +if (avio_read(pb, buf, ddts_size) < ddts_size) {
> +av_free(buf);
> +return AVERROR_INVALIDDATA;
> +}
> +
> +init_get_bits(, buf, 8*ddts_size);
> +
> +if (c->fc->nb_streams < 1) {
> +return 0;
> +}
> +st = c->fc->streams[c->fc->nb_streams-1];
> +
> +st->codec->sample_rate = get_bits_long(, 32);
> +skip_bits_long(, 32); /* max bitrate */
> +st->codec->bit_rate = get_bits_long(, 32);
> +st->codec->bits_per_coded_sample = get_bits(, 8);
>

This field is set to 0 as a reserved field if the file is compatible with
Ultra Violet's Common File Format (CFF).
I prefer that the reference about this is here.


> +frame_duration_code = get_bits(, 2);
> +skip_bits(, 30); /* various fields */
> +channel_layout_code = get_bits(, 16);
> +
> +st->codec->frame_size =
> +(frame_duration_code == 0) ? 512 :
> +(frame_duration_code == 1) ? 1024 :
> +(frame_duration_code == 2) ? 2048 :
> +(frame_duration_code == 3) ? 4096 : 0;
>

Wrong if LBRDurationMod is set to 1.


> +
> +if (channel_layout_code > 0xff) {
> +av_log(c->fc, AV_LOG_WARNING, "Unsupported DTS audio channel
> layout");
> +}
> +st->codec->channel_layout =
> +((channel_layout_code & 0x1) ? AV_CH_FRONT_CENTER : 0) |
> +((channel_layout_code & 0x2) ? AV_CH_FRONT_LEFT : 0) |
> +((channel_layout_code & 0x2) ? AV_CH_FRONT_RIGHT : 0) |
> +((channel_layout_code & 0x4) ? AV_CH_SIDE_LEFT : 0) |
> +((channel_layout_code & 0x4) ? AV_CH_SIDE_RIGHT : 0) |
> +((channel_layout_code & 0x8) ? AV_CH_LOW_FREQUENCY : 0);
> +
> +st->codec->channels =
> av_get_channel_layout_nb_channels(st->codec->channel_layout);
> +
> +return 0;
> +}
> +
>  static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  {
>  AVStream *st;
> @@ -3824,6 +3879,7 @@ static const MOVParseTableEntry
> mov_default_parse_table[] = {
>  { MKTAG('e','s','d','s'), mov_read_esds },
>  { MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */
>  { MKTAG('d','e','c','3'), mov_read_dec3 }, /* EAC-3 info */
> +{ MKTAG('d','d','t','s'), mov_read_ddts }, /* DTS audio descriptor */
>  { MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */
>  { MKTAG('w','f','e','x'), mov_read_wfex },
>  { MKTAG('c','m','o','v'), mov_read_cmov },
> --
> 2.6.0.rc2.230.g3dd15c0
>
> ___
> 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] winrt: multithreading support

2015-09-29 Thread Michael Niedermayer
On Wed, Sep 30, 2015 at 02:18:29AM +0800, wang-bin wrote:
> ---
>  compat/w32pthreads.h | 11 +++
>  configure|  4 
>  libavutil/cpu.c  | 11 ++-
>  3 files changed, 25 insertions(+), 1 deletion(-)

with minng64:
compat/w32pthreads.h:40:55: error: missing binary operator before token "("

[...]
-- 
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] doc: fix spelling errors

2015-09-29 Thread Lou Logan
On Tue, 29 Sep 2015 20:34:09 +0200, Andreas Cadhalpun wrote:

> Signed-off-by: Andreas Cadhalpun 
> ---
>  doc/encoders.texi  |  2 +-
>  doc/filters.texi   | 14 +++---
>  libavcodec/g726.c  |  2 +-
>  libavcodec/vaapi_hevc.c|  2 +-
>  libavfilter/x86/vf_removegrain.asm |  4 ++--
>  libavformat/asfdec_o.c |  6 +++---
>  libavformat/ffmdec.c   |  2 +-
>  libavformat/mov.c  |  4 ++--
>  8 files changed, 18 insertions(+), 18 deletions(-)

Patch LGTM, thanks. There are some existing grammar issues that I
noticed because of your patch (this is just a typo patch anyway), but I
can fix those "someday".

Consider adding "bellow" to tools/patcheck, and whatever other typos you
think are appropriate.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-09-29 Thread Ganesh Ajjanagadde
On Tue, Sep 29, 2015 at 9:08 PM, Michael Niedermayer  wrote:
> On Tue, Sep 29, 2015 at 07:27:03PM -0400, Ganesh Ajjanagadde wrote:
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavcodec/apedec.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> breaks fate
>
> --- ./tests/ref/fate/lossless-monkeysaudio-399  2015-09-29 13:42:22.893972599 
> +0200
> +++ tests/data/fate/lossless-monkeysaudio-399   2015-09-30 03:06:06.950988548 
> +0200
> @@ -1 +1 @@
> -a28d4e5f2192057f7d4bece870f40bd0
> +df8663c29d7cd7268d6ae77edd742bb5
> Test lossless-monkeysaudio-399 failed. Look at 
> tests/data/fate/lossless-monkeysaudio-399.err for details.
> make: *** [fate-lossless-monkeysaudio-399] Error 1

Weird, unfortunately for whatever reason my fate does not test this
(though apedec gets compiled) so I can't reproduce. One suggestion I
have is removing the U at the end, that will prevent any unforeseen
signed/unsigned business which I thought was ok. Please change the
author tag if you do this.

>
> [...]
> --
> 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
>
> ___
> 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] libx264: copy A53 closed captions from source

2015-09-29 Thread DeHackEd
Assumes 'GA94' format (ATSC standard)

Signed-off-by: DHE 
---
 doc/encoders.texi|  4 
 libavcodec/libx264.c | 45 +
 2 files changed, 49 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 3550bcc..f2d46dc 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2069,6 +2069,10 @@ For example to specify libx264 encoding options with 
@command{ffmpeg}:
 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an 
out.mkv
 @end example
 
+@item a53cc @var{boolean}
+Import closed captions (which must be ATSC compatible format) into output.
+Only the mpeg2 and h264 decoders provide these. Default is 0 (off).
+
 @item x264-params (N.A.)
 Override the x264 configuration using a :-separated list of key=value
 parameters.
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 58fcfb0..d4509d6 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -25,6 +25,7 @@
 #include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/stereo3d.h"
+#include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "internal.h"
 
@@ -83,6 +84,7 @@ typedef struct X264Context {
 int avcintra_class;
 int motion_est;
 int forced_idr;
+int a53_cc;
 char *x264_params;
 } X264Context;
 
@@ -256,6 +258,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, 
const AVFrame *frame,
 int nnal, i, ret;
 x264_picture_t pic_out = {0};
 int pict_type;
+AVFrameSideData *side_data;
 
 x264_picture_init( >pic );
 x4->pic.img.i_csp   = x4->params.i_csp;
@@ -278,7 +281,48 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, 
const AVFrame *frame,
 X264_TYPE_AUTO;
 
 reconfig_encoder(ctx, frame);
+
+if (x4->a53_cc) {
+side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC);
+if (side_data) {
+x4->pic.extra_sei.payloads = 
av_mallocz(sizeof(x4->pic.extra_sei.payloads[0]));
+if (x4->pic.extra_sei.payloads == NULL) {
+av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed 
captions, skipping\n");
+goto skip_a53cc;
+}
+x4->pic.extra_sei.sei_free = av_free;
+
+x4->pic.extra_sei.payloads[0].payload_size = side_data->size + 
11;
+x4->pic.extra_sei.payloads[0].payload = 
av_mallocz(x4->pic.extra_sei.payloads[0].payload_size);
+if (x4->pic.extra_sei.payloads[0].payload == NULL) {
+av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed 
captions, skipping\n");
+av_freep(>pic.extra_sei.payloads);
+goto skip_a53cc;
+}
+x4->pic.extra_sei.num_payloads = 1;
+x4->pic.extra_sei.payloads[0].payload_type = 4;
+memcpy(x4->pic.extra_sei.payloads[0].payload + 10, 
side_data->data, side_data->size);
+x4->pic.extra_sei.payloads[0].payload[0] = 181;
+x4->pic.extra_sei.payloads[0].payload[1] = 0;
+x4->pic.extra_sei.payloads[0].payload[2] = 49;
+
+/**
+ * 'GA94' is standard in North America for ATSC, but hard 
coding
+ * this style may not be the right thing to do -- other formats
+ * do exist. This information is not available in the side_data
+ * so we are going with this right now.
+ */
+AV_WL32(x4->pic.extra_sei.payloads[0].payload + 3,
+MKTAG('G', 'A', '9', '4'));
+x4->pic.extra_sei.payloads[0].payload[7] = 3;
+x4->pic.extra_sei.payloads[0].payload[8] =
+((side_data->size/3) & 0x1f) | 0x40;
+x4->pic.extra_sei.payloads[0].payload[9] = 0;
+x4->pic.extra_sei.payloads[0].payload[side_data->size+10] = 
255;
+}
+}
 }
+skip_a53cc:
 do {
 if (x264_encoder_encode(x4->enc, , , frame? >pic: NULL, 
_out) < 0)
 return AVERROR_EXTERNAL;
@@ -821,6 +865,7 @@ static const AVOption options[] = {
 {"level", "Specify level (as defined by Annex A)", OFFSET(level), 
AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
 {"passlogfile", "Filename for 2 pass stats", OFFSET(stats), 
AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
 {"wpredp", "Weighted prediction for P-frames", OFFSET(wpredp), 
AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+{"a53cc",  "Use A53 Closed Captions (if available)",  
OFFSET(a53_cc),AV_OPT_TYPE_BOOL,   {.i64 = 0}, 0, 1, VE},
 {"x264opts", "x264 options", OFFSET(x264opts), AV_OPT_TYPE_STRING, 
{.str=NULL}, 0, 0, VE},
 { "crf",   "Select the quality for constant quality mode",
OFFSET(crf),   AV_OPT_TYPE_FLOAT,  {.dbl = -1 }, -1, FLT_MAX, VE },
 { 

Re: [FFmpeg-devel] [PATCH] lavf/img2dec: Fix memory leak

2015-09-29 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 03:25:07PM +0200, Przemysław Sobala wrote:
> Fixes #4886
> ---
>  libavformat/img2dec.c | 32 +++-
>  1 file changed, 23 insertions(+), 9 deletions(-)

applied

thanks

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

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


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


Re: [FFmpeg-devel] [PATCH] videotoolbox: require hardware acceleration

2015-09-29 Thread wm4
On Mon, 28 Sep 2015 22:24:14 +0200
wm4  wrote:

> From: Stefano Pigozzi 
> 
> VideoToolbox also implements a software decoder for h264, and will fallback to
> using it if the file cannot be doceded on the CPU. In these cases though
> we want the hwaccel to fail so that we can use the libavcodec software decoder
> instead.
> ---
>  libavcodec/videotoolbox.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> index b78238a..a910a33 100644
> --- a/libavcodec/videotoolbox.c
> +++ b/libavcodec/videotoolbox.c
> @@ -32,8 +32,8 @@
>  #include "h264.h"
>  #include "mpegvideo.h"
>  
> -#ifndef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder
> -#  define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder 
> CFSTR("EnableHardwareAcceleratedVideoDecoder")
> +#ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
> +#  define 
> kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder 
> CFSTR("RequireHardwareAcceleratedVideoDecoder")
>  #endif
>  
>  #define VIDEOTOOLBOX_ESDS_EXTRADATA_PADDING  12
> @@ -398,7 +398,7 @@ static CFDictionaryRef 
> videotoolbox_decoder_config_create(CMVideoCodecType codec
> 
> );
>  
>  CFDictionarySetValue(config_info,
> - 
> kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder,
> + 
> kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
>   kCFBooleanTrue);
>  
>  if (avctx->extradata_size) {

If nobody minds, I'll apply in 1 hour.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/x86/rnd_template: silence -Wunused-function on --disable-mmx

2015-09-29 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 08:09:44AM -0400, Ganesh Ajjanagadde wrote:
> On Sat, Sep 19, 2015 at 11:39 AM, Ganesh Ajjanagadde
>  wrote:
> > This silences some of the -Wunused-function warnings when compiled with 
> > --disable-mmx, e.g
> > http://fate.ffmpeg.org/log.cgi?time=20150919094617=compile=x86_64-archlinux-gcc-disable-mmx.
> > Header guards are too brittle and ugly for this case.
> >
> > Signed-off-by: Ganesh Ajjanagadde 
> > ---
> >  libavcodec/x86/rnd_template.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/x86/rnd_template.c b/libavcodec/x86/rnd_template.c
> > index c9fd71e..ddca4eb 100644
> > --- a/libavcodec/x86/rnd_template.c
> > +++ b/libavcodec/x86/rnd_template.c
> > @@ -30,7 +30,7 @@
> >  #include "inline_asm.h"
> >
> >  // put_pixels
> > -STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
> > +av_unused STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t 
> > *pixels,
> >ptrdiff_t line_size, int h)
> >  {
> >  MOVQ_ZERO(mm7);
> > @@ -99,7 +99,7 @@ STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const 
> > uint8_t *pixels,
> >
> >  // avg_pixels
> >  // this routine is 'slightly' suboptimal but mostly unused
> > -STATIC void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
> > +av_unused STATIC void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t 
> > *pixels,
> >ptrdiff_t line_size, int h)
> >  {
> >  MOVQ_ZERO(mm7);
> > --
> > 2.5.2
> >
> 
> ping

applied

thanks

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

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


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


[FFmpeg-devel] [PATCH] doc: fix spelling errors

2015-09-29 Thread Andreas Cadhalpun
Signed-off-by: Andreas Cadhalpun 
---
 doc/encoders.texi  |  2 +-
 doc/filters.texi   | 14 +++---
 libavcodec/g726.c  |  2 +-
 libavcodec/vaapi_hevc.c|  2 +-
 libavfilter/x86/vf_removegrain.asm |  4 ++--
 libavformat/asfdec_o.c |  6 +++---
 libavformat/ffmdec.c   |  2 +-
 libavformat/mov.c  |  4 ++--
 8 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 3550bcc..53ac58e 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1411,7 +1411,7 @@ can be selected with @code{-pred 1}.
 @table @option
 @item format
 Can be set to either @code{j2k} or @code{jp2} (the default) that
-allows to store non-rgb pix_fmts.
+makes it possible to store non-rgb pix_fmts.
 
 @end table
 
diff --git a/doc/filters.texi b/doc/filters.texi
index a4d828e..d2a0771 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1118,7 +1118,7 @@ Number_of_samples
 For example full key look like this @code{lavfi.astats.1.DC_offset} or
 this @code{lavfi.astats.Overall.Peak_count}.
 
-For description what each key means read bellow.
+For description what each key means read below.
 
 @item reset
 Set number of frame after which stats are going to be recalculated.
@@ -2400,7 +2400,7 @@ Amount of milliseconds the signal has to rise above the 
threshold before gain
 reduction starts. Default is 20. Range is between 0.01 and 2000.
 
 @item release
-Amount of milliseconds the signal has to fall bellow the threshold before
+Amount of milliseconds the signal has to fall below the threshold before
 reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
 
 @item makeup
@@ -4533,7 +4533,7 @@ It accepts the following options:
 @item threshold1
 @item threshold2
 @item threshold3
-Allows to limit the maximum change for each plane, default is 65535.
+Limit the maximum change for each plane, default is 65535.
 If 0, plane will remain unchanged.
 @end table
 
@@ -4736,7 +4736,7 @@ It accepts the following options:
 @item threshold1
 @item threshold2
 @item threshold3
-Allows to limit the maximum change for each plane, default is 65535.
+Limit the maximum change for each plane, default is 65535.
 If 0, plane will remain unchanged.
 
 @item coordinates
@@ -5621,7 +5621,7 @@ It accepts the following options:
 @item threshold1
 @item threshold2
 @item threshold3
-Allows to limit the maximum change for each plane, default is 65535.
+Limit the maximum change for each plane, default is 65535.
 If 0, plane will remain unchanged.
 
 @item coordinates
@@ -7315,7 +7315,7 @@ It accepts the following options:
 @item threshold1
 @item threshold2
 @item threshold3
-Allows to limit the maximum change for each plane, default is 65535.
+Limit the maximum change for each plane, default is 65535.
 If 0, plane will remain unchanged.
 @end table
 
@@ -10351,7 +10351,7 @@ stereo3d=sbsl:aybd
 @end example
 
 @item
-Convert input video from above bellow (left eye above, right eye below) to 
side by side crosseye.
+Convert input video from above below (left eye above, right eye below) to side 
by side crosseye.
 @example
 stereo3d=abl:sbsr
 @end example
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 934d120..c3d018f 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -32,7 +32,7 @@
 
 /**
  * G.726 11bit float.
- * G.726 Standard uses rather odd 11bit floating point arithmentic for
+ * G.726 Standard uses rather odd 11bit floating point arithmetic for
  * numerous occasions. It's a mystery to me why they did it this way
  * instead of simply using 32bit integer arithmetic.
  */
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
index 762511f..62f783e 100644
--- a/libavcodec/vaapi_hevc.c
+++ b/libavcodec/vaapi_hevc.c
@@ -205,7 +205,7 @@ static void fill_picture_parameters(const HEVCContext *h, 
VAPictureParameterBuff
 pp->pps_tc_offset_div2 = h->ps.pps->tc_offset / 2;
 pp->log2_parallel_merge_level_minus2 = 
h->ps.pps->log2_parallel_merge_level - 2;
 
-/* Diffrent chroma/luma bit depths are currently not supported by ffmpeg. 
*/
+/* Different chroma/luma bit depths are currently not supported by ffmpeg. 
*/
 pp->bit_depth_luma_minus8 = h->ps.sps->bit_depth - 8;
 pp->bit_depth_chroma_minus8 = h->ps.sps->bit_depth - 8;
 
diff --git a/libavfilter/x86/vf_removegrain.asm 
b/libavfilter/x86/vf_removegrain.asm
index 0cc6e5f..d049bf2 100644
--- a/libavfilter/x86/vf_removegrain.asm
+++ b/libavfilter/x86/vf_removegrain.asm
@@ -359,7 +359,7 @@ cglobal rg_fl_mode_6, 4, 5, 16, 0, dst, src, stride, pixels
 paddw m2, m7 ; c2
 paddw m3, m6 ; c3
 paddw m4, m5 ; c4
-; As the differences (d1..d4) can only be postive, there is no need to
+; As the differences (d1..d4) can only be positive, there is no need to
 ; clip to zero.  Also, the maximum positive value is less than 768.
 
  

[FFmpeg-devel] [PATCH] winrt: multithreading support

2015-09-29 Thread wang-bin
---
 compat/w32pthreads.h | 11 +++
 configure|  4 
 libavutil/cpu.c  | 11 ++-
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
index 87e816f..9828e8a 100644
--- a/compat/w32pthreads.h
+++ b/compat/w32pthreads.h
@@ -37,7 +37,13 @@
 
 #define WIN32_LEAN_AND_MEAN
 #include 
+#if defined(WINAPI_FAMILY) && 
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#define TARGET_OS_WINRT
+#endif
+#ifndef TARGET_OS_WINRT
 #include 
+#endif
+
 
 #include "libavutil/attributes.h"
 #include "libavutil/common.h"
@@ -82,8 +88,13 @@ static av_unused int pthread_create(pthread_t *thread, const 
void *unused_attr,
 {
 thread->func   = start_routine;
 thread->arg= arg;
+#ifndef TARGET_OS_WINRT
 thread->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, thread,
0, NULL);
+#else
+thread->handle = (void*)CreateThread(NULL, 0, win32thread_worker, thread,
+   0, NULL);
+#endif
 return !thread->handle;
 }
 
diff --git a/configure b/configure
index 01f1797..4a7cdff 100755
--- a/configure
+++ b/configure
@@ -5189,6 +5189,10 @@ check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
 if ! disabled w32threads && ! enabled pthreads; then
 check_func_headers "windows.h process.h" _beginthreadex &&
 enable w32threads || disable w32threads
+if ! enabled w32threads; then
+check_func_headers "windows.h" CreateThread &&
+enable w32threads || disable w32threads
+fi
 fi
 
 # check for some common methods of building with pthread support
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 780368d..5968bc5 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -30,8 +30,11 @@
 #endif
 #include 
 #endif
-#if HAVE_GETPROCESSAFFINITYMASK
+#if HAVE_WINDOWS_H
 #include 
+#if defined(WINAPI_FAMILY) && 
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#define TARGET_OS_WINRT
+#endif
 #endif
 #if HAVE_SYSCTL
 #if HAVE_SYS_PARAM_H
@@ -253,6 +256,9 @@ int av_cpu_count(void)
 static volatile int printed;
 
 int nb_cpus = 1;
+#ifdef TARGET_OS_WINRT
+SYSTEM_INFO sysinfo;
+#endif
 #if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT)
 cpu_set_t cpuset;
 
@@ -274,6 +280,9 @@ int av_cpu_count(void)
 nb_cpus = sysconf(_SC_NPROC_ONLN);
 #elif HAVE_SYSCONF && defined(_SC_NPROCESSORS_ONLN)
 nb_cpus = sysconf(_SC_NPROCESSORS_ONLN);
+#elif defined(TARGET_OS_WINRT)
+GetNativeSystemInfo();
+nb_cpus = sysinfo.dwNumberOfProcessors;
 #endif
 
 if (!printed) {
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH 6/7] dnxhddata: deduplicate table

2015-09-29 Thread Christophe Gisquet
2015-09-28 11:21 GMT+02:00 Christophe Gisquet :
> Please ignore for now.

The specs explicitly says it is the same for luma and chroma. Here's a
patch that confidently reflects that.

-- 
Christophe
From bfbb0bdde4eee8d44d9c158e04b50fb4177c428f Mon Sep 17 00:00:00 2001
From: Christophe Gisquet 
Date: Mon, 28 Sep 2015 17:30:55 +0200
Subject: [PATCH 1/9] dnxhddata: deduplicate table

CID 1256 is specified as using the same table for luma and chroma,
which is the same as CID 1235 luma table. This is consistent with
the format supposedly being RGB, although most sequences seem to
actually be YCbCr-encoded.
---
 libavcodec/dnxhddata.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index cc304e4..0cbc57b 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -228,17 +228,6 @@ static const uint8_t dnxhd_1252_chroma_weight[] = {
 114, 128, 125, 129, 134, 125, 116, 116,
 };
 
-static const uint8_t dnxhd_1256_chroma_weight[] = {
- 0, 32, 32, 32, 32, 32, 32, 32,
-32, 32, 32, 32, 32, 32, 32, 32,
-32, 32, 32, 32, 32, 32, 37, 32,
-32, 32, 32, 32, 33, 32, 32, 32,
-32, 32, 33, 34, 37, 36, 32, 32,
-32, 33, 34, 37, 36, 34, 35, 36,
-39, 44, 40, 40, 39, 39, 44, 43,
-43, 51, 56, 50, 49, 60, 61, 70,
-};
-
 static const uint8_t dnxhd_1260_luma_weight[] = {
  0, 32, 33, 34, 36, 37, 37, 36,
 34, 33, 34, 35, 37, 38, 40, 41,
@@ -1041,7 +1030,7 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   { 36, 36, 45, 75, 90 },
   { { 24000, 1001 }, { 25, 1 }, { 3, 1001 }, { 50, 1 }, { 6, 1001 } } },
 { 1256, 1920, 1080, 0, 1835008, 1835008, 6, 10, 4,
-  dnxhd_1235_luma_weight, dnxhd_1256_chroma_weight,
+  dnxhd_1235_luma_weight, dnxhd_1235_luma_weight,
   dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
   dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
   dnxhd_1235_ac_flags,
-- 
2.5.2

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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix undefined left shifts of negative numbers

2015-09-29 Thread Ganesh Ajjanagadde
On Tue, Sep 29, 2015 at 11:22 AM, Ronald S. Bultje  wrote:
> Hi,
>
> On Tue, Sep 29, 2015 at 11:04 AM, Ganesh Ajjanagadde 
> wrote:
>
>> On Tue, Sep 29, 2015 at 9:24 AM, Hendrik Leppkes 
>> wrote:
>> > On Sun, Sep 20, 2015 at 4:18 AM, Ganesh Ajjanagadde
>> >  wrote:
>> >> This fixes -Wshift-negative-value reported with clang 3.7+, e.g
>> >>
>> http://fate.ffmpeg.org/log.cgi?time=20150919172459=compile=x86_64-darwin-clang-polly-notiling-3.7
>> .
>> >> Note that the patch crucially depends on int >= 32 bits,
>> >> an assumption made in many places in the codebase.
>> >>
>> >> Signed-off-by: Ganesh Ajjanagadde 
>> >> ---
>> >>  libavcodec/apedec.c | 2 +-
>> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>
>> >> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
>> >> index 5536e0f..7b34d26 100644
>> >> --- a/libavcodec/apedec.c
>> >> +++ b/libavcodec/apedec.c
>> >> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
>> version, APEFilter *f,
>> >>  /* Update the adaption coefficients */
>> >>  absres = FFABS(res);
>> >>  if (absres)
>> >> -*f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
>> >> +*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>> >>(25 + (absres <= f->avg*3) + (absres
>> <= f->avg*4/3));
>> >>  else
>> >>  *f->adaptcoeffs = 0;
>> >> --
>> >> 2.5.2
>> >>
>> >
>> > After this patch (GCC 5.2, x86)
>> >
>> > libavcodec/apedec.c: In function 'do_apply_filter':
>> > libavcodec/apedec.c:1284:44: warning: integer overflow in expression
>> > [-Woverflow]
>> >  *f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>>
>> Good catch - made an off by one error in my assumptions. I don't see a
>> nice, clean way of dealing with -(1 << 31).
>> I propose one of the following:
>> 1. use INT32_MIN.
>> 2. use an explicit binary/hexadecimal mask.
>> 3. use e.g (-2)*(1<<30).
>
>
> 0x8000U is fine.

This should be ok - res will be promoted to unsigned. The bit
representation being identical is not guaranteed, but in the 2's
complement world it should be fine.

>
> Ronald
> ___
> 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 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread Hendrik Leppkes
On Tue, Sep 29, 2015 at 9:08 PM, wm4  wrote:
> On Tue, 29 Sep 2015 20:57:31 +0200
> Michael Niedermayer  wrote:
>
>> From: Michael Niedermayer 
>>
>> Signed-off-by: Michael Niedermayer 
>> ---
>>  tests/fate/source-check.sh |8 
>>  tests/ref/fate/source  |3 +++
>>  2 files changed, 11 insertions(+)
>>
>> diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
>> index fb7af98..ac6bbc0 100755
>> --- a/tests/fate/source-check.sh
>> +++ b/tests/fate/source-check.sh
>> @@ -16,5 +16,13 @@ git grep -L -E "This file is part of FFmpeg|This file is 
>> part of libswresample|"
>>  "This program is free software; you can redistribute it and/or modify|"\
>>  "This file is placed in the public domain" | grep -E '\.c$|\.h$|\.S$|\.asm$'
>>
>> +echo Files that contain words with common typos:
>> +git grep -E 
>> '(^|[^a-zA-Z])([cC]ant|[dDwW]ont|[dD]oesnt|[uU]sefull|[sS]uccessfull|"\
>> +"[oO]ccured|[aA]wnser|[tT]eh|[aA]lot|[wW]ether|[sS]kiped|[sS]kiping"\
>> +"[hH]eigth|[iI]nformations|[cC]olums|[lL]oosy|[lL]oosing|[oO]uput|[sS]eperate|[pP]receed|[uU]pto|[pP]aket|[pP]osible|[uU]nkown"\
>> +"[Ii]npossible|[dD]imention|[aA]cheive|[fF]untions|[oO]verriden|[oO]utputing|[sS]eperation|[iI]nitalize|[cC]ompatibilty|[bB]istream|[kK]nwon|[uU]nknwon"\
>> +"[Cc]onvertion|[Oo]mmit|[cC]hoosen|[aA]dditonal|[gG]urantee|[aA]vailble|[wW]ich|[Oo]utter|[Ss]eperator"\
>> +"[Ss]uccesfully|[Rr]eproducable|[Ss]pecifiying|[Ss]eperated|[pP]recission|[iI]naccuarte|[iI]nitilaize"\
>> +")($|[^a-zA-Z])' | grep -v 'tests/ref/fate/source'
>>
>>  exit 0
>> diff --git a/tests/ref/fate/source b/tests/ref/fate/source
>> index 9cd8b30..7edd7e9 100644
>> --- a/tests/ref/fate/source
>> +++ b/tests/ref/fate/source
>> @@ -16,3 +16,6 @@ libswresample/log2_tab.c
>>  libswscale/log2_tab.c
>>  tools/uncoded_frame.c
>>  tools/yuvcmp.c
>> +Files that contain words with common typos:
>> +doc/t2h.pm:$program, $generator) = 
>> $self->_file_header_informations($command);
>> +tools/patcheck:hiegrep 
>> '\b(awnser|cant|dont|wont|doesnt|usefull|successfull|occured|teh|alot|wether|skiped|skiping|heigth|informations|colums|loosy|loosing|ouput|seperate|preceed|upto|paket|posible|unkown|inpossible|dimention|acheive|funtions|overriden|outputing|seperation|initalize|compatibilty|bistream|knwon|unknwon|choosen|additonal|gurantee|availble|wich)\b'
>>  'common typos' $*
>
> This kind of stuff doesn't belong into FATE itself.

I agree, we have patchcheck for typo checking.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread Michael Niedermayer
From: Michael Niedermayer 

Signed-off-by: Michael Niedermayer 
---
 tests/fate/source-check.sh |8 
 tests/ref/fate/source  |3 +++
 2 files changed, 11 insertions(+)

diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
index fb7af98..ac6bbc0 100755
--- a/tests/fate/source-check.sh
+++ b/tests/fate/source-check.sh
@@ -16,5 +16,13 @@ git grep -L -E "This file is part of FFmpeg|This file is 
part of libswresample|"
 "This program is free software; you can redistribute it and/or modify|"\
 "This file is placed in the public domain" | grep -E '\.c$|\.h$|\.S$|\.asm$'
 
+echo Files that contain words with common typos:
+git grep -E 
'(^|[^a-zA-Z])([cC]ant|[dDwW]ont|[dD]oesnt|[uU]sefull|[sS]uccessfull|"\
+"[oO]ccured|[aA]wnser|[tT]eh|[aA]lot|[wW]ether|[sS]kiped|[sS]kiping"\
+"[hH]eigth|[iI]nformations|[cC]olums|[lL]oosy|[lL]oosing|[oO]uput|[sS]eperate|[pP]receed|[uU]pto|[pP]aket|[pP]osible|[uU]nkown"\
+"[Ii]npossible|[dD]imention|[aA]cheive|[fF]untions|[oO]verriden|[oO]utputing|[sS]eperation|[iI]nitalize|[cC]ompatibilty|[bB]istream|[kK]nwon|[uU]nknwon"\
+"[Cc]onvertion|[Oo]mmit|[cC]hoosen|[aA]dditonal|[gG]urantee|[aA]vailble|[wW]ich|[Oo]utter|[Ss]eperator"\
+"[Ss]uccesfully|[Rr]eproducable|[Ss]pecifiying|[Ss]eperated|[pP]recission|[iI]naccuarte|[iI]nitilaize"\
+")($|[^a-zA-Z])' | grep -v 'tests/ref/fate/source'
 
 exit 0
diff --git a/tests/ref/fate/source b/tests/ref/fate/source
index 9cd8b30..7edd7e9 100644
--- a/tests/ref/fate/source
+++ b/tests/ref/fate/source
@@ -16,3 +16,6 @@ libswresample/log2_tab.c
 libswscale/log2_tab.c
 tools/uncoded_frame.c
 tools/yuvcmp.c
+Files that contain words with common typos:
+doc/t2h.pm:$program, $generator) = 
$self->_file_header_informations($command);
+tools/patcheck:hiegrep 
'\b(awnser|cant|dont|wont|doesnt|usefull|successfull|occured|teh|alot|wether|skiped|skiping|heigth|informations|colums|loosy|loosing|ouput|seperate|preceed|upto|paket|posible|unkown|inpossible|dimention|acheive|funtions|overriden|outputing|seperation|initalize|compatibilty|bistream|knwon|unknwon|choosen|additonal|gurantee|availble|wich)\b'
 'common typos' $*
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread wm4
On Tue, 29 Sep 2015 20:57:31 +0200
Michael Niedermayer  wrote:

> From: Michael Niedermayer 
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  tests/fate/source-check.sh |8 
>  tests/ref/fate/source  |3 +++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
> index fb7af98..ac6bbc0 100755
> --- a/tests/fate/source-check.sh
> +++ b/tests/fate/source-check.sh
> @@ -16,5 +16,13 @@ git grep -L -E "This file is part of FFmpeg|This file is 
> part of libswresample|"
>  "This program is free software; you can redistribute it and/or modify|"\
>  "This file is placed in the public domain" | grep -E '\.c$|\.h$|\.S$|\.asm$'
>  
> +echo Files that contain words with common typos:
> +git grep -E 
> '(^|[^a-zA-Z])([cC]ant|[dDwW]ont|[dD]oesnt|[uU]sefull|[sS]uccessfull|"\
> +"[oO]ccured|[aA]wnser|[tT]eh|[aA]lot|[wW]ether|[sS]kiped|[sS]kiping"\
> +"[hH]eigth|[iI]nformations|[cC]olums|[lL]oosy|[lL]oosing|[oO]uput|[sS]eperate|[pP]receed|[uU]pto|[pP]aket|[pP]osible|[uU]nkown"\
> +"[Ii]npossible|[dD]imention|[aA]cheive|[fF]untions|[oO]verriden|[oO]utputing|[sS]eperation|[iI]nitalize|[cC]ompatibilty|[bB]istream|[kK]nwon|[uU]nknwon"\
> +"[Cc]onvertion|[Oo]mmit|[cC]hoosen|[aA]dditonal|[gG]urantee|[aA]vailble|[wW]ich|[Oo]utter|[Ss]eperator"\
> +"[Ss]uccesfully|[Rr]eproducable|[Ss]pecifiying|[Ss]eperated|[pP]recission|[iI]naccuarte|[iI]nitilaize"\
> +")($|[^a-zA-Z])' | grep -v 'tests/ref/fate/source'
>  
>  exit 0
> diff --git a/tests/ref/fate/source b/tests/ref/fate/source
> index 9cd8b30..7edd7e9 100644
> --- a/tests/ref/fate/source
> +++ b/tests/ref/fate/source
> @@ -16,3 +16,6 @@ libswresample/log2_tab.c
>  libswscale/log2_tab.c
>  tools/uncoded_frame.c
>  tools/yuvcmp.c
> +Files that contain words with common typos:
> +doc/t2h.pm:$program, $generator) = 
> $self->_file_header_informations($command);
> +tools/patcheck:hiegrep 
> '\b(awnser|cant|dont|wont|doesnt|usefull|successfull|occured|teh|alot|wether|skiped|skiping|heigth|informations|colums|loosy|loosing|ouput|seperate|preceed|upto|paket|posible|unkown|inpossible|dimention|acheive|funtions|overriden|outputing|seperation|initalize|compatibilty|bistream|knwon|unknwon|choosen|additonal|gurantee|availble|wich)\b'
>  'common typos' $*

This kind of stuff doesn't belong into FATE itself.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] compat/avisynth/avisynth_c.h: fix typos

2015-09-29 Thread Michael Niedermayer
From: Michael Niedermayer 

Signed-off-by: Michael Niedermayer 
---
 compat/avisynth/avisynth_c.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compat/avisynth/avisynth_c.h b/compat/avisynth/avisynth_c.h
index 0189dad..7f4b3c9 100644
--- a/compat/avisynth/avisynth_c.h
+++ b/compat/avisynth/avisynth_c.h
@@ -151,9 +151,9 @@ enum {  //SUBTYPES
 enum {
   // New 2.6 explicitly defined cache hints.
   AVS_CACHE_NOTHING=10, // Do not cache video.
-  AVS_CACHE_WINDOW=11, // Hard protect upto X frames within a range of X from 
the current frame N.
-  AVS_CACHE_GENERIC=12, // LRU cache upto X frames.
-  AVS_CACHE_FORCE_GENERIC=13, // LRU cache upto X frames, override any 
previous CACHE_WINDOW.
+  AVS_CACHE_WINDOW=11, // Hard protect up to X frames within a range of X from 
the current frame N.
+  AVS_CACHE_GENERIC=12, // LRU cache up to X frames.
+  AVS_CACHE_FORCE_GENERIC=13, // LRU cache up to X frames, override any 
previous CACHE_WINDOW.
 
   AVS_CACHE_GET_POLICY=30, // Get the current policy.
   AVS_CACHE_GET_WINDOW=31, // Get the current window h_span.
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH v2 2/8] configure: Add version check for libkvazaar

2015-09-29 Thread Carl Eugen Hoyos
Clément Bœsch  pkh.me> writes:

> > + { check_cpp_condition kvazaar.h "KVZ_API_VERSION >= 7" ||
> > +   die "ERROR: kvazaar API version must be at least 7."; }
> 
> Can you do something like require_pkg_config "kvazaar >= 1.2.3" instead?

Please don't!
This only adds an unneeded requirement (and a regression) 
to the library 

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


Re: [FFmpeg-devel] [PATCH]lavf/rawenc: Force one stream for hevc and m4v

2015-09-29 Thread Carl Eugen Hoyos
Michael Niedermayer  gmx.at> writes:

> >  rawenc.c |2 ++
> >  1 file changed, 2 insertions(+)
> > 152253d1707fbee45355abd6364a9ecc592942c8  patchonestream.diff
> 
> 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 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread Clément Bœsch
On Tue, Sep 29, 2015 at 09:21:53PM +0200, Hendrik Leppkes wrote:
> On Tue, Sep 29, 2015 at 9:08 PM, wm4  wrote:
> > On Tue, 29 Sep 2015 20:57:31 +0200
> > Michael Niedermayer  wrote:
> >
> >> From: Michael Niedermayer 
> >>
> >> Signed-off-by: Michael Niedermayer 
> >> ---
> >>  tests/fate/source-check.sh |8 
> >>  tests/ref/fate/source  |3 +++
> >>  2 files changed, 11 insertions(+)
> >>
> >> diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
> >> index fb7af98..ac6bbc0 100755
> >> --- a/tests/fate/source-check.sh
> >> +++ b/tests/fate/source-check.sh
> >> @@ -16,5 +16,13 @@ git grep -L -E "This file is part of FFmpeg|This file 
> >> is part of libswresample|"
> >>  "This program is free software; you can redistribute it and/or modify|"\
> >>  "This file is placed in the public domain" | grep -E 
> >> '\.c$|\.h$|\.S$|\.asm$'
> >>
> >> +echo Files that contain words with common typos:
> >> +git grep -E 
> >> '(^|[^a-zA-Z])([cC]ant|[dDwW]ont|[dD]oesnt|[uU]sefull|[sS]uccessfull|"\
> >> +"[oO]ccured|[aA]wnser|[tT]eh|[aA]lot|[wW]ether|[sS]kiped|[sS]kiping"\
> >> +"[hH]eigth|[iI]nformations|[cC]olums|[lL]oosy|[lL]oosing|[oO]uput|[sS]eperate|[pP]receed|[uU]pto|[pP]aket|[pP]osible|[uU]nkown"\
> >> +"[Ii]npossible|[dD]imention|[aA]cheive|[fF]untions|[oO]verriden|[oO]utputing|[sS]eperation|[iI]nitalize|[cC]ompatibilty|[bB]istream|[kK]nwon|[uU]nknwon"\
> >> +"[Cc]onvertion|[Oo]mmit|[cC]hoosen|[aA]dditonal|[gG]urantee|[aA]vailble|[wW]ich|[Oo]utter|[Ss]eperator"\
> >> +"[Ss]uccesfully|[Rr]eproducable|[Ss]pecifiying|[Ss]eperated|[pP]recission|[iI]naccuarte|[iI]nitilaize"\
> >> +")($|[^a-zA-Z])' | grep -v 'tests/ref/fate/source'
> >>
> >>  exit 0
> >> diff --git a/tests/ref/fate/source b/tests/ref/fate/source
> >> index 9cd8b30..7edd7e9 100644
> >> --- a/tests/ref/fate/source
> >> +++ b/tests/ref/fate/source
> >> @@ -16,3 +16,6 @@ libswresample/log2_tab.c
> >>  libswscale/log2_tab.c
> >>  tools/uncoded_frame.c
> >>  tools/yuvcmp.c
> >> +Files that contain words with common typos:
> >> +doc/t2h.pm:$program, $generator) = 
> >> $self->_file_header_informations($command);
> >> +tools/patcheck:hiegrep 
> >> '\b(awnser|cant|dont|wont|doesnt|usefull|successfull|occured|teh|alot|wether|skiped|skiping|heigth|informations|colums|loosy|loosing|ouput|seperate|preceed|upto|paket|posible|unkown|inpossible|dimention|acheive|funtions|overriden|outputing|seperation|initalize|compatibilty|bistream|knwon|unknwon|choosen|additonal|gurantee|availble|wich)\b'
> >>  'common typos' $*
> >
> > This kind of stuff doesn't belong into FATE itself.
> 
> I agree, we have patchcheck for typo checking.

A lot of people do not run patchcheck (I personally never do, and given
that we fix typo on a regular basis I'm probably not the only one in this
situation); I think having it in FATE makes sense from a usage widespread
PoV. But it might be relevant to drop the typo code from patchcheck then
to avoid the duplication.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread Hendrik Leppkes
On Tue, Sep 29, 2015 at 9:56 PM, Clément Bœsch  wrote:
> On Tue, Sep 29, 2015 at 09:21:53PM +0200, Hendrik Leppkes wrote:
>> On Tue, Sep 29, 2015 at 9:08 PM, wm4  wrote:
>> > On Tue, 29 Sep 2015 20:57:31 +0200
>> > Michael Niedermayer  wrote:
>> >
>> >> From: Michael Niedermayer 
>> >>
>> >> Signed-off-by: Michael Niedermayer 
>> >> ---
>> >>  tests/fate/source-check.sh |8 
>> >>  tests/ref/fate/source  |3 +++
>> >>  2 files changed, 11 insertions(+)
>> >>
>> >> diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
>> >> index fb7af98..ac6bbc0 100755
>> >> --- a/tests/fate/source-check.sh
>> >> +++ b/tests/fate/source-check.sh
>> >> @@ -16,5 +16,13 @@ git grep -L -E "This file is part of FFmpeg|This file 
>> >> is part of libswresample|"
>> >>  "This program is free software; you can redistribute it and/or modify|"\
>> >>  "This file is placed in the public domain" | grep -E 
>> >> '\.c$|\.h$|\.S$|\.asm$'
>> >>
>> >> +echo Files that contain words with common typos:
>> >> +git grep -E 
>> >> '(^|[^a-zA-Z])([cC]ant|[dDwW]ont|[dD]oesnt|[uU]sefull|[sS]uccessfull|"\
>> >> +"[oO]ccured|[aA]wnser|[tT]eh|[aA]lot|[wW]ether|[sS]kiped|[sS]kiping"\
>> >> +"[hH]eigth|[iI]nformations|[cC]olums|[lL]oosy|[lL]oosing|[oO]uput|[sS]eperate|[pP]receed|[uU]pto|[pP]aket|[pP]osible|[uU]nkown"\
>> >> +"[Ii]npossible|[dD]imention|[aA]cheive|[fF]untions|[oO]verriden|[oO]utputing|[sS]eperation|[iI]nitalize|[cC]ompatibilty|[bB]istream|[kK]nwon|[uU]nknwon"\
>> >> +"[Cc]onvertion|[Oo]mmit|[cC]hoosen|[aA]dditonal|[gG]urantee|[aA]vailble|[wW]ich|[Oo]utter|[Ss]eperator"\
>> >> +"[Ss]uccesfully|[Rr]eproducable|[Ss]pecifiying|[Ss]eperated|[pP]recission|[iI]naccuarte|[iI]nitilaize"\
>> >> +")($|[^a-zA-Z])' | grep -v 'tests/ref/fate/source'
>> >>
>> >>  exit 0
>> >> diff --git a/tests/ref/fate/source b/tests/ref/fate/source
>> >> index 9cd8b30..7edd7e9 100644
>> >> --- a/tests/ref/fate/source
>> >> +++ b/tests/ref/fate/source
>> >> @@ -16,3 +16,6 @@ libswresample/log2_tab.c
>> >>  libswscale/log2_tab.c
>> >>  tools/uncoded_frame.c
>> >>  tools/yuvcmp.c
>> >> +Files that contain words with common typos:
>> >> +doc/t2h.pm:$program, $generator) = 
>> >> $self->_file_header_informations($command);
>> >> +tools/patcheck:hiegrep 
>> >> '\b(awnser|cant|dont|wont|doesnt|usefull|successfull|occured|teh|alot|wether|skiped|skiping|heigth|informations|colums|loosy|loosing|ouput|seperate|preceed|upto|paket|posible|unkown|inpossible|dimention|acheive|funtions|overriden|outputing|seperation|initalize|compatibilty|bistream|knwon|unknwon|choosen|additonal|gurantee|availble|wich)\b'
>> >>  'common typos' $*
>> >
>> > This kind of stuff doesn't belong into FATE itself.
>>
>> I agree, we have patchcheck for typo checking.
>
> A lot of people do not run patchcheck (I personally never do, and given
> that we fix typo on a regular basis I'm probably not the only one in this
> situation); I think having it in FATE makes sense from a usage widespread
> PoV. But it might be relevant to drop the typo code from patchcheck then
> to avoid the duplication.
>

FATE should be about testing the functionality, not probing the
source-code for irrelevant typos and comments.
If you want a new more prominent tool for that, go ahead, but FATE
isn't the right place for that.

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


Re: [FFmpeg-devel] [PATCH 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread James Almer
On 9/29/2015 5:14 PM, Hendrik Leppkes wrote:
> Typos should not be fixed in the merge. Either review and fix them
> before they get commited in Libav, or fix them in a separate commit
> afterwards.
> If I have to start fixing every typo in every commit that I merge from
> Libav, then I'm going to go crazy. So, just don't.
> 
> - Hendrik

My bad, i thought this was about the license header checking patch.
My fault for not reading the subject :P

I agree, then. Typo check for patches is a patcheck functionality, not
FATE.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 2/8] configure: Add version check for libkvazaar

2015-09-29 Thread Hendrik Leppkes
On Tue, Sep 29, 2015 at 9:39 PM, Carl Eugen Hoyos  wrote:
> Clément Bœsch  pkh.me> writes:
>
>> > + { check_cpp_condition kvazaar.h "KVZ_API_VERSION >= 7" ||
>> > +   die "ERROR: kvazaar API version must be at least 7."; }
>>
>> Can you do something like require_pkg_config "kvazaar >= 1.2.3" instead?
>
> Please don't!
> This only adds an unneeded requirement (and a regression)
> to the library

It already requires pkg-config, all Clement is asking to also use it
to check the version, which makes a lot of sense.
Its also much more visible for users. API versions aren't meaningful
to users, while actual library versions are.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 2/8] configure: Add version check for libkvazaar

2015-09-29 Thread Clément Bœsch
On Tue, Sep 29, 2015 at 07:39:05PM +, Carl Eugen Hoyos wrote:
> Clément Bœsch  pkh.me> writes:
> 
> > > + { check_cpp_condition kvazaar.h "KVZ_API_VERSION >= 7" ||
> > > +   die "ERROR: kvazaar API version must be at least 7."; }
> > 
> > Can you do something like require_pkg_config "kvazaar >= 1.2.3" instead?
> 
> Please don't!
> This only adds an unneeded requirement (and a regression) 
> to the library 

It's already using exclusively pkg-config, or you are talking about the
version requirement itself?

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH 3/3][RFC] avfilter/vf_chromakey: Add OpenCL acceleration

2015-09-29 Thread Timo Rothenpieler
> Signed-off-by: Timo Rothenpieler 
> ---
>  doc/filters.texi  |   5 +
>  libavfilter/chromakey_opencl_kernel.h |  98 +++
>  libavfilter/opencl_allkernels.c   |   2 +
>  libavfilter/vf_chromakey.c| 179 
> +-
>  4 files changed, 283 insertions(+), 1 deletion(-)
>  create mode 100644 libavfilter/chromakey_opencl_kernel.h
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 044876c..4faf4b9 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -3734,6 +3734,11 @@ Signals that the color passed is already in YUV 
> instead of RGB.
>  
>  Litteral colors like "green" or "red" don't make sense with this enabled 
> anymore.
>  This can be used to pass exact YUV values as hexadecimal numbers.
> +
> +@item opencl
> +If set to 1, specify using OpenCL capabilities, only available if
> +FFmpeg was configured with @code{--enable-opencl}. Default value is 0.
> +
>  @end table
>  
>  @subsection Examples
> diff --git a/libavfilter/chromakey_opencl_kernel.h 
> b/libavfilter/chromakey_opencl_kernel.h
> new file mode 100644
> index 000..56bbc79
> --- /dev/null
> +++ b/libavfilter/chromakey_opencl_kernel.h
> @@ -0,0 +1,98 @@
> +/*
> + * Copyright (c) 2015 Timo Rothenpieler 
> + *
> + * 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
> + */
> +
> +#ifndef AVFILTER_CHROMAKEY_OPENCL_KERNEL_H
> +#define AVFILTER_CHROMAKEY_OPENCL_KERNEL_H
> +
> +#include "libavutil/opencl.h"
> +
> +const char *ff_kernel_chromakey_opencl = AV_OPENCL_KERNEL(
> +
> +inline unsigned char get_pixel(global unsigned char *src,
> +   int x,
> +   int y,
> +   int w,
> +   int h,
> +   int linesize,
> +   int hsub_log2,
> +   int vsub_log2,
> +   unsigned char def)
> +{
> +if (x < 0 || x >= w || y < 0 || x >= w)
> +return def;
> +
> +x >>= hsub_log2;
> +y >>= vsub_log2;
> +
> +return src[linesize * y + x];
> +}
> +
> +kernel void chromakey(global unsigned char *src_u,
> +  global unsigned char *src_v,
> +  global unsigned char *dst,
> +  int linesize_u,
> +  int linesize_v,
> +  int linesize_a,
> +  int height,
> +  int width,
> +  int hsub_log2,
> +  int vsub_log2,
> +  unsigned char chromakey_u,
> +  unsigned char chromakey_v,
> +  float similarity,
> +  float blend
> + )
> +{
> +int x = get_global_id(0);
> +int y = get_global_id(1);
> +unsigned char res;
> +
> +int xo, yo, du, dv;
> +double diff = 0.0;
> +
> +if (x >= width || y >= height)
> +return;
> +
> +for (yo = 0; yo < 3; yo++) {
> +for (xo = 0; xo < 3; xo++) {
> +du = get_pixel(src_u, x + xo - 1, y + yo - 1, width, height, 
> linesize_u, hsub_log2, vsub_log2, chromakey_u);
> +dv = get_pixel(src_v, x + xo - 1, y + yo - 1, width, height, 
> linesize_v, hsub_log2, vsub_log2, chromakey_v);
> +
> +du -= chromakey_u;
> +dv -= chromakey_v;
> +
> +diff += sqrt((du * du + dv * dv) / (double)(255.0 * 255.0));
> +}
> +}
> +
> +diff /= 9.0;
> +
> +if (blend > 0.0001) {
> +res = clamp((diff - similarity) / blend, 0.0, 1.0) * 255.0;
> +} else {
> +res = (diff > similarity) ? 255 : 0;
> +}
> +
> +dst[linesize_a * y + x] = res;
> +}
> +
> +);
> +
> +#endif /* AVFILTER_CHROMAKEY_OPENCL_KERNEL_H */
> diff --git a/libavfilter/opencl_allkernels.c b/libavfilter/opencl_allkernels.c
> index 6d80fa8..fc05e66 100644
> --- a/libavfilter/opencl_allkernels.c
> +++ b/libavfilter/opencl_allkernels.c
> @@ -23,6 +23,7 @@
>  #include "libavutil/opencl.h"
>  #include "deshake_opencl_kernel.h"
>  #include "unsharp_opencl_kernel.h"
> +#include "chromakey_opencl_kernel.h"
>  #endif

Re: [FFmpeg-devel] [PATCH 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread James Almer
On 9/29/2015 4:21 PM, Hendrik Leppkes wrote:
> On Tue, Sep 29, 2015 at 9:08 PM, wm4  wrote:
>> On Tue, 29 Sep 2015 20:57:31 +0200
>> Michael Niedermayer  wrote:
>>
>>> From: Michael Niedermayer 
>>>
>>> Signed-off-by: Michael Niedermayer 
>>> ---
>>>  tests/fate/source-check.sh |8 
>>>  tests/ref/fate/source  |3 +++
>>>  2 files changed, 11 insertions(+)
>>>
>>> diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
>>> index fb7af98..ac6bbc0 100755
>>> --- a/tests/fate/source-check.sh
>>> +++ b/tests/fate/source-check.sh
>>> @@ -16,5 +16,13 @@ git grep -L -E "This file is part of FFmpeg|This file is 
>>> part of libswresample|"
>>>  "This program is free software; you can redistribute it and/or modify|"\
>>>  "This file is placed in the public domain" | grep -E 
>>> '\.c$|\.h$|\.S$|\.asm$'
>>>
>>> +echo Files that contain words with common typos:
>>> +git grep -E 
>>> '(^|[^a-zA-Z])([cC]ant|[dDwW]ont|[dD]oesnt|[uU]sefull|[sS]uccessfull|"\
>>> +"[oO]ccured|[aA]wnser|[tT]eh|[aA]lot|[wW]ether|[sS]kiped|[sS]kiping"\
>>> +"[hH]eigth|[iI]nformations|[cC]olums|[lL]oosy|[lL]oosing|[oO]uput|[sS]eperate|[pP]receed|[uU]pto|[pP]aket|[pP]osible|[uU]nkown"\
>>> +"[Ii]npossible|[dD]imention|[aA]cheive|[fF]untions|[oO]verriden|[oO]utputing|[sS]eperation|[iI]nitalize|[cC]ompatibilty|[bB]istream|[kK]nwon|[uU]nknwon"\
>>> +"[Cc]onvertion|[Oo]mmit|[cC]hoosen|[aA]dditonal|[gG]urantee|[aA]vailble|[wW]ich|[Oo]utter|[Ss]eperator"\
>>> +"[Ss]uccesfully|[Rr]eproducable|[Ss]pecifiying|[Ss]eperated|[pP]recission|[iI]naccuarte|[iI]nitilaize"\
>>> +")($|[^a-zA-Z])' | grep -v 'tests/ref/fate/source'
>>>
>>>  exit 0
>>> diff --git a/tests/ref/fate/source b/tests/ref/fate/source
>>> index 9cd8b30..7edd7e9 100644
>>> --- a/tests/ref/fate/source
>>> +++ b/tests/ref/fate/source
>>> @@ -16,3 +16,6 @@ libswresample/log2_tab.c
>>>  libswscale/log2_tab.c
>>>  tools/uncoded_frame.c
>>>  tools/yuvcmp.c
>>> +Files that contain words with common typos:
>>> +doc/t2h.pm:$program, $generator) = 
>>> $self->_file_header_informations($command);
>>> +tools/patcheck:hiegrep 
>>> '\b(awnser|cant|dont|wont|doesnt|usefull|successfull|occured|teh|alot|wether|skiped|skiping|heigth|informations|colums|loosy|loosing|ouput|seperate|preceed|upto|paket|posible|unkown|inpossible|dimention|acheive|funtions|overriden|outputing|seperation|initalize|compatibilty|bistream|knwon|unknwon|choosen|additonal|gurantee|availble|wich)\b'
>>>  'common typos' $*
>>
>> This kind of stuff doesn't belong into FATE itself.
> 
> I agree, we have patchcheck for typo checking.

As i mentioned on IRC, historically most wrong headers have come from libav
merges, and that's something you can't analyze with patcheck.

Nonetheless I agree this functionality should be also added to tools/patcheck,
which is the proper place for this stuff, since at some point this test should
be removed and replaced with something else (git hooks? Merge script update?).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] tests/fate/source-check.sh: Check for common typos

2015-09-29 Thread Hendrik Leppkes
On Tue, Sep 29, 2015 at 10:11 PM, James Almer  wrote:
> On 9/29/2015 4:21 PM, Hendrik Leppkes wrote:
>> On Tue, Sep 29, 2015 at 9:08 PM, wm4  wrote:
>>> On Tue, 29 Sep 2015 20:57:31 +0200
>>> Michael Niedermayer  wrote:
>>>
 From: Michael Niedermayer 

 Signed-off-by: Michael Niedermayer 
 ---
  tests/fate/source-check.sh |8 
  tests/ref/fate/source  |3 +++
  2 files changed, 11 insertions(+)

 diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
 index fb7af98..ac6bbc0 100755
 --- a/tests/fate/source-check.sh
 +++ b/tests/fate/source-check.sh
 @@ -16,5 +16,13 @@ git grep -L -E "This file is part of FFmpeg|This file 
 is part of libswresample|"
  "This program is free software; you can redistribute it and/or modify|"\
  "This file is placed in the public domain" | grep -E 
 '\.c$|\.h$|\.S$|\.asm$'

 +echo Files that contain words with common typos:
 +git grep -E 
 '(^|[^a-zA-Z])([cC]ant|[dDwW]ont|[dD]oesnt|[uU]sefull|[sS]uccessfull|"\
 +"[oO]ccured|[aA]wnser|[tT]eh|[aA]lot|[wW]ether|[sS]kiped|[sS]kiping"\
 +"[hH]eigth|[iI]nformations|[cC]olums|[lL]oosy|[lL]oosing|[oO]uput|[sS]eperate|[pP]receed|[uU]pto|[pP]aket|[pP]osible|[uU]nkown"\
 +"[Ii]npossible|[dD]imention|[aA]cheive|[fF]untions|[oO]verriden|[oO]utputing|[sS]eperation|[iI]nitalize|[cC]ompatibilty|[bB]istream|[kK]nwon|[uU]nknwon"\
 +"[Cc]onvertion|[Oo]mmit|[cC]hoosen|[aA]dditonal|[gG]urantee|[aA]vailble|[wW]ich|[Oo]utter|[Ss]eperator"\
 +"[Ss]uccesfully|[Rr]eproducable|[Ss]pecifiying|[Ss]eperated|[pP]recission|[iI]naccuarte|[iI]nitilaize"\
 +")($|[^a-zA-Z])' | grep -v 'tests/ref/fate/source'

  exit 0
 diff --git a/tests/ref/fate/source b/tests/ref/fate/source
 index 9cd8b30..7edd7e9 100644
 --- a/tests/ref/fate/source
 +++ b/tests/ref/fate/source
 @@ -16,3 +16,6 @@ libswresample/log2_tab.c
  libswscale/log2_tab.c
  tools/uncoded_frame.c
  tools/yuvcmp.c
 +Files that contain words with common typos:
 +doc/t2h.pm:$program, $generator) = 
 $self->_file_header_informations($command);
 +tools/patcheck:hiegrep 
 '\b(awnser|cant|dont|wont|doesnt|usefull|successfull|occured|teh|alot|wether|skiped|skiping|heigth|informations|colums|loosy|loosing|ouput|seperate|preceed|upto|paket|posible|unkown|inpossible|dimention|acheive|funtions|overriden|outputing|seperation|initalize|compatibilty|bistream|knwon|unknwon|choosen|additonal|gurantee|availble|wich)\b'
  'common typos' $*
>>>
>>> This kind of stuff doesn't belong into FATE itself.
>>
>> I agree, we have patchcheck for typo checking.
>
> As i mentioned on IRC, historically most wrong headers have come from libav
> merges, and that's something you can't analyze with patcheck.
>
> Nonetheless I agree this functionality should be also added to tools/patcheck,
> which is the proper place for this stuff, since at some point this test should
> be removed and replaced with something else (git hooks? Merge script update?).

Typos should not be fixed in the merge. Either review and fix them
before they get commited in Libav, or fix them in a separate commit
afterwards.
If I have to start fixing every typo in every commit that I merge from
Libav, then I'm going to go crazy. So, just don't.

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