[FFmpeg-cvslog] x86: xvid_idct: port MMX iDCT to yasm

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Tue Mar 10 23:11:52 2015 +| [c3bf52713a8485f5bcba4c37ae7373c6b67cd1eb] | 
committer: Michael Niedermayer

x86: xvid_idct: port MMX iDCT to yasm

Also reduce the table duplication with SSE2 code, remove duplicated
macro parameters.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c3bf52713a8485f5bcba4c37ae7373c6b67cd1eb
---

 libavcodec/x86/Makefile|1 -
 libavcodec/x86/dct-test.c  |8 +-
 libavcodec/x86/xvididct.asm|  450 +++-
 libavcodec/x86/xvididct_init.c |   40 ++-
 libavcodec/x86/xvididct_mmx.c  |  549 
 5 files changed, 484 insertions(+), 564 deletions(-)

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index f46c7d5..87985f2 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -73,7 +73,6 @@ MMX-OBJS-$(CONFIG_FDCTDSP) += x86/fdct.o
 MMX-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct.o
 
 # decoders/encoders
-MMX-OBJS-$(CONFIG_MPEG4_DECODER)   += x86/xvididct_mmx.o
 MMX-OBJS-$(CONFIG_SNOW_DECODER)+= x86/snowdsp.o
 MMX-OBJS-$(CONFIG_SNOW_ENCODER)+= x86/snowdsp.o
 MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index e14ce9a..3a4c0df 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -60,11 +60,9 @@ static const struct algo idct_tab_arch[] = {
 #if HAVE_MMX_INLINE
 { "SIMPLE-MMX",  ff_simple_idct_mmx,  FF_IDCT_PERM_SIMPLE, AV_CPU_FLAG_MMX 
},
 #endif
-#if CONFIG_MPEG4_DECODER
-#if HAVE_MMX_INLINE
+#if CONFIG_MPEG4_DECODER && HAVE_YASM
+#if ARCH_X86_32
 { "XVID-MMX",ff_xvid_idct_mmx,FF_IDCT_PERM_NONE,   
AV_CPU_FLAG_MMX,1 },
-#endif
-#if HAVE_MMXEXT_INLINE
 { "XVID-MMXEXT", ff_xvid_idct_mmxext, FF_IDCT_PERM_NONE,   
AV_CPU_FLAG_MMXEXT, 1 },
 #endif
 #if HAVE_SSE2_EXTERNAL
@@ -73,7 +71,7 @@ static const struct algo idct_tab_arch[] = {
 { "PR-SSE2", ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_SSE2, 1 },
 #endif
 #endif
-#endif /* CONFIG_MPEG4_DECODER */
+#endif /* CONFIG_MPEG4_DECODER && HAVE_YASM */
 { 0 }
 };
 
diff --git a/libavcodec/x86/xvididct.asm b/libavcodec/x86/xvididct.asm
index d16db34..4c52bf1 100644
--- a/libavcodec/x86/xvididct.asm
+++ b/libavcodec/x86/xvididct.asm
@@ -1,5 +1,9 @@
 ; XVID MPEG-4 VIDEO CODEC
-; - SSE2 inverse discrete cosine transform -
+;
+; Conversion from gcc syntax to x264asm syntax with modifications
+; by Christophe Gisquet 
+;
+; === SSE2 inverse discrete cosine transform ===
 ;
 ; Copyright(C) 2003 Pascal Massimino 
 ;
@@ -8,8 +12,6 @@
 ;
 ; Originally from dct/x86_asm/fdct_sse2_skal.asm in Xvid.
 ;
-; This file is part of FFmpeg.
-;
 ; Vertical pass is an implementation of the scheme:
 ;  Loeffler C., Ligtenberg A., and Moschytz C.S.:
 ;  Practical Fast 1D DCT Algorithm with Eleven Multiplications,
@@ -22,6 +24,32 @@
 ;
 ; More details at http://skal.planet-d.net/coding/dct.html
 ;
+; === MMX and XMM forward discrete cosine transform ===
+;
+; Copyright(C) 2001 Peter Ross 
+;
+; Originally provided by Intel at AP-922
+; http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
+; (See more app notes at 
http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm)
+; but in a limited edition.
+; New macro implements a column part for precise iDCT
+; The routine precision now satisfies IEEE standard 1180-1990.
+;
+; Copyright(C) 2000-2001 Peter Gubanov 
+; Rounding trick Copyright(C) 2000 Michel Lespinasse 
+;
+; http://www.elecard.com/peter/idct.html
+; http://www.linuxvideo.org/mpeg2dec/
+;
+; These examples contain code fragments for first stage iDCT 8x8
+; (for rows) and first stage DCT 8x8 (for columns)
+;
+; conversion to gcc syntax by Michael Niedermayer
+;
+; ==
+;
+; 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
@@ -39,11 +67,13 @@
 %include "libavutil/x86/x86util.asm"
 
 SECTION_RODATA
+; Similar to tg_1_16 in MMX code
 tan1:   times 8 dw 13036
 tan2:   times 8 dw 27146
 tan3:   times 8 dw 43790
 sqrt2:  times 8 dw 23170
 
+; SSE2 tables
 iTab1:  dw 0x4000, 0x539f, 0xc000, 0xac61, 0x4000, 0xdd5d, 0x4000, 0xdd5d
 dw 0x4000, 0x22a3, 0x4000, 0x22a3, 0xc000, 0x539f, 0x4000, 0xac61
 dw 0x3249, 0x11a8, 0x4b42, 0xee58, 0x11a8, 0x4b42, 0x11a8, 0xcdb7
@@ -61,12 +91,154 @@ iTab4:  dw 0x4b42, 0x6254, 0xb4be, 0x9dac, 0x4b42, 0xd746, 
0x4b42, 0xd746
 dw 0x3b21, 0x14c3, 0x587e, 0xeb3d, 0x14c3, 0x587e, 0x14c3, 0xc4df
 dw 0x6862, 0x587e, 0x979e, 0xc4df, 0x3b21, 0x979e, 0x587e, 0x979e
 
+%if ARCH_X86_32
+; --

[FFmpeg-cvslog] x86: dct-test: evaluate prores idct avx version

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 07:57:43 2015 +| [8200575d849473516cfe0a76cfceecdf9099a218] | 
committer: Michael Niedermayer

x86: dct-test: evaluate prores idct avx version

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8200575d849473516cfe0a76cfceecdf9099a218
---

 libavcodec/x86/dct-test.c |   39 ++-
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index 63a9aeb..d1a5067 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -26,21 +26,31 @@
 void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
 int16_t *block, int16_t *qmat);
 
-static void ff_prores_idct_put_10_sse2_wrap(int16_t *dst){
-DECLARE_ALIGNED(16, static int16_t, qmat)[64];
-DECLARE_ALIGNED(16, static int16_t, tmp)[64];
-int i;
+#define PR_WRAP(INSN) \
+static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \
+DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \
+DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \
+int i; \
+ \
+for(i=0; i<64; i++){ \
+qmat[i]=4; \
+tmp[i]= dst[i]; \
+} \
+ff_prores_idct_put_10_##INSN (dst, 16, tmp, qmat); \
+ \
+for(i=0; i<64; i++) { \
+ dst[i] -= 512; \
+} \
+}
 
-for(i=0; i<64; i++){
-qmat[i]=4;
-tmp[i]= dst[i];
-}
-ff_prores_idct_put_10_sse2(dst, 16, tmp, qmat);
+PR_WRAP(sse2)
+
+# if HAVE_AVX_EXTERNAL
+void ff_prores_idct_put_10_avx(uint16_t *dst, int linesize,
+   int16_t *block, int16_t *qmat);
+PR_WRAP(avx)
+# endif
 
-for(i=0; i<64; i++) {
- dst[i] -= 512;
-}
-}
 #endif
 
 static const struct algo fdct_tab_arch[] = {
@@ -71,6 +81,9 @@ static const struct algo idct_tab_arch[] = {
 #endif /* CONFIG_MPEG4_DECODER && HAVE_YASM */
 #if (CONFIG_PRORES_DECODER || CONFIG_PRORES_LGPL_DECODER) && ARCH_X86_64 && 
HAVE_YASM
 { "PR-SSE2", ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_SSE2, 1 },
+# if HAVE_AVX_EXTERNAL
+{ "PR-AVX",  ff_prores_idct_put_10_avx_wrap, FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_AVX, 1 },
+# endif
 #endif
 { 0 }
 };

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


[FFmpeg-cvslog] x86: xvid_idct: SSE2 merged add version

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Tue Mar 10 23:11:54 2015 +| [15ce160183c61fbd98915e07879f1225fcf1c080] | 
committer: Michael Niedermayer

x86: xvid_idct: SSE2 merged add version

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=15ce160183c61fbd98915e07879f1225fcf1c080
---

 libavcodec/x86/xvididct.asm|   92 ++--
 libavcodec/x86/xvididct_init.c |9 +---
 2 files changed, 91 insertions(+), 10 deletions(-)

diff --git a/libavcodec/x86/xvididct.asm b/libavcodec/x86/xvididct.asm
index 58ffb11..0220885 100644
--- a/libavcodec/x86/xvididct.asm
+++ b/libavcodec/x86/xvididct.asm
@@ -384,6 +384,12 @@ SECTION .text
 ; Must now load args as gprs are no longer used for masks
 ; DEST is set to where address of dest was loaded
 %if ARCH_X86_32
+%if %2 == 2 ; Not enough xmms, store
+movdqa   [%1+1*16], TAN3
+movdqa   [%1+2*16], xmm3
+movdqa   [%1+5*16], REG0
+movdqa   [%1+6*16], xmm5
+%endif
 %xdefine DEST r2q ; BLOCK is r0, stride r1
 movifnidn DEST, destm
 movifnidn strideq, stridem
@@ -397,8 +403,6 @@ SECTION .text
 movq [DEST + strideq], TAN3
 movhps   [DEST + 2*strideq], TAN3
 ; REG0 and TAN3 are now available (and likely used in second half)
-%else
-%warning Unimplemented
 %endif
 %endif
 %endmacro
@@ -427,7 +431,88 @@ SECTION .text
 movq [DEST + 2*strideq], xmm5
 movhps   [DEST + strideq], xmm5
 %elif %2 == 2
-%warning Unimplemented
+pxorxmm0, xmm0
+%if ARCH_X86_32
+; free: m3 REG0=m4 m5
+; input: m1, m7, m2, m6
+movqxmm3, [DEST+0*strideq]
+movqxmm4, [DEST+1*strideq]
+punpcklbw   xmm3, xmm0
+punpcklbw   xmm4, xmm0
+paddsw  xmm3, %3
+paddsw  xmm4, [%1 + 1*16]
+movq  %3, [DEST+2*strideq]
+movqxmm5, [DEST+  r3q]
+punpcklbw %3, xmm0
+punpcklbw   xmm5, xmm0
+paddsw%3, [%1 + 2*16]
+paddsw  xmm5, %5
+packuswbxmm3, xmm4
+packuswb  %3, xmm5
+movq[DEST+0*strideq], xmm3
+movhps  [DEST+1*strideq], xmm3
+movq[DEST+2*strideq], %3
+movhps  [DEST+  r3q], %3
+lea DEST, [DEST+4*strideq]
+movqxmm3, [DEST+0*strideq]
+movqxmm4, [DEST+1*strideq]
+movq  %3, [DEST+2*strideq]
+movqxmm5, [DEST+  r3q]
+punpcklbw   xmm3, xmm0
+punpcklbw   xmm4, xmm0
+punpcklbw %3, xmm0
+punpcklbw   xmm5, xmm0
+paddsw  xmm3, %6
+paddsw  xmm4, [%1 + 5*16]
+paddsw%3, [%1 + 6*16]
+paddsw  xmm5, %4
+packuswbxmm3, xmm4
+packuswb  %3, xmm5
+movq[DEST+0*strideq], xmm3
+movhps  [DEST+1*strideq], xmm3
+movq[DEST+2*strideq], %3
+movhps  [DEST+  r3q], %3
+%else
+; l1:TAN3=m13  l2:m3  l5:REG0=m8 l6=m5
+; input: m1, m7/SREG2=m9, TAN1=m14, REG4=m10
+movqxmm2, [DEST+0*strideq]
+movqxmm4, [DEST+1*strideq]
+movq   xmm12, [DEST+2*strideq]
+movq   xmm11, [DEST+  r3q]
+punpcklbw   xmm2, xmm0
+punpcklbw   xmm4, xmm0
+punpcklbw  xmm12, xmm0
+punpcklbw  xmm11, xmm0
+paddsw  xmm2, %3
+paddsw  xmm4, TAN3
+paddsw xmm12, xmm3
+paddsw xmm11, %5
+packuswbxmm2, xmm4
+packuswb   xmm12, xmm11
+movq[DEST+0*strideq], xmm2
+movhps  [DEST+1*strideq], xmm2
+movq[DEST+2*strideq], xmm12
+movhps  [DEST+  r3q], xmm12
+lea DEST, [DEST+4*strideq]
+movqxmm2, [DEST+0*strideq]
+movqxmm4, [DEST+1*strideq]
+movq   xmm12, [DEST+2*strideq]
+movq   xmm11, [DEST+  r3q]
+punpcklbw   xmm2, xmm0
+punpcklbw   xmm4, xmm0
+punpcklbw  xmm12, xmm0
+punpcklbw  xmm11, xmm0
+paddsw  xmm2, %6
+paddsw  xmm4, REG0
+paddsw xmm12, xmm5
+paddsw xmm11, %4
+packuswbxmm2, xmm4
+packuswb   xmm12, xmm11
+movq[DEST+0*strideq], xmm2
+movhps  [DEST+1*strideq], xmm2
+movq[DEST+2*strideq], xmm12
+movhps  [DEST+  r3q], xmm12
+%endif
 %endif
 %endmacro
 
@@ -623,6 +708,7 @@ cglobal xvid_idct_add, 0, NUM_GPRS, 8+7*ARCH_X86_64, dest, 
stride, block
 INIT_XMM sse2
 IDCT_SSE2 0
 IDCT_SSE2 1
+IDCT_SSE2 2
 
 %if ARCH_X86_32
 
diff --git a/libavcodec/x86/xvididct_init.c b/libavcodec/x86/xvididct_init.c
index 2530d7a..57f6ed6 100644
--- a/libavcodec/x86/xvididct_init.c
+++ b/libavcodec/x86/xvididct_init.c
@@ -27,12 +27,7 @@
 #include "xvididct.h"
 
 void ff_xvid_idct_put_sse2(uint8_t *dest, int line_size, short *block);
-
-static void xvid_idct_sse2_add(uint8_t *dest, int line_size, short *block)
-{
-ff_xvid_idct_sse2(block);
-ff_add_pixels_clamped(block, dest, line_size);
-}
+void ff_xvid_idct_add_sse2(uint8_t *dest, int line_size, short *block);
 
 #if ARCH_X86_32
 static void xvid_idct_mmx_put(uint8_t *dest, 

[FFmpeg-cvslog] x86: dct-test: fix compilation for prores

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 07:57:42 2015 +| [4eb4451be191a0144ee6af0650f3798b526b9b2c] | 
committer: Michael Niedermayer

x86: dct-test: fix compilation for prores

When the decoder is deactivated, the x86-optimized versions are
not compiled, resulting in a link error.

The C version is unaffected, as it is part of the idctdsp
subsystem.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4eb4451be191a0144ee6af0650f3798b526b9b2c
---

 libavcodec/x86/dct-test.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index 3a4c0df..63a9aeb 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -22,7 +22,7 @@
 #include "xvididct.h"
 #include "simple_idct.h"
 
-#if ARCH_X86_64 && HAVE_MMX && HAVE_YASM
+#if (CONFIG_PRORES_DECODER || CONFIG_PRORES_LGPL_DECODER) && ARCH_X86_64 && 
HAVE_YASM
 void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
 int16_t *block, int16_t *qmat);
 
@@ -67,11 +67,11 @@ static const struct algo idct_tab_arch[] = {
 #endif
 #if HAVE_SSE2_EXTERNAL
 { "XVID-SSE2",   ff_xvid_idct_sse2,   FF_IDCT_PERM_SSE2,   
AV_CPU_FLAG_SSE2,   1 },
-#if ARCH_X86_64
-{ "PR-SSE2", ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_SSE2, 1 },
-#endif
 #endif
 #endif /* CONFIG_MPEG4_DECODER && HAVE_YASM */
+#if (CONFIG_PRORES_DECODER || CONFIG_PRORES_LGPL_DECODER) && ARCH_X86_64 && 
HAVE_YASM
+{ "PR-SSE2", ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_SSE2, 1 },
+#endif
 { 0 }
 };
 

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


[FFmpeg-cvslog] x86: xvid_idct: merged idct_put SSE2 versions

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Tue Mar 10 23:11:53 2015 +| [decd5193e1d409a4d8dd4c55ca46467d51c86976] | 
committer: Michael Niedermayer

x86: xvid_idct: merged idct_put SSE2 versions

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=decd5193e1d409a4d8dd4c55ca46467d51c86976
---

 libavcodec/x86/xvididct.asm|  202 +++-
 libavcodec/x86/xvididct_init.c |8 +-
 2 files changed, 140 insertions(+), 70 deletions(-)

diff --git a/libavcodec/x86/xvididct.asm b/libavcodec/x86/xvididct.asm
index 4c52bf1..58ffb11 100644
--- a/libavcodec/x86/xvididct.asm
+++ b/libavcodec/x86/xvididct.asm
@@ -292,13 +292,13 @@ SECTION .text
 %define TAN3  xmm13
 %define TAN1  xmm14
 %else
-%define ROW0  [r0 + 0*16]
+%define ROW0  [BLOCK + 0*16]
 %define REG0  xmm4
-%define ROW2  [r0 + 2*16]
+%define ROW2  [BLOCK + 2*16]
 %define REG2  xmm4
-%define ROW4  [r0 + 4*16]
+%define ROW4  [BLOCK + 4*16]
 %define REG4  xmm6
-%define ROW6  [r0 + 6*16]
+%define ROW6  [BLOCK + 6*16]
 %define REG6  xmm6
 %define XMMS  xmm2
 %define SREG2 xmm7
@@ -369,8 +369,71 @@ SECTION .text
 movdqa   TAN1, [tan1]
 %endmacro
 
+%macro FIRST_HALF 2  ; %1=dct  %2=type(normal,add,put)
+psrawxmm5, 6
+psrawREG0, 6
+psrawTAN3, 6
+psrawxmm3, 6
+; dct coeffs must still be written for AC prediction
+%if %2 == 0
+movdqa   [%1+1*16], TAN3
+movdqa   [%1+2*16], xmm3
+movdqa   [%1+5*16], REG0
+movdqa   [%1+6*16], xmm5
+%else
+; Must now load args as gprs are no longer used for masks
+; DEST is set to where address of dest was loaded
+%if ARCH_X86_32
+%xdefine DEST r2q ; BLOCK is r0, stride r1
+movifnidn DEST, destm
+movifnidn strideq, stridem
+%else
+%xdefine DEST r0q
+%endif
+lea  r3q, [3*strideq]
+%if %2 == 1
+packuswb TAN3, xmm3
+packuswb xmm5, REG0
+movq [DEST + strideq], TAN3
+movhps   [DEST + 2*strideq], TAN3
+; REG0 and TAN3 are now available (and likely used in second half)
+%else
+%warning Unimplemented
+%endif
+%endif
+%endmacro
+
+%macro SECOND_HALF 6 ; %1=dct  %2=type(normal,add,put) 3-6: xmms
+psraw%3, 6
+psraw%4, 6
+psraw%5, 6
+psraw%6, 6
+; dct coeffs must still be written for AC prediction
+%if %2 == 0
+movdqa   [%1+0*16], %3
+movdqa   [%1+3*16], %5
+movdqa   [%1+4*16], %6
+movdqa   [%1+7*16], %4
+%elif %2 == 1
+packuswb %3, %5
+packuswb %6, %4
+; address of dest may have been loaded
+movq [DEST], %3
+movhps   [DEST + r3q], %3
+lea  DEST, [DEST + 4*strideq]
+movq [DEST], %6
+movhps   [DEST + r3q], %6
+; and now write remainder of first half
+movq [DEST + 2*strideq], xmm5
+movhps   [DEST + strideq], xmm5
+%elif %2 == 2
+%warning Unimplemented
+%endif
+%endmacro
+
+
 ; IDCT pass on columns.
-%macro iLLM_PASS  1  ;dct
+%macro iLLM_PASS  2  ; %1=dct  %2=type(normal,add,put)
 movdqa   xmm1, TAN3
 movdqa   xmm3, TAN1
 pmulhw   TAN3, xmm4
@@ -407,7 +470,7 @@ SECTION .text
 psubsw   xmm5, REG6
 MOV32ROW0, REG0
 MOV32ROW4, REG4
-MOV32TAN1, [r0]
+MOV32TAN1, [BLOCK]
 movdqa   XMMS, REG0
 psubsw   REG0, REG4
 paddsw   REG4, XMMS
@@ -423,33 +486,22 @@ SECTION .text
 movdqa   XMMS, REG0
 psubsw   REG0, xmm3
 paddsw   xmm3, XMMS
-MOV32[r0], TAN1
-psrawxmm5, 6
-psrawREG0, 6
-psrawTAN3, 6
-psrawxmm3, 6
-movdqa   [%1+1*16], TAN3
-movdqa   [%1+2*16], xmm3
-movdqa   [%1+5*16], REG0
-movdqa   [%1+6*16], xmm5
+MOV32[BLOCK], TAN1
+
+FIRST_HALF %1, %2
+
 movdqa   xmm0, xmm7
 movdqa   xmm4, REG4
 psubsw   xmm7, xmm1
 psubsw   REG4, TAN1
 paddsw   xmm1, xmm0
 paddsw   TAN1, xmm4
-psrawxmm1, 6
-psrawxmm7, 6
-psrawTAN1, 6
-psrawREG4, 6
-movdqa   [%1+0*16], xmm1
-movdqa   [%1+3*16], TAN1
-movdqa   [%1+4*16], REG4
-movdqa   [%1+7*16], xmm7
+
+SECOND_HALF %1, %2, xmm1, xmm7, TAN1, REG4
 %endmacro
 
 ; IDCT pass on columns, assuming rows 4-7 are zero
-%macro iLLM_PASS_SPARSE   1 ;dct
+%macro iLLM_PASS_SPARSE   2 ; %1=dct   %2=type(normal,put,add)
 pmulhw   TAN3, xmm4
 paddsw   TAN3, xmm4
 movdqa   xmm3, xmm6
@@ -475,7 +527,7 @@ SECTION .text
 movdqa   xmm6, REG0
 psubsw   xmm6, SREG2
 paddsw  SREG2, REG0
-MOV32TAN1, [r0]
+MOV32TAN1, [BLOCK]
 movdqa   XMMS, REG0
 psubsw   REG0, xmm5
 paddsw   xmm5, XMMS
@@ -485,70 +537,92 @@ SECTION .text
 movdqa   XMMS, REG0
 psubsw   REG0, xmm3
 paddsw   xmm3, XMMS
-MOV32[r0], TAN1
-psrawxmm5, 6
-psrawREG0, 6
-psrawTAN3, 6
-psrawxmm3, 6
-movdqa   [%1+1*16], TAN3
-movdqa   [%1+2*16], xmm3
-movdqa   [%1+5*16], REG0
-movdqa   [%1+6*16], xmm5
+MOV32

[FFmpeg-cvslog] ac3_fixed: fix out-of-bound read

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 11:48:57 2015 +| [b0834400608b3980c06bf6d2cf747116e60d10c7] | 
committer: Michael Niedermayer

ac3_fixed: fix out-of-bound read

Should also improve decoding, but actually doesn't...

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b0834400608b3980c06bf6d2cf747116e60d10c7
---

 libavcodec/ac3dec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 2f78d73..ce45186 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -872,7 +872,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
 start_subband += start_subband - 7;
 end_subband= get_bits(gbc, 3) + 5;
 #if USE_FIXED
-s->spx_dst_end_freq = end_freq_inv_tab[end_subband];
+s->spx_dst_end_freq = end_freq_inv_tab[end_subband-5];
 #endif
 if (end_subband   > 7)
 end_subband   += end_subband   - 7;

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


[FFmpeg-cvslog] eac3dec: fix scaling

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 11:48:59 2015 +| [0c3339f4bd7aceebfd74deb437ba2e5c04ef3d0e] | 
committer: Michael Niedermayer

eac3dec: fix scaling

This is the remaining error, the output on the SPX samples,
respectively csi_miami_stereo_128_spx.eac3 and
csi_miami_5.1_256_spx.eac3, goes from:
stddev:8.71 PSNR: 77.52 MAXDIFF:  235
stddev:24270.51 PSNR: 22.17 MAXDIFF:47166
to:
stddev:0.12 PSNR:114.12 MAXDIFF:1
stddev:0.12 PSNR:114.73 MAXDIFF:1

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c3339f4bd7aceebfd74deb437ba2e5c04ef3d0e
---

 libavcodec/eac3dec.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
index cd2eec8d..ef815af 100644
--- a/libavcodec/eac3dec.c
+++ b/libavcodec/eac3dec.c
@@ -143,7 +143,9 @@ static void 
ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
 float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * 
(1.0f / INT32_MIN);
 float sscale = s->spx_signal_blend[ch][bnd];
 #if USE_FIXED
+// spx_noise_blend and spx_signal_blend are both FP.23
 nscale *= 1.0 / (1<<23);
+sscale *= 1.0 / (1<<23);
 #endif
 for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
 float noise  = nscale * (int32_t)av_lfg_get(&s->dith_state);

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


[FFmpeg-cvslog] ac3_fixed: fix computation of spx_noise_blend

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 11:48:58 2015 +| [c4bf3833f4663fd484441907f73c5bc4700021a4] | 
committer: Michael Niedermayer

ac3_fixed: fix computation of spx_noise_blend

It was set to 1 instead of sqrt(3)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4bf3833f4663fd484441907f73c5bc4700021a4
---

 libavcodec/ac3dec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index ce45186..ae4129f 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -939,7 +939,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
 nblend = 0;
 sblend = 0x80;
 } else if (nratio > 0x7f) {
-nblend = 0x80;
+nblend = 14529495; // sqrt(3) in FP.23
 sblend = 0;
 } else {
 nblend = fixed_sqrt(nratio, 23);

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


[FFmpeg-cvslog] avcodec/012v: redesign main loop

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Tue Mar 
10 19:18:34 2015 +0100| [e75bb490ca39cc1282a286b3beebb681f43fe1f5] | committer: 
Michael Niedermayer

avcodec/012v: redesign main loop

Fixes out of array accesses
Fixes: ffmpeg_012v_crash.ts

Found-by: Thomas Lindroth 
Reviewed-by: Thomas Lindroth 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 48df30d36c3ca360c407d84f96749888d1fbe853)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e75bb490ca39cc1282a286b3beebb681f43fe1f5
---

 libavcodec/012v.c |   82 +
 1 file changed, 39 insertions(+), 43 deletions(-)

diff --git a/libavcodec/012v.c b/libavcodec/012v.c
index 7526e8f..b87551e 100644
--- a/libavcodec/012v.c
+++ b/libavcodec/012v.c
@@ -38,7 +38,7 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx)
 static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
 int *got_frame, AVPacket *avpkt)
 {
-int line = 0, ret;
+int line, ret;
 const int width = avctx->width;
 AVFrame *pic = data;
 uint16_t *y, *u, *v;
@@ -67,45 +67,45 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void 
*data,
 pic->pict_type = AV_PICTURE_TYPE_I;
 pic->key_frame = 1;
 
-y = (uint16_t *)pic->data[0];
-u = (uint16_t *)pic->data[1];
-v = (uint16_t *)pic->data[2];
 line_end = avpkt->data + stride;
+for (line = 0; line < avctx->height; line++) {
+uint16_t y_temp[6] = {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000};
+uint16_t u_temp[3] = {0x8000, 0x8000, 0x8000};
+uint16_t v_temp[3] = {0x8000, 0x8000, 0x8000};
+int x;
+y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
+u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
+v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
+
+for (x = 0; x < width; x += 6) {
+uint32_t t;
+
+if (width - x < 6 || line_end - src < 16) {
+y = y_temp;
+u = u_temp;
+v = v_temp;
+}
+
+if (line_end - src < 4)
+break;
 
-while (line++ < avctx->height) {
-while (1) {
-uint32_t t = AV_RL32(src);
+t = AV_RL32(src);
 src += 4;
 *u++ = t <<  6 & 0xFFC0;
 *y++ = t >>  4 & 0xFFC0;
 *v++ = t >> 14 & 0xFFC0;
 
-if (src >= line_end - 1) {
-*y = 0x80;
-src++;
-line_end += stride;
-y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
-u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
-v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
+if (line_end - src < 4)
 break;
-}
 
 t = AV_RL32(src);
 src += 4;
 *y++ = t <<  6 & 0xFFC0;
 *u++ = t >>  4 & 0xFFC0;
 *y++ = t >> 14 & 0xFFC0;
-if (src >= line_end - 2) {
-if (!(width & 1)) {
-*y = 0x80;
-src += 2;
-}
-line_end += stride;
-y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
-u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
-v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
+
+if (line_end - src < 4)
 break;
-}
 
 t = AV_RL32(src);
 src += 4;
@@ -113,15 +113,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, 
void *data,
 *y++ = t >>  4 & 0xFFC0;
 *u++ = t >> 14 & 0xFFC0;
 
-if (src >= line_end - 1) {
-*y = 0x80;
-src++;
-line_end += stride;
-y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
-u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
-v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
+if (line_end - src < 4)
 break;
-}
 
 t = AV_RL32(src);
 src += 4;
@@ -129,18 +122,21 @@ static int zero12v_decode_frame(AVCodecContext *avctx, 
void *data,
 *v++ = t >>  4 & 0xFFC0;
 *y++ = t >> 14 & 0xFFC0;
 
-if (src >= line_end - 2) {
-if (width & 1) {
-*y = 0x80;
-src += 2;
-}
-line_end += stride;
-y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
-u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
-v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
+if (width - x < 6)
 break;
-}
 }
+
+if (x < width) 

[FFmpeg-cvslog] avformat/asfdec: Use 64bit ret to avoid overflow

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Fri Feb 
20 19:29:12 2015 +0100| [a15ceebb6f2a7b6b8731793d9b8a1f565740ba50] | committer: 
Michael Niedermayer

avformat/asfdec: Use 64bit ret to avoid overflow

Signed-off-by: Michael Niedermayer 
(cherry picked from commit d4936d28a11fac6c9c4b4df9625185f93b086986)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a15ceebb6f2a7b6b8731793d9b8a1f565740ba50
---

 libavformat/asfdec.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 9bbc704..51ff96b 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1472,7 +1472,7 @@ static int asf_build_simple_index(AVFormatContext *s, int 
stream_index)
 ff_asf_guid g;
 ASFContext *asf = s->priv_data;
 int64_t current_pos = avio_tell(s->pb);
-int ret = 0;
+int64_t ret;
 
 if((ret = avio_seek(s->pb, asf->data_object_offset + 
asf->data_object_size, SEEK_SET)) < 0) {
 return ret;
@@ -1542,7 +1542,7 @@ static int asf_read_seek(AVFormatContext *s, int 
stream_index,
 
 /* Try using the protocol's read_seek if available */
 if (s->pb) {
-int ret = avio_seek_time(s->pb, stream_index, pts, flags);
+int64_t ret = avio_seek_time(s->pb, stream_index, pts, flags);
 if (ret >= 0)
 asf_reset_header(s);
 if (ret != AVERROR(ENOSYS))

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


[FFmpeg-cvslog] avcodec/012v: Check dimensions more completely

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Tue Mar 
10 20:21:14 2015 +0100| [f8bb156fa1f85f9a800ceae137403d83e5347ac4] | committer: 
Michael Niedermayer

avcodec/012v: Check dimensions more completely

Fixes division by 0

Found-by: Thomas Lindroth 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit d3b25383daffac154846daeb4e4fb46569e728db)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8bb156fa1f85f9a800ceae137403d83e5347ac4
---

 libavcodec/012v.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/012v.c b/libavcodec/012v.c
index c2b6a35..7526e8f 100644
--- a/libavcodec/012v.c
+++ b/libavcodec/012v.c
@@ -45,8 +45,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void 
*data,
 const uint8_t *line_end, *src = avpkt->data;
 int stride = avctx->width * 8 / 3;
 
-if (width == 1) {
-av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n");
+if (width <= 1 || avctx->height <= 0) {
+av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", 
width, avctx->height);
 return AVERROR_INVALIDDATA;
 }
 

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


[FFmpeg-cvslog] roqvideoenc: set enc->avctx in roq_encode_init

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Mon Mar  9 19:24:09 2015 +0100| 
[e407615129a58d21d2a7b4660432a67e5741f89f] | committer: Michael Niedermayer

roqvideoenc: set enc->avctx in roq_encode_init

So far it is only set in roq_encode_frame, but it is used in
roq_encode_end to free the coded_frame. This currently segfaults if
roq_encode_frame is not called between roq_encode_init and
roq_encode_end.

Signed-off-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit cf82c426fadf90105e1fb9d5ecd267cc3aa2b288)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e407615129a58d21d2a7b4660432a67e5741f89f
---

 libavcodec/roqvideoenc.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 4b96934..f682579 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -960,6 +960,8 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
 
 av_lfg_init(&enc->randctx, 1);
 
+enc->avctx = avctx;
+
 enc->framesSinceKeyframe = 0;
 if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
 av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");

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


[FFmpeg-cvslog] ffmdec: make sure the time base is valid

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Sun Mar  8 23:12:59 2015 +0100| 
[7a3ff7fb814bfecd4395427b52391c7ccb9561e0] | committer: Michael Niedermayer

ffmdec: make sure the time base is valid

A negative time base can trigger assertions.

Signed-off-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 4c91d81be23ffacfa3897b2bcfa77445bb0c2f89)

Conflicts:

libavformat/ffmdec.c
(cherry picked from commit 9678ceb6976ca8194848b24535785a298521211f)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a3ff7fb814bfecd4395427b52391c7ccb9561e0
---

 libavformat/ffmdec.c |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 2f02c7a..91882b2 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -296,6 +296,11 @@ static int ffm2_read_header(AVFormatContext *s)
 case MKBETAG('S', 'T', 'V', 'I'):
 codec->time_base.num = avio_rb32(pb);
 codec->time_base.den = avio_rb32(pb);
+if (codec->time_base.num <= 0 || codec->time_base.den <= 0) {
+av_log(s, AV_LOG_ERROR, "Invalid time base %d/%d\n",
+   codec->time_base.num, codec->time_base.den);
+goto fail;
+}
 codec->width = avio_rb16(pb);
 codec->height = avio_rb16(pb);
 codec->gop_size = avio_rb16(pb);
@@ -420,6 +425,11 @@ static int ffm_read_header(AVFormatContext *s)
 case AVMEDIA_TYPE_VIDEO:
 codec->time_base.num = avio_rb32(pb);
 codec->time_base.den = avio_rb32(pb);
+if (codec->time_base.num <= 0 || codec->time_base.den <= 0) {
+av_log(s, AV_LOG_ERROR, "Invalid time base %d/%d\n",
+   codec->time_base.num, codec->time_base.den);
+goto fail;
+}
 codec->width = avio_rb16(pb);
 codec->height = avio_rb16(pb);
 codec->gop_size = avio_rb16(pb);

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


[FFmpeg-cvslog] avformat/idcin: Use 64bit for ret to avoid overflow

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Fri Feb 
20 20:13:06 2015 +0100| [107738051393b1f91d4624909113e156ea910b08] | committer: 
Michael Niedermayer

avformat/idcin: Use 64bit for ret to avoid overflow

Signed-off-by: Michael Niedermayer 
(cherry picked from commit d1923d15a3544cbb94563a59e7169291db76b312)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=107738051393b1f91d4624909113e156ea910b08
---

 libavformat/idcin.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index cc25fb0..0f0b97e 100644
--- a/libavformat/idcin.c
+++ b/libavformat/idcin.c
@@ -359,7 +359,7 @@ static int idcin_read_seek(AVFormatContext *s, int 
stream_index,
 IdcinDemuxContext *idcin = s->priv_data;
 
 if (idcin->first_pkt_pos > 0) {
-int ret = avio_seek(s->pb, idcin->first_pkt_pos, SEEK_SET);
+int64_t ret = avio_seek(s->pb, idcin->first_pkt_pos, SEEK_SET);
 if (ret < 0)
 return ret;
 ff_update_cur_dts(s, s->streams[idcin->video_stream_index], 0);

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


[FFmpeg-cvslog] ffmdec: limit the backward seek to the last resync position

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Mon Mar  9 14:59:44 2015 +0100| 
[4f53eaaafa2dffa587ec6a3f0cd7048419297eca] | committer: Michael Niedermayer

ffmdec: limit the backward seek to the last resync position

If resyncing leads to the same position as previously, it will again
lead to a resync attempt, resulting in an infinite loop.

Thus don't seek back beyond the last syncpoint.

Signed-off-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 6b8263b03ab3d16d70525ae1893cb106be7852f1)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f53eaaafa2dffa587ec6a3f0cd7048419297eca
---

 libavformat/ffmdec.c |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 9d89b16..2f02c7a 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -79,6 +79,7 @@ static int ffm_read_data(AVFormatContext *s,
 FFMContext *ffm = s->priv_data;
 AVIOContext *pb = s->pb;
 int len, fill_size, size1, frame_offset, id;
+int64_t last_pos = -1;
 
 size1 = size;
 while (size > 0) {
@@ -98,9 +99,11 @@ static int ffm_read_data(AVFormatContext *s,
 avio_seek(pb, tell, SEEK_SET);
 }
 id = avio_rb16(pb); /* PACKET_ID */
-if (id != PACKET_ID)
+if (id != PACKET_ID) {
 if (ffm_resync(s, id) < 0)
 return -1;
+last_pos = avio_tell(pb);
+}
 fill_size = avio_rb16(pb);
 ffm->dts = avio_rb64(pb);
 frame_offset = avio_rb16(pb);
@@ -114,7 +117,9 @@ static int ffm_read_data(AVFormatContext *s,
 if (!frame_offset) {
 /* This packet has no frame headers in it */
 if (avio_tell(pb) >= ffm->packet_size * 3LL) {
-avio_seek(pb, -ffm->packet_size * 2LL, SEEK_CUR);
+int64_t seekback = FFMIN(ffm->packet_size * 2LL, 
avio_tell(pb) - last_pos);
+seekback = FFMAX(seekback, 0);
+avio_seek(pb, -seekback, SEEK_CUR);
 goto retry_read;
 }
 /* This is bad, we cannot find a valid frame header */

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


[FFmpeg-cvslog] avcodec/options_table: remove extradata_size from the AVOptions table

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Mon Mar 
 9 03:42:00 2015 +0100| [313492c0bd6999c18d98913a0da876f762ea3bff] | committer: 
Michael Niedermayer

avcodec/options_table: remove extradata_size from the AVOptions table

allowing access to the size but not the extradata itself is not useful
and could lead to potential problems if writing happens through this field

Reviewed-by: Andreas Cadhalpun 
Reviewed-by: Lukasz Marek 
Reviewed-by: Nicolas George 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 1f4088b28540080ce1d42345c5614be3e1a6a197)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=313492c0bd6999c18d98913a0da876f762ea3bff
---

 libavcodec/options_table.h |1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 1873a92..85af2e1 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -91,7 +91,6 @@ static const AVOption avcodec_options[] = {
 {"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_HEX }, 
INT_MIN, INT_MAX, V|E, "me_method" },
 {"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH }, 
INT_MIN, INT_MAX, V|E, "me_method" },
 {"iter", "iter motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ITER }, 
INT_MIN, INT_MAX, V|E, "me_method" },
-{"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 = 
DEFAULT }, INT_MIN, INT_MAX},
 {"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 
INT_MIN, INT_MAX},
 {"g", "set the group of picture (GOP) size", OFFSET(gop_size), 
AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
 {"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), 
AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},

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


[FFmpeg-cvslog] fix VP9 packet decoder returning 0 instead of the used data size

2015-03-14 Thread Steve Lhomme
ffmpeg | branch: release/2.2 | Steve Lhomme  | Tue Mar  3 
12:06:40 2015 +0100| [7ed19bd337ead0c9bf125432d5fa56ca8415d8be] | committer: 
Michael Niedermayer

fix VP9 packet decoder returning 0 instead of the used data size

See https://trac.videolan.org/vlc/ticket/14022#comment:6

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 4851db80a4f80ddade1d50d2ec741375c763f001)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ed19bd337ead0c9bf125432d5fa56ca8415d8be
---

 libavcodec/vp9.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index cbc885b..669 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3742,7 +3742,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 if ((res = av_frame_ref(frame, s->refs[ref].f)) < 0)
 return res;
 *got_frame = 1;
-return 0;
+return pkt->size;
 }
 data += res;
 size -= res;
@@ -3952,7 +3952,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 *got_frame = 1;
 }
 
-return 0;
+return pkt->size;
 }
 
 static void vp9_decode_flush(AVCodecContext *ctx)

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


[FFmpeg-cvslog] avformat/bit: check that pkt->size is 10 in write_packet

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Thu Feb 26 21:38:50 2015 +0100| 
[3183c2078105c3f9c9cd40227cdd8cc585ac720b] | committer: Michael Niedermayer

avformat/bit: check that pkt->size is 10 in write_packet

Ohter packet sizes are not supported by this muxer.

This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit eeda2c3de8a8484d9e7d1e47ac836bec850b31fc)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3183c2078105c3f9c9cd40227cdd8cc585ac720b
---

 libavformat/bit.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/bit.c b/libavformat/bit.c
index 0be471a..42df0c2 100644
--- a/libavformat/bit.c
+++ b/libavformat/bit.c
@@ -133,6 +133,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 GetBitContext gb;
 int i;
 
+if (pkt->size != 10)
+return AVERROR(EINVAL);
+
 avio_wl16(pb, SYNC_WORD);
 avio_wl16(pb, 8 * 10);
 

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


[FFmpeg-cvslog] avformat/bit: only accept the g729 codec and 1 channel

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Thu Feb 26 21:42:02 2015 +0100| 
[4e11780b85f8454de90cd3f7acf828a8e470fd7f] | committer: Michael Niedermayer

avformat/bit: only accept the g729 codec and 1 channel

Other codecs/channel numbers are not supported by this muxer.

Signed-off-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit d0b8640f75ff7569c98d6fdb03d83451104e088c)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e11780b85f8454de90cd3f7acf828a8e470fd7f
---

 libavformat/bit.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/bit.c b/libavformat/bit.c
index 42df0c2..f5112c2 100644
--- a/libavformat/bit.c
+++ b/libavformat/bit.c
@@ -119,8 +119,12 @@ static int write_header(AVFormatContext *s)
 {
 AVCodecContext *enc = s->streams[0]->codec;
 
-enc->codec_id = AV_CODEC_ID_G729;
-enc->channels = 1;
+if ((enc->codec_id != AV_CODEC_ID_G729) || enc->channels != 1) {
+av_log(s, AV_LOG_ERROR,
+   "only codec g729 with 1 channel is supported by this format\n");
+return AVERROR(EINVAL);
+}
+
 enc->bits_per_coded_sample = 16;
 enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3;
 

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


[FFmpeg-cvslog] doc/protocols/tcp: fix units of listen_timeout option value, from microseconds to milliseconds

2015-03-14 Thread Stefano Sabatini
ffmpeg | branch: release/2.2 | Stefano Sabatini  | Thu Mar  
5 12:05:17 2015 +0100| [6155d5d98b1b4fe76c8b1d072c39969068b9ed66] | committer: 
Michael Niedermayer

doc/protocols/tcp: fix units of listen_timeout option value, from microseconds 
to milliseconds

s->listen_timeout is passed to ff_listen_bind(), which accepts a timeout
value expressed in milliseconds.

The unit was incorrectly set in 1b4da43ce02452843a1e9bb976da1a39e18a945c.
(cherry picked from commit 6db20926c32ea297418f1f819585007c6b7b6160)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6155d5d98b1b4fe76c8b1d072c39969068b9ed66
---

 doc/protocols.texi |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 91b8244..851b3c5 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -982,8 +982,8 @@ Set raise error timeout, expressed in microseconds.
 This option is only relevant in read mode: if no data arrived in more
 than this time interval, raise error.
 
-@item listen_timeout=@var{microseconds}
-Set listen timeout, expressed in microseconds.
+@item listen_timeout=@var{milliseconds}
+Set listen timeout, expressed in milliseconds.
 @end table
 
 The following example shows how to setup a listening TCP connection

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


[FFmpeg-cvslog] avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Sun Feb 22 20:48:38 2015 +0100| 
[e29761b1c850513b19f435cf59903ee63991a30c] | committer: Michael Niedermayer

avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop

Averaging over 2 pixels doesn't work correctly for the last pixel, because the
rest of the buffer is not initialized.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 87513d654546a99f8ddb045ca4fa5d33778a617e)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e29761b1c850513b19f435cf59903ee63991a30c
---

 libavcodec/a64multienc.c |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index 0cdec2e..be68cd5 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -78,9 +78,13 @@ static void to_meta_with_crop(AVCodecContext *avctx, AVFrame 
*p, int *dest)
 for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
 for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
 if(x < width && y < height) {
-/* build average over 2 pixels */
-luma = (src[(x + 0 + y * p->linesize[0])] +
-src[(x + 1 + y * p->linesize[0])]) / 2;
+if (x + 1 < width) {
+/* build average over 2 pixels */
+luma = (src[(x + 0 + y * p->linesize[0])] +
+src[(x + 1 + y * p->linesize[0])]) / 2;
+} else {
+luma = src[(x + y * p->linesize[0])];
+}
 /* write blocks as linear data now so they are 
suitable for elbg */
 dest[0] = luma;
 }

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


[FFmpeg-cvslog] mips/acelp_filters: fix incorrect register constraint

2015-03-14 Thread James Cowgill
ffmpeg | branch: release/2.2 | James Cowgill  | Thu 
Feb 26 13:42:52 2015 +| [b9d09fb8c9998a533289c2fd9db8792570c9ff8f] | 
committer: Michael Niedermayer

mips/acelp_filters: fix incorrect register constraint

Change register constraint on the v variable from = to +. This was causing GCC
to think that the v variable was never read and therefore not initialize it.

This fixes about 20 fate failures on mips64el.

Signed-off-by: James Cowgill 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b9de1303a6414174ab2f3bccefa801bfabcf0f88)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9d09fb8c9998a533289c2fd9db8792570c9ff8f
---

 libavcodec/mips/acelp_filters_mips.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mips/acelp_filters_mips.c 
b/libavcodec/mips/acelp_filters_mips.c
index c8d980a..ffc0fe6 100644
--- a/libavcodec/mips/acelp_filters_mips.c
+++ b/libavcodec/mips/acelp_filters_mips.c
@@ -89,7 +89,7 @@ static void ff_acelp_interpolatef_mips(float *out, const 
float *in,
 "addu   %[p_filter_coeffs_m],  %[p_filter_coeffs_m],   %[prec] 
\n\t"
 "madd.s %[v],%[v],%[in_val_m], %[fc_val_m] 
\n\t"
 
-: [v] "=&f" (v),[p_in_p] "+r" (p_in_p), [p_in_m] "+r" (p_in_m),
+: [v] "+&f" (v),[p_in_p] "+r" (p_in_p), [p_in_m] "+r" (p_in_m),
   [p_filter_coeffs_p] "+r" (p_filter_coeffs_p),
   [in_val_p] "=&f" (in_val_p), [in_val_m] "=&f" (in_val_m),
   [fc_val_p] "=&f" (fc_val_p), [fc_val_m] "=&f" (fc_val_m),

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


[FFmpeg-cvslog] swscale/utils: clear formatConvBuffer on allocation

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Fri Feb 
27 03:12:23 2015 +0100| [e32e1e3a4fe084d76104285baa58ebb34868d912] | committer: 
Michael Niedermayer

swscale/utils: clear formatConvBuffer on allocation

Fixes use of uninitialized memory
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 007498fc1a639ecee2cda1892cbcff66c7c8c951)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e32e1e3a4fe084d76104285baa58ebb34868d912
---

 libswscale/utils.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 975a780..f82cc36 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1339,7 +1339,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 c->chrDstW = FF_CEIL_RSHIFT(dstW, c->chrDstHSubSample);
 c->chrDstH = FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample);
 
-FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail);
+FF_ALLOCZ_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, 
fail);
 
 /* unscaled special cases */
 if (unscaled && !usesHFilter && !usesVFilter &&

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


[FFmpeg-cvslog] Fix buffer_size argument to init_put_bits() in multiple encoders.

2015-03-14 Thread Dyami Caliri
ffmpeg | branch: release/2.2 | Dyami Caliri  | Thu Feb 
26 10:17:01 2015 -0800| [265ad094a8cbf071f24a32370a7ed3e2e7539e5a] | committer: 
Michael Niedermayer

Fix buffer_size argument to init_put_bits() in multiple encoders.

Several encoders were multiplying the buffer size by 8, in order to get
a bit size. However, the buffer_size argument is for the byte size of
the buffer. We had experienced crashes encoding prores (Anatoliy) at
size 4096x4096.
(cherry picked from commit 50833c9f7b4e1922197a8955669f8ab3589c8cef)

Conflicts:

libavcodec/proresenc_kostya.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=265ad094a8cbf071f24a32370a7ed3e2e7539e5a
---

 libavcodec/aacenc.c |2 +-
 libavcodec/adpcmenc.c   |4 ++--
 libavcodec/faxcompr.c   |2 +-
 libavcodec/flashsv2enc.c|2 +-
 libavcodec/flashsvenc.c |2 +-
 libavcodec/nellymoserenc.c  |2 +-
 libavcodec/proresenc_anatoliy.c |2 +-
 libavcodec/proresenc_kostya.c   |2 +-
 libavcodec/s302menc.c   |2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 5596b4b..24de94f 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -165,7 +165,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
 PutBitContext pb;
 AACEncContext *s = avctx->priv_data;
 
-init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
+init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
 put_bits(&pb, 5, 2); //object type - AAC-LC
 put_bits(&pb, 4, s->samplerate_index); //sample rate index
 put_bits(&pb, 4, s->channels);
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index da149a3..e0737e2 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -541,7 +541,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
 case AV_CODEC_ID_ADPCM_IMA_QT:
 {
 PutBitContext pb;
-init_put_bits(&pb, dst, pkt_size * 8);
+init_put_bits(&pb, dst, pkt_size);
 
 for (ch = 0; ch < avctx->channels; ch++) {
 ADPCMChannelStatus *status = &c->status[ch];
@@ -571,7 +571,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
 case AV_CODEC_ID_ADPCM_SWF:
 {
 PutBitContext pb;
-init_put_bits(&pb, dst, pkt_size * 8);
+init_put_bits(&pb, dst, pkt_size);
 
 n = frame->nb_samples - 1;
 
diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c
index 900851b..d2ba706 100644
--- a/libavcodec/faxcompr.c
+++ b/libavcodec/faxcompr.c
@@ -251,7 +251,7 @@ static void put_line(uint8_t *dst, int size, int width, 
const int *runs)
 PutBitContext pb;
 int run, mode = ~0, pix_left = width, run_idx = 0;
 
-init_put_bits(&pb, dst, size * 8);
+init_put_bits(&pb, dst, size);
 while (pix_left > 0) {
 run   = runs[run_idx++];
 mode  = ~mode;
diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c
index 436daa4..5fff04c 100644
--- a/libavcodec/flashsv2enc.c
+++ b/libavcodec/flashsv2enc.c
@@ -287,7 +287,7 @@ static int write_header(FlashSV2Context * s, uint8_t * buf, 
int buf_size)
 if (buf_size < 5)
 return -1;
 
-init_put_bits(&pb, buf, buf_size * 8);
+init_put_bits(&pb, buf, buf_size);
 
 put_bits(&pb, 4, (s->block_width  >> 4) - 1);
 put_bits(&pb, 12, s->image_width);
diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c
index 7ad15f1..6d406e9 100644
--- a/libavcodec/flashsvenc.c
+++ b/libavcodec/flashsvenc.c
@@ -151,7 +151,7 @@ static int encode_bitstream(FlashSVContext *s, const 
AVFrame *p, uint8_t *buf,
 int buf_pos, res;
 int pred_blocks = 0;
 
-init_put_bits(&pb, buf, buf_size * 8);
+init_put_bits(&pb, buf, buf_size);
 
 put_bits(&pb,  4, block_width / 16 - 1);
 put_bits(&pb, 12, s->image_width);
diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c
index f9d1389..8f15757 100644
--- a/libavcodec/nellymoserenc.c
+++ b/libavcodec/nellymoserenc.c
@@ -301,7 +301,7 @@ static void encode_block(NellyMoserEncodeContext *s, 
unsigned char *output, int
 
 apply_mdct(s);
 
-init_put_bits(&pb, output, output_size * 8);
+init_put_bits(&pb, output, output_size);
 
 i = 0;
 for (band = 0; band < NELLY_BANDS; band++) {
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 80ce135..da25b6b 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -304,7 +304,7 @@ static int encode_slice_plane(AVCodecContext *avctx, int 
mb_count,
 }
 
 blocks_per_slice = mb_count << (2 - chroma);
-init_put_bits(&pb, buf, buf_size << 3);
+init_put_bits(&pb, buf, buf_size);
 
 encode_dc_coeffs(&pb, blocks, blocks_per_slice, qmat);
 encode_ac_coeffs(avctx, &pb, blocks, blocks_per_slice, qmat);
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c

[FFmpeg-cvslog] avcodec/utils: Align YUV411 by as much as the other YUV variants

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Sat Mar 
 7 14:30:34 2015 +0100| [2e5579bbb4f84fbaecfba57166506801603303e2] | committer: 
Michael Niedermayer

avcodec/utils: Align YUV411 by as much as the other YUV variants

Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash2.avi

Found-by: Thomas Lindroth 
Tested-by: Thomas Lindroth 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit e3201c38d53d2b8b24d0bc95d726b2cb1752dc12)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e5579bbb4f84fbaecfba57166506801603303e2
---

 libavcodec/utils.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0872e32..8eb450c 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -375,7 +375,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int 
*width, int *height,
 case AV_PIX_FMT_YUVJ411P:
 case AV_PIX_FMT_UYYVYY411:
 w_align = 32;
-h_align = 8;
+h_align = 16 * 2;
 break;
 case AV_PIX_FMT_YUV410P:
 if (s->codec_id == AV_CODEC_ID_SVQ1) {

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


[FFmpeg-cvslog] ffmdec: fix infinite loop at EOF

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Sun Mar  8 23:31:48 2015 +0100| 
[88cc4a405a4602edf49832cccb6a4c7ffd266b2d] | committer: Michael Niedermayer

ffmdec: fix infinite loop at EOF

If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.

Signed-off-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 6fa98822eba501a4898fdec5b75acd3026201005)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88cc4a405a4602edf49832cccb6a4c7ffd266b2d
---

 libavformat/ffmdec.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 91882b2..338a850 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -356,7 +356,7 @@ static int ffm2_read_header(AVFormatContext *s)
 }
 
 /* get until end of block reached */
-while ((avio_tell(pb) % ffm->packet_size) != 0)
+while ((avio_tell(pb) % ffm->packet_size) != 0 && !pb->eof_reached)
 avio_r8(pb);
 
 /* init packet demux */
@@ -488,7 +488,7 @@ static int ffm_read_header(AVFormatContext *s)
 }
 
 /* get until end of block reached */
-while ((avio_tell(pb) % ffm->packet_size) != 0)
+while ((avio_tell(pb) % ffm->packet_size) != 0 && !pb->eof_reached)
 avio_r8(pb);
 
 /* init packet demux */

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


[FFmpeg-cvslog] avformat/adxdec: check avctx->channels for invalid values

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Wed Feb 25 22:55:44 2015 +0100| 
[3193f4d3f2a6ad982d4fdbb4dc226ea8d81572b7] | committer: Michael Niedermayer

avformat/adxdec: check avctx->channels for invalid values

This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 7faa40af982960608b117e20fec999b48011e5e0)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3193f4d3f2a6ad982d4fdbb4dc226ea8d81572b7
---

 libavformat/adxdec.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c
index fe22c3a..b577b89 100644
--- a/libavformat/adxdec.c
+++ b/libavformat/adxdec.c
@@ -41,6 +41,11 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt)
 AVCodecContext *avctx = s->streams[0]->codec;
 int ret, size;
 
+if (avctx->channels <= 0) {
+av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", 
avctx->channels);
+return AVERROR_INVALIDDATA;
+}
+
 size = BLOCK_SIZE * avctx->channels;
 
 pkt->pos = avio_tell(s->pb);

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


[FFmpeg-cvslog] vp9: ignore reference segmentation map if error_resilience flag is set.

2015-03-14 Thread Ronald S. Bultje
ffmpeg | branch: release/2.2 | Ronald S. Bultje  | Tue Aug 
12 18:11:05 2014 -0400| [77e8bd8ce62a968b5ba318635f94de3dd8cce7eb] | committer: 
Michael Niedermayer

vp9: ignore reference segmentation map if error_resilience flag is set.

Fixes ffvp9_fails_where_libvpx.succeeds.webm from ticket 3849.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 14e3025518124f99cb0f5885feb603a9f217d25d)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=77e8bd8ce62a968b5ba318635f94de3dd8cce7eb
---

 libavcodec/vp9.c |   26 +++---
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 669..3306c57 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -278,7 +278,7 @@ static int vp9_alloc_frame(AVCodecContext *ctx, VP9Frame *f)
 
 // retain segmentation map if it doesn't update
 if (s->segmentation.enabled && !s->segmentation.update_map &&
-!s->intraonly && !s->keyframe) {
+!s->intraonly && !s->keyframe && !s->errorres) {
 memcpy(f->segmentation_map, s->frames[LAST_FRAME].segmentation_map, 
sz);
 }
 
@@ -1344,16 +1344,20 @@ static void decode_mode(AVCodecContext *ctx)
 vp56_rac_get_prob_branchy(&s->c,
 s->prob.segpred[s->above_segpred_ctx[col] +
 s->left_segpred_ctx[row7]]))) {
-int pred = 8, x;
-uint8_t *refsegmap = s->frames[LAST_FRAME].segmentation_map;
-
-if (!s->last_uses_2pass)
-ff_thread_await_progress(&s->frames[LAST_FRAME].tf, row >> 3, 0);
-for (y = 0; y < h4; y++)
-for (x = 0; x < w4; x++)
-pred = FFMIN(pred, refsegmap[(y + row) * 8 * s->sb_cols + x + 
col]);
-av_assert1(pred < 8);
-b->seg_id = pred;
+if (!s->errorres) {
+int pred = 8, x;
+uint8_t *refsegmap = s->frames[LAST_FRAME].segmentation_map;
+
+if (!s->last_uses_2pass)
+ff_thread_await_progress(&s->frames[LAST_FRAME].tf, row >> 3, 
0);
+for (y = 0; y < h4; y++)
+for (x = 0; x < w4; x++)
+pred = FFMIN(pred, refsegmap[(y + row) * 8 * s->sb_cols + 
x + col]);
+av_assert1(pred < 8);
+b->seg_id = pred;
+} else {
+b->seg_id = 0;
+}
 
 memset(&s->above_segpred_ctx[col], 1, w4);
 memset(&s->left_segpred_ctx[row7], 1, h4);

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


[FFmpeg-cvslog] swscale/utils: More carefully merge and clear coefficients outside the input

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Tue Feb 
24 00:32:39 2015 +0100| [d125abfa748797e80fa6458e86260f5ddb1ef2cc] | committer: 
Michael Niedermayer

swscale/utils: More carefully merge and clear coefficients outside the input

Fixes out of array read
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 1895d414aaacece3b57d7bf19502305e9a064fae)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d125abfa748797e80fa6458e86260f5ddb1ef2cc
---

 libswscale/utils.c |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 9db6af6..975a780 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -619,14 +619,24 @@ static av_cold int initFilter(int16_t **outFilter, 
int32_t **filterPos,
 
 if ((*filterPos)[i] + filterSize > srcW) {
 int shift = (*filterPos)[i] + FFMIN(filterSize - srcW, 0);
+int64_t acc = 0;
 
-// move filter coefficients right to compensate for filterPos
-for (j = filterSize - 2; j >= 0; j--) {
-int right = FFMIN(j + shift, filterSize - 1);
-filter[i * filterSize + right] += filter[i * filterSize + j];
-filter[i * filterSize + j]  = 0;
+for (j = filterSize - 1; j >= 0; j--) {
+if ((*filterPos)[i] + j >= srcW) {
+acc += filter[i * filterSize + j];
+filter[i * filterSize + j] = 0;
+}
 }
+for (j = filterSize - 1; j >= 0; j--) {
+if (j < shift) {
+filter[i * filterSize + j] = 0;
+} else {
+filter[i * filterSize + j] = filter[i * filterSize + j - 
shift];
+}
+}
+
 (*filterPos)[i]-= shift;
+filter[i * filterSize + srcW - 1 - (*filterPos)[i]] += acc;
 }
 }
 

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


[FFmpeg-cvslog] avcodec/hevc_ps: Sanity checks for some log2_* values

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Wed Feb 
25 15:51:28 2015 +0100| [a3cd26aa33eda9f333f4024bab48717c38c78a90] | committer: 
Michael Niedermayer

avcodec/hevc_ps: Sanity checks for some log2_* values

log2 values which imply numeric overflow are not supported

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 205b2ba3d677330e023aac2f4bd3f624039256b9)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a3cd26aa33eda9f333f4024bab48717c38c78a90
---

 libavcodec/hevc_ps.c |   21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index c575fce..be1adb1 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -787,11 +787,30 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
 sps->log2_max_trafo_size = 
log2_diff_max_min_transform_block_size +
sps->log2_min_tb_size;
 
-if (sps->log2_min_tb_size >= sps->log2_min_cb_size) {
+if (sps->log2_min_cb_size < 3 || sps->log2_min_cb_size > 30) {
+av_log(s->avctx, AV_LOG_ERROR, "Invalid value %d for 
log2_min_cb_size", sps->log2_min_cb_size);
+ret = AVERROR_INVALIDDATA;
+goto err;
+}
+
+if (sps->log2_diff_max_min_coding_block_size > 30) {
+av_log(s->avctx, AV_LOG_ERROR, "Invalid value %d for 
log2_diff_max_min_coding_block_size", sps->log2_diff_max_min_coding_block_size);
+ret = AVERROR_INVALIDDATA;
+goto err;
+}
+
+if (sps->log2_min_tb_size >= sps->log2_min_cb_size || 
sps->log2_min_tb_size < 2) {
 av_log(s->avctx, AV_LOG_ERROR, "Invalid value for log2_min_tb_size");
 ret = AVERROR_INVALIDDATA;
 goto err;
 }
+
+if (log2_diff_max_min_transform_block_size < 0 || 
log2_diff_max_min_transform_block_size > 30) {
+av_log(s->avctx, AV_LOG_ERROR, "Invalid value %d for 
log2_diff_max_min_transform_block_size", 
log2_diff_max_min_transform_block_size);
+ret = AVERROR_INVALIDDATA;
+goto err;
+}
+
 sps->max_transform_hierarchy_depth_inter = get_ue_golomb_long(gb);
 sps->max_transform_hierarchy_depth_intra = get_ue_golomb_long(gb);
 

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


[FFmpeg-cvslog] avformat/gxf: Use 64bit for res to avoid overflow

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Fri Feb 
20 20:14:56 2015 +0100| [2ee4b48c9b72867ceae99151a0c69d3f7be1660e] | committer: 
Michael Niedermayer

avformat/gxf: Use 64bit for res to avoid overflow

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 12987f89007ee82b9d3a6090085dfaef8461ab8b)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ee4b48c9b72867ceae99151a0c69d3f7be1660e
---

 libavformat/gxf.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/gxf.c b/libavformat/gxf.c
index c36479a..f8053a0 100644
--- a/libavformat/gxf.c
+++ b/libavformat/gxf.c
@@ -556,7 +556,7 @@ static int gxf_packet(AVFormatContext *s, AVPacket *pkt) {
 }
 
 static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, 
int flags) {
-int res = 0;
+int64_t res = 0;
 uint64_t pos;
 uint64_t maxlen = 100 * 1024 * 1024;
 AVStream *st = s->streams[0];

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


[FFmpeg-cvslog] vp9: fix segmentation map retention with threading enabled.

2015-03-14 Thread Ronald S. Bultje
ffmpeg | branch: release/2.2 | Ronald S. Bultje  | Fri Mar  
6 21:07:54 2015 -0500| [2cde388aeabcbeb69fd899c4171729ddd824be7f] | committer: 
Michael Niedermayer

vp9: fix segmentation map retention with threading enabled.

Fixes ticket 4359.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit efff3854f05d171f5ad3e4f4206533b255a6d267)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2cde388aeabcbeb69fd899c4171729ddd824be7f
---

 libavcodec/vp9.c |   16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 3306c57..07d1497 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -278,7 +278,8 @@ static int vp9_alloc_frame(AVCodecContext *ctx, VP9Frame *f)
 
 // retain segmentation map if it doesn't update
 if (s->segmentation.enabled && !s->segmentation.update_map &&
-!s->intraonly && !s->keyframe && !s->errorres) {
+!s->intraonly && !s->keyframe && !s->errorres &&
+ctx->active_thread_type != FF_THREAD_FRAME) {
 memcpy(f->segmentation_map, s->frames[LAST_FRAME].segmentation_map, 
sz);
 }
 
@@ -1350,9 +1351,18 @@ static void decode_mode(AVCodecContext *ctx)
 
 if (!s->last_uses_2pass)
 ff_thread_await_progress(&s->frames[LAST_FRAME].tf, row >> 3, 
0);
-for (y = 0; y < h4; y++)
+for (y = 0; y < h4; y++) {
+int idx_base = (y + row) * 8 * s->sb_cols + col;
 for (x = 0; x < w4; x++)
-pred = FFMIN(pred, refsegmap[(y + row) * 8 * s->sb_cols + 
x + col]);
+pred = FFMIN(pred, refsegmap[idx_base + x]);
+if (!s->segmentation.update_map && ctx->active_thread_type == 
FF_THREAD_FRAME) {
+// FIXME maybe retain reference to previous frame as
+// segmap reference instead of copying the whole map
+// into a new buffer
+memcpy(&s->frames[CUR_FRAME].segmentation_map[idx_base],
+   &refsegmap[idx_base], w4);
+}
+}
 av_assert1(pred < 8);
 b->seg_id = pred;
 } else {

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


[FFmpeg-cvslog] doc: avoid the incorrect phrase 'allow to'

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Sat Mar  7 19:36:07 2015 +0100| 
[917ce36a2067c3c1a02a54bb0aeb6eff39673dd5] | committer: Michael Niedermayer

doc: avoid the incorrect phrase 'allow to'

Signed-off-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 10fd7ff814f2a35b5b49a9c3b0d426ead6c7e83f)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=917ce36a2067c3c1a02a54bb0aeb6eff39673dd5
---

 doc/faq.texi  |2 +-
 doc/ffserver.texi |2 +-
 doc/filters.texi  |2 +-
 doc/formats.texi  |4 ++--
 doc/indevs.texi   |2 +-
 doc/utils.texi|4 ++--
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/faq.texi b/doc/faq.texi
index 74c259f..a9e779b 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -298,7 +298,7 @@ FFmpeg has a 
@url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
 @code{concat}} protocol designed specifically for that, with examples in the
 documentation.
 
-A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
+A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate
 video by merely concatenating the files containing them.
 
 Hence you may concatenate your multimedia files by first transcoding them to
diff --git a/doc/ffserver.texi b/doc/ffserver.texi
index fb90dd6..d45a0ee 100644
--- a/doc/ffserver.texi
+++ b/doc/ffserver.texi
@@ -71,7 +71,7 @@ the HTTP server (configured through the @option{Port} 
option), and
 configuration file.
 
 Each feed is associated to a file which is stored on disk. This stored
-file is used to allow to send pre-recorded data to a player as fast as
+file is used to send pre-recorded data to a player as fast as
 possible when new content is added in real-time to the stream.
 
 A "live-stream" or "stream" is a resource published by
diff --git a/doc/filters.texi b/doc/filters.texi
index b7a1b34..ec1449a 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3143,7 +3143,7 @@ Set number overlapping pixels for each block. Each block 
is of size
 @code{16x16}. Since the filter can be slow, you may want to reduce this value,
 at the cost of a less effective filter and the risk of various artefacts.
 
-If the overlapping value doesn't allow to process the whole input width or
+If the overlapping value doesn't permit processing the whole input width or
 height, a warning will be displayed and according borders won't be denoised.
 
 Default value is @code{15}.
diff --git a/doc/formats.texi b/doc/formats.texi
index 027510e..910ffd2 100644
--- a/doc/formats.texi
+++ b/doc/formats.texi
@@ -23,7 +23,7 @@ Reduce buffering.
 
 @item probesize @var{integer} (@emph{input})
 Set probing size in bytes, i.e. the size of the data to analyze to get
-stream information. A higher value will allow to detect more
+stream information. A higher value will enable detecting more
 information in case it is dispersed into the stream, but will increase
 latency. Must be an integer not lesser than 32. It is 500 by default.
 
@@ -63,7 +63,7 @@ Default is 0.
 
 @item analyzeduration @var{integer} (@emph{input})
 Specify how many microseconds are analyzed to probe the input. A
-higher value will allow to detect more accurate information, but will
+higher value will enable detecting more accurate information, but will
 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
 
 @item cryptokey @var{hexadecimal string} (@emph{input})
diff --git a/doc/indevs.texi b/doc/indevs.texi
index 93fbbe8..e63d71b 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -1,7 +1,7 @@
 @chapter Input Devices
 @c man begin INPUT DEVICES
 
-Input devices are configured elements in FFmpeg which allow to access
+Input devices are configured elements in FFmpeg which enable accessing
 the data coming from a multimedia device attached to your system.
 
 When you configure your FFmpeg build, all the supported input devices
diff --git a/doc/utils.texi b/doc/utils.texi
index 5abfb0c..05fbced 100644
--- a/doc/utils.texi
+++ b/doc/utils.texi
@@ -841,7 +841,7 @@ Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
 Return 1.0 if @var{x} is NAN, 0.0 otherwise.
 
 @item ld(var)
-Allow to load the value of the internal variable with number
+Load the value of the internal variable with number
 @var{var}, which was previously stored with st(@var{var}, @var{expr}).
 The function returns the loaded value.
 
@@ -909,7 +909,7 @@ Compute the square root of @var{expr}. This is equivalent to
 Compute expression @code{1/(1 + exp(4*x))}.
 
 @item st(var, expr)
-Allow to store the value of the expression @var{expr} in an internal
+Store the value of the expression @var{expr} in an internal
 variable. @var{var} specifies the number of the variable where to
 store the value, and it is a value ranging from 0 to 9. The function
 returns the value stored in the internal variable.

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ff

[FFmpeg-cvslog] avcodec/tiff: move bpp check to after "end:"

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Sun Mar 
 8 23:27:43 2015 +0100| [d8a8b3948c2996d97958284cb780ead19165da96] | committer: 
Michael Niedermayer

avcodec/tiff: move bpp check to after "end:"

This ensures that all current and future code-pathes get bpp checked

Signed-off-by: Michael Niedermayer 
(cherry picked from commit d5e9fc782150d4596c72440a0aa02b7f4f1254b1)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8a8b3948c2996d97958284cb780ead19165da96
---

 libavcodec/tiff.c |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 998b836..a0b1836 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -636,13 +636,6 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
 s->bpp = -1;
 }
 }
-if (s->bpp > 64U) {
-av_log(s->avctx, AV_LOG_ERROR,
-   "This format is not supported (bpp=%d, %d components)\n",
-   s->bpp, count);
-s->bpp = 0;
-return AVERROR_INVALIDDATA;
-}
 break;
 case TIFF_SAMPLES_PER_PIXEL:
 if (count != 1) {
@@ -934,6 +927,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
 }
 }
 end:
+if (s->bpp > 64U) {
+av_log(s->avctx, AV_LOG_ERROR,
+"This format is not supported (bpp=%d, %d components)\n",
+s->bpp, count);
+s->bpp = 0;
+return AVERROR_INVALIDDATA;
+}
 bytestream2_seek(&s->gb, start, SEEK_SET);
 return 0;
 }

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


[FFmpeg-cvslog] avformat/flvenc: check that the codec_tag fits in the available bits

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Sat Feb 28 20:58:31 2015 +0100| 
[97fb0b2109312bdbe3075d2d5c8c73d1c1750729] | committer: Michael Niedermayer

avformat/flvenc: check that the codec_tag fits in the available bits

flags is later written with avio_w8 and if it doesn't fit in one byte it
triggers an av_assert2.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit e8565d21c276ab9ac5ce785549420321fbd0b093)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=97fb0b2109312bdbe3075d2d5c8c73d1c1750729
---

 libavformat/flvenc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 9778719..553304e 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -488,7 +488,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 avio_w8(pb, FLV_TAG_TYPE_VIDEO);
 
 flags = enc->codec_tag;
-if (flags == 0) {
+if (flags <= 0 || flags > 15) {
 av_log(s, AV_LOG_ERROR,
"Video codec '%s' is not compatible with FLV\n",
avcodec_get_name(enc->codec_id));

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


[FFmpeg-cvslog] aic: Fix decoding files with odd dimensions

2015-03-14 Thread Vittorio Giovara
ffmpeg | branch: release/2.2 | Vittorio Giovara  | 
Fri Feb 27 19:00:25 2015 +| [5537faaf19d36a4e89b10d832c0dc2aca6171629] | 
committer: Michael Niedermayer

aic: Fix decoding files with odd dimensions

Normally the aic decoder finds the proper slice combination (multiple of
some number less than 32) but in case of odd width, it resorts to the
default values, which were actually swapped.
The number of slices is modified to account for such odd width cases.

CC: libav-sta...@libav.org
(cherry picked from commit e878ec0d47cd6228c367b2f3128b76d7523f7255)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5537faaf19d36a4e89b10d832c0dc2aca6171629
---

 libavcodec/aic.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aic.c b/libavcodec/aic.c
index 3963642..674f230 100644
--- a/libavcodec/aic.c
+++ b/libavcodec/aic.c
@@ -437,8 +437,8 @@ static av_cold int aic_decode_init(AVCodecContext *avctx)
 ctx->mb_width  = FFALIGN(avctx->width,  16) >> 4;
 ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;
 
-ctx->num_x_slices = 16;
-ctx->slice_width  = ctx->mb_width / 16;
+ctx->num_x_slices = (ctx->mb_width + 15) >> 4;
+ctx->slice_width  = 16;
 for (i = 1; i < 32; i++) {
 if (!(ctx->mb_width % i) && (ctx->mb_width / i < 32)) {
 ctx->slice_width  = ctx->mb_width / i;

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


[FFmpeg-cvslog] avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Thu Feb 
19 16:25:29 2015 +0100| [1a396d1ee0d6114af4397c6335877fb28f897d37] | committer: 
Michael Niedermayer

avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()

Based on patch by Francisco Blas Izquierdo Riera
Commit message partly taken from carl

fixes a compilation
error in mlpdsp_init.c with -fstack-check and some gcc compilers (I
reproduced the issue with gcc 4.7.3) by simplifying the code.

See also https://bugs.gentoo.org/show_bug.cgi?id=471756

$ make libavcodec/x86/mlpdsp_init.o
libavcodec/x86/mlpdsp_init.c: In function ‘mlp_filter_channel_x86’:
libavcodec/x86/mlpdsp_init.c:142:5: error: can’t find a register in
class ‘GENERAL_REGS’ while reloading ‘asm’
libavcodec/x86/mlpdsp_init.c:142:5: error: ‘asm’ operand has impossible
constraints

4551 -> 4509 dezicycles

Reviewed-by: Ramiro Polla 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 03f39fbb2a558153a3c464edec1378d637a755fe)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a396d1ee0d6114af4397c6335877fb28f897d37
---

 libavcodec/x86/mlpdsp.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/x86/mlpdsp.c b/libavcodec/x86/mlpdsp.c
index 94849b7..a3ac207 100644
--- a/libavcodec/x86/mlpdsp.c
+++ b/libavcodec/x86/mlpdsp.c
@@ -132,8 +132,8 @@ static void mlp_filter_channel_x86(int32_t *state, const 
int32_t *coeff,
 FIRMUL   (ff_mlp_firorder_6, 0x14   )
 FIRMUL   (ff_mlp_firorder_5, 0x10   )
 FIRMUL   (ff_mlp_firorder_4, 0x0c   )
-FIRMULREG(ff_mlp_firorder_3, 0x08,10)
-FIRMULREG(ff_mlp_firorder_2, 0x04, 9)
+FIRMUL   (ff_mlp_firorder_3, 0x08   )
+FIRMUL   (ff_mlp_firorder_2, 0x04   )
 FIRMULREG(ff_mlp_firorder_1, 0x00, 8)
 LABEL_MANGLE(ff_mlp_firorder_0)":\n\t"
 "jmp  *%6 \n\t"
@@ -162,8 +162,6 @@ static void mlp_filter_channel_x86(int32_t *state, const 
int32_t *coeff,
 : /* 4*/"r"((x86_reg)mask), /* 5*/"r"(firjump),
   /* 6*/"r"(iirjump)  , /* 7*/"c"(filter_shift)
 , /* 8*/"r"((int64_t)coeff[0])
-, /* 9*/"r"((int64_t)coeff[1])
-, /*10*/"r"((int64_t)coeff[2])
 : "rax", "rdx", "rsi"
 #else /* ARCH_X86_32 */
   /* 3*/"+m"(blocksize)

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


[FFmpeg-cvslog] avformat/mvdec: Use 64bit for ret to avoid overflow

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Fri Feb 
20 20:41:35 2015 +0100| [c4b5b3309ca97bbb45ab9437a8deaab1299f82e1] | committer: 
Michael Niedermayer

avformat/mvdec: Use 64bit for ret to avoid overflow

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 26c0cc154e06cb0064b3a3da49447ac44d82444f)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4b5b3309ca97bbb45ab9437a8deaab1299f82e1
---

 libavformat/mvdec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 5525233..8d6a26c 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -371,7 +371,7 @@ static int mv_read_packet(AVFormatContext *avctx, AVPacket 
*pkt)
 AVStream *st = avctx->streams[mv->stream_index];
 const AVIndexEntry *index;
 int frame = mv->frame[mv->stream_index];
-int ret;
+int64_t ret;
 uint64_t pos;
 
 if (frame  < st->nb_index_entries) {

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


[FFmpeg-cvslog] avformat/vqf: Use 64bit for ret to avoid overflow

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Fri Feb 
20 21:00:57 2015 +0100| [c5c39132b4a3ef7f72dda8ea3d389eb3ba04860b] | committer: 
Michael Niedermayer

avformat/vqf: Use 64bit for ret to avoid overflow

Signed-off-by: Michael Niedermayer 
(cherry picked from commit cb08687180683a755d0fe9d425280d0e4d1e6db2)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c5c39132b4a3ef7f72dda8ea3d389eb3ba04860b
---

 libavformat/vqf.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index 74c7f5f..a470366 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -265,7 +265,7 @@ static int vqf_read_seek(AVFormatContext *s,
 {
 VqfContext *c = s->priv_data;
 AVStream *st;
-int ret;
+int64_t ret;
 int64_t pos;
 
 st = s->streams[stream_index];

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


[FFmpeg-cvslog] avcodec/a64multienc: use av_frame_ref instead of copying the frame

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.2 | Andreas Cadhalpun 
 | Sun Feb 22 20:43:30 2015 +0100| 
[baa1738f99187fc2c6ce16e5e79d45d1eb555d63] | committer: Michael Niedermayer

avcodec/a64multienc: use av_frame_ref instead of copying the frame

This fixes freeing the frame buffer twice on cleanup leading to a crash.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 39e4ed7c1d8d840be47f6d604704d47a59a9ae5d)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=baa1738f99187fc2c6ce16e5e79d45d1eb555d63
---

 libavcodec/a64multienc.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index af3f965..89cd2f5 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -317,7 +317,9 @@ static int a64multi_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 } else {
 /* fill up mc_meta_charset with data until lifetime exceeds */
 if (c->mc_frame_counter < c->mc_lifetime) {
-*p = *pict;
+ret = av_frame_ref(p, pict);
+if (ret < 0)
+return ret;
 p->pict_type = AV_PICTURE_TYPE_I;
 p->key_frame = 1;
 to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);

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


[FFmpeg-cvslog] avcodec/zmbv: Check len before reading in decode_frame()

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Wed Feb 
25 12:29:10 2015 +0100| [c803985132042edfa2b2c11223e1ac39d38a66db] | committer: 
Michael Niedermayer

avcodec/zmbv: Check len before reading in decode_frame()

Fixes out of array read
Fixes: asan_heap-oob_4d4eb0_3994_cov_3169972261_zmbv_15bit.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 1f5c7781e63d6519192ada59c1e36bcecc92791d)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c803985132042edfa2b2c11223e1ac39d38a66db
---

 libavcodec/zmbv.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 71e8287..048cbb5 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -410,11 +410,16 @@ static int decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame, AVPac
 int hi_ver, lo_ver, ret;
 
 /* parse header */
+if (len < 1)
+return AVERROR_INVALIDDATA;
 c->flags = buf[0];
 buf++; len--;
 if (c->flags & ZMBV_KEYFRAME) {
 void *decode_intra = NULL;
 c->decode_intra= NULL;
+
+if (len < 6)
+return AVERROR_INVALIDDATA;
 hi_ver = buf[0];
 lo_ver = buf[1];
 c->comp = buf[2];

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


[FFmpeg-cvslog] avcodec/snowdec: Fix ref value check

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Tue Feb 
24 03:12:22 2015 +0100| [c4d250abcaf72f57c2937043dc6bdb502bfb9c69] | committer: 
Michael Niedermayer

avcodec/snowdec: Fix ref value check

Fixes integer overflow and out of array read.
Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 8f4cbf940212079a34753c7f4d6c6b5a43586d30)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4d250abcaf72f57c2937043dc6bdb502bfb9c69
---

 libavcodec/snowdec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 79cf5a1..7651373 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -153,7 +153,7 @@ static int decode_q_branch(SnowContext *s, int level, int 
x, int y){
 int l = left->color[0];
 int cb= left->color[1];
 int cr= left->color[2];
-int ref = 0;
+unsigned ref = 0;
 int ref_context= av_log2(2*left->ref) + av_log2(2*top->ref);
 int mx_context= av_log2(2*FFABS(left->mx - top->mx)) + 
0*av_log2(2*FFABS(tr->mx - top->mx));
 int my_context= av_log2(2*FFABS(left->my - top->my)) + 
0*av_log2(2*FFABS(tr->my - top->my));

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


[FFmpeg-cvslog] avcodec/h264: Only reinit quant tables if a new PPS is allowed

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Tue Feb 
24 20:49:07 2015 +0100| [ec7c1cd73319bbe75924f77363e710217f0878da] | committer: 
Michael Niedermayer

avcodec/h264: Only reinit quant tables if a new PPS is allowed

Fixes null pointer dereference
Fixes: signal_sigsegv_3042097_3007_cov_1741463594_non_monotone_timestamps1.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit c23a0e77dd492d6c794f89dbff3a438c95745e70)

Conflicts:

libavcodec/h264_slice.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec7c1cd73319bbe75924f77363e710217f0878da
---

 libavcodec/h264.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 00f9e07..56858f4 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3712,7 +3712,7 @@ static int decode_slice_header(H264Context *h, 
H264Context *h0)
 }
 }
 
-if (h == h0 && h->dequant_coeff_pps != pps_id) {
+if (first_slice && h->dequant_coeff_pps != pps_id) {
 h->dequant_coeff_pps = pps_id;
 init_dequant_tables(h);
 }

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


[FFmpeg-cvslog] avcodec/a64multienc: don't set incorrect packet size

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Mon Feb 
23 01:21:30 2015 +0100| [5c4dc00c3a6d8403a881fc810dc38ae861a1eef4] | committer: 
Michael Niedermayer

avcodec/a64multienc: don't set incorrect packet size

This fixes invalid reads of the packet buffer in av_dup_packet

Based on patch by Andreas Cadhalpun 

Signed-off-by: Michael Niedermayer 
(cherry picked from commit d96142e9af92ded84f2580620c571ab96c4bb657)

Conflicts:

libavcodec/a64multienc.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c4dc00c3a6d8403a881fc810dc38ae861a1eef4
---

 libavcodec/a64multienc.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index 89cd2f5..0cdec2e 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -336,8 +336,8 @@ static int a64multi_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 req_size = 0;
 /* any frames to encode? */
 if (c->mc_lifetime) {
-req_size = charset_size + c->mc_lifetime*(screen_size + 
colram_size);
-if ((ret = ff_alloc_packet2(avctx, pkt, req_size)) < 0)
+int alloc_size = charset_size + c->mc_lifetime*(screen_size + 
colram_size);
+if ((ret = ff_alloc_packet2(avctx, pkt, alloc_size)) < 0)
 return ret;
 buf = pkt->data;
 
@@ -354,6 +354,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 /* advance pointers */
 buf  += charset_size;
 charset  += charset_size;
+req_size += charset_size;
 }
 
 /* write x frames to buf */

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


[FFmpeg-cvslog] avformat/omadec: Use 64bit for ret to avoid overflow

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Fri Feb 
20 21:01:54 2015 +0100| [2bb09b714ab6978d88de33eab601ef2b315f92b4] | committer: 
Michael Niedermayer

avformat/omadec: Use 64bit for ret to avoid overflow

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 0f55bc29d41585d110b126cb4ed4b395fd46d7ac)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2bb09b714ab6978d88de33eab601ef2b315f92b4
---

 libavformat/omadec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 3ea2ec1..afd483c 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -462,7 +462,7 @@ static int oma_read_seek(struct AVFormatContext *s,
  int stream_index, int64_t timestamp, int flags)
 {
 OMAContext *oc = s->priv_data;
-int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);
+int64_t err = ff_pcm_read_seek(s, stream_index, timestamp, flags);
 
 if (!oc->encrypted)
 return err;

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


[FFmpeg-cvslog] Update for FFmpeg 2.2.14

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Sat Mar 
14 14:41:10 2015 +0100| [0746f5035e7ba5573add8bcf8c51e3307cf913f0] | committer: 
Michael Niedermayer

Update for FFmpeg 2.2.14

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0746f5035e7ba5573add8bcf8c51e3307cf913f0
---

 RELEASE  |2 +-
 doc/Doxyfile |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/RELEASE b/RELEASE
index f2b42fc..42a4ee5 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-2.2.13
+2.2.14
diff --git a/doc/Doxyfile b/doc/Doxyfile
index b25ee35..92ec9d1 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME   = FFmpeg
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER = 2.2.13
+PROJECT_NUMBER = 2.2.14
 
 # With the PROJECT_LOGO tag one can specify a logo or icon that is included
 # in the documentation. The maximum height of the logo should not exceed 55

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


[FFmpeg-cvslog] ac3dec: cosmetics

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 11:49:00 2015 +| [73ebbfdff0bb2c22e3b5c14b11485e5798a317fd] | 
committer: Michael Niedermayer

ac3dec: cosmetics

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=73ebbfdff0bb2c22e3b5c14b11485e5798a317fd
---

 libavcodec/ac3dec.c |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index ae4129f..ac53bdc 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -924,14 +924,13 @@ static int decode_audio_block(AC3DecodeContext *s, int 
blk)
 
 bin = s->spx_src_start_freq;
 for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
-int bandsize;
+int bandsize = s->spx_band_sizes[bnd];
 int spx_coord_exp, spx_coord_mant;
 INTFLOAT nratio, sblend, nblend;
 #if USE_FIXED
-int64_t accu;
 /* calculate blending factors */
-bandsize = s->spx_band_sizes[bnd];
-accu = (int64_t)((bin << 23) + (bandsize << 22)) * 
s->spx_dst_end_freq;
+int64_t accu = ((bin << 23) + (bandsize << 22))
+ * (int64_t)s->spx_dst_end_freq;
 nratio = (int)(accu >> 32);
 nratio -= spx_blend << 18;
 
@@ -951,7 +950,6 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
 float spx_coord;
 
 /* calculate blending factors */
-bandsize = s->spx_band_sizes[bnd];
 nratio = ((float)((bin + (bandsize >> 1))) / 
s->spx_dst_end_freq) - spx_blend;
 nratio = av_clipf(nratio, 0.0f, 1.0f);
 nblend = sqrtf(3.0f * nratio); // noise is scaled by 
sqrt(3)

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


[FFmpeg-cvslog] avcodec/wmadec: Fix undefined shift in wma_decode_block()

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Mar 14 
17:11:59 2015 +0100| [a48b24e5ebdb21d25512ac481a1d396e7685f0a4] | committer: 
Michael Niedermayer

avcodec/wmadec: Fix undefined shift in wma_decode_block()

Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a48b24e5ebdb21d25512ac481a1d396e7685f0a4
---

 libavcodec/wmadec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index d80bd2b..ffbf511 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -697,7 +697,7 @@ static int wma_decode_block(WMACodecContext *s)
 
 /* very high freqs : noise */
 n = s->block_len - s->coefs_end[bsize];
-mult1 = mult * exponents[((-1 << bsize)) >> esize];
+mult1 = mult * exponents[(-(1 << bsize)) >> esize];
 for (i = 0; i < n; i++) {
 *coefs++   = s->noise_table[s->noise_index] * mult1;
 s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 
1);

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


[FFmpeg-cvslog] ppc: libswscale: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 15:30:26 2015 +| [5d38c628b0a84fafc220f070d9d4cf8fbfe96447] | 
committer: Michael Niedermayer

ppc: libswscale: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

The later may yield incorrect code for on-stack variables.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d38c628b0a84fafc220f070d9d4cf8fbfe96447
---

 libswscale/ppc/swscale_altivec.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c
index a1548a7..3034c72 100644
--- a/libswscale/ppc/swscale_altivec.c
+++ b/libswscale/ppc/swscale_altivec.c
@@ -90,7 +90,7 @@ static void yuv2planeX_16_altivec(const int16_t *filter, int 
filterSize,
   const uint8_t *dither, int offset, int x)
 {
 register int i, j;
-DECLARE_ALIGNED(16, int, val)[16];
+LOCAL_ALIGNED(16, int, val, [16]);
 vector signed int vo1, vo2, vo3, vo4;
 vector unsigned short vs1, vs2;
 vector unsigned char vf;
@@ -215,7 +215,7 @@ static void hScale_altivec_real(SwsContext *c, int16_t 
*dst, int dstW,
 const int32_t *filterPos, int filterSize)
 {
 register int i;
-DECLARE_ALIGNED(16, int, tempo)[4];
+LOCAL_ALIGNED(16, int, tempo, [4]);
 
 if (filterSize % 4) {
 for (i = 0; i < dstW; i++) {

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


[FFmpeg-cvslog] ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 15:30:27 2015 +| [98cccdd91c9aab9e031753f6feb81be0c44a9c8e] | 
committer: Michael Niedermayer

ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

The later may yield incorrect code for on-stack variables.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98cccdd91c9aab9e031753f6feb81be0c44a9c8e
---

 libavcodec/ppc/h264dsp.c|   10 
 libavcodec/ppc/h264qpel.c   |   50 +++
 libavcodec/ppc/vp8dsp_altivec.c |2 +-
 3 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/libavcodec/ppc/h264dsp.c b/libavcodec/ppc/h264dsp.c
index da118a4..fabdc2f 100644
--- a/libavcodec/ppc/h264dsp.c
+++ b/libavcodec/ppc/h264dsp.c
@@ -262,7 +262,7 @@ static av_always_inline void 
h264_idct_dc_add_internal(uint8_t *dst, int16_t *bl
 vec_u8 dcplus, dcminus, v0, v1, v2, v3, aligner;
 vec_s32 v_dc32;
 LOAD_ZERO;
-DECLARE_ALIGNED(16, int, dc);
+LOCAL_ALIGNED(16, int, dc);
 int i;
 
 dc = (block[0] + 32) >> 6;
@@ -391,7 +391,7 @@ static void h264_idct_add8_altivec(uint8_t **dest, const 
int *block_offset,
 static inline void write16x4(uint8_t *dst, int dst_stride,
  register vec_u8 r0, register vec_u8 r1,
  register vec_u8 r2, register vec_u8 r3) {
-DECLARE_ALIGNED(16, unsigned char, result)[64];
+LOCAL_ALIGNED(16, unsigned char, result, [64]);
 uint32_t *src_int = (uint32_t *)result, *dst_int = (uint32_t *)dst;
 int int_dst_stride = dst_stride/4;
 
@@ -571,7 +571,7 @@ static inline vec_u8 h264_deblock_q1(register vec_u8 p0,
 }
 
 #define h264_loop_filter_luma_altivec(p2, p1, p0, q0, q1, q2, alpha, beta, 
tc0) {\
-DECLARE_ALIGNED(16, unsigned char, temp)[16];  
   \
+LOCAL_ALIGNED(16, unsigned char, temp, [16]);  
  \
 register vec_u8 alphavec;  
\
 register vec_u8 betavec;   
\
 register vec_u8 mask;  
\
@@ -652,7 +652,7 @@ void weight_h264_W_altivec(uint8_t *block, int stride, int 
height,
 vec_u8 vblock;
 vec_s16 vtemp, vweight, voffset, v0, v1;
 vec_u16 vlog2_denom;
-DECLARE_ALIGNED(16, int32_t, temp)[4];
+LOCAL_ALIGNED(16, int32_t, temp, [4]);
 LOAD_ZERO;
 
 offset <<= log2_denom;
@@ -701,7 +701,7 @@ void biweight_h264_W_altivec(uint8_t *dst, uint8_t *src, 
int stride, int height,
 vec_u8 vsrc, vdst;
 vec_s16 vtemp, vweights, vweightd, voffset, v0, v1, v2, v3;
 vec_u16 vlog2_denom;
-DECLARE_ALIGNED(16, int32_t, temp)[4];
+LOCAL_ALIGNED(16, int32_t, temp, [4]);
 LOAD_ZERO;
 
 offset = ((offset + 1) | 1) << log2_denom;
diff --git a/libavcodec/ppc/h264qpel.c b/libavcodec/ppc/h264qpel.c
index 575f504..ecf99c8 100644
--- a/libavcodec/ppc/h264qpel.c
+++ b/libavcodec/ppc/h264qpel.c
@@ -73,7 +73,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE 
(uint8_t *dst, con
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, 
const uint8_t *src, ptrdiff_t stride)\
 { \
-DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
+LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\
 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, 
stride, SIZE);\
 }\
@@ -85,14 +85,14 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## 
CODETYPE(uint8_t *dst, cons
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, 
const uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
+LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\
 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, 
stride, SIZE);\
 }\
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, 
const uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
+LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\
 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, 
stride, SIZE);\
 }\
@@ -104,15 +104,15 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## 
CODETYPE(uint8_t *dst, cons
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, 
const uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
+LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\
 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
 OPNAME ## pixels ## SIZ

[FFmpeg-cvslog] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 14:30:18 2015 +0100| [238db7cc56be4c4e71ff98758b7b8ef077ebd4ca] | 
committer: Michael Niedermayer

x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

The later may yield incorrect code for on-stack variables.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=238db7cc56be4c4e71ff98758b7b8ef077ebd4ca
---

 libavcodec/x86/ac3dsp_init.c  |2 +-
 libavcodec/x86/cavsdsp.c  |4 ++--
 libavcodec/x86/dct-test.c |4 ++--
 libavcodec/x86/h264_qpel.c|   22 +++---
 libavcodec/x86/rv40dsp_init.c |2 +-
 libavcodec/x86/vc1dsp_mmx.c   |2 +-
 libavcodec/x86/vp8dsp_init.c  |4 ++--
 7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 30a85f9..eea2736 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -165,7 +165,7 @@ static void ac3_downmix_sse(float **samples, float 
(*matrix)[2],
matrix_cmp[3][0] == matrix_cmp[4][0]) {
 MIX5(IF1, IF0);
 } else {
-DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4];
+LOCAL_ALIGNED(16, float, matrix_simd, [AC3_MAX_CHANNELS], [2][4]);
 float *samp[AC3_MAX_CHANNELS];
 
 for (j = 0; j < in_ch; j++)
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 190f6ee..f142db6 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -139,10 +139,10 @@ static inline void cavs_idct8_1d(int16_t *block, uint64_t 
bias)
 static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
 {
 int i;
-DECLARE_ALIGNED(16, int16_t, b2)[64];
+LOCAL_ALIGNED(16, int16_t, b2, [64]);
 
 for(i=0; i<2; i++){
-DECLARE_ALIGNED(8, uint64_t, tmp);
+LOCAL_ALIGNED(8, uint64_t, tmp);
 
 cavs_idct8_1d(block+4*i, ff_pw_4.a);
 
diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index d1a5067..193a69e 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -28,8 +28,8 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
 
 #define PR_WRAP(INSN) \
 static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \
-DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \
-DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \
+LOCAL_ALIGNED(16, int16_t, qmat, [64]); \
+LOCAL_ALIGNED(16, int16_t, tmp, [64]); \
 int i; \
  \
 for(i=0; i<64; i++){ \
diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c
index b4cb9b1..33a7fb0 100644
--- a/libavcodec/x86/h264_qpel.c
+++ b/libavcodec/x86/h264_qpel.c
@@ -282,7 +282,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## 
MMX(uint8_t *dst, const uin
 #define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \
 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, 
stride, SIZE);\
 }\
@@ -294,7 +294,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## 
MMX(uint8_t *dst, const uin
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, 
stride, stride, SIZE);\
 }\
@@ -302,41 +302,41 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## 
MMX(uint8_t *dst, const uin
 #define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \
 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, 
temp, stride, SIZE);\
 }\
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, 
temp, stride, SIZE);\
 }\
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE 

[FFmpeg-cvslog] avformat/mov: Check for string truncation in mov_open_dref()

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Mar 14 
21:24:54 2015 +0100| [8003816e1619e77d8de051883264aa090e0d78cc] | committer: 
Michael Niedermayer

avformat/mov: Check for string truncation in mov_open_dref()

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8003816e1619e77d8de051883264aa090e0d78cc
---

 libavformat/mov.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2129620..438cffb 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2600,7 +2600,7 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 /* try relative path, we do not try the absolute because it can leak 
information about our
system to an attacker */
 if (ref->nlvl_to > 0 && ref->nlvl_from > 0) {
-char filename[1024];
+char filename[1025];
 const char *src_path;
 int i, l;
 
@@ -2630,6 +2630,8 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 
 av_strlcat(filename, ref->path + l + 1, sizeof(filename));
 
+if (strlen(filename) + 1 == sizeof(filename))
+return AVERROR(ENOENT);
 if (!avio_open2(pb, filename, AVIO_FLAG_READ, int_cb, NULL))
 return 0;
 }

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


[FFmpeg-cvslog] avformat/mov: Use sizeof(filename) instead of a literal number

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Mar 14 
21:23:32 2015 +0100| [21a53dd08dce7cc5b3fdf9c4826b4b74d8300ea0] | committer: 
Michael Niedermayer

avformat/mov: Use sizeof(filename) instead of a literal number

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21a53dd08dce7cc5b3fdf9c4826b4b74d8300ea0
---

 libavformat/mov.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 986af57..2129620 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2626,9 +2626,9 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 filename[src_path - src] = 0;
 
 for (i = 1; i < ref->nlvl_from; i++)
-av_strlcat(filename, "../", 1024);
+av_strlcat(filename, "../", sizeof(filename));
 
-av_strlcat(filename, ref->path + l + 1, 1024);
+av_strlcat(filename, ref->path + l + 1, sizeof(filename));
 
 if (!avio_open2(pb, filename, AVIO_FLAG_READ, int_cb, NULL))
 return 0;

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


[FFmpeg-cvslog] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sat Mar 14 14:26:16 2015 +0100| [3814f92fd77f8f09fa6f88333b8d06512b6ced82] | 
committer: Michael Niedermayer

lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

The later may yield incorrect code for on-stack variables.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3814f92fd77f8f09fa6f88333b8d06512b6ced82
---

 libavcodec/dct-test.c   |2 +-
 libavcodec/h264_loopfilter.c|   10 +-
 libavcodec/proresenc_anatoliy.c |3 ++-
 libavcodec/vp8.c|2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 30eca3e..56e1a62 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -66,7 +66,7 @@ static const struct algo fdct_tab[] = {
 };
 
 static void ff_prores_idct_wrap(int16_t *dst){
-DECLARE_ALIGNED(16, static int16_t, qmat)[64];
+LOCAL_ALIGNED(16, int16_t, qmat, [64]);
 int i;
 
 for(i=0; i<64; i++){
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c
index a7b6878..c221f98 100644
--- a/libavcodec/h264_loopfilter.c
+++ b/libavcodec/h264_loopfilter.c
@@ -355,7 +355,7 @@ static av_always_inline void 
h264_filter_mb_fast_internal(H264Context *h,
 }
 return;
 } else {
-LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]);
+LOCAL_ALIGNED(8, int16_t, bS, [2], [4][4]);
 int edges;
 if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 && !chroma444 ) {
 edges = 4;
@@ -492,7 +492,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, 
int mb_x, int mb_y, u
 int j;
 
 for(j=0; j<2; j++, mbn_xy += h->mb_stride){
-DECLARE_ALIGNED(8, int16_t, bS)[4];
+LOCAL_ALIGNED(8, int16_t, bS, [4]);
 int qp;
 if (IS_INTRA(mb_type | h->cur_pic.mb_type[mbn_xy])) {
 AV_WN64A(bS, 0x0003000300030003ULL);
@@ -529,7 +529,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, 
int mb_x, int mb_y, u
 }
 }
 }else{
-DECLARE_ALIGNED(8, int16_t, bS)[4];
+LOCAL_ALIGNED(8, int16_t, bS, [4]);
 int qp;
 
 if( IS_INTRA(mb_type|mbm_type)) {
@@ -612,7 +612,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, 
int mb_x, int mb_y, u
 
 /* Calculate bS */
 for( edge = 1; edge < edges; edge++ ) {
-DECLARE_ALIGNED(8, int16_t, bS)[4];
+LOCAL_ALIGNED(8, int16_t, bS, [4]);
 int qp;
 const int deblock_edge = !IS_8x8DCT(mb_type & (edge<<24)); // (edge&1) 
&& IS_8x8DCT(mb_type)
 
@@ -719,7 +719,7 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, 
uint8_t *img_y, uint
 /* First vertical edge is different in MBAFF frames
  * There are 8 different bS to compute and 2 different Qp
  */
-DECLARE_ALIGNED(8, int16_t, bS)[8];
+LOCAL_ALIGNED(8, int16_t, bS, [8]);
 int qp[2];
 int bqp[2];
 int rqp[2];
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 634ff08..bf6e671 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -286,7 +286,8 @@ static int encode_slice_plane(AVCodecContext *avctx, int 
mb_count,
 {
 ProresContext* ctx = avctx->priv_data;
 FDCTDSPContext *fdsp = &ctx->fdsp;
-DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block;
+LOCAL_ALIGNED(16, int16_t, blocks, [DEFAULT_SLICE_MB_WIDTH << 8]);
+int16_t *block;
 int i, blocks_per_slice;
 PutBitContext pb;
 
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 4b32347..8d6cbe1 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1615,7 +1615,7 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, 
uint8_t *dst[3],
 for (x = 0; x < 4; x++) {
 int copy = 0, linesize = s->linesize;
 uint8_t *dst = ptr + 4 * x;
-DECLARE_ALIGNED(4, uint8_t, copy_dst)[5 * 8];
+LOCAL_ALIGNED(4, uint8_t, copy_dst, [5 * 8]);
 
 if ((y == 0 || x == 3) && mb_y == 0) {
 topright = tr_top;

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


[FFmpeg-cvslog] libavformat/mxfdec: export user comments metadata

2015-03-14 Thread Mark Reid
ffmpeg | branch: master | Mark Reid  | Fri Mar 13 18:58:38 
2015 -0700| [43cafb956e29d690df6f4deb4c83508a2e066e58] | committer: Michael 
Niedermayer

libavformat/mxfdec: export user comments metadata

Previous-revision-reviewed-by: Tomas Härdin 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=43cafb956e29d690df6f4deb4c83508a2e066e58
---

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

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

[FFmpeg-cvslog] avcodec/utils: mark codec argument as const in ff_lock_avcodec()

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Mar 14 
23:30:16 2015 +0100| [a994fc39b3fc8b3996b24450916ec3ae69a00de5] | committer: 
Michael Niedermayer

avcodec/utils: mark codec argument as const in ff_lock_avcodec()

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a994fc39b3fc8b3996b24450916ec3ae69a00de5
---

 libavcodec/internal.h |2 +-
 libavcodec/utils.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 3d0cd5b..3bf35df 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -167,7 +167,7 @@ int ff_init_buffer_info(AVCodecContext *s, AVFrame *frame);
 void avpriv_color_frame(AVFrame *frame, const int color[4]);
 
 extern volatile int ff_avcodec_locked;
-int ff_lock_avcodec(AVCodecContext *log_ctx, AVCodec *codec);
+int ff_lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec);
 int ff_unlock_avcodec(void);
 
 int avpriv_lock_avformat(void);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 82f74d6..99f254b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -3604,7 +3604,7 @@ int av_lockmgr_register(int (*cb)(void **mutex, enum 
AVLockOp op))
 return 0;
 }
 
-int ff_lock_avcodec(AVCodecContext *log_ctx, AVCodec *codec)
+int ff_lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec)
 {
 if (lockmgr_cb) {
 if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))

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


[FFmpeg-cvslog] Revert "ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED"

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun Mar 15 
02:02:21 2015 +0100| [b8535b273fcbf83c8aeffa3d6cae54882eaed364] | committer: 
Michael Niedermayer

Revert "ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED"

This broke build, note, LOCAL_ALIGNED_16() does not work either

Found-by: James Almer 
This reverts commit 98cccdd91c9aab9e031753f6feb81be0c44a9c8e.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8535b273fcbf83c8aeffa3d6cae54882eaed364
---

 libavcodec/ppc/h264dsp.c|   10 
 libavcodec/ppc/h264qpel.c   |   50 +++
 libavcodec/ppc/vp8dsp_altivec.c |2 +-
 3 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/libavcodec/ppc/h264dsp.c b/libavcodec/ppc/h264dsp.c
index fabdc2f..da118a4 100644
--- a/libavcodec/ppc/h264dsp.c
+++ b/libavcodec/ppc/h264dsp.c
@@ -262,7 +262,7 @@ static av_always_inline void 
h264_idct_dc_add_internal(uint8_t *dst, int16_t *bl
 vec_u8 dcplus, dcminus, v0, v1, v2, v3, aligner;
 vec_s32 v_dc32;
 LOAD_ZERO;
-LOCAL_ALIGNED(16, int, dc);
+DECLARE_ALIGNED(16, int, dc);
 int i;
 
 dc = (block[0] + 32) >> 6;
@@ -391,7 +391,7 @@ static void h264_idct_add8_altivec(uint8_t **dest, const 
int *block_offset,
 static inline void write16x4(uint8_t *dst, int dst_stride,
  register vec_u8 r0, register vec_u8 r1,
  register vec_u8 r2, register vec_u8 r3) {
-LOCAL_ALIGNED(16, unsigned char, result, [64]);
+DECLARE_ALIGNED(16, unsigned char, result)[64];
 uint32_t *src_int = (uint32_t *)result, *dst_int = (uint32_t *)dst;
 int int_dst_stride = dst_stride/4;
 
@@ -571,7 +571,7 @@ static inline vec_u8 h264_deblock_q1(register vec_u8 p0,
 }
 
 #define h264_loop_filter_luma_altivec(p2, p1, p0, q0, q1, q2, alpha, beta, 
tc0) {\
-LOCAL_ALIGNED(16, unsigned char, temp, [16]);  
  \
+DECLARE_ALIGNED(16, unsigned char, temp)[16];  
   \
 register vec_u8 alphavec;  
\
 register vec_u8 betavec;   
\
 register vec_u8 mask;  
\
@@ -652,7 +652,7 @@ void weight_h264_W_altivec(uint8_t *block, int stride, int 
height,
 vec_u8 vblock;
 vec_s16 vtemp, vweight, voffset, v0, v1;
 vec_u16 vlog2_denom;
-LOCAL_ALIGNED(16, int32_t, temp, [4]);
+DECLARE_ALIGNED(16, int32_t, temp)[4];
 LOAD_ZERO;
 
 offset <<= log2_denom;
@@ -701,7 +701,7 @@ void biweight_h264_W_altivec(uint8_t *dst, uint8_t *src, 
int stride, int height,
 vec_u8 vsrc, vdst;
 vec_s16 vtemp, vweights, vweightd, voffset, v0, v1, v2, v3;
 vec_u16 vlog2_denom;
-LOCAL_ALIGNED(16, int32_t, temp, [4]);
+DECLARE_ALIGNED(16, int32_t, temp)[4];
 LOAD_ZERO;
 
 offset = ((offset + 1) | 1) << log2_denom;
diff --git a/libavcodec/ppc/h264qpel.c b/libavcodec/ppc/h264qpel.c
index ecf99c8..575f504 100644
--- a/libavcodec/ppc/h264qpel.c
+++ b/libavcodec/ppc/h264qpel.c
@@ -73,7 +73,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE 
(uint8_t *dst, con
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, 
const uint8_t *src, ptrdiff_t stride)\
 { \
-LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\
+DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, 
stride, SIZE);\
 }\
@@ -85,14 +85,14 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## 
CODETYPE(uint8_t *dst, cons
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, 
const uint8_t *src, ptrdiff_t stride)\
 {\
-LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\
+DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, 
stride, SIZE);\
 }\
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, 
const uint8_t *src, ptrdiff_t stride)\
 {\
-LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\
+DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, 
stride, SIZE);\
 }\
@@ -104,15 +104,15 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## 
CODETYPE(uint8_t *dst, cons
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, 
const uint8_t *src, ptrdiff_t stride)\
 {\
-LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\
+DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
 put_h264_qpel ## SIZE ## _v_lowpass_ ## 

[FFmpeg-cvslog] avcodec/vc1: Fix undefined shifts

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun Mar 15 
02:57:24 2015 +0100| [3b63819dfbeefe8656c816e2dcdba548ff6dfb35] | committer: 
Michael Niedermayer

avcodec/vc1: Fix undefined shifts

Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b63819dfbeefe8656c816e2dcdba548ff6dfb35
---

 libavcodec/vc1.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 22eb358..a84522c 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -572,13 +572,13 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, 
VC1Context *v, GetBitContex
 int scale, shift, i;  \
 if (!lumscale) {  \
 scale = -64;  \
-shift = (255 - lumshift * 2) << 6;\
+shift = (255 - lumshift * 2) * 64;\
 if (lumshift > 31)\
 shift += 128 << 6;\
 } else {  \
 scale = lumscale + 32;\
 if (lumshift > 31)\
-shift = (lumshift - 64) << 6; \
+shift = (lumshift - 64) * 64; \
 else  \
 shift = lumshift << 6;\
 } \

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


[FFmpeg-cvslog] avformat/mov: Check for string truncation in mov_open_dref()

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Sat Mar 
14 21:24:54 2015 +0100| [bf0d2ee92c33d802907e829f99c26a46578ed679] | committer: 
Michael Niedermayer

avformat/mov: Check for string truncation in mov_open_dref()

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 8003816e1619e77d8de051883264aa090e0d78cc)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf0d2ee92c33d802907e829f99c26a46578ed679
---

 libavformat/mov.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index d0d28bd..1243c35 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2316,7 +2316,7 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 /* try relative path, we do not try the absolute because it can leak 
information about our
system to an attacker */
 if (ref->nlvl_to > 0 && ref->nlvl_from > 0) {
-char filename[1024];
+char filename[1025];
 const char *src_path;
 int i, l;
 
@@ -2346,6 +2346,8 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 
 av_strlcat(filename, ref->path + l + 1, sizeof(filename));
 
+if (strlen(filename) + 1 == sizeof(filename))
+return AVERROR(ENOENT);
 if (!avio_open2(pb, filename, AVIO_FLAG_READ, int_cb, NULL))
 return 0;
 }

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


[FFmpeg-cvslog] avformat/mov: Use sizeof(filename) instead of a literal number

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.2 | Michael Niedermayer  | Sat Mar 
14 21:23:32 2015 +0100| [53239e50ed366f9c12ef7531e63c5c0693fed328] | committer: 
Michael Niedermayer

avformat/mov: Use sizeof(filename) instead of a literal number

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 21a53dd08dce7cc5b3fdf9c4826b4b74d8300ea0)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=53239e50ed366f9c12ef7531e63c5c0693fed328
---

 libavformat/mov.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9a52eb0..d0d28bd 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2342,9 +2342,9 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 filename[src_path - src] = 0;
 
 for (i = 1; i < ref->nlvl_from; i++)
-av_strlcat(filename, "../", 1024);
+av_strlcat(filename, "../", sizeof(filename));
 
-av_strlcat(filename, ref->path + l + 1, 1024);
+av_strlcat(filename, ref->path + l + 1, sizeof(filename));
 
 if (!avio_open2(pb, filename, AVIO_FLAG_READ, int_cb, NULL))
 return 0;

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


[FFmpeg-cvslog] Tag n2.2.14 : FFmpeg 2.2.14 release

2015-03-14 Thread git
[ffmpeg] [branch: refs/tags/n2.2.14]
Tag:5e7de8482bc67aba1c4e47c820c7e8092f016e72
> http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=5e7de8482bc67aba1c4e47c820c7e8092f016e72

Tagger: Michael Niedermayer 
Date:   Sun Mar 15 03:43:52 2015 +0100

FFmpeg 2.2.14 release
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] [ffmpeg-web] branch master updated. b43f819 web/download: add FFmpeg 2.2.14

2015-03-14 Thread gitolite
The branch, master has been updated
   via  b43f8194bec1601a301ab8fd3569008da0984bd6 (commit)
  from  f64e64c7a9614a8c5c19effad0f2fb31c4e7e67b (commit)


- Log -
commit b43f8194bec1601a301ab8fd3569008da0984bd6
Author: Michael Niedermayer 
AuthorDate: Sun Mar 15 04:03:04 2015 +0100
Commit: Michael Niedermayer 
CommitDate: Sun Mar 15 04:03:04 2015 +0100

web/download: add FFmpeg 2.2.14

diff --git a/src/download b/src/download
index 426b43a..9d460f4 100644
--- a/src/download
+++ b/src/download
@@ -384,13 +384,13 @@ libpostproc53.  0.100

 
   
-FFmpeg 2.2.13 "Muybridge"
+FFmpeg 2.2.14 "Muybridge"
 
   
-2.2.13 was released on 2015-02-19. It is the latest stable FFmpeg release
+2.2.14 was released on 2015-03-15. It is the latest stable FFmpeg release
 from the 2.2 release branch, which was cut from master on 2014-03-01.
 Amongst lots of other changes, it includes all changes from
-ffmpeg-mt, libav master of 2014-03-01, libav 10.5 as of 2014-12-07.
+ffmpeg-mt, libav master of 2014-03-01, libav 10.6 as of 2015-03-14.
   
   It includes the following library versions:
   
@@ -407,15 +407,15 @@ libpostproc52.  3.100
 
   
 
-  Download bzip2 tarball
-  PGP 
signature
+  Download bzip2 tarball
+  PGP 
signature
  
 
-  Download 
gzip tarball
-  PGP 
signature
+  Download 
gzip tarball
+  PGP 
signature
  
 
-  http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=n2.2.13";>Changelog
+  http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=n2.2.14";>Changelog
  

 

---

Summary of changes:
 src/download |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)


hooks/post-receive
-- 

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


[FFmpeg-cvslog] avformat/mov: Use sizeof(filename) instead of a literal number

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.6 | Michael Niedermayer  | Sat Mar 
14 21:23:32 2015 +0100| [350054e8e216e7f2370e0215a0222020703e8062] | committer: 
Michael Niedermayer

avformat/mov: Use sizeof(filename) instead of a literal number

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 21a53dd08dce7cc5b3fdf9c4826b4b74d8300ea0)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=350054e8e216e7f2370e0215a0222020703e8062
---

 libavformat/mov.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 986af57..2129620 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2626,9 +2626,9 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 filename[src_path - src] = 0;
 
 for (i = 1; i < ref->nlvl_from; i++)
-av_strlcat(filename, "../", 1024);
+av_strlcat(filename, "../", sizeof(filename));
 
-av_strlcat(filename, ref->path + l + 1, 1024);
+av_strlcat(filename, ref->path + l + 1, sizeof(filename));
 
 if (!avio_open2(pb, filename, AVIO_FLAG_READ, int_cb, NULL))
 return 0;

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


[FFmpeg-cvslog] avformat/mov: Check for string truncation in mov_open_dref()

2015-03-14 Thread Michael Niedermayer
ffmpeg | branch: release/2.6 | Michael Niedermayer  | Sat Mar 
14 21:24:54 2015 +0100| [37469af29454a78227326bf64608b86cb6cd678b] | committer: 
Michael Niedermayer

avformat/mov: Check for string truncation in mov_open_dref()

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 8003816e1619e77d8de051883264aa090e0d78cc)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=37469af29454a78227326bf64608b86cb6cd678b
---

 libavformat/mov.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2129620..438cffb 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2600,7 +2600,7 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 /* try relative path, we do not try the absolute because it can leak 
information about our
system to an attacker */
 if (ref->nlvl_to > 0 && ref->nlvl_from > 0) {
-char filename[1024];
+char filename[1025];
 const char *src_path;
 int i, l;
 
@@ -2630,6 +2630,8 @@ static int mov_open_dref(AVIOContext **pb, const char 
*src, MOVDref *ref,
 
 av_strlcat(filename, ref->path + l + 1, sizeof(filename));
 
+if (strlen(filename) + 1 == sizeof(filename))
+return AVERROR(ENOENT);
 if (!avio_open2(pb, filename, AVIO_FLAG_READ, int_cb, NULL))
 return 0;
 }

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


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

2015-03-14 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.6 | Andreas Cadhalpun 
 | Fri Mar 13 22:28:42 2015 +0100| 
[480e18e6ff93aed8442084cfb62192c0cb6d0d6e] | committer: Michael Niedermayer

ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext

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

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

The result is memory corruption, leading to crashes.

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

A loss of precission and scaling bug has been fixed by the committer
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 7b05b5093ea67a3397b0c37cf398bab471e1ce2b)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=480e18e6ff93aed8442084cfb62192c0cb6d0d6e
---

 libavcodec/Makefile   |2 +-
 libavcodec/ac3dec.h   |6 +++---
 libavcodec/ac3dec_fixed.c |1 +
 libavcodec/ac3dec_float.c |1 +
 libavcodec/eac3dec.c  |   13 -
 5 files changed, 14 insertions(+), 9 deletions(-)

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

[FFmpeg-cvslog] ac3_fixed: fix computation of spx_noise_blend

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: release/2.6 | Christophe Gisquet 
 | Sat Mar 14 11:48:58 2015 +| 
[7edd380668457782e06093320c41c4f060635861] | committer: Michael Niedermayer

ac3_fixed: fix computation of spx_noise_blend

It was set to 1 instead of sqrt(3)

Signed-off-by: Michael Niedermayer 
(cherry picked from commit c4bf3833f4663fd484441907f73c5bc4700021a4)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7edd380668457782e06093320c41c4f060635861
---

 libavcodec/ac3dec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index ce45186..ae4129f 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -939,7 +939,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
 nblend = 0;
 sblend = 0x80;
 } else if (nratio > 0x7f) {
-nblend = 0x80;
+nblend = 14529495; // sqrt(3) in FP.23
 sblend = 0;
 } else {
 nblend = fixed_sqrt(nratio, 23);

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


[FFmpeg-cvslog] ac3_fixed: fix out-of-bound read

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: release/2.6 | Christophe Gisquet 
 | Sat Mar 14 11:48:57 2015 +| 
[26bed98d64705348fdc684c2d62c305045dedaec] | committer: Michael Niedermayer

ac3_fixed: fix out-of-bound read

Should also improve decoding, but actually doesn't...

Signed-off-by: Michael Niedermayer 
(cherry picked from commit b0834400608b3980c06bf6d2cf747116e60d10c7)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=26bed98d64705348fdc684c2d62c305045dedaec
---

 libavcodec/ac3dec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 2f78d73..ce45186 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -872,7 +872,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
 start_subband += start_subband - 7;
 end_subband= get_bits(gbc, 3) + 5;
 #if USE_FIXED
-s->spx_dst_end_freq = end_freq_inv_tab[end_subband];
+s->spx_dst_end_freq = end_freq_inv_tab[end_subband-5];
 #endif
 if (end_subband   > 7)
 end_subband   += end_subband   - 7;

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


[FFmpeg-cvslog] eac3dec: fix scaling

2015-03-14 Thread Christophe Gisquet
ffmpeg | branch: release/2.6 | Christophe Gisquet 
 | Sat Mar 14 11:48:59 2015 +| 
[7ff46a20d5cc2d746d7396cc80120cb77e5fd90e] | committer: Michael Niedermayer

eac3dec: fix scaling

This is the remaining error, the output on the SPX samples,
respectively csi_miami_stereo_128_spx.eac3 and
csi_miami_5.1_256_spx.eac3, goes from:
stddev:8.71 PSNR: 77.52 MAXDIFF:  235
stddev:24270.51 PSNR: 22.17 MAXDIFF:47166
to:
stddev:0.12 PSNR:114.12 MAXDIFF:1
stddev:0.12 PSNR:114.73 MAXDIFF:1

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 0c3339f4bd7aceebfd74deb437ba2e5c04ef3d0e)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ff46a20d5cc2d746d7396cc80120cb77e5fd90e
---

 libavcodec/eac3dec.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
index cd2eec8d..ef815af 100644
--- a/libavcodec/eac3dec.c
+++ b/libavcodec/eac3dec.c
@@ -143,7 +143,9 @@ static void 
ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
 float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * 
(1.0f / INT32_MIN);
 float sscale = s->spx_signal_blend[ch][bnd];
 #if USE_FIXED
+// spx_noise_blend and spx_signal_blend are both FP.23
 nscale *= 1.0 / (1<<23);
+sscale *= 1.0 / (1<<23);
 #endif
 for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
 float noise  = nscale * (int32_t)av_lfg_get(&s->dith_state);

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