[FFmpeg-cvslog] configure: Check for _M_ARMT to detect thumb when using MSVC

2015-07-27 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö mar...@martin.st | Fri Jul 24 
23:29:17 2015 +0300| [60a21b3d81c1a11cf5a08950eadd4e84ca2e597c] | committer: 
Martin Storsjö

configure: Check for _M_ARMT to detect thumb when using MSVC

Signed-off-by: Martin Storsjö mar...@martin.st

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

 configure |1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 291247a..88c167f 100755
--- a/configure
+++ b/configure
@@ -3996,6 +3996,7 @@ elif enabled alpha; then
 
 elif enabled arm; then
 
+enabled msvc  check_cpp_condition stddef.h defined _M_ARMT  enable 
thumb
 check_cpp_condition stddef.h defined __thumb__  enable_weak thumb
 enabled thumb  check_cflags -mthumb || check_cflags -marm
 

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


[FFmpeg-cvslog] Merge commit '60a21b3d81c1a11cf5a08950eadd4e84ca2e597c'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 13:20:12 2015 +0200| [d06ea6e5ce51165c7c81677ab6827612173bf4f7] | 
committer: Michael Niedermayer

Merge commit '60a21b3d81c1a11cf5a08950eadd4e84ca2e597c'

* commit '60a21b3d81c1a11cf5a08950eadd4e84ca2e597c':
  configure: Check for _M_ARMT to detect thumb when using MSVC

Conflicts:
configure

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] configure: Simplify, remove an unnecessary intermediate variable

2015-07-27 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö mar...@martin.st | Mon Jul 27 
09:40:28 2015 +0300| [e4015b00d4e9e40dc1693a018edd51bf7a04993e] | committer: 
Martin Storsjö

configure: Simplify, remove an unnecessary intermediate variable

Signed-off-by: Martin Storsjö mar...@martin.st

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

 configure |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure b/configure
index 66edc14..5645936 100755
--- a/configure
+++ b/configure
@@ -4693,8 +4693,7 @@ EOF
 fi
 
 for pfx in  host_; do
-pfx_no_=${pfx%_}
-varname=${pfx_no_}cc_type
+varname=${pfx%_}cc_type
 eval type=\$$varname
 if [ $type = msvc ]; then
 check_${pfx}cc EOF || add_${pfx}cflags -Dinline=__inline

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


[FFmpeg-cvslog] Merge commit 'e4015b00d4e9e40dc1693a018edd51bf7a04993e'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 12:51:40 2015 +0200| [a74e3fc18b569693e7e046089b283576eae33a22] | 
committer: Michael Niedermayer

Merge commit 'e4015b00d4e9e40dc1693a018edd51bf7a04993e'

* commit 'e4015b00d4e9e40dc1693a018edd51bf7a04993e':
  configure: Simplify, remove an unnecessary intermediate variable

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] configure: Default to armasm for --toolchain=msvc when targeting arm

2015-07-27 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö mar...@martin.st | Fri Jul 24 
23:23:29 2015 +0300| [2192ff84dd720968108bc1ca54e239f4c94eb61d] | committer: 
Martin Storsjö

configure: Default to armasm for --toolchain=msvc when targeting arm

Signed-off-by: Martin Storsjö mar...@martin.st

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

 configure |5 +
 1 file changed, 5 insertions(+)

diff --git a/configure b/configure
index 5645936..73f4e18 100755
--- a/configure
+++ b/configure
@@ -2642,6 +2642,11 @@ case $toolchain in
 ld_default=$source_path/compat/windows/mslink
 nm_default=dumpbin -symbols
 ar_default=lib
+case $arch in
+arm*)
+as_default=armasm
+;;
+esac
 target_os_default=win32
 # Use a relative path for TMPDIR. This makes sure all the
 # ffconf temp files are written with a relative path, avoiding

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


[FFmpeg-cvslog] Merge commit '2192ff84dd720968108bc1ca54e239f4c94eb61d'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 13:00:03 2015 +0200| [d9f3efd3d611c83a0ceb2f05dc97e9feafc57575] | 
committer: Michael Niedermayer

Merge commit '2192ff84dd720968108bc1ca54e239f4c94eb61d'

* commit '2192ff84dd720968108bc1ca54e239f4c94eb61d':
  configure: Default to armasm for --toolchain=msvc when targeting arm

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] configure: Check MSVC defines for identifying hardfloat

2015-07-27 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö mar...@martin.st | Fri Jul 24 
23:25:10 2015 +0300| [616b409c8f1e4fa568908212c01f6530da8d2e71] | committer: 
Martin Storsjö

configure: Check MSVC defines for identifying hardfloat

This macro identifies whether VFPv3 is available; MSVC defaults
to hardfloat (except for older MSVC versions for CE, targeting
ARMv4).

Signed-off-by: Martin Storsjö mar...@martin.st

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

 configure |2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 73f4e18..291247a 100755
--- a/configure
+++ b/configure
@@ -4001,6 +4001,8 @@ elif enabled arm; then
 
 if check_cpp_condition stddef.h defined __ARM_PCS_VFP; then
 enable vfp_args
+elif check_cpp_condition stddef.h defined _M_ARM_FP  _M_ARM_FP = 30; 
then
+enable vfp_args
 elif ! check_cpp_condition stddef.h defined __ARM_PCS || defined 
__SOFTFP__; then
 case ${cross_prefix:-$cc} in
 *hardfloat*) enable vfp_args;   fpabi=vfp ;;

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


[FFmpeg-cvslog] Merge commit '616b409c8f1e4fa568908212c01f6530da8d2e71'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 13:07:46 2015 +0200| [8324d427c21aa37e173983cb1ba12915b4d62a8d] | 
committer: Michael Niedermayer

Merge commit '616b409c8f1e4fa568908212c01f6530da8d2e71'

* commit '616b409c8f1e4fa568908212c01f6530da8d2e71':
  configure: Check MSVC defines for identifying hardfloat

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] avformat/mpegts: Use DVB_TELETEXT timestamp heuristic also for DVB subtitles

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 15:13:50 2015 +0200| [42aa02418e43802b4ebcca373d2413ab63a0307e] | 
committer: Michael Niedermayer

avformat/mpegts: Use DVB_TELETEXT timestamp heuristic also for DVB subtitles

Fixes Ticket4200

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

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

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

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 689b31d..b758ae3 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1140,7 +1140,10 @@ skip:
 p += 5;
 buf_size -= 5;
 }
-if (pes-ts-fix_teletext_pts  pes-st-codec-codec_id == 
AV_CODEC_ID_DVB_TELETEXT) {
+if (   pes-ts-fix_teletext_pts
+ (   pes-st-codec-codec_id == AV_CODEC_ID_DVB_TELETEXT
+|| pes-st-codec-codec_id == 
AV_CODEC_ID_DVB_SUBTITLE)
+) {
 AVProgram *p = NULL;
 while ((p = av_find_program_from_stream(pes-stream, p, 
pes-st-index))) {
 if (p-pcr_pid != -1  p-discard != AVDISCARD_ALL) {
@@ -1169,7 +1172,11 @@ skip:
 pes-st-pts_wrap_behavior = 
st-pts_wrap_behavior;
 if (pes-dts == AV_NOPTS_VALUE || pes-dts 
 pcr) {
 pes-pts = pes-dts = pcr;
-} else if (pes-dts  pcr + 3654 + 9000) {
+} else if (pes-st-codec-codec_id == 
AV_CODEC_ID_DVB_TELETEXT 
+   pes-dts  pcr + 3654 + 9000) {
+pes-pts = pes-dts = pcr + 3654 + 
9000;
+} else if (pes-st-codec-codec_id == 
AV_CODEC_ID_DVB_SUBTITLE 
+   pes-dts  pcr + 10*9) { 
//10sec
 pes-pts = pes-dts = pcr + 3654 + 
9000;
 }
 break;

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


[FFmpeg-cvslog] Merge commit '6d3081e6c374ff7da12b07ed33d1662be1b32dbc'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 12:41:06 2015 +0200| [46f01e413320acb86a66d13d13735694d1a0364d] | 
committer: Michael Niedermayer

Merge commit '6d3081e6c374ff7da12b07ed33d1662be1b32dbc'

* commit '6d3081e6c374ff7da12b07ed33d1662be1b32dbc':
  doc: Remove the now unnecessary remark about PATH and link.exe

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] doc: Remove the now unnecessary remark about PATH and link.exe

2015-07-27 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö mar...@martin.st | Sun Jul 26 
20:23:30 2015 +0300| [6d3081e6c374ff7da12b07ed33d1662be1b32dbc] | committer: 
Martin Storsjö

doc: Remove the now unnecessary remark about PATH and link.exe

Signed-off-by: Martin Storsjö mar...@martin.st

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

 doc/platform.texi |6 --
 1 file changed, 6 deletions(-)

diff --git a/doc/platform.texi b/doc/platform.texi
index edd7577..07c8575 100644
--- a/doc/platform.texi
+++ b/doc/platform.texi
@@ -168,12 +168,6 @@ Notes:
 
 @itemize
 
-@item It is possible that coreutils' @code{link.exe} conflicts with MSVC's 
linker.
-You can find out by running @code{which link} to see which @code{link.exe} you
-are using. If it is located at @code{/bin/link.exe}, then you have the wrong 
one
-in your @code{PATH}. Either move or remove that copy, or make sure MSVC's
-@code{link.exe} takes precedence in your @code{PATH} over coreutils'.
-
 @item If you wish to build with zlib support, you will have to grab a 
compatible
 zlib binary from somewhere, with an MSVC import lib, or if you wish to link
 statically, you can follow the instructions below to build a compatible

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


[FFmpeg-cvslog] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 bilinear functions

2015-07-27 Thread Shivraj Patil
ffmpeg | branch: master | Shivraj Patil shivraj.pa...@imgtec.com | Mon Jul 27 
17:47:34 2015 +0530| [71aede3ced76a5adb4d8cd44a70dfe2487db882a] | committer: 
Michael Niedermayer

avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 bilinear functions

Signed-off-by: Shivraj Patil shivraj.pa...@imgtec.com
Reviewed-by: Ronald S. Bultje rsbul...@gmail.com
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc

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

 libavcodec/mips/vp9_mc_msa.c   | 2123 
 libavcodec/mips/vp9dsp_init_mips.c |2 +
 libavcodec/mips/vp9dsp_mips.h  |   32 +
 3 files changed, 2157 insertions(+)

diff --git a/libavcodec/mips/vp9_mc_msa.c b/libavcodec/mips/vp9_mc_msa.c
index a1d7798..1671d97 100644
--- a/libavcodec/mips/vp9_mc_msa.c
+++ b/libavcodec/mips/vp9_mc_msa.c
@@ -31,6 +31,24 @@ static const uint8_t mc_filt_mask_arr[16 * 3] = {
 8, 9, 9, 10, 10, 11, 11, 12, 24, 25, 25, 26, 26, 27, 27, 28
 };
 
+static const int8_t vp9_bilinear_filters_msa[15][2] = {
+{120, 8},
+{112, 16},
+{104, 24},
+{96, 32},
+{88, 40},
+{80, 48},
+{72, 56},
+{64, 64},
+{56, 72},
+{48, 80},
+{40, 88},
+{32, 96},
+{24, 104},
+{16, 112},
+{8, 120}
+};
+
 #define FILT_8TAP_DPADD_S_H(vec0, vec1, vec2, vec3, \
 filt0, filt1, filt2, filt3) \
 ( { \
@@ -1827,6 +1845,2111 @@ static void 
common_hv_8ht_8vt_and_aver_dst_64w_msa(const uint8_t *src,
 }
 }
 
+static void common_hz_2t_4x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+v16i8 src0, src1, src2, src3, mask;
+v16u8 filt0, vec0, vec1, res0, res1;
+v8u16 vec2, vec3, filt;
+
+mask = LD_SB(mc_filt_mask_arr[16]);
+
+/* rearranging filter */
+filt = LD_UH(filter);
+filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+LD_SB4(src, src_stride, src0, src1, src2, src3);
+VSHF_B2_UB(src0, src1, src2, src3, mask, mask, vec0, vec1);
+DOTP_UB2_UH(vec0, vec1, filt0, filt0, vec2, vec3);
+SRARI_H2_UH(vec2, vec3, 7);
+PCKEV_B2_UB(vec2, vec2, vec3, vec3, res0, res1);
+ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+}
+
+static void common_hz_2t_4x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+v16u8 vec0, vec1, vec2, vec3, filt0;
+v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+v16i8 res0, res1, res2, res3;
+v8u16 vec4, vec5, vec6, vec7, filt;
+
+mask = LD_SB(mc_filt_mask_arr[16]);
+
+/* rearranging filter */
+filt = LD_UH(filter);
+filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+VSHF_B2_UB(src0, src1, src2, src3, mask, mask, vec0, vec1);
+VSHF_B2_UB(src4, src5, src6, src7, mask, mask, vec2, vec3);
+DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+vec4, vec5, vec6, vec7);
+SRARI_H4_UH(vec4, vec5, vec6, vec7, 7);
+PCKEV_B4_SB(vec4, vec4, vec5, vec5, vec6, vec6, vec7, vec7,
+res0, res1, res2, res3);
+ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+dst += (4 * dst_stride);
+ST4x4_UB(res2, res3, 0, 1, 0, 1, dst, dst_stride);
+}
+
+void ff_put_bilin_4h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+
+if (4 == height) {
+common_hz_2t_4x4_msa(src, src_stride, dst, dst_stride, filter);
+} else if (8 == height) {
+common_hz_2t_4x8_msa(src, src_stride, dst, dst_stride, filter);
+}
+}
+
+static void common_hz_2t_8x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+v16u8 filt0;
+v16i8 src0, src1, src2, src3, mask;
+v8u16 vec0, vec1, vec2, vec3, filt;
+
+mask = LD_SB(mc_filt_mask_arr[0]);
+
+/* rearranging filter */
+filt = LD_UH(filter);
+filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+LD_SB4(src, src_stride, src0, src1, src2, src3);
+VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+vec0, vec1, vec2, vec3);
+SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+PCKEV_B2_SB(vec1, vec0, vec3, vec2, src0, src1);
+ST8x4_UB(src0, src1, dst, dst_stride);
+}
+
+static void 

[FFmpeg-cvslog] avformat/mpegts: Replace silent cliping of language_count by asserts

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 18:03:53 2015 +0200| [c8c86b8f9b8c166633a7324c8646f38866801b88] | 
committer: Michael Niedermayer

avformat/mpegts: Replace silent cliping of language_count by asserts

Failure should not be possible, if it does occur then the code is
buggy and should be fixed not silently clip

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

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

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

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b758ae3..6f4a47d 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1651,9 +1651,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
 
 if (language_count  0) {
 /* 4 bytes per language code (3 bytes) with comma or NUL byte 
should fit language buffer */
-if (language_count  sizeof(language) / 4) {
-language_count = sizeof(language) / 4;
-}
+av_assert0(language_count = sizeof(language) / 4);
 
 if (st-codec-extradata == NULL) {
 if (ff_alloc_extradata(st-codec, language_count * 2)) {
@@ -1703,9 +1701,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
 uint8_t *extradata;
 
 /* 4 bytes per language code (3 bytes) with comma or NUL byte 
should fit language buffer */
-if (language_count  sizeof(language) / 4) {
-language_count = sizeof(language) / 4;
-}
+av_assert0(language_count = sizeof(language) / 4);
 
 if (st-codec-extradata == NULL) {
 if (ff_alloc_extradata(st-codec, language_count * 5)) {

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


[FFmpeg-cvslog] avcodec/internal: Deprecate ff_alloc_packet() in favor of ff_alloc_packet2 ()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Mon Jul  6 
11:33:01 2015 +0200| [0dbfb5386f1e27ef148793a4eb47bd9826756f2c] | committer: 
Michael Niedermayer

avcodec/internal: Deprecate ff_alloc_packet() in favor of ff_alloc_packet2()

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/internal.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 1a15e6b..97b89c1 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -225,7 +225,7 @@ int avpriv_unlock_avformat(void);
  */
 int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, 
int64_t min_size);
 
-int ff_alloc_packet(AVPacket *avpkt, int size);
+attribute_deprecated int ff_alloc_packet(AVPacket *avpkt, int size);
 
 /**
  * Rescale from sample rate to AVCodecContext.time_base.

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


[FFmpeg-cvslog] avcodec: Add a min size parameter to ff_alloc_packet2()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 19:36:16 2015 +0200| [e36db49b7b31cb17912895cb4d95b7b45d6f0882] | 
committer: Michael Niedermayer

avcodec: Add a min size parameter to  ff_alloc_packet2()

This parameter can be used to inform the allocation code about how much
downsizing might occur, and can be used to optimize how to allocate the
packet

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

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

 libavcodec/a64multienc.c   |2 +-
 libavcodec/aacenc.c|2 +-
 libavcodec/ac3enc_template.c   |2 +-
 libavcodec/adpcmenc.c  |2 +-
 libavcodec/adxenc.c|2 +-
 libavcodec/alacenc.c   |2 +-
 libavcodec/asvenc.c|2 +-
 libavcodec/bmpenc.c|2 +-
 libavcodec/cinepakenc.c|2 +-
 libavcodec/cljrenc.c   |2 +-
 libavcodec/dcaenc.c|2 +-
 libavcodec/dnxhdenc.c  |2 +-
 libavcodec/dpxenc.c|2 +-
 libavcodec/dvenc.c |2 +-
 libavcodec/ffv1enc.c   |2 +-
 libavcodec/flacenc.c   |2 +-
 libavcodec/flashsv2enc.c   |2 +-
 libavcodec/flashsvenc.c|2 +-
 libavcodec/g722enc.c   |2 +-
 libavcodec/g723_1.c|2 +-
 libavcodec/g726.c  |2 +-
 libavcodec/gif.c   |2 +-
 libavcodec/huffyuvenc.c|2 +-
 libavcodec/internal.h  |6 +-
 libavcodec/j2kenc.c|2 +-
 libavcodec/jpeglsenc.c |2 +-
 libavcodec/lclenc.c|2 +-
 libavcodec/libaacplus.c|2 +-
 libavcodec/libfaac.c   |2 +-
 libavcodec/libfdk-aacenc.c |2 +-
 libavcodec/libgsmenc.c |2 +-
 libavcodec/libilbc.c   |2 +-
 libavcodec/libmp3lame.c|2 +-
 libavcodec/libopencore-amr.c   |2 +-
 libavcodec/libopenjpegenc.c|2 +-
 libavcodec/libopusenc.c|2 +-
 libavcodec/libschroedingerenc.c|2 +-
 libavcodec/libspeexenc.c   |2 +-
 libavcodec/libtheoraenc.c  |2 +-
 libavcodec/libtwolame.c|2 +-
 libavcodec/libutvideoenc.cpp   |2 +-
 libavcodec/libvo-aacenc.c  |2 +-
 libavcodec/libvo-amrwbenc.c|2 +-
 libavcodec/libvorbisenc.c  |2 +-
 libavcodec/libvpxenc.c |2 +-
 libavcodec/libx264.c   |2 +-
 libavcodec/libxavs.c   |4 ++--
 libavcodec/libxvid.c   |2 +-
 libavcodec/ljpegenc.c  |2 +-
 libavcodec/mpegaudioenc_template.c |2 +-
 libavcodec/mpegvideo_enc.c |2 +-
 libavcodec/msvideo1enc.c   |2 +-
 libavcodec/nellymoserenc.c |2 +-
 libavcodec/nvenc.c |2 +-
 libavcodec/pamenc.c|2 +-
 libavcodec/pcm.c   |2 +-
 libavcodec/pcxenc.c|2 +-
 libavcodec/pngenc.c|4 ++--
 libavcodec/pnmenc.c|2 +-
 libavcodec/proresenc_anatoliy.c|2 +-
 libavcodec/proresenc_kostya.c  |2 +-
 libavcodec/qtrleenc.c  |2 +-
 libavcodec/r210enc.c   |2 +-
 libavcodec/ra144enc.c  |2 +-
 libavcodec/roqaudioenc.c   |2 +-
 libavcodec/roqvideoenc.c   |2 +-
 libavcodec/s302menc.c  |2 +-
 libavcodec/sgienc.c|2 +-
 libavcodec/snowenc.c   |2 +-
 libavcodec/sonic.c |2 +-
 libavcodec/sunrastenc.c|2 +-
 libavcodec/svq1enc.c   |2 +-
 libavcodec/targaenc.c  |2 +-
 libavcodec/tiffenc.c   |2 +-
 libavcodec/ttaenc.c|2 +-
 libavcodec/utils.c |4 ++--
 libavcodec/utvideoenc.c|2 +-
 libavcodec/v308enc.c   |2 +-
 libavcodec/v408enc.c   |2 +-
 libavcodec/v410enc.c   |2 +-
 libavcodec/vorbisenc.c |2 +-
 libavcodec/wavpackenc.c|2 +-
 libavcodec/wmaenc.c|2 +-
 libavcodec/xbmenc.c|2 +-
 libavcodec/xfaceenc.c  |2 +-
 libavcodec/xwdenc.c|2 +-
 libavcodec/y41penc.c   |2 +-
 libavcodec/yuv4enc.c   |2 +-
 libavcodec/zmbvenc.c   |2 +-
 89 files changed, 96 insertions(+), 92 deletions(-)

diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index 4cd7e8b..ceb7dca 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -328,7 +328,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 /* any frames to encode? 

[FFmpeg-cvslog] avcodec/v410enc: do not use internal-byte_buffer

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Sun Jul  5 
21:13:04 2015 +0200| [af5f707e46f01d9afff57029d098fb46da53cc93] | committer: 
Michael Niedermayer

avcodec/v410enc: do not use internal-byte_buffer

it is not optimal when the buffer size is well known at allocation time

This avoids a memcpy()

about 1% faster

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c
index 9a914bd..f35ff75 100644
--- a/libavcodec/v410enc.c
+++ b/libavcodec/v410enc.c
@@ -43,7 +43,8 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 uint32_t val;
 int i, j, ret;
 
-if ((ret = ff_alloc_packet2(avctx, pkt, avctx-width * avctx-height * 4, 
0))  0)
+if ((ret = ff_alloc_packet2(avctx, pkt, avctx-width * avctx-height * 4,
+avctx-width * avctx-height * 4)) 
 0)
 return ret;
 dst = pkt-data;
 

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


[FFmpeg-cvslog] avcodec/utils: do not use internal- byte_buffer when little downsizing is expected

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 20:01:59 2015 +0200| [9fe873bec8b6d342064cf282b0ba09f91ac9292f] | 
committer: Michael Niedermayer

avcodec/utils: do not use internal-byte_buffer when little downsizing is 
expected

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

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

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

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b147559..42d509e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1789,7 +1789,7 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket 
*avpkt, int64_t size, int64
 return AVERROR(EINVAL);
 }
 
-if (avctx) {
+if (avctx  2*min_size  size) { // FIXME The factor needs to be finetuned
 av_assert0(!avpkt-data || avpkt-data != 
avctx-internal-byte_buffer);
 if (!avpkt-data || avpkt-size  size) {
 av_fast_padded_malloc(avctx-internal-byte_buffer, 
avctx-internal-byte_buffer_size, size);

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


[FFmpeg-cvslog] AAC Encoder: clipping avoidance

2015-07-27 Thread Claudio Freire
ffmpeg | branch: master | Claudio Freire klaussfre...@gmail.com | Mon Jul 20 
22:53:24 2015 -0300| [59216e0525a58714be4207be6ae8744750e62867] | committer: 
Michael Niedermayer

AAC Encoder: clipping avoidance

Avoid clipping due to quantization noise to produce audible
artifacts, by detecting near-clipping signals and both attenuating
them a little and encoding escape-encoded bands (usually the
loudest) rounding towards zero instead of nearest, which tends to
decrease overall energy and thus clipping.

Currently fate tests measure numerical error so this change makes
tests using asynth (which are near clipping) report higher error
not less, because of window attenuation. Yet, they sound better,
not worse (albeit subtle, other samples aren't subtle at all).
Only measuring psychoacoustically weighted error would make for
a representative test, so that will be left for a future patch.

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

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

 libavcodec/aac.h  |4 ++
 libavcodec/aaccoder.c |  108 -
 libavcodec/aacenc.c   |   38 -
 libavcodec/aacenc.h   |2 +-
 libavcodec/aacpsy.c   |   30 ++
 libavcodec/psymodel.h |1 +
 tests/fate/aac.mak|4 +-
 7 files changed, 145 insertions(+), 42 deletions(-)

diff --git a/libavcodec/aac.h b/libavcodec/aac.h
index d62455d..3e3e479 100644
--- a/libavcodec/aac.h
+++ b/libavcodec/aac.h
@@ -50,6 +50,8 @@
 #define TNS_MAX_ORDER 20
 #define MAX_LTP_LONG_SFB 40
 
+#define CLIP_AVOIDANCE_FACTOR 0.95f
+
 enum RawDataBlockType {
 TYPE_SCE,
 TYPE_CPE,
@@ -180,6 +182,8 @@ typedef struct IndividualChannelStream {
 int predictor_initialized;
 int predictor_reset_group;
 uint8_t prediction_used[41];
+uint8_t window_clipping[8]; /// set if a certain window is near clipping
+float clip_avoidance_factor; /// set if any window is near clipping to 
the necessary atennuation factor to avoid it
 } IndividualChannelStream;
 
 /**
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index 17b14d6..eb58342 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -79,6 +79,9 @@ static const uint8_t * const run_value_bits[2] = {
 run_value_bits_long, run_value_bits_short
 };
 
+#define ROUND_STANDARD 0.4054f
+#define ROUND_TO_ZERO 0.1054f
+
 /** Map to convert values from BandCodingPath index to a codebook index **/
 static const uint8_t aac_cb_out_map[CB_TOT_ALL]  = 
{0,1,2,3,4,5,6,7,8,9,10,11,13,14,15};
 /** Inverse map to convert from codebooks to BandCodingPath indices **/
@@ -89,20 +92,20 @@ static const uint8_t aac_cb_in_map[CB_TOT_ALL+1] = 
{0,1,2,3,4,5,6,7,8,9,10,11,0,
  * @return absolute value of the quantized coefficient
  * @see 3GPP TS26.403 5.6.2 Scalefactor determination
  */
-static av_always_inline int quant(float coef, const float Q)
+static av_always_inline int quant(float coef, const float Q, const float 
rounding)
 {
 float a = coef * Q;
-return sqrtf(a * sqrtf(a)) + 0.4054;
+return sqrtf(a * sqrtf(a)) + rounding;
 }
 
 static void quantize_bands(int *out, const float *in, const float *scaled,
-   int size, float Q34, int is_signed, int maxval)
+   int size, float Q34, int is_signed, int maxval, 
const float rounding)
 {
 int i;
 double qc;
 for (i = 0; i  size; i++) {
 qc = scaled[i] * Q34;
-out[i] = (int)FFMIN(qc + 0.4054, (double)maxval);
+out[i] = (int)FFMIN(qc + rounding, (double)maxval);
 if (is_signed  in[i]  0.0f) {
 out[i] = -out[i];
 }
@@ -134,7 +137,8 @@ static av_always_inline float 
quantize_and_encode_band_cost_template(
 const float *scaled, int size, int scale_idx,
 int cb, const float lambda, const float uplim,
 int *bits, int BT_ZERO, int BT_UNSIGNED,
-int BT_PAIR, int BT_ESC, int BT_NOISE, int 
BT_STEREO)
+int BT_PAIR, int BT_ESC, int BT_NOISE, int 
BT_STEREO,
+const float ROUNDING)
 {
 const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512;
 const float Q   = ff_aac_pow2sf_tab [q_idx];
@@ -158,7 +162,7 @@ static av_always_inline float 
quantize_and_encode_band_cost_template(
 abs_pow34_v(s-scoefs, in, size);
 scaled = s-scoefs;
 }
-quantize_bands(s-qcoefs, in, scaled, size, Q34, !BT_UNSIGNED, 
aac_cb_maxval[cb]);
+quantize_bands(s-qcoefs, in, scaled, size, Q34, !BT_UNSIGNED, 
aac_cb_maxval[cb], ROUNDING);
 if (BT_UNSIGNED) {
 off = 0;
 } else {
@@ -185,7 +189,7 @@ static av_always_inline float 
quantize_and_encode_band_cost_template(
 di = t - CLIPPED_ESCAPE;
 curbits += 21;
 

[FFmpeg-cvslog] wmv2enc: Check memory allocation

2015-07-27 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Fri 
Jul 24 04:24:33 2015 +0100| [03eb55741427c6608f63972c105e565ca0ba4f15] | 
committer: Vittorio Giovara

wmv2enc: Check memory allocation

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

 libavcodec/wmv2enc.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index e4e51d3..e4d4159 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -63,6 +63,9 @@ static av_cold int wmv2_encode_init(AVCodecContext *avctx)
 
 avctx-extradata_size = 4;
 avctx-extradata  = av_mallocz(avctx-extradata_size + 10);
+if (!avctx-extradata)
+return AVERROR(ENOMEM);
+
 encode_ext_header(w);
 
 return 0;

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


[FFmpeg-cvslog] Merge commit '03eb55741427c6608f63972c105e565ca0ba4f15'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 20:42:09 2015 +0200| [59b009411fcc8531d661a381bbd2608e36c20bd0] | 
committer: Michael Niedermayer

Merge commit '03eb55741427c6608f63972c105e565ca0ba4f15'

* commit '03eb55741427c6608f63972c105e565ca0ba4f15':
  wmv2enc: Check memory allocation

Conflicts:
libavcodec/wmv2enc.c

See: 6e8fe448154e1aa0928cb0d2e1aecb7255c751cc
Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] Merge commit 'a67b67944aa9e6e794934d15f9fd9a9cf7173e09'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 20:32:41 2015 +0200| [c7074375724e85e889ddaff68d150c12a90b4300] | 
committer: Michael Niedermayer

Merge commit 'a67b67944aa9e6e794934d15f9fd9a9cf7173e09'

* commit 'a67b67944aa9e6e794934d15f9fd9a9cf7173e09':
  ac3enc_template: Use the correct context field

See: 320ce9f284171f8c8d8561cccd2186c27f24898c
Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] ac3enc_template: Use the correct context field

2015-07-27 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Fri 
Jul 24 05:17:26 2015 +0100| [a67b67944aa9e6e794934d15f9fd9a9cf7173e09] | 
committer: Vittorio Giovara

ac3enc_template: Use the correct context field

For audio encoders, delay has no effect, use the appropriate one,
initial_padding (see 2df0c32).

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

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

diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c
index 79b4946..8febf85 100644
--- a/libavcodec/ac3enc_template.c
+++ b/libavcodec/ac3enc_template.c
@@ -450,7 +450,7 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket 
*avpkt,
 ff_ac3_output_frame(s, avpkt-data);
 
 if (frame-pts != AV_NOPTS_VALUE)
-avpkt-pts = frame-pts - ff_samples_to_time_base(avctx, avctx-delay);
+avpkt-pts = frame-pts - ff_samples_to_time_base(avctx, 
avctx-initial_padding);
 
 *got_packet_ptr = 1;
 return 0;

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


[FFmpeg-cvslog] lavc: Deprecate avctx.me_method

2015-07-27 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Tue 
Jul  7 01:20:43 2015 +0100| [4b6b1082a73907c7c3de2646c6398bc61320f2c6] | 
committer: Vittorio Giovara

lavc: Deprecate avctx.me_method

This option is extremely codec specific and only a few codecs employ it.
Move it to codec private options instead: mpegenc family supports only 3
values, xavs and x264 use 5, and xvid has a different metric entirely.

Signed-off-by: Vittorio Giovara vittorio.giov...@gmail.com

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

 doc/encoders.texi  |2 -
 libavcodec/avcodec.h   |   14 +++---
 libavcodec/libx264.c   |   39 ++-
 libavcodec/libxavs.c   |   56 ++
 libavcodec/libxvid.c   |   43 -
 libavcodec/motion_est.c|  114 +---
 libavcodec/motion_est.h|4 ++
 libavcodec/mpegvideo.h |7 +++
 libavcodec/mpegvideo_enc.c |4 ++
 libavcodec/options_table.h |2 +
 libavcodec/svq1enc.c   |   32 +
 libavcodec/svq1enc.h   |2 +
 libavcodec/version.h   |5 +-
 libavcodec/wmv2enc.c   |8 
 14 files changed, 221 insertions(+), 111 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 94d8340..779a469 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -603,8 +603,6 @@ options follow the Libav ones.
 @tab Noise reduction.
 @item me_range  @tab merange
 @tab Maximum range of the motion search in pixels.
-@item me_method @tab me
-@tab Full-pixel motion estimation method.
 @item subq  @tab subme
 @tab Sub-pixel motion estimation method.
 @item b_strategy@tab b-adapt
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 290de70..6fb3c0f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -548,7 +548,9 @@ typedef struct AVCodecDescriptor {
 /**
  * @ingroup lavc_encoding
  * motion estimation type.
+ * @deprecated use codec private option instead
  */
+#if FF_API_MOTION_EST
 enum Motion_Est_ID {
 ME_ZERO = 1,/// no search, that is use 0,0 vector whenever one is 
needed
 ME_FULL,
@@ -560,6 +562,7 @@ enum Motion_Est_ID {
 ME_UMH, /// uneven multi-hexagon search
 ME_TESA,/// transformed exhaustive search algorithm
 };
+#endif
 
 /**
  * @ingroup lavc_decoding
@@ -1281,14 +1284,13 @@ typedef struct AVCodecContext {
  */
 enum AVPixelFormat pix_fmt;
 
+#if FF_API_MOTION_EST
 /**
- * Motion estimation algorithm used for video coding.
- * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
- * 8 (umh), 10 (tesa) [7, 8, 10 are x264 specific]
- * - encoding: MUST be set by user.
- * - decoding: unused
+ * This option does nothing
+ * @deprecated use codec private options instead
  */
-int me_method;
+attribute_deprecated int me_method;
+#endif
 
 /**
  * If non NULL, 'draw_horiz_band' is called by the libavcodec
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 7d719d4..531d897 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -76,6 +76,7 @@ typedef struct X264Context {
 int slice_max_size;
 char *stats;
 int nal_hrd;
+int motion_est;
 char *x264_params;
 } X264Context;
 
@@ -394,17 +395,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
 x4-params.rc.f_pb_factor = avctx-b_quant_factor;
 x4-params.analyse.i_chroma_qp_offset = avctx-chromaoffset;
 
-if (avctx-me_method == ME_EPZS)
-x4-params.analyse.i_me_method = X264_ME_DIA;
-else if (avctx-me_method == ME_HEX)
-x4-params.analyse.i_me_method = X264_ME_HEX;
-else if (avctx-me_method == ME_UMH)
-x4-params.analyse.i_me_method = X264_ME_UMH;
-else if (avctx-me_method == ME_FULL)
-x4-params.analyse.i_me_method = X264_ME_ESA;
-else if (avctx-me_method == ME_TESA)
-x4-params.analyse.i_me_method = X264_ME_TESA;
-
 if (avctx-gop_size = 0)
 x4-params.i_keyint_max = avctx-gop_size;
 if (avctx-max_b_frames = 0)
@@ -493,6 +483,25 @@ static av_cold int X264_init(AVCodecContext *avctx)
 if (x4-nal_hrd = 0)
 x4-params.i_nal_hrd = x4-nal_hrd;
 
+if (x4-motion_est = 0) {
+x4-params.analyse.i_me_method = x4-motion_est;
+#if FF_API_MOTION_EST
+FF_DISABLE_DEPRECATION_WARNINGS
+} else {
+if (avctx-me_method == ME_EPZS)
+x4-params.analyse.i_me_method = X264_ME_DIA;
+else if (avctx-me_method == ME_HEX)
+x4-params.analyse.i_me_method = X264_ME_HEX;
+else if (avctx-me_method == ME_UMH)
+x4-params.analyse.i_me_method = X264_ME_UMH;
+else if (avctx-me_method == ME_FULL)
+x4-params.analyse.i_me_method = X264_ME_ESA;
+else if (avctx-me_method == ME_TESA)
+x4-params.analyse.i_me_method = X264_ME_TESA;

[FFmpeg-cvslog] Merge commit '4b6b1082a73907c7c3de2646c6398bc61320f2c6'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 21:03:20 2015 +0200| [0b6f092ed31b83e01e980b596ef8bdd9db6cfff6] | 
committer: Michael Niedermayer

Merge commit '4b6b1082a73907c7c3de2646c6398bc61320f2c6'

* commit '4b6b1082a73907c7c3de2646c6398bc61320f2c6':
  lavc: Deprecate avctx.me_method

Conflicts:
doc/encoders.texi
libavcodec/avcodec.h
libavcodec/libx264.c
libavcodec/motion_est.c
libavcodec/options_table.h
libavcodec/version.h

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] avfilter: add acrossfade filter

2015-07-27 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol one...@gmail.com | Thu Jul 23 22:13:17 
2015 +| [4a2836eaf33b64512678ed6dc1387f8f042cf387] | committer: Paul B Mahol

avfilter: add acrossfade filter

Signed-off-by: Paul B Mahol one...@gmail.com

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

 Changelog|1 +
 doc/filters.texi |   49 +
 libavfilter/Makefile |1 +
 libavfilter/af_afade.c   |  465 --
 libavfilter/allfilters.c |1 +
 libavfilter/version.h|2 +-
 6 files changed, 462 insertions(+), 57 deletions(-)

diff --git a/Changelog b/Changelog
index 7865c8e..f41d837 100644
--- a/Changelog
+++ b/Changelog
@@ -26,6 +26,7 @@ version next:
 - AAC fixed-point decoding
 - sidechaincompress audio filter
 - bitstream filter for converting HEVC from MP4 to Annex B
+- acrossfade audio filter
 
 
 version 2.7:
diff --git a/doc/filters.texi b/doc/filters.texi
index f6380c9..4c4beea 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -318,6 +318,54 @@ build.
 
 Below is a description of the currently available audio filters.
 
+@section acrossfade
+
+Apply cross fade from one input audio stream to another input audio stream.
+The cross fade is applied for specified duration near the end of first stream.
+
+The filter accepts the following options:
+
+@table @option
+@item nb_samples, ns
+Specify the number of samples for which the cross fade effect has to last.
+At the end of the cross fade effect the first input audio will be completely
+silent. Default is 44100.
+
+@item duration, d
+Specify the duration of the cross fade effect. See
+@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) 
manual,ffmpeg-utils}
+for the accepted syntax.
+By default the duration is determined by @var{nb_samples}.
+If set this option is used instead of @var{nb_samples}.
+
+@item overlap, o
+Should first stream end overlap with second stream start. Default is enabled.
+
+@item curve1
+Set curve for cross fade transition for first stream.
+
+@item curve2
+Set curve for cross fade transition for second stream.
+
+For description of available curve types see @ref{afade} filter description.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Cross fade from one input to another:
+@example
+ffmpeg -i first.flac -i second.flac -filter_complex 
acrossfade=d=10:c1=exp:c2=exp output.flac
+@end example
+
+@item
+Cross fade from one input to another but without overlapping:
+@example
+ffmpeg -i first.flac -i second.flac -filter_complex 
acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
+@end example
+@end itemize
+
 @section adelay
 
 Delay one or more audio channels.
@@ -469,6 +517,7 @@ aeval=val(0)|-val(1)
 @end example
 @end itemize
 
+@anchor{afade}
 @section afade
 
 Apply fade-in/out effect to input audio.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index af1d780..5d03e86 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -29,6 +29,7 @@ OBJS = allfilters.o   
  \
 
 OBJS-$(CONFIG_AVCODEC)   += avcodec.o
 
+OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o
 OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o
 OBJS-$(CONFIG_AECHO_FILTER)  += af_aecho.o
 OBJS-$(CONFIG_AEVAL_FILTER)  += aeval.o
diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index 4b5124a..a599b62 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Paul B Mahol
+ * Copyright (c) 2013-2015 Paul B Mahol
  *
  * This file is part of FFmpeg.
  *
@@ -23,6 +23,7 @@
  * fade audio filter
  */
 
+#include libavutil/audio_fifo.h
 #include libavutil/opt.h
 #include audio.h
 #include avfilter.h
@@ -31,15 +32,24 @@
 typedef struct {
 const AVClass *class;
 int type;
-int curve;
+int curve, curve2;
 int nb_samples;
 int64_t start_sample;
 int64_t duration;
 int64_t start_time;
+int overlap;
+int cf0_eof;
+int crossfade_is_over;
+AVAudioFifo *fifo[2];
+int64_t pts;
 
 void (*fade_samples)(uint8_t **dst, uint8_t * const *src,
  int nb_samples, int channels, int direction,
  int64_t start, int range, int curve);
+void (*crossfade_samples)(uint8_t **dst, uint8_t * const *cf0,
+  uint8_t * const *cf1,
+  int nb_samples, int channels,
+  int curve0, int curve1);
 } AudioFadeContext;
 
 enum CurveType { TRI, QSIN, ESIN, HSIN, LOG, IPAR, QUA, CUB, SQU, CBR, PAR, 
EXP, IQSIN, IHSIN, DESE, DESI, NB_CURVES };
@@ -47,52 +57,6 @@ enum CurveType { TRI, QSIN, ESIN, HSIN, LOG, IPAR, QUA, CUB, 
SQU, CBR, PAR, EXP,
 #define OFFSET(x) offsetof(AudioFadeContext, x)
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
-static const 

[FFmpeg-cvslog] Merge commit 'b94ec30428b9696f99b08055735689623fe63954'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 23:21:23 2015 +0200| [e3ec2cde2c394af6c9b64bccd39bc206a88a4e58] | 
committer: Michael Niedermayer

Merge commit 'b94ec30428b9696f99b08055735689623fe63954'

* commit 'b94ec30428b9696f99b08055735689623fe63954':
  lavc: Update version and APIchanges

Conflicts:
doc/APIchanges
libavcodec/avcodec.h
libavcodec/version.h

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] lavc: Update version and APIchanges

2015-07-27 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Fri 
Jul  3 00:50:54 2015 +0100| [b94ec30428b9696f99b08055735689623fe63954] | 
committer: Vittorio Giovara

lavc: Update version and APIchanges

Signed-off-by: Vittorio Giovara vittorio.giov...@gmail.com

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

 doc/APIchanges   |6 ++
 libavcodec/avcodec.h |4 
 libavcodec/version.h |7 +--
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 3303d5f..4ee7f41 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,12 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2015-xx-xx - lavc 56.35.0 - avcodec.h
+  x - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
+  x - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
+  x - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
+  to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.
+
 2015-xx-xx - xxx - lavc 56.33.0 - avcodec.h
   Add AV_PKT_DATA_QUALITY_FACTOR to export the quality value of an AVPacket.
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 8e5a228..5bf9833 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -544,6 +544,7 @@ typedef struct AVCodecDescriptor {
  */
 #define AV_INPUT_BUFFER_MIN_SIZE 16384
 
+#if FF_API_WITHOUT_PREFIX
 /**
  * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead
  */
@@ -553,6 +554,7 @@ typedef struct AVCodecDescriptor {
  * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead
  */
 #define FF_MIN_BUFFER_SIZE 16384
+#endif /* FF_API_WITHOUT_PREFIX */
 
 /**
  * @ingroup lavc_encoding
@@ -806,6 +808,7 @@ typedef struct RcOverride{
  */
 #define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1  16)
 
+#if FF_API_WITHOUT_PREFIX
 /**
  * Allow decoders to produce frames with data planes that are not aligned
  * to CPU requirements (e.g. due to cropping).
@@ -972,6 +975,7 @@ typedef struct RcOverride{
  * Audio encoder supports receiving a different number of samples in each call.
  */
 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x1
+#endif /* FF_API_WITHOUT_PREFIX */
 
 #if FF_API_MB_TYPE
 //The following defines may change, don't expect compatibility if you use them.
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 28a2809..f8e5ac8 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,8 +29,8 @@
 #include libavutil/version.h
 
 #define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR 34
-#define LIBAVCODEC_VERSION_MICRO  1
+#define LIBAVCODEC_VERSION_MINOR 35
+#define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
@@ -177,5 +177,8 @@
 #ifndef FF_API_MOTION_EST
 #define FF_API_MOTION_EST(LIBAVCODEC_VERSION_MAJOR  59)
 #endif
+#ifndef FF_API_WITHOUT_PREFIX
+#define FF_API_WITHOUT_PREFIX(LIBAVCODEC_VERSION_MAJOR  59)
+#endif
 
 #endif /* AVCODEC_VERSION_H */

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


[FFmpeg-cvslog] Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 21:14:31 2015 +0200| [94d68a41fabb55dd8c7e59b88fe4a28a637d1e5f] | 
committer: Michael Niedermayer

Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'

* commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615':
  lavc: AV-prefix all codec flags

Conflicts:
doc/examples/muxing.c
ffmpeg.c
ffmpeg_opt.c
ffplay.c
libavcodec/aacdec.c
libavcodec/aacenc.c
libavcodec/ac3dec.c
libavcodec/ac3enc_float.c
libavcodec/atrac1.c
libavcodec/atrac3.c
libavcodec/atrac3plusdec.c
libavcodec/dcadec.c
libavcodec/ffv1enc.c
libavcodec/h264.c
libavcodec/h264_loopfilter.c
libavcodec/h264_mb.c
libavcodec/imc.c
libavcodec/libmp3lame.c
libavcodec/libtheoraenc.c
libavcodec/libtwolame.c
libavcodec/libvpxenc.c
libavcodec/libxavs.c
libavcodec/libxvid.c
libavcodec/mpeg12dec.c
libavcodec/mpeg12enc.c
libavcodec/mpegaudiodec_template.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideo_motion.c
libavcodec/nellymoserdec.c
libavcodec/nellymoserenc.c
libavcodec/nvenc.c
libavcodec/on2avc.c
libavcodec/options_table.h
libavcodec/opus_celt.c
libavcodec/pngenc.c
libavcodec/ra288.c
libavcodec/ratecontrol.c
libavcodec/twinvq.c
libavcodec/vc1_block.c
libavcodec/vc1_loopfilter.c
libavcodec/vc1_mc.c
libavcodec/vc1dec.c
libavcodec/vorbisdec.c
libavcodec/vp3.c
libavcodec/wma.c
libavcodec/wmaprodec.c
libavcodec/x86/hpeldsp_init.c
libavcodec/x86/me_cmp_init.c

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 22:21:19 2015 +0200| [444e9874a75c821ad4a1b487559ee8ca1c999712] | 
committer: Michael Niedermayer

Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'

* commit 'def97856de6021965db86c25a732d78689bd6bb0':
  lavc: AV-prefix all codec capabilities

Conflicts:
cmdutils.c
ffmpeg.c
ffplay.c
libavcodec/8svx.c
libavcodec/aacenc.c
libavcodec/ac3dec.c
libavcodec/adpcm.c
libavcodec/alac.c
libavcodec/atrac3plusdec.c
libavcodec/bink.c
libavcodec/dnxhddec.c
libavcodec/dvdec.c
libavcodec/dvenc.c
libavcodec/ffv1dec.c
libavcodec/ffv1enc.c
libavcodec/fic.c
libavcodec/flacdec.c
libavcodec/flacenc.c
libavcodec/flvdec.c
libavcodec/fraps.c
libavcodec/frwu.c
libavcodec/gifdec.c
libavcodec/h261dec.c
libavcodec/hevc.c
libavcodec/iff.c
libavcodec/imc.c
libavcodec/libopenjpegdec.c
libavcodec/libvo-aacenc.c
libavcodec/libvorbisenc.c
libavcodec/libvpxdec.c
libavcodec/libvpxenc.c
libavcodec/libx264.c
libavcodec/mjpegbdec.c
libavcodec/mjpegdec.c
libavcodec/mpegaudiodec_float.c
libavcodec/msmpeg4dec.c
libavcodec/mxpegdec.c
libavcodec/nvenc_h264.c
libavcodec/nvenc_hevc.c
libavcodec/pngdec.c
libavcodec/qpeg.c
libavcodec/ra288.c
libavcodec/rv10.c
libavcodec/s302m.c
libavcodec/sp5xdec.c
libavcodec/takdec.c
libavcodec/tiff.c
libavcodec/tta.c
libavcodec/utils.c
libavcodec/v210dec.c
libavcodec/vp6.c
libavcodec/vp9.c
libavcodec/wavpack.c
libavcodec/yop.c

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 22:53:16 2015 +0200| [29d147c94dd40a78ca3981f39365cc77dae9a0da] | 
committer: Michael Niedermayer

Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'

* commit '059a934806d61f7af9ab3fd9f74994b838ea5eba':
  lavc: Consistently prefix input buffer defines

Conflicts:
doc/examples/decoding_encoding.c
libavcodec/4xm.c
libavcodec/aac_adtstoasc_bsf.c
libavcodec/aacdec.c
libavcodec/aacenc.c
libavcodec/ac3dec.h
libavcodec/asvenc.c
libavcodec/avcodec.h
libavcodec/avpacket.c
libavcodec/dvdec.c
libavcodec/ffv1enc.c
libavcodec/g2meet.c
libavcodec/gif.c
libavcodec/h264.c
libavcodec/h264_mp4toannexb_bsf.c
libavcodec/huffyuvdec.c
libavcodec/huffyuvenc.c
libavcodec/jpeglsenc.c
libavcodec/libxvid.c
libavcodec/mdec.c
libavcodec/motionpixels.c
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo.c
libavcodec/noise_bsf.c
libavcodec/nuv.c
libavcodec/nvenc.c
libavcodec/options.c
libavcodec/parser.c
libavcodec/pngenc.c
libavcodec/proresenc_kostya.c
libavcodec/qsvdec.c
libavcodec/svq1enc.c
libavcodec/tiffenc.c
libavcodec/truemotion2.c
libavcodec/utils.c
libavcodec/utvideoenc.c
libavcodec/vc1dec.c
libavcodec/wmalosslessdec.c
libavformat/adxdec.c
libavformat/aiffdec.c
libavformat/apc.c
libavformat/apetag.c
libavformat/avidec.c
libavformat/bink.c
libavformat/cafdec.c
libavformat/flvdec.c
libavformat/id3v2.c
libavformat/isom.c
libavformat/matroskadec.c
libavformat/mov.c
libavformat/mpc.c
libavformat/mpc8.c
libavformat/mpegts.c
libavformat/mvi.c
libavformat/mxfdec.c
libavformat/mxg.c
libavformat/nutdec.c
libavformat/oggdec.c
libavformat/oggparsecelt.c
libavformat/oggparseflac.c
libavformat/oggparseopus.c
libavformat/oggparsespeex.c
libavformat/omadec.c
libavformat/rawdec.c
libavformat/riffdec.c
libavformat/rl2.c
libavformat/rmdec.c
libavformat/rtpdec_latm.c
libavformat/rtpdec_mpeg4.c
libavformat/rtpdec_qdm2.c
libavformat/rtpdec_svq3.c
libavformat/sierravmd.c
libavformat/smacker.c
libavformat/smush.c
libavformat/spdifenc.c
libavformat/takdec.c
libavformat/tta.c
libavformat/utils.c
libavformat/vqf.c
libavformat/westwood_vqa.c
libavformat/xmv.c
libavformat/xwma.c
libavformat/yop.c

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] hap: Move some per-stream setup into decoder init rather than per-frame

2015-07-27 Thread Tom Butterworth
ffmpeg | branch: master | Tom Butterworth bangno...@gmail.com | Thu Jul 23 
14:37:08 2015 -0400| [43dd004747fa697396b47d034a80e069facbea09] | committer: 
Vittorio Giovara

hap: Move some per-stream setup into decoder init rather than per-frame

This change will reject frames with a texture type which does not match
the stream description.

Signed-off-by: Vittorio Giovara vittorio.giov...@gmail.com

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

 libavcodec/hapdec.c |   49 -
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c
index 71f7db5..46dda04 100644
--- a/libavcodec/hapdec.c
+++ b/libavcodec/hapdec.c
@@ -74,29 +74,14 @@ static int setup_texture(AVCodecContext *avctx, size_t 
length)
 HapContext *ctx = avctx-priv_data;
 GetByteContext *gbc = ctx-gbc;
 int64_t snappy_size;
-const char *texture_name;
 const char *compressorstr;
 int ret;
 
-switch (ctx-section_type  0x0F) {
-case HAP_FMT_RGBDXT1:
-ctx-tex_rat = 8;
-ctx-tex_fun = ctx-dxtc.dxt1_block;
-texture_name = DXT1;
-break;
-case HAP_FMT_RGBADXT5:
-ctx-tex_rat = 16;
-ctx-tex_fun = ctx-dxtc.dxt5_block;
-texture_name = DXT5;
-break;
-case HAP_FMT_YCOCGDXT5:
-ctx-tex_rat = 16;
-ctx-tex_fun = ctx-dxtc.dxt5ys_block;
-texture_name = DXT5-YCoCg-scaled;
-break;
-default:
+if ((avctx-codec_tag == MKTAG('H','a','p','1')  (ctx-section_type  
0x0F) != HAP_FMT_RGBDXT1) ||
+(avctx-codec_tag == MKTAG('H','a','p','5')  (ctx-section_type  
0x0F) != HAP_FMT_RGBADXT5) ||
+(avctx-codec_tag == MKTAG('H','a','p','Y')  (ctx-section_type  
0x0F) != HAP_FMT_YCOCGDXT5)) {
 av_log(avctx, AV_LOG_ERROR,
-   Invalid format mode %02X.\n, ctx-section_type);
+   Invalid texture format %#04x.\n, ctx-section_type  0x0F);
 return AVERROR_INVALIDDATA;
 }
 
@@ -135,8 +120,7 @@ static int setup_texture(AVCodecContext *avctx, size_t 
length)
 return AVERROR_INVALIDDATA;
 }
 
-av_log(avctx, AV_LOG_DEBUG, %s texture with %s compressor\n,
-   texture_name, compressorstr);
+av_log(avctx, AV_LOG_DEBUG, %s compressor\n, compressorstr);
 
 return 0;
 }
@@ -220,6 +204,7 @@ static int hap_decode(AVCodecContext *avctx, void *data,
 static av_cold int hap_init(AVCodecContext *avctx)
 {
 HapContext *ctx = avctx-priv_data;
+const char *texture_name;
 int ret = av_image_check_size(avctx-width, avctx-height, 0, avctx);
 
 if (ret  0) {
@@ -237,6 +222,28 @@ static av_cold int hap_init(AVCodecContext *avctx)
 
 ff_texturedsp_init(ctx-dxtc);
 
+switch (avctx-codec_tag) {
+case MKTAG('H','a','p','1'):
+texture_name = DXT1;
+ctx-tex_rat = 8;
+ctx-tex_fun = ctx-dxtc.dxt1_block;
+break;
+case MKTAG('H','a','p','5'):
+texture_name = DXT5;
+ctx-tex_rat = 16;
+ctx-tex_fun = ctx-dxtc.dxt5_block;
+break;
+case MKTAG('H','a','p','Y'):
+texture_name = DXT5-YCoCg-scaled;
+ctx-tex_rat = 16;
+ctx-tex_fun = ctx-dxtc.dxt5ys_block;
+break;
+default:
+return AVERROR_DECODER_NOT_FOUND;
+}
+
+av_log(avctx, AV_LOG_DEBUG, %s texture\n, texture_name);
+
 ctx-slice_count = av_clip(avctx-thread_count, 1,
avctx-coded_height / TEXTURE_BLOCK_H);
 

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


[FFmpeg-cvslog] Merge commit '43dd004747fa697396b47d034a80e069facbea09'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 23:36:37 2015 +0200| [f01e3c5d000d264b2935e186594a37a3c00f9465] | 
committer: Michael Niedermayer

Merge commit '43dd004747fa697396b47d034a80e069facbea09'

* commit '43dd004747fa697396b47d034a80e069facbea09':
  hap: Move some per-stream setup into decoder init rather than per-frame

Conflicts:
libavcodec/hapdec.c

See: 6074956fa1d2617ac602e49931b06df0a751370e
Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] Merge commit '3ee217853a6741b829a2683f49c590618891b1ab'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Mon 
Jul 27 23:47:01 2015 +0200| [4be1b6bef09737cef8173b619132fa13bef80818] | 
committer: Michael Niedermayer

Merge commit '3ee217853a6741b829a2683f49c590618891b1ab'

* commit '3ee217853a6741b829a2683f49c590618891b1ab':
  Support the Hap chunked frame format

Conflicts:
libavcodec/hap.h
libavcodec/hapdec.c
libavcodec/version.h

See: c7e6443441ed5c1b5f64067dfbf4956bc2c6acbb
Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] Support the Hap chunked frame format

2015-07-27 Thread Tom Butterworth
ffmpeg | branch: master | Tom Butterworth bangno...@gmail.com | Thu Jul 23 
14:39:29 2015 -0400| [3ee217853a6741b829a2683f49c590618891b1ab] | committer: 
Vittorio Giovara

Support the Hap chunked frame format

Signed-off-by: Vittorio Giovara vittorio.giov...@gmail.com

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

 libavcodec/Makefile  |4 +-
 libavcodec/hap.h |   38 ++-
 libavcodec/hapdec.c  |  273 +++---
 libavcodec/hapenc.c  |  191 +--
 libavcodec/version.h |2 +-
 tests/fate/video.mak |3 +
 6 files changed, 414 insertions(+), 97 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 40f653b..a6e88c7 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -243,8 +243,8 @@ OBJS-$(CONFIG_H264_MMAL_DECODER)   += mmaldec.o
 OBJS-$(CONFIG_H264_NVENC_ENCODER)  += nvenc_h264.o
 OBJS-$(CONFIG_H264_QSV_DECODER)+= qsvdec_h2645.o
 OBJS-$(CONFIG_H264_QSV_ENCODER)+= qsvenc_h264.o
-OBJS-$(CONFIG_HAP_DECODER) += hapdec.o
-OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o
+OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o
+OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o
 OBJS-$(CONFIG_HEVC_DECODER)+= hevc.o hevc_mvs.o hevc_ps.o 
hevc_sei.o \
   hevc_cabac.o hevc_refs.o hevcpred.o  
  \
   hevcdsp.o hevc_filter.o hevc_parse.o 
hevc_data.o
diff --git a/libavcodec/hap.h b/libavcodec/hap.h
index a0fc2e0..9d847f7 100644
--- a/libavcodec/hap.h
+++ b/libavcodec/hap.h
@@ -1,6 +1,7 @@
 /*
  * Vidvox Hap
  * Copyright (C) 2015 Vittorio Giovara vittorio.giov...@gmail.com
+ * Copyright (C) 2015 Tom Butterworth bangno...@gmail.com
  *
  * This file is part of Libav.
  *
@@ -41,20 +42,39 @@ enum HapCompressor {
 HAP_COMP_COMPLEX = 0xC0,
 };
 
+enum HapSectionType {
+HAP_ST_DECODE_INSTRUCTIONS = 0x01,
+HAP_ST_COMPRESSOR_TABLE= 0x02,
+HAP_ST_SIZE_TABLE  = 0x03,
+HAP_ST_OFFSET_TABLE= 0x04,
+};
+
+typedef struct HapChunk {
+enum HapCompressor compressor;
+int compressed_offset;
+size_t compressed_size;
+int uncompressed_offset;
+size_t uncompressed_size;
+} HapChunk;
+
 typedef struct HapContext {
 AVClass *class;
 
 TextureDSPContext dxtc;
 GetByteContext gbc;
 
-int section_type;/* Header type */
+enum HapTextureFormat opt_tex_fmt; /* Texture type (encoder only) */
+int opt_chunk_count; /* User-requested chunk count (encoder only) */
+
+int chunk_count;
+HapChunk *chunks;
+int *chunk_results;  /* Results from threaded operations */
 
 int tex_rat; /* Compression ratio */
 const uint8_t *tex_data; /* Compressed texture */
-uint8_t *tex_buf;/* Uncompressed texture */
+uint8_t *tex_buf;/* Buffer for compressed texture */
 size_t tex_size; /* Size of the compressed texture */
 
-uint8_t *snappied;   /* Buffer interacting with snappy */
 size_t max_snappy;   /* Maximum compressed size for snappy buffer */
 
 int slice_count; /* Number of slices for threaded operations */
@@ -63,4 +83,16 @@ typedef struct HapContext {
 int (*tex_fun)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
 } HapContext;
 
+/*
+ * Set the number of chunks in the frame. Returns 0 on success or an error if:
+ * - first_in_frame is 0 and the number of chunks has changed
+ * - any other error occurs
+ */
+int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame);
+
+/*
+ * Free resources associated with the context
+ */
+av_cold void ff_hap_free_context(HapContext *ctx);
+
 #endif /* AVCODEC_HAP_H */
diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c
index 46dda04..8f5365b 100644
--- a/libavcodec/hapdec.c
+++ b/libavcodec/hapdec.c
@@ -1,6 +1,7 @@
 /*
  * Vidvox Hap decoder
  * Copyright (C) 2015 Vittorio Giovara vittorio.giov...@gmail.com
+ * Copyright (C) 2015 Tom Butterworth bangno...@gmail.com
  *
  * This file is part of Libav.
  *
@@ -36,6 +37,7 @@
 #include bytestream.h
 #include hap.h
 #include internal.h
+#include memory.h
 #include snappy.h
 #include texturedsp.h
 #include thread.h
@@ -43,85 +45,224 @@
 /* The first three bytes are the size of the section past the header, or zero
  * if the length is stored in the next long word. The fourth byte in the first
  * long word indicates the type of the current section. */
-static int parse_section_header(AVCodecContext *avctx)
+static int parse_section_header(GetByteContext *gbc, int *section_size,
+enum HapSectionType *section_type)
 {
-HapContext *ctx = avctx-priv_data;
-GetByteContext *gbc = ctx-gbc;
-int length;
-
 if (bytestream2_get_bytes_left(gbc)  4)
 return AVERROR_INVALIDDATA;
 
-length = 

[FFmpeg-cvslog] Merge commit 'b7040e67ec18259ca634a0e29d98469b3484a87c'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Tue 
Jul 28 00:27:37 2015 +0200| [ea7e4f8e6aa2500716b55a1d9ad247bca1cd1174] | 
committer: Michael Niedermayer

Merge commit 'b7040e67ec18259ca634a0e29d98469b3484a87c'

* commit 'b7040e67ec18259ca634a0e29d98469b3484a87c':
  h264: fix AVDISCARD_NONKEY for some interlaced content

Conflicts:
libavcodec/h264.c

Not merged, the used field is not initialized where it is used

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] fate: Add hap-chunk ref file

2015-07-27 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Mon 
Jul 27 16:56:12 2015 +0100| [abdc7e403e003e97a0dcc4499ac319bf854aeead] | 
committer: Vittorio Giovara

fate: Add hap-chunk ref file

Missing from the push of 3ee217853a6741b829a2683f49c590618891b1ab.

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

 tests/ref/fate/hap-chunk |2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/ref/fate/hap-chunk b/tests/ref/fate/hap-chunk
new file mode 100644
index 000..4f09d43
--- /dev/null
+++ b/tests/ref/fate/hap-chunk
@@ -0,0 +1,2 @@
+#tb 0: 1/15360
+0,  0,  0,0,16384, 0x096d409e

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


[FFmpeg-cvslog] hap: Add utility functions file

2015-07-27 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Mon 
Jul 27 16:20:29 2015 +0100| [aaf937ee3557bfb99c2ad298591b22a7f22ecbf7] | 
committer: Vittorio Giovara

hap: Add utility functions file

Missing from the push of 3ee217853a6741b829a2683f49c590618891b1ab.

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

 libavcodec/hap.c |   55 ++
 1 file changed, 55 insertions(+)

diff --git a/libavcodec/hap.c b/libavcodec/hap.c
new file mode 100644
index 000..770142c
--- /dev/null
+++ b/libavcodec/hap.c
@@ -0,0 +1,55 @@
+/*
+ * Vidvox Hap utility functions
+ * Copyright (C) 2015 Tom Butterworth bangno...@gmail.com
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Hap utilities
+ */
+#include hap.h
+
+int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame)
+{
+int ret = 0;
+if (first_in_frame == 1  ctx-chunk_count != count) {
+int ret = av_reallocp_array(ctx-chunks, count, sizeof(HapChunk));
+if (ret == 0)
+ret = av_reallocp_array(ctx-chunk_results, count, sizeof(int));
+if (ret  0) {
+ctx-chunk_count = 0;
+} else {
+ctx-chunk_count = count;
+}
+} else if (ctx-chunk_count != count) {
+/* If this is not the first chunk count calculated for a frame and a
+ * different count has already been encountered, then reject the frame:
+ * each table in the Decode Instructions Container must describe the
+ * same number of chunks. */
+ret = AVERROR_INVALIDDATA;
+}
+return ret;
+}
+
+av_cold void ff_hap_free_context(HapContext *ctx)
+{
+av_freep(ctx-tex_buf);
+av_freep(ctx-chunks);
+av_freep(ctx-chunk_results);
+}

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


[FFmpeg-cvslog] Merge commit 'abdc7e403e003e97a0dcc4499ac319bf854aeead'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Tue 
Jul 28 00:04:02 2015 +0200| [146730480265dc2ce23f18a15b9edf2129b54185] | 
committer: Michael Niedermayer

Merge commit 'abdc7e403e003e97a0dcc4499ac319bf854aeead'

* commit 'abdc7e403e003e97a0dcc4499ac319bf854aeead':
  fate: Add hap-chunk ref file

Conflicts:
tests/ref/fate/hap-chunk

See: c7e6443441ed5c1b5f64067dfbf4956bc2c6acbb
Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] Merge commit 'aaf937ee3557bfb99c2ad298591b22a7f22ecbf7'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Tue 
Jul 28 00:02:37 2015 +0200| [952e9fbb4aaa7d424847e64514973d749d2fc931] | 
committer: Michael Niedermayer

Merge commit 'aaf937ee3557bfb99c2ad298591b22a7f22ecbf7'

* commit 'aaf937ee3557bfb99c2ad298591b22a7f22ecbf7':
  hap: Add utility functions file

Conflicts:
libavcodec/hap.c

No change, no files are/where missing in FFmpeg

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] qsvdec_mpeg2: drop an incorrect comment

2015-07-27 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov an...@khirnov.net | Mon Jul 27 
08:01:09 2015 +0200| [db21dde3f72c2331653399bdb8745350f015d847] | committer: 
Anton Khirnov

qsvdec_mpeg2: drop an incorrect comment

It got copypasted from the h264 decoder, but it does not apply to mpeg2.

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

 libavcodec/qsvdec_mpeg2.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/qsvdec_mpeg2.c b/libavcodec/qsvdec_mpeg2.c
index 31bdf92..98318bd 100644
--- a/libavcodec/qsvdec_mpeg2.c
+++ b/libavcodec/qsvdec_mpeg2.c
@@ -114,7 +114,6 @@ static int qsv_decode_frame(AVCodecContext *avctx, void 
*data,
 
 /* process buffered data */
 while (!*got_frame) {
-/* prepare the input data -- convert to Annex B if needed */
 if (s-input_ref.size = 0) {
 /* no more data */
 if (av_fifo_size(s-packet_fifo)  sizeof(AVPacket))

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


[FFmpeg-cvslog] Merge commit 'b5c1c16247ab7d166c84eaf4564e49a1535fdaaf'

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer mich...@niedermayer.cc | Tue 
Jul 28 00:13:51 2015 +0200| [e1296b5fa4e54941dcc68136022d71dfff01e214] | 
committer: Michael Niedermayer

Merge commit 'b5c1c16247ab7d166c84eaf4564e49a1535fdaaf'

* commit 'b5c1c16247ab7d166c84eaf4564e49a1535fdaaf':
  asfdec: do not align Data Object when Broadcast Flag is set

Merged-by: Michael Niedermayer mich...@niedermayer.cc

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



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


[FFmpeg-cvslog] asfdec: do not align Data Object when Broadcast Flag is set

2015-07-27 Thread Alexandra Hájková
ffmpeg | branch: master | Alexandra Hájková alexandra.khirn...@gmail.com | 
Thu Jul 23 12:33:37 2015 +0200| [b5c1c16247ab7d166c84eaf4564e49a1535fdaaf] | 
committer: Anton Khirnov

asfdec: do not align Data Object when Broadcast Flag is set

its size is invalid in this case

Signed-off-by: Anton Khirnov an...@khirnov.net

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

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

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 9c746af..37d91e0 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -928,7 +928,7 @@ static int asf_read_data(AVFormatContext *s, const 
GUIDParseTable *g)
size, asf-nb_packets);
 avio_skip(pb, 2); // skip reserved field
 asf-first_packet_offset = avio_tell(pb);
-if (pb-seekable)
+if (pb-seekable  !(asf-b_flags  ASF_FLAG_BROADCAST))
 align_position(pb, asf-offset, asf-data_size);
 
 return 0;
@@ -1676,7 +1676,7 @@ static int asf_read_header(AVFormatContext *s)
 size = avio_rl64(pb);
 align_position(pb, asf-offset, size);
 }
-if (asf-data_reached  !pb-seekable)
+if (asf-data_reached  (!pb-seekable || (asf-b_flags  
ASF_FLAG_BROADCAST)))
 break;
 }
 

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


[FFmpeg-cvslog] h264: fix AVDISCARD_NONKEY for some interlaced content

2015-07-27 Thread John Högberg
ffmpeg | branch: master | John Högberg john.hogb...@ericsson.com | Fri Jul 24 
15:30:38 2015 +0200| [b7040e67ec18259ca634a0e29d98469b3484a87c] | committer: 
Anton Khirnov

h264: fix AVDISCARD_NONKEY for some interlaced content

When skip_frame is set to _NONKEY the decoder skips everything except intra
slices, which breaks frames that consist of an intra field together with any
other field type; half the frame becomes garbage. This patch fixes the issue by
letting non-intra slices through if they're part of a keyframe.

Signed-off-by: Anton Khirnov an...@khirnov.net

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

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

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index eb4edb9..7c2b307 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1507,7 +1507,7 @@ again:
 (avctx-skip_frame  AVDISCARD_BIDIR  ||
  sl-slice_type_nos != AV_PICTURE_TYPE_B) 
 (avctx-skip_frame  AVDISCARD_NONKEY ||
- sl-slice_type_nos == AV_PICTURE_TYPE_I) 
+ h-cur_pic_ptr-f-key_frame) 
 avctx-skip_frame  AVDISCARD_ALL) {
 if (avctx-hwaccel) {
 ret = avctx-hwaccel-decode_slice(avctx,

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


[FFmpeg-cvslog] avformat/wavdec: Increase probe_packets limit

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Sat May 
23 12:03:38 2015 +0200| [f1a4af4dc27c41e13e15ff5e7e9f5af3551a1b2e] | committer: 
Michael Niedermayer

avformat/wavdec: Increase probe_packets limit

Fixes DTS detection of b2429e5ba9.dts

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 9f5769437aaab30a359cde254f39d9a28b1ce657)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 9c4e2df..763e2e4 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -114,7 +114,7 @@ static void handle_stream_probing(AVStream *st)
 {
 if (st-codec-codec_id == AV_CODEC_ID_PCM_S16LE) {
 st-request_probe = AVPROBE_SCORE_EXTENSION;
-st-probe_packets = FFMIN(st-probe_packets, 14);
+st-probe_packets = FFMIN(st-probe_packets, 20);
 }
 }
 

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


[FFmpeg-cvslog] avcodec/put_bits: Assert that there is enough space left in skip_put_bytes ()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon May 
25 03:45:38 2015 +0200| [4ac8b94a73218aa176226a431a222a1946199e7c] | committer: 
Michael Niedermayer

avcodec/put_bits: Assert that there is enough space left in skip_put_bytes()

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 8f5ffed183e099128a732a00976f69fdc641d093)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/put_bits.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 8dbbd09..08f6826 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -230,6 +230,7 @@ static inline void skip_put_bytes(PutBitContext *s, int n)
 {
 av_assert2((put_bits_count(s)  7) == 0);
 av_assert2(s-bit_left == 32);
+av_assert0(n = s-buf_end - s-buf_ptr);
 s-buf_ptr += n;
 }
 

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


[FFmpeg-cvslog] avformat/wavdec: Increase dts packet threshold to fix more misdetections

2015-07-27 Thread Rodger Combs
ffmpeg | branch: release/2.5 | Rodger Combs rodger.co...@gmail.com | Sat May 
23 14:07:14 2015 +0200| [9e1a818a2df1a5c023780bb3d9b0bcafbe7bf20e] | committer: 
Michael Niedermayer

avformat/wavdec: Increase dts packet threshold to fix more misdetections

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 40a3e1e9c54997e4dfc7802b5a758b68ceb64982)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 763e2e4..66fd766 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -114,7 +114,7 @@ static void handle_stream_probing(AVStream *st)
 {
 if (st-codec-codec_id == AV_CODEC_ID_PCM_S16LE) {
 st-request_probe = AVPROBE_SCORE_EXTENSION;
-st-probe_packets = FFMIN(st-probe_packets, 20);
+st-probe_packets = FFMIN(st-probe_packets, 32);
 }
 }
 

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


[FFmpeg-cvslog] avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon May 
25 04:53:09 2015 +0200| [962ad32891c82906cdca3a5e4c3e1d3e92b384bc] | committer: 
Michael Niedermayer

avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size()

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit e4c2ec879b1121c02279cd60a54643da0d249e40)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/put_bits.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 8858caa..8dbbd09 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -253,6 +253,7 @@ static inline void skip_put_bits(PutBitContext *s, int n)
 static inline void set_put_bits_buffer_size(PutBitContext *s, int size)
 {
 s-buf_end = s-buf + size;
+s-size_in_bits = 8*size;
 }
 
 #endif /* AVCODEC_PUT_BITS_H */

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


[FFmpeg-cvslog] vp9: change type of tile_size from unsigned to int64_t

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Sun Jun  7 18:50:43 2015 +0200| 
[e4e3b14bba127bdce9521a78446b294f6bc8e43b] | committer: Michael Niedermayer

vp9: change type of tile_size from unsigned to int64_t

Otherwise the check 'tile_size  size' treats a negative size as
unsigned, causing the check to pass. This subsequently leads to
segmentation faults.

This was originally fixed as part of Libav commit 72ca83, so the
original author is one of the following developers:
Anton Khirnov an...@khirnov.net
Diego Biurrun di...@biurrun.de
Luca Barbato lu_z...@gentoo.org
Martin Storsjö mar...@martin.st

Reviewed-by: Ronald S. Bultje rsbul...@gmail.com
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit b18eac7ff22332c9344769af15f7b245dd13cc64)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index a051284..8cf649e 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3856,7 +3856,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 tile_row, s-tiling.log2_tile_rows, s-sb_rows);
 if (s-pass != 2) {
 for (tile_col = 0; tile_col  s-tiling.tile_cols; tile_col++) 
{
-unsigned tile_size;
+int64_t tile_size;
 
 if (tile_col == s-tiling.tile_cols - 1 
 tile_row == s-tiling.tile_rows - 1) {

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


[FFmpeg-cvslog] swresample/swresample: Cleanup on init failure.

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Thu Jun 
 4 03:47:55 2015 +0200| [de943a3460a8a0f88cbdbfa1ef16ae93dbbbee29] | committer: 
Michael Niedermayer

swresample/swresample: Cleanup on init failure.

This avoids leaks if the user doest call swr_close() after a failed init

Found-by: James Almer jamr...@gmail.com
Reviewed-by: James Almer jamr...@gmail.com
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit c3f87f7545d42520921bc448b9fbd7324c574e49)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libswresample/swresample.c |   34 --
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 2cd9d45..6dde73b 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -267,7 +267,8 @@ av_cold int swr_init(struct SwrContext *s){
  s-int_sample_fmt != AV_SAMPLE_FMT_DBLP
  s-resample){
 av_log(s, AV_LOG_ERROR, Resampling only supported with internal 
s16/s32/flt/dbl\n);
-return -1;
+ret = AVERROR(EINVAL);
+goto fail;
 }
 
 #define RSC 1 //FIXME finetune
@@ -281,24 +282,28 @@ av_cold int swr_init(struct SwrContext *s){
 if(!s- in.ch_count){
 av_assert0(!s-in_ch_layout);
 av_log(s, AV_LOG_ERROR, Input channel count and layout are unset\n);
-return -1;
+ret = AVERROR(EINVAL);
+goto fail;
 }
 
 av_get_channel_layout_string(l1, sizeof(l1), s- in.ch_count, s- 
in_ch_layout);
 av_get_channel_layout_string(l2, sizeof(l2), s-out.ch_count, 
s-out_ch_layout);
 if (s-out_ch_layout  s-out.ch_count != 
av_get_channel_layout_nb_channels(s-out_ch_layout)) {
 av_log(s, AV_LOG_ERROR, Output channel layout %s mismatches specified 
channel count %d\n, l2, s-out.ch_count);
-return AVERROR(EINVAL);
+ret = AVERROR(EINVAL);
+goto fail;
 }
 if (s-in_ch_layout  s-used_ch_count != 
av_get_channel_layout_nb_channels(s-in_ch_layout)) {
 av_log(s, AV_LOG_ERROR, Input channel layout %s mismatches specified 
channel count %d\n, l1, s-used_ch_count);
-return AVERROR(EINVAL);
+ret = AVERROR(EINVAL);
+goto fail;
 }
 
 if ((!s-out_ch_layout || !s-in_ch_layout)  s-used_ch_count != 
s-out.ch_count  !s-rematrix_custom) {
 av_log(s, AV_LOG_ERROR, Rematrix is needed between %s and %s 
but there is not enough information to do it\n, l1, l2);
-return -1;
+ret = AVERROR(EINVAL);
+goto fail;
 }
 
 av_assert0(s-used_ch_count);
@@ -320,8 +325,10 @@ av_assert0(s-out.ch_count);
 s-out_convert= swri_audio_convert_alloc(s-out_sample_fmt,
  s-int_sample_fmt, 
s-out.ch_count, NULL, 0);
 
-if (!s-in_convert || !s-out_convert)
-return AVERROR(ENOMEM);
+if (!s-in_convert || !s-out_convert) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 
 s-postin= s-in;
 s-preout= s-out;
@@ -348,12 +355,19 @@ av_assert0(s-out.ch_count);
 }
 
 if ((ret = swri_dither_init(s, s-out_sample_fmt, s-int_sample_fmt))  0)
-return ret;
+goto fail;
 
-if(s-rematrix || s-dither.method)
-return swri_rematrix_init(s);
+if(s-rematrix || s-dither.method) {
+ret = swri_rematrix_init(s);
+if (ret  0)
+goto fail;
+}
 
 return 0;
+fail:
+swr_close(s);
+return ret;
+
 }
 
 int swri_realloc_audio(AudioData *a, int count){

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


[FFmpeg-cvslog] libopenjpegdec: check existence of image component data

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Sat May 30 16:18:48 2015 +0200| 
[a1879d347e6268635e19fcf4fd31cc4dfa0e161c] | committer: Michael Niedermayer

libopenjpegdec: check existence of image component data

libopenjpeg can return images with components without data.

This fixes segmentation faults.

Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit 3ef5702926c495232ffe685303ba8661bdff1149)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/libopenjpegdec.c |9 +
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 0cf46e6..33c570f 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -356,6 +356,15 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
 goto done;
 }
 
+for (i = 0; i  image-numcomps; i++) {
+if (!image-comps[i].data) {
+av_log(avctx, AV_LOG_ERROR,
+   Image component %d contains no data.\n, i);
+ret = AVERROR_INVALIDDATA;
+goto done;
+}
+}
+
 desc   = av_pix_fmt_desc_get(avctx-pix_fmt);
 pixel_size = desc-comp[0].step_minus1 + 1;
 ispacked   = libopenjpeg_ispacked(avctx-pix_fmt);

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


[FFmpeg-cvslog] sonic: set avctx-channels in sonic_decode_init

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Tue Jun  9 22:41:24 2015 +0200| 
[da13957525a7939599cf7f425c2feb00ea5a] | committer: Michael Niedermayer

sonic: set avctx-channels in sonic_decode_init

Otherwise it can be 0 in sonic_decode_frame, causing SIGFPE crashes.

Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit 58995f647b5fa2e1efa33ae4f8b8a76a81ec99df)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/sonic.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index 3db77f3..c5076f9 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -900,6 +900,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
 av_log(avctx, AV_LOG_ERROR, Only mono and stereo streams are 
supported by now\n);
 return AVERROR_INVALIDDATA;
 }
+avctx-channels = s-channels;
 
 s-lossless = get_bits1(gb);
 if (!s-lossless)

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


[FFmpeg-cvslog] postproc: fix unaligned access

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Thu Jun 18 20:15:12 2015 +0200| 
[dd141a50ccb3913d6e9b46478cac7a640e76ddc4] | committer: Michael Niedermayer

postproc: fix unaligned access

QP_store is only 8-bit-aligned, so accessing it as uint32_t causes
SIGBUS crashes on sparc.
The AV_RN32/AV_WN32 macros only do unaligned access in the
HAVE_FAST_UNALIGNED case.

Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit 590743101dc934043f34013f1c9bb9fb261355b0)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libpostproc/postprocess.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index c11debc..1b90a51 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -76,6 +76,7 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x 
... checks
 #include config.h
 #include libavutil/avutil.h
 #include libavutil/avassert.h
+#include libavutil/intreadwrite.h
 #include inttypes.h
 #include stdio.h
 #include stdlib.h
@@ -1024,7 +1025,7 @@ void  pp_postprocess(const uint8_t * src[3], const int 
srcStride[3],
 int i;
 const int count= FFMAX(mbHeight * QPStride, mbWidth);
 for(i=0; i(count2); i++){
-((uint32_t*)c-nonBQPTable)[i] = ((const 
uint32_t*)QP_store)[i]  0x3F3F3F3F;
+AV_WN32(c-nonBQPTable + (i2), AV_RN32(QP_store + (i2))  
0x3F3F3F3F);
 }
 for(i=2; icount; i++){
 c-nonBQPTable[i] = QP_store[i]  0x3F;

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


[FFmpeg-cvslog] avio: fix potential crashes when combining ffio_ensure_seekback + crc

2015-07-27 Thread wm4
ffmpeg | branch: release/2.5 | wm4 nfx...@googlemail.com | Wed Jun 17 
00:21:02 2015 +0200| [3903a60d4beeb46cda5d830be2eb2bac76171ce8] | committer: 
Michael Niedermayer

avio: fix potential crashes when combining ffio_ensure_seekback + crc

Calling ffio_ensure_seekback() if ffio_init_checksum() has been called
on the same context can lead to out of bounds memory accesses and
crashes. The reason is that ffio_ensure_seekback() does not update
checksum_ptr after reallocating the buffer, resulting in a dangling
pointer.

This effectively fixes potential crashes when opening mp3 files.

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit dc87758775e2ce8be84e4fe598e12416e83d2845)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 0b0748e..4ce18e4 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -785,6 +785,7 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
 int max_buffer_size = s-max_packet_size ?
   s-max_packet_size : IO_BUFFER_SIZE;
 int filled = s-buf_end - s-buffer;
+ptrdiff_t checksum_ptr_offset = s-checksum_ptr ? s-checksum_ptr - 
s-buffer : -1;
 
 buf_size += s-buf_ptr - s-buffer + max_buffer_size;
 
@@ -802,6 +803,8 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
 s-buf_end = buffer + (s-buf_end - s-buffer);
 s-buffer = buffer;
 s-buffer_size = buf_size;
+if (checksum_ptr_offset = 0)
+s-checksum_ptr = s-buffer + checksum_ptr_offset;
 return 0;
 }
 

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


[FFmpeg-cvslog] vp8: change mv_{min,max}.{x,y} type to int

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Mon Jun  8 22:38:29 2015 +0200| 
[27d50fb2d52bc1fb85d13b968f61a70ea8defc9e] | committer: Michael Niedermayer

vp8: change mv_{min,max}.{x,y} type to int

If one of the dimensions is larger than 8176, s-mb_width or
s-mb_height is larger than 511, leading to an int16_t overflow of
s-mv_max.{x,y}. This then causes av_clip to be called with amin  amax.

Changing the type to int avoids the overflow and has no negative
effect, because s-mv_max is only used in clamp_mv for clipping.
Since mv_max.{x,y} is positive and mv_min.{x,y} negative, av_clip can't
increase the absolute value. The input to av_clip is an int16_t, and
thus the output fits into int16_t as well.

For additional safety, s-mv_{min,max}.{x,y} are clipped to int16_t range
before use.

Reviewed-by: Ronald S. Bultje rsbul...@gmail.com
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit 6fdbaa2b7fb56623ab2163f861952bc1408c39b3)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/vp8.c |6 --
 libavcodec/vp8.h |9 +++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 5d3123d..86eb4e9 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -757,8 +757,10 @@ static int vp8_decode_frame_header(VP8Context *s, const 
uint8_t *buf, int buf_si
 static av_always_inline
 void clamp_mv(VP8Context *s, VP56mv *dst, const VP56mv *src)
 {
-dst-x = av_clip(src-x, s-mv_min.x, s-mv_max.x);
-dst-y = av_clip(src-y, s-mv_min.y, s-mv_max.y);
+dst-x = av_clip(src-x, av_clip(s-mv_min.x, INT16_MIN, INT16_MAX),
+ av_clip(s-mv_max.x, INT16_MIN, INT16_MAX));
+dst-y = av_clip(src-y, av_clip(s-mv_min.y, INT16_MIN, INT16_MAX),
+ av_clip(s-mv_max.y, INT16_MIN, INT16_MAX));
 }
 
 /**
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h
index b650892..2135bd9 100644
--- a/libavcodec/vp8.h
+++ b/libavcodec/vp8.h
@@ -134,6 +134,11 @@ typedef struct VP8Frame {
 AVBufferRef *seg_map;
 } VP8Frame;
 
+typedef struct VP8intmv {
+int x;
+int y;
+} VP8intmv;
+
 #define MAX_THREADS 8
 typedef struct VP8Context {
 VP8ThreadData *thread_data;
@@ -152,8 +157,8 @@ typedef struct VP8Context {
 uint8_t deblock_filter;
 uint8_t mbskip_enabled;
 uint8_t profile;
-VP56mv mv_min;
-VP56mv mv_max;
+VP8intmv mv_min;
+VP8intmv mv_max;
 
 int8_t sign_bias[4]; /// one state [0, 1] per ref frame type
 int ref_count[3];

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


[FFmpeg-cvslog] avcodec/dpxenc: implement write16/32 as functions

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Fri Jun 
19 16:46:06 2015 +0200| [fc0df14de1a6f75be52b77e067608d833a68c05c] | committer: 
Michael Niedermayer

avcodec/dpxenc: implement write16/32 as functions

Fixes undefined behavior and segfault

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 8edc17b639c4ac47913c467107ffb43c67c64890)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/dpxenc.c |   23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c
index aca745b..76aa0cc 100644
--- a/libavcodec/dpxenc.c
+++ b/libavcodec/dpxenc.c
@@ -75,17 +75,20 @@ static av_cold int encode_init(AVCodecContext *avctx)
 return 0;
 }
 
-#define write16(p, value) \
-do { \
-if (s-big_endian) AV_WB16(p, value); \
-else   AV_WL16(p, value); \
-} while(0)
+static av_always_inline void write16_internal(int big_endian, void *p, int 
value)
+{
+if (big_endian) AV_WB16(p, value);
+elseAV_WL16(p, value);
+}
+
+static av_always_inline void write32_internal(int big_endian, void *p, int 
value)
+{
+if (big_endian) AV_WB32(p, value);
+elseAV_WL32(p, value);
+}
 
-#define write32(p, value) \
-do { \
-if (s-big_endian) AV_WB32(p, value); \
-else   AV_WL32(p, value); \
-} while(0)
+#define write16(p, value) write16_internal(s-big_endian, p, value)
+#define write32(p, value) write32_internal(s-big_endian, p, value)
 
 static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, 
uint8_t *dst)
 {

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


[FFmpeg-cvslog] matroskadec: validate audio channels and bitdepth

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Mon Jun 15 21:06:51 2015 +0200| 
[5464da89056698856d919585256bb422558eb554] | committer: Michael Niedermayer

matroskadec: validate audio channels and bitdepth

In the TTA extradata re-construction the values are written with
avio_wl16 and if they don't fit into uint16_t, this triggers an
av_assert2 in avio_w8.

Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit 92e79a2f7bf2f8bb0cb2d1a3e4d76737557071c4)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavformat/matroskadec.c |   12 
 1 file changed, 12 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 0bfa9dc..0654b31 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1799,6 +1799,18 @@ static int matroska_parse_tracks(AVFormatContext *s)
   NULL, NULL, NULL, NULL);
 avio_write(b, TTA1, 4);
 avio_wl16(b, 1);
+if (track-audio.channels  UINT16_MAX ||
+track-audio.bitdepth  UINT16_MAX) {
+av_log(matroska-ctx, AV_LOG_WARNING,
+   Too large audio channel number %PRIu64
+or bitdepth %PRIu64. Skipping track.\n,
+   track-audio.channels, track-audio.bitdepth);
+av_freep(extradata);
+if (matroska-ctx-error_recognition  AV_EF_EXPLODE)
+return AVERROR_INVALIDDATA;
+else
+continue;
+}
 avio_wl16(b, track-audio.channels);
 avio_wl16(b, track-audio.bitdepth);
 if (track-audio.out_samplerate  0 || track-audio.out_samplerate 
 INT_MAX)

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


[FFmpeg-cvslog] ffmpeg: Free last_frame instead of just unref

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Thu Jun 
18 05:27:08 2015 +0200| [568c1b8166b111d41e6b416e6d98244072fb087a] | committer: 
Michael Niedermayer

ffmpeg: Free last_frame instead of just unref

Fixes Ticket4611

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit d1050d9950610aa2b27878b67bb2b902dd717e7c)

Conflicts:

ffmpeg.c

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

 ffmpeg.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 6e640e3..60d8e89 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1142,7 +1142,10 @@ static void do_video_out(AVFormatContext *s,
 if (!ost-last_frame)
 ost-last_frame = av_frame_alloc();
 av_frame_unref(ost-last_frame);
-av_frame_ref(ost-last_frame, next_picture);
+if (next_picture)
+av_frame_ref(ost-last_frame, next_picture);
+else
+av_frame_free(ost-last_frame);
 }
 
 static double psnr(double d)

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


[FFmpeg-cvslog] ffmpeg_opt: Check for localtime() failure

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Fri Jun 
12 15:36:20 2015 +0200| [7d03a9156da3df077feb4a5235d9393d313cd5ff] | committer: 
Michael Niedermayer

ffmpeg_opt: Check for localtime() failure

Found-by: Daemon404
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 8e91d9652ea5048d9014e7636e12c6ed4732d7b7)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 ffmpeg_opt.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index ea16a11..e0c48ce 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2345,6 +2345,9 @@ static int opt_vstats(void *optctx, const char *opt, 
const char *arg)
 time_t today2 = time(NULL);
 struct tm *today = localtime(today2);
 
+if (!today)
+return AVERROR(errno);
+
 snprintf(filename, sizeof(filename), vstats_%02d%02d%02d.log, 
today-tm_hour, today-tm_min,
  today-tm_sec);
 return opt_vstats_file(NULL, opt, filename);

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


[FFmpeg-cvslog] arm: only enable setend on ARMv6

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Thu Jun  4 23:07:44 2015 +0200| 
[b4d265e2dcd9f714df83c5b7468e28dc1e274397] | committer: Michael Niedermayer

arm: only enable setend on ARMv6

Without this check it causes SIGILL crashes on ARMv5.

Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit 5bf84a584e9ce681b439a5747671e2809a019c83)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavutil/arm/cpu.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c
index f1683e8..02def0b 100644
--- a/libavutil/arm/cpu.c
+++ b/libavutil/arm/cpu.c
@@ -128,7 +128,7 @@ int ff_get_cpu_flags_arm(void)
trickle down. */
 if (flags  (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON))
 flags |= AV_CPU_FLAG_ARMV6T2;
-else
+else if (flags  (AV_CPU_FLAG_ARMV6T2 | AV_CPU_FLAG_ARMV6))
 /* Some functions use the 'setend' instruction which is deprecated on ARMv8
  * and serializing on some ARMv7 cores. This ensures such functions
  * are only enabled on ARMv6. */

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


[FFmpeg-cvslog] h264: er: Copy from the previous reference only if compatible

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Sun Jun 14 12:40:18 2015 +0200| 
[58a0dc1bdf67d11fbb2a46a1726ba9abc2550a9f] | committer: Michael Niedermayer

h264: er: Copy from the previous reference only if compatible

Also use the frame pixel format instead of the one from the codec
context, which is more robust.

Signed-off-by: Luca Barbato lu_z...@gentoo.org
Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit fdc64a104410f5fcc7f35b62287b0ae502b7061a)

Conflicts:

libavcodec/h264_slice.c

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index d439f9b..13b7482 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1687,12 +1687,15 @@ int ff_h264_decode_slice_header(H264Context *h, 
H264Context *h0)
  * vectors.  Given we are concealing a lost frame, this probably
  * is not noticeable by comparison, but it should be fixed. */
 if (h-short_ref_count) {
-if (prev) {
+if (prev 
+h-short_ref[0]-f.width == prev-f.width 
+h-short_ref[0]-f.height == prev-f.height 
+h-short_ref[0]-f.format == prev-f.format) {
 av_image_copy(h-short_ref[0]-f.data,
   h-short_ref[0]-f.linesize,
   (const uint8_t **)prev-f.data,
   prev-f.linesize,
-  h-avctx-pix_fmt,
+  prev-f.format,
   h-mb_width  * 16,
   h-mb_height * 16);
 h-short_ref[0]-poc = prev-poc + 2;

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


[FFmpeg-cvslog] avformat: Fix bug in parse_rps for HEVC.

2015-07-27 Thread Deliang Fu
ffmpeg | branch: release/2.5 | Deliang Fu agoals...@gmail.com | Wed Jun 10 
12:30:46 2015 +0800| [bda906a19561f6e4cc60c9dd494eef1669a438b9] | committer: 
Michael Niedermayer

avformat: Fix bug in parse_rps for HEVC.

Make the logic in libavformat/hevc.c parse_rps align with libavcodec/hevc_ps.c 
ff_hevc_decode_short_term_rps

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 6e1f8780c833ef55815111d4771b95ff78567cdb)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavformat/hevc.c b/libavformat/hevc.c
index c92e9eb..32192ba 100644
--- a/libavformat/hevc.c
+++ b/libavformat/hevc.c
@@ -449,7 +449,7 @@ static int parse_rps(GetBitContext *gb, unsigned int 
rps_idx,
  *
  * NumDeltaPocs[RefRpsIdx]: num_delta_pocs[rps_idx - 1]
  */
-for (i = 0; i  num_delta_pocs[rps_idx - 1]; i++) {
+for (i = 0; i = num_delta_pocs[rps_idx - 1]; i++) {
 uint8_t use_delta_flag = 0;
 uint8_t used_by_curr_pic_flag = get_bits1(gb);
 if (!used_by_curr_pic_flag)

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


[FFmpeg-cvslog] avcodec/h264_slice: Use AVFrame diemensions for grayscale handling

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Wed Jun 
10 11:37:48 2015 +0200| [f5a73058b0f26133bb366f8644711563db76fb74] | committer: 
Michael Niedermayer

avcodec/h264_slice: Use AVFrame diemensions for grayscale handling

The AVFrame values are closer to the AVFrame bitmap changed instead of
the AVCodecContext values, so this should be more robust

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit aef0e0f009802f1a5e21eb6465498632071e4475)

Conflicts:

libavcodec/h264_slice.c

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

 libavcodec/h264_slice.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 6b1db1a..d439f9b 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -278,11 +278,11 @@ static int alloc_picture(H264Context *h, H264Picture *pic)
 av_pix_fmt_get_chroma_sub_sample(pic-f.format,
  h_chroma_shift, v_chroma_shift);
 
-for(i=0; iFF_CEIL_RSHIFT(h-avctx-height, v_chroma_shift); i++) {
+for(i=0; iFF_CEIL_RSHIFT(pic-f.height, v_chroma_shift); i++) {
 memset(pic-f.data[1] + pic-f.linesize[1]*i,
-   0x80, FF_CEIL_RSHIFT(h-avctx-width, h_chroma_shift));
+   0x80, FF_CEIL_RSHIFT(pic-f.width, h_chroma_shift));
 memset(pic-f.data[2] + pic-f.linesize[2]*i,
-   0x80, FF_CEIL_RSHIFT(h-avctx-width, h_chroma_shift));
+   0x80, FF_CEIL_RSHIFT(pic-f.width, h_chroma_shift));
 }
 }
 

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


[FFmpeg-cvslog] avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Wed Jun 
10 00:47:43 2015 +0200| [a2a545d8db8e9081dfae02e8f2ccfac8796783f1] | committer: 
Michael Niedermayer

avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 913685f55208efd78bfc34d82b261bd449e69774)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavdevice/lavfi.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 1398ece..f6c92bc 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -339,7 +339,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, 
AVPacket *pkt)
 continue;
 } else if (ret  0)
 return ret;
-d = av_rescale_q(frame-pts, tb, AV_TIME_BASE_Q);
+d = av_rescale_q_rnd(frame-pts, tb, AV_TIME_BASE_Q, 
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
 av_dlog(avctx, sink_idx:%d time:%f\n, i, d);
 av_frame_unref(frame);
 

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


[FFmpeg-cvslog] vda: unlock the pixel buffer base address.

2015-07-27 Thread Sebastien Zwickert
ffmpeg | branch: release/2.5 | Sebastien Zwickert dilar...@gmail.com | Sat 
Jun 20 13:19:29 2015 +0200| [8f067955332dc185003f30387c5deb41fe954786] | 
committer: Michael Niedermayer

vda: unlock the pixel buffer base address.

The pixel buffer base address is never unlocked this causes
a bug with some pixel format types that are produced natively
by the hardware decoder: the first buffer was always used.
Unlock the pixel buffer base address fixes the issue.
(cherry picked from commit c06fdacc3dc706e70d953917fea845532d3703ca)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 ffmpeg_vda.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffmpeg_vda.c b/ffmpeg_vda.c
index b9f0975..fded39e 100644
--- a/ffmpeg_vda.c
+++ b/ffmpeg_vda.c
@@ -77,6 +77,8 @@ static int vda_retrieve_data(AVCodecContext *s, AVFrame 
*frame)
   frame-width, frame-height);
 
 ret = av_frame_copy_props(vda-tmp_frame, frame);
+CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
+
 if (ret  0)
 return ret;
 

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


[FFmpeg-cvslog] swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon Jun 
22 22:23:22 2015 +0200| [f9dbe8ab2a03c8843c45536589b5d4fe9546ae8d] | committer: 
Michael Niedermayer

swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian

The function is specific to little endian

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 4df3cf90bf7a54793e90304bd1b6c7599673f36a)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libswscale/rgb2rgb_template.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index f9a98a8..70294ae 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -929,7 +929,9 @@ static av_cold void rgb2rgb_init_c(void)
 rgb24to15  = rgb24to15_c;
 rgb24to16  = rgb24to16_c;
 rgb24tobgr24   = rgb24tobgr24_c;
+#if !HAVE_BIGENDIAN
 shuffle_bytes_2103 = shuffle_bytes_2103_c;
+#endif
 rgb32tobgr16   = rgb32tobgr16_c;
 rgb32tobgr15   = rgb32tobgr15_c;
 yv12toyuy2 = yv12toyuy2_c;

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


[FFmpeg-cvslog] swscale/x86/rgb2rgb_template: add missing xmm clobbers

2015-07-27 Thread James Almer
ffmpeg | branch: release/2.5 | James Almer jamr...@gmail.com | Tue Jun 23 
01:14:16 2015 -0300| [3528822f969ebbec0b63316ba341e2749a94be4d] | committer: 
Michael Niedermayer

swscale/x86/rgb2rgb_template: add missing xmm clobbers

Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: James Almer jamr...@gmail.com
(cherry picked from commit 910eeab48026060b5f7780b2560445c069eb4d6b)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libswscale/x86/rgb2rgb_template.c 
b/libswscale/x86/rgb2rgb_template.c
index e71c7eb..fd04923 100644
--- a/libswscale/x86/rgb2rgb_template.c
+++ b/libswscale/x86/rgb2rgb_template.c
@@ -1905,7 +1905,7 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, 
const uint8_t *src2, ui
 cmp %3, %%REG_a  \n\t
  jb 1b \n\t
 ::r(dest), r(src1), r(src2), r ((x86_reg)width-15)
-: memory, %REG_a
+: memory, XMM_CLOBBERS(xmm0, xmm1, xmm2,) %REG_a
 );
 #else
 __asm__(

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


[FFmpeg-cvslog] mov: abort on EOF in ff_mov_read_chan

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Sat May 23 23:32:12 2015 +0200| 
[7a12379463b5d9cf31424d339f4b02cfd7d9e22f] | committer: Michael Niedermayer

mov: abort on EOF in ff_mov_read_chan

Otherwise the loop can take a lot of time if num_descr is very large.

Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit a5718863da99b54b6c853d45c84871c4a96a57c0)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index 3b91ed7..b63310b 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -566,6 +566,11 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, 
AVStream *st,
 label_mask = 0;
 for (i = 0; i  num_descr; i++) {
 uint32_t label;
+if (pb-eof_reached) {
+av_log(s, AV_LOG_ERROR,
+   reached EOF while reading channel layout\n);
+return AVERROR_INVALIDDATA;
+}
 label = avio_rb32(pb);  // mChannelLabel
 avio_rb32(pb);  // mChannelFlags
 avio_rl32(pb);  // mCoordinates[0]

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


[FFmpeg-cvslog] swr: Remember previously set int_sample_format from user

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon Jun 
22 18:27:27 2015 +0200| [7ff8f9a604f09e208c6d017c4ab88dd8c0ba6430] | committer: 
Michael Niedermayer

swr: Remember previously set int_sample_format from user

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit d4325b2fea9e2f4f4a17d0b929f12425e9c39964)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libswresample/options.c |4 ++--
 libswresample/swresample.c  |2 ++
 libswresample/swresample_internal.h |1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libswresample/options.c b/libswresample/options.c
index de84672..1bc1a70 100644
--- a/libswresample/options.c
+++ b/libswresample/options.c
@@ -49,8 +49,8 @@ static const AVOption options[]={
 {in_sample_fmt, set input sample format , OFFSET( 
in_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1   , 
INT_MAX, PARAM},
 {osf  , set output sample format, 
OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
 {out_sample_fmt   , set output sample format, 
OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
-{tsf  , set internal sample format  , 
OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
-{internal_sample_fmt  , set internal sample format  , 
OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
+{tsf  , set internal sample format  , 
OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , 
{.i64=AV_SAMPLE_FMT_NONE}, -1   , INT_MAX, PARAM},
+{internal_sample_fmt  , set internal sample format  , 
OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , 
{.i64=AV_SAMPLE_FMT_NONE}, -1   , INT_MAX, PARAM},
 {icl  , set input channel layout, 
OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 0  
  , INT64_MAX , PARAM, channel_layout},
 {in_channel_layout, set input channel layout, 
OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 0  
  , INT64_MAX , PARAM, channel_layout},
 {ocl  , set output channel layout   , 
OFFSET(user_out_ch_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 0  
  , INT64_MAX , PARAM, channel_layout},
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 6dde73b..dbcb42e 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -173,6 +173,8 @@ av_cold int swr_init(struct SwrContext *s){
 s- in_ch_layout = s- user_in_ch_layout;
 s-out_ch_layout = s-user_out_ch_layout;
 
+s-int_sample_fmt= s-user_int_sample_fmt;
+
 if(av_get_channel_layout_nb_channels(s- in_ch_layout)  SWR_CH_MAX) {
 av_log(s, AV_LOG_WARNING, Input channel layout 0x%PRIx64 is invalid 
or unsupported.\n, s- in_ch_layout);
 s-in_ch_layout = 0;
diff --git a/libswresample/swresample_internal.h 
b/libswresample/swresample_internal.h
index fcc63a6..f55bd9d 100644
--- a/libswresample/swresample_internal.h
+++ b/libswresample/swresample_internal.h
@@ -95,6 +95,7 @@ struct SwrContext {
 int user_used_ch_count; /// User set used channel 
count
 int64_t user_in_ch_layout;  /// User set input 
channel layout
 int64_t user_out_ch_layout; /// User set output 
channel layout
+enum AVSampleFormat user_int_sample_fmt;/// User set internal 
sample format
 
 struct DitherContext dither;
 

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


[FFmpeg-cvslog] Update for 2.5.8

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Tue Jul 28 03:23:43 2015 +0200| [ad03cef4208b564f63354cdce6610e854cd51a48] | 
committer: Michael Niedermayer

Update for 2.5.8

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

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

 Changelog|   89 ++
 RELEASE  |2 +-
 doc/Doxyfile |2 +-
 3 files changed, 91 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 9c37fac..9cfeeff 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,95 @@
 Entries are sorted chronologically from oldest to youngest within each release,
 releases are sorted from youngest to oldest.
 
+version 2.5.8
+- avcodec/vp8: Check buffer size in vp8_decode_frame_header()
+- avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()
+- avcodec/diracdec: Check for hpel_base allocation failure
+- avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()
+- avfilter/af_aresample: Check ff_all_* for allocation failures
+- avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case
+- swscale/utils: Clear pix buffers
+- avutil/fifo: Fix the case where func() returns less bytes than requested in 
av_fifo_generic_write()
+- avformat/mov: Fix deallocation when MOVStreamContext failed to allocate
+- ffmpeg: Fix crash with ost-last_frame allocation failure
+- ffmpeg: Fix cleanup with ost = NULL
+- avcodec/pthread_frame: check avctx on deallocation
+- avcodec/sanm: Reset sizes in destroy_buffers()
+- avcodec/alac: Clear pointers in allocate_buffers()
+- bytestream2: set the reader to the end when reading more than available
+- avcodec/utils: use a minimum 32pixel width in  avcodec_align_dimensions2() 
for H.264
+- avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()
+- oggparsedirac: check return value of init_get_bits
+- wmalosslessdec: reset frame-nb_samples on packet loss
+- wmalosslessdec: avoid reading 0 bits with get_bits
+- avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
+- avcodec/aacsbr: Assert that bs_num_env is positive
+- avcodec/aacsbr: check that the element type matches before applying SBR
+- avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
+- vp9/update_prob: prevent out of bounds table read
+- avfilter/vf_transpose: Fix rounding error
+- avcodec/pngdec: Check values before updating context in decode_fctl_chunk()
+- avcodec/pngdec: Require a IHDR chunk before fctl
+- avcodec/pngdec: Only allow one IHDR chunk
+- wmavoice: limit wmavoice_decode_packet return value to packet size
+- swscale/swscale_unscaled: Fix rounding difference with RGBA output between 
little and big endian
+- ffmpeg: Do not use the data/size of a bitstream filter after failure
+- swscale/x86/rgb2rgb_template: fix signedness of v in 
shuffle_bytes_2103_{mmx,mmxext}
+- swscale/x86/rgb2rgb_template: add missing xmm clobbers
+- vda: unlock the pixel buffer base address.
+- swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
+- swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix 
shuffle_bytes_2103_c on BE
+- swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
+- swr: Remember previously set int_sample_format from user
+- matroskadec: check audio sample rate
+- matroskadec: validate audio channels and bitdepth
+- avcodec/dpxenc: implement write16/32 as functions
+- postproc: fix unaligned access
+- ffmpeg: Free last_frame instead of just unref
+- avio: fix potential crashes when combining ffio_ensure_seekback + crc
+- h264: er: Copy from the previous reference only if compatible
+- sonic: set avctx-channels in sonic_decode_init
+- vp8: change mv_{min,max}.{x,y} type to int
+- vp9: change type of tile_size from unsigned to int64_t
+- arm: only enable setend on ARMv6
+- libopenjpegdec: check existence of image component data
+- mov: abort on EOF in ff_mov_read_chan
+- ffmpeg_opt: Check for localtime() failure
+- avformat: Fix bug in parse_rps for HEVC.
+- takdec: ensure chan2 is a valid channel index
+- avcodec/h264_slice: Use AVFrame diemensions for grayscale handling
+- avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()
+- libavutil/channel_layout: Correctly return layout when channel specification 
ends with a trailing 'c'.
+- avcodec/jpeg2000dec: Check that coords match before applying ICT
+- avformat/ffmdec: Check ffio_set_buf_size() return value
+- avcodec/adpcm: Check for overreads
+- avcodec/alsdec: Check for overread
+- avcodec/atrac3plusdec: consume only as many bytes as available
+- libavutil/softfloat: Fix av_normalize1_sf bias.
+- swresample/swresample: Cleanup on init failure.
+- Revert avformat/rtpenc: check av_packet_get_side_data() return, fix null 
ptr dereference
+- avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec
+- swresample/dither: check memory allocation
+- libopenjpegenc: add NULL check 

[FFmpeg-cvslog] avcodec/mpegvideo_enc: Update the buffer size as more slices are merged

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon May 
25 04:54:41 2015 +0200| [e83d99863418104adb1ea12825a19343ced5227c] | committer: 
Michael Niedermayer

avcodec/mpegvideo_enc: Update the buffer size as more slices are merged

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 561d3a57aaa95c7e8e65e96b36dd069100603650)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index f303a35..dbcbb8a 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -3742,6 +3742,8 @@ static int encode_picture(MpegEncContext *s, int 
picture_number)
 }
 s-avctx-execute(s-avctx, encode_thread, s-thread_context[0], NULL, 
context_count, sizeof(void*));
 for(i=1; icontext_count; i++){
+if (s-pb.buf_end == s-thread_context[i]-pb.buf)
+set_put_bits_buffer_size(s-pb, 
FFMIN(s-thread_context[i]-pb.buf_end - s-pb.buf, INT_MAX/8-32));
 merge_context_after_encode(s, s-thread_context[i]);
 }
 emms_c();

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


[FFmpeg-cvslog] h264: Make sure reinit failures mark the context as not initialized

2015-07-27 Thread Luca Barbato
ffmpeg | branch: release/2.5 | Luca Barbato lu_z...@gentoo.org | Mon May 25 
22:30:10 2015 +0200| [6b2163caabadf3bd5618ce78720035946b5493f3] | committer: 
Michael Niedermayer

h264: Make sure reinit failures mark the context as not initialized

(cherry picked from commit 0181ae9af2de1526464d23209b82e6674d362f5d)
Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/h264_slice.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index b667da3..6b1db1a 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1472,6 +1472,7 @@ int ff_h264_decode_slice_header(H264Context *h, 
H264Context *h0)
 
 if (h-context_initialized 
 (must_reinit || needs_reinit)) {
+h-context_initialized = 0;
 if (h != h0) {
 av_log(h-avctx, AV_LOG_ERROR,
changing width %d - %d / height %d - %d on 

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


[FFmpeg-cvslog] swresample: Check the return value of resampler-init()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Wed Jun 
 3 00:48:29 2015 +0200| [fd989ff9ca4dfe3fb9b5b41737740d58b6c5a873] | committer: 
Michael Niedermayer

swresample: Check the return value of resampler-init()

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 02915602d9313aa4b108342a3081244b9d2422bf)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libswresample/swresample.c |4 
 1 file changed, 4 insertions(+)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index a29dc62..c5ac1b3 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -255,6 +255,10 @@ av_cold int swr_init(struct SwrContext *s){
 
 if (s-out_sample_rate!=s-in_sample_rate || (s-flags  
SWR_FLAG_RESAMPLE)){
 s-resample = s-resampler-init(s-resample, s-out_sample_rate, 
s-in_sample_rate, s-filter_size, s-phase_shift, s-linear_interp, s-cutoff, 
s-int_sample_fmt, s-filter_type, s-kaiser_beta, s-precision, s-cheby);
+if (!s-resample) {
+av_log(s, AV_LOG_ERROR, Failed to initilaize resampler\n);
+return AVERROR(ENOMEM);
+}
 }else
 s-resampler-free(s-resample);
 if(s-int_sample_fmt != AV_SAMPLE_FMT_S16P

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


[FFmpeg-cvslog] libopenjpegenc: add NULL check for img before accessing it

2015-07-27 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.5 | Andreas Cadhalpun 
andreas.cadhal...@googlemail.com | Mon Jun  1 00:51:30 2015 +0200| 
[42c54f8f4dd9b43dcb9cfc484b9f5ce82d1a812e] | committer: Michael Niedermayer

libopenjpegenc: add NULL check for img before accessing it

If opj_image_create fails to allocate an image it returns NULL, which
causes a segmentation fault at 'img-x0 = 0'.

Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com
(cherry picked from commit 1577526b47439f33a999339efdec5d624b70e1da)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/libopenjpegenc.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 66633f4..458cf7c 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -164,6 +164,9 @@ static opj_image_t *mj2_create_image(AVCodecContext *avctx, 
opj_cparameters_t *p
 
 img = opj_image_create(numcomps, cmptparm, color_space);
 
+if (!img)
+return NULL;
+
 // x0, y0 is the top left corner of the image
 // x1, y1 is the width, height of the reference grid
 img-x0 = 0;

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


[FFmpeg-cvslog] avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon May 
25 03:48:45 2015 +0200| [8d98fbef16554c3b889c426c75155823d6be2f37] | committer: 
Michael Niedermayer

avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 291ad5cc9cf815eb110b062487980fab2d107936)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index d041643..2e102df 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -69,6 +69,8 @@ void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, 
int length)
 if (length == 0)
 return;
 
+av_assert0(length = put_bits_left(pb));
+
 if (CONFIG_SMALL || words  16 || put_bits_count(pb)  7) {
 for (i = 0; i  words; i++)
 put_bits(pb, 16, AV_RB16(src + 2 * i));

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


[FFmpeg-cvslog] swresample/dither: check memory allocation

2015-07-27 Thread Ganesh Ajjanagadde
ffmpeg | branch: release/2.5 | Ganesh Ajjanagadde gajjanaga...@gmail.com | 
Tue Jun  2 23:17:48 2015 -0400| [3dc303a05192b2a7863b4ce4df10646b501ebe4e] | 
committer: Michael Niedermayer

swresample/dither: check memory allocation

check memory allocation in swri_get_dither()

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 196b885a5f0aa3ca022c1fa99509f47341239784)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libswresample/dither.c  |6 +-
 libswresample/swresample.c  |3 ++-
 libswresample/swresample_internal.h |2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libswresample/dither.c b/libswresample/dither.c
index 8121f11..23e7e12 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -23,12 +23,15 @@
 
 #include noise_shaping_data.c
 
-void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum 
AVSampleFormat noise_fmt) {
+int swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum 
AVSampleFormat noise_fmt) {
 double scale = s-dither.noise_scale;
 #define TMP_EXTRA 2
 double *tmp = av_malloc_array(len + TMP_EXTRA, sizeof(double));
 int i;
 
+if (!tmp)
+return AVERROR(ENOMEM);
+
 for(i=0; ilen + TMP_EXTRA; i++){
 double v;
 seed = seed* 1664525 + 1013904223;
@@ -70,6 +73,7 @@ void swri_get_dither(SwrContext *s, void *dst, int len, 
unsigned seed, enum AVSa
 }
 
 av_free(tmp);
+return 0;
 }
 
 int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum 
AVSampleFormat in_fmt)
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index c5ac1b3..2cd9d45 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -628,7 +628,8 @@ static int swr_convert_internal(struct SwrContext *s, 
AudioData *out, int out_co
 return ret;
 if(ret)
 for(ch=0; chs-dither.noise.ch_count; ch++)
-swri_get_dither(s, s-dither.noise.ch[ch], 
s-dither.noise.count, 12345678913579ch, s-dither.noise.fmt);
+if((ret=swri_get_dither(s, s-dither.noise.ch[ch], 
s-dither.noise.count, 12345678913579ch, s-dither.noise.fmt))0)
+return ret;
 av_assert0(s-dither.noise.ch_count == preout-ch_count);
 
 if(s-dither.noise_pos + out_count  s-dither.noise.count)
diff --git a/libswresample/swresample_internal.h 
b/libswresample/swresample_internal.h
index 1bc6837..fcc63a6 100644
--- a/libswresample/swresample_internal.h
+++ b/libswresample/swresample_internal.h
@@ -191,7 +191,7 @@ void swri_rematrix_free(SwrContext *s);
 int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int 
mustcopy);
 void swri_rematrix_init_x86(struct SwrContext *s);
 
-void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum 
AVSampleFormat noise_fmt);
+int swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum 
AVSampleFormat noise_fmt);
 int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum 
AVSampleFormat in_fmt);
 
 void swri_audio_convert_init_aarch64(struct AudioConvert *ac,

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


[FFmpeg-cvslog] avcodec/atrac3plusdec: consume only as many bytes as available

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Thu Jun 
 4 22:47:24 2015 +0200| [177014a49437869971310c8c6c171255c391a636] | committer: 
Michael Niedermayer

avcodec/atrac3plusdec: consume only as many bytes as available

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 6b6ae7c3ead5dee786a4aea929820076a7c82da4)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c
index 78121e8..50cf74e 100644
--- a/libavcodec/atrac3plusdec.c
+++ b/libavcodec/atrac3plusdec.c
@@ -383,7 +383,7 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void 
*data,
 
 *got_frame_ptr = 1;
 
-return avctx-block_align;
+return FFMIN(avctx-block_align, avpkt-size);
 }
 
 AVCodec ff_atrac3p_decoder = {

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


[FFmpeg-cvslog] avcodec/alsdec: Check for overread

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Thu Jun 
 4 22:59:34 2015 +0200| [5ebae729b9a9cbeb553056eca25a2caedbe03c5d] | committer: 
Michael Niedermayer

avcodec/alsdec: Check for overread

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit c2657633187e325a439e3297fd9ccd0522ab2e39)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index a55354b..708c714 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1493,6 +1493,11 @@ static int read_frame_data(ALSDecContext *ctx, unsigned 
int ra_frame)
 
 // TODO: read_diff_float_data
 
+if (get_bits_left(gb)  0) {
+av_log(ctx-avctx, AV_LOG_ERROR, Overread %d\n, -get_bits_left(gb));
+return AVERROR_INVALIDDATA;
+}
+
 return 0;
 }
 

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


[FFmpeg-cvslog] avcodec/adpcm: Check for overreads

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Thu Jun 
 4 22:34:12 2015 +0200| [cdd594e24ba1729f9850bbefc4b8d87a7adb1740] | committer: 
Michael Niedermayer

avcodec/adpcm: Check for overreads

See: vlc ticket 14649
Reported-by: carl
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 3c803ed9cb23e5a8d76b6c31d8a8c71cac27e769)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/adpcm.c |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 2f95a6f..f7ca208 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -574,6 +574,8 @@ static int get_nb_samples(AVCodecContext *avctx, 
GetByteContext *gb,
 case AV_CODEC_ID_ADPCM_IMA_DK4:
 if (avctx-block_align  0)
 buf_size = FFMIN(buf_size, avctx-block_align);
+if (buf_size  4 * ch)
+return AVERROR_INVALIDDATA;
 nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch;
 break;
 case AV_CODEC_ID_ADPCM_IMA_RAD:
@@ -587,13 +589,15 @@ static int get_nb_samples(AVCodecContext *avctx, 
GetByteContext *gb,
 int bsamples = ff_adpcm_ima_block_samples[avctx-bits_per_coded_sample 
- 2];
 if (avctx-block_align  0)
 buf_size = FFMIN(buf_size, avctx-block_align);
+if (buf_size  4 * ch)
+return AVERROR_INVALIDDATA;
 nb_samples = 1 + (buf_size - 4 * ch) / (bsize * ch) * bsamples;
 break;
 }
 case AV_CODEC_ID_ADPCM_MS:
 if (avctx-block_align  0)
 buf_size = FFMIN(buf_size, avctx-block_align);
-nb_samples = 2 + (buf_size - 7 * ch) * 2 / ch;
+nb_samples = (buf_size - 6 * ch) * 2 / ch;
 break;
 case AV_CODEC_ID_ADPCM_SBPRO_2:
 case AV_CODEC_ID_ADPCM_SBPRO_3:
@@ -606,6 +610,8 @@ static int get_nb_samples(AVCodecContext *avctx, 
GetByteContext *gb,
 case AV_CODEC_ID_ADPCM_SBPRO_4: samples_per_byte = 2; break;
 }
 if (!s-status[0].step_index) {
+if (buf_size  ch)
+return AVERROR_INVALIDDATA;
 nb_samples++;
 buf_size -= ch;
 }
@@ -1524,6 +1530,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, 
void *data,
 
 *got_frame_ptr = 1;
 
+if (avpkt-size  bytestream2_tell(gb)) {
+av_log(avctx, AV_LOG_ERROR, Overread of %d  %d\n, avpkt-size, 
bytestream2_tell(gb));
+return avpkt-size;
+}
+
 return bytestream2_tell(gb);
 }
 

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


[FFmpeg-cvslog] avcodec/jpeg2000dec: Check that coords match before applying ICT

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Tue Jun 
 9 00:37:26 2015 +0200| [062f63e46cd8d4d8094928ce78566e8fb0830aa5] | committer: 
Michael Niedermayer

avcodec/jpeg2000dec: Check that coords match before applying ICT

This avoid potential out of array accesses

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 12ba1b2b4d5592c0e27b0fcc83db929e8d6a8eee)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/jpeg2000dec.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 555b3e9..4f5b32f 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1148,11 +1148,16 @@ static inline void mct_decode(Jpeg2000DecoderContext 
*s, Jpeg2000Tile *tile)
 int i, csize = 1;
 void *src[3];
 
-for (i = 1; i  3; i++)
+for (i = 1; i  3; i++) {
 if (tile-codsty[0].transform != tile-codsty[i].transform) {
 av_log(s-avctx, AV_LOG_ERROR, Transforms mismatch, MCT not 
supported\n);
 return;
 }
+if (memcmp(tile-comp[0].coord, tile-comp[i].coord, 
sizeof(tile-comp[0].coord))) {
+av_log(s-avctx, AV_LOG_ERROR, Coords mismatch, MCT not 
supported\n);
+return;
+}
+}
 
 for (i = 0; i  3; i++)
 if (tile-codsty[0].transform == FF_DWT97)

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


[FFmpeg-cvslog] ffmpeg_opt: Set the video VBV parameters only for the video stream from -target

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon May 
25 12:13:53 2015 +0200| [a61759596dc76448d265a66aaa5c3f452d729097] | committer: 
Michael Niedermayer

ffmpeg_opt: Set the video VBV parameters only for the video stream from -target

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 2ce6e419113f8276f417a9a8b50122c5467d9bc5)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 ffmpeg_opt.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index ad082ac..ea16a11 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2248,9 +2248,9 @@ static int opt_target(void *optctx, const char *opt, 
const char *arg)
 opt_default(NULL, g, norm == PAL ? 15 : 18);
 
 opt_default(NULL, b:v, 115);
-opt_default(NULL, maxrate, 115);
-opt_default(NULL, minrate, 115);
-opt_default(NULL, bufsize, 327680); // 40*1024*8;
+opt_default(NULL, maxrate:v, 115);
+opt_default(NULL, minrate:v, 115);
+opt_default(NULL, bufsize:v, 327680); // 40*1024*8;
 
 opt_default(NULL, b:a, 224000);
 parse_option(o, ar, 44100, options);
@@ -2277,9 +2277,9 @@ static int opt_target(void *optctx, const char *opt, 
const char *arg)
 opt_default(NULL, g, norm == PAL ? 15 : 18);
 
 opt_default(NULL, b:v, 204);
-opt_default(NULL, maxrate, 2516000);
-opt_default(NULL, minrate, 0); // 1145000;
-opt_default(NULL, bufsize, 1835008); // 224*1024*8;
+opt_default(NULL, maxrate:v, 2516000);
+opt_default(NULL, minrate:v, 0); // 1145000;
+opt_default(NULL, bufsize:v, 1835008); // 224*1024*8;
 opt_default(NULL, scan_offset, 1);
 
 opt_default(NULL, b:a, 224000);
@@ -2299,9 +2299,9 @@ static int opt_target(void *optctx, const char *opt, 
const char *arg)
 opt_default(NULL, g, norm == PAL ? 15 : 18);
 
 opt_default(NULL, b:v, 600);
-opt_default(NULL, maxrate, 900);
-opt_default(NULL, minrate, 0); // 150;
-opt_default(NULL, bufsize, 1835008); // 224*1024*8;
+opt_default(NULL, maxrate:v, 900);
+opt_default(NULL, minrate:v, 0); // 150;
+opt_default(NULL, bufsize:v, 1835008); // 224*1024*8;
 
 opt_default(NULL, packetsize, 2048);  // from www.mpucoder.com: 
DVD sectors contain 2048 bytes of data, this is also the size of one pack.
 opt_default(NULL, muxrate, 1008); // from mplex project: 
data_rate = 126. mux_rate = data_rate * 8

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


[FFmpeg-cvslog] libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing ' c'.

2015-07-27 Thread Simon Thelen
ffmpeg | branch: release/2.5 | Simon Thelen ffmpeg-...@c-14.de | Tue Jun  9 
04:55:57 2015 +0200| [fb22fc0c46bb4bee48cdcdf43c8cb1d18aa04e20] | committer: 
Michael Niedermayer

libavutil/channel_layout: Correctly return layout when channel specification 
ends with a trailing 'c'.

Return layout when FF_API_GET_CHANNEL_LAYOUT_COMPAT is set even if the
layout itself is not in the deprecated style.

Signed-off-by: Simon Thelen ffmpeg-...@c-14.de
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 83307a32eb0c9f0843f655c44bb65e3e999153f8)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavutil/channel_layout.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index 4c0677f..cd5cf42 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -138,8 +138,8 @@ static uint64_t get_channel_layout_single(const char *name, 
int name_len)
switch to the syntax '%.*sc' otherwise it will be 
interpreted as a 
channel layout number in a later version\n,
name_len, name, name_len, name);
-return layout;
 }
+return layout;
 }
 } else {
 #endif

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


[FFmpeg-cvslog] avformat/ffmdec: Check ffio_set_buf_size() return value

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Sun Jun 
 7 14:55:10 2015 +0200| [057d6e1cd62055c58db1087b553e6beb871509ab] | committer: 
Michael Niedermayer

avformat/ffmdec: Check ffio_set_buf_size() return value

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit dc55477a64cefebf8dcc611f026be71382814ae2)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 33bbde0..57df43b 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -98,7 +98,9 @@ static int ffm_read_data(AVFormatContext *s,
 retry_read:
 if (pb-buffer_size != ffm-packet_size) {
 int64_t tell = avio_tell(pb);
-ffio_set_buf_size(pb, ffm-packet_size);
+int ret = ffio_set_buf_size(pb, ffm-packet_size);
+if (ret  0)
+return ret;
 avio_seek(pb, tell, SEEK_SET);
 }
 id = avio_rb16(pb); /* PACKET_ID */

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


[FFmpeg-cvslog] Revert avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Wed Jun 
 3 22:39:27 2015 +0200| [1728aa3442d7e3a18268a9b8ae8fcb5ff914fa33] | committer: 
Michael Niedermayer

Revert avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr 
dereference

This was simply wrong

Found-by: Martin Storsjö
This reverts commit 5d8e4f6da03c0342157e6ac7fab1a8ac3a87a8b0.
(cherry picked from commit 3e34b7498f14c04baadde1700a6f73a7e9e86fa6)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavformat/rtpenc.c |4 
 1 file changed, 4 deletions(-)

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index c608dfb..cbe0fae 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -576,10 +576,6 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket 
*pkt)
 const uint8_t *mb_info =
 av_packet_get_side_data(pkt, AV_PKT_DATA_H263_MB_INFO,
 mb_info_size);
-if (!mb_info) {
-av_log(s1, AV_LOG_ERROR, failed to allocate side data\n);
-return AVERROR(ENOMEM);
-}
 ff_rtp_send_h263_rfc2190(s1, pkt-data, size, mb_info, 
mb_info_size);
 break;
 }

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


[FFmpeg-cvslog] libavutil/softfloat: Fix av_normalize1_sf bias.

2015-07-27 Thread Nedeljko Babic
ffmpeg | branch: release/2.5 | Nedeljko Babic nedeljko.ba...@imgtec.com | Wed 
Jun  3 16:17:39 2015 +0200| [3dd5c6a4ba805f7b6c4c80897571cb14b9aa4496] | 
committer: Michael Niedermayer

libavutil/softfloat: Fix av_normalize1_sf bias.

av_normalize1_sf doesn't properly address border case when mantis is
exactly -0x4000.

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 7131aba916d1f562bdaf6a81319f1421ce175b1e)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavutil/softfloat.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index 8647e6a..a487c34 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -59,7 +59,7 @@ static av_const SoftFloat av_normalize_sf(SoftFloat a){
 
 static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){
 #if 1
-if((int32_t)(a.mant + 0x4000U)  0){
+if((int32_t)(a.mant + 0x4000U) = 0){
 a.exp++;
 a.mant=1;
 }

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


[FFmpeg-cvslog] oggparsedirac: check return value of init_get_bits

2015-07-27 Thread Chris Watkins
ffmpeg | branch: release/2.5 | Chris Watkins w...@chromium.org | Tue Jul  7 
10:23:44 2015 -0700| [4f4ff23ccb88a6e815b9e8cbb95133491f1fb28c] | committer: 
Michael Niedermayer

oggparsedirac: check return value of init_get_bits

If init_get_bits fails the GetBitContext is invalid and must not be
used. Check the return value in dirac_header and propogate the error.

Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 4f5c2e651a95b950f6a3fb36f2342cbc32515f17)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavformat/oggparsedirac.c |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavformat/oggparsedirac.c b/libavformat/oggparsedirac.c
index 10fb07e..ab40f96 100644
--- a/libavformat/oggparsedirac.c
+++ b/libavformat/oggparsedirac.c
@@ -31,14 +31,19 @@ static int dirac_header(AVFormatContext *s, int idx)
 AVStream *st = s-streams[idx];
 dirac_source_params source;
 GetBitContext gb;
+int ret;
 
 // already parsed the header
 if (st-codec-codec_id == AV_CODEC_ID_DIRAC)
 return 0;
 
-init_get_bits(gb, os-buf + os-pstart + 13, (os-psize - 13) * 8);
-if (avpriv_dirac_parse_sequence_header(st-codec, gb, source)  0)
-return -1;
+ret = init_get_bits8(gb, os-buf + os-pstart + 13, (os-psize - 13));
+if (ret  0)
+return ret;
+
+ret = avpriv_dirac_parse_sequence_header(st-codec, gb, source);
+if (ret  0)
+return ret;
 
 st-codec-codec_type = AVMEDIA_TYPE_VIDEO;
 st-codec-codec_id = AV_CODEC_ID_DIRAC;

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


[FFmpeg-cvslog] avfilter/vf_transpose: Fix rounding error

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Tue Jun 
30 16:01:15 2015 +0200| [c7cb598bdd8ac914ca300be7031cbe0208eb85e5] | committer: 
Michael Niedermayer

avfilter/vf_transpose: Fix rounding error

Fixes out of array access
Fixes: asan_heap-oob_7f875d_3482_cov_1818465256_ssudec.mov

Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 0083c16605aa5997534e87e68f97ef85a8c3b7b8)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavfilter/vf_transpose.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c
index d9b165c..6ae5fce 100644
--- a/libavfilter/vf_transpose.c
+++ b/libavfilter/vf_transpose.c
@@ -152,7 +152,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, 
int jobnr,
 int hsub= plane == 1 || plane == 2 ? trans-hsub : 0;
 int vsub= plane == 1 || plane == 2 ? trans-vsub : 0;
 int pixstep = trans-pixsteps[plane];
-int inh = in-height   vsub;
+int inh = FF_CEIL_RSHIFT(in-height, vsub);
 int outw= FF_CEIL_RSHIFT(out-width,  hsub);
 int outh= FF_CEIL_RSHIFT(out-height, vsub);
 int start   = (outh *  jobnr   ) / nb_jobs;

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


[FFmpeg-cvslog] avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Thu Jul 
 9 22:16:15 2015 +0200| [d137bb92b29895207d0d2fccb34c235451771671] | committer: 
Michael Niedermayer

avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()

This ensures that no stale pointers leak through on any path

Fixes: signal_sigsegv_c3097a_991_xtrem_e2_m64q15_a32sxx.3gp

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit b160fc290cf49b516c5b6ee0730fd9da7fc623b1)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavcodec/mpegvideo.c |   82 +---
 1 file changed, 78 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f84557b..ade85e9 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1286,6 +1286,82 @@ fail:
 return AVERROR(ENOMEM);
 }
 
+static void clear_context(MpegEncContext *s)
+{
+int i, j, k;
+
+memset(s-next_picture, 0, sizeof(s-next_picture));
+memset(s-last_picture, 0, sizeof(s-last_picture));
+memset(s-current_picture, 0, sizeof(s-current_picture));
+memset(s-new_picture, 0, sizeof(s-new_picture));
+
+memset(s-thread_context, 0, sizeof(s-thread_context));
+
+s-me.map = NULL;
+s-me.score_map = NULL;
+s-dct_error_sum = NULL;
+s-block = NULL;
+s-blocks = NULL;
+memset(s-pblocks, 0, sizeof(s-pblocks));
+s-ac_val_base = NULL;
+s-ac_val[0] =
+s-ac_val[1] =
+s-ac_val[2] =NULL;
+s-edge_emu_buffer = NULL;
+s-me.scratchpad = NULL;
+s-me.temp =
+s-rd_scratchpad =
+s-b_scratchpad =
+s-obmc_scratchpad = NULL;
+
+s-parse_context.buffer = NULL;
+s-parse_context.buffer_size = 0;
+s-bitstream_buffer = NULL;
+s-allocated_bitstream_buffer_size = 0;
+s-picture  = NULL;
+s-mb_type  = NULL;
+s-p_mv_table_base  = NULL;
+s-b_forw_mv_table_base = NULL;
+s-b_back_mv_table_base = NULL;
+s-b_bidir_forw_mv_table_base = NULL;
+s-b_bidir_back_mv_table_base = NULL;
+s-b_direct_mv_table_base = NULL;
+s-p_mv_table= NULL;
+s-b_forw_mv_table   = NULL;
+s-b_back_mv_table   = NULL;
+s-b_bidir_forw_mv_table = NULL;
+s-b_bidir_back_mv_table = NULL;
+s-b_direct_mv_table = NULL;
+for (i = 0; i  2; i++) {
+for (j = 0; j  2; j++) {
+for (k = 0; k  2; k++) {
+s-b_field_mv_table_base[i][j][k] = NULL;
+s-b_field_mv_table[i][j][k] = NULL;
+}
+s-b_field_select_table[i][j] = NULL;
+s-p_field_mv_table_base[i][j] = NULL;
+s-p_field_mv_table[i][j] = NULL;
+}
+s-p_field_select_table[i] = NULL;
+}
+
+s-dc_val_base = NULL;
+s-coded_block_base = NULL;
+s-mbintra_table = NULL;
+s-cbp_table = NULL;
+s-pred_dir_table = NULL;
+
+s-mbskip_table = NULL;
+
+s-er.error_status_table = NULL;
+s-er.er_temp_buffer = NULL;
+s-mb_index2xy = NULL;
+s-lambda_table = NULL;
+
+s-cplx_tab = NULL;
+s-bits_tab = NULL;
+}
+
 /**
  * init common structure for both encoder and decoder.
  * this assumes that some variables like width/height are already set
@@ -1297,6 +1373,8 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
  s-avctx-active_thread_type  FF_THREAD_SLICE) ?
 s-avctx-thread_count : 1;
 
+clear_context(s);
+
 if (s-encoding  s-avctx-slices)
 nb_slices = s-avctx-slices;
 
@@ -1344,10 +1422,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
 if (!s-picture[i].f)
 goto fail;
 }
-memset(s-next_picture, 0, sizeof(s-next_picture));
-memset(s-last_picture, 0, sizeof(s-last_picture));
-memset(s-current_picture, 0, sizeof(s-current_picture));
-memset(s-new_picture, 0, sizeof(s-new_picture));
 s-next_picture.f = av_frame_alloc();
 if (!s-next_picture.f)
 goto fail;

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


[FFmpeg-cvslog] avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Thu Jul 16 11:52:33 2015 +0200| [b7c8d072ea1bde2edd8f2b1b83d3463b6ca4c844] | 
committer: Michael Niedermayer

avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case

Fixes: 
b4b47bc2b3fb7ca710bfffe5aa969e37_signal_sigabrt_770eccc9_744_nc_sample2.avi 
with memlimit of 4194304

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit f1a38264f20382731cf2cc75fdd98f4c9a84a626)

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

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

 libavcodec/pthread_frame.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index e7ac377..41fafce 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -669,6 +669,7 @@ int ff_frame_thread_init(AVCodecContext *avctx)
 
 copy-internal = av_malloc(sizeof(AVCodecInternal));
 if (!copy-internal) {
+copy-priv_data = NULL;
 err = AVERROR(ENOMEM);
 goto error;
 }

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


[FFmpeg-cvslog] ffmpeg: Do not use the data/size of a bitstream filter after failure

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Wed Jun 
24 13:27:39 2015 +0200| [98d916300afeb5291f2a8eb8c0deb9fc33f545dc] | committer: 
Michael Niedermayer

ffmpeg: Do not use the data/size of a bitstream filter after failure

Found-by: Rodger Combs
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 8f0f678f090d9939b0014ba85641e2cb83d39cb8)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 ffmpeg.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 60d8e89..0636304 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -650,6 +650,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, 
OutputStream *ost)
 if (!new_pkt.buf)
 exit_program(1);
 } else if (a  0) {
+new_pkt = *pkt;
 av_log(NULL, AV_LOG_ERROR, Failed to open bitstream filter %s for 
stream %d with codec %s,
bsfc-filter-name, pkt-stream_index,
avctx-codec ? avctx-codec-name : copy);

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


[FFmpeg-cvslog] avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon Jun 
 1 21:35:02 2015 +0200| [f569422d669ff2232e52ee4345eea0742d37c67c] | committer: 
Michael Niedermayer

avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec

This is the maximum rate possible based on the frame size limit of MXF D-10

Previous version reviewed by tim nicholson nicho...@yahoo.com
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit d7a762553c6f6c422adb6632354bcc4ff577b701)

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

 libavformat/mxfenc.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index a850239..36503f3 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1840,9 +1840,10 @@ static int mxf_write_header(AVFormatContext *s)
 return ret;
 sc-video_bit_rate = st-codec-bit_rate ? st-codec-bit_rate : 
st-codec-rc_max_rate;
 if (s-oformat == ff_mxf_d10_muxer) {
-if (sc-video_bit_rate == 5000) {
-if (mxf-time_base.den == 25) sc-index = 3;
-else  sc-index = 5;
+if ((sc-video_bit_rate == 5000)  (mxf-time_base.den == 
25)) {
+sc-index = 3;
+} else if ((sc-video_bit_rate == 4840 || 
sc-video_bit_rate == 5000)  (mxf-time_base.den != 25)) {
+sc-index = 5;
 } else if (sc-video_bit_rate == 4000) {
 if (mxf-time_base.den == 25) sc-index = 7;
 else  sc-index = 9;

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


[FFmpeg-cvslog] avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()

2015-07-27 Thread Zhang Rui
ffmpeg | branch: release/2.5 | Zhang Rui bbcal...@gmail.com | Tue Jul 14 
14:47:26 2015 +0800| [d819a2c9869cacfc58ab7ef55bf74532bd6dad20] | committer: 
Michael Niedermayer

avutil/fifo: Fix the case where func() returns less bytes than requested in 
av_fifo_generic_write()

Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit fcbea93cf8777bbef2a393d26942b5d3c70a448d)

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

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

 libavutil/fifo.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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

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


[FFmpeg-cvslog] ffmpeg: Fix cleanup with ost = NULL

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Mon Jul 13 23:33:18 2015 +0200| [3e167497c78f0f562fa6b5d05977bf3028ad8780] | 
committer: Michael Niedermayer

ffmpeg: Fix cleanup with ost = NULL

Fixes: 
09e670595acbdafb226974b08dab66e3_signal_sigabrt_770eccc9_991_xtrem_e2_m64q15_a32sxx.3gp
 with memlimit of 1048576

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit 503ec7139f887bf8ed8d57da07ce93c4e88447a6)

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

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

 ffmpeg.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 0636304..baaa101 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -466,7 +466,12 @@ static void ffmpeg_cleanup(int ret)
 }
 for (i = 0; i  nb_output_streams; i++) {
 OutputStream *ost = output_streams[i];
-AVBitStreamFilterContext *bsfc = ost-bitstream_filters;
+AVBitStreamFilterContext *bsfc;
+
+if (!ost)
+continue;
+
+bsfc = ost-bitstream_filters;
 while (bsfc) {
 AVBitStreamFilterContext *next = bsfc-next;
 av_bitstream_filter_close(bsfc);

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


[FFmpeg-cvslog] avcodec/pngdec: Only allow one IHDR chunk

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer michae...@gmx.at | Mon Jun 
29 21:08:05 2015 +0200| [d661cfad02afc2f8cb17d5b89c1aced1189dab82] | committer: 
Michael Niedermayer

avcodec/pngdec: Only allow one IHDR chunk

Multiple IHDR chunks are forbidden in PNG
Fixes inconsistency and out of array accesses

Fixes: 
asan_heap-oob_4d5c5a_1738_cov_2638287726_c-m2-8f2b481b7fd9bd745e620b7c01a18df2.png

Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer michae...@gmx.at
(cherry picked from commit 47f4e2d8960ca756ca153ab8e3e93d80449b8c91)

Conflicts:

libavcodec/pngdec.c

Signed-off-by: Michael Niedermayer michae...@gmx.at

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

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

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 75feb04..092528e 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -538,6 +538,11 @@ static int decode_ihdr_chunk(AVCodecContext *avctx, 
PNGDecContext *s,
 return AVERROR_INVALIDDATA;
 }
 
+if (s-state  PNG_IHDR) {
+av_log(avctx, AV_LOG_ERROR, Multiple IHDR\n);
+return AVERROR_INVALIDDATA;
+}
+
 s-width  = s-cur_w = bytestream2_get_be32(s-gb);
 s-height = s-cur_h = bytestream2_get_be32(s-gb);
 if (av_image_check_size(s-width, s-height, 0, avctx)) {

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


[FFmpeg-cvslog] avfilter/af_aresample: Check ff_all_* for allocation failures

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Fri Jul 17 20:27:25 2015 +0200| [384f6801a2ed1611e01df358ffbb08c689e38670] | 
committer: Michael Niedermayer

avfilter/af_aresample: Check ff_all_* for allocation failures

Fixes: signal_sigabrt_770eccc9_498_divx502.avi with memlimit 1572864

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit 2ea8a480832acad3095783bcb11d5f290bec56cf)

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

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

 libavfilter/af_aresample.c |   21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 57ac397..6cb765d 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -87,15 +87,24 @@ static int query_formats(AVFilterContext *ctx)
 AVFilterLink *inlink  = ctx-inputs[0];
 AVFilterLink *outlink = ctx-outputs[0];
 
-AVFilterFormats*in_formats  = 
ff_all_formats(AVMEDIA_TYPE_AUDIO);
-AVFilterFormats*out_formats;
-AVFilterFormats*in_samplerates  = ff_all_samplerates();
-AVFilterFormats*out_samplerates;
-AVFilterChannelLayouts *in_layouts  = ff_all_channel_counts();
-AVFilterChannelLayouts *out_layouts;
+AVFilterFormats*in_formats, *out_formats;
+AVFilterFormats*in_samplerates, *out_samplerates;
+AVFilterChannelLayouts *in_layouts, *out_layouts;
 
+
+in_formats  = ff_all_formats(AVMEDIA_TYPE_AUDIO);
+if (!in_formats)
+return AVERROR(ENOMEM);
 ff_formats_ref  (in_formats,  inlink-out_formats);
+
+in_samplerates  = ff_all_samplerates();
+if (!in_samplerates)
+return AVERROR(ENOMEM);
 ff_formats_ref  (in_samplerates,  inlink-out_samplerates);
+
+in_layouts  = ff_all_channel_counts();
+if (!in_layouts)
+ return AVERROR(ENOMEM);
 ff_channel_layouts_ref(in_layouts,  inlink-out_channel_layouts);
 
 if(out_rate  0) {

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


[FFmpeg-cvslog] avformat/mov: Fix deallocation when MOVStreamContext failed to allocate

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Tue Jul 14 14:14:16 2015 +0200| [3953c497e2751bbbfd5063e4b7b54c868f46e031] | 
committer: Michael Niedermayer

avformat/mov: Fix deallocation when MOVStreamContext failed to allocate

Fixes: 
260813283176b57b3c9974fe284eebc3_signal_sigsegv_7713351a_991_xtrem_e2_m64q15_a32sxx.3gp
 with memlimit of 262144

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit 15629129dde771446a005282ee33c4ea1199e696)

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

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 783ad0d..137bc60 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3717,6 +3717,9 @@ static int mov_read_close(AVFormatContext *s)
 AVStream *st = s-streams[i];
 MOVStreamContext *sc = st-priv_data;
 
+if (!sc)
+continue;
+
 av_freep(sc-ctts_data);
 for (j = 0; j  sc-drefs_count; j++) {
 av_freep(sc-drefs[j].path);

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


[FFmpeg-cvslog] avcodec/pthread_frame: check avctx on deallocation

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Mon Jul 13 21:19:04 2015 +0200| [95d8912bfdc5e0eca54d9f3b251f67c19b88b6a3] | 
committer: Michael Niedermayer

avcodec/pthread_frame: check avctx on deallocation

Fixes null pointer dereferences
Fixes: 
af1a5a33e67e479f439239097bd0d4fd_signal_sigsegv_7713351a_152_Dolby_Rain_Logo.pmp
 with memlimit of 8388608

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit 5d346feafa817c4fbc30f7ed0b93b2dad6cef15b)

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

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

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

diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 5a4ab84..e7ac377 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -571,7 +571,7 @@ void ff_frame_thread_free(AVCodecContext *avctx, int 
thread_count)
 pthread_join(p-thread, NULL);
 p-thread_init=0;
 
-if (codec-close)
+if (codec-close  p-avctx)
 codec-close(p-avctx);
 
 avctx-codec = NULL;
@@ -591,12 +591,13 @@ void ff_frame_thread_free(AVCodecContext *avctx, int 
thread_count)
 av_packet_unref(p-avpkt);
 av_freep(p-released_buffers);
 
-if (i) {
+if (i  p-avctx) {
 av_freep(p-avctx-priv_data);
 av_freep(p-avctx-slice_offset);
 }
 
-av_freep(p-avctx-internal);
+if (p-avctx)
+av_freep(p-avctx-internal);
 av_freep(p-avctx);
 }
 

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


[FFmpeg-cvslog] avcodec/diracdec: Check for hpel_base allocation failure

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Sat Jul 18 17:55:19 2015 +0200| [c72c1b871602079f4d867bf5c04fa0a3f51ec7c2] | 
committer: Michael Niedermayer

avcodec/diracdec: Check for hpel_base allocation failure

Fixes null pointer dereference
Fixes: signal_sigsegv_b02a96_280_RL_420p_ffdirac.drc with memlimit of 67108864

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit 1c5b712c0a643a039d6f34269b4102de313a050a)

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

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

 libavcodec/diracdec.c |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 1bfe6be..6b93d86 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1561,7 +1561,7 @@ static void select_dsp_funcs(DiracContext *s, int width, 
int height, int xblen,
 }
 }
 
-static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, 
int width, int height)
+static int interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, 
int width, int height)
 {
 /* chroma allocates an edge of 8 when subsampled
which for 4:2:2 means an h edge of 16 and v edge of 8
@@ -1573,11 +1573,14 @@ static void interpolate_refplane(DiracContext *s, 
DiracFrame *ref, int plane, in
 
 /* no need for hpel if we only have fpel vectors */
 if (!s-mv_precision)
-return;
+return 0;
 
 for (i = 1; i  4; i++) {
 if (!ref-hpel_base[plane][i])
 ref-hpel_base[plane][i] = av_malloc((height+2*edge) * 
ref-avframe-linesize[plane] + 32);
+if (!ref-hpel_base[plane][i]) {
+return AVERROR(ENOMEM);
+}
 /* we need to be 16-byte aligned even for chroma */
 ref-hpel[plane][i] = ref-hpel_base[plane][i] + 
edge*ref-avframe-linesize[plane] + 16;
 }
@@ -1591,6 +1594,8 @@ static void interpolate_refplane(DiracContext *s, 
DiracFrame *ref, int plane, in
 s-mpvencdsp.draw_edges(ref-hpel[plane][3], 
ref-avframe-linesize[plane], width, height, edge, edge, EDGE_TOP | 
EDGE_BOTTOM);
 }
 ref-interpolated[plane] = 1;
+
+return 0;
 }
 
 /**
@@ -1640,8 +1645,11 @@ static int dirac_decode_frame_internal(DiracContext *s)
 
 select_dsp_funcs(s, p-width, p-height, p-xblen, p-yblen);
 
-for (i = 0; i  s-num_refs; i++)
-interpolate_refplane(s, s-ref_pics[i], comp, p-width, 
p-height);
+for (i = 0; i  s-num_refs; i++) {
+int ret = interpolate_refplane(s, s-ref_pics[i], comp, 
p-width, p-height);
+if (ret  0)
+return ret;
+}
 
 memset(s-mctmp, 0, 4*p-yoffset*p-stride);
 

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


[FFmpeg-cvslog] avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Sat Jul 18 19:02:26 2015 +0200| [1166d9245ab1ee76905a8ec7355a7f03f611ed83] | 
committer: Michael Niedermayer

avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()

Fixes: signal_sigsegv_d5de23_967_vp80_00_comprehensive_010.ivf with memlimit 
524288

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit a84f0e8d8f293df3c535f9b893730a835bed6520)

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

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

 libavcodec/vp8.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 86eb4e9..8313544 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2689,6 +2689,9 @@ av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
 VP8Context *s = avctx-priv_data;
 int i;
 
+if (!s)
+return 0;
+
 vp8_decode_flush_impl(avctx, 1);
 for (i = 0; i  FF_ARRAY_ELEMS(s-frames); i++)
 av_frame_free(s-frames[i].tf.f);

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


[FFmpeg-cvslog] avcodec/alac: Clear pointers in allocate_buffers()

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Mon Jul 13 15:46:10 2015 +0200| [3489693051a7eaa43b219fc55286cb5e0c280902] | 
committer: Michael Niedermayer

avcodec/alac: Clear pointers in allocate_buffers()

Fixes: 
06a4edb39ad8a9883175f9bd428334a2_signal_sigsegv_7713351a_706_mov__alac__ALAC_6ch.mov

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit f7068bf277a37479aecde2832208d820682b35e6)

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

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

 libavcodec/alac.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index f5a5b86..48013f6 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -533,6 +533,12 @@ static int allocate_buffers(ALACContext *alac)
 int ch;
 int buf_size = alac-max_samples_per_frame * sizeof(int32_t);
 
+for (ch = 0; ch  2; ch++) {
+alac-predict_error_buffer[ch]  = NULL;
+alac-output_samples_buffer[ch] = NULL;
+alac-extra_bits_buffer[ch] = NULL;
+}
+
 for (ch = 0; ch  FFMIN(alac-channels, 2); ch++) {
 FF_ALLOC_OR_GOTO(alac-avctx, alac-predict_error_buffer[ch],
  buf_size, buf_alloc_fail);

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


[FFmpeg-cvslog] ffmpeg: Fix crash with ost-last_frame allocation failure

2015-07-27 Thread Michael Niedermayer
ffmpeg | branch: release/2.5 | Michael Niedermayer mich...@niedermayer.cc | 
Tue Jul 14 13:02:19 2015 +0200| [40f5222e9c17b0ae759e38e2ba783017f183729b] | 
committer: Michael Niedermayer

ffmpeg: Fix crash with ost-last_frame allocation failure

Fixes: 1013dbde2c360d939cc2dfc33e4f275c_signal_sigsegv_a0500f_45_320vp3.nsv 
with memlimit of 536870912

Found-by: Samuel Groß, Mateusz j00ru Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer mich...@niedermayer.cc
(cherry picked from commit fd4c87fa3becaf8a6c480db915daf51e297b76c5)

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

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

 ffmpeg.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index baaa101..43762ed 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1148,7 +1148,7 @@ static void do_video_out(AVFormatContext *s,
 if (!ost-last_frame)
 ost-last_frame = av_frame_alloc();
 av_frame_unref(ost-last_frame);
-if (next_picture)
+if (next_picture  ost-last_frame)
 av_frame_ref(ost-last_frame, next_picture);
 else
 av_frame_free(ost-last_frame);

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


  1   2   >