Re: [libav-devel] [PATCH] configure: Add a generic catch for all -W options with msvc/icl

2013-09-27 Thread Diego Biurrun
On Wed, Sep 25, 2013 at 07:55:27AM -0400, Alex Smith wrote:
 On Wed, Sep 25, 2013 at 7:00 AM, Diego Biurrun di...@biurrun.de wrote:
  On Tue, Sep 24, 2013 at 11:18:10AM -0400, Alex Smith wrote:
  The latest icl silently ignores certain -W* options.  This is
  effectively a nop on older icl/msvc versions.
  --- a/configure
  +++ b/configure
  @@ -2390,9 +2390,9 @@ msvc_common_flags(){
   # In addition to specifying certain flags under the compiler
   # specific filters, they must be specified here as well or 
  else the
   # generic catch all at the bottom will print the original 
  flag.
  --Wall);;
   -std=c99) ;;
   # Common flags
  +-W*)  ;;
   -fomit-frame-pointer) ;;
   -g)   echo -Z7 ;;
   -fno-math-errno)  ;;
 
  I don't really understand what you are trying to achieve here and
  the log message does not enlighten me.
 
 Instead of issuing a warning (which we then turn into an error) to
 detect unknown command line options, the latest icl just treats them
 as valid but they don't do anything.

So why do you want to filter?

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/3] lavf: add a raw HEVC demuxer

2013-09-27 Thread Anton Khirnov
From: Dirk Farin dirk.fa...@gmail.com

---
 libavformat/Makefile |1 +
 libavformat/allformats.c |1 +
 libavformat/hevcdec.c|   64 ++
 3 files changed, 66 insertions(+)
 create mode 100644 libavformat/hevcdec.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 231e127..8abcb36 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -139,6 +139,7 @@ OBJS-$(CONFIG_H263_DEMUXER)  += h263dec.o 
rawdec.o
 OBJS-$(CONFIG_H263_MUXER)+= rawenc.o
 OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o rawdec.o
 OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
+OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
 OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o
 OBJS-$(CONFIG_IDCIN_DEMUXER) += idcin.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 585cf43..3bdbadf 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -117,6 +117,7 @@ void av_register_all(void)
 REGISTER_MUXDEMUX(H261, h261);
 REGISTER_MUXDEMUX(H263, h263);
 REGISTER_MUXDEMUX(H264, h264);
+REGISTER_DEMUXER (HEVC, hevc);
 REGISTER_MUXDEMUX(HLS,  hls);
 REGISTER_DEMUXER (IDCIN,idcin);
 REGISTER_DEMUXER (IFF,  iff);
diff --git a/libavformat/hevcdec.c b/libavformat/hevcdec.c
new file mode 100644
index 000..f3b0aa3
--- /dev/null
+++ b/libavformat/hevcdec.c
@@ -0,0 +1,64 @@
+/*
+ * RAW HEVC video demuxer
+ * Copyright (c) 2013 Dirk Farin dirk.fa...@gmail.com
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include avformat.h
+#include rawdec.h
+
+#include libavcodec/hevc.h
+
+static int hevc_probe(AVProbeData *p)
+{
+uint32_t code = -1;
+int vps = 0, sps = 0, pps = 0, irap = 0;
+int i;
+
+for (i = 0; i  p-buf_size - 1; i++) {
+code = (code  8) + p-buf[i];
+if ((code  0xff00) == 0x100) {
+uint8_t nal2 = p-buf[i + 1];
+int type = (code  0x7E)  1;
+
+if (code  0x81) // forbidden and reserved zero bits
+return 0;
+
+if (nal2  0xf8) // reserved zero
+return 0;
+
+switch (type) {
+case NAL_VPS:vps++;  break;
+case NAL_SPS:sps++;  break;
+case NAL_PPS:pps++;  break;
+case NAL_BLA_N_LP:
+case NAL_BLA_W_LP:
+case NAL_BLA_W_RADL:
+case NAL_CRA_NUT:
+case NAL_IDR_N_LP:
+case NAL_IDR_W_RADL: irap++; break;
+}
+}
+}
+
+if (vps  sps  pps  irap)
+return AVPROBE_SCORE_EXTENSION + 1; // 1 more than .mpg
+return 0;
+}
+
+FF_DEF_RAWVIDEO_DEMUXER(hevc, raw HEVC video, hevc_probe, hevc,h265,265, 
AV_CODEC_ID_HEVC)
-- 
1.7.10.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [WIP/PATCH] HEVC decoder

2013-09-27 Thread Anton Khirnov
Hi,
The Time Has Come for a new iteration of the HEVC decoder.

Since the last version, I've merged a lot of OpenHEVC changes, so now
all except 3 conformance samples decode correctly. Of those that
don't, one has different luma and chroma bit depths, which I don't think
we need to support until there is a use case for it (likely never).

There's also been a bunch of cleanup, refactoring and fixing by myself,
Luca, Vittorio and other people, so the code should be more pleasant to
read and harder to crash. I already did some basic fuzz testing, some
more will be needed in the future.

Threading is still not there (I hope to work on it soonish), but I think
that should not prevent pushing it.

As previously, more cleanup (cosmetic and otherwise, especially on mvs),
reviews, asm welcome.

-- 
Anton Khirnov
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/3] lavf: add a raw HEVC demuxer

2013-09-27 Thread Diego Biurrun
On Fri, Sep 27, 2013 at 03:26:10PM +0200, Anton Khirnov wrote:
 ---
  libavformat/Makefile |1 +
  libavformat/allformats.c |1 +
  libavformat/hevcdec.c|   64 
 ++
  3 files changed, 66 insertions(+)
  create mode 100644 libavformat/hevcdec.c

Changelog, docs, version bump?

 --- /dev/null
 +++ b/libavformat/hevcdec.c
 @@ -0,0 +1,64 @@
 +
 +#include avformat.h
 +#include rawdec.h
 +
 +#include libavcodec/hevc.h

I think we agreed to order this

#include libavcodec/hevc.h
#include avformat.h
#include rawdec.h

in the header cleanup patchset discussion.

 +switch (type) {
 +case NAL_VPS:vps++;  break;
 +case NAL_SPS:sps++;  break;
 +case NAL_PPS:pps++;  break;
 +case NAL_BLA_N_LP:
 +case NAL_BLA_W_LP:
 +case NAL_BLA_W_RADL:
 +case NAL_CRA_NUT:
 +case NAL_IDR_N_LP:
 +case NAL_IDR_W_RADL: irap++; break;

Please break the lines.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/3] FATE: add HEVC tests

2013-09-27 Thread Diego Biurrun
On Fri, Sep 27, 2013 at 03:26:11PM +0200, Anton Khirnov wrote:
 
 --- /dev/null
 +++ b/tests/fate/hevc.mak
 @@ -0,0 +1,162 @@
 +# those samples have the checksums embedded, so the decoder itself can test
 +# correctness

These - also capitalize and end in a period, same below.

 +# do not pass:

That's a bit nondescript.

 +# those samples don't have embedded checksums, so we test them with framecrc

do not, see above

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/3] lavf: add a raw HEVC demuxer

2013-09-27 Thread Luca Barbato
On 27/09/13 15:37, Diego Biurrun wrote:
 On Fri, Sep 27, 2013 at 03:26:10PM +0200, Anton Khirnov wrote:
 ---
  libavformat/Makefile |1 +
  libavformat/allformats.c |1 +
  libavformat/hevcdec.c|   64 
 ++
  3 files changed, 66 insertions(+)
  create mode 100644 libavformat/hevcdec.c
 
 Changelog, docs, version bump?
 
 --- /dev/null
 +++ b/libavformat/hevcdec.c
 @@ -0,0 +1,64 @@
 +
 +#include avformat.h
 +#include rawdec.h
 +
 +#include libavcodec/hevc.h
 
 I think we agreed to order this

My proposal got two +1, nobody put it in the documentation.

If there is agreement we should go forward and spend a weekend cleaning
up everything (and then I'll spend a week rebasing my trees)

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] avframe: note that linesize is not the usable data size

2013-09-27 Thread Anton Khirnov
---
 libavutil/frame.h |3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/frame.h b/libavutil/frame.h
index d71948d..b0676e7 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -84,6 +84,9 @@ typedef struct AVFrame {
  *
  * For audio, only linesize[0] may be set. For planar audio, each channel
  * plane must be the same size.
+ *
+ * @note The linesize may be larger than the size of usable data -- there
+ * may be extra padding present for performance reasons.
  */
 int linesize[AV_NUM_DATA_POINTERS];
 
-- 
1.7.10.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avframe: note that linesize is not the usable data size

2013-09-27 Thread Luca Barbato
On 27/09/13 16:49, Anton Khirnov wrote:
 ---
  libavutil/frame.h |3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/libavutil/frame.h b/libavutil/frame.h
 index d71948d..b0676e7 100644
 --- a/libavutil/frame.h
 +++ b/libavutil/frame.h
 @@ -84,6 +84,9 @@ typedef struct AVFrame {
   *
   * For audio, only linesize[0] may be set. For planar audio, each channel
   * plane must be the same size.
 + *
 + * @note The linesize may be larger than the size of usable data -- there
 + * may be extra padding present for performance reasons.
   */

Ok.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/3] lavf: add a raw HEVC demuxer

2013-09-27 Thread Vittorio Giovara
On Fri, Sep 27, 2013 at 3:51 PM, Luca Barbato lu_z...@gentoo.org wrote:
 +
 +#include avformat.h
 +#include rawdec.h
 +
 +#include libavcodec/hevc.h

 I think we agreed to order this

 My proposal got two +1, nobody put it in the documentation.


I can add that in the next iteration of the cleanup patchset.

Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Add support for multichannel ATRAC3+ to OpenMG demuxer

2013-09-27 Thread Maxim Polijakowski



Hi crews,

the attached patch adds support for multichannel ATRAC3+ streams to 
the OpenMG demuxer. It also sets the currently wrong ATRAC3+ frame 
size to right one of 2048 samples.


The patch for ATRAC3+ codec itself is in preparation and will be 
posted shortly...




Please find attached the updated patch...

Best regards
Maxim
From cb20dd04f8ba8342dc2992df4287b55df3b2175c Mon Sep 17 00:00:00 2001
From: Maxim Poliakovski max_p...@gmx.de
Date: Sat, 28 Sep 2013 00:18:18 +0200
Subject: [PATCH] Add support for multichannel ATRAC3+ streams.

---
 libavformat/oma.c|   15 +++
 libavformat/oma.h|3 +++
 libavformat/omadec.c |   15 +++
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/libavformat/oma.c b/libavformat/oma.c
index aaaf0b2..27b5988 100644
--- a/libavformat/oma.c
+++ b/libavformat/oma.c
@@ -21,6 +21,7 @@
 #include internal.h
 #include oma.h
 #include libavcodec/avcodec.h
+#include libavutil/channel_layout.h
 
 const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 };
 
@@ -31,3 +32,17 @@ const AVCodecTag ff_oma_codec_tags[] = {
 { AV_CODEC_ID_PCM_S16BE,   OMA_CODECID_LPCM},
 { 0 },
 };
+
+/** map ATRAC-X channel id to internal channel layout */
+const uint64_t ff_oma_chid_to_native_layout[7] = {
+AV_CH_LAYOUT_MONO,
+AV_CH_LAYOUT_STEREO,
+AV_CH_LAYOUT_SURROUND,
+AV_CH_LAYOUT_4POINT0,
+AV_CH_LAYOUT_5POINT1_BACK,
+AV_CH_LAYOUT_6POINT1_BACK,
+AV_CH_LAYOUT_7POINT1
+};
+
+/** map ATRAC-X channel id to total number of channels */
+const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8};
diff --git a/libavformat/oma.h b/libavformat/oma.h
index 1f0ddf9..9a35da2 100644
--- a/libavformat/oma.h
+++ b/libavformat/oma.h
@@ -41,4 +41,7 @@ extern const uint16_t ff_oma_srate_tab[8];
 
 extern const AVCodecTag ff_oma_codec_tags[];
 
+extern const uint64_t ff_oma_chid_to_native_layout[7];
+extern const int ff_oma_chid_to_num_channels[7];
+
 #endif /* AVFORMAT_OMA_H */
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 274112e..e5a2090 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -1,7 +1,7 @@
 /*
  * Sony OpenMG (OMA) demuxer
  *
- * Copyright (c) 2008 Maxim Poliakovski
+ * Copyright (c) 2008, 2013 Maxim Poliakovski
  *   2008 Benjamin Larsson
  *   2011 David Goldwich
  *
@@ -284,7 +284,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
 static int oma_read_header(AVFormatContext *s)
 {
 int ret, framesize, jsflag, samplerate;
-uint32_t codec_params;
+uint32_t codec_params, channel_id;
 int16_t eid;
 uint8_t buf[EA3_HEADER_SIZE];
 uint8_t *edata;
@@ -364,7 +364,14 @@ static int oma_read_header(AVFormatContext *s)
 avpriv_set_pts_info(st, 64, 1, st-codec-sample_rate);
 break;
 case OMA_CODECID_ATRAC3P:
-st-codec-channels = (codec_params  10)  7;
+channel_id = (codec_params  10)  7;
+if (!channel_id) {
+av_log(s, AV_LOG_ERROR,
+   Invalid ATRAC-X channel id: %d\n, channel_id);
+return AVERROR_INVALIDDATA;
+}
+st-codec-channel_layout = ff_oma_chid_to_native_layout[channel_id - 1];
+st-codec-channels   = ff_oma_chid_to_num_channels[channel_id - 1];
 framesize = ((codec_params  0x3FF) * 8) + 8;
 samplerate = ff_oma_srate_tab[(codec_params  13)  7] * 100;
 if (!samplerate) {
@@ -372,7 +379,7 @@ static int oma_read_header(AVFormatContext *s)
 return AVERROR_INVALIDDATA;
 }
 st-codec-sample_rate = samplerate;
-st-codec-bit_rate= samplerate * framesize * 8 / 1024;
+st-codec-bit_rate= samplerate * framesize * 8 / 2048;
 avpriv_set_pts_info(st, 64, 1, samplerate);
 av_log(s, AV_LOG_ERROR, Unsupported codec ATRAC3+!\n);
 break;
-- 
1.7.9.5

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] Add support for multichannel ATRAC3+ to OpenMG demuxer

2013-09-27 Thread Anton Khirnov

On Sat, 28 Sep 2013 00:35:27 +0200, Maxim Polijakowski max_p...@gmx.de wrote:
 
  Hi crews,
 
  the attached patch adds support for multichannel ATRAC3+ streams to 
  the OpenMG demuxer. It also sets the currently wrong ATRAC3+ frame 
  size to right one of 2048 samples.
 
  The patch for ATRAC3+ codec itself is in preparation and will be 
  posted shortly...
 
 
 Please find attached the updated patch...
 
 Best regards
 Maxim
 From cb20dd04f8ba8342dc2992df4287b55df3b2175c Mon Sep 17 00:00:00 2001
 From: Maxim Poliakovski max_p...@gmx.de
 Date: Sat, 28 Sep 2013 00:18:18 +0200
 Subject: [PATCH] Add support for multichannel ATRAC3+ streams.
 
 ---
  libavformat/oma.c|   15 +++
  libavformat/oma.h|3 +++
  libavformat/omadec.c |   15 +++
  3 files changed, 29 insertions(+), 4 deletions(-)
 
 diff --git a/libavformat/oma.c b/libavformat/oma.c
 index aaaf0b2..27b5988 100644
 --- a/libavformat/oma.c
 +++ b/libavformat/oma.c
 @@ -21,6 +21,7 @@
  #include internal.h
  #include oma.h
  #include libavcodec/avcodec.h
 +#include libavutil/channel_layout.h
  
  const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 };
  
 @@ -31,3 +32,17 @@ const AVCodecTag ff_oma_codec_tags[] = {
  { AV_CODEC_ID_PCM_S16BE,   OMA_CODECID_LPCM},
  { 0 },
  };
 +
 +/** map ATRAC-X channel id to internal channel layout */
 +const uint64_t ff_oma_chid_to_native_layout[7] = {
 +AV_CH_LAYOUT_MONO,
 +AV_CH_LAYOUT_STEREO,
 +AV_CH_LAYOUT_SURROUND,
 +AV_CH_LAYOUT_4POINT0,
 +AV_CH_LAYOUT_5POINT1_BACK,
 +AV_CH_LAYOUT_6POINT1_BACK,
 +AV_CH_LAYOUT_7POINT1
 +};
 +
 +/** map ATRAC-X channel id to total number of channels */
 +const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8};
 diff --git a/libavformat/oma.h b/libavformat/oma.h
 index 1f0ddf9..9a35da2 100644
 --- a/libavformat/oma.h
 +++ b/libavformat/oma.h
 @@ -41,4 +41,7 @@ extern const uint16_t ff_oma_srate_tab[8];
  
  extern const AVCodecTag ff_oma_codec_tags[];
  
 +extern const uint64_t ff_oma_chid_to_native_layout[7];
 +extern const int ff_oma_chid_to_num_channels[7];
 +
  #endif /* AVFORMAT_OMA_H */
 diff --git a/libavformat/omadec.c b/libavformat/omadec.c
 index 274112e..e5a2090 100644
 --- a/libavformat/omadec.c
 +++ b/libavformat/omadec.c
 @@ -1,7 +1,7 @@
  /*
   * Sony OpenMG (OMA) demuxer
   *
 - * Copyright (c) 2008 Maxim Poliakovski
 + * Copyright (c) 2008, 2013 Maxim Poliakovski
   *   2008 Benjamin Larsson
   *   2011 David Goldwich
   *
 @@ -284,7 +284,7 @@ static int decrypt_init(AVFormatContext *s, 
 ID3v2ExtraMeta *em, uint8_t *header)
  static int oma_read_header(AVFormatContext *s)
  {
  int ret, framesize, jsflag, samplerate;
 -uint32_t codec_params;
 +uint32_t codec_params, channel_id;
  int16_t eid;
  uint8_t buf[EA3_HEADER_SIZE];
  uint8_t *edata;
 @@ -364,7 +364,14 @@ static int oma_read_header(AVFormatContext *s)
  avpriv_set_pts_info(st, 64, 1, st-codec-sample_rate);
  break;
  case OMA_CODECID_ATRAC3P:
 -st-codec-channels = (codec_params  10)  7;
 +channel_id = (codec_params  10)  7;
 +if (!channel_id) {
 +av_log(s, AV_LOG_ERROR,
 +   Invalid ATRAC-X channel id: %d\n, channel_id);
 +return AVERROR_INVALIDDATA;
 +}
 +st-codec-channel_layout = ff_oma_chid_to_native_layout[channel_id 
 - 1];
 +st-codec-channels   = ff_oma_chid_to_num_channels[channel_id - 
 1];
  framesize = ((codec_params  0x3FF) * 8) + 8;
  samplerate = ff_oma_srate_tab[(codec_params  13)  7] * 100;
  if (!samplerate) {
 @@ -372,7 +379,7 @@ static int oma_read_header(AVFormatContext *s)
  return AVERROR_INVALIDDATA;
  }
  st-codec-sample_rate = samplerate;
 -st-codec-bit_rate= samplerate * framesize * 8 / 1024;
 +st-codec-bit_rate= samplerate * framesize * 8 / 2048;

This part looks unrelated.
Was bitrate wrong previously?

The rest looks ok.

-- 
Anton Khirnov
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/3] rtpdec_qt: Add an accidentally removed allocation return value check

2013-09-27 Thread Anton Khirnov

On Thu, 26 Sep 2013 17:13:38 +0200, Luca Barbato lu_z...@gentoo.org wrote:
 On 26/09/13 15:43, Martin Storsjö wrote:
  This check was mistakenly removed in 5626f994f.
  ---
   libavformat/rtpdec_qt.c |2 ++
   1 file changed, 2 insertions(+)
  
 
 The set looks fine, thanks for fixing all of them.
 

+1

-- 
Anton Khirnov
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel