Re: [FFmpeg-devel] [PATCH 0/5] assembler related build system merge from libav

2017-06-20 Thread Hendrik Leppkes
On Wed, Jun 21, 2017 at 12:49 AM, James Almer  wrote:
> These are five commits from libav a bit away from out current merge
> point that are useful enough that i figured should be committed now.
>

Perhaps add adfd7892e3b8b40e7a1620f7254459d8e096a9a1 to the set? It
fixes some issues when you have eg. a very old nasm but a recent yasm
installed.

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


Re: [FFmpeg-devel] [PATCH] libavformat/cache: don't treat 0 as EOF

2017-06-20 Thread Michael Niedermayer
On Fri, Jun 09, 2017 at 03:39:59PM +0200, Daniel Kučera wrote:
> 2017-06-05 21:18 GMT+02:00 Daniel Kucera :
> > Signed-off-by: Daniel Kucera 
> > ---
> >  libavformat/cache.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavformat/cache.c b/libavformat/cache.c
> > index 6aabca2e78..66bbbf54c9 100644
> > --- a/libavformat/cache.c
> > +++ b/libavformat/cache.c
> > @@ -201,7 +201,7 @@ static int cache_read(URLContext *h, unsigned char 
> > *buf, int size)
> >  }
> >
> >  r = ffurl_read(c->inner, buf, size);
> > -if (r == 0 && size>0) {
> > +if (r == AVERROR_EOF && size>0) {
> >  c->is_true_eof = 1;
> >  av_assert0(c->end >= c->logical_pos);
> >  }
> > @@ -263,7 +263,7 @@ resolve_eof:
> >  if (whence == SEEK_SET)
> >  size = FFMIN(sizeof(tmp), pos - c->logical_pos);
> >  ret = cache_read(h, tmp, size);
> > -if (ret == 0 && whence == SEEK_END) {
> > +if (ret == AVERROR_EOF && whence == SEEK_END) {
> >  av_assert0(c->is_true_eof);
> >  goto resolve_eof;
> >  }
> > --
> > 2.11.0
> >
> 
> Reminding for review.

causes infinite loop in fate-seek-cache-pipe

also if 2 patches each require the other they must be in one patch
as neither could be applied first.


[...]
-- 
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/avio: retry_transfer_wrapper: don't treat 0 as EOF

2017-06-20 Thread Michael Niedermayer
On Mon, Jun 19, 2017 at 10:34:34PM +0200, Daniel Kucera wrote:
> transfer_func variable passed to retry_transfer_wrapper are
> h->prot->url_read and h->prot->url_write functions. These need
> to return EOF or other error properly. In case of returning >= 0,
>  url_read/url_write is retried until error is returned.
> 
> requires patch: libavformat/cache: don't treat 0 as EOF
> 
> Signed-off-by: Daniel Kucera 
> ---
>  libavformat/avio.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

Question from last review, still applies:

(Does this patch requires changes in protocols ? )
If so did you (or someone else) review all protocols to identify which
need to be updated ?

also it seems to infinite loop with the concat protocol
./ffmpeg -i concat:matrixbench_mpeg2.mpg|matrixbench_mpeg2.mpg file.avi

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

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


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


Re: [FFmpeg-devel] [PATCH] mdec: use correctly permutated quant matrix for dequantization.

2017-06-20 Thread Michael Niedermayer
On Tue, Jun 20, 2017 at 08:18:20PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Jun 20, 2017 at 5:22 PM, Michael Niedermayer  > wrote:
> 
> > On Tue, Jun 20, 2017 at 08:47:33AM -0400, Ronald S. Bultje wrote:
> > > This allows using non-simple (e.g. simplemmx) IDCT implementations.
> > > The result is not bitexact (which is why the fate test continues to
> > > use -idct simple), but the PSNR between C/MMX goes from ~35 to ~90.
> > > ---
> > >  libavcodec/mdec.c | 14 ++
> > >  1 file changed, 10 insertions(+), 4 deletions(-)
> > >
> > [...]
> >
> > > @@ -212,9 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
> > >  static av_cold int decode_init(AVCodecContext *avctx)
> > >  {
> > >  MDECContext * const a = avctx->priv_data;
> > > -
> > > -if (avctx->idct_algo == FF_IDCT_AUTO)
> > > -avctx->idct_algo = FF_IDCT_SIMPLE;
> >
> > iam not sure this should be in this patch
> 
> 
> Can you be more precise?

> Would you like this in a separate patch?

yes


> Or do you
> think it's wrong?

no, i dont think the change is wrong, but thats just thinking

The code was added in:

commit e3e3c82555e2382125195c1ba9f34b5a43299abc
Author: Vitor Sessak 
Date:   Sun Jan 2 11:16:21 2011 +

Make PSX MDEC decoder output YUVJ420 and always use IDCT_SIMPLE. This
makes the output much closer to original Playstation hardware.



> 
> I believe this code was there because the PSNR between FF_IDCT_SIMPLE and
> SIMPLEMMX was 35, which is pretty terrible. This was probably because of
> the bug in the dequant permutation that's fixed in this patch. After this
> patch, the PSNR between the two is 90, which is pretty decent and good
> enough for me to enable it by default (although not in fate).
> 
> Ronald
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk



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


Re: [FFmpeg-devel] [PATCH 10/11] avcodec/x86: add an 8-bit simple IDCT function based on the x86-64 high depth functions

2017-06-20 Thread Michael Niedermayer
On Tue, Jun 20, 2017 at 08:24:55PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Jun 20, 2017 at 7:13 PM, Michael Niedermayer  > wrote:
> 
> > On Mon, Jun 19, 2017 at 05:11:03PM +0200, James Darnley wrote:
> > > Includes add/put functions
> > >
> > > Rounding contributed by Ronald S. Bultje
> > > ---
> > >  libavcodec/tests/x86/dct.c|  2 +
> > >  libavcodec/x86/idctdsp_init.c | 23 
> > >  libavcodec/x86/simple_idct.h  |  9 +++
> > >  libavcodec/x86/simple_idct10.asm  | 92
> > +++
> > >  libavcodec/x86/simple_idct10_template.asm |  6 +-
> > >  5 files changed, 130 insertions(+), 2 deletions(-)
> >
> > breaks:
> >
> > ./ffmpeg -i matrixbench_mpeg2.mpg -an -vframes 1  -vf
> > format=gbrp,spp=1:63,format=gbrp -qscale 1 file.avi
> 
> 
> Please define "breaks".

it looked like the blocks where somehow using the wrong scantable
that is recognizable but clearly not correct looking

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

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


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


Re: [FFmpeg-devel] [PATCH 10/11] avcodec/x86: add an 8-bit simple IDCT function based on the x86-64 high depth functions

2017-06-20 Thread Ronald S. Bultje
Hi,

On Tue, Jun 20, 2017 at 7:13 PM, Michael Niedermayer  wrote:

> On Mon, Jun 19, 2017 at 05:11:03PM +0200, James Darnley wrote:
> > Includes add/put functions
> >
> > Rounding contributed by Ronald S. Bultje
> > ---
> >  libavcodec/tests/x86/dct.c|  2 +
> >  libavcodec/x86/idctdsp_init.c | 23 
> >  libavcodec/x86/simple_idct.h  |  9 +++
> >  libavcodec/x86/simple_idct10.asm  | 92
> +++
> >  libavcodec/x86/simple_idct10_template.asm |  6 +-
> >  5 files changed, 130 insertions(+), 2 deletions(-)
>
> breaks:
>
> ./ffmpeg -i matrixbench_mpeg2.mpg -an -vframes 1  -vf
> format=gbrp,spp=1:63,format=gbrp -qscale 1 file.avi


Please define "breaks".

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


Re: [FFmpeg-devel] [PATCH] mdec: use correctly permutated quant matrix for dequantization.

2017-06-20 Thread Ronald S. Bultje
Hi,

On Tue, Jun 20, 2017 at 5:22 PM, Michael Niedermayer  wrote:

> On Tue, Jun 20, 2017 at 08:47:33AM -0400, Ronald S. Bultje wrote:
> > This allows using non-simple (e.g. simplemmx) IDCT implementations.
> > The result is not bitexact (which is why the fate test continues to
> > use -idct simple), but the PSNR between C/MMX goes from ~35 to ~90.
> > ---
> >  libavcodec/mdec.c | 14 ++
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> >
> [...]
>
> > @@ -212,9 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
> >  static av_cold int decode_init(AVCodecContext *avctx)
> >  {
> >  MDECContext * const a = avctx->priv_data;
> > -
> > -if (avctx->idct_algo == FF_IDCT_AUTO)
> > -avctx->idct_algo = FF_IDCT_SIMPLE;
>
> iam not sure this should be in this patch


Can you be more precise? Would you like this in a separate patch? Or do you
think it's wrong?

I believe this code was there because the PSNR between FF_IDCT_SIMPLE and
SIMPLEMMX was 35, which is pretty terrible. This was probably because of
the bug in the dequant permutation that's fixed in this patch. After this
patch, the PSNR between the two is 90, which is pretty decent and good
enough for me to enable it by default (although not in fate).

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


Re: [FFmpeg-devel] [PATCH 1/5] build: Generalize yasm/nasm-related variable names

2017-06-20 Thread James Almer
On 6/20/2017 7:49 PM, James Almer wrote:
> +--yasmexe)

Locally changed to --yasmexe=*)

> +warn "The ${opt} option is only provided for compatibility and 
> will be\n"\
> + "removed in the future. Use --x86asmexe instead."
> +x86asmexe="$optval"
> +;;

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


Re: [FFmpeg-devel] [PATCH 10/11] avcodec/x86: add an 8-bit simple IDCT function based on the x86-64 high depth functions

2017-06-20 Thread Michael Niedermayer
On Mon, Jun 19, 2017 at 05:11:03PM +0200, James Darnley wrote:
> Includes add/put functions
> 
> Rounding contributed by Ronald S. Bultje
> ---
>  libavcodec/tests/x86/dct.c|  2 +
>  libavcodec/x86/idctdsp_init.c | 23 
>  libavcodec/x86/simple_idct.h  |  9 +++
>  libavcodec/x86/simple_idct10.asm  | 92 
> +++
>  libavcodec/x86/simple_idct10_template.asm |  6 +-
>  5 files changed, 130 insertions(+), 2 deletions(-)

breaks:

./ffmpeg -i matrixbench_mpeg2.mpg -an -vframes 1  -vf 
format=gbrp,spp=1:63,format=gbrp -qscale 1 file.avi



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

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


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


[FFmpeg-devel] [PATCH 5/5] build: Prefer NASM assembler over YASM

2017-06-20 Thread James Almer
From: Diego Biurrun 

NASM is more actively maintained and permits generating dependency information
as a sideeffect of assembling, thus cutting build times in half.

(Cherry-picked from libav commit 57b753b445e23363c997a8ec1c556e0b0f6e9da3)

Signed-off-by: James Almer 
---
 .travis.yml  | 4 ++--
 Changelog| 2 ++
 configure| 6 +++---
 doc/optimization.txt | 8 
 doc/platform.texi| 8 
 5 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e541ee1608..40f01f94c2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ os:
 addons:
   apt:
 packages:
-  - yasm
+  - nasm
   - diffutils
 compiler:
   - clang
@@ -17,7 +17,7 @@ cache:
 before_install:
   - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi
 install:
-  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install yasm; fi
+  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install nasm; fi
 script:
   - mkdir -p ffmpeg-samples
   - ./configure --samples=ffmpeg-samples --cc=$CC
diff --git a/Changelog b/Changelog
index a893efa4f0..4f46edaddb 100644
--- a/Changelog
+++ b/Changelog
@@ -22,6 +22,8 @@ version :
 - headphone audio filter
 - superequalizer audio filter
 - roberts video filter
+- The x86 assembler default switched from yasm to nasm, pass
+  --x86asmexe=yasm to configure to restore the old behavior.
 
 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/configure b/configure
index a1957b2843..f4ba6405ff 100755
--- a/configure
+++ b/configure
@@ -3258,7 +3258,7 @@ pkg_config_default=pkg-config
 ranlib_default="ranlib"
 strip_default="strip"
 version_script='--version-script'
-x86asmexe_default="yasm"
+x86asmexe_default="nasm"
 windres_default="windres"
 nvcc_default="nvcc"
 nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
@@ -5505,7 +5505,7 @@ EOF
 }
 
 if ! disabled_any asm mmx x86asm; then
-for program in $x86asmexe yasm nasm; do
+for program in $x86asmexe nasm yasm; do
 probe_x86asm $program
 test -n "$x86asm_type" && break
 done
@@ -5517,7 +5517,7 @@ EOF
 esac
 
 check_x86asm "movbe ecx, [5]" && enable x86asm ||
-die "yasm/nasm not found or too old. Use --disable-x86asm for a 
crippled build."
+die "nasm/yasm not found or too old. Use --disable-x86asm for a 
crippled build."
 check_x86asm "vextracti128 xmm0, ymm0, 0"  || disable avx2_external
 check_x86asm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
 check_x86asm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
diff --git a/doc/optimization.txt b/doc/optimization.txt
index c39e1e37b9..974e2f9af2 100644
--- a/doc/optimization.txt
+++ b/doc/optimization.txt
@@ -161,8 +161,8 @@ do{
 For x86, mark registers that are clobbered in your asm. This means both
 general x86 registers (e.g. eax) as well as XMM registers. This last one is
 particularly important on Win64, where xmm6-15 are callee-save, and not
-restoring their contents leads to undefined results. In external asm (e.g.
-yasm), you do this by using:
+restoring their contents leads to undefined results. In external asm,
+you do this by using:
 cglobal function_name, num_args, num_regs, num_xmm_regs
 In inline asm, you specify clobbered registers at the end of your asm:
 __asm__(".." ::: "%eax").
@@ -199,12 +199,12 @@ actual lines causing issues.
 Inline asm vs. external asm
 ---
 Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc)
-and external asm (.s or .asm files, handled by an assembler such as yasm/nasm)
+and external asm (.s or .asm files, handled by an assembler such as nasm/yasm)
 are accepted in FFmpeg. Which one to use differs per specific case.
 
 - if your code is intended to be inlined in a C function, inline asm is always
better, because external asm cannot be inlined
-- if your code calls external functions, yasm is always better
+- if your code calls external functions, external asm is always better
 - if your code takes huge and complex structs as function arguments (e.g.
MpegEncContext; note that this is not ideal and is discouraged if there
are alternatives), then inline asm is always better, because predicting
diff --git a/doc/platform.texi b/doc/platform.texi
index 32d97cc58b..185bda5a07 100644
--- a/doc/platform.texi
+++ b/doc/platform.texi
@@ -71,9 +71,9 @@ Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor 
from
 assembly functions. Put the Perl script somewhere
 in your PATH, FFmpeg's configure will pick it up automatically.
 
-Mac OS X on amd64 and x86 requires @command{yasm} to build most of the
+Mac OS X on amd64 and x86 requires @command{nasm} to build most of the
 optimized assembly functions. @uref{http://www.finkproject.org/, Fink},
-@uref{http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, 
Gentoo Prefix},
+@uref{{https://wiki.g

[FFmpeg-devel] [PATCH 2/5] build: Allow generating dependencies as a side-effect of assembling

2017-06-20 Thread James Almer
From: Diego Biurrun 

(Cherry-picked from libav commit 3c0efbd03349ae68d3a25a08652a102e3fd4)

Signed-off-by: James Almer 
---
 configure  |  8 
 ffbuild/common.mak | 10 +-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 132f38f62e..2f18a2bb0d 100755
--- a/configure
+++ b/configure
@@ -3329,6 +3329,7 @@ CXX_O='-o $@'
 OBJCC_C='-c'
 OBJCC_E='-E -o $@'
 OBJCC_O='-o $@'
+X86ASM_O='-o $@'
 LD_O='-o $@'
 LD_LIB='-l%'
 LD_PATH='-L'
@@ -5490,9 +5491,11 @@ EOF
 if check_cmd $x86asmexe --version; then
 enabled x86_64 && x86asm_extra="-m amd64"
 x86asm_debug="-g dwarf2"
+X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > 
$(@:.o=.d)'
 elif check_cmd nasm -v; then
 x86asmexe=nasm
 x86asm_debug="-g -F dwarf"
+X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
 if enabled x86_64; then
 case "$objformat" in
 elf)   objformat=elf64 ;;
@@ -6738,6 +6741,7 @@ DEPAS=$as
 DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
 X86ASM=$x86asmexe
 DEPX86ASM=$x86asmexe
+DEPX86ASMFLAGS=\$(X86ASMFLAGS)
 AR=$ar
 ARFLAGS=$arflags
 AR_O=$ar_o
@@ -6765,6 +6769,7 @@ CXX_O=$CXX_O
 NVCC_C=$NVCC_C
 NVCC_O=$NVCC_O
 LD_O=$LD_O
+X86ASM_O=$X86ASM_O
 LD_LIB=$LD_LIB
 LD_PATH=$LD_PATH
 DLLTOOL=$dlltool
@@ -6792,8 +6797,11 @@ CXXDEP=$CXXDEP
 CCDEP_FLAGS=$CCDEP_FLAGS
 ASDEP=$ASDEP
 ASDEP_FLAGS=$ASDEP_FLAGS
+X86ASMDEP=$X86ASMDEP
+X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
 CC_DEPFLAGS=$CC_DEPFLAGS
 AS_DEPFLAGS=$AS_DEPFLAGS
+X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
 HOSTCC=$host_cc
 HOSTLD=$host_ld
 HOSTCFLAGS=$host_cflags
diff --git a/ffbuild/common.mak b/ffbuild/common.mak
index b029e2a0fc..e168fb2cfd 100644
--- a/ffbuild/common.mak
+++ b/ffbuild/common.mak
@@ -37,7 +37,7 @@ OBJCFLAGS  += $(EOBJCFLAGS)
 OBJCCFLAGS  = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
 ASFLAGS:= $(CPPFLAGS) $(ASFLAGS)
 CXXFLAGS   := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
-X86ASMFLAGS  += $(IFLAGS:%=%/) -Pconfig.asm
+X86ASMFLAGS += $(IFLAGS:%=%/) -I$( $(@:.asm=.d)
-   $(X86ASM) $(X86ASMFLAGS) -I $( $@
+   $(DEPX86ASM) $(X86ASMFLAGS) -M -o $@ $< > $(@:.asm=.d)
+   $(X86ASM) $(X86ASMFLAGS) -e $< | sed '/^%/d;/^$$/d;' > $@
 
 %.o: %.asm
-   $(DEPX86ASM) $(X86ASMFLAGS) -I $( $(@:.o=.d)
-   $(X86ASM) $(X86ASMFLAGS) -I $(http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 4/5] build: fix commandline selection of nasm

2017-06-20 Thread James Almer
"nasm --version" works on nasm since around version 2.11 and as
such configure assumed it was yasm.

Based on libav commit f54037da8af2f2aeb5e5633b48434211e6a97fe5 by
Diego Biurrun.

Signed-off-by: James Almer 
---
 configure | 23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 170089753a..a1957b2843 100755
--- a/configure
+++ b/configure
@@ -5489,16 +5489,26 @@ EOF
 enabled ssse3  && check_inline_asm ssse3_inline  '"pabsw %xmm0, %xmm0"'
 enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
 
-if ! disabled_any asm mmx x86asm; then
-if check_cmd $x86asmexe --version; then
-x86asm_debug="-g dwarf2"
-X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > 
$(@:.o=.d)'
-elif check_cmd nasm -v; then
-x86asmexe=nasm
+probe_x86asm(){
+x86asmexe_probe=$1
+if check_cmd $x86asmexe_probe -v; then
+x86asmexe=$x86asmexe_probe
+x86asm_type=nasm
 x86asm_debug="-g -F dwarf"
 X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
+elif check_cmd $x86asmexe_probe --version; then
+x86asmexe=$x86asmexe_probe
+x86asm_type=yasm
+x86asm_debug="-g dwarf2"
+X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > 
$(@:.o=.d)'
 fi
+}
 
+if ! disabled_any asm mmx x86asm; then
+for program in $x86asmexe yasm nasm; do
+probe_x86asm $program
+test -n "$x86asm_type" && break
+done
 X86ASMFLAGS="-f $objformat"
 enabled pic   && append X86ASMFLAGS "-DPIC"
 test -n "$extern_prefix"  && append X86ASMFLAGS "-DPREFIX"
@@ -6599,6 +6609,7 @@ echo "big-endian${bigendian-no}"
 echo "runtime cpu detection ${runtime_cpudetect-no}"
 if enabled x86; then
 echo "standalone assembly   ${x86asm-no}"
+echo "x86 assembler ${x86asmexe}"
 echo "MMX enabled   ${mmx-no}"
 echo "MMXEXT enabled${mmxext-no}"
 echo "3DNow! enabled${amd3dnow-no}"
-- 
2.13.0

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


[FFmpeg-devel] [PATCH 3/5] build: Explicitly set 32-bit/64-bit object formats for nasm/yasm

2017-06-20 Thread James Almer
From: Diego Biurrun 

Consistently use object format names with "32" suffix and set object format
to "win64" on Windows x86_64, which fixes assembling with nasm.

(Cherry-picked from libav commit 808ef43597b1e3d6e69a5b9abe2237c8ddb97b44)

Signed-off-by: James Almer 
---
 configure | 23 +--
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/configure b/configure
index 2f18a2bb0d..170089753a 100755
--- a/configure
+++ b/configure
@@ -3254,7 +3254,6 @@ doxygen_default="doxygen"
 install="install"
 ln_s_default="ln -s -f"
 nm_default="nm -g"
-objformat="elf"
 pkg_config_default=pkg-config
 ranlib_default="ranlib"
 strip_default="strip"
@@ -4796,6 +4795,8 @@ esac
 enable $subarch
 enabled spic && enable_weak pic
 
+enabled x86_64 && objformat=elf64 || objformat="elf32"
+
 # OS specific
 case $target_os in
 aix)
@@ -4866,7 +4867,7 @@ case $target_os in
 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
 objformat="macho"
-enabled x86_64 && objformat="macho64"
+enabled x86_64 && objformat="macho64" || objformat="macho32"
 enabled_any pic shared x86_64 ||
 { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
 check_header dispatch/dispatch.h &&
@@ -4910,7 +4911,7 @@ case $target_os in
 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
 SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
 SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) 
-Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
-Wl,--enable-runtime-pseudo-reloc -Wl,--disable-auto-image-base'
-objformat="win32"
+enabled x86_64 && objformat="win64" || objformat="win32"
 ranlib=:
 enable dos_paths
 check_ldflags -Wl,--nxcompat,--dynamicbase
@@ -4950,7 +4951,7 @@ case $target_os in
 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
 SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
 SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) 
-implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
-objformat="win32"
+enabled x86_64 && objformat="win64" || objformat="win32"
 ranlib=:
 enable dos_paths
 ;;
@@ -4965,7 +4966,7 @@ case $target_os in
 SLIB_INSTALL_LINKS=
 SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
 SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
-objformat="win32"
+enabled x86_64 && objformat="win64" || objformat="win32"
 enable dos_paths
 enabled shared && ! enabled small && check_cmd $windres --version && 
enable gnu_windres
 add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
@@ -5376,7 +5377,8 @@ EOF
 EOF
 
 # llvm's integrated assembler supports .object_arch from llvm 3.5
-[ "$objformat" = elf ] && check_as 

[FFmpeg-devel] [PATCH 1/5] build: Generalize yasm/nasm-related variable names

2017-06-20 Thread James Almer
From: Diego Biurrun 

None of them are specific to the YASM assembler.

(Cherry-picked from libav commit 39e208f4d4756367c7cd2d581847e0c1b8a429c1)

Signed-off-by: James Almer 
---
 Makefile|   2 +-
 configure   |  74 ++---
 ffbuild/arch.mak|   2 +-
 ffbuild/common.mak  |  26 +++---
 libavcodec/tests/x86/dct.c  |  10 +--
 libavcodec/x86/Makefile | 124 ++--
 libavcodec/x86/alacdsp_init.c   |   4 +-
 libavcodec/x86/blockdsp_init.c  |   4 +-
 libavcodec/x86/dirac_dwt_init.c |   6 +-
 libavcodec/x86/diracdsp_init.c  |   6 +-
 libavcodec/x86/flacdsp_init.c   |   4 +-
 libavcodec/x86/fmtconvert_init.c|   8 +-
 libavcodec/x86/h264_qpel.c  |   6 +-
 libavcodec/x86/h264dsp_init.c   |   2 +-
 libavcodec/x86/hpeldsp_init.c   |   4 +-
 libavcodec/x86/lossless_audiodsp_init.c |   2 +-
 libavcodec/x86/me_cmp_init.c|   6 +-
 libavcodec/x86/mpegaudiodsp.c   |  12 +--
 libavcodec/x86/qpeldsp_init.c   |   4 +-
 libavcodec/x86/rv40dsp_init.c   |   8 +-
 libavcodec/x86/synth_filter_init.c  |   8 +-
 libavcodec/x86/takdsp_init.c|   2 +-
 libavcodec/x86/ttadsp_init.c|   2 +-
 libavcodec/x86/ttaencdsp_init.c |   2 +-
 libavcodec/x86/v210-init.c  |   2 +-
 libavcodec/x86/vc1dsp_init.c|   8 +-
 libavcodec/x86/videodsp_init.c  |   8 +-
 libavcodec/x86/vp8dsp_init.c|  12 +--
 libavcodec/x86/vp9dsp_init.c|   8 +-
 libavcodec/x86/vp9dsp_init_16bpp.c  |   8 +-
 libavcodec/x86/vp9dsp_init_16bpp_template.c |   8 +-
 libavcodec/x86/xvididct_init.c  |   6 +-
 libavfilter/x86/Makefile|  44 +-
 libavfilter/x86/vf_gradfun_init.c   |   8 +-
 libavfilter/x86/vf_hqdn3d_init.c|   4 +-
 libavfilter/x86/vf_idet_init.c  |   6 +-
 libavfilter/x86/vf_pullup_init.c|   2 +-
 libavresample/x86/Makefile  |   2 +-
 libavutil/x86/Makefile  |   4 +-
 libavutil/x86/cpu.c |   4 +-
 libswresample/audioconvert.c|   2 +-
 libswresample/rematrix.c|   2 +-
 libswresample/x86/Makefile  |   2 +-
 libswresample/x86/rematrix_init.c   |   2 +-
 libswscale/x86/Makefile |   2 +-
 libswscale/x86/rgb2rgb_template.c   |   4 +-
 tests/checkasm/Makefile |   2 +-
 tests/checkasm/checkasm.h   |   2 +-
 tools/target_dec_fuzzer.c   |   2 +-
 49 files changed, 246 insertions(+), 236 deletions(-)

diff --git a/Makefile b/Makefile
index ea90ec8b44..aef18185d4 100644
--- a/Makefile
+++ b/Makefile
@@ -99,7 +99,7 @@ ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS  \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS\
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
-   ALTIVEC-OBJS VSX-OBJS MMX-OBJS YASM-OBJS  \
+   ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS\
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
 
diff --git a/configure b/configure
index ace65c36ea..132f38f62e 100755
--- a/configure
+++ b/configure
@@ -330,7 +330,7 @@ Toolchain options:
   --ln_s=LN_S  use symbolic link tool LN_S [$ln_s_default]
   --strip=STRIPuse strip tool STRIP [$strip_default]
   --windres=WINDRESuse windows resource compiler WINDRES 
[$windres_default]
-  --yasmexe=EXEuse yasm-compatible assembler EXE [$yasmexe_default]
+  --x86asmexe=EXE  use nasm-compatible assembler EXE 
[$x86asmexe_default]
   --cc=CC  use C compiler CC [$cc_default]
   --cxx=CXXuse C compiler CXX [$cxx_default]
   --objcc=OCC  use ObjC compiler OCC [$cc_default]
@@ -401,7 +401,7 @@ Optimization options (experts only):
   --disable-vfpdisable VFP optimizations
   --disable-neon   disable NEON optimizations
   --disable-inline-asm disable use of inline assembly
-  --disable-yasm   disable use of nasm/yasm assembly
+  --disable-x86asm disable use of standalone x86 assembly
   --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
   --disable-msadisable MSA optimizations
@@ -979,12 +979,12 @@ check_insn(){
 echo "$2" | check_as && enable ${1}_external || disable ${1}_external
 }
 
-check_yasm(

[FFmpeg-devel] [PATCH 0/5] assembler related build system merge from libav

2017-06-20 Thread James Almer
These are five commits from libav a bit away from out current merge
point that are useful enough that i figured should be committed now.

Diego Biurrun (4):
  build: Generalize yasm/nasm-related variable names
  build: Allow generating dependencies as a side-effect of assembling
  build: Explicitly set 32-bit/64-bit object formats for nasm/yasm
  build: Prefer NASM assembler over YASM

James Almer (1):
  build: fix commandline selection of nasm

 .travis.yml |   4 +-
 Changelog   |   2 +
 Makefile|   2 +-
 configure   | 114 +++--
 doc/optimization.txt|   8 +-
 doc/platform.texi   |   8 +-
 ffbuild/arch.mak|   2 +-
 ffbuild/common.mak  |  26 +++---
 libavcodec/tests/x86/dct.c  |  10 +--
 libavcodec/x86/Makefile | 124 ++--
 libavcodec/x86/alacdsp_init.c   |   4 +-
 libavcodec/x86/blockdsp_init.c  |   4 +-
 libavcodec/x86/dirac_dwt_init.c |   6 +-
 libavcodec/x86/diracdsp_init.c  |   6 +-
 libavcodec/x86/flacdsp_init.c   |   4 +-
 libavcodec/x86/fmtconvert_init.c|   8 +-
 libavcodec/x86/h264_qpel.c  |   6 +-
 libavcodec/x86/h264dsp_init.c   |   2 +-
 libavcodec/x86/hpeldsp_init.c   |   4 +-
 libavcodec/x86/lossless_audiodsp_init.c |   2 +-
 libavcodec/x86/me_cmp_init.c|   6 +-
 libavcodec/x86/mpegaudiodsp.c   |  12 +--
 libavcodec/x86/qpeldsp_init.c   |   4 +-
 libavcodec/x86/rv40dsp_init.c   |   8 +-
 libavcodec/x86/synth_filter_init.c  |   8 +-
 libavcodec/x86/takdsp_init.c|   2 +-
 libavcodec/x86/ttadsp_init.c|   2 +-
 libavcodec/x86/ttaencdsp_init.c |   2 +-
 libavcodec/x86/v210-init.c  |   2 +-
 libavcodec/x86/vc1dsp_init.c|   8 +-
 libavcodec/x86/videodsp_init.c  |   8 +-
 libavcodec/x86/vp8dsp_init.c|  12 +--
 libavcodec/x86/vp9dsp_init.c|   8 +-
 libavcodec/x86/vp9dsp_init_16bpp.c  |   8 +-
 libavcodec/x86/vp9dsp_init_16bpp_template.c |   8 +-
 libavcodec/x86/xvididct_init.c  |   6 +-
 libavfilter/x86/Makefile|  44 +-
 libavfilter/x86/vf_gradfun_init.c   |   8 +-
 libavfilter/x86/vf_hqdn3d_init.c|   4 +-
 libavfilter/x86/vf_idet_init.c  |   6 +-
 libavfilter/x86/vf_pullup_init.c|   2 +-
 libavresample/x86/Makefile  |   2 +-
 libavutil/x86/Makefile  |   4 +-
 libavutil/x86/cpu.c |   4 +-
 libswresample/audioconvert.c|   2 +-
 libswresample/rematrix.c|   2 +-
 libswresample/x86/Makefile  |   2 +-
 libswresample/x86/rematrix_init.c   |   2 +-
 libswscale/x86/Makefile |   2 +-
 libswscale/x86/rgb2rgb_template.c   |   4 +-
 tests/checkasm/Makefile |   2 +-
 tests/checkasm/checkasm.h   |   2 +-
 tools/target_dec_fuzzer.c   |   2 +-
 53 files changed, 285 insertions(+), 259 deletions(-)

-- 
2.13.0

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


Re: [FFmpeg-devel] [PATCH] Update decode_simple_internal() to get the side data correctly.

2017-06-20 Thread John Rummell
Using avci->last_pkt_props works. Chromium tests work, "make fate" passes.
Updated patch:

From 0fd3c5c9abd3cea943b12f65f219d479b5949e4b Mon Sep 17 00:00:00 2001
From: John Rummell 
Date: Wed, 14 Jun 2017 14:43:04 -0700
Subject: [PATCH] Update decode_simple_internal() to get the side data
 correctly.

Use avci->last_pkt_props to get the side data. Using |pkt| doesn't work
when FF_API_MERGE_SD is set, as the compressed side data is expanded into
|tmp|, leaving the original |pkt| unchanged.
---
 libavcodec/decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 584d9d6241..f7dea930ed 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -462,7 +462,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 frame->sample_rate = avctx->sample_rate;
 }

-side= av_packet_get_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES,
&side_size);
+side= av_packet_get_side_data(avci->last_pkt_props,
AV_PKT_DATA_SKIP_SAMPLES, &side_size);
 if(side && side_size>=10) {
 avctx->internal->skip_samples = AV_RL32(side) *
avctx->internal->skip_samples_multiplier;
 discard_padding = AV_RL32(side + 4);
-- 
2.13.1.518.g3df882009-goog


On Thu, Jun 15, 2017 at 2:53 PM, James Almer  wrote:

> On 6/14/2017 9:04 PM, John Rummell wrote:
> > From 6418fc43b06cea4cf49e410d474ae92022c4dbd1 Mon Sep 17 00:00:00 2001
> > From: John Rummell 
> > Date: Wed, 14 Jun 2017 14:43:04 -0700
> > Subject: [PATCH] Update decode_simple_internal() to get the side data
> > correctly.
> >
> > When FF_API_MERGE_SD is set, the compressed side data is expanded into
> > |tmp|,
> > leaving the original |pkt| unchanged. So when retrieving side data, get
> it
> > from |tmp|. If the side data is not compressed, |tmp| is a copy of |pkt|
> > so the side data should be accessible from either.
> > ---
> >  libavcodec/decode.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> > index 584d9d6241..327fb8ccb7 100644
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> > @@ -462,7 +462,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >  frame->sample_rate = avctx->sample_rate;
> >  }
> >
> > -side= av_packet_get_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES,
> > &side_size);
> > +side= av_packet_get_side_data(&tmp, AV_PKT_DATA_SKIP_SAMPLES,
> > &side_size);
>
> Could you please test if using avci->last_pkt_props instead of &tmp also
> works for you?
>
> I'm the one that changed it from avci->last_pkt_props (which contains
> packet properties, including side data, as taken from tmp post side data
> splitting) to pkt two months ago, if i remember correctly because it
> fixed a regression in some test, but I'm unable to reproduce anything if
> i revert it right now.
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Use intra_scantable in dct_unquantize_h263_intra_c()

2017-06-20 Thread Michael Niedermayer
On Tue, Jun 20, 2017 at 06:52:09PM +0200, James Darnley wrote:
> On 2017-06-20 00:37, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/mpegvideo.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> > index 63a30b93ce..e29558b3a2 100644
> > --- a/libavcodec/mpegvideo.c
> > +++ b/libavcodec/mpegvideo.c
> > @@ -225,7 +225,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext 
> > *s,
> >  if(s->ac_pred)
> >  nCoeffs=63;
> >  else
> > -nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
> > +nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
> >  
> >  for(i=1; i<=nCoeffs; i++) {
> >  level = block[i];
> > 
> 
> This copies the change that you pushed for x86.  That change fixed the
> issue I had with wmv1.  This must correct that for other platforms.

will push this

thx

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

Observe your enemies, for they first find out your faults. -- Antisthenes


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


Re: [FFmpeg-devel] [PATCH] mdec: use correctly permutated quant matrix for dequantization.

2017-06-20 Thread Michael Niedermayer
On Tue, Jun 20, 2017 at 08:47:33AM -0400, Ronald S. Bultje wrote:
> This allows using non-simple (e.g. simplemmx) IDCT implementations.
> The result is not bitexact (which is why the fate test continues to
> use -idct simple), but the PSNR between C/MMX goes from ~35 to ~90.
> ---
>  libavcodec/mdec.c | 14 ++
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
[...]

> @@ -212,9 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
>  static av_cold int decode_init(AVCodecContext *avctx)
>  {
>  MDECContext * const a = avctx->priv_data;
> -
> -if (avctx->idct_algo == FF_IDCT_AUTO)
> -avctx->idct_algo = FF_IDCT_SIMPLE;

iam not sure this should be in this patch

rest LGTM

thx

[...]
-- 
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 1/2] avcodec/mpegvideo: Use intra_scantable in dct_unquantize_h263_intra_c()

2017-06-20 Thread Michael Niedermayer
On Tue, Jun 20, 2017 at 12:06:08AM +, Kieran Kunhya wrote:
> On Tue, 20 Jun 2017, 00:38 Michael Niedermayer, 
> wrote:
> 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/mpegvideo.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> > index 63a30b93ce..e29558b3a2 100644
> > --- a/libavcodec/mpegvideo.c
> > +++ b/libavcodec/mpegvideo.c
> > @@ -225,7 +225,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext
> > *s,
> >  if(s->ac_pred)
> >  nCoeffs=63;
> >  else
> > -nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
> > +nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
> >
> >  for(i=1; i<=nCoeffs; i++) {
> >  level = block[i];
> > --
> > 2.13.0
> >
> 
> Are you able to document some of this, Ronald and James spent a lot of time
> trying to understand this undocumented code and this patch set doesn't
> explain anything better.

can you be more specific about what should be documented ?
Iam a little "handicapped" as i wrote or know large parts of this
stuff, so i do not realize what is hard to understand ...

I think mpegvideo would benefit from some cleanup.
Ideally code should not need documentation in most cases


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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


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


[FFmpeg-devel] [PATCHv2 3/4] avformat: make flush_packets a tri-state and set it to -1 (auto) by default

2017-06-20 Thread Marton Balint
If flushing is not disabled, then mux.c will signal the end of the packets with
an AVIO_DATA_MARKER_FLUSH_POINT, and aviobuf will be able to decide to flush or
not based on the preferred minimum packet size set by the used protocol.

Signed-off-by: Marton Balint 
---
 doc/formats.texi|  7 ---
 libavformat/mux.c   | 12 +---
 libavformat/options_table.h |  4 ++--
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/doc/formats.texi b/doc/formats.texi
index c51d4086db..ddd7743548 100644
--- a/doc/formats.texi
+++ b/doc/formats.texi
@@ -182,9 +182,10 @@ Default is 0.
 Correct single timestamp overflows if set to 1. Default is 1.
 
 @item flush_packets @var{integer} (@emph{output})
-Flush the underlying I/O stream after each packet. Default 1 enables it, and
-has the effect of reducing the latency; 0 disables it and may slightly
-increase performance in some cases.
+Flush the underlying I/O stream after each packet. Default is -1 (auto), which
+means that the underlying protocol will decide, 1 enables it, and has the
+effect of reducing the latency, 0 disables it and may increase IO throughput in
+some cases.
 
 @item output_ts_offset @var{offset} (@emph{output})
 Set the output time offset.
diff --git a/libavformat/mux.c b/libavformat/mux.c
index e1e49a81be..516d8fa746 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -479,8 +479,10 @@ static int write_header_internal(AVFormatContext *s)
 s->internal->write_header_ret = ret;
 if (ret < 0)
 return ret;
-if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & 
AVFMT_FLAG_FLUSH_PACKETS)
+if ((s->flush_packets == 1 || s->flags & AVFMT_FLAG_FLUSH_PACKETS) && 
s->pb && s->pb->error >= 0)
 avio_flush(s->pb);
+else if (s->flush_packets && !(s->oformat->flags & AVFMT_NOFILE) && 
s->pb && s->pb->error >= 0)
+avio_write_marker(s->pb, AV_NOPTS_VALUE, 
AVIO_DATA_MARKER_FLUSH_POINT);
 }
 s->internal->header_written = 1;
 if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
@@ -772,8 +774,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
 }
 
 if (s->pb && ret >= 0) {
-if (s->flush_packets && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
+if (s->flush_packets == 1 || s->flags & AVFMT_FLAG_FLUSH_PACKETS)
 avio_flush(s->pb);
+else if (s->flush_packets && !(s->oformat->flags & AVFMT_NOFILE))
+avio_write_marker(s->pb, AV_NOPTS_VALUE, 
AVIO_DATA_MARKER_FLUSH_POINT);
 if (s->pb->error < 0)
 ret = s->pb->error;
 }
@@ -932,8 +936,10 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
 return ret;
 }
 ret = s->oformat->write_packet(s, NULL);
-if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & 
AVFMT_FLAG_FLUSH_PACKETS)
+if ((s->flush_packets == 1 || s->flags & AVFMT_FLAG_FLUSH_PACKETS) 
&& s->pb && s->pb->error >= 0)
 avio_flush(s->pb);
+else if (s->flush_packets && !(s->oformat->flags & AVFMT_NOFILE) 
&& s->pb && s->pb->error >= 0)
+avio_write_marker(s->pb, AV_NOPTS_VALUE, 
AVIO_DATA_MARKER_FLUSH_POINT);
 if (ret >= 0 && s->pb && s->pb->error < 0)
 ret = s->pb->error;
 return ret;
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index 0c1915d6d4..118086df66 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -39,7 +39,7 @@ static const AVOption avformat_options[] = {
 {"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 
= 500 }, 32, INT64_MAX, D},
 {"formatprobesize", "number of bytes to probe file format", 
OFFSET(format_probesize), AV_OPT_TYPE_INT, {.i64 = PROBE_BUF_MAX}, 0, 
INT_MAX-1, D},
 {"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 
= DEFAULT }, 0, INT_MAX, E},
-{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 
AVFMT_FLAG_FLUSH_PACKETS | AVFMT_FLAG_AUTO_BSF }, INT_MIN, INT_MAX, D|E, 
"fflags"},
+{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVFMT_FLAG_AUTO_BSF 
}, INT_MIN, INT_MAX, D|E, "fflags"},
 {"flush_packets", "reduce the latency by flushing out packets immediately", 0, 
AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, E, 
"fflags"},
 {"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNIDX }, 
INT_MIN, INT_MAX, D, "fflags"},
 {"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_GENPTS }, 
INT_MIN, INT_MAX, D, "fflags"},
@@ -85,7 +85,7 @@ static const AVOption avformat_options[] = {
 {"use_wallclock_as_timestamps", "use wallclock as timestamps", 
OFFSET(use_wallclock_as_timestamps), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D},
 {"skip_initial_bytes", "set number of bytes to skip before reading header and 
frames", OFFSET(skip_initial_bytes), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, 
INT64_MAX-1, D},
 {"correct_ts_overflow", "co

[FFmpeg-devel] [PATCHv2 2/4] avformat/aviobuf: add support for specifying minimum packet size and marking flush points

2017-06-20 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 doc/APIchanges|  3 +++
 libavformat/avio.h| 13 -
 libavformat/aviobuf.c |  7 +++
 libavformat/url.h |  1 +
 libavformat/version.h |  2 +-
 5 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 5dca6b3e51..939a4a7d9d 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2017-06-20 - xxx - lavf 57.75.100 - avio.h
+  Add AVIO_DATA_MARKER_FLUSH_POINT to signal preferred flush points to aviobuf.
+
 2017-06-14 - xxx - lavu 55.66.100 - hwcontext.h
   av_hwframe_ctx_create_derived() now takes some AV_HWFRAME_MAP_* combination
   as its flags argument (which was previously unused).
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 844a5723d3..f14b003ba5 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -137,7 +137,13 @@ enum AVIODataMarkerType {
  * Trailer data, which doesn't contain actual content, but only for
  * finalizing the output file.
  */
-AVIO_DATA_MARKER_TRAILER
+AVIO_DATA_MARKER_TRAILER,
+/**
+ * A point in the output bytestream where the underlying AVIOContext might
+ * flush the buffer depending on latency or buffering requirements. 
Typically
+ * means the end of a packet.
+ */
+AVIO_DATA_MARKER_FLUSH_POINT,
 };
 
 /**
@@ -339,6 +345,11 @@ typedef struct AVIOContext {
  * used keeping track of already written data for a later flush.
  */
 unsigned char *buf_ptr_max;
+
+/**
+ * Try to buffer at least this amount of data before flushing it
+ */
+int min_packet_size;
 } AVIOContext;
 
 /**
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index dcb91570d8..7f4e740a33 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -104,6 +104,7 @@ int ffio_init_context(AVIOContext *s,
 s->eof_reached = 0;
 s->error   = 0;
 s->seekable= seek ? AVIO_SEEKABLE_NORMAL : 0;
+s->min_packet_size = 0;
 s->max_packet_size = 0;
 s->update_checksum = NULL;
 s->short_seek_threshold = SHORT_SEEK_THRESHOLD;
@@ -489,6 +490,11 @@ void avio_wb24(AVIOContext *s, unsigned int val)
 
 void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType 
type)
 {
+if (type == AVIO_DATA_MARKER_FLUSH_POINT) {
+if (s->buf_ptr - s->buffer >= s->min_packet_size)
+avio_flush(s);
+return;
+}
 if (!s->write_data_type)
 return;
 // If ignoring boundary points, just treat it as unknown
@@ -941,6 +947,7 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
 
 (*s)->seekable = h->is_streamed ? 0 : AVIO_SEEKABLE_NORMAL;
 (*s)->max_packet_size = max_packet_size;
+(*s)->min_packet_size = h->min_packet_size;
 if(h->prot) {
 (*s)->read_pause = io_read_pause;
 (*s)->read_seek  = io_read_seek;
diff --git a/libavformat/url.h b/libavformat/url.h
index 910f1e00b3..4750bfff82 100644
--- a/libavformat/url.h
+++ b/libavformat/url.h
@@ -48,6 +48,7 @@ typedef struct URLContext {
 int64_t rw_timeout; /**< maximum time to wait for (network) 
read/write operation completion, in mcs */
 const char *protocol_whitelist;
 const char *protocol_blacklist;
+int min_packet_size;/**< if non zero, the stream is packetized 
with this min packet size */
 } URLContext;
 
 typedef struct URLProtocol {
diff --git a/libavformat/version.h b/libavformat/version.h
index 1fb8ffb2b9..44c16ac75a 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  74
+#define LIBAVFORMAT_VERSION_MINOR  75
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-- 
2.12.3

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


Re: [FFmpeg-devel] [PATCH] Update decode_simple_internal() to get the side data correctly.

2017-06-20 Thread James Almer
On 6/20/2017 5:09 PM, John Rummell wrote:
> Using avci->last_pkt_props works. Chromium tests work, "make fate"
> passes. Updated patch:
> 
> From 0fd3c5c9abd3cea943b12f65f219d479b5949e4b Mon Sep 17 00:00:00 2001
> From: John Rummell mailto:jrumm...@chromium.org>>
> Date: Wed, 14 Jun 2017 14:43:04 -0700
> Subject: [PATCH] Update decode_simple_internal() to get the side data
>  correctly.
> 
> Use avci->last_pkt_props to get the side data. Using |pkt| doesn't work
> when FF_API_MERGE_SD is set, as the compressed side data is expanded into
> |tmp|, leaving the original |pkt| unchanged.
> ---
>  libavcodec/decode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index 584d9d6241..f7dea930ed 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -462,7 +462,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  frame->sample_rate = avctx->sample_rate;
>  }
>  
> -side= av_packet_get_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES,
> &side_size);
> +side= av_packet_get_side_data(avci->last_pkt_props,
> AV_PKT_DATA_SKIP_SAMPLES, &side_size);
>  if(side && side_size>=10) {
>  avctx->internal->skip_samples = AV_RL32(side) *
> avctx->internal->skip_samples_multiplier;
>  discard_padding = AV_RL32(side + 4);
> -- 
> 2.13.1.518.g3df882009-goog

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


Re: [FFmpeg-devel] [PATCH 2/2] aarch64: vp9 16bpp: Fix assembling with Xcode 6.2 and older

2017-06-20 Thread Matthieu Bouron
On Tue, Jun 20, 2017 at 10:09:05PM +0300, Martin Storsjö wrote:
> From: Memphiz 
> 
> Properly use the b.eq form instead of the nonstandard form (which
> both gas and newer clang accept though), and expand the register
> lists that used a range (which the Xcode 6.2 clang, based on clang
> 3.5 svn, didn't support).
> ---
>  libavcodec/aarch64/vp9itxfm_16bpp_neon.S | 8 
>  libavcodec/aarch64/vp9mc_16bpp_neon.S| 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/aarch64/vp9itxfm_16bpp_neon.S 
> b/libavcodec/aarch64/vp9itxfm_16bpp_neon.S
> index 0befe383df..68296d9c40 100644
> --- a/libavcodec/aarch64/vp9itxfm_16bpp_neon.S
> +++ b/libavcodec/aarch64/vp9itxfm_16bpp_neon.S
> @@ -1925,8 +1925,8 @@ function vp9_idct_idct_32x32_add_16_neon
>  2:
>  subsx1,  x1,  #1
>  .rept 4
> -st1 {v16.4s-v19.4s},  [x0], #64
> -st1 {v16.4s-v19.4s},  [x0], #64
> +st1 {v16.4s,v17.4s,v18.4s,v19.4s},  [x0], #64
> +st1 {v16.4s,v17.4s,v18.4s,v19.4s},  [x0], #64
>  .endr
>  b.ne2b
>  3:
> @@ -1991,8 +1991,8 @@ function idct32x32_\size\()_add_16_neon
>  moviv19.4s,  #0
>  
>  .rept 4
> -st1 {v16.4s-v19.4s},  [x0], #64
> -st1 {v16.4s-v19.4s},  [x0], #64
> +st1 {v16.4s,v17.4s,v18.4s,v19.4s},  [x0], #64
> +st1 {v16.4s,v17.4s,v18.4s,v19.4s},  [x0], #64
>  .endr
>  
>  3:
> diff --git a/libavcodec/aarch64/vp9mc_16bpp_neon.S 
> b/libavcodec/aarch64/vp9mc_16bpp_neon.S
> index 98ffd2e8a7..cac6428709 100644
> --- a/libavcodec/aarch64/vp9mc_16bpp_neon.S
> +++ b/libavcodec/aarch64/vp9mc_16bpp_neon.S
> @@ -275,7 +275,7 @@ function \type\()_8tap_\size\()h
>  subsx9,  x9,  #32
>  st1 {v1.8h,  v2.8h},  [x0], #32
>  st1 {v24.8h, v25.8h}, [x6], #32
> -beq 3f
> +b.eq3f
>  mov v5.16b,  v7.16b
>  mov v16.16b, v18.16b
>  ld1 {v6.8h,  v7.8h},  [x2], #32
> -- 
> 2.11.0 (Apple Git-81)

Both patches LGTM.

Thanks.

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


[FFmpeg-devel] [PATCH 1/2] aarch64: vp9: Fix assembling with Xcode 6.2 and older

2017-06-20 Thread Martin Storsjö
From: Memphiz 

Properly use the b.eq/b.ge forms instead of the nonstandard forms
(which both gas and newer clang accept though), and expand the
register list that used a range (which the Xcode 6.2 clang, based
on clang 3.5 svn, didn't support).

This is cherrypicked from libav commit
a970f9de865c84ed5360dd0398baee7d48d04620.
---
 libavcodec/aarch64/vp9itxfm_neon.S | 2 +-
 libavcodec/aarch64/vp9mc_neon.S| 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/aarch64/vp9itxfm_neon.S 
b/libavcodec/aarch64/vp9itxfm_neon.S
index b12890f0db..99413b0f70 100644
--- a/libavcodec/aarch64/vp9itxfm_neon.S
+++ b/libavcodec/aarch64/vp9itxfm_neon.S
@@ -1531,7 +1531,7 @@ function ff_vp9_idct_idct_32x32_add_neon, export=1
 2:
 subsx1,  x1,  #1
 .rept 4
-st1 {v16.8h-v19.8h},  [x0], #64
+st1 {v16.8h,v17.8h,v18.8h,v19.8h},  [x0], #64
 .endr
 b.ne2b
 3:
diff --git a/libavcodec/aarch64/vp9mc_neon.S b/libavcodec/aarch64/vp9mc_neon.S
index 82a0f53133..f67624ca04 100644
--- a/libavcodec/aarch64/vp9mc_neon.S
+++ b/libavcodec/aarch64/vp9mc_neon.S
@@ -341,7 +341,7 @@ function \type\()_8tap_\size\()h_\idx1\idx2
 subsx9,  x9,  #16
 st1 {v1.16b},  [x0], #16
 st1 {v24.16b}, [x6], #16
-beq 3f
+b.eq3f
 mov v4.16b,  v6.16b
 mov v16.16b, v18.16b
 ld1 {v6.16b},  [x2], #16
@@ -388,10 +388,10 @@ function ff_vp9_\type\()_\filter\()\size\()_h_neon, 
export=1
 add x9,  x6,  w5, uxtw #4
 mov x5,  #\size
 .if \size >= 16
-bge \type\()_8tap_16h_34
+b.ge\type\()_8tap_16h_34
 b   \type\()_8tap_16h_43
 .else
-bge \type\()_8tap_\size\()h_34
+b.ge\type\()_8tap_\size\()h_34
 b   \type\()_8tap_\size\()h_43
 .endif
 endfunc
-- 
2.11.0 (Apple Git-81)

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


[FFmpeg-devel] [PATCH 2/2] aarch64: vp9 16bpp: Fix assembling with Xcode 6.2 and older

2017-06-20 Thread Martin Storsjö
From: Memphiz 

Properly use the b.eq form instead of the nonstandard form (which
both gas and newer clang accept though), and expand the register
lists that used a range (which the Xcode 6.2 clang, based on clang
3.5 svn, didn't support).
---
 libavcodec/aarch64/vp9itxfm_16bpp_neon.S | 8 
 libavcodec/aarch64/vp9mc_16bpp_neon.S| 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/aarch64/vp9itxfm_16bpp_neon.S 
b/libavcodec/aarch64/vp9itxfm_16bpp_neon.S
index 0befe383df..68296d9c40 100644
--- a/libavcodec/aarch64/vp9itxfm_16bpp_neon.S
+++ b/libavcodec/aarch64/vp9itxfm_16bpp_neon.S
@@ -1925,8 +1925,8 @@ function vp9_idct_idct_32x32_add_16_neon
 2:
 subsx1,  x1,  #1
 .rept 4
-st1 {v16.4s-v19.4s},  [x0], #64
-st1 {v16.4s-v19.4s},  [x0], #64
+st1 {v16.4s,v17.4s,v18.4s,v19.4s},  [x0], #64
+st1 {v16.4s,v17.4s,v18.4s,v19.4s},  [x0], #64
 .endr
 b.ne2b
 3:
@@ -1991,8 +1991,8 @@ function idct32x32_\size\()_add_16_neon
 moviv19.4s,  #0
 
 .rept 4
-st1 {v16.4s-v19.4s},  [x0], #64
-st1 {v16.4s-v19.4s},  [x0], #64
+st1 {v16.4s,v17.4s,v18.4s,v19.4s},  [x0], #64
+st1 {v16.4s,v17.4s,v18.4s,v19.4s},  [x0], #64
 .endr
 
 3:
diff --git a/libavcodec/aarch64/vp9mc_16bpp_neon.S 
b/libavcodec/aarch64/vp9mc_16bpp_neon.S
index 98ffd2e8a7..cac6428709 100644
--- a/libavcodec/aarch64/vp9mc_16bpp_neon.S
+++ b/libavcodec/aarch64/vp9mc_16bpp_neon.S
@@ -275,7 +275,7 @@ function \type\()_8tap_\size\()h
 subsx9,  x9,  #32
 st1 {v1.8h,  v2.8h},  [x0], #32
 st1 {v24.8h, v25.8h}, [x6], #32
-beq 3f
+b.eq3f
 mov v5.16b,  v7.16b
 mov v16.16b, v18.16b
 ld1 {v6.8h,  v7.8h},  [x2], #32
-- 
2.11.0 (Apple Git-81)

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


Re: [FFmpeg-devel] [PATCH] lavfi/buffersrc: push the frame deeper if requested.

2017-06-20 Thread Gyan
On Tue, Jun 20, 2017 at 11:29 PM, Paul B Mahol  wrote:

> On 12/24/16, Nicolas George  wrote:
> > Le quartidi 4 nivose, an CCXXV, Michael Niedermayer a ecrit :
> >> theres a change with "-af apad=pad_len=1 -shortest" (no -vframes)
> >> the file is not sharable, this change undoes the effect of the
> >> non-recursive patch
> >>
> >> use of vframes generally shows differences which seem to return to what
> >> things were before the "non recursive patch"
> >
> > Thanks for checking. Then I shall push shortly.
>
> This breaks :shortest=1 in all framesync filters, so I'm for reverting
> this.
>

Thanks. Please close ticket 6292 when you do.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Requesting push access to FFmpeg repo

2017-06-20 Thread Kevin Mark
On Tue, Jun 20, 2017 at 7:14 AM, Michael Niedermayer
 wrote:
> If you want push access, please send a patch that adds you to the
> MAINTAINERs file
> after the patch has been applied, you get push access
>
> (by going throgh this extra step changes to the git access list are
>  public, are logged and allow people to comment/veto ...)
>
> thx

Thank you for the clarification and rationale on the process!

On Tue, Jun 20, 2017 at 7:36 AM, Hendrik Leppkes  wrote:
> Personally I think people that have been around like a month should
> perhaps excercise some more patience while they get more familiar with
> our codebase and our workflows. :)

I do not believe patience has been an issue but I can understand how
this request could appear premature. I would personally require more
than a month of activity before allowing push access to one of my own
projects, but it was suggested that I ask by another project member
with push access so I assumed things might be different here. It
doesn't appear that is the case so it may be best to withdraw my
request. I'm open to any further suggestions.

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


Re: [FFmpeg-devel] [PATCH] lavfi/buffersrc: push the frame deeper if requested.

2017-06-20 Thread Paul B Mahol
On 12/24/16, Nicolas George  wrote:
> Le quartidi 4 nivose, an CCXXV, Michael Niedermayer a ecrit :
>> theres a change with "-af apad=pad_len=1 -shortest" (no -vframes)
>> the file is not sharable, this change undoes the effect of the
>> non-recursive patch
>>
>> use of vframes generally shows differences which seem to return to what
>> things were before the "non recursive patch"
>
> Thanks for checking. Then I shall push shortly.

This breaks :shortest=1 in all framesync filters, so I'm for reverting this.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] configure/libopenjpegdec.c/libopenjpegenc.c: Add support for LibOpenJPEG v2.2/git

2017-06-20 Thread Michael Bradshaw
> From 70b53c1ea5a56a03cfef24d5b551b983ba2473b2 Mon Sep 17 00:00:00 2001
> From: Reino17 
> Date: Wed, 14 Jun 2017 00:19:12 +0200
> Subject: [PATCH] Add support for LibOpenJPEG v2.2/git
>
> ---
>  configure   |  4 +++-
>  libavcodec/libopenjpegdec.c | 10 +++---
>  libavcodec/libopenjpegenc.c | 12 
>  3 files changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/configure b/configure
> index e3941f9..0190966 100755
> --- a/configure
> +++ b/configure
> @@ -1868,6 +1868,7 @@ HEADERS_LIST="
>  machine_ioctl_meteor_h
>  malloc_h
>  opencv2_core_core_c_h
> +openjpeg_2_2_openjpeg_h
>  openjpeg_2_1_openjpeg_h
>  openjpeg_2_0_openjpeg_h
>  openjpeg_1_5_openjpeg_h
> @@ -5831,7 +5832,8 @@ enabled libopencv && { check_header
opencv2/core/core_c.h &&
>   require opencv opencv2/core/core_c.h
cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
> require_pkg_config opencv opencv/cxcore.h
cvCreateImageHeader; }
>  enabled libopenh264   && require_pkg_config openh264
wels/codec_api.h WelsGetCodecVersion
> -enabled libopenjpeg   && { { check_lib libopenjpeg
openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags
-DOPJ_STATIC; } ||
> +enabled libopenjpeg   && { { check_lib libopenjpeg
openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags
-DOPJ_STATIC; } ||
> +   { check_lib libopenjpeg
openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags
-DOPJ_STATIC; } ||
> check_lib libopenjpeg
openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
> { check_lib libopenjpeg
openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags
-DOPJ_STATIC; } ||
> { check_lib libopenjpeg
openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags
-DOPJ_STATIC; } ||
> diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
> index ce4e2b0..5ed9ce1 100644
> --- a/libavcodec/libopenjpegdec.c
> +++ b/libavcodec/libopenjpegdec.c
> @@ -34,7 +34,9 @@
>  #include "internal.h"
>  #include "thread.h"
>
> -#if HAVE_OPENJPEG_2_1_OPENJPEG_H
> +#if HAVE_OPENJPEG_2_2_OPENJPEG_H
> +#  include 
> +#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
>  #  include 
>  #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
>  #  include 
> @@ -44,7 +46,7 @@
>  #  include 
>  #endif
>
> -#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
> +#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H ||
HAVE_OPENJPEG_2_0_OPENJPEG_H
>  #  define OPENJPEG_MAJOR_VERSION 2
>  #  define OPJ(x) OPJ_##x
>  #else
> @@ -429,7 +431,9 @@ static int libopenjpeg_decode_frame(AVCodecContext
*avctx,
>  opj_stream_set_read_function(stream, stream_read);
>  opj_stream_set_skip_function(stream, stream_skip);
>  opj_stream_set_seek_function(stream, stream_seek);
> -#if HAVE_OPENJPEG_2_1_OPENJPEG_H
> +#if HAVE_OPENJPEG_2_2_OPENJPEG_H
> +opj_stream_set_user_data(stream, &reader, NULL);
> +#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
>  opj_stream_set_user_data(stream, &reader, NULL);

Please merge these two conditions, since both #if conditions are executing
the same code. That is:

#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
opj_stream_set_user_data(stream, &reader, NULL);
#elif HAVE_OPENJPEG_2_0_OPENJPEG_H
...

>  #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
>  opj_stream_set_user_data(stream, &reader);
> diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
> index 4a12729..d3b9161 100644
> --- a/libavcodec/libopenjpegenc.c
> +++ b/libavcodec/libopenjpegenc.c
> @@ -32,7 +32,9 @@
>  #include "avcodec.h"
>  #include "internal.h"
>
> -#if HAVE_OPENJPEG_2_1_OPENJPEG_H
> +#if HAVE_OPENJPEG_2_2_OPENJPEG_H
> +#  include 
> +#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
>  #  include 
>  #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
>  #  include 
> @@ -42,7 +44,7 @@
>  #  include 
>  #endif
>
> -#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
> +#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H ||
HAVE_OPENJPEG_2_0_OPENJPEG_H
>  #  define OPENJPEG_MAJOR_VERSION 2
>  #  define OPJ(x) OPJ_##x
>  #else
> @@ -305,7 +307,7 @@ static av_cold int
libopenjpeg_encode_init(AVCodecContext *avctx)
>
>  opj_set_default_encoder_parameters(&ctx->enc_params);
>
> -#if HAVE_OPENJPEG_2_1_OPENJPEG_H
> +#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
>  switch (ctx->cinema_mode) {
>  case OPJ_CINEMA2K_24:
>  ctx->enc_params.rsiz = OPJ_PROFILE_CINEMA_2K;
> @@ -769,7 +771,9 @@ static int libopenjpeg_encode_frame(AVCodecContext
*avctx, AVPacket *pkt,
>  opj_stream_set_write_function(stream, stream_write);
>  opj_stream_set_skip_function(stream, stream_skip);
>  opj_stream_set_seek_function(stream, stream_seek);
> -#if HAVE_OPENJPEG_2_1_OPENJPEG_H
> +#if HAVE_OP

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Use intra_scantable in dct_unquantize_h263_intra_c()

2017-06-20 Thread James Darnley
On 2017-06-20 00:37, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/mpegvideo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index 63a30b93ce..e29558b3a2 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -225,7 +225,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext *s,
>  if(s->ac_pred)
>  nCoeffs=63;
>  else
> -nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
> +nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
>  
>  for(i=1; i<=nCoeffs; i++) {
>  level = block[i];
> 

This copies the change that you pushed for x86.  That change fixed the
issue I had with wmv1.  This must correct that for other platforms.

LGTM.

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


Re: [FFmpeg-devel] [PATCH 10/11] avcodec/x86: add an 8-bit simple IDCT function based on the x86-64 high depth functions

2017-06-20 Thread James Darnley
On 2017-06-19 17:11, James Darnley wrote:
> diff --git a/libavcodec/x86/simple_idct10_template.asm 
> b/libavcodec/x86/simple_idct10_template.asm
> index 51baf84c82..02fd445ec0 100644
> --- a/libavcodec/x86/simple_idct10_template.asm
> +++ b/libavcodec/x86/simple_idct10_template.asm
> @@ -258,6 +258,10 @@
>  
>  IDCT_1D %1, %2, %8
>  %elif %2 == 11
> +; This copies the DC-only shortcut.  When there is only a DC coefficient 
> the
> +; C shifts the value and splats it to all coeffs rather than multiplying 
> and
> +; doing the full IDCT.  This causes a difference on 8-bit because the
> +; coefficient is 16383 rather than 16384 (which you can get with 
> shifting).
>  por m1, m8, m13
>  por m1, m12
>  por m1, [blockq+ 16]   ; { row[1] }[0-7]
> @@ -293,8 +297,6 @@
>  por  m9, m6
>  pand m10, m5
>  por  m10, m6
> -pand m3, m5
> -por  m3, m6
>  %else
>  IDCT_1D %1, %2
>  %endif
> 

Now I see where these went.  I've moved these to the previous commit
which added the DC-only hack and as I said earlier I will push that one
soon.

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


Re: [FFmpeg-devel] [PATCH 08/11] avcodec/x86: allow future 8-bit simple idct to use slightly different coefficients

2017-06-20 Thread James Darnley
On 2017-06-20 13:55, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Jun 19, 2017 at 11:11 AM, James Darnley  wrote:
> 
>> ---
>>  libavcodec/x86/proresdsp.asm  | 18 ++
>>  libavcodec/x86/simple_idct10.asm  | 29
>> +
>>  libavcodec/x86/simple_idct10_template.asm | 19 +++
>>  3 files changed, 50 insertions(+), 16 deletions(-)
> 
> 
> LGTM.
> 
> Ronald

Thank you, pushed.

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


Re: [FFmpeg-devel] [PATCH] mdec: use correctly permutated quant matrix for dequantization.

2017-06-20 Thread James Darnley
On 2017-06-20 18:16, Ronald S. Bultje wrote:
> On Tue, Jun 20, 2017 at 12:04 PM, James Darnley  wrote:
>>> @@ -231,6 +230,13 @@ static av_cold int decode_init(AVCodecContext
>> *avctx)
>>>  avctx->pix_fmt  = AV_PIX_FMT_YUVJ420P;
>>>  avctx->color_range = AVCOL_RANGE_JPEG;
>>>
>>> +/* init q matrix */
>>> +for (i = 0; i < 64; i++) {
>>> +int j = a->idsp.idct_permutation[i];
>>> +
>>> +a->quant_matrix[j] = ff_mpeg1_default_intra_matrix[i];
>>> +}
>>> +
>>>  return 0;
>>>  }
>>>
>>>
>>
>> That patch seems to work.  FATE doesn't complain when I apply on top of
>> my others after dropping the one Michael complained about.  That is what
>> it was supposed to do, right?
> 
> 
> Yes, it's intended to be an alternative to that patch, based on Michael's
> review/comments.

Good.  Are you going to push it?  Do you want me to?  Are you waiting
for something else?

>>> @@ -212,9 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
>>>  static av_cold int decode_init(AVCodecContext *avctx)
>>>  {
>>>  MDECContext * const a = avctx->priv_data;
>>> -
>>> -if (avctx->idct_algo == FF_IDCT_AUTO)
>>> -avctx->idct_algo = FF_IDCT_SIMPLE;
>>> +int i;
>>>
>>>  a->mb_width  = (avctx->coded_width  + 15) / 16;
>>>  a->mb_height = (avctx->coded_height + 15) / 16;

I have just one suggestion to make this time.  I think you should
mention that you remove the idct override in the commit message.

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


Re: [FFmpeg-devel] [PATCH] mdec: use correctly permutated quant matrix for dequantization.

2017-06-20 Thread Ronald S. Bultje
Hi,

On Tue, Jun 20, 2017 at 12:04 PM, James Darnley  wrote:

> On 2017-06-20 14:47, Ronald S. Bultje wrote:
> > This allows using non-simple (e.g. simplemmx) IDCT implementations.
> > The result is not bitexact (which is why the fate test continues to
> > use -idct simple), but the PSNR between C/MMX goes from ~35 to ~90.
> > ---
> >  libavcodec/mdec.c | 14 ++
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
> > index 97bfebb..59658b3 100644
> > --- a/libavcodec/mdec.c
> > +++ b/libavcodec/mdec.c
> > @@ -49,6 +49,7 @@ typedef struct MDECContext {
> >  int mb_height;
> >  int mb_x, mb_y;
> >  DECLARE_ALIGNED(16, int16_t, block)[6][64];
> > +DECLARE_ALIGNED(16, uint16_t, quant_matrix)[64];
> >  uint8_t *bitstream_buffer;
> >  unsigned int bitstream_buffer_size;
> >  int block_last_index[6];
> > @@ -61,7 +62,7 @@ static inline int mdec_decode_block_intra(MDECContext
> *a, int16_t *block, int n)
> >  int component;
> >  RLTable *rl = &ff_rl_mpeg1;
> >  uint8_t * const scantable = a->scantable.permutated;
> > -const uint16_t *quant_matrix = ff_mpeg1_default_intra_matrix;
> > +const uint16_t *quant_matrix = a->quant_matrix;
> >  const int qscale = a->qscale;
> >
> >  /* DC coefficient */
> > @@ -212,9 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
> >  static av_cold int decode_init(AVCodecContext *avctx)
> >  {
> >  MDECContext * const a = avctx->priv_data;
> > -
> > -if (avctx->idct_algo == FF_IDCT_AUTO)
> > -avctx->idct_algo = FF_IDCT_SIMPLE;
> > +int i;
> >
> >  a->mb_width  = (avctx->coded_width  + 15) / 16;
> >  a->mb_height = (avctx->coded_height + 15) / 16;
> > @@ -231,6 +230,13 @@ static av_cold int decode_init(AVCodecContext
> *avctx)
> >  avctx->pix_fmt  = AV_PIX_FMT_YUVJ420P;
> >  avctx->color_range = AVCOL_RANGE_JPEG;
> >
> > +/* init q matrix */
> > +for (i = 0; i < 64; i++) {
> > +int j = a->idsp.idct_permutation[i];
> > +
> > +a->quant_matrix[j] = ff_mpeg1_default_intra_matrix[i];
> > +}
> > +
> >  return 0;
> >  }
> >
> >
>
> That patch seems to work.  FATE doesn't complain when I apply on top of
> my others after dropping the one Michael complained about.  That is what
> it was supposed to do, right?


Yes, it's intended to be an alternative to that patch, based on Michael's
review/comments.

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


Re: [FFmpeg-devel] [PATCH] mdec: use correctly permutated quant matrix for dequantization.

2017-06-20 Thread James Darnley
On 2017-06-20 14:47, Ronald S. Bultje wrote:
> This allows using non-simple (e.g. simplemmx) IDCT implementations.
> The result is not bitexact (which is why the fate test continues to
> use -idct simple), but the PSNR between C/MMX goes from ~35 to ~90.
> ---
>  libavcodec/mdec.c | 14 ++
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
> index 97bfebb..59658b3 100644
> --- a/libavcodec/mdec.c
> +++ b/libavcodec/mdec.c
> @@ -49,6 +49,7 @@ typedef struct MDECContext {
>  int mb_height;
>  int mb_x, mb_y;
>  DECLARE_ALIGNED(16, int16_t, block)[6][64];
> +DECLARE_ALIGNED(16, uint16_t, quant_matrix)[64];
>  uint8_t *bitstream_buffer;
>  unsigned int bitstream_buffer_size;
>  int block_last_index[6];
> @@ -61,7 +62,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, 
> int16_t *block, int n)
>  int component;
>  RLTable *rl = &ff_rl_mpeg1;
>  uint8_t * const scantable = a->scantable.permutated;
> -const uint16_t *quant_matrix = ff_mpeg1_default_intra_matrix;
> +const uint16_t *quant_matrix = a->quant_matrix;
>  const int qscale = a->qscale;
>  
>  /* DC coefficient */
> @@ -212,9 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
>  static av_cold int decode_init(AVCodecContext *avctx)
>  {
>  MDECContext * const a = avctx->priv_data;
> -
> -if (avctx->idct_algo == FF_IDCT_AUTO)
> -avctx->idct_algo = FF_IDCT_SIMPLE;
> +int i;
>  
>  a->mb_width  = (avctx->coded_width  + 15) / 16;
>  a->mb_height = (avctx->coded_height + 15) / 16;
> @@ -231,6 +230,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
>  avctx->pix_fmt  = AV_PIX_FMT_YUVJ420P;
>  avctx->color_range = AVCOL_RANGE_JPEG;
>  
> +/* init q matrix */
> +for (i = 0; i < 64; i++) {
> +int j = a->idsp.idct_permutation[i];
> +
> +a->quant_matrix[j] = ff_mpeg1_default_intra_matrix[i];
> +}
> +
>  return 0;
>  }
>  
> 

That patch seems to work.  FATE doesn't complain when I apply on top of
my others after dropping the one Michael complained about.  That is what
it was supposed to do, right?

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


Re: [FFmpeg-devel] [PATCH 09/11] avcodec/x86: allow future 8-bit simple idct to have "DC only hack"

2017-06-20 Thread James Darnley
On 2017-06-20 13:56, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Jun 19, 2017 at 11:11 AM, James Darnley  wrote:
> 
>> Created by Ronald S. Bultje
>> ---
>>  libavcodec/x86/simple_idct10_template.asm | 38
>> +++
>>  1 file changed, 38 insertions(+)
>>
>> diff --git a/libavcodec/x86/simple_idct10_template.asm
>> b/libavcodec/x86/simple_idct10_template.asm
>> index d8ea0bcc6b..51baf84c82 100644
>> --- a/libavcodec/x86/simple_idct10_template.asm
>> +++ b/libavcodec/x86/simple_idct10_template.asm
>> @@ -257,6 +257,44 @@
>>  pmullw  m12,[%8+96]
>>
>>  IDCT_1D %1, %2, %8
>> +%elif %2 == 11
>> +por m1, m8, m13
>> +por m1, m12
>> +por m1, [blockq+ 16]   ; { row[1] }[0-7]
>> +por m1, [blockq+ 48]   ; { row[3] }[0-7]
>> +por m1, [blockq+ 80]   ; { row[5] }[0-7]
>> +por m1, [blockq+112]   ; { row[7] }[0-7]
>> +pxorm2, m2
>> +pcmpeqw m1, m2
>> +psllw   m2, m10, 3
>> +pandm2, m1
>> +pcmpeqb m3, m3
>> +pxorm1, m3
>> +mova[rsp], m1
>> +mova[rsp+16], m2
>> +
>> +IDCT_1D %1, %2
>> +
>> +mova m5, [rsp]
>> +mova m6, [rsp+16]
>> +pand m8, m5
>> +por  m8, m6
>> +pand m0, m5
>> +por  m0, m6
>> +pand m1, m5
>> +por  m1, m6
>> +pand m2, m5
>> +por  m2, m6
>> +pand m4, m5
>> +por  m4, m6
>> +pand m11, m5
>> +por  m11, m6
>> +pand m9, m5
>> +por  m9, m6
>> +pand m10, m5
>> +por  m10, m6
>> +pand m3, m5
>> +por  m3, m6
>>  %else
> 
> 
> Can you fix the indentation while you push it? LGTM.

Done.  I also removed the redundant use of m3, again.  I swear that's
the 3rd time I've done that change.

Will push shortly.

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


Re: [FFmpeg-devel] [PATCH] Add FITS Decoder

2017-06-20 Thread Paras Chadha
On Tue, Jun 20, 2017 at 2:44 PM, Paul B Mahol  wrote:

> On 6/19/17, Paras Chadha  wrote:
> > Added support for XTENSION keyword
> >
> > Signed-off-by: Paras Chadha 
> > ---
> >  Changelog   |   1 +
> >  doc/general.texi|   2 +
> >  libavcodec/Makefile |   1 +
> >  libavcodec/allcodecs.c  |   1 +
> >  libavcodec/avcodec.h|   1 +
> >  libavcodec/codec_desc.c |   8 +
> >  libavcodec/fitsdec.c| 518
> > 
> >  libavcodec/version.h|   2 +-
> >  libavformat/img2.c  |   1 +
> >  9 files changed, 534 insertions(+), 1 deletion(-)
> >  create mode 100644 libavcodec/fitsdec.c
> >
> > diff --git a/Changelog b/Changelog
> > index a893efa..a07644c 100644
> > --- a/Changelog
> > +++ b/Changelog
> > @@ -22,6 +22,7 @@ version :
> >  - headphone audio filter
> >  - superequalizer audio filter
> >  - roberts video filter
> > +- FITS decoder
> >
> >  version 3.3:
> >  - CrystalHD decoder moved to new decode API
> > diff --git a/doc/general.texi b/doc/general.texi
> > index 8f582d5..c00ce32 100644
> > --- a/doc/general.texi
> > +++ b/doc/general.texi
> > @@ -591,6 +591,8 @@ following image formats are supported:
> >  @tab Digital Picture Exchange
> >  @item EXR  @tab   @tab X
> >  @tab OpenEXR
> > +@item FITS @tab   @tab X
> > +@tab Flexible Image Transport System
> >  @item JPEG @tab X @tab X
> >  @tab Progressive JPEG is not supported.
> >  @item JPEG 2000@tab X @tab X
> > diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> > index 2e7f19d..2cfd1fe 100644
> > --- a/libavcodec/Makefile
> > +++ b/libavcodec/Makefile
> > @@ -291,6 +291,7 @@ OBJS-$(CONFIG_FFV1_DECODER)+= ffv1dec.o
> > ffv1.o
> >  OBJS-$(CONFIG_FFV1_ENCODER)+= ffv1enc.o ffv1.o
> >  OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
> >  OBJS-$(CONFIG_FIC_DECODER) += fic.o
> > +OBJS-$(CONFIG_FITS_DECODER)+= fitsdec.o
> >  OBJS-$(CONFIG_FLAC_DECODER)+= flacdec.o flacdata.o flac.o
> >  OBJS-$(CONFIG_FLAC_ENCODER)+= flacenc.o flacdata.o flac.o
> > vorbis_data.o
> >  OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
> > diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> > index 27110e1..8a89264 100644
> > --- a/libavcodec/allcodecs.c
> > +++ b/libavcodec/allcodecs.c
> > @@ -186,6 +186,7 @@ static void register_all(void)
> >  REGISTER_ENCDEC (FFV1,  ffv1);
> >  REGISTER_ENCDEC (FFVHUFF,   ffvhuff);
> >  REGISTER_DECODER(FIC,   fic);
> > +REGISTER_DECODER(FITS,  fits);
> >  REGISTER_ENCDEC (FLASHSV,   flashsv);
> >  REGISTER_ENCDEC (FLASHSV2,  flashsv2);
> >  REGISTER_DECODER(FLIC,  flic);
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > index 39be8cf..1310426 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -447,6 +447,7 @@ enum AVCodecID {
> >  AV_CODEC_ID_SRGC,
> >  AV_CODEC_ID_SVG,
> >  AV_CODEC_ID_GDV,
> > +AV_CODEC_ID_FITS,
> >
> >  /* various PCM "codecs" */
> >  AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at
> the
> > start of audio codecs
> > diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> > index cf1246e..0112517 100644
> > --- a/libavcodec/codec_desc.c
> > +++ b/libavcodec/codec_desc.c
> > @@ -1464,6 +1464,14 @@ static const AVCodecDescriptor
> codec_descriptors[] =
> > {
> >   AV_CODEC_PROP_LOSSLESS,
> >  },
> >  {
> > +.id= AV_CODEC_ID_FITS,
> > +.type  = AVMEDIA_TYPE_VIDEO,
> > +.name  = "fits",
> > +.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport
> > System"),
> > +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
> > + AV_CODEC_PROP_LOSSLESS,
> > +},
> > +{
> >  .id= AV_CODEC_ID_GIF,
> >  .type  = AVMEDIA_TYPE_VIDEO,
> >  .name  = "gif",
> > diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c
> > new file mode 100644
> > index 000..4e80936
> > --- /dev/null
> > +++ b/libavcodec/fitsdec.c
> > @@ -0,0 +1,518 @@
> > +/*
> > + * FITS image decoder
> > + * Copyright (c) 2017 Paras Chadha
> > + *
> > + * 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 Pub

[FFmpeg-devel] [PATCH] Add FITS Decoder

2017-06-20 Thread Paras Chadha
Above changes done. Also fixed an issue with BLANK keyword.

Signed-off-by: Paras Chadha 
---
 Changelog   |   1 +
 doc/general.texi|   2 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   8 +
 libavcodec/fitsdec.c| 517 
 libavcodec/version.h|   2 +-
 libavformat/img2.c  |   1 +
 9 files changed, 533 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/fitsdec.c

diff --git a/Changelog b/Changelog
index a893efa..a07644c 100644
--- a/Changelog
+++ b/Changelog
@@ -22,6 +22,7 @@ version :
 - headphone audio filter
 - superequalizer audio filter
 - roberts video filter
+- FITS decoder

 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/doc/general.texi b/doc/general.texi
index 8f582d5..c00ce32 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -591,6 +591,8 @@ following image formats are supported:
 @tab Digital Picture Exchange
 @item EXR  @tab   @tab X
 @tab OpenEXR
+@item FITS @tab   @tab X
+@tab Flexible Image Transport System
 @item JPEG @tab X @tab X
 @tab Progressive JPEG is not supported.
 @item JPEG 2000@tab X @tab X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 2e7f19d..2cfd1fe 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -291,6 +291,7 @@ OBJS-$(CONFIG_FFV1_DECODER)+= ffv1dec.o ffv1.o
 OBJS-$(CONFIG_FFV1_ENCODER)+= ffv1enc.o ffv1.o
 OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
 OBJS-$(CONFIG_FIC_DECODER) += fic.o
+OBJS-$(CONFIG_FITS_DECODER)+= fitsdec.o
 OBJS-$(CONFIG_FLAC_DECODER)+= flacdec.o flacdata.o flac.o
 OBJS-$(CONFIG_FLAC_ENCODER)+= flacenc.o flacdata.o flac.o 
vorbis_data.o
 OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 27110e1..8a89264 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -186,6 +186,7 @@ static void register_all(void)
 REGISTER_ENCDEC (FFV1,  ffv1);
 REGISTER_ENCDEC (FFVHUFF,   ffvhuff);
 REGISTER_DECODER(FIC,   fic);
+REGISTER_DECODER(FITS,  fits);
 REGISTER_ENCDEC (FLASHSV,   flashsv);
 REGISTER_ENCDEC (FLASHSV2,  flashsv2);
 REGISTER_DECODER(FLIC,  flic);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 39be8cf..1310426 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -447,6 +447,7 @@ enum AVCodecID {
 AV_CODEC_ID_SRGC,
 AV_CODEC_ID_SVG,
 AV_CODEC_ID_GDV,
+AV_CODEC_ID_FITS,

 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index cf1246e..0112517 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1464,6 +1464,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
  AV_CODEC_PROP_LOSSLESS,
 },
 {
+.id= AV_CODEC_ID_FITS,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "fits",
+.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
+ AV_CODEC_PROP_LOSSLESS,
+},
+{
 .id= AV_CODEC_ID_GIF,
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "gif",
diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c
new file mode 100644
index 000..4ad2596
--- /dev/null
+++ b/libavcodec/fitsdec.c
@@ -0,0 +1,517 @@
+/*
+ * FITS image decoder
+ * Copyright (c) 2017 Paras Chadha
+ *
+ * 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
+ * FITS image decoder
+ * It supports all 2-d images alongwith, bzero, bscale and blank keywords.
+ * RGBA images are supported as NAXIS3 = 3 or 4 i.e. Planes in RGBA order. 
Also CTYPE = 'RGB ' should be present.
+ * Also to interpret data, values are linearly scaled using min-max scaling 
but not RGB images.
+ */
+
+#include "avcodec.h"
+#include "internal.h"
+#include 
+#include "lib

Re: [FFmpeg-devel] Requesting push access to FFmpeg repo

2017-06-20 Thread James Almer
On 6/20/2017 8:36 AM, Hendrik Leppkes wrote:
> On Tue, Jun 20, 2017 at 1:14 PM, Michael Niedermayer
>  wrote:
>> On Tue, Jun 20, 2017 at 05:30:05AM +, Kevin Mark wrote:
>>> Ronald Bultje via IRC recommended I ask on the mailing list for push access
>>> to the FFmpeg repository so that I may push my own patches once approved.
>>> If someone with the access to do so could please consider this request it
>>> would be greatly appreciated.
>>
>> If you want push access, please send a patch that adds you to the
>> MAINTAINERs file
>> after the patch has been applied, you get push access
>>
>> (by going throgh this extra step changes to the git access list are
>>  public, are logged and allow people to comment/veto ...)
>>
> 
> Personally I think people that have been around like a month should
> perhaps excercise some more patience while they get more familiar with
> our codebase and our workflows. :)
> 
> - Hendrik

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


[FFmpeg-devel] [job] trim based on pic_timing SEI

2017-06-20 Thread David Holroyd
Hi there,

I have been looking at using ffmpeg to trim and reencode some source
content, and to use the clockTimestamp fields from the pic_timing SEI
header as the basis of finding the correct start frame for the trimmed
output.

If I am correct in thinking this is not currently possible with
ffmpeg, would anybody be interested in taking on a contract to make
this work?  If so, please contact me directly with an indication of
your availability.


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


Re: [FFmpeg-devel] [PATCH 10/11] avcodec/x86: add an 8-bit simple IDCT function based on the x86-64 high depth functions

2017-06-20 Thread Ronald S. Bultje
Hi,

On Mon, Jun 19, 2017 at 4:32 PM, Michael Niedermayer  wrote:

> On Mon, Jun 19, 2017 at 05:11:03PM +0200, James Darnley wrote:
> > Includes add/put functions
> >
> > Rounding contributed by Ronald S. Bultje
> > ---
> >  libavcodec/tests/x86/dct.c|  2 +
> >  libavcodec/x86/idctdsp_init.c | 23 
> >  libavcodec/x86/simple_idct.h  |  9 +++
> >  libavcodec/x86/simple_idct10.asm  | 92
> +++
> >  libavcodec/x86/simple_idct10_template.asm |  6 +-
> >  5 files changed, 130 insertions(+), 2 deletions(-)
>
> this changes the output of:
> ./ffmpeg -an -i ~/tickets/4400/cartest_supers.mov -flags +bitexact
> out-ref.avi
>
> ls -alF out-ref.avi out.avi
> -rw-r- 1 michael michael 761042 Jun 19 22:29 out.avi
> -rw-r- 1 michael michael 761044 Jun 19 22:29 out-ref.avi


This is because you're comparing the non-bitexact mmx IDCT (which is
enabled even if the bitexact flag is set) with the bitexact sse2 IDCT.

Compare (without this patch) the C IDCT ("simple"):

./ffmpeg -an -i ~/Downloads/cartest_supers.mov -idct simple -flags
+bitexact /tmp/out-ref-simple.avi
-rw-r--r--  1 ronaldbultje  wheel  831994 Jun 20 08:56
/tmp/out-ref-simple.avi

with the MMX IDCT ("simplemmx", which is selected by "auto" and enabled by
default):

./ffmpeg -an -i ~/Downloads/cartest_supers.mov -flags +bitexact
/tmp/out-ref.avi
or
./ffmpeg -an -i ~/Downloads/cartest_supers.mov -idct simplemmx -flags
+bitexact /tmp/out-ref.avi
or
./ffmpeg -an -i ~/Downloads/cartest_supers.mov -idct simpleauto -flags
+bitexact /tmp/out-ref.avi
or
./ffmpeg -an -i ~/Downloads/cartest_supers.mov -idct auto -flags +bitexact
/tmp/out-ref.avi
-rw-r--r--  1 ronaldbultje  wheel  831998 Jun 20 08:54 /tmp/out-ref.avi

After this patch, all of these (simplemmx, simpleauto, simple, auto) will
refer to SSE2 instead of MMX, thus making their results identical to the C
version again.

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


[FFmpeg-devel] [PATCH] mdec: use correctly permutated quant matrix for dequantization.

2017-06-20 Thread Ronald S. Bultje
This allows using non-simple (e.g. simplemmx) IDCT implementations.
The result is not bitexact (which is why the fate test continues to
use -idct simple), but the PSNR between C/MMX goes from ~35 to ~90.
---
 libavcodec/mdec.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 97bfebb..59658b3 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -49,6 +49,7 @@ typedef struct MDECContext {
 int mb_height;
 int mb_x, mb_y;
 DECLARE_ALIGNED(16, int16_t, block)[6][64];
+DECLARE_ALIGNED(16, uint16_t, quant_matrix)[64];
 uint8_t *bitstream_buffer;
 unsigned int bitstream_buffer_size;
 int block_last_index[6];
@@ -61,7 +62,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, 
int16_t *block, int n)
 int component;
 RLTable *rl = &ff_rl_mpeg1;
 uint8_t * const scantable = a->scantable.permutated;
-const uint16_t *quant_matrix = ff_mpeg1_default_intra_matrix;
+const uint16_t *quant_matrix = a->quant_matrix;
 const int qscale = a->qscale;
 
 /* DC coefficient */
@@ -212,9 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
 static av_cold int decode_init(AVCodecContext *avctx)
 {
 MDECContext * const a = avctx->priv_data;
-
-if (avctx->idct_algo == FF_IDCT_AUTO)
-avctx->idct_algo = FF_IDCT_SIMPLE;
+int i;
 
 a->mb_width  = (avctx->coded_width  + 15) / 16;
 a->mb_height = (avctx->coded_height + 15) / 16;
@@ -231,6 +230,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
 avctx->pix_fmt  = AV_PIX_FMT_YUVJ420P;
 avctx->color_range = AVCOL_RANGE_JPEG;
 
+/* init q matrix */
+for (i = 0; i < 64; i++) {
+int j = a->idsp.idct_permutation[i];
+
+a->quant_matrix[j] = ff_mpeg1_default_intra_matrix[i];
+}
+
 return 0;
 }
 
-- 
2.8.1

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


Re: [FFmpeg-devel] [PATCH 03/11] avcodec/mdec: override IDCT choice before initing DSP structs

2017-06-20 Thread Ronald S. Bultje
Hi,

On Mon, Jun 19, 2017 at 2:05 PM, Ronald S. Bultje 
wrote:

> Hi,
>
> On Mon, Jun 19, 2017 at 11:10 AM, James Darnley  wrote:
>
>> ---
>>  libavcodec/mdec.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
>> index 8e28aa04f0..97bfebbeb7 100644
>> --- a/libavcodec/mdec.c
>> +++ b/libavcodec/mdec.c
>> @@ -213,6 +213,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
>>  {
>>  MDECContext * const a = avctx->priv_data;
>>
>> +if (avctx->idct_algo == FF_IDCT_AUTO)
>> +avctx->idct_algo = FF_IDCT_SIMPLE;
>> +
>>  a->mb_width  = (avctx->coded_width  + 15) / 16;
>>  a->mb_height = (avctx->coded_height + 15) / 16;
>>
>> @@ -225,8 +228,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
>>  ff_init_scantable(a->idsp.idct_permutation, &a->scantable,
>>ff_zigzag_direct);
>>
>> -if (avctx->idct_algo == FF_IDCT_AUTO)
>> -avctx->idct_algo = FF_IDCT_SIMPLE;
>>  avctx->pix_fmt  = AV_PIX_FMT_YUVJ420P;
>>  avctx->color_range = AVCOL_RANGE_JPEG;
>>
>> --
>> 2.13.1
>
>
> Can we use per-codec defaults to accomplish this?
>

I'm not actually sure this is a good idea, because it changes the meaning
of _AUTO slightly. Patch is OK as-is.

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


Re: [FFmpeg-devel] [PATCH 09/11] avcodec/x86: allow future 8-bit simple idct to have "DC only hack"

2017-06-20 Thread Ronald S. Bultje
Hi,

On Mon, Jun 19, 2017 at 11:11 AM, James Darnley  wrote:

> Created by Ronald S. Bultje
> ---
>  libavcodec/x86/simple_idct10_template.asm | 38
> +++
>  1 file changed, 38 insertions(+)
>
> diff --git a/libavcodec/x86/simple_idct10_template.asm
> b/libavcodec/x86/simple_idct10_template.asm
> index d8ea0bcc6b..51baf84c82 100644
> --- a/libavcodec/x86/simple_idct10_template.asm
> +++ b/libavcodec/x86/simple_idct10_template.asm
> @@ -257,6 +257,44 @@
>  pmullw  m12,[%8+96]
>
>  IDCT_1D %1, %2, %8
> +%elif %2 == 11
> +por m1, m8, m13
> +por m1, m12
> +por m1, [blockq+ 16]   ; { row[1] }[0-7]
> +por m1, [blockq+ 48]   ; { row[3] }[0-7]
> +por m1, [blockq+ 80]   ; { row[5] }[0-7]
> +por m1, [blockq+112]   ; { row[7] }[0-7]
> +pxorm2, m2
> +pcmpeqw m1, m2
> +psllw   m2, m10, 3
> +pandm2, m1
> +pcmpeqb m3, m3
> +pxorm1, m3
> +mova[rsp], m1
> +mova[rsp+16], m2
> +
> +IDCT_1D %1, %2
> +
> +mova m5, [rsp]
> +mova m6, [rsp+16]
> +pand m8, m5
> +por  m8, m6
> +pand m0, m5
> +por  m0, m6
> +pand m1, m5
> +por  m1, m6
> +pand m2, m5
> +por  m2, m6
> +pand m4, m5
> +por  m4, m6
> +pand m11, m5
> +por  m11, m6
> +pand m9, m5
> +por  m9, m6
> +pand m10, m5
> +por  m10, m6
> +pand m3, m5
> +por  m3, m6
>  %else


Can you fix the indentation while you push it? LGTM.

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


Re: [FFmpeg-devel] [PATCH 08/11] avcodec/x86: allow future 8-bit simple idct to use slightly different coefficients

2017-06-20 Thread Ronald S. Bultje
Hi,

On Mon, Jun 19, 2017 at 11:11 AM, James Darnley  wrote:

> ---
>  libavcodec/x86/proresdsp.asm  | 18 ++
>  libavcodec/x86/simple_idct10.asm  | 29
> +
>  libavcodec/x86/simple_idct10_template.asm | 19 +++
>  3 files changed, 50 insertions(+), 16 deletions(-)


LGTM.

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


Re: [FFmpeg-devel] [PATCH 07/11] avcodec/x86: modify simple_idct10 macros to add an action paramter

2017-06-20 Thread James Darnley
On 2017-06-19 20:31, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Jun 19, 2017 at 11:11 AM, James Darnley  wrote:
> 
>> ---
>>  libavcodec/x86/proresdsp.asm  |  2 +-
>>  libavcodec/x86/simple_idct10.asm  |  8 +++
>>  libavcodec/x86/simple_idct10_template.asm | 37
>> +--
>>  3 files changed, 25 insertions(+), 22 deletions(-)
> 
> 
> LGTM.
> 
> Ronald

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH 06/11] avcodec/x86: cleanup simple_idct10

2017-06-20 Thread James Darnley
On 2017-06-19 20:30, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Jun 19, 2017 at 11:10 AM, James Darnley  wrote:
> 
>> Use named arguments for the functions so we can remove a define.  The
>> stride/linesize argument is now ptrdiff_t type so we no longer need to
>> sign extend the register.
>> ---
>>  libavcodec/x86/proresdsp.asm  |  2 +-
>>  libavcodec/x86/simple_idct10.asm  |  8 ++--
>>  libavcodec/x86/simple_idct10_template.asm | 80
>> ++-
>>  3 files changed, 41 insertions(+), 49 deletions(-)
> 
> 
> LGTM.
> 
> Ronald

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH] avcodec/lpc: signed integer overflow in compute_lpc_coefs() (aacdec_fixed)

2017-06-20 Thread Michael Niedermayer
On Thu, Jun 15, 2017 at 02:17:36AM +0200, Michael Niedermayer wrote:
> Fixes: runtime error: signed integer overflow: -1575818955 + -915383657 
> cannot be represented in type 'int'
> Fixes: 2224/clusterfuzz-testcase-minimized-6208559949807616
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/lpc.h | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)

applied

[...]
-- 
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] Requesting push access to FFmpeg repo

2017-06-20 Thread Hendrik Leppkes
On Tue, Jun 20, 2017 at 1:14 PM, Michael Niedermayer
 wrote:
> On Tue, Jun 20, 2017 at 05:30:05AM +, Kevin Mark wrote:
>> Ronald Bultje via IRC recommended I ask on the mailing list for push access
>> to the FFmpeg repository so that I may push my own patches once approved.
>> If someone with the access to do so could please consider this request it
>> would be greatly appreciated.
>
> If you want push access, please send a patch that adds you to the
> MAINTAINERs file
> after the patch has been applied, you get push access
>
> (by going throgh this extra step changes to the git access list are
>  public, are logged and allow people to comment/veto ...)
>

Personally I think people that have been around like a month should
perhaps excercise some more patience while they get more familiar with
our codebase and our workflows. :)

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


Re: [FFmpeg-devel] Requesting push access to FFmpeg repo

2017-06-20 Thread Michael Niedermayer
On Tue, Jun 20, 2017 at 05:30:05AM +, Kevin Mark wrote:
> Ronald Bultje via IRC recommended I ask on the mailing list for push access
> to the FFmpeg repository so that I may push my own patches once approved.
> If someone with the access to do so could please consider this request it
> would be greatly appreciated.

If you want push access, please send a patch that adds you to the
MAINTAINERs file
after the patch has been applied, you get push access

(by going throgh this extra step changes to the git access list are
 public, are logged and allow people to comment/veto ...)

thx

[...]
-- 
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 02/11] avcodec/x86/mpegenc: support transpose permuation type

2017-06-20 Thread James Darnley
On 2017-06-19 18:30, Michael Niedermayer wrote:
> On Mon, Jun 19, 2017 at 05:10:55PM +0200, James Darnley wrote:
>> ---
>>  libavcodec/x86/mpegvideoenc_template.c | 47 
>> +-
>>  1 file changed, 46 insertions(+), 1 deletion(-)
> 
> LGTM
> 
> thx

You're welcome.  Thanks for quickly identifying where the problem was.
To answer your question from the last time I posted these two: there is
no measurable speed loss from the extra else-if branch.

If nobody raises an objection soon, very soon, I will push these first 2
patches.

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


Re: [FFmpeg-devel] [PATCH 05/11] avcodec/mpegenc: do not use unquantize shortcuts for wmv1

2017-06-20 Thread James Darnley
On 2017-06-20 00:08, Michael Niedermayer wrote:
> On Mon, Jun 19, 2017 at 05:10:58PM +0200, James Darnley wrote:
>> From: "Ronald S. Bultje" 
>>
>> Commit message by James Darnley
>>
>> The shortcut is based on end-of-block positions.  This leads to some
>> coefficients not being unquantized.  This is the symptom of the bug.
>>
> 
>> A possible candidate for the real bug is the scan table used here in
>> unquantize does not appear to match the one used in wmv1.  That might be
>> because h263_unquantize_intra uses the inter scan table.
> 
> changed it to intra, i hope this makes this patch here unneeded

Yes it does appear to be unneeded.  Thank you.

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


Re: [FFmpeg-devel] [PATCH] Add FITS Decoder

2017-06-20 Thread Paul B Mahol
On 6/19/17, Paras Chadha  wrote:
> Added support for XTENSION keyword
>
> Signed-off-by: Paras Chadha 
> ---
>  Changelog   |   1 +
>  doc/general.texi|   2 +
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/avcodec.h|   1 +
>  libavcodec/codec_desc.c |   8 +
>  libavcodec/fitsdec.c| 518
> 
>  libavcodec/version.h|   2 +-
>  libavformat/img2.c  |   1 +
>  9 files changed, 534 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/fitsdec.c
>
> diff --git a/Changelog b/Changelog
> index a893efa..a07644c 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -22,6 +22,7 @@ version :
>  - headphone audio filter
>  - superequalizer audio filter
>  - roberts video filter
> +- FITS decoder
>
>  version 3.3:
>  - CrystalHD decoder moved to new decode API
> diff --git a/doc/general.texi b/doc/general.texi
> index 8f582d5..c00ce32 100644
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -591,6 +591,8 @@ following image formats are supported:
>  @tab Digital Picture Exchange
>  @item EXR  @tab   @tab X
>  @tab OpenEXR
> +@item FITS @tab   @tab X
> +@tab Flexible Image Transport System
>  @item JPEG @tab X @tab X
>  @tab Progressive JPEG is not supported.
>  @item JPEG 2000@tab X @tab X
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 2e7f19d..2cfd1fe 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -291,6 +291,7 @@ OBJS-$(CONFIG_FFV1_DECODER)+= ffv1dec.o
> ffv1.o
>  OBJS-$(CONFIG_FFV1_ENCODER)+= ffv1enc.o ffv1.o
>  OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
>  OBJS-$(CONFIG_FIC_DECODER) += fic.o
> +OBJS-$(CONFIG_FITS_DECODER)+= fitsdec.o
>  OBJS-$(CONFIG_FLAC_DECODER)+= flacdec.o flacdata.o flac.o
>  OBJS-$(CONFIG_FLAC_ENCODER)+= flacenc.o flacdata.o flac.o
> vorbis_data.o
>  OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 27110e1..8a89264 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -186,6 +186,7 @@ static void register_all(void)
>  REGISTER_ENCDEC (FFV1,  ffv1);
>  REGISTER_ENCDEC (FFVHUFF,   ffvhuff);
>  REGISTER_DECODER(FIC,   fic);
> +REGISTER_DECODER(FITS,  fits);
>  REGISTER_ENCDEC (FLASHSV,   flashsv);
>  REGISTER_ENCDEC (FLASHSV2,  flashsv2);
>  REGISTER_DECODER(FLIC,  flic);
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 39be8cf..1310426 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -447,6 +447,7 @@ enum AVCodecID {
>  AV_CODEC_ID_SRGC,
>  AV_CODEC_ID_SVG,
>  AV_CODEC_ID_GDV,
> +AV_CODEC_ID_FITS,
>
>  /* various PCM "codecs" */
>  AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the
> start of audio codecs
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index cf1246e..0112517 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -1464,6 +1464,14 @@ static const AVCodecDescriptor codec_descriptors[] =
> {
>   AV_CODEC_PROP_LOSSLESS,
>  },
>  {
> +.id= AV_CODEC_ID_FITS,
> +.type  = AVMEDIA_TYPE_VIDEO,
> +.name  = "fits",
> +.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport
> System"),
> +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
> + AV_CODEC_PROP_LOSSLESS,
> +},
> +{
>  .id= AV_CODEC_ID_GIF,
>  .type  = AVMEDIA_TYPE_VIDEO,
>  .name  = "gif",
> diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c
> new file mode 100644
> index 000..4e80936
> --- /dev/null
> +++ b/libavcodec/fitsdec.c
> @@ -0,0 +1,518 @@
> +/*
> + * FITS image decoder
> + * Copyright (c) 2017 Paras Chadha
> + *
> + * 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
> + * FITS image decoder
> + * It supports all 2-d images alongwith, bzero, bscale and blank keywords.
> + * RGBA images are

Re: [FFmpeg-devel] [PATCH] libavcodec/htmlsubtitles: skip newline characters at the beginning of the subtitle

2017-06-20 Thread wm4
On Fri, 16 Jun 2017 23:40:32 +0300
Evgeny Shulgin  wrote:

> > Anyway, I don't understand why this makes subtitle lines actually
> > disappear?  
> 
> Because SubRip format does not allow to have empty lines, that is:
> 
>1. Subtitle text itself on one or more lines
>2. A blank line containing no text, indicating the end of this subtitle
> 
> So, when we have '\n' at the start or two '\n'-s in a row, the code
> interrupts the recording of sub. But in this video we could get subtitles
> as "\r\n\r\n\r\nСкандинавия", and this video is played perfectly in VLC
> player like it's "Скандинавия". So we had to deal with it. Anyway, this
> .mkv was recorded successfully a couple of years ago:
> 
>   Metadata:
> encoder : libebml v1.3.0 + libmatroska v1.4.1
> creation_time   : 2015-05-30T16:56:01.00Z
> 
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 32bit built on
> Jun  9 2014 15:08:34

I could understand if this was in the .srt parser, but this is just the
srt to ass converter. Does the latter really drop anything after the
first newline?

> 
> > Most of this should probably go into the commit message  
> 
> How can I edit the patch? Send the updated patch as attachment in the emal?
> I don't see how can I do it on the patchwork site. Thanks!

Just use -v2 and maybe --in-reply-to= with the message ID.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg: remove misleading and incorrect error messages

2017-06-20 Thread wm4
On Sun, 18 Jun 2017 20:41:39 +0200
Paul B Mahol  wrote:

> On 6/15/17, wm4  wrote:
> > Those are warnings, not error messages. Fixed locally.
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >  
> 
> should be ok

Pushed with modified commit message.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel