Re: [FFmpeg-devel] [PATCH] libavcodec/qsv.c: Issue fixed: QSV engine does not release display handler under linux platform.

2015-07-14 Thread Ivan Uskov
Hello Gwenole,

As I can see the current implementation of qsv-accelerated components
already allows to use external MXF session created by main application.
Please look the AVQSVContext structure into \libavcodec\qsv.h, example of
its allocation into the \doc\examples\qsvdec.c and how
AVCodecContext::hwaccel_context uses into the 
libavcodec\qsvenc.c::ff_qsv_enc_init()

Only when external session not specified the qsv engine forced to
search appropriate device by itself and open an internal session.

Tuesday, July 14, 2015, 12:26:41 AM, you wrote:

GB Note it would also be interesting to provide a means to import a
GB VADisplay from the user through an additional function. e.g. in view
GB to interop VA decode to MSDK encode and/or video processing.

GB Regards,



-- 
Best regards,
 Ivanmailto:ivan.us...@nablet.com

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


Re: [FFmpeg-devel] [PATCH 05/12] libavcodec: Implementation of AAC_fixed_decoder (SBR-module) [1/3]

2015-07-14 Thread Nedeljko Babic
On Tue, Jun 30, 2015 at 11:53:07AM +0200, Nedeljko Babic wrote:
 From: Djordje Pesut djordje.pe...@imgtec.com
 
 Move the existing code to a new template file.
 
 Signed-off-by: Nedeljko Babic nedeljko.ba...@imgtec.com
 ---
  libavcodec/aacsbr.c| 1419 
 +---
  libavcodec/aacsbr.h|   45 +
  libavcodec/{aacsbr.c = aacsbr_template.c} |  377 
  libavcodec/sbrdsp.c|   75 +-
  libavcodec/sbrdsp_template.c   |   95 ++
  5 files changed, 142 insertions(+), 1869 deletions(-)
  copy libavcodec/{aacsbr.c = aacsbr_template.c} (78%)
  create mode 100644 libavcodec/sbrdsp_template.c

seems not to apply cleanly

Applying: libavcodec: Implementation of AAC_fixed_decoder (SBR-module) [1/3]
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging libavcodec/aacsbr.c
CONFLICT (content): Merge conflict in libavcodec/aacsbr.c
Failed to merge in the changes.
Patch failed at 0001 libavcodec: Implementation of AAC_fixed_decoder 
(SBR-module) [1/3]
When you have resolved this problem run git am --resolved.
If you would prefer to skip this patch, instead run git am --skip.
To restore the original branch and stop patching run git am --abort.

The reason is in the recent changes to the file libavcodec/aacsbr.c.
I'll rebase this as well as other patches and resend them.

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


Re: [FFmpeg-devel] [PATCH 06/12] libavcodec: Implementation of AAC_fixed_decoder (SBR-module) [2/3]

2015-07-14 Thread Nedeljko Babic
On Tue, Jun 30, 2015 at 11:53:08AM +0200, Nedeljko Babic wrote:
 From: Jovan Zelincevic jovan.zelince...@imgtec.com

 Create tables for fixed point code.

Can you make the first line of the commit messages a bit more
informative

when looking at it with git log --oneline
they would all be nearly identical and one wouldnt know which is
doing what

Ok. I'll make changes in the new patch set.

-Nedeljko


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


Re: [FFmpeg-devel] [PATCH] avcodec: add libkvazaar HECV encoder

2015-07-14 Thread Hendrik Leppkes
On Tue, Jul 14, 2015 at 7:53 AM, Arttu Ylä-Outinen
arttu.yla-outi...@tut.fi wrote:
 Signed-off-by: Arttu Ylä-Outinen arttu.yla-outi...@tut.fi
 ---
  Changelog   |1 +
  configure   |4 +
  doc/encoders.texi   |   24 +
  doc/general.texi|   10 +-
  libavcodec/Makefile |1 +
  libavcodec/allcodecs.c  |1 +
  libavcodec/libkvazaar.c |  248 
 +++
  libavcodec/version.h|2 +-
  8 files changed, 289 insertions(+), 2 deletions(-)
  create mode 100644 libavcodec/libkvazaar.c

 diff --git a/Changelog b/Changelog
 index ccd8d4a..a4451f9 100644
 --- a/Changelog
 +++ b/Changelog
 @@ -15,6 +15,7 @@ version next:
  - adrawgraph audio and drawgraph video filter
  - removegrain video filter
  - Intel QSV-accelerated MPEG-2 video and HEVC encoding
 +- libkvazaar HEVC encoder


  version 2.7:
 diff --git a/configure b/configure
 index 88ee936..5616b59 100755
 --- a/configure
 +++ b/configure
 @@ -222,6 +222,7 @@ External library support:
--enable-libgsm  enable GSM de/encoding via libgsm [no]
--enable-libiec61883 enable iec61883 via libiec61883 [no]
--enable-libilbc enable iLBC de/encoding via libilbc [no]
 +  --enable-libkvazaar  enable HEVC encoding via libkvazaar [no]
--enable-libmfx  enable HW acceleration through libmfx
--enable-libmodplug  enable ModPlug via libmodplug [no]
--enable-libmp3lame  enable MP3 encoding via libmp3lame [no]
 @@ -1386,6 +1387,7 @@ EXTERNAL_LIBRARY_LIST=
  libgsm
  libiec61883
  libilbc
 +libkvazaar
  libmfx
  libmodplug
  libmp3lame
 @@ -2464,6 +2466,7 @@ libgsm_ms_decoder_deps=libgsm
  libgsm_ms_encoder_deps=libgsm
  libilbc_decoder_deps=libilbc
  libilbc_encoder_deps=libilbc
 +libkvazaar_encoder_deps=libkvazaar
  libmodplug_demuxer_deps=libmodplug
  libmp3lame_encoder_deps=libmp3lame
  libmp3lame_encoder_select=audio_frame_queue
 @@ -5152,6 +5155,7 @@ enabled libgsm { for gsm_hdr in gsm.h 
 gsm/gsm.h; do
 check_lib ${gsm_hdr} gsm_create -lgsm 
  break;
 done || die ERROR: libgsm not found; }
  enabled libilbcrequire libilbc ilbc.h WebRtcIlbcfix_InitDecode 
 -lilbc
 +enabled libkvazaar require2 libkvazaar kvazaar.h kvz_api_get 
 -lkvazaar
  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
 diff --git a/doc/encoders.texi b/doc/encoders.texi
 index 5946644..6e50a90 100644
 --- a/doc/encoders.texi
 +++ b/doc/encoders.texi
 @@ -2315,6 +2315,30 @@ Setting a higher @option{bits_per_mb} limit will 
 improve the speed.
  For the fastest encoding speed set the @option{qscale} parameter (4 is the
  recommended value) and do not set a size constraint.

 +@section libkvazaar
 +
 +Kvazaar H.265/HEVC encoder.
 +
 +Requires the presence of the libkvazaar headers and library during
 +configuration. You need to explicitly configure the build with
 +@option{--enable-libkvazaar}.
 +
 +@subsection Options
 +
 +@table @option
 +
 +@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.
 +
 +@end table
 +
  @c man end VIDEO ENCODERS

  @chapter Subtitles Encoders
 diff --git a/doc/general.texi b/doc/general.texi
 index 5089c36..dc22d90 100644
 --- a/doc/general.texi
 +++ b/doc/general.texi
 @@ -145,6 +145,14 @@ x265 is under the GNU Public License Version 2 or later
  details), you must upgrade FFmpeg's license to GPL in order to use it.
  @end float

 +@section kvazaar
 +
 +FFmpeg can make use of the kvazaar library for HEVC encoding.
 +
 +Go to @url{https://github.com/ultravideo/kvazaar} and follow the
 +instructions for installing the library. Then pass
 +@code{--enable-libkvazaar} to configure to enable it.
 +
  @section libilbc

  iLBC is a narrowband speech codec that has been made freely available
 @@ -688,7 +696,7 @@ following image formats are supported:
  @item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10  @tab  E  @tab  X
  @tab encoding supported through external library libx264 and OpenH264
  @item HEVC   @tab  X  @tab  X
 -@tab encoding supported through the external library libx265
 +@tab encoding supported through external library libx265 and libkvazaar
  @item HNM version 4  @tab @tab  X
  @item HuffYUV@tab  X  @tab  X
  @item HuffYUV FFmpeg variant @tab  X  @tab  X
 diff --git a/libavcodec/Makefile b/libavcodec/Makefile
 index 70755f6..b7fe1c9 100644
 --- a/libavcodec/Makefile
 +++ 

[FFmpeg-devel] [PATCH] avutil/fifo: func could return less bytes in av_fifo_generic_write()

2015-07-14 Thread Zhang Rui
---
 libavutil/fifo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 4ff3194..f2fe93d 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -129,7 +129,8 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int 
size,
 do {
 int len = FFMIN(f-end - wptr, size);
 if (func) {
-if (func(src, wptr, len) = 0)
+len = func(src, wptr, len);
+if (len = 0)
 break;
 } else {
 memcpy(wptr, src, len);
-- 
2.0.0

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


Re: [FFmpeg-devel] [PATCH 3/3] swscale: ayuv16le output support

2015-07-14 Thread Robert Krüger
On Mon, Jul 6, 2015 at 3:12 PM, Michael Niedermayer michae...@gmx.at
wrote:

 On Mon, Jul 06, 2015 at 03:10:41PM +0200, Michael Niedermayer wrote:
  On Mon, Jul 06, 2015 at 11:56:21AM +, Paul B Mahol wrote:
   Signed-off-by: Paul B Mahol one...@gmail.com
   ---
libswscale/output.c  | 48
 
libswscale/utils.c   |  2 +-
tests/ref/fate/filter-pixfmts-copy   |  1 +
tests/ref/fate/filter-pixfmts-crop   |  1 +
tests/ref/fate/filter-pixfmts-field  |  1 +
tests/ref/fate/filter-pixfmts-fieldorder |  1 +
tests/ref/fate/filter-pixfmts-hflip  |  1 +
tests/ref/fate/filter-pixfmts-il |  1 +
tests/ref/fate/filter-pixfmts-null   |  1 +
tests/ref/fate/filter-pixfmts-scale  |  1 +
tests/ref/fate/filter-pixfmts-vflip  |  1 +
11 files changed, 58 insertions(+), 1 deletion(-)
 
   filter-pixfmts-fieldorder
  TESTfilter-pixfmts-hflip
  reference file './tests/ref/fate/filter-pixdesc-ayuv16le' not found
  ./tests/fate-run.sh: 282: ./tests/fate-run.sh: cannot open
 tests/data/fate/filter-pixdesc-ayuv16le.diff: No such file
  Test filter-pixdesc-ayuv16le failed. Look at
 tests/data/fate/filter-pixdesc-ayuv16le.err for details.
  make: *** [fate-filter-pixdesc-ayuv16le] Error 1
 
  patch should be ok otherwise

 (assuming roberts tests find no issues of course)


Verified that this creates valid input for the Apple Prores Encoder which
is great.

A side-note: In our transcoding set-up I just quickly compared the
performance of that conversion (in the test case from yuv420p - AYUV16LE)
is still slower than our previous setup with conversion yuv420p -
YUVA444P10LE using swscale and then doing the YUVA444P10LE - AYUV16LE
conversion in Java but I guess that is because there is no asm for this.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] Refactoring to move common QSV-related code part into libavcodec/qsvdec.c

2015-07-14 Thread Ivan Uskov
Hello All,

Current implementation of qsvdec_h264.c does contain initialization
code which is common for all qsv-based decoders. The attached patch
moves common code into qsvdec.c. The declaration ff_qsv_decode_init
has been unified with ff_qsv_encode_init.
Please review.

  

-- 
Best regards,
 Ivan  mailto:ivan.us...@nablet.com

0001-Refactoring-to-move-common-QSV-related-code-part-int.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] swscale: ayuv16le output support

2015-07-14 Thread Paul B Mahol
Dana 14. 7. 2015. 13:09 osoba Robert Krüger krue...@lesspain.de
napisala je:

 On Mon, Jul 6, 2015 at 3:12 PM, Michael Niedermayer michae...@gmx.at
 wrote:

  On Mon, Jul 06, 2015 at 03:10:41PM +0200, Michael Niedermayer wrote:
   On Mon, Jul 06, 2015 at 11:56:21AM +, Paul B Mahol wrote:
Signed-off-by: Paul B Mahol one...@gmail.com
---
 libswscale/output.c  | 48
  
 libswscale/utils.c   |  2 +-
 tests/ref/fate/filter-pixfmts-copy   |  1 +
 tests/ref/fate/filter-pixfmts-crop   |  1 +
 tests/ref/fate/filter-pixfmts-field  |  1 +
 tests/ref/fate/filter-pixfmts-fieldorder |  1 +
 tests/ref/fate/filter-pixfmts-hflip  |  1 +
 tests/ref/fate/filter-pixfmts-il |  1 +
 tests/ref/fate/filter-pixfmts-null   |  1 +
 tests/ref/fate/filter-pixfmts-scale  |  1 +
 tests/ref/fate/filter-pixfmts-vflip  |  1 +
 11 files changed, 58 insertions(+), 1 deletion(-)
  
filter-pixfmts-fieldorder
   TESTfilter-pixfmts-hflip
   reference file './tests/ref/fate/filter-pixdesc-ayuv16le' not found
   ./tests/fate-run.sh: 282: ./tests/fate-run.sh: cannot open
  tests/data/fate/filter-pixdesc-ayuv16le.diff: No such file
   Test filter-pixdesc-ayuv16le failed. Look at
  tests/data/fate/filter-pixdesc-ayuv16le.err for details.
   make: *** [fate-filter-pixdesc-ayuv16le] Error 1
  
   patch should be ok otherwise
 
  (assuming roberts tests find no issues of course)
 
 
 Verified that this creates valid input for the Apple Prores Encoder which
 is great.

 A side-note: In our transcoding set-up I just quickly compared the
 performance of that conversion (in the test case from yuv420p - AYUV16LE)
 is still slower than our previous setup with conversion yuv420p -
 YUVA444P10LE using swscale and then doing the YUVA444P10LE - AYUV16LE
 conversion in Java but I guess that is because there is no asm for this.


By how much is it slower?
___
 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] avutil/fifo: func could return less bytes in av_fifo_generic_write()

2015-07-14 Thread Michael Niedermayer
On Tue, Jul 14, 2015 at 02:47:26PM +0800, Zhang Rui wrote:
 ---
  libavutil/fifo.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

applied

thanks


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


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


Re: [FFmpeg-devel] [PATCH] vf_psnr: sse2 optimizations for sum-squared-error.

2015-07-14 Thread Michael Niedermayer
On Mon, Jul 13, 2015 at 05:14:09PM -0300, James Almer wrote:
 On 13/07/15 5:07 PM, Ronald S. Bultje wrote:
  Hi,
  
  On Mon, Jul 13, 2015 at 3:50 PM, James Darnley james.darn...@gmail.com
  wrote:
  
  On 2015-07-13 01:34, Ronald S. Bultje wrote:
  Hi,
 
  On Sun, Jul 12, 2015 at 5:54 PM, Paul B Mahol one...@gmail.com wrote:
 
  On 7/12/15, Ronald S. Bultje rsbul...@gmail.com wrote:
  +typedef struct PSNRDSPContext {
  +uint64_t (*sse_line)(const uint8_t *buf, const uint8_t *ref, int
  w);
 
  Besides naming of function sse_line rest LGTM.
 
 
  That was sort of inspired by other functions in lavfi. I'm open to
  alternative suggestions.
 
  If it was called sse after Intel's Streaming SIMD Extensions then it
  would be bad because it implies it must use those instructions.  (Or
  some reason like that.)
 
  If it was called sse after Sum of Squared Errors then it would be good
  because the name is correctly reflecting what it does.
 
  Perhaps ssd is more acceptable after Sum of Squared Differences?
  
  
  Libavcodec calls this thing sum-of-squared-errors already (grep -i squared
  libavcodec/x86/*.asm).
  
  Ronald
 
 Yeah, me_cmp uses sse as abbreviation for Sum of Squared Errors, so IMO it's
 fine here as well.

applied

thanks

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

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


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


Re: [FFmpeg-devel] [PATCH 3/3] swscale: ayuv16le output support

2015-07-14 Thread Robert Krüger
On Tue, Jul 14, 2015 at 3:17 PM, Paul B Mahol one...@gmail.com wrote:

 Dana 14. 7. 2015. 13:09 osoba Robert Krüger krue...@lesspain.de
 napisala je:
 
  On Mon, Jul 6, 2015 at 3:12 PM, Michael Niedermayer michae...@gmx.at
  wrote:
 
   On Mon, Jul 06, 2015 at 03:10:41PM +0200, Michael Niedermayer wrote:
On Mon, Jul 06, 2015 at 11:56:21AM +, Paul B Mahol wrote:
 Signed-off-by: Paul B Mahol one...@gmail.com
 ---
  libswscale/output.c  | 48
   
  libswscale/utils.c   |  2 +-
  tests/ref/fate/filter-pixfmts-copy   |  1 +
  tests/ref/fate/filter-pixfmts-crop   |  1 +
  tests/ref/fate/filter-pixfmts-field  |  1 +
  tests/ref/fate/filter-pixfmts-fieldorder |  1 +
  tests/ref/fate/filter-pixfmts-hflip  |  1 +
  tests/ref/fate/filter-pixfmts-il |  1 +
  tests/ref/fate/filter-pixfmts-null   |  1 +
  tests/ref/fate/filter-pixfmts-scale  |  1 +
  tests/ref/fate/filter-pixfmts-vflip  |  1 +
  11 files changed, 58 insertions(+), 1 deletion(-)
   
 filter-pixfmts-fieldorder
TESTfilter-pixfmts-hflip
reference file './tests/ref/fate/filter-pixdesc-ayuv16le' not found
./tests/fate-run.sh: 282: ./tests/fate-run.sh: cannot open
   tests/data/fate/filter-pixdesc-ayuv16le.diff: No such file
Test filter-pixdesc-ayuv16le failed. Look at
   tests/data/fate/filter-pixdesc-ayuv16le.err for details.
make: *** [fate-filter-pixdesc-ayuv16le] Error 1
   
patch should be ok otherwise
  
   (assuming roberts tests find no issues of course)
  
  
  Verified that this creates valid input for the Apple Prores Encoder which
  is great.
 
  A side-note: In our transcoding set-up I just quickly compared the
  performance of that conversion (in the test case from yuv420p -
 AYUV16LE)
  is still slower than our previous setup with conversion yuv420p -
  YUVA444P10LE using swscale and then doing the YUVA444P10LE - AYUV16LE
  conversion in Java but I guess that is because there is no asm for this.
 

 By how much is it slower?


it's roughly like this (sample is 1080p):

swscale conversion YUV420P - YUVA444P16LE: 10ms + Java Conversion
YUVA444P16LE - AYUV16LE: 20ms

vs.

swscale conversion YUV420P -  AYUV16LE: 40ms

So the old variant takes 75% of the time of the new one but it's probably
an unfair comparison if the path YUV420P - YUVA444P16LE uses asm and the
Java converter in this case only repacks with no subsampling and the JIT
does a decent job at optimizing this.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: add libkvazaar HECV encoder

2015-07-14 Thread Michael Niedermayer
On Tue, Jul 14, 2015 at 09:29:11AM +0200, Hendrik Leppkes wrote:
 On Tue, Jul 14, 2015 at 7:53 AM, Arttu Ylä-Outinen
 arttu.yla-outi...@tut.fi wrote:
  Signed-off-by: Arttu Ylä-Outinen arttu.yla-outi...@tut.fi
  ---
   Changelog   |1 +
   configure   |4 +
   doc/encoders.texi   |   24 +
   doc/general.texi|   10 +-
   libavcodec/Makefile |1 +
   libavcodec/allcodecs.c  |1 +
   libavcodec/libkvazaar.c |  248 
  +++
   libavcodec/version.h|2 +-
   8 files changed, 289 insertions(+), 2 deletions(-)
   create mode 100644 libavcodec/libkvazaar.c
 
  diff --git a/Changelog b/Changelog
  index ccd8d4a..a4451f9 100644
  --- a/Changelog
  +++ b/Changelog
  @@ -15,6 +15,7 @@ version next:
   - adrawgraph audio and drawgraph video filter
   - removegrain video filter
   - Intel QSV-accelerated MPEG-2 video and HEVC encoding
  +- libkvazaar HEVC encoder
 
 
   version 2.7:
  diff --git a/configure b/configure
  index 88ee936..5616b59 100755
  --- a/configure
  +++ b/configure
  @@ -222,6 +222,7 @@ External library support:
 --enable-libgsm  enable GSM de/encoding via libgsm [no]
 --enable-libiec61883 enable iec61883 via libiec61883 [no]
 --enable-libilbc enable iLBC de/encoding via libilbc [no]
  +  --enable-libkvazaar  enable HEVC encoding via libkvazaar [no]
 --enable-libmfx  enable HW acceleration through libmfx
 --enable-libmodplug  enable ModPlug via libmodplug [no]
 --enable-libmp3lame  enable MP3 encoding via libmp3lame [no]
  @@ -1386,6 +1387,7 @@ EXTERNAL_LIBRARY_LIST=
   libgsm
   libiec61883
   libilbc
  +libkvazaar
   libmfx
   libmodplug
   libmp3lame
  @@ -2464,6 +2466,7 @@ libgsm_ms_decoder_deps=libgsm
   libgsm_ms_encoder_deps=libgsm
   libilbc_decoder_deps=libilbc
   libilbc_encoder_deps=libilbc
  +libkvazaar_encoder_deps=libkvazaar
   libmodplug_demuxer_deps=libmodplug
   libmp3lame_encoder_deps=libmp3lame
   libmp3lame_encoder_select=audio_frame_queue
  @@ -5152,6 +5155,7 @@ enabled libgsm { for gsm_hdr in gsm.h 
  gsm/gsm.h; do
  check_lib ${gsm_hdr} gsm_create -lgsm 
   break;
  done || die ERROR: libgsm not found; }
   enabled libilbcrequire libilbc ilbc.h 
  WebRtcIlbcfix_InitDecode -lilbc
  +enabled libkvazaar require2 libkvazaar kvazaar.h kvz_api_get 
  -lkvazaar
   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
  diff --git a/doc/encoders.texi b/doc/encoders.texi
  index 5946644..6e50a90 100644
  --- a/doc/encoders.texi
  +++ b/doc/encoders.texi
  @@ -2315,6 +2315,30 @@ Setting a higher @option{bits_per_mb} limit will 
  improve the speed.
   For the fastest encoding speed set the @option{qscale} parameter (4 is the
   recommended value) and do not set a size constraint.
 
  +@section libkvazaar
  +
  +Kvazaar H.265/HEVC encoder.
  +
  +Requires the presence of the libkvazaar headers and library during
  +configuration. You need to explicitly configure the build with
  +@option{--enable-libkvazaar}.
  +
  +@subsection Options
  +
  +@table @option
  +
  +@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.
  +
  +@end table
  +
   @c man end VIDEO ENCODERS
 
   @chapter Subtitles Encoders
  diff --git a/doc/general.texi b/doc/general.texi
  index 5089c36..dc22d90 100644
  --- a/doc/general.texi
  +++ b/doc/general.texi
  @@ -145,6 +145,14 @@ x265 is under the GNU Public License Version 2 or later
   details), you must upgrade FFmpeg's license to GPL in order to use it.
   @end float
 
  +@section kvazaar
  +
  +FFmpeg can make use of the kvazaar library for HEVC encoding.
  +
  +Go to @url{https://github.com/ultravideo/kvazaar} and follow the
  +instructions for installing the library. Then pass
  +@code{--enable-libkvazaar} to configure to enable it.
  +
   @section libilbc
 
   iLBC is a narrowband speech codec that has been made freely available
  @@ -688,7 +696,7 @@ following image formats are supported:
   @item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10  @tab  E  @tab  X
   @tab encoding supported through external library libx264 and OpenH264
   @item HEVC   @tab  X  @tab  X
  -@tab encoding supported through the external library libx265
  +@tab encoding supported through external library libx265 and libkvazaar
   @item HNM version 4  @tab @tab  X
   @item HuffYUV

Re: [FFmpeg-devel] FFmpeg/MPlayer/rtmpdump possibly searching for a new server and hosting

2015-07-14 Thread Michael Niedermayer
Hi all

libnova (see CC:) has offered us a
OVH (France) 64gb ram xeon server with 4tb storage dedicated for the
project, Administration of the server should be on our side. They can
offer at least 2 years prepaid server. And might pay for longer but no
gurantee for that

no traffic limit, 500mbps wrant 1 gbps burst
CPU: 
http://ark.intel.com/products/75779/Intel-Xeon-Processor-E5-1620-v2-10M-Cache-3_70-GHz

They would ask us to put their link  small logo to our webpage footer
they do not insist on that though IIUC

If i hear no objections i will accept the offer and once we start
using the server add their logolink to the footer of the FFmpeg
webpage.

Thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator


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


[FFmpeg-devel] [PATCH] lavfi: add erosion, dilation, deflate inflate filter

2015-07-14 Thread Paul B Mahol
Signed-off-by: Paul B Mahol one...@gmail.com
---
 Changelog |   1 +
 doc/filters.texi  |  78 
 libavfilter/Makefile  |   4 +
 libavfilter/allfilters.c  |   4 +
 libavfilter/vf_neighbor.c | 315 ++
 5 files changed, 402 insertions(+)
 create mode 100644 libavfilter/vf_neighbor.c

diff --git a/Changelog b/Changelog
index a4451f9..b3a3e11 100644
--- a/Changelog
+++ b/Changelog
@@ -16,6 +16,7 @@ version next:
 - removegrain video filter
 - Intel QSV-accelerated MPEG-2 video and HEVC encoding
 - libkvazaar HEVC encoder
+- erosion, dilation, deflate and inflate video filters
 
 
 version 2.7:
diff --git a/doc/filters.texi b/doc/filters.texi
index 9f7b976..d4d8bad 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3718,6 +3718,24 @@ Set whether or not chroma is considered in the metric 
calculations. Default is
 @code{1}.
 @end table
 
+@section deflate
+
+Apply deflate effect to the video.
+
+This filter replaces the pixel by the local(3x3) average by taking into account
+only values lower than the pixel.
+
+It accepts the following options:
+
+@table @option
+@item threshold
+Allows to limit the maximum change, default is 65535.
+
+@item planes
+Flag which specifies which planes to filter. Default is 15 i.e. all four
+planes.
+@end table
+
 @section dejudder
 
 Remove judder produced by partially interlaced telecined content.
@@ -3904,6 +3922,27 @@ A number representing position of the first frame with 
respect to the telecine
 pattern. This is to be used if the stream is cut. The default value is 
@code{0}.
 @end table
 
+@section dilation
+
+Apply dilation effect to the video.
+
+This filter replaces the pixel by the local(3x3) maximum.
+
+It accepts the following options:
+
+@table @option
+@item threshold
+Allows to limit the maximum change, default is 65535.
+
+@item coordinates
+Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
+pixels are used.
+
+@item planes
+Flag which specifies which planes to filter. Default is 15 i.e. all four
+planes.
+@end table
+
 @section drawbox
 
 Draw a colored box on the input image.
@@ -4759,6 +4798,27 @@ value.
 
 @end table
 
+@section erosion
+
+Apply erosion effect to the video.
+
+This filter replaces the pixel by the local(3x3) minimum.
+
+It accepts the following options:
+
+@table @option
+@item threshold
+Allows to limit the maximum change, default is 65535.
+
+@item coordinates
+Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
+pixels are used.
+
+@item planes
+Flag which specifies which planes to filter. Default is 15 i.e. all four
+planes.
+@end table
+
 @section extractplanes
 
 Extract color channel components from input video stream into
@@ -6356,6 +6416,24 @@ Default value is @code{none}.
 Swap luma/chroma/alpha fields. Exchange even  odd lines. Default value is 
@code{0}.
 @end table
 
+@section inflate
+
+Apply inflate effect to the video.
+
+This filter replaces the pixel by the local(3x3) average by taking into account
+only values higher than the pixel.
+
+It accepts the following options:
+
+@table @option
+@item threshold
+Allows to limit the maximum change, default is 65535.
+
+@item planes
+Flag which specifies which planes to filter. Default is 15 i.e. all four
+planes.
+@end table
+
 @section interlace
 
 Simple interlacing filter from progressive contents. This interleaves upper (or
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index a623433..058b9e9 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -112,10 +112,12 @@ OBJS-$(CONFIG_CROPDETECT_FILTER) += 
vf_cropdetect.o
 OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o
 OBJS-$(CONFIG_DCTDNOIZ_FILTER)   += vf_dctdnoiz.o
 OBJS-$(CONFIG_DECIMATE_FILTER)   += vf_decimate.o
+OBJS-$(CONFIG_DEFLATE_FILTER)+= vf_neighbor.o
 OBJS-$(CONFIG_DEJUDDER_FILTER)   += vf_dejudder.o
 OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
 OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
 OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
+OBJS-$(CONFIG_DILATION_FILTER)   += vf_neighbor.o
 OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
 OBJS-$(CONFIG_DRAWGRAPH_FILTER)  += f_drawgraph.o
 OBJS-$(CONFIG_DRAWGRID_FILTER)   += vf_drawbox.o
@@ -123,6 +125,7 @@ OBJS-$(CONFIG_DRAWTEXT_FILTER)   += 
vf_drawtext.o
 OBJS-$(CONFIG_ELBG_FILTER)   += vf_elbg.o
 OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o
 OBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
+OBJS-$(CONFIG_EROSION_FILTER)+= vf_neighbor.o
 OBJS-$(CONFIG_EXTRACTPLANES_FILTER)  += vf_extractplanes.o
 OBJS-$(CONFIG_FADE_FILTER)   += vf_fade.o
 OBJS-$(CONFIG_FFTFILT_FILTER)+= vf_fftfilt.o
@@ -147,6 +150,7 @@ OBJS-$(CONFIG_HQX_FILTER) 

Re: [FFmpeg-devel] [PATCH] lavfi/removegrain: add x86 and x86_64 SSE2 functions

2015-07-14 Thread James Almer
On 14/07/15 3:54 PM, James Darnley wrote:
 On 2015-07-11 18:34, James Almer wrote:
 On 11/07/15 10:40 AM, James Darnley wrote:
 @@ -566,7 +554,19 @@ static int filter_slice(AVFilterContext *ctx, void 
 *arg, int jobnr, int nb_jobs)
  }
  
  *dst++ = *src++;
 -for (x = 1; x  s-planewidth[i] - 1; x++) {
 +
 +if (s-fl[i]) {
 +int w_asm = (s-planewidth[i] - 2)  ~15;

 I don't thinks this belongs here. If you add an AVX2 version as you intended,
 wouldn't this need to be 31?

 A wrapper function to have this code in the x86 folder may be the best 
 option.
 
 I was considering having the init_x86 function set a variable in the
 context to do this math based on how many pixels are actually done per
 iteration, meaning:
 - 8 for the unpacked words and sse2
 - 16 for the packed bytes and see2 or future unpacked words and avx2
 - 32 for the future packed bytes and avx2
 
 That would let it be simply re-used if someone wanted to try writing a
 line function in C or other platform assembly.
 
 new file mode 100644
 index 000..5e1feea
 --- /dev/null
 +++ b/libavfilter/x86/vf_removegrain.asm
 @@ -0,0 +1,1215 @@
 +;*
 +;* x86-optimized functions for yadif filter
 +;*
 +;* Copyright (C) 2015 James Darnley
 +;*
 +;* This file is part of FFmpeg.
 +;*
 +;* TODO: gpl text goes here.
 +;*
 +
 +; column: -1  0 +1
 +; row -1: a1 a2 a3
 +; row  0: a4  c a5
 +; row +1: a6 a7 a8
 +
 +%include libavutil/x86/x86util.asm
 +
 +SECTION_RODATA

 Declare it SECTION_RODATA 32 now so you don't forget when you add AVX2 
 versions.
 
 Okay, I'm confused by this.  It doesn't align the constants you define
 on 32 byte boundaries if you happen to define the data incorrectly so...
  Why does this matter?  Or what does it do?
 

SECTION_RODATA 32 translates into SECTION .rodata align=32, which according 
to the 
documentation makes sure the constants are aligned on a 32-byte boundary.
I noticed it doesn't do much if the constants are out of order if you will, 
but if
you're defining them right and you're going to use 32-byte movas with them, 
then i
don't see a reason to not declare the section properly.

 +
 +; The loop doesn't need to do all the iterations.  It could stop when the 
 right
 +; pixels are in the right registers.
 +%macro SORT_SQUARE 0
 +%assign k 7
 +%rep 7
 +%assign i 1
 +%assign j 2
 +%rep k
 +SORT_PAIR m %+ i , m %+ j , m9
 +%assign i i+1
 +%assign j j+1
 +%endrep
 +%assign k k-1
 +%endrep
 +%endmacro
 +
 +; %1 dest simd register
 +; %2 source (simd register/memory)
 +; %3 temp simd register
 +%macro ABS_DIFF 3
 +mova %3, %2
 +psubusb %3, %1
 +psubusb %1, %2
 +por %1, %3
 +%endmacro
 +
 +; %1 dest simd register
 +; %2 source (simd register/memory)
 +; %3 temp simd register
 +%macro ABS_DIFF_W 3
 +mova %3, %2
 +psubusw %3, %1
 +psubusw %1, %2
 +por %1, %3
 +%endmacro

 No way to achieve this using the pabs* ssse3 instructions?
 
 Maybe.  I looked them up and see that I would need a subtraction anyway.
  I wonder if I could measure a speed change.  I need to check the
 behaviour of them together with the subtract instructions.

For that matter, since in many cases you're calling two or more ABS_DIFF_W one 
after
the other, you could combine the instructions to minimize dependencies 
regardless of
using pabs or psubs + por like you're doing right now.
It may end up being faster that way.

 
 +; %1 simd register that hold the mask and will hold the result
 +; %2 simd register that holds the true values
 +; %3 location of the false values (simd register/memory)
 +%macro BLEND 3 ; mask, true, false
 +pand %2, %1
 +pandn %1, %3
 +por %1, %2
 +%endmacro

 This doesn't follow the sse4 blend instructions' semantic, so it will make 
 adding AVX2
 versions harder.

 Try instead

 %macro BLEND 3 ; false, true, mask
 pand  %2, %3
 pandn %3, %1
 por   %3, %2
 SWAP  %1, %3
 %endmacro

 Which will let you use vpblendvb %1, %1, %2, %3 for the avx2 version.
 SSE4's pblendvb is kinda crappy, requiring the mask to be in xmm0, so
 adding an SSE4 version may not be worth it.
 
 I applied your patches that you sent on IRC (this and the sort macro
 one).  Do you want me to put your name in the copyright header?
 

Not really. small changes like those are IMO not enough to get credit in the 
header.
If you want you can add a With contributions by line in the commit message.

 diff --git a/libavfilter/x86/vf_removegrain_init.c 
 b/libavfilter/x86/vf_removegrain_init.c
 new file mode 100644
 index 000..450185f
 --- /dev/null
 +++ b/libavfilter/x86/vf_removegrain_init.c
 @@ -0,0 +1,128 @@
 +#include libavutil/attributes.h
 +#include libavutil/cpu.h
 +#include libavutil/x86/cpu.h
 +#include 

[FFmpeg-devel] [PATCH] avfilter/af_astats: calculate audio bit-depth

2015-07-14 Thread Paul B Mahol
Signed-off-by: Paul B Mahol one...@gmail.com
---
 libavfilter/af_astats.c | 21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c
index a89ac6d..21cec8c 100644
--- a/libavfilter/af_astats.c
+++ b/libavfilter/af_astats.c
@@ -33,6 +33,7 @@ typedef struct ChannelStats {
 double min, max;
 double min_run, max_run;
 double min_runs, max_runs;
+uint64_t mask;
 uint64_t min_count, max_count;
 uint64_t nb_samples;
 } ChannelStats;
@@ -121,6 +122,15 @@ static int config_output(AVFilterLink *outlink)
 return 0;
 }
 
+static unsigned bit_depth(uint64_t mask)
+{
+unsigned result = 64;
+
+for (; result  !(mask  1); --result, mask = 1);
+
+return result;
+}
+
 static inline void update_stat(AudioStatsContext *s, ChannelStats *p, double d)
 {
 if (d  p-min) {
@@ -151,6 +161,7 @@ static inline void update_stat(AudioStatsContext *s, 
ChannelStats *p, double d)
 p-sigma_x2 += d * d;
 p-avg_sigma_x2 = p-avg_sigma_x2 * s-mult + (1.0 - s-mult) * d * d;
 p-last = d;
+p-mask |= llrint(d * (1LLU63));
 
 if (p-nb_samples = s-tc_samples) {
 p-max_sigma_x2 = FFMAX(p-max_sigma_x2, p-avg_sigma_x2);
@@ -177,7 +188,7 @@ static void set_meta(AVDictionary **metadata, int chan, 
const char *key,
 
 static void set_metadata(AudioStatsContext *s, AVDictionary **metadata)
 {
-uint64_t min_count = 0, max_count = 0, nb_samples = 0;
+uint64_t mask = 0, min_count = 0, max_count = 0, nb_samples = 0;
 double min_runs = 0, max_runs = 0,
min = DBL_MAX, max = DBL_MIN,
max_sigma_x = 0,
@@ -203,6 +214,7 @@ static void set_metadata(AudioStatsContext *s, AVDictionary 
**metadata)
 max_count += p-max_count;
 min_runs += p-min_runs;
 max_runs += p-max_runs;
+mask |= p-mask;
 nb_samples += p-nb_samples;
 if (fabs(p-sigma_x)  fabs(max_sigma_x))
 max_sigma_x = p-sigma_x;
@@ -217,6 +229,7 @@ static void set_metadata(AudioStatsContext *s, AVDictionary 
**metadata)
 set_meta(metadata, c + 1, Crest_factor, %f, p-sigma_x2 ? 
FFMAX(-p-min, p-max) / sqrt(p-sigma_x2 / p-nb_samples) : 1);
 set_meta(metadata, c + 1, Flat_factor, %f, 
LINEAR_TO_DB((p-min_runs + p-max_runs) / (p-min_count + p-max_count)));
 set_meta(metadata, c + 1, Peak_count, %f, (float)(p-min_count + 
p-max_count));
+set_meta(metadata, c + 1, Bit-depth, %f, bit_depth(p-mask));
 }
 
 set_meta(metadata, 0, Overall.DC_offset, %f, max_sigma_x / (nb_samples 
/ s-nb_channels));
@@ -228,6 +241,7 @@ static void set_metadata(AudioStatsContext *s, AVDictionary 
**metadata)
 set_meta(metadata, 0, Overall.RMS_trough, %f, 
LINEAR_TO_DB(sqrt(min_sigma_x2)));
 set_meta(metadata, 0, Overall.Flat_factor, %f, LINEAR_TO_DB((min_runs 
+ max_runs) / (min_count + max_count)));
 set_meta(metadata, 0, Overall.Peak_count, %f, (float)(min_count + 
max_count) / (double)s-nb_channels);
+set_meta(metadata, 0, Overall.Bit-depth, %f, bit_depth(mask));
 set_meta(metadata, 0, Overall.Number_of_samples, %f, nb_samples / 
s-nb_channels);
 }
 
@@ -276,7 +290,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
 static void print_stats(AVFilterContext *ctx)
 {
 AudioStatsContext *s = ctx-priv;
-uint64_t min_count = 0, max_count = 0, nb_samples = 0;
+uint64_t mask = 0, min_count = 0, max_count = 0, nb_samples = 0;
 double min_runs = 0, max_runs = 0,
min = DBL_MAX, max = DBL_MIN,
max_sigma_x = 0,
@@ -302,6 +316,7 @@ static void print_stats(AVFilterContext *ctx)
 max_count += p-max_count;
 min_runs += p-min_runs;
 max_runs += p-max_runs;
+mask |= p-mask;
 nb_samples += p-nb_samples;
 if (fabs(p-sigma_x)  fabs(max_sigma_x))
 max_sigma_x = p-sigma_x;
@@ -318,6 +333,7 @@ static void print_stats(AVFilterContext *ctx)
 av_log(ctx, AV_LOG_INFO, Crest factor: %f\n, p-sigma_x2 ? 
FFMAX(-p-min, p-max) / sqrt(p-sigma_x2 / p-nb_samples) : 1);
 av_log(ctx, AV_LOG_INFO, Flat factor: %f\n, 
LINEAR_TO_DB((p-min_runs + p-max_runs) / (p-min_count + p-max_count)));
 av_log(ctx, AV_LOG_INFO, Peak count: %PRId64\n, p-min_count + 
p-max_count);
+av_log(ctx, AV_LOG_INFO, Bit-depth: %u\n, bit_depth(p-mask));
 }
 
 av_log(ctx, AV_LOG_INFO, Overall\n);
@@ -331,6 +347,7 @@ static void print_stats(AVFilterContext *ctx)
 av_log(ctx, AV_LOG_INFO, RMS trough dB: %f\n, 
LINEAR_TO_DB(sqrt(min_sigma_x2)));
 av_log(ctx, AV_LOG_INFO, Flat factor: %f\n, LINEAR_TO_DB((min_runs + 
max_runs) / (min_count + max_count)));
 av_log(ctx, AV_LOG_INFO, Peak count: %f\n, (min_count + max_count) / 
(double)s-nb_channels);
+av_log(ctx, AV_LOG_INFO, Bit-depth: %u\n, bit_depth(mask));
 av_log(ctx, AV_LOG_INFO, Number of samples: %PRId64\n, nb_samples / 
s-nb_channels);
 }
 
-- 
1.7.11.2


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

2015-07-14 Thread Paul B Mahol
Signed-off-by: Paul B Mahol one...@gmail.com
---
 doc/filters.texi |  35 ++
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/vf_deband.c  | 312 +++
 4 files changed, 349 insertions(+)
 create mode 100644 libavfilter/vf_deband.c

diff --git a/doc/filters.texi b/doc/filters.texi
index 9f7b976..0a07735 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3678,6 +3678,41 @@ Violent denoise using a block size of @code{16x16}:
 dctdnoiz=15:n=4
 @end example
 
+@section deband
+
+Remove banding artifacts from input video.
+It works by replacing banded pixels with average value of referenced pixels.
+
+The filter accepts the following options:
+
+@table @option
+@item 1thr
+@item 2thr
+@item 3thr
+@item 4thr
+Set banding detection threshold for each plane. Default is 0.02. Range from
+which value can be selected is from 0.008 to 0.5.
+If difference between current pixel and reference pixel is less than threshold,
+it will be considered as banded.
+
+@item range, r
+Banding detection range in pixels. Default is 16. If positive, random number
+from range 0 to set value will be picked. If negative, exact of absolute value
+will be used.
+The range defines square of four pixels around current pixel.
+
+@item direction, d
+Set direction from which four pixel will be compared. If positive, random
+direction from 0 to set direction will be picked. If negative, exact of
+absolute value will be picked.
+
+@item blur
+If enabled current pixel is compared with average value of all four
+surrounding pixels. By default is enabled. If disabled current pixel is
+compared with all four surrounding pixels. The pixel is considered banded
+if only all four differences with surrounding pixels are less than threshold.
+@end table
+
 @anchor{decimate}
 @section decimate
 
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index a623433..ea5c7c8 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -111,6 +111,7 @@ OBJS-$(CONFIG_CROP_FILTER)   += vf_crop.o
 OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o
 OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o
 OBJS-$(CONFIG_DCTDNOIZ_FILTER)   += vf_dctdnoiz.o
+OBJS-$(CONFIG_DEBAND_FILTER) += vf_deband.o
 OBJS-$(CONFIG_DECIMATE_FILTER)   += vf_decimate.o
 OBJS-$(CONFIG_DEJUDDER_FILTER)   += vf_dejudder.o
 OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index ab0dc1d..5128708 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -127,6 +127,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(CROPDETECT, cropdetect, vf);
 REGISTER_FILTER(CURVES, curves, vf);
 REGISTER_FILTER(DCTDNOIZ,   dctdnoiz,   vf);
+REGISTER_FILTER(DEBAND, deband, vf);
 REGISTER_FILTER(DECIMATE,   decimate,   vf);
 REGISTER_FILTER(DEJUDDER,   dejudder,   vf);
 REGISTER_FILTER(DELOGO, delogo, vf);
diff --git a/libavfilter/vf_deband.c b/libavfilter/vf_deband.c
new file mode 100644
index 000..1fd05d1
--- /dev/null
+++ b/libavfilter/vf_deband.c
@@ -0,0 +1,312 @@
+/*
+ * Copyright (c) 2015 Niklas Haas
+ * Copyright (c) 2015 Paul B Mahol
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the Software), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+ * SOFTWARE.
+ */
+
+#include libavutil/opt.h
+#include libavutil/pixdesc.h
+#include avfilter.h
+#include internal.h
+#include video.h
+
+typedef struct DebandContext {
+const AVClass *class;
+
+float threshold[4];
+int range;
+int blur;
+float direction;
+
+int nb_components;
+int planewidth[4];
+int planeheight[4];
+int thr[4];
+
+int *x_pos;
+int *y_pos;
+
+int (*deband)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
+} DebandContext;
+
+#define OFFSET(x) 

Re: [FFmpeg-devel] [PATCH] avfilter/internal: Improve docs about ff_request_frame()

2015-07-14 Thread Michael Niedermayer
On Tue, Jul 14, 2015 at 08:42:40PM +0200, James Darnley wrote:
 On 2015-07-14 19:50, Michael Niedermayer wrote:
  From: Michael Niedermayer mich...@niedermayer.cc
  
  Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
  ---
   libavfilter/internal.h |   17 +
   1 file changed, 17 insertions(+)
  
  diff --git a/libavfilter/internal.h b/libavfilter/internal.h
  index a7ec751..fcd1a5a 100644
  --- a/libavfilter/internal.h
  +++ b/libavfilter/internal.h
  @@ -305,8 +305,25 @@ int ff_poll_frame(AVFilterLink *link);
   /**
* Request an input frame from the filter at the other end of the link.
*
  + * The source filter may pass the request on to its sources, fullfill the
  + * request from an internal buffer or any other means specific to its 
  function.
 
 fulfill (US) or fulfil (UK).
 
 I don't think source filter is very clear here.  You mean the filter
 you send a request to, right?  Not the source filter (if that is the
 term used in lavfi) that puts frames into the filter chain.

yes, reworded


 
  + * One example of a source returning AVERROR(EAGAIN) is a buffer into 
  which the
  + * user application pushes new data, it cannot fullfill a request
  + * or know its at EOF until the user application has given it this
  + * information
 
 I don't find this clear.

ok
so please help me reword this in a way that is clear

you have a filter A which can contain a frame, or no frame
it has a single buffer (it could have more but single is simpler as an
example)
if it has a frame in its buffer and the next filter does a
ff_request_frame() on it it returns that frame and returns success
(0) from the ff_request_frame() call
if it does not have a frame in its buffer its screwed and has to
return AVERROR(EAGAIN)
until the user application gives it a frame by external means or
tells it that EOF has been reached


 This is internal, isn't it?

yes, it is, it should be public API though its required for
implementing filters


 What does a user
 application matter to a filter, or someone writing a filter?

Derek complained on IRC that the why isnt documented, so
i tried to document it.


 
 Perhaps something about filters rather than applications?
 
 One example of a source returning AVERROR(EAGAIN) is a filter which
 buffers frames and cannot fulfil a request until some event happens or
 the filter cannot know it is as EOF until some other event happens.

This misses the main point and it is possibly why derek was confused
about the API

EAGAIN here means please return all the way back to the user
application so it can perform the next transcode step and refill
the filter graphs source _IF_ that is how the application interfaces
to the filergraph

new patch:
commit 6628dd2aa001ec23de306840a41f05947abdf326
Author: Michael Niedermayer mich...@niedermayer.cc
Date:   Tue Jul 14 19:44:59 2015 +0200

avfilter/internal: Improve docs about ff_request_frame()

Signed-off-by: Michael Niedermayer mich...@niedermayer.cc

diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index a7ec751..f1938f9 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -305,8 +305,24 @@ int ff_poll_frame(AVFilterLink *link);
 /**
  * Request an input frame from the filter at the other end of the link.
  *
+ * The input filter may pass the request on to its inputs, fulfill the
+ * request from an internal buffer or any other means specific to its function.
+ * When the end of a stream is reached AVERROR_EOF is returned and no further 
frames.
+ * When a filter is unable to output a frame for example due to its sources
+ * being unable to do so or because it depends on external means pushing data
+ * into it then AVERROR(EAGAIN) is returned.
+ * It is important that a AVERROR(EAGAIN) return is returned all the way to the
+ * caller (generally eventually a user application) as this step may (but does
+ * not have to be) neccessary to provide the input with the next frame.
+ *
+ * If a request is successful then the filter_frame() function will be called
+ * at least once before ff_request_frame() returns
+ *
  * @param link the input link
  * @return zero on success
+ * AVERROR_EOF on end of file
+ * AVERROR(EAGAIN) if the previous filter cannot output a frame
+ * currently and can neither guarantee that EOF has been reached.
  */
 int ff_request_frame(AVFilterLink *link);



[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


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: don't crash API users when demuxing mp4

2015-07-14 Thread Michael Niedermayer
On Tue, Jul 14, 2015 at 09:08:24PM +0200, wm4 wrote:
 This code is one big chunk of WTF.
 ---
  libavformat/utils.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

applied

thanks

[...]
-- 
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] mxfdec: calculate the index in display order

2015-07-14 Thread Tomas Härdin
On Sat, 2015-07-11 at 18:54 +0200, Marton Balint wrote:
 This should fix seeking for open GOP files as well.
 
 Signed-off-by: Marton Balint c...@passwd.hu
 ---
 @@ -1411,8 +1417,7 @@ static int mxf_compute_ptses_fake_index(MXFContext 
 *mxf, MXFIndexTable *index_ta
  break;
  }
  
 -index_table-fake_index[x].timestamp = x;

Why is this removed?

 -index_table-fake_index[x].flags = !(s-flag_entries[j]  0x30) 
 ? AVINDEX_KEYFRAME : 0;
 +flags[x] = !(s-flag_entries[j]  0x30) ? AVINDEX_KEYFRAME : 0;
  
  if (index  0 || index = index_table-nb_ptses) {
  av_log(mxf-fc, AV_LOG_ERROR,
 @@ -1421,11 +1426,20 @@ static int mxf_compute_ptses_fake_index(MXFContext 
 *mxf, MXFIndexTable *index_ta
  continue;
  }
  
 +index_table-offsets[x] = offset;
  index_table-ptses[index] = x;
  max_temporal_offset = FFMAX(max_temporal_offset, offset);
  }
  }
  
 +/* calculate the fake index table in display order */
 +for (x = 0; x  index_table-nb_ptses; x++) {
 +index_table-fake_index[x].timestamp = x;
 +if (index_table-ptses[x] != AV_NOPTS_VALUE)
 +index_table-fake_index[index_table-ptses[x]].flags = flags[x];

ptses are checked to be in range, right?

Anyway, the patch is probably OK. I recall doing something similar at
work in another mxf library. Do we have test files with B-frames? If not
then this may be a good time to add them.

/Tomas


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


[FFmpeg-devel] [PATCH] avformat: don't crash API users when demuxing mp4

2015-07-14 Thread wm4
This code is one big chunk of WTF.
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index a123a59..c40b4d2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1788,7 +1788,7 @@ void ff_configure_buffers_for_index(AVFormatContext *s, 
int64_t time_tolerance)
 //We could use URLProtocol flags here but as many user applications do not 
use URLProtocols this would be unreliable
 const char *proto = avio_find_protocol_name(s-filename);
 
-if (!(strcmp(proto, file)  strcmp(proto, pipe)  strcmp(proto, 
cache)))
+if (proto  !(strcmp(proto, file)  strcmp(proto, pipe)  
strcmp(proto, cache)))
 return;
 
 for (ist1 = 0; ist1  s-nb_streams; ist1++) {
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] avfilter/internal: Improve docs about ff_request_frame()

2015-07-14 Thread Michael Niedermayer
On Tue, Jul 14, 2015 at 10:33:13PM +0200, James Darnley wrote:
 On 2015-07-14 21:47, Michael Niedermayer wrote:
  On Tue, Jul 14, 2015 at 08:42:40PM +0200, James Darnley wrote:
  On 2015-07-14 19:50, Michael Niedermayer wrote:
  + * One example of a source returning AVERROR(EAGAIN) is a buffer into 
  which the
  + * user application pushes new data, it cannot fullfill a request
  + * or know its at EOF until the user application has given it this
  + * information
 
  I don't find this clear.
  
  ok
  so please help me reword this in a way that is clear
 
 I do want to but me knowledge of how filters are supposed to operate is
 limited.
 
  you have a filter A which can contain a frame, or no frame
  it has a single buffer (it could have more but single is simpler as an
  example)
  if it has a frame in its buffer and the next filter does a
  ff_request_frame() on it it returns that frame and returns success
  (0) from the ff_request_frame() call
  if it does not have a frame in its buffer its screwed and has to
  return AVERROR(EAGAIN)
  until the user application gives it a frame by external means or
  tells it that EOF has been reached
 
 Okay.  Don't make the doxy comment too verbose with examples.  I'll look
 again at writing_filters.txt and my example and see if I can explain
 things better there.
 
  This is internal, isn't it?
  
  yes, it is, it should be public API though its required for
  implementing filters
 
 Sorry if I wasn't clear.  When I meant internal I meant internal to
 lavfi, as in only filters need to use or care about this function.  Not
 external users of lavfi, say a player or a video encoder.
 
  What does a user
  application matter to a filter, or someone writing a filter?
  
  Derek complained on IRC that the why isnt documented, so
  i tried to document it.
  
  
 
  Perhaps something about filters rather than applications?
 
  One example of a source returning AVERROR(EAGAIN) is a filter which
  buffers frames and cannot fulfil a request until some event happens or
  the filter cannot know it is as EOF until some other event happens.
  
  This misses the main point and it is possibly why derek was confused
  about the API
  
  EAGAIN here means please return all the way back to the user
  application so it can perform the next transcode step and refill
  the filter graphs source _IF_ that is how the application interfaces
  to the filergraph
 
 Fair enough.  I didn't understand how requests were supposed to work
 either and I think my example filter is wrong about them.  This latest
 round of attention is helping.
 
  new patch:
  commit 6628dd2aa001ec23de306840a41f05947abdf326
  Author: Michael Niedermayer mich...@niedermayer.cc
  Date:   Tue Jul 14 19:44:59 2015 +0200
  
  avfilter/internal: Improve docs about ff_request_frame()
  
  Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
  
  diff --git a/libavfilter/internal.h b/libavfilter/internal.h
  index a7ec751..f1938f9 100644
  --- a/libavfilter/internal.h
  +++ b/libavfilter/internal.h
  @@ -305,8 +305,24 @@ int ff_poll_frame(AVFilterLink *link);
   /**
* Request an input frame from the filter at the other end of the link.
*
  + * The input filter may pass the request on to its inputs, fulfill the
  + * request from an internal buffer or any other means specific to its 
  function.
 
 Can I suggest a blank line here between the above line and the one below?
 
  + * When the end of a stream is reached AVERROR_EOF is returned and no 
  further frames.
 
 The line above is longer than 80 characters.  Are we supposed to stick
 to that for comments?  Can I also ask for another blank line here, just
 to clearly separate these two return conditions.
 
  + * When a filter is unable to output a frame for example due to its sources
  + * being unable to do so or because it depends on external means pushing 
  data
  + * into it then AVERROR(EAGAIN) is returned.
  + * It is important that a AVERROR(EAGAIN) return is returned all the way 
  to the
  + * caller (generally eventually a user application) as this step may (but 
  does
  + * not have to be) neccessary to provide the input with the next frame.
 
 Much better in my opinion, except for necessary (one 'c').

ok, applied with these changes

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- 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] mxfdec: calculate the index in display order

2015-07-14 Thread Marton Balint


On Tue, 14 Jul 2015, Tomas Härdin wrote:


On Sat, 2015-07-11 at 18:54 +0200, Marton Balint wrote:

This should fix seeking for open GOP files as well.

Signed-off-by: Marton Balint c...@passwd.hu
---
@@ -1411,8 +1417,7 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, 
MXFIndexTable *index_ta
 break;
 }

-index_table-fake_index[x].timestamp = x;


Why is this removed?


It is only moved to the index calculation loop below, it looked cleaner to
fill all fields of the fake index in one place.




-index_table-fake_index[x].flags = !(s-flag_entries[j]  0x30) ? 
AVINDEX_KEYFRAME : 0;
+flags[x] = !(s-flag_entries[j]  0x30) ? AVINDEX_KEYFRAME : 0;

 if (index  0 || index = index_table-nb_ptses) {
 av_log(mxf-fc, AV_LOG_ERROR,
@@ -1421,11 +1426,20 @@ static int mxf_compute_ptses_fake_index(MXFContext 
*mxf, MXFIndexTable *index_ta
 continue;
 }

+index_table-offsets[x] = offset;
 index_table-ptses[index] = x;
 max_temporal_offset = FFMAX(max_temporal_offset, offset);
 }
 }

+/* calculate the fake index table in display order */
+for (x = 0; x  index_table-nb_ptses; x++) {
+index_table-fake_index[x].timestamp = x;
+if (index_table-ptses[x] != AV_NOPTS_VALUE)
+index_table-fake_index[index_table-ptses[x]].flags = flags[x];


ptses are checked to be in range, right?



Sure :). ptses are only set to x in the first loop, and x is between 0 and 
nb_ptses.



Anyway, the patch is probably OK. I recall doing something similar at
work in another mxf library. Do we have test files with B-frames? If not
then this may be a good time to add them.


tests/data/lavf/lavf.mxf already has B-frames, but probably a more 
thorough seek test for the file would not hurt... I plan to work on this 
later.


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


Re: [FFmpeg-devel] [PATCH] lavfi: add erosion, dilation, deflate inflate filter

2015-07-14 Thread James Darnley
On 2015-07-15 00:15, Paul B Mahol wrote:
 diff --git a/doc/filters.texi b/doc/filters.texi
 index 9f7b976..d4d8bad 100644
 --- a/doc/filters.texi
 +++ b/doc/filters.texi
 @@ -3718,6 +3718,24 @@ Set whether or not chroma is considered in the metric 
 calculations. Default is
  @code{1}.
  @end table
  
 +@section deflate
 +
 +Apply deflate effect to the video.
 +
 +This filter replaces the pixel by the local(3x3) average by taking into 
 account
 +only values lower than the pixel.
 +
 +It accepts the following options:
 +
 +@table @option
 +@item threshold
 +Allows to limit the maximum change, default is 65535.

Strange phrasing.  Why not just Limits the maximum change, default is
65535

 +@item planes
 +Flag which specifies which planes to filter. Default is 15 i.e. all four
 +planes.
 +@end table

While this was probably the existing behaviour (assuming this is the
patch from ubitux), do many other filters use a bit mask for controlling
which planes are processed?  But to be honest, I don't have a suggestion
for how else you should do it.  4 separate threshold options, similar to
removegrain and its modes?

 @@ -3904,6 +3922,27 @@ A number representing position of the first frame with 
 respect to the telecine
  pattern. This is to be used if the stream is cut. The default value is 
 @code{0}.
  @end table
  
 +@section dilation
 +
 +Apply dilation effect to the video.
 +
 +This filter replaces the pixel by the local(3x3) maximum.
 +
 +It accepts the following options:
 +
 +@table @option
 +@item threshold
 +Allows to limit the maximum change, default is 65535.

As above.

 +@item coordinates
 +Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
 +pixels are used.

You should probably explain which values represent which pixel, i.e.
tha1 1 is the top left pixel.

 @@ -4759,6 +4798,27 @@ value.
  
  @end table
  
 +@section erosion
 +
 +Apply erosion effect to the video.
 +
 +This filter replaces the pixel by the local(3x3) minimum.
 +
 +It accepts the following options:
 +
 +@table @option
 +@item threshold
 +Allows to limit the maximum change, default is 65535.

...

 +@item coordinates
 +Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
 +pixels are used.

...

 @@ -6356,6 +6416,24 @@ Default value is @code{none}.
  Swap luma/chroma/alpha fields. Exchange even  odd lines. Default value is 
 @code{0}.
  @end table
  
 +@section inflate
 +
 +Apply inflate effect to the video.
 +
 +This filter replaces the pixel by the local(3x3) average by taking into 
 account
 +only values higher than the pixel.
 +
 +It accepts the following options:
 +
 +@table @option
 +@item threshold
 +Allows to limit the maximum change, default is 65535.
 +
 +@item planes
 +Flag which specifies which planes to filter. Default is 15 i.e. all four
 +planes.
 +@end table
 +

Same comments.

 ...

Despite my comments above I get the feeling that this might be intended
for programmatic use by other future filters.  If that's the case then I
guess the options don't have to be user friendly.




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


Re: [FFmpeg-devel] [PATCH] lavfi/removegrain: add x86 and x86_64 SSE2 functions

2015-07-14 Thread James Darnley
On 2015-07-14 23:23, James Almer wrote:
 On 14/07/15 3:54 PM, James Darnley wrote:
 On 2015-07-11 18:34, James Almer wrote:
 On 11/07/15 10:40 AM, James Darnley wrote:
 new file mode 100644
 index 000..5e1feea
 --- /dev/null
 +++ b/libavfilter/x86/vf_removegrain.asm
 @@ -0,0 +1,1215 @@
 +;*
 +;* x86-optimized functions for yadif filter
 +;*
 +;* Copyright (C) 2015 James Darnley
 +;*
 +;* This file is part of FFmpeg.
 +;*
 +;* TODO: gpl text goes here.
 +;*
 +
 +; column: -1  0 +1
 +; row -1: a1 a2 a3
 +; row  0: a4  c a5
 +; row +1: a6 a7 a8
 +
 +%include libavutil/x86/x86util.asm
 +
 +SECTION_RODATA

 Declare it SECTION_RODATA 32 now so you don't forget when you add AVX2 
 versions.

 Okay, I'm confused by this.  It doesn't align the constants you define
 on 32 byte boundaries if you happen to define the data incorrectly so...
  Why does this matter?  Or what does it do?

 
 SECTION_RODATA 32 translates into SECTION .rodata align=32, which according 
 to the 
 documentation makes sure the constants are aligned on a 32-byte boundary.
 I noticed it doesn't do much if the constants are out of order if you will, 
 but if
 you're defining them right and you're going to use 32-byte movas with them, 
 then i
 don't see a reason to not declare the section properly.

I will change it.  Perhaps I misunderstood its use.  My impression now
is that it instructs the linker to maintain the alignment of the section
not that the assembler should align the labels in a particular fashion.

If the user (me) defines some data to be 10 bytes long it is the user's
fault that the next constant begins at 0xA.

 +
 +; The loop doesn't need to do all the iterations.  It could stop when the 
 right
 +; pixels are in the right registers.
 +%macro SORT_SQUARE 0
 +%assign k 7
 +%rep 7
 +%assign i 1
 +%assign j 2
 +%rep k
 +SORT_PAIR m %+ i , m %+ j , m9
 +%assign i i+1
 +%assign j j+1
 +%endrep
 +%assign k k-1
 +%endrep
 +%endmacro
 +
 +; %1 dest simd register
 +; %2 source (simd register/memory)
 +; %3 temp simd register
 +%macro ABS_DIFF 3
 +mova %3, %2
 +psubusb %3, %1
 +psubusb %1, %2
 +por %1, %3
 +%endmacro
 +
 +; %1 dest simd register
 +; %2 source (simd register/memory)
 +; %3 temp simd register
 +%macro ABS_DIFF_W 3
 +mova %3, %2
 +psubusw %3, %1
 +psubusw %1, %2
 +por %1, %3
 +%endmacro

 No way to achieve this using the pabs* ssse3 instructions?

 Maybe.  I looked them up and see that I would need a subtraction anyway.
  I wonder if I could measure a speed change.  I need to check the
 behaviour of them together with the subtract instructions.
 
 For that matter, since in many cases you're calling two or more ABS_DIFF_W 
 one after
 the other, you could combine the instructions to minimize dependencies 
 regardless of
 using pabs or psubs + por like you're doing right now.
 It may end up being faster that way.

You're probably right.  I will try them and send a separate patch later.

 +; %1 simd register that hold the mask and will hold the result
 +; %2 simd register that holds the true values
 +; %3 location of the false values (simd register/memory)
 +%macro BLEND 3 ; mask, true, false
 +pand %2, %1
 +pandn %1, %3
 +por %1, %2
 +%endmacro

 This doesn't follow the sse4 blend instructions' semantic, so it will make 
 adding AVX2
 versions harder.

 Try instead

 %macro BLEND 3 ; false, true, mask
 pand  %2, %3
 pandn %3, %1
 por   %3, %2
 SWAP  %1, %3
 %endmacro

 Which will let you use vpblendvb %1, %1, %2, %3 for the avx2 version.
 SSE4's pblendvb is kinda crappy, requiring the mask to be in xmm0, so
 adding an SSE4 version may not be worth it.

 I applied your patches that you sent on IRC (this and the sort macro
 one).  Do you want me to put your name in the copyright header?

 
 Not really. small changes like those are IMO not enough to get credit in the 
 header.
 If you want you can add a With contributions by line in the commit message.

Okay.

 +av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
 +{
 +int cpu_flags = av_get_cpu_flags();
 +int i;
 +
 +for (i = 0; i  rg-nb_planes; i++) {
 +switch (rg-mode[i]) {
 +case 1:
 +if (EXTERNAL_SSE2(cpu_flags))

 I think it will be much cleaner and simpler if you put the switch inside a 
 single
 EXTERNAL_SSE2 branch, rather than checking it for every mode.

 You're probably right.  I was going to see what it looks like after AVX2
 and clean it up then but I can squash some changes into this patch if
 people prefer it.

Done anyway.




signature.asc
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org

Re: [FFmpeg-devel] FFmpeg/MPlayer/rtmpdump possibly searching for a new server and hosting

2015-07-14 Thread Kieran Kunhya
OVH has poor quality connectivity by the way - this could lead to
performance issues in some countries.
Why can't you use the server videolan offered?

Kieran

On 14 July 2015 at 21:32, Michael Niedermayer mich...@niedermayer.cc wrote:
 Hi all

 libnova (see CC:) has offered us a
 OVH (France) 64gb ram xeon server with 4tb storage dedicated for the
 project, Administration of the server should be on our side. They can
 offer at least 2 years prepaid server. And might pay for longer but no
 gurantee for that

 no traffic limit, 500mbps wrant 1 gbps burst
 CPU: 
 http://ark.intel.com/products/75779/Intel-Xeon-Processor-E5-1620-v2-10M-Cache-3_70-GHz

 They would ask us to put their link  small logo to our webpage footer
 they do not insist on that though IIUC

 If i hear no objections i will accept the offer and once we start
 using the server add their logolink to the footer of the FFmpeg
 webpage.

 Thanks

 [...]

 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

 Democracy is the form of government in which you can choose your dictator

 ___
 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] lavfi: add erosion, dilation, deflate inflate filter

2015-07-14 Thread Paul B Mahol
On 7/14/15, James Darnley james.darn...@gmail.com wrote:
 On 2015-07-15 00:15, Paul B Mahol wrote:
 diff --git a/doc/filters.texi b/doc/filters.texi
 index 9f7b976..d4d8bad 100644
 --- a/doc/filters.texi
 +++ b/doc/filters.texi
 @@ -3718,6 +3718,24 @@ Set whether or not chroma is considered in the
 metric calculations. Default is
  @code{1}.
  @end table

 +@section deflate
 +
 +Apply deflate effect to the video.
 +
 +This filter replaces the pixel by the local(3x3) average by taking into
 account
 +only values lower than the pixel.
 +
 +It accepts the following options:
 +
 +@table @option
 +@item threshold
 +Allows to limit the maximum change, default is 65535.

 Strange phrasing.  Why not just Limits the maximum change, default is
 65535

 +@item planes
 +Flag which specifies which planes to filter. Default is 15 i.e. all four
 +planes.
 +@end table

 While this was probably the existing behaviour (assuming this is the
 patch from ubitux), do many other filters use a bit mask for controlling
 which planes are processed?  But to be honest, I don't have a suggestion

Those have nothing to do with ubitux patch. His patch is about generic
convolution. Those above use ffmin/ffmax so they are not in same category IMHO.

 for how else you should do it.  4 separate threshold options, similar to
 removegrain and its modes?

Maybe that is better approach I will think about it.


 @@ -3904,6 +3922,27 @@ A number representing position of the first frame
 with respect to the telecine
  pattern. This is to be used if the stream is cut. The default value is
 @code{0}.
  @end table

 +@section dilation
 +
 +Apply dilation effect to the video.
 +
 +This filter replaces the pixel by the local(3x3) maximum.
 +
 +It accepts the following options:
 +
 +@table @option
 +@item threshold
 +Allows to limit the maximum change, default is 65535.

 As above.

 +@item coordinates
 +Flag which specifies the pixel to refer to. Default is 255 i.e. all
 eight
 +pixels are used.

 You should probably explain which values represent which pixel, i.e.
 tha1 1 is the top left pixel.

Something like this:

 1  2  3
 4 5
 6  7  8


 @@ -4759,6 +4798,27 @@ value.

  @end table

 +@section erosion
 +
 +Apply erosion effect to the video.
 +
 +This filter replaces the pixel by the local(3x3) minimum.
 +
 +It accepts the following options:
 +
 +@table @option
 +@item threshold
 +Allows to limit the maximum change, default is 65535.

 ...

 +@item coordinates
 +Flag which specifies the pixel to refer to. Default is 255 i.e. all
 eight
 +pixels are used.

 ...

 @@ -6356,6 +6416,24 @@ Default value is @code{none}.
  Swap luma/chroma/alpha fields. Exchange even  odd lines. Default value
 is @code{0}.
  @end table

 +@section inflate
 +
 +Apply inflate effect to the video.
 +
 +This filter replaces the pixel by the local(3x3) average by taking into
 account
 +only values higher than the pixel.
 +
 +It accepts the following options:
 +
 +@table @option
 +@item threshold
 +Allows to limit the maximum change, default is 65535.
 +
 +@item planes
 +Flag which specifies which planes to filter. Default is 15 i.e. all four
 +planes.
 +@end table
 +

 Same comments.

 ...

 Despite my comments above I get the feeling that this might be intended
 for programmatic use by other future filters.  If that's the case then I
 guess the options don't have to be user friendly.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fix reference quicktime movie reading

2015-07-14 Thread Michael Niedermayer
On Wed, Jun 24, 2015 at 08:22:33PM +0300, Maksym Veremeyenko wrote:
 Hi,
 
 i noticed that ffmpeg from latest git stop decoding all reference mov files:
 
 
 [root@dev-5 data]# ffmpeg -debug 3 -i BNC123914.mov -y q.mp4
 ffmpeg version N-73128-g5a1f785 Copyright (c) 2000-2015 the FFmpeg
 developers
   built with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
   configuration: --prefix=/usr/local/enctools --enable-debug=3
 --extra-cflags='-O0 -ggdb -I/usr/local/enctools/include'
 --extra-ldflags=-L/usr/local/enctools/lib --enable-shared
 --enable-gpl --enable-version3 --enable-nonfree --enable-avfilter
 --enable-pthreads --enable-bzlib --enable-zlib --enable-libfaac
 --enable-libmp3lame --enable-libspeex --enable-libtheora
 --enable-libvorbis --enable-libx264 --enable-libxvid
 --enable-libfreetype --disable-stripping
   libavutil  54. 27.100 / 54. 27.100
   libavcodec 56. 44.101 / 56. 44.101
   libavformat56. 38.101 / 56. 38.101
   libavdevice56.  4.100 / 56.  4.100
   libavfilter 5. 18.100 /  5. 18.100
   libswscale  3.  1.101 /  3.  1.101
   libswresample   1.  2.100 /  1.  2.100
   libpostproc53.  3.100 / 53.  3.100
  matched as AVOption 'debug' with argument '3'.
 Reading option '-i' ... matched as input file with argument 'BNC123914.mov'.
 Reading option '-y' ... matched as option 'y' (overwrite output
 files) with argument '1'.
 Reading option 'q.mp4' ... matched as output file.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option y (overwrite output files) with argument 1.
 Successfully parsed a group of options.
 Parsing a group of options: input file BNC123914.mov.
 Successfully parsed a group of options.
 Opening an input file: BNC123914.mov.
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Format mov,mp4,m4a,3gp,3g2,mj2
 probed with size=2048 and score=50
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] volume f, len 1
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] filename BNC123914.dv, len 12
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] nlvl from 1, nlvl to 2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 0, len 9
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] dir media.dir
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 2, len 73
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] path 
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 11, len 5
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type -1, len 0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Absolute path 
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv
 not tried for security reasons, set demuxer option use_absolute_path
 to allow absolute paths
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] stream 0, error opening alias: 
 path='/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.dv',
 dir='media.dir', filename='BNC123914.dv', volume='f', nlvl_from=1,
 nlvl_to=2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] volume f, len 1
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] filename BNC123914.aiff, len 14
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] nlvl from 1, nlvl to 2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 0, len 9
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] dir media.dir
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 2, len 75
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] path 
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type 11, len 5
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] type -1, len 0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Absolute path 
 /temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff
 not tried for security reasons, set demuxer option use_absolute_path
 to allow absolute paths
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] stream 1, error opening alias: 
 path='/temp_store/BNC123914.mov_2015-06-16_15.10.52.880/media.dir/BNC123914.aiff',
 dir='media.dir', filename='BNC123914.aiff', volume='f', nlvl_from=1,
 nlvl_to=2
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Before
 avformat_find_stream_info() pos: 14936 bytes read:14936 seeks:0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] Could not find codec
 parameters for stream 0 (Video: dvvideo, 1 reference frame (dvcp /
 0x70637664), none(topleft), 720x576, 1/600, 28800 kb/s): unspecified
 pixel format
 Consider increasing the value for the 'analyzeduration' and
 'probesize' options
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x20ba300] After
 avformat_find_stream_info() pos: 14936 bytes read:14936 seeks:0
 frames:0
 Guessed Channel Layout for  Input Stream #0.1 : stereo
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BNC123914.mov':
   Metadata:
 creation_time   : 2015-06-16 12:10:52
 encoder : Omneon OmMedia.dll 4.7.0 05-18-2007
 18:45:32,ex={0,-1},rng={0,-1,0},trimAu,exPre
 encoder-eng : Omneon OmMedia.dll 4.7.0 05-18-2007
 18:45:32,ex={0,-1},rng={0,-1,0},trimAu,exPre
   Duration: 00:00:30.00, bitrate: 3 kb/s
 Stream #0:0(eng), 0, 1/600: Video: dvvideo, 1 reference frame
 (dvcp / 0x70637664), none(topleft), 720x576, 1/600, 28800 kb/s, 25
 

[FFmpeg-devel] [PATCH] lavc/srtdec: handle leading whitespace before tag names

2015-07-14 Thread Rodger Combs
This fixes cases like `/ font`.

I'm not particularly happy with this solution, but anything better would need
to be part of a larger cleanup.
---
 libavcodec/srtdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index ed3af95..0d1b80e 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -114,7 +114,9 @@ static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
 case '':
 tag_close = in[1] == '/';
 len = 0;
-if (sscanf(in+tag_close+1, %127[^]%n, buffer, len) = 1  
len  0) {
+while (*(in + 1 + tag_close) == ' ')
+in++;
+if (sscanf(in + 1 + tag_close, %127[^]%n, buffer, len) = 1 
 len  0) {
 if ((param = strchr(buffer, ' ')))
 *param++ = 0;
 if ((!tag_close  sptr  FF_ARRAY_ELEMS(stack)) ||
-- 
2.4.1

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


Re: [FFmpeg-devel] [PATCH] lavfi/removegrain: add x86 and x86_64 SSE2 functions

2015-07-14 Thread James Almer
On 14/07/15 8:35 PM, James Darnley wrote:
 Speed of all modes increased by a factor between 7.4 and 19.8 largely 
 depending
 on whether bytes are unpacked into words.  Modes 2, 3, and 4 have been sped-up
 by a factor of 43 (thanks quick sort!)
 
 All modes are available on x86_64 but only modes 1, 10, 11, 12, 13, 14, 19, 
 20,
 21, and 22 are available on x86 due to the number of SIMD registers used.
 
 With a contribution from James Almer jamr...@gmail.com
 ---
  LICENSE.md|1 +
  libavfilter/removegrain.h |   40 ++
  libavfilter/vf_removegrain.c  |   38 +-
  libavfilter/x86/Makefile  |4 +
  libavfilter/x86/vf_removegrain.asm| 1218 
 +
  libavfilter/x86/vf_removegrain_init.c |   88 +++
  6 files changed, 1370 insertions(+), 19 deletions(-)
  create mode 100644 libavfilter/removegrain.h
  create mode 100644 libavfilter/x86/vf_removegrain.asm
  create mode 100644 libavfilter/x86/vf_removegrain_init.c

Assembly looks fine and works. Any improvements or additions can be done in 
subsequent
patches.

Paul: Any comment? If not then please push it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavfi/removegrain: add x86 and x86_64 SSE2 functions

2015-07-14 Thread James Darnley
Speed of all modes increased by a factor between 7.4 and 19.8 largely depending
on whether bytes are unpacked into words.  Modes 2, 3, and 4 have been sped-up
by a factor of 43 (thanks quick sort!)

All modes are available on x86_64 but only modes 1, 10, 11, 12, 13, 14, 19, 20,
21, and 22 are available on x86 due to the number of SIMD registers used.

With a contribution from James Almer jamr...@gmail.com
---
 LICENSE.md|1 +
 libavfilter/removegrain.h |   40 ++
 libavfilter/vf_removegrain.c  |   38 +-
 libavfilter/x86/Makefile  |4 +
 libavfilter/x86/vf_removegrain.asm| 1218 +
 libavfilter/x86/vf_removegrain_init.c |   88 +++
 6 files changed, 1370 insertions(+), 19 deletions(-)
 create mode 100644 libavfilter/removegrain.h
 create mode 100644 libavfilter/x86/vf_removegrain.asm
 create mode 100644 libavfilter/x86/vf_removegrain_init.c

diff --git a/LICENSE.md b/LICENSE.md
index 545d366..1a6e3b3 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -16,6 +16,7 @@ Specifically, the GPL parts of FFmpeg are:
 - optional x86 optimizations in the files
   - `libavcodec/x86/flac_dsp_gpl.asm`
   - `libavcodec/x86/idct_mmx.c`
+  - `libavfilter/x86/vf_removegrain.asm`
 - libutvideo encoding/decoding wrappers in
   `libavcodec/libutvideo*.cpp`
 - the X11 grabber in `libavdevice/x11grab.c`
diff --git a/libavfilter/removegrain.h b/libavfilter/removegrain.h
new file mode 100644
index 000..60401fb
--- /dev/null
+++ b/libavfilter/removegrain.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015 Paul B Mahol
+ * Copyright (c) 2015 James Darnley
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include avfilter.h
+
+typedef struct RemoveGrainContext {
+const AVClass *class;
+
+int mode[4];
+
+int nb_planes;
+int planewidth[4];
+int planeheight[4];
+int skip_even;
+int skip_odd;
+
+int (*rg[4])(int c, int a1, int a2, int a3, int a4, int a5, int a6, int 
a7, int a8);
+
+void (*fl[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+} RemoveGrainContext;
+
+void ff_removegrain_init_x86(RemoveGrainContext *rg);
diff --git a/libavfilter/vf_removegrain.c b/libavfilter/vf_removegrain.c
index 77b3561..da17f6a 100644
--- a/libavfilter/vf_removegrain.c
+++ b/libavfilter/vf_removegrain.c
@@ -2,6 +2,7 @@
  * Copyright (c) 2012 Laurent de Soras
  * Copyright (c) 2013 Fredrik Mellbin
  * Copyright (c) 2015 Paul B Mahol
+ * Copyright (c) 2015 James Darnley
  *
  * This file is part of FFmpeg.
  *
@@ -20,32 +21,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-/*
- * TODO: add SIMD
- */
-
 #include libavutil/imgutils.h
 #include libavutil/opt.h
 #include libavutil/pixdesc.h
 #include avfilter.h
 #include formats.h
 #include internal.h
+#include removegrain.h
 #include video.h
 
-typedef struct RemoveGrainContext {
-const AVClass *class;
-
-int mode[4];
-
-int nb_planes;
-int planewidth[4];
-int planeheight[4];
-int skip_even;
-int skip_odd;
-
-int (*rg[4])(int c, int a1, int a2, int a3, int a4, int a5, int a6, int 
a7, int a8);
-} RemoveGrainContext;
-
 #define OFFSET(x) offsetof(RemoveGrainContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
@@ -142,6 +126,7 @@ static int mode05(int c, int a1, int a2, int a3, int a4, 
int a5, int a6, int a7,
 
 const int mindiff = FFMIN(FFMIN(c1, c2), FFMIN(c3, c4));
 
+/* When adding SIMD notice the return order here: 4, 2, 3, 1. */
 if (mindiff == c4) {
 return av_clip(c, mi4, ma4);
 } else if (mindiff == c2) {
@@ -524,6 +509,9 @@ static int config_input(AVFilterLink *inlink)
 }
 }
 
+if (ARCH_X86)
+ff_removegrain_init_x86(s);
+
 return 0;
 }
 
@@ -566,7 +554,19 @@ static int filter_slice(AVFilterContext *ctx, void *arg, 
int jobnr, int nb_jobs)
 }
 
 *dst++ = *src++;
-for (x = 1; x  s-planewidth[i] - 1; x++) {
+
+if (s-fl[i]) {
+int w_asm = (s-planewidth[i] - 2)  ~15;
+
+s-fl[i](dst, src, in-linesize[i], w_asm);
+
+x = 1 + w_asm;
+dst += w_asm;
+src += w_asm;
+} else
+x = 1;
+
+   

Re: [FFmpeg-devel] [PATCH] avfilter/internal: Improve docs about ff_request_frame()

2015-07-14 Thread James Darnley
On 2015-07-14 19:50, Michael Niedermayer wrote:
 From: Michael Niedermayer mich...@niedermayer.cc
 
 Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
 ---
  libavfilter/internal.h |   17 +
  1 file changed, 17 insertions(+)
 
 diff --git a/libavfilter/internal.h b/libavfilter/internal.h
 index a7ec751..fcd1a5a 100644
 --- a/libavfilter/internal.h
 +++ b/libavfilter/internal.h
 @@ -305,8 +305,25 @@ int ff_poll_frame(AVFilterLink *link);
  /**
   * Request an input frame from the filter at the other end of the link.
   *
 + * The source filter may pass the request on to its sources, fullfill the
 + * request from an internal buffer or any other means specific to its 
 function.

fulfill (US) or fulfil (UK).

I don't think source filter is very clear here.  You mean the filter
you send a request to, right?  Not the source filter (if that is the
term used in lavfi) that puts frames into the filter chain.

 + * One example of a source returning AVERROR(EAGAIN) is a buffer into which 
 the
 + * user application pushes new data, it cannot fullfill a request
 + * or know its at EOF until the user application has given it this
 + * information

I don't find this clear.  This is internal, isn't it?  What does a user
application matter to a filter, or someone writing a filter?

Perhaps something about filters rather than applications?

One example of a source returning AVERROR(EAGAIN) is a filter which
buffers frames and cannot fulfil a request until some event happens or
the filter cannot know it is as EOF until some other event happens.

 + * If a request is successfull then the filter_frame() function will be 
 called
 + * at least once before ff_request_frame() returns

successful

 + *
   * @param link the input link
   * @return zero on success
 + * AVERROR_EOF on end of file
 + * AVERROR(EAGAIN) if the previous filter cannot output a frame
 + * currently and can neither gurantee that EOF has been reached.

guarantee





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


Re: [FFmpeg-devel] [PATCH] lavfi/removegrain: add x86 and x86_64 SSE2 functions

2015-07-14 Thread James Darnley
On 2015-07-11 18:34, James Almer wrote:
 On 11/07/15 10:40 AM, James Darnley wrote:
 @@ -566,7 +554,19 @@ static int filter_slice(AVFilterContext *ctx, void 
 *arg, int jobnr, int nb_jobs)
  }
  
  *dst++ = *src++;
 -for (x = 1; x  s-planewidth[i] - 1; x++) {
 +
 +if (s-fl[i]) {
 +int w_asm = (s-planewidth[i] - 2)  ~15;
 
 I don't thinks this belongs here. If you add an AVX2 version as you intended,
 wouldn't this need to be 31?
 
 A wrapper function to have this code in the x86 folder may be the best option.

I was considering having the init_x86 function set a variable in the
context to do this math based on how many pixels are actually done per
iteration, meaning:
- 8 for the unpacked words and sse2
- 16 for the packed bytes and see2 or future unpacked words and avx2
- 32 for the future packed bytes and avx2

That would let it be simply re-used if someone wanted to try writing a
line function in C or other platform assembly.

 new file mode 100644
 index 000..5e1feea
 --- /dev/null
 +++ b/libavfilter/x86/vf_removegrain.asm
 @@ -0,0 +1,1215 @@
 +;*
 +;* x86-optimized functions for yadif filter
 +;*
 +;* Copyright (C) 2015 James Darnley
 +;*
 +;* This file is part of FFmpeg.
 +;*
 +;* TODO: gpl text goes here.
 +;*
 +
 +; column: -1  0 +1
 +; row -1: a1 a2 a3
 +; row  0: a4  c a5
 +; row +1: a6 a7 a8
 +
 +%include libavutil/x86/x86util.asm
 +
 +SECTION_RODATA
 
 Declare it SECTION_RODATA 32 now so you don't forget when you add AVX2 
 versions.

Okay, I'm confused by this.  It doesn't align the constants you define
on 32 byte boundaries if you happen to define the data incorrectly so...
 Why does this matter?  Or what does it do?

 +
 +; The loop doesn't need to do all the iterations.  It could stop when the 
 right
 +; pixels are in the right registers.
 +%macro SORT_SQUARE 0
 +%assign k 7
 +%rep 7
 +%assign i 1
 +%assign j 2
 +%rep k
 +SORT_PAIR m %+ i , m %+ j , m9
 +%assign i i+1
 +%assign j j+1
 +%endrep
 +%assign k k-1
 +%endrep
 +%endmacro
 +
 +; %1 dest simd register
 +; %2 source (simd register/memory)
 +; %3 temp simd register
 +%macro ABS_DIFF 3
 +mova %3, %2
 +psubusb %3, %1
 +psubusb %1, %2
 +por %1, %3
 +%endmacro
 +
 +; %1 dest simd register
 +; %2 source (simd register/memory)
 +; %3 temp simd register
 +%macro ABS_DIFF_W 3
 +mova %3, %2
 +psubusw %3, %1
 +psubusw %1, %2
 +por %1, %3
 +%endmacro
 
 No way to achieve this using the pabs* ssse3 instructions?

Maybe.  I looked them up and see that I would need a subtraction anyway.
 I wonder if I could measure a speed change.  I need to check the
behaviour of them together with the subtract instructions.

 +; %1 simd register that hold the mask and will hold the result
 +; %2 simd register that holds the true values
 +; %3 location of the false values (simd register/memory)
 +%macro BLEND 3 ; mask, true, false
 +pand %2, %1
 +pandn %1, %3
 +por %1, %2
 +%endmacro
 
 This doesn't follow the sse4 blend instructions' semantic, so it will make 
 adding AVX2
 versions harder.
 
 Try instead
 
 %macro BLEND 3 ; false, true, mask
 pand  %2, %3
 pandn %3, %1
 por   %3, %2
 SWAP  %1, %3
 %endmacro
 
 Which will let you use vpblendvb %1, %1, %2, %3 for the avx2 version.
 SSE4's pblendvb is kinda crappy, requiring the mask to be in xmm0, so
 adding an SSE4 version may not be worth it.

I applied your patches that you sent on IRC (this and the sort macro
one).  Do you want me to put your name in the copyright header?

 diff --git a/libavfilter/x86/vf_removegrain_init.c 
 b/libavfilter/x86/vf_removegrain_init.c
 new file mode 100644
 index 000..450185f
 --- /dev/null
 +++ b/libavfilter/x86/vf_removegrain_init.c
 @@ -0,0 +1,128 @@
 +#include libavutil/attributes.h
 +#include libavutil/cpu.h
 +#include libavutil/x86/cpu.h
 +#include libavfilter/removegrain.h
 +
 +void ff_rg_fl_mode_1_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int 
 pixels);
 +void ff_rg_fl_mode_10_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, 
 int pixels);
 +void ff_rg_fl_mode_11_12_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, 
 int pixels);
 +void ff_rg_fl_mode_13_14_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, 
 int pixels);
 +void ff_rg_fl_mode_19_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, 
 int pixels);
 +void ff_rg_fl_mode_20_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, 
 int pixels);
 +void ff_rg_fl_mode_21_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, 
 int pixels);
 +void ff_rg_fl_mode_22_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, 
 int pixels);
 +#if ARCH_X86_64
 +void ff_rg_fl_mode_2_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int 
 pixels);
 +void 

[FFmpeg-devel] [PATCH] avfilter/internal: Improve docs about ff_request_frame()

2015-07-14 Thread Michael Niedermayer
From: Michael Niedermayer mich...@niedermayer.cc

Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
---
 libavfilter/internal.h |   17 +
 1 file changed, 17 insertions(+)

diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index a7ec751..fcd1a5a 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -305,8 +305,25 @@ int ff_poll_frame(AVFilterLink *link);
 /**
  * Request an input frame from the filter at the other end of the link.
  *
+ * The source filter may pass the request on to its sources, fullfill the
+ * request from an internal buffer or any other means specific to its function.
+ * When the end of a stream is reached AVERROR_EOF is returned and no further 
frames.
+ * When a filter is unable to output a frame for example due to its sources
+ * being unable to do so or because it depends on external means pushing data
+ * into it then AVERROR(EAGAIN) is returned.
+ * One example of a source returning AVERROR(EAGAIN) is a buffer into which the
+ * user application pushes new data, it cannot fullfill a request
+ * or know its at EOF until the user application has given it this
+ * information
+ *
+ * If a request is successfull then the filter_frame() function will be called
+ * at least once before ff_request_frame() returns
+ *
  * @param link the input link
  * @return zero on success
+ * AVERROR_EOF on end of file
+ * AVERROR(EAGAIN) if the previous filter cannot output a frame
+ * currently and can neither gurantee that EOF has been reached.
  */
 int ff_request_frame(AVFilterLink *link);
 
-- 
1.7.9.5

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