[FFmpeg-cvslog] avcodec/wma: Print more details in case of spectral RLE overflows

2015-01-12 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Mon Jan 12 
13:56:13 2015 +0100| [365ef88d5df4756942324b633cc439154e468276] | committer: 
Michael Niedermayer

avcodec/wma: Print more details in case of spectral RLE overflows

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

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

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

diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index 841a2be..fa5c887 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -487,7 +487,11 @@ int ff_wma_run_level_decode(AVCodecContext *avctx, 
GetBitContext *gb,
 }
 /** NOTE: EOB can be omitted */
 if (offset  num_coefs) {
-av_log(avctx, AV_LOG_ERROR, overflow in spectral RLE, ignoring\n);
+av_log(avctx, AV_LOG_ERROR,
+   overflow (%d  %d) in spectral RLE, ignoring\n,
+   offset,
+   num_coefs
+  );
 return -1;
 }
 

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


Re: [FFmpeg-cvslog] Adding Closed caption Support

2015-01-12 Thread Clément Bœsch
On Sun, Jan 11, 2015 at 11:15:35PM +0100, Anshul Maheshwari wrote:
 ffmpeg | branch: master | Anshul Maheshwari anshul.ffm...@gmail.com | Tue 
 Jan  6 12:41:34 2015 +0530| [4b6262610bd516320b3fca71ef03ff9bf1aa5066] | 
 committer: Michael Niedermayer
 
 Adding Closed caption Support
 
 Signed-off-by: Anshul Maheshwari anshul.ffm...@gmail.com
 
 To test Closed caption use following command
 ffmpeg -f lavfi -i movie=input.ts[out0+subcc] -map s output.srt
 Signed-off-by: Michael Niedermayer michae...@gmx.at

Sorry for the late review, I wasn't available.

Q: how does it compare to libzvbi, do we still need libzvbi (especially
the text part)?

 
  http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b6262610bd516320b3fca71ef03ff9bf1aa5066
 ---
 
  libavcodec/Makefile   |1 +
  libavcodec/allcodecs.c|1 +
  libavcodec/ccaption_dec.c |  529 
 +
  3 files changed, 531 insertions(+)
 

Where is the FATE test for this?

 diff --git a/libavcodec/Makefile b/libavcodec/Makefile
 index 6b85420..80ee389 100644
 --- a/libavcodec/Makefile
 +++ b/libavcodec/Makefile
 @@ -173,6 +173,7 @@ OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o
  OBJS-$(CONFIG_C93_DECODER) += c93.o
  OBJS-$(CONFIG_CAVS_DECODER)+= cavs.o cavsdec.o cavsdsp.o \
cavsdata.o mpeg12data.o
 +OBJS-$(CONFIG_CCAPTION_DECODER)+= ccaption_dec.o
  OBJS-$(CONFIG_CDGRAPHICS_DECODER)  += cdgraphics.o
  OBJS-$(CONFIG_CDXL_DECODER)+= cdxl.o
  OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
 diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
 index 512711e..29b45f3 100644
 --- a/libavcodec/allcodecs.c
 +++ b/libavcodec/allcodecs.c
 @@ -481,6 +481,7 @@ void avcodec_register_all(void)
  /* subtitles */
  REGISTER_ENCDEC (SSA,   ssa);
  REGISTER_ENCDEC (ASS,   ass);
 +REGISTER_DECODER(CCAPTION,  ccaption);
  REGISTER_ENCDEC (DVBSUB,dvbsub);
  REGISTER_ENCDEC (DVDSUB,dvdsub);
  REGISTER_DECODER(JACOSUB,   jacosub);
 diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
 new file mode 100644
 index 000..a92c609
 --- /dev/null
 +++ b/libavcodec/ccaption_dec.c
 @@ -0,0 +1,529 @@
 +/*
 + * Closed Caption Decoding
 + * Copyright (c) 2015 Anshul Maheshwari
 + *
 + * 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 avcodec.h
 +#include ass.h
 +#include libavutil/opt.h
 +

 +#define CHAR_DEBUG

We have av_dlog() for that purpose.

 +#define SCREEN_ROWS 15
 +#define SCREEN_COLUMNS 32
 +
 +#define SET_FLAG(var, val) ( var |= ( 1  (val) ) )
 +#define UNSET_FLAG(var, val) ( var =  ~( 1  (val)) )
 +#define CHECK_FLAG(var, val) ( (var)  (1  (val) ) )
 +
 +/*
 + * TODO list
 + * 1) handle font and color completely
 + */
 +enum cc_mode {
 +CCMODE_POPON,
 +CCMODE_PAINTON,
 +CCMODE_ROLLUP_2,
 +CCMODE_ROLLUP_3,
 +CCMODE_ROLLUP_4,
 +CCMODE_TEXT,
 +};
 +
 +enum cc_color_code
 +{

The style is broken all over the file, but please at least make it
consistent with the surrounding one.

 +CCCOL_WHITE,
 +CCCOL_GREEN,
 +CCCOL_BLUE,
 +CCCOL_CYAN,
 +CCCOL_RED,
 +CCCOL_YELLOW,
 +CCCOL_MAGENTA,
 +CCCOL_USERDEFINED,
 +CCCOL_BLACK,
 +CCCOL_TRANSPARENT

note: you should keep a trailing comma at the end of such structure to
reduce later diffs.

 +};
 +
 +enum cc_font
 +{
 +CCFONT_REGULAR,
 +CCFONT_ITALICS,
 +CCFONT_UNDERLINED,
 +CCFONT_UNDERLINED_ITALICS
 +};
 +
 +static const unsigned char pac2_attribs[][3] = // Color, font, ident
 +{
 +{ CCCOL_WHITE, CCFONT_REGULAR, 0 },  // 0x40 || 0x60
 +{ CCCOL_WHITE, CCFONT_UNDERLINED, 0 },  // 0x41 || 0x61
 +{ CCCOL_GREEN, CCFONT_REGULAR, 0 },  // 0x42 || 0x62
 +{ CCCOL_GREEN, CCFONT_UNDERLINED, 0 },  // 0x43 || 0x63
 +{ CCCOL_BLUE, CCFONT_REGULAR, 0 },  // 0x44 || 0x64
 +{ CCCOL_BLUE, CCFONT_UNDERLINED, 0 },  // 0x45 || 0x65
 +{ CCCOL_CYAN, CCFONT_REGULAR, 0 },  // 0x46 || 0x66
 +{ CCCOL_CYAN, CCFONT_UNDERLINED, 0 },  // 0x47 || 0x67
 +{ CCCOL_RED, CCFONT_REGULAR, 0 },  // 0x48 || 0x68
 +{ CCCOL_RED, CCFONT_UNDERLINED, 0 },  // 

[FFmpeg-cvslog] avcodec/ccaption_dec: Fix typos and cosmetics

2015-01-12 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Mon Jan 12 
13:43:53 2015 +0100| [4f664d8aae8ccca33f39c2515484bd03e9d3f80d] | committer: 
Michael Niedermayer

avcodec/ccaption_dec: Fix typos and cosmetics

Found-by: ubitux
(rest of found stuff left to the author to decide which way to fix)

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

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

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

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index a92c609..e05468f 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -55,7 +55,7 @@ enum cc_color_code
 CCCOL_MAGENTA,
 CCCOL_USERDEFINED,
 CCCOL_BLACK,
-CCCOL_TRANSPARENT
+CCCOL_TRANSPARENT,
 };
 
 enum cc_font
@@ -63,7 +63,7 @@ enum cc_font
 CCFONT_REGULAR,
 CCFONT_ITALICS,
 CCFONT_UNDERLINED,
-CCFONT_UNDERLINED_ITALICS
+CCFONT_UNDERLINED_ITALICS,
 };
 
 static const unsigned char pac2_attribs[][3] = // Color, font, ident
@@ -100,9 +100,9 @@ static const unsigned char pac2_attribs[][3] = // Color, 
font, ident
 { CCCOL_WHITE, CCFONT_UNDERLINED, 24 }, // 0x5d || 0x7d
 { CCCOL_WHITE, CCFONT_REGULAR, 28 }, // 0x5e || 0x7e
 { CCCOL_WHITE, CCFONT_UNDERLINED, 28 }  // 0x5f || 0x7f
-/* total 32 entry */
+/* total 32 entries */
 };
-/* 0-255 needs 256 space */
+/* 0-255 needs 256 spaces */
 static const uint8_t parity_table[256] = { 0, 1, 1, 0, 1, 0, 0, 1,
1, 0, 0, 1, 0, 1, 1, 0,
1, 0, 0, 1, 0, 1, 1, 0,
@@ -141,7 +141,7 @@ struct Screen {
 /*
  * Bitmask of used rows; if a bit is not set, the
  * corresponding row is not used.
- * for setting row 1  use row | (0  1)
+ * for setting row 1  use row | (1  0)
  * for setting row 15 use row | (1  14)
  */
 int16_t  row_used;
@@ -212,7 +212,7 @@ static int write_char (CCaptionSubContext *ctx, char 
*row,uint8_t col, char ch)
 return 0;
 }
 else {
-av_log(ctx, AV_LOG_WARNING,Data Ignored since exciding screen 
width\n);
+av_log(ctx, AV_LOG_WARNING,Data Ignored since exceeding screen 
width\n);
 return AVERROR_INVALIDDATA;
 }
 }

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


[FFmpeg-cvslog] libavformat/mxfdec.c: read project_name metadata

2015-01-12 Thread Mark Reid
ffmpeg | branch: master | Mark Reid mindm...@gmail.com | Mon Jan  5 16:53:05 
2015 -0800| [b08b5f4be2cca4a5e095e268947dfa6207399bc3] | committer: Michael 
Niedermayer

libavformat/mxfdec.c: read project_name metadata

MXF files generated by Media Composer or LibMXF can contain a
project name property in the Preface. Lots of existing samples have them.

http://samples.ffmpeg.org/MXF/issue2160/PW0805A0V01.4C5B5636.EFA330.mxf
project_name: DNX145 PW Test

http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3450/WriteAvidMXFgenerated/5502_0010_v1.mxf
project_name: Rombus

http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3100/1sec_mxf_test_Video5270C795.mxf
project_name: NVB_DOOD

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

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

 libavformat/mxfdec.c |   15 +++
 1 file changed, 15 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 4715169..23d9c73 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -279,6 +279,7 @@ static const uint8_t mxf_encrypted_triplet_key[]   
= { 0x06,0x0e,0x2b,0x
 static const uint8_t mxf_encrypted_essence_container[] = { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 
};
 static const uint8_t mxf_random_index_pack_key[]   = { 
0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x11,0x01,0x00 
};
 static const uint8_t mxf_sony_mpeg4_extradata[]= { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 
};
+static const uint8_t mxf_avid_project_name[]   = { 
0xa5,0xfb,0x7b,0x25,0xf6,0x15,0x94,0xb9,0x62,0xfc,0x37,0x17,0x49,0x2d,0x42,0xbf 
};
 
 #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
 
@@ -2087,6 +2088,19 @@ static int mxf_read_identification_metadata(void *arg, 
AVIOContext *pb, int tag,
 return 0;
 }
 
+static int mxf_read_preface_metadata(void *arg, AVIOContext *pb, int tag, int 
size, UID uid, int64_t klv_offset)
+{
+MXFContext *mxf = arg;
+AVFormatContext *s = mxf-fc;
+int ret;
+char *str = NULL;
+
+if (tag = 0x8000  (IS_KLV_KEY(uid, mxf_avid_project_name))) {
+SET_STR_METADATA(pb, project_name, str);
+}
+return 0;
+}
+
 static const MXFMetadataReadTableEntry mxf_metadata_read_table[] = {
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x05,0x01,0x00 
}, mxf_read_primer_pack },
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 
}, mxf_read_partition_pack },
@@ -2099,6 +2113,7 @@ static const MXFMetadataReadTableEntry 
mxf_metadata_read_table[] = {
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x04,0x00 
}, mxf_read_partition_pack },
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x02,0x00 
}, mxf_read_partition_pack },
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x04,0x00 
}, mxf_read_partition_pack },
+{ { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x2f,0x00 
}, mxf_read_preface_metadata },
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x30,0x00 
}, mxf_read_identification_metadata },
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x18,0x00 
}, mxf_read_content_storage, 0, AnyType },
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x37,0x00 
}, mxf_read_package, sizeof(MXFPackage), SourcePackage },

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


[FFmpeg-cvslog] avcodec/snow: Use av_malloc_array()

2015-01-12 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Mon Jan 12 
23:14:40 2015 +0100| [13871a95d0e4af15b771040254079da908a34d6b] | committer: 
Michael Niedermayer

avcodec/snow: Use av_malloc_array()

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

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

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

diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 83db3c7..d5a620b 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -594,9 +594,9 @@ static int halfpel_interpol(SnowContext *s, uint8_t 
*halfpel[4][4], AVFrame *fra
 int ls= frame-linesize[p];
 uint8_t *src= frame-data[p];
 
-halfpel[1][p] = (uint8_t*) av_malloc(ls * (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
-halfpel[2][p] = (uint8_t*) av_malloc(ls * (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
-halfpel[3][p] = (uint8_t*) av_malloc(ls * (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
+halfpel[1][p] = (uint8_t*) av_malloc_array(ls, (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
+halfpel[2][p] = (uint8_t*) av_malloc_array(ls, (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
+halfpel[3][p] = (uint8_t*) av_malloc_array(ls, (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
 if (!halfpel[1][p] || !halfpel[2][p] || !halfpel[3][p])
 return AVERROR(ENOMEM);
 

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


[FFmpeg-cvslog] avcodec/shorten: use av_reallocp_array()

2015-01-12 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Mon Jan 12 
23:27:18 2015 +0100| [fbe8672e158a640291c964eef51cbb2924af6348] | committer: 
Michael Niedermayer

avcodec/shorten: use av_reallocp_array()

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

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

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

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 4c9cc06..deae0fa 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -136,12 +136,12 @@ static int allocate_buffers(ShortenContext *s)
 return AVERROR_INVALIDDATA;
 }
 
-if ((err = av_reallocp(s-offset[chan],
-   sizeof(int32_t) *
+if ((err = av_reallocp_array(s-offset[chan],
+   sizeof(int32_t),
FFMAX(1, s-nmean)))  0)
 return err;
 
-if ((err = av_reallocp(s-decoded_base[chan], (s-blocksize + 
s-nwrap) *
+if ((err = av_reallocp_array(s-decoded_base[chan], (s-blocksize + 
s-nwrap),
sizeof(s-decoded_base[0][0])))  0)
 return err;
 for (i = 0; i  s-nwrap; i++)
@@ -149,7 +149,7 @@ static int allocate_buffers(ShortenContext *s)
 s-decoded[chan] = s-decoded_base[chan] + s-nwrap;
 }
 
-if ((err = av_reallocp(s-coeffs, s-nwrap * sizeof(*s-coeffs)))  0)
+if ((err = av_reallocp_array(s-coeffs, s-nwrap, sizeof(*s-coeffs)))  
0)
 return err;
 
 return 0;

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


[FFmpeg-cvslog] avcodec/opus_imdct: Use av_malloc_array()

2015-01-12 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Mon Jan 12 
23:11:44 2015 +0100| [24222cc1d5caaeaad8df69904bc546bf9d34caa3] | committer: 
Michael Niedermayer

avcodec/opus_imdct: Use av_malloc_array()

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

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

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

diff --git a/libavcodec/opus_imdct.c b/libavcodec/opus_imdct.c
index 0a6fca9..126e882 100644
--- a/libavcodec/opus_imdct.c
+++ b/libavcodec/opus_imdct.c
@@ -105,11 +105,11 @@ av_cold int ff_celt_imdct_init(CeltIMDCTContext **ps, int 
N)
 s-len4 = len2 / 2;
 s-len2 = len2;
 
-s-tmp  = av_malloc(len * 2 * sizeof(*s-tmp));
+s-tmp  = av_malloc_array(len, 2 * sizeof(*s-tmp));
 if (!s-tmp)
 goto fail;
 
-s-twiddle_exptab  = av_malloc(s-len4 * sizeof(*s-twiddle_exptab));
+s-twiddle_exptab  = av_malloc_array(s-len4, sizeof(*s-twiddle_exptab));
 if (!s-twiddle_exptab)
 goto fail;
 

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


[FFmpeg-cvslog] avcodec/snow: Fix av_malloc* failure checks

2015-01-12 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Mon Jan 12 
23:15:32 2015 +0100| [56c7e1059ab993da68caa3847372f3fb5e010dc4] | committer: 
Michael Niedermayer

avcodec/snow: Fix av_malloc* failure checks

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

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

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

diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index d5a620b..c4f7004 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -594,11 +594,18 @@ static int halfpel_interpol(SnowContext *s, uint8_t 
*halfpel[4][4], AVFrame *fra
 int ls= frame-linesize[p];
 uint8_t *src= frame-data[p];
 
-halfpel[1][p] = (uint8_t*) av_malloc_array(ls, (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
-halfpel[2][p] = (uint8_t*) av_malloc_array(ls, (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
-halfpel[3][p] = (uint8_t*) av_malloc_array(ls, (h + 2 * EDGE_WIDTH)) + 
EDGE_WIDTH * (1 + ls);
-if (!halfpel[1][p] || !halfpel[2][p] || !halfpel[3][p])
+halfpel[1][p] = av_malloc_array(ls, (h + 2 * EDGE_WIDTH));
+halfpel[2][p] = av_malloc_array(ls, (h + 2 * EDGE_WIDTH));
+halfpel[3][p] = av_malloc_array(ls, (h + 2 * EDGE_WIDTH));
+if (!halfpel[1][p] || !halfpel[2][p] || !halfpel[3][p]) {
+av_freep(halfpel[1][p]);
+av_freep(halfpel[2][p]);
+av_freep(halfpel[3][p]);
 return AVERROR(ENOMEM);
+}
+halfpel[1][p] += EDGE_WIDTH * (1 + ls);
+halfpel[2][p] += EDGE_WIDTH * (1 + ls);
+halfpel[3][p] += EDGE_WIDTH * (1 + ls);
 
 halfpel[0][p]= src;
 for(y=0; yh; y++){

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


[FFmpeg-cvslog] libavformat/mxfdec.c: export the full UMID as metadata

2015-01-12 Thread Mark Reid
ffmpeg | branch: master | Mark Reid mindm...@gmail.com | Fri Jan  9 18:05:27 
2015 -0800| [b23a8668448d99b4c59daad3d485f17e182f43a3] | committer: Michael 
Niedermayer

libavformat/mxfdec.c: export the full UMID as metadata

Previous version reviewed-by: tim nicholson

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

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

 libavformat/mxfdec.c |   38 +++---
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 23d9c73..646a3ea 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -200,6 +200,7 @@ typedef struct {
 UID uid;
 enum MXFMetadataSetType type;
 UID package_uid;
+UID package_ul;
 UID *tracks_refs;
 int tracks_count;
 MXFDescriptor *descriptor; /* only one */
@@ -841,8 +842,8 @@ static int mxf_read_package(void *arg, AVIOContext *pb, int 
tag, int size, UID u
 avio_read(pb, (uint8_t *)package-tracks_refs, package-tracks_count * 
sizeof(UID));
 break;
 case 0x4401:
-/* UMID, only get last 16 bytes */
-avio_skip(pb, 16);
+/* UMID */
+avio_read(pb, package-package_ul, 16);
 avio_read(pb, package-package_uid, 16);
 break;
 case 0x4701:
@@ -1489,11 +1490,34 @@ static int mxf_uid_to_str(UID uid, char **str)
 return 0;
 }
 
-static int mxf_add_uid_metadata(AVDictionary **pm, const char *key, UID uid)
+static int mxf_umid_to_str(UID ul, UID uid, char **str)
+{
+int i;
+char *p;
+p = *str = av_mallocz(sizeof(UID) * 4 + 2 + 1);
+if (!p)
+return AVERROR(ENOMEM);
+snprintf(p, 2 + 1, 0x);
+p += 2;
+for (i = 0; i  sizeof(UID); i++) {
+snprintf(p, 2 + 1, %.2X, ul[i]);
+p += 2;
+
+}
+for (i = 0; i  sizeof(UID); i++) {
+snprintf(p, 2 + 1, %.2X, uid[i]);
+p += 2;
+}
+return 0;
+}
+
+static int mxf_add_umid_metadata(AVDictionary **pm, const char *key, 
MXFPackage* package)
 {
 char *str;
 int ret;
-if ((ret = mxf_uid_to_str(uid, str))  0)
+if (!package)
+return 0;
+if ((ret = mxf_umid_to_str(package-package_ul, package-package_uid, 
str))  0)
 return ret;
 av_dict_set(pm, key, str, AV_DICT_DONT_STRDUP_VAL);
 return 0;
@@ -1634,7 +1658,7 @@ static int mxf_parse_physical_source_package(MXFContext 
*mxf, MXFTrack *source_t
 if (!(physical_package = mxf_resolve_source_package(mxf, 
sourceclip-source_package_uid)))
 break;
 
-mxf_add_uid_metadata(st-metadata, reel_uid, 
physical_package-package_uid);
+mxf_add_umid_metadata(st-metadata, reel_umid, physical_package);
 
 /* the name of physical source package is name of the reel or tape */
 if (physical_package-name  physical_package-name[0])
@@ -1691,7 +1715,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 return AVERROR_INVALIDDATA;
 }
 
-mxf_add_uid_metadata(mxf-fc-metadata, material_package_uid, 
material_package-package_uid);
+mxf_add_umid_metadata(mxf-fc-metadata, material_package_umid, 
material_package);
 if (material_package-name  material_package-name[0])
 av_dict_set(mxf-fc-metadata, material_package_name, 
material_package-name, 0);
 
@@ -1859,7 +1883,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 }
 av_log(mxf-fc, AV_LOG_VERBOSE, \n);
 
-mxf_add_uid_metadata(st-metadata, file_package_uid, 
source_package-package_uid);
+mxf_add_umid_metadata(st-metadata, file_package_umid, 
source_package);
 if (source_package-name  source_package-name[0])
 av_dict_set(st-metadata, file_package_name, 
source_package-name, 0);
 

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


[FFmpeg-cvslog] avutil/opencl: don't include config.h

2015-01-12 Thread James Almer
ffmpeg | branch: master | James Almer jamr...@gmail.com | Mon Jan 12 13:48:52 
2015 -0300| [3aaff803489af21011b8cf03847e17b29643c922] | committer: James Almer

avutil/opencl: don't include config.h

It's not an installed header.

Tested-by: Thilo Borgmann thilo.borgm...@mail.de
Tested-by: Wei Gao highgod0...@gmail.com
Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: James Almer jamr...@gmail.com

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

 configure  |2 --
 libavutil/opencl.h |7 +++
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 94f9432..a0dbafb 100755
--- a/configure
+++ b/configure
@@ -1642,7 +1642,6 @@ HEADERS_LIST=
 asm_types_h
 cdio_paranoia_h
 cdio_paranoia_paranoia_h
-CL_cl_h
 dev_bktr_ioctl_bt848_h
 dev_bktr_ioctl_meteor_h
 dev_ic_bt8xx_h
@@ -4775,7 +4774,6 @@ check_func_headers glob.h glob
 enabled xlib 
 check_func_headers X11/Xlib.h X11/extensions/Xvlib.h XvGetPortAttribute 
-lXv -lX11 -lXext
 
-check_header cl/cl.h
 check_header direct.h
 check_header dlfcn.h
 check_header dxva.h
diff --git a/libavutil/opencl.h b/libavutil/opencl.h
index 4655cba..0b7b8d4 100644
--- a/libavutil/opencl.h
+++ b/libavutil/opencl.h
@@ -32,11 +32,10 @@
 #ifndef LIBAVUTIL_OPENCL_H
 #define LIBAVUTIL_OPENCL_H
 
-#include config.h
-#if HAVE_CL_CL_H
-#include CL/cl.h
-#else
+#ifdef __APPLE__
 #include OpenCL/cl.h
+#else
+#include CL/cl.h
 #endif
 #include stdint.h
 #include dict.h

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


[FFmpeg-cvslog] doc/general: update libilbc link

2015-01-12 Thread Lou Logan
ffmpeg | branch: master | Lou Logan l...@lrcd.com | Mon Jan 12 09:32:06 2015 
-0900| [e9f8780381feb7a62939018149e5153dfffaf921] | committer: Lou Logan

doc/general: update libilbc link

Signed-off-by: Lou Logan l...@lrcd.com

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

 doc/general.texi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/general.texi b/doc/general.texi
index b4c9325..49f5ade 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -151,7 +151,7 @@ by Google as part of the WebRTC project. libilbc is a 
packaging friendly
 copy of the iLBC codec. FFmpeg can make use of the libilbc library for
 iLBC encoding and decoding.
 
-Go to @url{https://github.com/dekkers/libilbc} and follow the instructions for
+Go to @url{https://github.com/TimothyGu/libilbc} and follow the instructions 
for
 installing the library. Then pass @code{--enable-libilbc} to configure to
 enable it.
 

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


[FFmpeg-cvslog] x86/swr: add SSE/AVX unpack_6ch functions

2015-01-12 Thread James Almer
ffmpeg | branch: master | James Almer jamr...@gmail.com | Mon Jan 12 15:32:24 
2015 -0300| [59ac93f6af3e4e148e744e5820a1d56fadd635d6] | committer: James Almer

x86/swr: add SSE/AVX unpack_6ch functions

int32/float only

Reviewed-by: Michael Niedermayer michae...@gmx.at
Signed-off-by: James Almer jamr...@gmail.com

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

 libswresample/x86/audio_convert.asm|   89 
 libswresample/x86/audio_convert_init.c |   16 ++
 2 files changed, 105 insertions(+)

diff --git a/libswresample/x86/audio_convert.asm 
b/libswresample/x86/audio_convert.asm
index 07d7458..1617e0b 100644
--- a/libswresample/x86/audio_convert.asm
+++ b/libswresample/x86/audio_convert.asm
@@ -305,6 +305,79 @@ pack_6ch_%2_to_%1_u_int %+ SUFFIX
 %endif
 %endmacro
 
+%macro UNPACK_6CH 5-7
+cglobal unpack_6ch_%2_to_%1_%3, 2, 8, 8, dst, src, dst1, dst2, dst3, dst4, 
dst5, len
+%if ARCH_X86_64
+mov lend, r2d
+%else
+%define lend dword r2m
+%endif
+movdst1q, [dstq+1*gprsize]
+movdst2q, [dstq+2*gprsize]
+movdst3q, [dstq+3*gprsize]
+movdst4q, [dstq+4*gprsize]
+movdst5q, [dstq+5*gprsize]
+mov dstq, [dstq]
+mov srcq, [srcq]
+%ifidn %3, a
+test dstq, mmsize-1
+jne unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+test srcq, mmsize-1
+jne unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+test dst1q, mmsize-1
+jne unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+test dst2q, mmsize-1
+jne unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+test dst3q, mmsize-1
+jne unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+test dst4q, mmsize-1
+jne unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+test dst5q, mmsize-1
+jne unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+%else
+unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+%endif
+subdst1q, dstq
+subdst2q, dstq
+subdst3q, dstq
+subdst4q, dstq
+subdst5q, dstq
+%7 x,x,x,x,m7,x
+.loop:
+mov%3 m0, [srcq   ]
+mov%3 m1, [srcq+16]
+mov%3 m2, [srcq+32]
+mov%3 m3, [srcq+48]
+mov%3 m4, [srcq+64]
+mov%3 m5, [srcq+80]
+
+SBUTTERFLYPS 0, 3, 6
+SBUTTERFLYPS 1, 4, 6
+SBUTTERFLYPS 2, 5, 6
+SBUTTERFLYPS 0, 4, 6
+SBUTTERFLYPS 3, 2, 6
+SBUTTERFLYPS 1, 5, 6
+SWAP 1, 4
+SWAP 2, 3
+
+%6 m0,m1,x,x,m7,m6
+%6 m2,m3,x,x,m7,m6
+%6 m4,m5,x,x,m7,m6
+
+mov %+ %3 %+ ps [dstq  ], m0
+mov %+ %3 %+ ps [dstq+dst1q], m1
+mov %+ %3 %+ ps [dstq+dst2q], m2
+mov %+ %3 %+ ps [dstq+dst3q], m3
+mov %+ %3 %+ ps [dstq+dst4q], m4
+mov %+ %3 %+ ps [dstq+dst5q], m5
+
+add  srcq, mmsize*6
+add  dstq, mmsize
+sub  lend, mmsize/4
+jg .loop
+REP_RET
+%endmacro
+
 %macro PACK_8CH 5-7
 cglobal pack_8ch_%2_to_%1_%3, 2,10,10, ARCH_X86_32*32, dst, src, len, src1, 
src2, src3, src4, src5, src6, src7
 mov dstq, [dstq]
@@ -527,6 +600,9 @@ INIT_XMM sse
 PACK_6CH float, float, u, 2, 2, NOP_N, NOP_N
 PACK_6CH float, float, a, 2, 2, NOP_N, NOP_N
 
+UNPACK_6CH float, float, u, 2, 2, NOP_N, NOP_N
+UNPACK_6CH float, float, a, 2, 2, NOP_N, NOP_N
+
 INIT_XMM sse2
 CONV int32, int16, u, 2, 1, INT16_TO_INT32_N, NOP_N
 CONV int32, int16, a, 2, 1, INT16_TO_INT32_N, NOP_N
@@ -583,6 +659,11 @@ PACK_6CH float, int32, a, 2, 2, INT32_TO_FLOAT_N, 
INT32_TO_FLOAT_INIT
 PACK_6CH int32, float, u, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
 PACK_6CH int32, float, a, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
 
+UNPACK_6CH float, int32, u, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
+UNPACK_6CH float, int32, a, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
+UNPACK_6CH int32, float, u, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
+UNPACK_6CH int32, float, a, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
+
 %if HAVE_ALIGNED_STACK
 PACK_8CH float, float, u, 2, 2, NOP_N, NOP_N
 PACK_8CH float, float, a, 2, 2, NOP_N, NOP_N
@@ -606,11 +687,19 @@ INIT_XMM avx
 PACK_6CH float, float, u, 2, 2, NOP_N, NOP_N
 PACK_6CH float, float, a, 2, 2, NOP_N, NOP_N
 
+UNPACK_6CH float, float, u, 2, 2, NOP_N, NOP_N
+UNPACK_6CH float, float, a, 2, 2, NOP_N, NOP_N
+
 PACK_6CH float, int32, u, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
 PACK_6CH float, int32, a, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
 PACK_6CH int32, float, u, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
 PACK_6CH int32, float, a, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
 
+UNPACK_6CH float, int32, u, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
+UNPACK_6CH float, int32, a, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
+UNPACK_6CH int32, float, u, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
+UNPACK_6CH int32, float, a, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
+
 %if HAVE_ALIGNED_STACK
 PACK_8CH float, float, u, 2, 2, NOP_N, NOP_N
 PACK_8CH float, float, a, 2, 2, NOP_N, NOP_N
diff --git a/libswresample/x86/audio_convert_init.c 
b/libswresample/x86/audio_convert_init.c