[FFmpeg-cvslog] dnxhddec: remove unused qscale parameter

2015-09-27 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sun Sep 27 10:09:02 2015 +0200| [8e8ed57ea7d33fa2b872884ead5ec3033637ce92] | 
committer: Michael Niedermayer

dnxhddec: remove unused qscale parameter

Signed-off-by: Michael Niedermayer 

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

 libavcodec/dnxhddec.c |   25 -
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index fa93407..34cf379 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -63,7 +63,7 @@ typedef struct DNXHDContext {
 int act;
 void (*decode_dct_block)(const struct DNXHDContext *ctx,
  RowContext *row, int16_t *block,
- int n, int qscale);
+ int n);
 } DNXHDContext;
 
 #define DNXHD_VLC_BITS 9
@@ -71,13 +71,13 @@ typedef struct DNXHDContext {
 
 static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
  RowContext *row, int16_t *block,
- int n, int qscale);
+ int n);
 static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
   RowContext *row, int16_t *block,
-  int n, int qscale);
+  int n);
 static void dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
   RowContext *row, int16_t *block,
-  int n, int qscale);
+  int n);
 
 static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
 {
@@ -272,7 +272,6 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 static av_always_inline void dnxhd_decode_dct_block(const DNXHDContext *ctx,
 RowContext *row,
 int16_t *block, int n,
-int qscale,
 int index_bits,
 int level_bias,
 int level_shift)
@@ -366,23 +365,23 @@ static av_always_inline void dnxhd_decode_dct_block(const 
DNXHDContext *ctx,
 
 static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
  RowContext *row, int16_t *block,
- int n, int qscale)
+ int n)
 {
-dnxhd_decode_dct_block(ctx, row, block, n, qscale, 4, 32, 6);
+dnxhd_decode_dct_block(ctx, row, block, n, 4, 32, 6);
 }
 
 static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
   RowContext *row, int16_t *block,
-  int n, int qscale)
+  int n)
 {
-dnxhd_decode_dct_block(ctx, row, block, n, qscale, 6, 8, 4);
+dnxhd_decode_dct_block(ctx, row, block, n, 6, 8, 4);
 }
 
 static void dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
   RowContext *row, int16_t *block,
-  int n, int qscale)
+  int n)
 {
-dnxhd_decode_dct_block(ctx, row, block, n, qscale, 6, 32, 6);
+dnxhd_decode_dct_block(ctx, row, block, n, 6, 32, 6);
 }
 
 static int dnxhd_decode_macroblock(const DNXHDContext *ctx, RowContext *row,
@@ -421,12 +420,12 @@ static int dnxhd_decode_macroblock(const DNXHDContext 
*ctx, RowContext *row,
 
 for (i = 0; i < 8; i++) {
 ctx->bdsp.clear_block(row->blocks[i]);
-ctx->decode_dct_block(ctx, row, row->blocks[i], i, qscale);
+ctx->decode_dct_block(ctx, row, row->blocks[i], i);
 }
 if (ctx->is_444) {
 for (; i < 12; i++) {
 ctx->bdsp.clear_block(row->blocks[i]);
-ctx->decode_dct_block(ctx, row, row->blocks[i], i, qscale);
+ctx->decode_dct_block(ctx, row, row->blocks[i], i);
 }
 }
 

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


[FFmpeg-cvslog] dnxhddec: simplify block parsing calls

2015-09-27 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sun Sep 27 10:09:03 2015 +0200| [5c6e3a019c5cbcaeb17f3ae0da55070867d6f63d] | 
committer: Michael Niedermayer

dnxhddec: simplify block parsing calls

Fewer arguments, less duplicated code.

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 34cf379..007eabe 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -62,22 +62,18 @@ typedef struct DNXHDContext {
 int mbaff;
 int act;
 void (*decode_dct_block)(const struct DNXHDContext *ctx,
- RowContext *row, int16_t *block,
- int n);
+ RowContext *row, int n);
 } DNXHDContext;
 
 #define DNXHD_VLC_BITS 9
 #define DNXHD_DC_VLC_BITS 7
 
 static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
- RowContext *row, int16_t *block,
- int n);
+ RowContext *row, int n);
 static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
-  RowContext *row, int16_t *block,
-  int n);
+  RowContext *row, int n);
 static void dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
-  RowContext *row, int16_t *block,
-  int n);
+  RowContext *row, int n);
 
 static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
 {
@@ -271,7 +267,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 
 static av_always_inline void dnxhd_decode_dct_block(const DNXHDContext *ctx,
 RowContext *row,
-int16_t *block, int n,
+int n,
 int index_bits,
 int level_bias,
 int level_shift)
@@ -282,9 +278,12 @@ static av_always_inline void dnxhd_decode_dct_block(const 
DNXHDContext *ctx,
 const uint8_t *weight_matrix;
 const uint8_t *ac_level = ctx->cid_table->ac_level;
 const uint8_t *ac_flags = ctx->cid_table->ac_flags;
+int16_t *block = row->blocks[n];
 const int eob_index = ctx->cid_table->eob_index;
 OPEN_READER(bs, &row->gb);
 
+ctx->bdsp.clear_block(block);
+
 if (!ctx->is_444) {
 if (n & 2) {
 component = 1 + (n & 1);
@@ -364,24 +363,21 @@ static av_always_inline void dnxhd_decode_dct_block(const 
DNXHDContext *ctx,
 }
 
 static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
- RowContext *row, int16_t *block,
- int n)
+ RowContext *row, int n)
 {
-dnxhd_decode_dct_block(ctx, row, block, n, 4, 32, 6);
+dnxhd_decode_dct_block(ctx, row, n, 4, 32, 6);
 }
 
 static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
-  RowContext *row, int16_t *block,
-  int n)
+  RowContext *row, int n)
 {
-dnxhd_decode_dct_block(ctx, row, block, n, 6, 8, 4);
+dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4);
 }
 
 static void dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
-  RowContext *row, int16_t *block,
-  int n)
+  RowContext *row, int n)
 {
-dnxhd_decode_dct_block(ctx, row, block, n, 6, 32, 6);
+dnxhd_decode_dct_block(ctx, row, n, 6, 32, 6);
 }
 
 static int dnxhd_decode_macroblock(const DNXHDContext *ctx, RowContext *row,
@@ -418,15 +414,8 @@ static int dnxhd_decode_macroblock(const DNXHDContext 
*ctx, RowContext *row,
 row->last_qscale = qscale;
 }
 
-for (i = 0; i < 8; i++) {
-ctx->bdsp.clear_block(row->blocks[i]);
-ctx->decode_dct_block(ctx, row, row->blocks[i], i);
-}
-if (ctx->is_444) {
-for (; i < 12; i++) {
-ctx->bdsp.clear_block(row->blocks[i]);
-ctx->decode_dct_block(ctx, row, row->blocks[i], i);
-}
+for (i = 0; i < 8 + 4 * ctx->is_444; i++) {
+ctx->decode_dct_block(ctx, row, i);
 }
 
 if (frame->interlaced_frame) {

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


[FFmpeg-cvslog] avfilter/vf_mcdeint: add missing "This file is part of FFmpeg"

2015-09-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Sep 27 13:07:12 2015 +0200| [485057f715720b2cdaf581bb3960e70cd3541ba8] | 
committer: Michael Niedermayer

avfilter/vf_mcdeint: add missing "This file is part of FFmpeg"

Signed-off-by: Michael Niedermayer 

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

 libavfilter/vf_mcdeint.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/vf_mcdeint.c b/libavfilter/vf_mcdeint.c
index 03daca5..38a299e 100644
--- a/libavfilter/vf_mcdeint.c
+++ b/libavfilter/vf_mcdeint.c
@@ -1,6 +1,8 @@
 /*
  * Copyright (c) 2006 Michael Niedermayer 
  *
+ * This file is part of FFmpeg.
+ *
  * FFmpeg is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or

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


[FFmpeg-cvslog] swresample/dither_template: Add missing license header

2015-09-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Sep 27 13:09:10 2015 +0200| [7d636d02b1134755fd1d93c2302ad32d9bbfd1c7] | 
committer: Michael Niedermayer

swresample/dither_template: Add missing license header

Signed-off-by: Michael Niedermayer 

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

 libswresample/dither_template.c |   17 +
 1 file changed, 17 insertions(+)

diff --git a/libswresample/dither_template.c b/libswresample/dither_template.c
index 1e35dfb..1f535de 100644
--- a/libswresample/dither_template.c
+++ b/libswresample/dither_template.c
@@ -1,3 +1,20 @@
+/*
+ * This file is part of libswresample
+ *
+ * libswresample 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.
+ *
+ * libswresample 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 libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
 
 #if defined(TEMPLATE_DITHER_DBL)
 #define RENAME(N) N ## _double

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


[FFmpeg-cvslog] avfilter/vf_yadif: add missing "This file is part of FFmpeg"

2015-09-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Sep 27 13:07:12 2015 +0200| [549d10924894da30156ab37327ece8a8cfdc9a7e] | 
committer: Michael Niedermayer

avfilter/vf_yadif: add missing "This file is part of FFmpeg"

Signed-off-by: Michael Niedermayer 

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

 libavfilter/vf_yadif.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 7451832..d7a2b53 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -1,6 +1,8 @@
 /*
  * Copyright (C) 2006-2011 Michael Niedermayer 
  *   2010  James Darnley 
+
+ * This file is part of FFmpeg.
  *
  * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public

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


[FFmpeg-cvslog] avcodec/d3d11va: Fix project name

2015-09-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Sep 27 13:08:49 2015 +0200| [c4d50314c0871d0eb6f083957686de0373ebe730] | 
committer: Michael Niedermayer

avcodec/d3d11va: Fix project name

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/d3d11va.c b/libavcodec/d3d11va.c
index d24730a..42491e7 100644
--- a/libavcodec/d3d11va.c
+++ b/libavcodec/d3d11va.c
@@ -3,20 +3,20 @@
  *
  * copyright (c) 2015 Steve Lhomme
  *
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * 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.
  *
- * Libav is distributed in the hope that it will be useful,
+ * 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 Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 

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


[FFmpeg-cvslog] configure: Disable automatic image base calculation

2015-09-27 Thread Alex Smith
ffmpeg | branch: master | Alex Smith  | Mon Sep 21 
00:41:38 2015 -0400| [6e61231d641b23d9d298b31e9241371f5e7abddb] | committer: 
Michael Niedermayer

configure: Disable automatic image base calculation

There's no reason for it.  ASLR will rebase it regardless so "preventing
collisions" isn't really relevant.  This also brings it in line with
what a msvc produced dll will have (an image base of 0x1000).

Signed-off-by: Alex Smith 
Reviewed-by: Hendrik Leppkes 
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/configure b/configure
index 11b6dc4..bd4f91d 100755
--- a/configure
+++ b/configure
@@ -4386,7 +4386,7 @@ case $target_os in
 SLIB_INSTALL_LINKS=
 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
 SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
-SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) 
-Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
-Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
+SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) 
-Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
-Wl,--enable-runtime-pseudo-reloc -Wl,--disable-auto-image-base'
 objformat="win32"
 ranlib=:
 enable dos_paths

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


[FFmpeg-cvslog] checkasm/x86: Correctly handle variadic functions

2015-09-27 Thread Henrik Gramner
ffmpeg | branch: master | Henrik Gramner  | Wed Sep 23 
16:06:02 2015 +0200| [7ca1de5b4f1a369a997c5cf9924b0197606f558d] | committer: 
Henrik Gramner

checkasm/x86: Correctly handle variadic functions

The System V ABI on x86-64 specifies that the al register contains an upper
bound of the number of arguments passed in vector registers when calling
variadic functions, so we aren't allowed to clobber it.

checkasm_fail_func() is a variadic function so also zero al before calling it.

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

 tests/checkasm/x86/checkasm.asm |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/checkasm/x86/checkasm.asm b/tests/checkasm/x86/checkasm.asm
index 5f3def9..20012f8 100644
--- a/tests/checkasm/x86/checkasm.asm
+++ b/tests/checkasm/x86/checkasm.asm
@@ -77,8 +77,10 @@ cglobal stack_clobber, 1,2
 
 %if WIN64
 %assign free_regs 7
+DECLARE_REG_TMP 4
 %else
 %assign free_regs 9
+DECLARE_REG_TMP 7
 %endif
 
 ;-
@@ -86,7 +88,7 @@ cglobal stack_clobber, 1,2
 ;-
 INIT_XMM
 cglobal checked_call, 2,15,16,max_args*8+8
-mov  r6, r0
+mov  t0, r0
 
 ; All arguments have been pushed on the stack instead of registers in 
order to
 ; test for incorrect assumptions that 32-bit ints are zero-extended to 
64-bit.
@@ -129,7 +131,7 @@ cglobal checked_call, 2,15,16,max_args*8+8
 mov r %+ i, [n %+ i]
 %assign i i-1
 %endrep
-call r6
+call t0
 %assign i 14
 %rep 15-free_regs
 xor r %+ i, [n %+ i]
@@ -156,6 +158,7 @@ cglobal checked_call, 2,15,16,max_args*8+8
 mov  r9, rax
 mov r10, rdx
 lea  r0, [error_message]
+xor eax, eax
 call fail_func
 mov rdx, r10
 mov rax, r9

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


[FFmpeg-cvslog] dnxhddec: check and report bitstream errors

2015-09-27 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sun Sep 27 10:09:04 2015 +0200| [b8b8e82ea14016b2cb04b49ecea57f836e6ee7f8] | 
committer: Michael Niedermayer

dnxhddec: check and report bitstream errors

This only occur when an overrun in coefficient decoding is
detected.

Signed-off-by: Michael Niedermayer 

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

 libavcodec/dnxhddec.c |   48 ++--
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 007eabe..8d30446 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -39,6 +39,7 @@ typedef struct RowContext {
 GetBitContext gb;
 int last_dc[3];
 int last_qscale;
+int errors;
 } RowContext;
 
 typedef struct DNXHDContext {
@@ -61,18 +62,18 @@ typedef struct DNXHDContext {
 int is_444;
 int mbaff;
 int act;
-void (*decode_dct_block)(const struct DNXHDContext *ctx,
+int (*decode_dct_block)(const struct DNXHDContext *ctx,
  RowContext *row, int n);
 } DNXHDContext;
 
 #define DNXHD_VLC_BITS 9
 #define DNXHD_DC_VLC_BITS 7
 
-static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
+static int dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
  RowContext *row, int n);
-static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
+static int dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
   RowContext *row, int n);
-static void dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
+static int dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
   RowContext *row, int n);
 
 static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
@@ -265,7 +266,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 return 0;
 }
 
-static av_always_inline void dnxhd_decode_dct_block(const DNXHDContext *ctx,
+static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx,
 RowContext *row,
 int n,
 int index_bits,
@@ -280,6 +281,7 @@ static av_always_inline void dnxhd_decode_dct_block(const 
DNXHDContext *ctx,
 const uint8_t *ac_flags = ctx->cid_table->ac_flags;
 int16_t *block = row->blocks[n];
 const int eob_index = ctx->cid_table->eob_index;
+int ret = 0;
 OPEN_READER(bs, &row->gb);
 
 ctx->bdsp.clear_block(block);
@@ -343,6 +345,7 @@ static av_always_inline void dnxhd_decode_dct_block(const 
DNXHDContext *ctx,
 
 if (++i > 63) {
 av_log(ctx->avctx, AV_LOG_ERROR, "ac tex damaged %d, %d\n", n, i);
+ret = -1;
 break;
 }
 
@@ -360,24 +363,25 @@ static av_always_inline void dnxhd_decode_dct_block(const 
DNXHDContext *ctx,
 }
 
 CLOSE_READER(bs, &row->gb);
+return ret;
 }
 
-static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
+static int dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
  RowContext *row, int n)
 {
-dnxhd_decode_dct_block(ctx, row, n, 4, 32, 6);
+return dnxhd_decode_dct_block(ctx, row, n, 4, 32, 6);
 }
 
-static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
+static int dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
   RowContext *row, int n)
 {
-dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4);
+return dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4);
 }
 
-static void dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
+static int dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx,
   RowContext *row, int n)
 {
-dnxhd_decode_dct_block(ctx, row, n, 6, 32, 6);
+return dnxhd_decode_dct_block(ctx, row, n, 6, 32, 6);
 }
 
 static int dnxhd_decode_macroblock(const DNXHDContext *ctx, RowContext *row,
@@ -415,7 +419,8 @@ static int dnxhd_decode_macroblock(const DNXHDContext *ctx, 
RowContext *row,
 }
 
 for (i = 0; i < 8 + 4 * ctx->is_444; i++) {
-ctx->decode_dct_block(ctx, row, i);
+if (ctx->decode_dct_block(ctx, row, i) < 0)
+return AVERROR_INVALIDDATA;
 }
 
 if (frame->interlaced_frame) {
@@ -488,7 +493,11 @@ static int dnxhd_decode_row(AVCodecContext *avctx, void 
*data,
 init_get_bits(&row->gb, ctx->buf + offset, (ctx->buf_size - offset) << 3);
 for (x = 0; x < ctx->mb_width; x++) {
 //START_TIMER;
-dnxhd_decode_macroblock(ctx, row, data, x, rownb);
+int ret = dnxhd_decode_macroblock(ctx, row, data, x, rownb);
+if (ret < 0) {
+row->errors++;
+return ret;
+}
 //STOP_TIMER("decode macroblock");
 }
 
@@ -504,7 +513,7 @@ static int dnxhd_decode_frame(AVCo

[FFmpeg-cvslog] h264: Fix ticket #3147 H264 - Wrong field order

2015-09-27 Thread Thomas Mundt
ffmpeg | branch: master | Thomas Mundt  | Sun Sep 27 22:11:47 
2015 +0100| [2b6567722a48656c526ca2d6c1dcab88be3c18f7] | committer: Michael 
Niedermayer

h264: Fix ticket #3147 H264 - Wrong field order

Default field order to top field first when interlaced frame is detected and 
pic_struct_present_flag is not set.
Since bottom field first comes from the old NTSC standard and is not used with 
HD anymore I think it´s straight forward to favor the majority.

Signed-off-by: Thomas Mundt 
Reviewed-by: Kieran Kunhya 
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index b797893..8b95003 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -803,7 +803,7 @@ static void decode_postinit(H264Context *h, int 
setup_finished)
 /* Derive top_field_first from field pocs. */
 cur->f->top_field_first = cur->field_poc[0] < cur->field_poc[1];
 } else {
-if (cur->f->interlaced_frame || h->sps.pic_struct_present_flag) {
+if (h->sps.pic_struct_present_flag) {
 /* Use picture timing SEI information. Even if it is a
  * information of a past frame, better than nothing. */
 if (h->sei_pic_struct == SEI_PIC_STRUCT_TOP_BOTTOM ||
@@ -811,6 +811,10 @@ static void decode_postinit(H264Context *h, int 
setup_finished)
 cur->f->top_field_first = 1;
 else
 cur->f->top_field_first = 0;
+} else if (cur->f->interlaced_frame) {
+/* Default to top field first when pic_struct_present_flag
+ * is not set but interlaced frame detected */
+cur->f->top_field_first = 1;
 } else {
 /* Most likely progressive */
 cur->f->top_field_first = 0;

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


[FFmpeg-cvslog] ffplay: add support for interactive volume control

2015-09-27 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Sun Sep 
27 10:41:37 2015 -0400| [f1a9583305d90533acb54c9cadf6afac2c4dc3fa] | committer: 
Marton Balint

ffplay: add support for interactive volume control

This is a feature heavily inspired by the mpv player. At the moment, methods
for adjusting volume in ffplay are rather clumsy: either one needs to set it
system-wide, or one needs to set it via the volume filter.

This patch adds key bindings identical to the mpv defaults for muting/unmuting
and increasing/decreasing the volume interactively without any introduction of
external dependencies.

TODO: doc update, possible mouse button bindings (mpv has this).

Signed-off-by: Ganesh Ajjanagadde 
Signed-off-by: Marton Balint 

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

 ffplay.c |   36 +++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 2bb5d26..21600d0 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -73,6 +73,9 @@ const int program_birth_year = 2003;
 /* Calculate actual buffer size keeping in mind not cause too frequent audio 
callbacks */
 #define SDL_AUDIO_MAX_CALLBACKS_PER_SEC 30
 
+/* Step size for volume control */
+#define SDL_VOLUME_STEP (SDL_MIX_MAXVOLUME / 50)
+
 /* no AV sync correction is done if below the minimum AV sync threshold */
 #define AV_SYNC_THRESHOLD_MIN 0.04
 /* AV sync correction is done if above the maximum AV sync threshold */
@@ -246,6 +249,8 @@ typedef struct VideoState {
 unsigned int audio_buf1_size;
 int audio_buf_index; /* in bytes */
 int audio_write_buf_size;
+int audio_volume;
+int muted;
 struct AudioParams audio_src;
 #if CONFIG_AVFILTER
 struct AudioParams audio_filter_src;
@@ -1349,6 +1354,16 @@ static void toggle_pause(VideoState *is)
 is->step = 0;
 }
 
+static void toggle_mute(VideoState *is)
+{
+is->muted = !is->muted;
+}
+
+static void update_volume(VideoState *is, int sign, int step)
+{
+is->audio_volume = av_clip(is->audio_volume + sign * step, 0, 
SDL_MIX_MAXVOLUME);
+}
+
 static void step_to_next_frame(VideoState *is)
 {
 /* if the stream is paused unpause it, then step */
@@ -2448,7 +2463,13 @@ static void sdl_audio_callback(void *opaque, Uint8 
*stream, int len)
 len1 = is->audio_buf_size - is->audio_buf_index;
 if (len1 > len)
 len1 = len;
-memcpy(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1);
+if (!is->muted && is->audio_volume == SDL_MIX_MAXVOLUME)
+memcpy(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, 
len1);
+else {
+memset(stream, is->silence_buf[0], len1);
+if (!is->muted)
+SDL_MixAudio(stream, (uint8_t *)is->audio_buf + 
is->audio_buf_index, len1, is->audio_volume);
+}
 len -= len1;
 stream += len1;
 is->audio_buf_index += len1;
@@ -3125,6 +3146,8 @@ static VideoState *stream_open(const char *filename, 
AVInputFormat *iformat)
 init_clock(&is->audclk, &is->audioq.serial);
 init_clock(&is->extclk, &is->extclk.serial);
 is->audio_clock_serial = -1;
+is->audio_volume = SDL_MIX_MAXVOLUME;
+is->muted = 0;
 is->av_sync_type = av_sync_type;
 is->read_tid = SDL_CreateThread(read_thread, is);
 if (!is->read_tid) {
@@ -3314,6 +3337,17 @@ static void event_loop(VideoState *cur_stream)
 case SDLK_SPACE:
 toggle_pause(cur_stream);
 break;
+case SDLK_m:
+toggle_mute(cur_stream);
+break;
+case SDLK_KP_MULTIPLY:
+case SDLK_0:
+update_volume(cur_stream, 1, SDL_VOLUME_STEP);
+break;
+case SDLK_KP_DIVIDE:
+case SDLK_9:
+update_volume(cur_stream, -1, SDL_VOLUME_STEP);
+break;
 case SDLK_s: // S: Step to next frame
 step_to_next_frame(cur_stream);
 break;

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


[FFmpeg-cvslog] doc/ffplay, ffplay: add information regarding volume control

2015-09-27 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Sun Sep 
27 12:38:34 2015 -0400| [fd44892073cc9a5737ee230b0528aba3d555378c] | committer: 
Marton Balint

doc/ffplay, ffplay: add information regarding volume control

ffplay now supports dynamic volume control. This documents the supported
behavior.

Signed-off-by: Ganesh Ajjanagadde 
Reviewed-by: Stefano Sabatini 
Signed-off-by: Marton Balint 

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

 doc/ffplay.texi |9 +
 ffplay.c|3 +++
 2 files changed, 12 insertions(+)

diff --git a/doc/ffplay.texi b/doc/ffplay.texi
index be696c8..2a35c21 100644
--- a/doc/ffplay.texi
+++ b/doc/ffplay.texi
@@ -197,6 +197,15 @@ Toggle full screen.
 @item p, SPC
 Pause.
 
+@item m
+Toggle mute.
+
+@item 9, 0
+Decrease and increase volume respectively.
+
+@item /, *
+Decrease and increase volume respectively.
+
 @item a
 Cycle audio channel in the current program.
 
diff --git a/ffplay.c b/ffplay.c
index 21600d0..3c2407f 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3681,6 +3681,9 @@ void show_help_default(const char *opt, const char *arg)
"q, ESC  quit\n"
"f   toggle full screen\n"
"p, SPC  pause\n"
+   "m   toggle mute\n"
+   "9, 0decrease and increase volume respectively\n"
+   "/, *decrease and increase volume respectively\n"
"a   cycle audio channel in the current program\n"
"v   cycle video channel\n"
"t   cycle subtitle channel in the current 
program\n"

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


[FFmpeg-cvslog] dnxhddec: use unsafe bitstream reader

2015-09-27 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Sun Sep 27 10:09:05 2015 +0200| [235381e674bf0921cbb7871946e2ff08bd84d6ba] | 
committer: Michael Niedermayer

dnxhddec: use unsafe bitstream reader

Each line is padded by the format, and errors are now reported and
stop the decoding. Around 5% speedup.

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 8d30446..06d4780 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -26,6 +26,7 @@
 #include "libavutil/timer.h"
 #include "avcodec.h"
 #include "blockdsp.h"
+#define  UNCHECKED_BITSTREAM_READER 1
 #include "get_bits.h"
 #include "dnxhddata.h"
 #include "idctdsp.h"

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