[FFmpeg-cvslog] avfilter/ebur128: rework channel weighting definition code

2014-09-06 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Sat Sep  6 13:47:59 
2014 +0200| [b2c0b80f62912f932cc3bb04621408601a9ed4d5] | committer: Clément 
Bœsch

avfilter/ebur128: rework channel weighting definition code

Should fix CID1194399 (Bad bit shift operation)

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

 libavfilter/f_ebur128.c |   14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index a02cf28..c18ae79 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -363,7 +363,6 @@ static int config_audio_input(AVFilterLink *inlink)
 static int config_audio_output(AVFilterLink *outlink)
 {
 int i;
-int idx_bitposn = 0;
 AVFilterContext *ctx = outlink->src;
 EBUR128Context *ebur128 = ctx->priv;
 const int nb_channels = 
av_get_channel_layout_nb_channels(outlink->channel_layout);
@@ -379,23 +378,16 @@ static int config_audio_output(AVFilterLink *outlink)
 return AVERROR(ENOMEM);
 
 for (i = 0; i < nb_channels; i++) {
-
-/* find the next bit that is set starting from the right */
-while ((outlink->channel_layout & 1ULLch_weighting[i] = 0;
-} else if (1ULLch_weighting[i] = 1.0;
 }
 
-idx_bitposn++;
-
 if (!ebur128->ch_weighting[i])
 continue;
 

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


[FFmpeg-cvslog] avformat/mpegts: fix spelling error

2014-09-06 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Sat Sep  6 12:06:39 2014 +0200| [b76d6eb3bd70b38c1d02b257462bc7ed102550fb] | 
committer: Michael Niedermayer

avformat/mpegts: fix spelling error

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 20a2d30..c7e8bb5 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -156,7 +156,7 @@ struct MpegTSContext {
 };
 
 #define MPEGTS_OPTIONS \
-{ "resync_size",   "Size limit for looking up a new syncronization.", 
offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT,  { .i64 =  
MAX_RESYNC_SIZE}, 0, INT_MAX,  AV_OPT_FLAG_DECODING_PARAM }
+{ "resync_size",   "Size limit for looking up a new synchronization.", 
offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT,  { .i64 =  
MAX_RESYNC_SIZE}, 0, INT_MAX,  AV_OPT_FLAG_DECODING_PARAM }
 
 static const AVOption options[] = {
 MPEGTS_OPTIONS,

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


[FFmpeg-cvslog] ffplay: make autoexit the default

2014-09-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Sep  6 
20:22:14 2014 +0200| [5732b21884251a3414622f662eb337666f2eb77e] | committer: 
Michael Niedermayer

ffplay: make autoexit the default

See: f9bc65e399d1883da21ae03d07b09348a11a5f49
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/ffplay.c b/ffplay.c
index 833b5b1..06bccce 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -311,7 +311,7 @@ static int fast = 0;
 static int genpts = 0;
 static int lowres = 0;
 static int decoder_reorder_pts = -1;
-static int autoexit;
+static int autoexit = 1;
 static int exit_on_keydown;
 static int exit_on_mousedown;
 static int loop = 1;

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


[FFmpeg-cvslog] Merge commit '041caf1a63f091745b95a6d51c23fbdcb604d4ce'

2014-09-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Sep  6 
20:20:44 2014 +0200| [f9bc65e399d1883da21ae03d07b09348a11a5f49] | committer: 
Michael Niedermayer

Merge commit '041caf1a63f091745b95a6d51c23fbdcb604d4ce'

* commit '041caf1a63f091745b95a6d51c23fbdcb604d4ce':
  avplay: Exit by default at the end of playback

Conflicts:
Changelog
ffplay.c

Changes to ffplay not merged as they would break -autoexit as a way to override 
-noautoexit,
the change of the default will be implemented in the next commit

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] avplay: Exit by default at the end of playback

2014-09-06 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Wed Sep  3 
00:45:21 2014 +0200| [041caf1a63f091745b95a6d51c23fbdcb604d4ce] | committer: 
Diego Biurrun

avplay: Exit by default at the end of playback

This is the expected behavior shared by all other cli multimedia players.

Bug-Id: 732

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

 Changelog   |1 +
 avplay.c|6 +++---
 doc/avplay.texi |4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Changelog b/Changelog
index ae43bcd..bbbe9dc 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version :
 - aliases and defaults for Ogg subtypes (opus, spx)
 - HEVC/H.265 RTP payload format (draft v6) depacketizer
+- avplay now exits by default at the end of playback
 
 
 version 11:
diff --git a/avplay.c b/avplay.c
index 816733f..4a7759b 100644
--- a/avplay.c
+++ b/avplay.c
@@ -254,7 +254,7 @@ static enum AVDiscard skip_idct= AVDISCARD_DEFAULT;
 static enum AVDiscard skip_loop_filter = AVDISCARD_DEFAULT;
 static int error_concealment = 3;
 static int decoder_reorder_pts = -1;
-static int autoexit;
+static int noautoexit;
 static int exit_on_keydown;
 static int exit_on_mousedown;
 static int loop = 1;
@@ -2421,7 +2421,7 @@ static int decode_thread(void *arg)
 if (is->audioq.size + is->videoq.size + is->subtitleq.size == 0) {
 if (loop != 1 && (!loop || --loop)) {
 stream_seek(cur_stream, start_time != AV_NOPTS_VALUE ? 
start_time : 0, 0, 0);
-} else if (autoexit) {
+} else if (!noautoexit) {
 ret = AVERROR_EOF;
 goto fail;
 }
@@ -2874,7 +2874,7 @@ static const OptionDef options[] = {
 { "idct", OPT_INT | HAS_ARG | OPT_EXPERT, { &idct }, "set idct algo",  
"algo" },
 { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, { &error_concealment }, "set error 
concealment options",  "bit_mask" },
 { "sync", HAS_ARG | OPT_EXPERT, { .func_arg = opt_sync }, "set audio-video 
sync. type (type=audio/video/ext)", "type" },
-{ "autoexit", OPT_BOOL | OPT_EXPERT, { &autoexit }, "exit at the end", "" 
},
+{ "noautoexit", OPT_BOOL | OPT_EXPERT, { &noautoexit }, "Do not exit at 
the end of playback", "" },
 { "exitonkeydown", OPT_BOOL | OPT_EXPERT, { &exit_on_keydown }, "exit on 
key down", "" },
 { "exitonmousedown", OPT_BOOL | OPT_EXPERT, { &exit_on_mousedown }, "exit 
on mouse down", "" },
 { "loop", OPT_INT | HAS_ARG | OPT_EXPERT, { &loop }, "set number of times 
the playback shall be looped", "loop count" },
diff --git a/doc/avplay.texi b/doc/avplay.texi
index 71981f6..d526213 100644
--- a/doc/avplay.texi
+++ b/doc/avplay.texi
@@ -109,8 +109,8 @@ Select the desired subtitle stream number, counting from 0. 
The number
 refers to the list of all the input subtitle streams. If it is greater
 than the number of subtitle streams minus one, then the last one is
 selected, if it is negative the subtitle rendering is disabled.
-@item -autoexit
-Exit when video is done playing.
+@item -noautoexit
+Do not exit after playback is finished.
 @item -exitonkeydown
 Exit if any key is pressed.
 @item -exitonmousedown

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


[FFmpeg-cvslog] avcodec/hevc: fix dead code

2014-09-06 Thread Mickaël Raulet
ffmpeg | branch: master | Mickaël Raulet  | Sat Sep  6 
19:05:21 2014 +0200| [684d0a0b23dce1f7759a40b1ef5c24eb7d8e9329] | committer: 
Michael Niedermayer

avcodec/hevc: fix dead code

fix CID 1231985

cherry picked from commit 745a35a777eaa5f77b8660b44098110a29916aae
Signed-off-by: Michael Niedermayer 

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

 libavcodec/hevc.c |6 --
 1 file changed, 6 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 863ed23..5fc7324 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1140,9 +1140,6 @@ static int hls_transform_tree(HEVCContext *s, int x0, int 
y0,
 if (s->sps->chroma_format_idc == 2 && (!split_transform_flag || 
log2_trafo_size == 3)) {
 cbf_cb[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
 }
-} else if (trafo_depth == 0) {
-cbf_cb[0] =
-cbf_cb[1] = 0;
 }
 
 if (trafo_depth == 0 || cbf_cr[0]) {
@@ -1150,9 +1147,6 @@ static int hls_transform_tree(HEVCContext *s, int x0, int 
y0,
 if (s->sps->chroma_format_idc == 2 && (!split_transform_flag || 
log2_trafo_size == 3)) {
 cbf_cr[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
 }
-} else if (trafo_depth == 0) {
-cbf_cr[0] =
-cbf_cr[1] = 0;
 }
 }
 

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


[FFmpeg-cvslog] aacsbr: support hardcoding tables.

2014-09-06 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Sat Aug 
30 17:27:57 2014 +0200| [87c7fb2b215f306c4b2db42b71d41a7b340e6b7f] | committer: 
Reimar Döffinger

aacsbr: support hardcoding tables.

For sbr_qmf_window_us there is even a question if it maybe
should be fully hardcoded all the time.
Since half of it is coded, it ends up in .data and not .bss.

Signed-off-by: Reimar Döffinger 

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

 libavcodec/Makefile  |4 +-
 libavcodec/aacsbr.c  |   10 +---
 libavcodec/aacsbr_tablegen.c |   39 +
 libavcodec/aacsbr_tablegen.h |  129 ++
 libavcodec/aacsbrdata.h  |   86 
 libavcodec/tableprint.h  |   10 
 6 files changed, 183 insertions(+), 95 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fd96a1e..078b555 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -873,6 +873,7 @@ TOOLS = fourcc2pixfmt
 
 HOSTPROGS = aac_tablegen\
 aacps_tablegen  \
+aacsbr_tablegen \
 cbrt_tablegen   \
 cos_tablegen\
 dsd_tablegen\
@@ -900,7 +901,7 @@ else
 $(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
 endif
 
-GEN_HEADERS = cbrt_tables.h aacps_tables.h aac_tables.h dsd_tables.h 
dv_tables.h \
+GEN_HEADERS = cbrt_tables.h aacps_tables.h aacsbr_tables.h aac_tables.h 
dsd_tables.h dv_tables.h \
   sinewin_tables.h mpegaudio_tables.h motionpixels_tables.h \
   pcm_tables.h qdm2_tables.h
 GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
@@ -911,6 +912,7 @@ $(GEN_HEADERS): $(SUBDIR)%_tables.h: 
$(SUBDIR)%_tablegen$(HOSTEXESUF)
 ifdef CONFIG_HARDCODED_TABLES
 $(SUBDIR)aacdec.o: $(SUBDIR)cbrt_tables.h
 $(SUBDIR)aacps.o: $(SUBDIR)aacps_tables.h
+$(SUBDIR)aacsbr.o: $(SUBDIR)aacsbr_tables.h
 $(SUBDIR)aactab.o: $(SUBDIR)aac_tables.h
 $(SUBDIR)dsddec.o: $(SUBDIR)dsd_tables.h
 $(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index 290fb81..f550ead 100644
--- a/libavcodec/aacsbr.c
+++ b/libavcodec/aacsbr.c
@@ -30,6 +30,7 @@
 #include "sbr.h"
 #include "aacsbr.h"
 #include "aacsbrdata.h"
+#include "aacsbr_tablegen.h"
 #include "fft.h"
 #include "aacps.h"
 #include "sbrdsp.h"
@@ -95,7 +96,6 @@ static void aacsbr_func_ptr_init(AACSBRContext *c);
 
 av_cold void ff_aac_sbr_init(void)
 {
-int n;
 static const struct {
 const void *sbr_codes, *sbr_bits;
 const unsigned int table_size, elem_size;
@@ -124,13 +124,7 @@ av_cold void ff_aac_sbr_init(void)
 SBR_INIT_VLC_STATIC(8, 592);
 SBR_INIT_VLC_STATIC(9, 512);
 
-for (n = 1; n < 320; n++)
-sbr_qmf_window_us[320 + n] = sbr_qmf_window_us[320 - n];
-sbr_qmf_window_us[384] = -sbr_qmf_window_us[384];
-sbr_qmf_window_us[512] = -sbr_qmf_window_us[512];
-
-for (n = 0; n < 320; n++)
-sbr_qmf_window_ds[n] = sbr_qmf_window_us[2*n];
+aacsbr_tableinit();
 
 ff_ps_init();
 }
diff --git a/libavcodec/aacsbr_tablegen.c b/libavcodec/aacsbr_tablegen.c
new file mode 100644
index 000..c3c0f0c
--- /dev/null
+++ b/libavcodec/aacsbr_tablegen.c
@@ -0,0 +1,39 @@
+/*
+ * Header file for hardcoded AAC SBR windows
+ *
+ * Copyright (c) 2014 Reimar Döffinger 
+ *
+ * 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 
+#define CONFIG_HARDCODED_TABLES 0
+#include "libavutil/common.h"
+#include "aacsbr_tablegen.h"
+#include "tableprint.h"
+
+int main(void)
+{
+aacsbr_tableinit();
+
+write_fileheader();
+
+WRITE_ARRAY_ALIGNED("static const", 32, float, sbr_qmf_window_ds);
+WRITE_ARRAY_ALIGNED("static const", 32, float, sbr_qmf_window_us);
+
+return 0;
+}
diff --git a/libavcodec/aacsbr_tablegen.h b/libavcodec/aacsbr_tablegen.h
new file mode 100644
index 000..56fdccc
--- /dev/null
+++ b/libavcodec/aacsbr_tablegen.h
@@ -0,0 +1,129 @@
+/*
+ * Header file f

[FFmpeg-cvslog] huffyuvdec: avoid large stack use.

2014-09-06 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Tue Sep 
 2 21:56:43 2014 +0200| [3dbf569032e7cabb7c6a76c62ea8130bb74ef71b] | committer: 
Reimar Döffinger

huffyuvdec: avoid large stack use.

Signed-off-by: Reimar Döffinger 

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

 libavcodec/huffyuvdec.c |   19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 1df77e0..3b2b0f7 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -115,10 +115,14 @@ static int read_len_table(uint8_t *dst, GetBitContext 
*gb, int n)
 
 static int generate_joint_tables(HYuvContext *s)
 {
-uint16_t symbols[1 << VLC_BITS];
-uint16_t bits[1 << VLC_BITS];
-uint8_t len[1 << VLC_BITS];
 int ret;
+uint16_t *symbols = av_mallocz(5 << VLC_BITS);
+uint16_t *bits;
+uint8_t *len;
+if (!symbols)
+return AVERROR(ENOMEM);
+bits = symbols + (1 << VLC_BITS);
+len = (uint8_t *)(bits + (1 << VLC_BITS));
 
 if (s->bitstream_bpp < 24 || s->version > 2) {
 int p, i, y, u;
@@ -147,7 +151,7 @@ static int generate_joint_tables(HYuvContext *s)
 ff_free_vlc(&s->vlc[4 + p]);
 if ((ret = ff_init_vlc_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 
1,
   bits, 2, 2, symbols, 2, 2, 0)) < 0)
-return ret;
+goto out;
 }
 } else {
 uint8_t (*map)[4] = (uint8_t(*)[4]) s->pix_bgr_map;
@@ -191,9 +195,12 @@ static int generate_joint_tables(HYuvContext *s)
 ff_free_vlc(&s->vlc[4]);
 if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1,
 bits, 2, 2, 0)) < 0)
-return ret;
+goto out;
 }
-return 0;
+ret = 0;
+out:
+av_freep(&symbols);
+return ret;
 }
 
 static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)

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


[FFmpeg-cvslog] cabac: initialize all of ff_h264_cabac_tables programmatically.

2014-09-06 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Sat Aug 
30 18:17:39 2014 +0200| [0f1281b2b8ac6f7d2a0b8d18f6fbba9ed7a1bd08] | committer: 
Reimar Döffinger

cabac: initialize all of ff_h264_cabac_tables programmatically.

Moves it from .data to .bss, slightly reducing binary size.

Signed-off-by: Reimar Döffinger 

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

 libavcodec/cabac.c |   26 --
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c
index 65579d8..803c81c 100644
--- a/libavcodec/cabac.c
+++ b/libavcodec/cabac.c
@@ -32,28 +32,7 @@
 #include "cabac.h"
 #include "cabac_functions.h"
 
-uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63] = {
- 9,8,7,7,6,6,6,6,5,5,5,5,5,5,5,5,
- 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
+uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63];
 
 static const uint8_t lps_range[64][4]= {
 {128,176,208,240}, {128,167,197,227}, {128,158,187,216}, {123,150,178,205},
@@ -143,6 +122,9 @@ void ff_init_cabac_states(void)
 if (initialized)
 return;
 
+for (i = 0; i < 512; i++)
+ff_h264_norm_shift[i] = i ? 8 - av_log2(i) : 9;
+
 for(i=0; i<64; i++){
 for(j=0; j<4; j++){ //FIXME check if this is worth the 1 shift we save
 ff_h264_lps_range[j*2*64+2*i+0]=

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


[FFmpeg-cvslog] cabac: Allow hardcoding CABAC table.

2014-09-06 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Sun Aug 
31 12:42:51 2014 +0200| [092d1977cc7146f20c8db2155e7d648afb300de7] | committer: 
Reimar Döffinger

cabac: Allow hardcoding CABAC table.

Signed-off-by: Reimar Döffinger 

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

 libavcodec/Makefile  |4 +-
 libavcodec/cabac.c   |   74 +
 libavcodec/cabac.h   |7 ++-
 libavcodec/cabac_functions.h |8 ++--
 libavcodec/cabac_tablegen.c  |   41 
 libavcodec/cabac_tablegen.h  |  108 ++
 6 files changed, 164 insertions(+), 78 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 078b555..b74d8b5 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -874,6 +874,7 @@ TOOLS = fourcc2pixfmt
 HOSTPROGS = aac_tablegen\
 aacps_tablegen  \
 aacsbr_tablegen \
+cabac_tablegen  \
 cbrt_tablegen   \
 cos_tablegen\
 dsd_tablegen\
@@ -901,7 +902,7 @@ else
 $(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
 endif
 
-GEN_HEADERS = cbrt_tables.h aacps_tables.h aacsbr_tables.h aac_tables.h 
dsd_tables.h dv_tables.h \
+GEN_HEADERS = cabac_tables.h cbrt_tables.h aacps_tables.h aacsbr_tables.h 
aac_tables.h dsd_tables.h dv_tables.h \
   sinewin_tables.h mpegaudio_tables.h motionpixels_tables.h \
   pcm_tables.h qdm2_tables.h
 GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
@@ -914,6 +915,7 @@ $(SUBDIR)aacdec.o: $(SUBDIR)cbrt_tables.h
 $(SUBDIR)aacps.o: $(SUBDIR)aacps_tables.h
 $(SUBDIR)aacsbr.o: $(SUBDIR)aacsbr_tables.h
 $(SUBDIR)aactab.o: $(SUBDIR)aac_tables.h
+$(SUBDIR)cabac.o: $(SUBDIR)cabac_tables.h
 $(SUBDIR)dsddec.o: $(SUBDIR)dsd_tables.h
 $(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
 $(SUBDIR)sinewin.o: $(SUBDIR)sinewin_tables.h
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c
index 803c81c..81a75dd 100644
--- a/libavcodec/cabac.c
+++ b/libavcodec/cabac.c
@@ -32,55 +32,7 @@
 #include "cabac.h"
 #include "cabac_functions.h"
 
-uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63];
-
-static const uint8_t lps_range[64][4]= {
-{128,176,208,240}, {128,167,197,227}, {128,158,187,216}, {123,150,178,205},
-{116,142,169,195}, {111,135,160,185}, {105,128,152,175}, {100,122,144,166},
-{ 95,116,137,158}, { 90,110,130,150}, { 85,104,123,142}, { 81, 99,117,135},
-{ 77, 94,111,128}, { 73, 89,105,122}, { 69, 85,100,116}, { 66, 80, 95,110},
-{ 62, 76, 90,104}, { 59, 72, 86, 99}, { 56, 69, 81, 94}, { 53, 65, 77, 89},
-{ 51, 62, 73, 85}, { 48, 59, 69, 80}, { 46, 56, 66, 76}, { 43, 53, 63, 72},
-{ 41, 50, 59, 69}, { 39, 48, 56, 65}, { 37, 45, 54, 62}, { 35, 43, 51, 59},
-{ 33, 41, 48, 56}, { 32, 39, 46, 53}, { 30, 37, 43, 50}, { 29, 35, 41, 48},
-{ 27, 33, 39, 45}, { 26, 31, 37, 43}, { 24, 30, 35, 41}, { 23, 28, 33, 39},
-{ 22, 27, 32, 37}, { 21, 26, 30, 35}, { 20, 24, 29, 33}, { 19, 23, 27, 31},
-{ 18, 22, 26, 30}, { 17, 21, 25, 28}, { 16, 20, 23, 27}, { 15, 19, 22, 25},
-{ 14, 18, 21, 24}, { 14, 17, 20, 23}, { 13, 16, 19, 22}, { 12, 15, 18, 21},
-{ 12, 14, 17, 20}, { 11, 14, 16, 19}, { 11, 13, 15, 18}, { 10, 12, 15, 17},
-{ 10, 12, 14, 16}, {  9, 11, 13, 15}, {  9, 11, 12, 14}, {  8, 10, 12, 14},
-{  8,  9, 11, 13}, {  7,  9, 11, 12}, {  7,  9, 10, 12}, {  7,  8, 10, 11},
-{  6,  8,  9, 11}, {  6,  7,  9, 10}, {  6,  7,  8,  9}, {  2,  2,  2,  2},
-};
-
-static const uint8_t mps_state[64]= {
-  1, 2, 3, 4, 5, 6, 7, 8,
-  9,10,11,12,13,14,15,16,
- 17,18,19,20,21,22,23,24,
- 25,26,27,28,29,30,31,32,
- 33,34,35,36,37,38,39,40,
- 41,42,43,44,45,46,47,48,
- 49,50,51,52,53,54,55,56,
- 57,58,59,60,61,62,62,63,
-};
-
-static const uint8_t lps_state[64]= {
-  0, 0, 1, 2, 2, 4, 4, 5,
-  6, 7, 8, 9, 9,11,11,12,
- 13,13,15,15,16,16,18,18,
- 19,19,21,21,22,22,23,24,
- 24,25,26,26,27,27,28,29,
- 29,30,30,30,31,32,32,33,
- 33,33,34,34,35,35,35,36,
- 36,36,37,37,37,38,38,63,
-};
-
-static const uint8_t last_coeff_flag_offset_8x8[63] = {
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8
-};
+#include "cabac_tablegen.h"
 
 /**
  *
@@ -116,34 +68,12 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t 
*buf, int buf_size){
 
 void ff_init_cabac_states(void)
 {
-int i, j;
 static int initialized = 0;
 
 if (initialized)
 return;
 
-for (i = 0; i < 512; i++)
-ff_h264_norm_shift[i] = i ? 8 - av_log2(i) : 9;
-
-for(i=0; i<64; i++){
-for(j=0

[FFmpeg-cvslog] RELEASE_NOTES: mention the ffplay -autoexit behaviour change

2014-09-06 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Sat Sep  6 21:28:53 
2014 +0200| [d8f08047dc9a0cc99268db91bc17643010e7f517] | committer: Clément 
Bœsch

RELEASE_NOTES: mention the ffplay -autoexit behaviour change

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

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

diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 113cc5e..d5bd6d7 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -59,3 +59,4 @@
   • libmodplug is now detected through pkg-config
   • HTML documentation generation through texi2html is deprecated in
 favor of makeinfo/texi2any
+  • ffplay now exits by default at the end of playback

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


[FFmpeg-cvslog] avcodec/hevc_ps: Always initialize backup in decode_vui()

2014-09-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Sep  6 
12:40:34 2014 +0200| [cbb277988afc7032e632393e2c96a70d4389ac4f] | committer: 
Michael Niedermayer

avcodec/hevc_ps: Always initialize backup in decode_vui()

Fixes CID1237283

Reviewed-by: Christophe Gisquet 
Signed-off-by: Michael Niedermayer 

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

 libavcodec/hevc_ps.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 365652c..c17ca04 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -527,8 +527,7 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
 
 vui->default_display_window_flag = get_bits1(gb);
 // Backup context in case an alternate header is detected
-if( get_bits_left(gb) >= 66)
-memcpy(&backup, gb, sizeof(backup));
+memcpy(&backup, gb, sizeof(backup));
 
 if (vui->default_display_window_flag) {
 //TODO: * 2 is only valid for 420

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


[FFmpeg-cvslog] avfilter/af_silenceremove: remove dead code

2014-09-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Sep  6 
12:56:03 2014 +0200| [1b2390e2bcdd09a6a3d614d1926ba0f540ea70d9] | committer: 
Michael Niedermayer

avfilter/af_silenceremove: remove dead code

Fixes CID1237284

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
index 3f6cb7a..02b64ce 100644
--- a/libavfilter/af_silenceremove.c
+++ b/libavfilter/af_silenceremove.c
@@ -335,13 +335,10 @@ silence_copy:
 flush(out, outlink, &nb_samples_written, &ret);
 goto silence_trim;
 }
-} else {
-s->mode = SILENCE_COPY_FLUSH;
-flush(out, outlink, &nb_samples_written, &ret);
-goto silence_copy_flush;
 }
+s->mode = SILENCE_COPY_FLUSH;
 flush(out, outlink, &nb_samples_written, &ret);
-break;
+goto silence_copy_flush;
 }
 }
 }

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


[FFmpeg-cvslog] avformat/swfdec: Do not change the pixel format

2014-09-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
16:42:33 2014 +0200| [c2430304dfb3cc0e3a59ce6d1b59ebdcc934a0c2] | committer: 
Michael Niedermayer

avformat/swfdec: Do not change the pixel format

This is currently not supported
Fixes part of Ticket 3539

Signed-off-by: Michael Niedermayer 

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

 libavformat/swfdec.c |   13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index ca2a1c4..528bc23 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -289,6 +289,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 const int bmp_fmt = avio_r8(pb);
 const int width   = avio_rl16(pb);
 const int height  = avio_rl16(pb);
+int pix_fmt;
 
 len -= 2+1+2+2;
 
@@ -367,7 +368,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 
 switch (bmp_fmt) {
 case 3:
-st->codec->pix_fmt = AV_PIX_FMT_PAL8;
+pix_fmt = AV_PIX_FMT_PAL8;
 for (i = 0; i < colormapsize; i++)
 if (alpha_bmp)  colormap[i] = buf[3]<<24 | AV_RB24(buf + 
4*i);
 elsecolormap[i] = 0xffU <<24 | AV_RB24(buf + 
3*i);
@@ -379,14 +380,20 @@ static int swf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 memcpy(pal, colormap, AVPALETTE_SIZE);
 break;
 case 4:
-st->codec->pix_fmt = AV_PIX_FMT_RGB555;
+pix_fmt = AV_PIX_FMT_RGB555;
 break;
 case 5:
-st->codec->pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : 
AV_PIX_FMT_0RGB;
+pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB;
 break;
 default:
 av_assert0(0);
 }
+if (st->codec->pix_fmt != AV_PIX_FMT_NONE && st->codec->pix_fmt != 
pix_fmt) {
+av_log(s, AV_LOG_ERROR, "pixel format change unsupported\n");
+res = AVERROR_PATCHWELCOME;
+goto bitmap_end;
+}
+st->codec->pix_fmt = pix_fmt;
 
 if (linesize * height > pkt->size) {
 res = AVERROR_INVALIDDATA;

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


[FFmpeg-cvslog] avcodec/h264: Allow partial escaping

2014-09-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun Sep  7 
01:42:28 2014 +0200| [033a5334badd8af48f13c6fd1e6827f8e3f2c2f3] | committer: 
Michael Niedermayer

avcodec/h264: Allow partial escaping

Fixes Ticket3923

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 0fcc769..4b7ce9c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -248,7 +248,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const 
uint8_t *src,
 
 #define STARTCODE_TEST  \
 if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
-if (src[i + 2] != 3) {  \
+if (src[i + 2] != 3 && src[i + 2] != 0) {   \
 /* startcode, so we must be past the end */ \
 length = i; \
 }   \
@@ -320,7 +320,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const 
uint8_t *src,
 if (src[si + 2] > 3) {
 dst[di++] = src[si++];
 dst[di++] = src[si++];
-} else if (src[si] == 0 && src[si + 1] == 0) {
+} else if (src[si] == 0 && src[si + 1] == 0 && src[si + 2] != 0) {
 if (src[si + 2] == 3) { // escape
 dst[di++]  = 0;
 dst[di++]  = 0;

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


[FFmpeg-cvslog] ffmpeg: Copy extradata if it has been initialized later from the encoder

2014-09-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Sep  6 
04:42:48 2014 +0200| [ab84effdeda931a74d8503891488ed538619a5d3] | committer: 
Michael Niedermayer

ffmpeg: Copy extradata if it has been initialized later from the encoder

Fixes Ticket3909

Signed-off-by: Michael Niedermayer 

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

 ffmpeg.c |8 
 1 file changed, 8 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 220816b..0807eec 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -590,6 +590,14 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, 
OutputStream *ost)
 AVCodecContext  *avctx = ost->st->codec;
 int ret;
 
+if (!ost->st->codec->extradata_size && ost->enc_ctx->extradata_size) {
+ost->st->codec->extradata = av_mallocz(ost->enc_ctx->extradata_size + 
FF_INPUT_BUFFER_PADDING_SIZE);
+if (ost->st->codec->extradata) {
+memcpy(ost->st->codec->extradata, ost->enc_ctx->extradata, 
ost->enc_ctx->extradata_size);
+ost->st->codec->extradata_size = ost->enc_ctx->extradata_size;
+}
+}
+
 if ((avctx->codec_type == AVMEDIA_TYPE_VIDEO && video_sync_method == 
VSYNC_DROP) ||
 (avctx->codec_type == AVMEDIA_TYPE_AUDIO && audio_sync_method < 0))
 pkt->pts = pkt->dts = AV_NOPTS_VALUE;

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