[FFmpeg-cvslog] doc/filters: move mcdeint above mergeplanes

2015-09-28 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Sep 26 22:52:06 
2015 +0200| [238ca2d723605bd5756181087551cf7dcd46076b] | committer: Paul B Mahol

doc/filters: move mcdeint above mergeplanes

Signed-off-by: Paul B Mahol 

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

 doc/filters.texi |   88 +++---
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index a5906d6..a4d828e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7644,6 +7644,50 @@ copied from first stream.
 By default value 0xf, all planes will be processed.
 @end table
 
+@section mcdeint
+
+Apply motion-compensation deinterlacing.
+
+It needs one field per frame as input and must thus be used together
+with yadif=1/3 or equivalent.
+
+This filter accepts the following options:
+@table @option
+@item mode
+Set the deinterlacing mode.
+
+It accepts one of the following values:
+@table @samp
+@item fast
+@item medium
+@item slow
+use iterative motion estimation
+@item extra_slow
+like @samp{slow}, but use multiple reference frames.
+@end table
+Default value is @samp{fast}.
+
+@item parity
+Set the picture field parity assumed for the input video. It must be
+one of the following values:
+
+@table @samp
+@item 0, tff
+assume top field first
+@item 1, bff
+assume bottom field first
+@end table
+
+Default value is @samp{bff}.
+
+@item qp
+Set per-block quantization parameter (QP) used by the internal
+encoder.
+
+Higher values should result in a smoother motion vector field but less
+optimal individual vectors. Default value is 1.
+@end table
+
 @section mergeplanes
 
 Merge color channel components from several video streams.
@@ -7703,50 +7747,6 @@ format=rgb24,mergeplanes=0x000102:yuv444p
 @end example
 @end itemize
 
-@section mcdeint
-
-Apply motion-compensation deinterlacing.
-
-It needs one field per frame as input and must thus be used together
-with yadif=1/3 or equivalent.
-
-This filter accepts the following options:
-@table @option
-@item mode
-Set the deinterlacing mode.
-
-It accepts one of the following values:
-@table @samp
-@item fast
-@item medium
-@item slow
-use iterative motion estimation
-@item extra_slow
-like @samp{slow}, but use multiple reference frames.
-@end table
-Default value is @samp{fast}.
-
-@item parity
-Set the picture field parity assumed for the input video. It must be
-one of the following values:
-
-@table @samp
-@item 0, tff
-assume top field first
-@item 1, bff
-assume bottom field first
-@end table
-
-Default value is @samp{bff}.
-
-@item qp
-Set per-block quantization parameter (QP) used by the internal
-encoder.
-
-Higher values should result in a smoother motion vector field but less
-optimal individual vectors. Default value is 1.
-@end table
-
 @section mpdecimate
 
 Drop frames that do not differ greatly from the previous frame in

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


[FFmpeg-cvslog] avfilter: add maskedmerge filter

2015-09-28 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Fri Sep 25 22:46:38 
2015 +0200| [691a7df3c5b7a9d6b83540720e41081f7137f14b] | committer: Paul B Mahol

avfilter: add maskedmerge filter

Signed-off-by: Paul B Mahol 

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

 Changelog|1 +
 doc/filters.texi |   19 +++
 libavfilter/Makefile |1 +
 libavfilter/allfilters.c |1 +
 libavfilter/version.h|2 +-
 libavfilter/vf_maskedmerge.c |  324 ++
 6 files changed, 347 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index d5017e1..515d649 100644
--- a/Changelog
+++ b/Changelog
@@ -12,6 +12,7 @@ version :
 - tremolo filter
 - agate filter
 - chromakey filter
+- maskedmerge filter
 
 
 version 2.8:
diff --git a/doc/filters.texi b/doc/filters.texi
index 0fdb677..a5906d6 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7625,6 +7625,25 @@ lutyuv=y='bitand(val, 128+64+32)'
 @end example
 @end itemize
 
+@section maskedmerge
+
+Merge the first input stream with the second input stream using per pixel
+weights in the third input stream.
+
+A value of 0 in the third stream pixel component means that pixel component
+from first stream is returned unchanged, while maximum value (eg. 255 for
+8-bit videos) means that pixel component from second stream is returned
+unchanged. Intermediate values define the amount of merging between both
+input stream's pixel components.
+
+This filter accepts the following options:
+@table @option
+@item planes
+Set which planes will be processed as bitmap, unprocessed planes will be
+copied from first stream.
+By default value 0xf, all planes will be processed.
+@end table
+
 @section mergeplanes
 
 Merge color channel components from several video streams.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index c70887e..9125443 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -169,6 +169,7 @@ OBJS-$(CONFIG_LUT3D_FILTER)  += vf_lut3d.o
 OBJS-$(CONFIG_LUT_FILTER)+= vf_lut.o
 OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o
 OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o
+OBJS-$(CONFIG_MASKEDMERGE_FILTER)+= vf_maskedmerge.o framesync.o
 OBJS-$(CONFIG_MCDEINT_FILTER)+= vf_mcdeint.o
 OBJS-$(CONFIG_MERGEPLANES_FILTER)+= vf_mergeplanes.o framesync.o
 OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index c21456d..612fc99 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -191,6 +191,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(LUT,lut,vf);
 REGISTER_FILTER(LUTRGB, lutrgb, vf);
 REGISTER_FILTER(LUTYUV, lutyuv, vf);
+REGISTER_FILTER(MASKEDMERGE,maskedmerge,vf);
 REGISTER_FILTER(MCDEINT,mcdeint,vf);
 REGISTER_FILTER(MERGEPLANES,mergeplanes,vf);
 REGISTER_FILTER(MPDECIMATE, mpdecimate, vf);
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 1426cf8..670ee4e 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFILTER_VERSION_MAJOR   6
-#define LIBAVFILTER_VERSION_MINOR   8
+#define LIBAVFILTER_VERSION_MINOR   9
 #define LIBAVFILTER_VERSION_MICRO 100
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
diff --git a/libavfilter/vf_maskedmerge.c b/libavfilter/vf_maskedmerge.c
new file mode 100644
index 000..72f9fb3
--- /dev/null
+++ b/libavfilter/vf_maskedmerge.c
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2015 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/imgutils.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "framesync.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct MaskedMergeContext {
+const AVClass *class;
+int width[4], height[4];
+int nb_planes;
+int planes;
+int max, half, depth;
+FFFrameSync fs;
+
+v

[FFmpeg-cvslog] configure: Support for HEASLR on mingw targets

2015-09-28 Thread Alex Smith
ffmpeg | branch: master | Alex Smith  | Sat Sep 26 
02:43:23 2015 -0400| [a58c22d61260941fc651add73836882d5b112fdb] | committer: 
Hendrik Leppkes

configure: Support for HEASLR on mingw targets

The appropriate flag for HEASLR (--high-entropy-va) was added in
binutils 2.25.

Also set the image base >4GB so higher entropy gets applied to image
base randomization when used with HEASLR (8 -> 17 bits of
randomization).  Windows does this for compatibility because of "latent
pointer truncation issues".

Signed-off-by: Alex Smith 

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

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

diff --git a/configure b/configure
index bd4f91d..b572d59 100755
--- a/configure
+++ b/configure
@@ -4400,6 +4400,10 @@ case $target_os in
 add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
 elif enabled x86_64; then
 add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
+check_ldflags -Wl,--high-entropy-va # binutils 2.25
+# Set image base >4GB for extra entropy with HEASLR
+add_ldexeflags -Wl,--image-base,0x14000
+append SHFLAGS -Wl,--image-base,0x18000
 fi
 ;;
 win32|win64)

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


[FFmpeg-cvslog] dnxhddec: reindent/cosmetics

2015-09-28 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sun Sep 27 10:09:06 2015 +0200| [6110a55b7d0d22b1d23e195681b4cae99df07e34] | 
committer: Michael Niedermayer

dnxhddec: reindent/cosmetics

Signed-off-by: Michael Niedermayer 

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

 libavcodec/dnxhddec.c |   32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 06d4780..7b96004 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -64,18 +64,18 @@ typedef struct DNXHDContext {
 int mbaff;
 int act;
 int (*decode_dct_block)(const struct DNXHDContext *ctx,
- RowContext *row, int n);
+RowContext *row, int n);
 } DNXHDContext;
 
 #define DNXHD_VLC_BITS 9
 #define DNXHD_DC_VLC_BITS 7
 
 static int dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
- RowContext *row, int n);
+RowContext *row, int n);
 static int dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
-  RowContext *row, int n);
+ RowContext *row, int n);
 static int dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
-  RowContext *row, int n);
+ RowContext *row, int n);
 
 static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
 {
@@ -153,8 +153,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 int old_bit_depth = ctx->bit_depth;
 
 if (buf_size < 0x280) {
-av_log(ctx->avctx, AV_LOG_ERROR, "buffer too small (%d < 640).\n",
-   buf_size);
+av_log(ctx->avctx, AV_LOG_ERROR,
+   "buffer too small (%d < 640).\n", buf_size);
 return AVERROR_INVALIDDATA;
 }
 
@@ -199,8 +199,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 ctx->is_444 = 0;
 ctx->decode_dct_block = dnxhd_decode_dct_block_8;
 } else {
-av_log(ctx->avctx, AV_LOG_ERROR, "invalid bit depth value (%d).\n",
-   buf[0x21]);
+av_log(ctx->avctx, AV_LOG_ERROR,
+   "invalid bit depth value (%d).\n", buf[0x21]);
 return AVERROR_INVALIDDATA;
 }
 if (ctx->bit_depth != old_bit_depth) {
@@ -268,11 +268,11 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 }
 
 static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx,
-RowContext *row,
-int n,
-int index_bits,
-int level_bias,
-int level_shift)
+   RowContext *row,
+   int n,
+   int index_bits,
+   int level_bias,
+   int level_shift)
 {
 int i, j, index1, index2, len, flags;
 int level, component, sign;
@@ -368,19 +368,19 @@ static av_always_inline int dnxhd_decode_dct_block(const 
DNXHDContext *ctx,
 }
 
 static int dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
- RowContext *row, int n)
+RowContext *row, int n)
 {
 return dnxhd_decode_dct_block(ctx, row, n, 4, 32, 6);
 }
 
 static int dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
-  RowContext *row, int n)
+ RowContext *row, int n)
 {
 return dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4);
 }
 
 static int dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
-  RowContext *row, int n)
+ RowContext *row, int n)
 {
 return dnxhd_decode_dct_block(ctx, row, n, 6, 32, 6);
 }

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


[FFmpeg-cvslog] dnxhddec: add my contributions

2015-09-28 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sun Sep 27 10:09:08 2015 +0200| [578f721f5dcf5577e0b06447082497319ccb7a39] | 
committer: Michael Niedermayer

dnxhddec: add my contributions

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 7b96004..423bce2 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -2,8 +2,10 @@
  * VC3/DNxHD decoder.
  * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier 
  * Copyright (c) 2011 MirriAd Ltd
+ * Copyright (c) 2015 Christophe Gisquet
  *
  * 10 bit support added by MirriAd Ltd, Joseph Artsimovich 
+ * Slice multithreading and MB interlaced support added by Christophe Gisquet
  *
  * This file is part of FFmpeg.
  *

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


[FFmpeg-cvslog] avfilter/delogo: Fix show option when band is small

2015-09-28 Thread Jean Delvare
ffmpeg | branch: master | Jean Delvare  | Mon Sep 28 10:18:06 
2015 +0200| [3e5b02bdb8e5b35564893e6618c217e4c949c743] | committer: Michael 
Niedermayer

avfilter/delogo: Fix show option when band is small

The code assumed that the outermost interpolated pixels were always in
the fuzzy area defined by the band option. However if the band value
is small, there may be no fuzzy area on a given plane. In that case,
option show did not work, no rectangle was drawn (or only on the luma
plane, depending on the band value and chroma plane subsampling
factors.)

Fix the problem by not making any assumption on where the outermost
interpolated pixels will be.

The new code was verified to produce the same result as the original
code when the band value is not small.

Signed-off-by: Jean Delvare 
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index 0178ee0..3258493 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2002 Jindrich Makovicka 
  * Copyright (c) 2011 Stefano Sabatini
- * Copyright (c) 2013 Jean Delvare 
+ * Copyright (c) 2013, 2015 Jean Delvare 
  *
  * This file is part of FFmpeg.
  *
@@ -101,6 +101,12 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
  xdst = dst+logo_x1+1,
  xsrc = src+logo_x1+1; x < logo_x2-1; x++, xdst++, xsrc++) {
 
+if (show && (y == logo_y+1 || y == logo_y+logo_h-2 ||
+ x == logo_x+1 || x == logo_x+logo_w-2)) {
+*xdst = 0;
+continue;
+}
+
 /* Weighted interpolation based on relative distances, taking SAR 
into account */
 weightl = (uint64_t)  (logo_x2-1-x) * (y-logo_y1) * 
(logo_y2-1-y) * sar.den;
 weightr = (uint64_t)(x-logo_x1) * (y-logo_y1) * 
(logo_y2-1-y) * sar.den;
@@ -138,8 +144,6 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
 dist = FFMAX(dist, y-(logo_y+logo_h-1-band));
 
 *xdst = (*xsrc*dist + interp*(band-dist))/band;
-if (show && (dist == band-1))
-*xdst = 0;
 }
 }
 

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


[FFmpeg-cvslog] checkasm: Fix the function name sorting algorithm

2015-09-28 Thread Henrik Gramner
ffmpeg | branch: master | Henrik Gramner  | Sat Sep 26 
20:15:35 2015 +0200| [19b28d047daa2bc9eaac0cca391bb5932fcb7059] | committer: 
Henrik Gramner

checkasm: Fix the function name sorting algorithm

The previous implementation was behaving incorrectly in some corner cases.

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

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

diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 2f967e3..d4680f0 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -289,12 +289,16 @@ static void print_benchs(CheckasmFunc *f)
 /* ASCIIbetical sort except preserving natural order for numbers */
 static int cmp_func_names(const char *a, const char *b)
 {
+const char *start = a;
 int ascii_diff, digit_diff;
 
-for (; !(ascii_diff = *a - *b) && *a; a++, b++);
+for (; !(ascii_diff = *(const unsigned char*)a - *(const unsigned char*)b) 
&& *a; a++, b++);
 for (; av_isdigit(*a) && av_isdigit(*b); a++, b++);
 
-return (digit_diff = av_isdigit(*a) - av_isdigit(*b)) ? digit_diff : 
ascii_diff;
+if (a > start && av_isdigit(a[-1]) && (digit_diff = av_isdigit(*a) - 
av_isdigit(*b)))
+return digit_diff;
+
+return ascii_diff;
 }
 
 /* Perform a tree rotation in the specified direction and return the new root 
*/

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


[FFmpeg-cvslog] checkasm: add vp9dsp.itxfm_add tests.

2015-09-28 Thread Ronald S. Bultje
ffmpeg | branch: master | Ronald S. Bultje  | Tue Sep 22 
14:24:27 2015 -0400| [0b227c6d4725d580feeea7d04c07bee26600df1b] | committer: 
Ronald S. Bultje

checkasm: add vp9dsp.itxfm_add tests.

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

 tests/checkasm/vp9dsp.c |  275 +++
 1 file changed, 275 insertions(+)

diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c
index d175e17..5ec4038 100644
--- a/tests/checkasm/vp9dsp.c
+++ b/tests/checkasm/vp9dsp.c
@@ -18,12 +18,15 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include 
 #include 
 #include "checkasm.h"
+#include "libavcodec/vp9data.h"
 #include "libavcodec/vp9dsp.h"
 #include "libavutil/common.h"
 #include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/mathematics.h"
 
 static const uint32_t pixel_mask[3] = { 0x, 0x03ff03ff, 0x0fff0fff };
 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
@@ -94,6 +97,277 @@ static void check_ipred(void)
 
 #undef randomize_buffers
 
+#define randomize_buffers() \
+do { \
+uint32_t mask = pixel_mask[(bit_depth - 8) >> 1];  \
+for (y = 0; y < sz; y++) { \
+for (x = 0; x < sz * SIZEOF_PIXEL; x += 4) {   \
+uint32_t r = rnd() & mask; \
+AV_WN32A(dst + y * sz * SIZEOF_PIXEL + x, r);  \
+AV_WN32A(src + y * sz * SIZEOF_PIXEL + x, rnd() & mask);   \
+}  \
+for (x = 0; x < sz; x++) { \
+if (bit_depth == 8) {  \
+coef[y * sz + x] = src[y * sz + x] - dst[y * sz + x];  \
+} else {   \
+((int32_t *) coef)[y * sz + x] =   \
+((uint16_t *) src)[y * sz + x] -   \
+((uint16_t *) dst)[y * sz + x];\
+}  \
+}  \
+}  \
+} while(0)
+
+// wht function copied from libvpx
+static void fwht_1d(double *out, const double *in, int sz)
+{
+double t0 = in[0] + in[1];
+double t3 = in[3] - in[2];
+double t4 = trunc((t0 - t3) * 0.5);
+double t1 = t4 - in[1];
+double t2 = t4 - in[2];
+
+out[0] = t0 - t2;
+out[1] = t2;
+out[2] = t3 + t1;
+out[3] = t1;
+}
+
+// standard DCT-II
+static void fdct_1d(double *out, const double *in, int sz)
+{
+int k, n;
+
+for (k = 0; k < sz; k++) {
+out[k] = 0.0;
+for (n = 0; n < sz; n++)
+out[k] += in[n] * cos(M_PI * (2 * n + 1) * k / (sz * 2.0));
+}
+out[0] *= M_SQRT1_2;
+}
+
+// see "Towards jointly optimal spatial prediction and adaptive transform in
+// video/image coding", by J. Han, A. Saxena, and K. Rose
+// IEEE Proc. ICASSP, pp. 726-729, Mar. 2010.
+static void fadst4_1d(double *out, const double *in, int sz)
+{
+int k, n;
+
+for (k = 0; k < sz; k++) {
+out[k] = 0.0;
+for (n = 0; n < sz; n++)
+out[k] += in[n] * sin(M_PI * (n + 1) * (2 * k + 1) / (sz * 2.0 + 
1.0));
+}
+}
+
+// see "A Butterfly Structured Design of The Hybrid Transform Coding Scheme",
+// by Jingning Han, Yaowu Xu, and Debargha Mukherjee
+// 
http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41418.pdf
+static void fadst_1d(double *out, const double *in, int sz)
+{
+int k, n;
+
+for (k = 0; k < sz; k++) {
+out[k] = 0.0;
+for (n = 0; n < sz; n++)
+out[k] += in[n] * sin(M_PI * (2 * n + 1) * (2 * k + 1) / (sz * 
4.0));
+}
+}
+
+typedef void (*ftx1d_fn)(double *out, const double *in, int sz);
+static void ftx_2d(double *out, const double *in, enum TxfmMode tx,
+   enum TxfmType txtp, int sz)
+{
+static const double scaling_factors[5][4] = {
+{ 4.0, 16.0 * M_SQRT1_2 / 3.0, 16.0 * M_SQRT1_2 / 3.0, 32.0 / 9.0 },
+{ 2.0, 2.0, 2.0, 2.0 },
+{ 1.0, 1.0, 1.0, 1.0 },
+{ 0.25 },
+{ 4.0 }
+};
+static const ftx1d_fn ftx1d_tbl[5][4][2] = {
+{
+{ fdct_1d, fdct_1d },
+{ fadst4_1d, fdct_1d },
+{ fdct_1d, fadst4_1d },
+{ fadst4_1d, fadst4_1d },
+}, {
+{ fdct_1d, fdct_1d },
+{ fadst_1d, fdct_1d },
+{ fdct_1d, fadst_1d },
+{ fadst_1d, fadst_1d },
+}, {
+{ fdct_1d, fdct_1d },
+{ fadst_1d, fdct_1d },
+{ fdct_1d, fad

[FFmpeg-cvslog] checkasm/vp9dsp: Fix iszero() to read the correct data

2015-09-28 Thread Henrik Gramner
ffmpeg | branch: master | Henrik Gramner  | Mon Sep 28 
18:50:13 2015 +0200| [69e456d7fbc5fff88acf747d135bf15c8e511c59] | committer: 
Henrik Gramner

checkasm/vp9dsp: Fix iszero() to read the correct data

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

 tests/checkasm/vp9dsp.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c
index 5ec4038..37a3ca6 100644
--- a/tests/checkasm/vp9dsp.c
+++ b/tests/checkasm/vp9dsp.c
@@ -297,7 +297,7 @@ static int iszero(const int16_t *c, int sz)
 {
 int n;
 
-for (n = 0; n < sz; n += 4)
+for (n = 0; n < sz / sizeof(int16_t); n += 2)
 if (AV_RN32A(&c[n]))
 return 0;
 

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


[FFmpeg-cvslog] avcodec/pngdec: reset has_trns after every decode_frame_png()

2015-09-28 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Sep 28 20:53:01 
2015 +0200| [1d0487f77f07663c510207eb6e946675b71823cb] | committer: Paul B Mahol

avcodec/pngdec: reset has_trns after every decode_frame_png()

Fixes #4887.

Signed-off-by: Paul B Mahol 

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

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

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index ee11f12..1b47b18 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1254,7 +1254,7 @@ static int decode_frame_png(AVCodecContext *avctx,
 return AVERROR_INVALIDDATA;
 }
 
-s->y = s->state = 0;
+s->y = s->state = s->has_trns = 0;
 
 /* init the zlib */
 s->zstream.zalloc = ff_png_zalloc;

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


[FFmpeg-cvslog] libavformat/flvdec.c: free always the packet after a resync.

2015-09-28 Thread Thierry Foucu
ffmpeg | branch: master | Thierry Foucu  | Mon Sep 28 
14:34:45 2015 -0700| [7f72f2d75e581abfe016600d003d1bbab99714f0] | committer: 
Michael Niedermayer

libavformat/flvdec.c: free always the packet after a resync.

In case of resync, always free the packet, but retry only if the resync
did not get to the end of the file. Otherwise, there is a memory leak when the
last packet in the file is corrupted.

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 16d25e9..a59c07d 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -1142,8 +1142,8 @@ leave:
 av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d\n", last, orig_size + 
11);
 avio_seek(s->pb, pos + 1, SEEK_SET);
 ret = resync(s);
+av_free_packet(pkt);
 if (ret >= 0) {
-av_free_packet(pkt);
 goto retry;
 }
 }

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


[FFmpeg-cvslog] avcodec/videotoolbox: fix -Wunused-but-set-variable

2015-09-28 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Sat Sep 
19 17:41:30 2015 -0400| [b3066be0e460d915db344c21d092b5554b1b68e8] | committer: 
Michael Niedermayer

avcodec/videotoolbox: fix -Wunused-but-set-variable

pix_fmt was declared presumably to shorten the argument passed to the function.
However, it is currently not being used for such a purpose.
This patch simply removes it instead.
This fixes -Wunused-but-set-variable reported at e.g:
http://fate.ffmpeg.org/log.cgi?time=20150919194249&log=compile&slot=x86_64-darwin-gcc-4.9.

Signed-off-by: Ganesh Ajjanagadde 
Reviewed-by: wm4 
Signed-off-by: Michael Niedermayer 

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

 libavcodec/videotoolbox.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index b78238a..ca44491 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -501,7 +501,6 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
 VTDecompressionOutputCallbackRecord decoder_cb;
 CFDictionaryRef decoder_spec;
 CFDictionaryRef buf_attr;
-int32_t pix_fmt;
 
 if (!videotoolbox) {
 av_log(avctx, AV_LOG_ERROR, "hwaccel context is not set\n");
@@ -528,8 +527,6 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
 break;
 }
 
-pix_fmt = videotoolbox->cv_pix_fmt_type;
-
 decoder_spec = 
videotoolbox_decoder_config_create(videotoolbox->cm_codec_type, avctx);
 
 videotoolbox->cm_fmt_desc = 
videotoolbox_format_desc_create(videotoolbox->cm_codec_type,

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