[libav-devel] [PATCH 1/1] prepare 9_beta1 release

2012-10-11 Thread Janne Grunau
On 2012-10-10 19:44:00 -0400, Sean McGovern wrote:
 On Wed, Oct 10, 2012 at 7:19 PM, Reinhard Tartler siret...@gmail.com wrote:
  Oh, ich it's really only signing the tarball, then i might find some time
  tomorrow night. But Diego should be able for that as well.

I can sign the tarballs too if we can live with an unsigned key. I will
tag following commit after pushing as v9_beta1 and prepare and sign tarballs
tonight.

  What about point releases?
 
 I haven't engaged anyone on the point releases, and I think we should
 get the 9 beta out first.

I agree.

Janne

---8---
---
 Changelog | 3 +++
 RELEASE   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 5948bbe..b4b5294 100644
--- a/Changelog
+++ b/Changelog
@@ -3,6 +3,9 @@ releases are sorted from youngest to oldest.
 
 version next:
 
+
+version 9_beta1:
+
 - XWD encoder and decoder
 - Support for fragmentation in the mov/mp4 muxer
 - ISMV (Smooth Streaming) muxer
diff --git a/RELEASE b/RELEASE
index aec258d..437fe58 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-0.8
+9_beta1
-- 
1.7.12

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


Re: [libav-devel] [PATCH 3/4] indeo4/5: remove constant parameter num_bands from wavelet recomposition

2012-10-11 Thread Maxim
Am 10.10.2012 19:57, schrieb Janne Grunau:
 Fixes bogus uninitialized value compiler and coverity warnings.
 ---
  libavcodec/ivi_common.c | 4 ++--
  libavcodec/ivi_dsp.c| 5 +++--
  libavcodec/ivi_dsp.h| 6 ++
  3 files changed, 7 insertions(+), 8 deletions(-)

 diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
 index d1a86c4..d48014c 100644
 --- a/libavcodec/ivi_common.c
 +++ b/libavcodec/ivi_common.c
 @@ -808,9 +808,9 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void 
 *data, int *data_size,
  
  if (ctx-is_scalable) {
  if (avctx-codec_id == AV_CODEC_ID_INDEO4)
 -ff_ivi_recompose_haar(ctx-planes[0], ctx-frame.data[0], 
 ctx-frame.linesize[0], 4);
 +ff_ivi_recompose_haar(ctx-planes[0], ctx-frame.data[0], 
 ctx-frame.linesize[0]);
  else
 -ff_ivi_recompose53   (ctx-planes[0], ctx-frame.data[0], 
 ctx-frame.linesize[0], 4);
 +ff_ivi_recompose53   (ctx-planes[0], ctx-frame.data[0], 
 ctx-frame.linesize[0]);
  } else {
  ff_ivi_output_plane(ctx-planes[0], ctx-frame.data[0], 
 ctx-frame.linesize[0]);
  }

It would be nice to add a description why num_bands has been set to
that fixed value. The original routines support partial recomposition if
one or several bands are not available for whatever reason (insufficient
processor power or corrupted frame data). Therefore, the caller could
tell the wavelet transform how much bands are available using this
parameter.
Libav's implementation does currently support neither any processor
speed measurements nor any bitstream data recovery. Therefore, this last
parameter is practically useless in that implementation.

But, IMHO, it should be well documented at least...

Thanks
Best regards
Maxim P. (the author of the original indeo45 code)
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] mlpdsp: adding missing file

2012-10-11 Thread Luca Barbato
---
 libavcodec/mlpdsp.h | 37 +
 1 file changed, 37 insertions(+)
 create mode 100644 libavcodec/mlpdsp.h

diff --git a/libavcodec/mlpdsp.h b/libavcodec/mlpdsp.h
new file mode 100644
index 000..995f72a
--- /dev/null
+++ b/libavcodec/mlpdsp.h
@@ -0,0 +1,37 @@
+/*
+ * MLP codec common header file
+ * Copyright (c) 2007-2008 Ian Caulfield
+ *
+ * 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
+ */
+
+#ifndef AVCODEC_MLPDSP_H
+#define AVCODEC_MLPDSP_H
+
+#include stdint.h
+
+typedef struct MLPDSPContext {
+void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff,
+   int firorder, int iirorder,
+   unsigned int filter_shift, int32_t mask,
+   int blocksize, int32_t *sample_buffer);
+} MLPDSPContext;
+
+void ff_mlpdsp_init(MLPDSPContext *c);
+void ff_mlpdsp_init_x86(MLPDSPContext *c);
+
+#endif /* AVCODEC_MLPDSP_H */
-- 
1.7.12

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


Re: [libav-devel] [PATCH] mlpdsp: adding missing file

2012-10-11 Thread Kostya Shishkov
On Thu, Oct 11, 2012 at 12:35:03PM +0200, Luca Barbato wrote:
 ---
  libavcodec/mlpdsp.h | 37 +
  1 file changed, 37 insertions(+)
  create mode 100644 libavcodec/mlpdsp.h
 
 diff --git a/libavcodec/mlpdsp.h b/libavcodec/mlpdsp.h
 new file mode 100644
 index 000..995f72a
 --- /dev/null
 +++ b/libavcodec/mlpdsp.h
 @@ -0,0 +1,37 @@
 +/*
 + * MLP codec common header file
 + * Copyright (c) 2007-2008 Ian Caulfield
 + *
 + * 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
 + */
 +
 +#ifndef AVCODEC_MLPDSP_H
 +#define AVCODEC_MLPDSP_H
 +
 +#include stdint.h
 +
 +typedef struct MLPDSPContext {
 +void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff,
 +   int firorder, int iirorder,
 +   unsigned int filter_shift, int32_t mask,
 +   int blocksize, int32_t *sample_buffer);
 +} MLPDSPContext;
 +
 +void ff_mlpdsp_init(MLPDSPContext *c);
 +void ff_mlpdsp_init_x86(MLPDSPContext *c);
 +
 +#endif /* AVCODEC_MLPDSP_H */
 -- 

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


Re: [libav-devel] [PATCH] mlpdsp: adding missing file

2012-10-11 Thread Diego Biurrun
On Thu, Oct 11, 2012 at 12:35:03PM +0200, Luca Barbato wrote:
 ---
  libavcodec/mlpdsp.h | 37 +
  1 file changed, 37 insertions(+)
  create mode 100644 libavcodec/mlpdsp.h

OK

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


Re: [libav-devel] [PATCH] Drop Snow codec

2012-10-11 Thread Luca Barbato
On 09/24/2012 07:05 PM, Diego Biurrun wrote:
 So I guess it's time to drop Snow.  Jordi is moving code around for Dirac
 that will end up getting deleted.  Let's not have him do that.  Attached
 is a patch that excises Snow; note the sexy diffstat.

Dirac is having a stand-alone dwt.c in the branch so we could in theory
remove everything and replace the snow dwt.c with dirac's. j2k could
pick from the dwt.c once it is ready, I know for sure dirac and j2k can
share some of it.

I tested snow yesterday (patch to have iqa in libavfilter will appear
soonish) and while it is still a better dirac in term on quality/space
it has some security issues (one leading any player to crash) so
removing it is the best course of action since I do not have time to
cleanup and fix the code and nobody else is even thinking about touch
that eye poking code.

Snow will live in an experimental branch on my github or on a stand
alone repo on our organization github.

Whoever wants to play with the concept and clean it up is welcome to
participate.




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


[libav-devel] [PATCH] random_seed: Support using CryptGenRandom on windows

2012-10-11 Thread Martin Storsjö
---
 configure   |2 ++
 libavutil/random_seed.c |   14 ++
 2 files changed, 16 insertions(+)

diff --git a/configure b/configure
index 17f38ec..67f88eb 100755
--- a/configure
+++ b/configure
@@ -1139,6 +1139,7 @@ HAVE_LIST=
 closesocket
 cmov
 cpunop
+CryptGenRandom
 dcbzl
 dev_bktr_ioctl_bt848_h
 dev_bktr_ioctl_meteor_h
@@ -3202,6 +3203,7 @@ check_func  sysctl
 check_func  usleep
 check_func_headers io.h setmode
 check_lib2 windows.h shellapi.h CommandLineToArgvW -lshell32
+check_lib2 windows.h wincrypt.h CryptGenRandom -ladvapi32
 check_lib2 windows.h psapi.h GetProcessMemoryInfo -lpsapi
 check_func_headers windows.h GetProcessAffinityMask
 check_func_headers windows.h GetProcessTimes
diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
index 8ee4cb7..e29775e 100644
--- a/libavutil/random_seed.c
+++ b/libavutil/random_seed.c
@@ -23,6 +23,10 @@
 #if HAVE_UNISTD_H
 #include unistd.h
 #endif
+#if HAVE_CRYPTGENRANDOM
+#include windows.h
+#include wincrypt.h
+#endif
 #include fcntl.h
 #include math.h
 #include time.h
@@ -82,6 +86,16 @@ uint32_t av_get_random_seed(void)
 {
 uint32_t seed;
 
+#if HAVE_CRYPTGENRANDOM
+HCRYPTPROV provider;
+if (CryptAcquireContext(provider, NULL, NULL, PROV_RSA_FULL, 
CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
+BOOL ret = CryptGenRandom(provider, sizeof(seed), (PBYTE) seed);
+CryptReleaseContext(provider, 0);
+if (ret)
+return seed;
+}
+#endif
+
 if (read_random(seed, /dev/urandom) == sizeof(seed))
 return seed;
 if (read_random(seed, /dev/random)  == sizeof(seed))
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] random_seed: Support using CryptGenRandom on windows

2012-10-11 Thread Måns Rullgård
Martin Storsjö mar...@martin.st writes:

 ---
  configure   |2 ++
  libavutil/random_seed.c |   14 ++
  2 files changed, 16 insertions(+)

 diff --git a/configure b/configure
 index 17f38ec..67f88eb 100755
 --- a/configure
 +++ b/configure
 @@ -1139,6 +1139,7 @@ HAVE_LIST=
  closesocket
  cmov
  cpunop
 +CryptGenRandom
  dcbzl
  dev_bktr_ioctl_bt848_h
  dev_bktr_ioctl_meteor_h
 @@ -3202,6 +3203,7 @@ check_func  sysctl
  check_func  usleep
  check_func_headers io.h setmode
  check_lib2 windows.h shellapi.h CommandLineToArgvW -lshell32
 +check_lib2 windows.h wincrypt.h CryptGenRandom -ladvapi32
  check_lib2 windows.h psapi.h GetProcessMemoryInfo -lpsapi
  check_func_headers windows.h GetProcessAffinityMask
  check_func_headers windows.h GetProcessTimes
 diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
 index 8ee4cb7..e29775e 100644
 --- a/libavutil/random_seed.c
 +++ b/libavutil/random_seed.c
 @@ -23,6 +23,10 @@
  #if HAVE_UNISTD_H
  #include unistd.h
  #endif
 +#if HAVE_CRYPTGENRANDOM
 +#include windows.h
 +#include wincrypt.h
 +#endif
  #include fcntl.h
  #include math.h
  #include time.h
 @@ -82,6 +86,16 @@ uint32_t av_get_random_seed(void)
  {
  uint32_t seed;

 +#if HAVE_CRYPTGENRANDOM
 +HCRYPTPROV provider;
 +if (CryptAcquireContext(provider, NULL, NULL, PROV_RSA_FULL, 
 CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
 +BOOL ret = CryptGenRandom(provider, sizeof(seed), (PBYTE) seed);
 +CryptReleaseContext(provider, 0);
 +if (ret)
 +return seed;
 +}
 +#endif
 +
  if (read_random(seed, /dev/urandom) == sizeof(seed))
  return seed;
  if (read_random(seed, /dev/random)  == sizeof(seed))
 -- 

Seems reasonable.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Drop Snow codec

2012-10-11 Thread Luca Barbato
On 10/07/2012 10:56 PM, Diego Biurrun wrote:
 Snow is a toy codec with no real-world use and horrible code.
 ---
 Updated to also drop the DWT code, which is completely Snow-specific
 and cannot be shared with Dirac.  Plus drop some Snow-specific parts
 from dsputil.

Looks fine to me.

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


[libav-devel] [PATCH] nut: support high depth pcm codecs

2012-10-11 Thread Luca Barbato
Give priority to the native tags when encoding.
---
 libavformat/nut.c| 20 
 libavformat/nut.h|  1 +
 libavformat/nutdec.c |  9 +++--
 libavformat/nutenc.c | 20 ++--
 4 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/libavformat/nut.c b/libavformat/nut.c
index 4e46b98..0e866da 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -89,6 +89,26 @@ const AVCodecTag ff_nut_video_tags[] = {
 { AV_CODEC_ID_NONE, 0 }
 };
 
+const AVCodecTag ff_nut_audio_tags[] = {
+{ AV_CODEC_ID_PCM_ALAW,  MKTAG('A', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
+{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) },
+{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D',  8 ) },
+{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) },
+{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) },
+{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D',  8 ) },
+{ AV_CODEC_ID_NONE,  0 }
+};
+
 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){
 int i;
 for(i=0; inut-avf-nb_streams; i++){
diff --git a/libavformat/nut.h b/libavformat/nut.h
index 3f09689..933b9c5 100644
--- a/libavformat/nut.h
+++ b/libavformat/nut.h
@@ -105,6 +105,7 @@ typedef struct NUTContext {
 
 extern const AVCodecTag ff_nut_subtitle_tags[];
 extern const AVCodecTag ff_nut_video_tags[];
+extern const AVCodecTag ff_nut_audio_tags[];
 
 typedef struct Dispositions {
 char str[9];
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index dd02aad..a3ff2e6 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut)
 break;
 case 1:
 st-codec-codec_type = AVMEDIA_TYPE_AUDIO;
-st-codec-codec_id   = ff_codec_get_id(ff_codec_wav_tags, tmp);
+st-codec-codec_id   = av_codec_get_id((const AVCodecTag * const []) {
+ff_codec_wav_tags,
+ff_nut_audio_tags,
+0
+},
+tmp);
 break;
 case 2:
 st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
@@ -993,6 +998,6 @@ AVInputFormat ff_nut_demuxer = {
 .extensions = nut,
 .codec_tag  = (const AVCodecTag * const []) {
 ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags,
-ff_nut_subtitle_tags, 0
+ff_nut_subtitle_tags, ff_nut_audio_tags, 0
 },
 };
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 4b1e663..ba79d8f 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -371,9 +371,16 @@ static void write_mainheader(NUTContext *nut, AVIOContext 
*bc){
 }
 }
 
+static const AVCodecTag * const nut_codec_tags[] = {
+ff_nut_audio_tags, ff_nut_video_tags, ff_nut_subtitle_tags,
+ff_codec_bmp_tags, ff_codec_wav_tags, 0
+};
+
 static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, 
AVStream *st, int i){
 NUTContext *nut = avctx-priv_data;
 AVCodecContext *codec = st-codec;
+unsigned codec_tag = av_codec_get_tag(nut_codec_tags, codec-codec_id);
+
 ff_put_v(bc, i);
 switch(codec-codec_type){
 case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break;
@@ -382,8 +389,12 @@ static int write_streamheader(AVFormatContext *avctx, 
AVIOContext *bc, AVStream
 default  : ff_put_v(bc, 3); break;
 }
 ff_put_v(bc, 4);
-if (codec-codec_tag){
-avio_wl32(bc, codec-codec_tag);
+
+if (!codec_tag)
+codec_tag = codec-codec_tag;
+
+if (codec_tag) {
+avio_wl32(bc, codec_tag);
 } else {
 av_log(avctx, AV_LOG_ERROR, No codec tag defined for stream %d\n, i);
 return AVERROR(EINVAL);
@@ -873,8 +884,5 @@ AVOutputFormat ff_nut_muxer = {
 .write_packet   = nut_write_packet,
 .write_trailer  = nut_write_trailer,
 .flags  = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
-.codec_tag  = (const AVCodecTag * const []){
-ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags,
-ff_nut_subtitle_tags, 0
-},
+.codec_tag  = nut_codec_tags,
 };
-- 
1.7.12

___
libav-devel mailing list
libav-devel@libav.org

Re: [libav-devel] [PATCH] Move avutil tables only used in libavcodec to libavcodec.

2012-10-11 Thread Martin Storsjö

On Thu, 11 Oct 2012, Diego Biurrun wrote:


---
Fixed placement of extern table declarations (for arm), they need to
come before the arch-specific headers, as they are referenced there.

libavcodec/Makefile|7 +
libavcodec/arm/mathops.h   |   24 
libavcodec/inverse.c   |1 -
libavcodec/mathops.h   |   29 +++
libavutil/inverse.c = libavcodec/mathtables.c |   14 +++--
libavcodec/motion_est.c|2 +-
libavcodec/mpegvideo.c |2 +-
libavcodec/mpegvideo_enc.c |1 +
libavcodec/ra144.c |2 +-
libavcodec/roqaudioenc.c   |2 +-
libavutil/Makefile |1 -
libavutil/arm/intmath.h|   24 
libavutil/intmath.h|   35 
libavutil/mathematics.c|   11 ---
14 files changed, 70 insertions(+), 85 deletions(-)
delete mode 100644 libavcodec/inverse.c
rename libavutil/inverse.c = libavcodec/mathtables.c (79%)


Looks ok.

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


[libav-devel] [PATCH 2/2] parseutils-test: various cleanups

2012-10-11 Thread Mans Rullgard
- make tables static const
- remove useless use of compound literal
- break long lines
- fix a comma/semicolon typo

Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavutil/parseutils.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 23fa80c..28aa9c9 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -650,7 +650,7 @@ int main(void)
 printf(Testing av_parse_video_rate()\n);
 {
 int i;
-const char *rates[] = {
+static const char *const rates[] = {
 -inf,
 inf,
 nan,
@@ -680,8 +680,8 @@ int main(void)
 
 for (i = 0; i  FF_ARRAY_ELEMS(rates); i++) {
 int ret;
-AVRational q = (AVRational){0, 0};
-ret = av_parse_video_rate(q, rates[i]),
+AVRational q = { 0, 0 };
+ret = av_parse_video_rate(q, rates[i]);
 printf('%s' - %d/%d %s\n,
rates[i], q.num, q.den, ret ? ERROR : OK);
 }
@@ -691,7 +691,7 @@ int main(void)
 {
 int i;
 uint8_t rgba[4];
-const char *color_names[] = {
+static const char *const color_names[] = {
 foo,
 red,
 Red ,
@@ -732,7 +732,8 @@ int main(void)
 
 for (i = 0;  i  FF_ARRAY_ELEMS(color_names); i++) {
 if (av_parse_color(rgba, color_names[i], -1, NULL) = 0)
-printf(%s - R(%d) G(%d) B(%d) A(%d)\n, color_names[i], 
rgba[0], rgba[1], rgba[2], rgba[3]);
+printf(%s - R(%d) G(%d) B(%d) A(%d)\n,
+   color_names[i], rgba[0], rgba[1], rgba[2], rgba[3]);
 }
 }
 
-- 
1.7.12

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


[libav-devel] [PATCH 1/2] parseutils: fix const removal warning

2012-10-11 Thread Mans Rullgard
The const qualifier is still removed although it happens inside
the strtol() function so no warning is generated.

Fixes:
libavutil/parseutils.c:110:11: warning: assignment discards qualifiers from 
pointer target type

Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavutil/parseutils.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index b51f2e8..23fa80c 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -107,8 +107,7 @@ int av_parse_video_size(int *width_ptr, int *height_ptr, 
const char *str)
 }
 }
 if (i == n) {
-p = str;
-width = strtol(p, p, 10);
+width = strtol(str, p, 10);
 if (*p)
 p++;
 height = strtol(p, p, 10);
-- 
1.7.12

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


[libav-devel] [PATCH 1/3] avutil: Add functions for allocating opaque contexts for algorithms

2012-10-11 Thread Martin Storsjö
The current API where the plain size is exposed is not of much
use - in most cases it is allocated dynamically anyway.

If allocated e.g. on the stack via an uint8_t array, there's no
guarantee that the struct's members are aligned properly (unless
the array is overallocated and the opaque pointer within it
manually aligned to some unspecified alignment).
---
 doc/APIchanges  |4 
 libavutil/aes.c |7 +++
 libavutil/aes.h |   12 +++-
 libavutil/md5.c |8 
 libavutil/md5.h |8 +++-
 libavutil/sha.c |8 
 libavutil/sha.h |   12 +++-
 libavutil/tree.c|7 +++
 libavutil/tree.h|   12 +++-
 libavutil/version.h |5 -
 10 files changed, 78 insertions(+), 5 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 3e93354..81a2266 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil: 2011-04-18
 
 API changes, most recent first:
 
+2012-10-xx - xxx - lavu 51.43.0 - aes.h, md5.h, sha.h, tree.h
+  Add functions for allocating the opaque contexts for the algorithms,
+  deprecate the context size variables.
+
 2012-10-xx - xxx - lavf 54.18.0 - avio.h
   Add avio_closep to complement avio_close.
 
diff --git a/libavutil/aes.c b/libavutil/aes.c
index 6803c71..4656a48 100644
--- a/libavutil/aes.c
+++ b/libavutil/aes.c
@@ -39,7 +39,14 @@ typedef struct AVAES {
 int rounds;
 } AVAES;
 
+#if FF_API_CONTEXT_SIZE
 const int av_aes_size= sizeof(AVAES);
+#endif
+
+struct AVAES *av_aes_alloc(void)
+{
+return av_mallocz(sizeof(struct AVAES));
+}
 
 static const uint8_t rcon[10] = {
   0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36
diff --git a/libavutil/aes.h b/libavutil/aes.h
index cf7b462..edff275 100644
--- a/libavutil/aes.h
+++ b/libavutil/aes.h
@@ -23,17 +23,27 @@
 
 #include stdint.h
 
+#include attributes.h
+#include version.h
+
 /**
  * @defgroup lavu_aes AES
  * @ingroup lavu_crypto
  * @{
  */
 
-extern const int av_aes_size;
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_aes_size;
+#endif
 
 struct AVAES;
 
 /**
+ * Allocate an AVAES context.
+ */
+struct AVAES *av_aes_alloc(void);
+
+/**
  * Initialize an AVAES context.
  * @param key_bits 128, 192 or 256
  * @param decrypt 0 for encryption, 1 for decryption
diff --git a/libavutil/md5.c b/libavutil/md5.c
index ca0e598..93a91d7 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -34,6 +34,7 @@
 #include bswap.h
 #include intreadwrite.h
 #include md5.h
+#include mem.h
 
 typedef struct AVMD5{
 uint64_t len;
@@ -41,7 +42,14 @@ typedef struct AVMD5{
 uint32_t ABCD[4];
 } AVMD5;
 
+#if FF_API_CONTEXT_SIZE
 const int av_md5_size = sizeof(AVMD5);
+#endif
+
+struct AVMD5 *av_md5_alloc(void)
+{
+return av_mallocz(sizeof(struct AVMD5));
+}
 
 static const uint8_t S[4][4] = {
 { 7, 12, 17, 22 },  /* round 1 */
diff --git a/libavutil/md5.h b/libavutil/md5.h
index c5b858a..29e4e7c 100644
--- a/libavutil/md5.h
+++ b/libavutil/md5.h
@@ -23,16 +23,22 @@
 
 #include stdint.h
 
+#include attributes.h
+#include version.h
+
 /**
  * @defgroup lavu_md5 MD5
  * @ingroup lavu_crypto
  * @{
  */
 
-extern const int av_md5_size;
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_md5_size;
+#endif
 
 struct AVMD5;
 
+struct AVMD5 *av_md5_alloc(void);
 void av_md5_init(struct AVMD5 *ctx);
 void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
 void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
diff --git a/libavutil/sha.c b/libavutil/sha.c
index cbe1608..d583191 100644
--- a/libavutil/sha.c
+++ b/libavutil/sha.c
@@ -26,6 +26,7 @@
 #include bswap.h
 #include sha.h
 #include intreadwrite.h
+#include mem.h
 
 /** hash context */
 typedef struct AVSHA {
@@ -37,7 +38,14 @@ typedef struct AVSHA {
 void (*transform)(uint32_t *state, const uint8_t buffer[64]);
 } AVSHA;
 
+#if FF_API_CONTEXT_SIZE
 const int av_sha_size = sizeof(AVSHA);
+#endif
+
+struct AVSHA *av_sha_alloc(void)
+{
+return av_mallocz(sizeof(struct AVSHA));
+}
 
 #define rol(value, bits) (((value)  (bits)) | ((value)  (32 - (bits
 
diff --git a/libavutil/sha.h b/libavutil/sha.h
index 8350954..4c9a0c9 100644
--- a/libavutil/sha.h
+++ b/libavutil/sha.h
@@ -23,17 +23,27 @@
 
 #include stdint.h
 
+#include attributes.h
+#include version.h
+
 /**
  * @defgroup lavu_sha SHA
  * @ingroup lavu_crypto
  * @{
  */
 
-extern const int av_sha_size;
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_sha_size;
+#endif
 
 struct AVSHA;
 
 /**
+ * Allocate an AVSHA context.
+ */
+struct AVSHA *av_sha_alloc(void);
+
+/**
  * Initialize SHA-1 or SHA-2 hashing.
  *
  * @param context pointer to the function context (of size av_sha_size)
diff --git a/libavutil/tree.c b/libavutil/tree.c
index 0e68bb7..55dcbc5 100644
--- a/libavutil/tree.c
+++ b/libavutil/tree.c
@@ -28,7 +28,14 @@ typedef struct AVTreeNode {
 int state;
 } AVTreeNode;
 
+#if FF_API_CONTEXT_SIZE
 const int 

[libav-devel] [PATCH 2/3] Use the new aes/md5/sha/tree allocation functions

2012-10-11 Thread Martin Storsjö
---
 libavcodec/flacenc.c|2 +-
 libavformat/crypto.c|2 +-
 libavformat/httpauth.c  |2 +-
 libavformat/mxfdec.c|2 +-
 libavformat/nut.c   |2 +-
 libavformat/rtmpproto.c |2 +-
 libavutil/tree.c|2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 122d485..b135e4a 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -354,7 +354,7 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
   s-channels, 16);
 
 /* initialize MD5 context */
-s-md5ctx = av_malloc(av_md5_size);
+s-md5ctx = av_md5_alloc();
 if (!s-md5ctx)
 return AVERROR(ENOMEM);
 av_md5_init(s-md5ctx);
diff --git a/libavformat/crypto.c b/libavformat/crypto.c
index 93c9f23..3bc33f2 100644
--- a/libavformat/crypto.c
+++ b/libavformat/crypto.c
@@ -87,7 +87,7 @@ static int crypto_open(URLContext *h, const char *uri, int 
flags)
 av_log(h, AV_LOG_ERROR, Unable to open input\n);
 goto err;
 }
-c-aes = av_mallocz(av_aes_size);
+c-aes = av_aes_alloc();
 if (!c-aes) {
 ret = AVERROR(ENOMEM);
 goto err;
diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c
index 4ec8ac2..774ee21 100644
--- a/libavformat/httpauth.c
+++ b/libavformat/httpauth.c
@@ -159,7 +159,7 @@ static char *make_digest_auth(HTTPAuthState *state, const 
char *username,
 ff_data_to_hex(cnonce, (const uint8_t*) cnonce_buf, sizeof(cnonce_buf), 1);
 cnonce[2*sizeof(cnonce_buf)] = 0;
 
-md5ctx = av_malloc(av_md5_size);
+md5ctx = av_md5_alloc();
 if (!md5ctx)
 return NULL;
 
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 25d18f4..8595d72 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -340,7 +340,7 @@ static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket 
*pkt, KLVPacket *klv
 int index;
 
 if (!mxf-aesc  s-key  s-keylen == 16) {
-mxf-aesc = av_malloc(av_aes_size);
+mxf-aesc = av_aes_alloc();
 if (!mxf-aesc)
 return AVERROR(ENOMEM);
 av_aes_init(mxf-aesc, s-key, 128, 1);
diff --git a/libavformat/nut.c b/libavformat/nut.c
index 4e46b98..6a68e28 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -116,7 +116,7 @@ int ff_nut_sp_pts_cmp(const Syncpoint *a, const Syncpoint 
*b){
 
 void ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts){
 Syncpoint *sp= av_mallocz(sizeof(Syncpoint));
-struct AVTreeNode *node= av_mallocz(av_tree_node_size);
+struct AVTreeNode *node = av_tree_node_alloc();
 
 sp-pos= pos;
 sp-back_ptr= back_ptr;
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index d04f3a7..a5bc246 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -859,7 +859,7 @@ int ff_rtmp_calc_digest(const uint8_t *src, int len, int 
gap,
 uint8_t hmac_buf[64+32] = {0};
 int i;
 
-sha = av_mallocz(av_sha_size);
+sha = av_sha_alloc();
 if (!sha)
 return AVERROR(ENOMEM);
 
diff --git a/libavutil/tree.c b/libavutil/tree.c
index 55dcbc5..fd51a74 100644
--- a/libavutil/tree.c
+++ b/libavutil/tree.c
@@ -220,7 +220,7 @@ int main (void)
 }
 av_log(NULL, AV_LOG_ERROR, inserting %4d\n, j);
 if (!node)
-node = av_mallocz(av_tree_node_size);
+node = av_tree_node_alloc();
 av_tree_insert(root, (void *) (j + 1), cmp, node);
 
 j = av_lfg_get(prng) % 86294;
-- 
1.7.9.4

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


Re: [libav-devel] [PATCH 1/3] avutil: Add functions for allocating opaque contexts for algorithms

2012-10-11 Thread Luca Barbato
On 10/11/2012 03:19 PM, Martin Storsjö wrote:
 The current API where the plain size is exposed is not of much
 use - in most cases it is allocated dynamically anyway.
 

The set looks fine.

lu

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


[libav-devel] [PATCH] avcodec: Remove broken MMI optimizations

2012-10-11 Thread Diego Biurrun
The code fails to compile and is broken beyond repair.
---
Removed file content deleted from the diff to avoid patch spam.

 Makefile|2 +-
 arch.mak|2 -
 configure   |8 -
 libavcodec/avcodec.h|2 +
 libavcodec/dsputil.c|1 -
 libavcodec/dsputil.h|3 +-
 libavcodec/mips/Makefile|4 -
 libavcodec/mips/dsputil_mmi.c   |  162 -
 libavcodec/mips/idct_mmi.c  |  361 ---
 libavcodec/mips/mmi.h   |  179 ---
 libavcodec/mips/mpegvideo_mmi.c |   87 --
 libavcodec/mpegvideo.c  |2 -
 libavcodec/mpegvideo.h  |1 -
 libavcodec/options_table.h  |3 +
 libavcodec/version.h|3 +
 15 files changed, 10 insertions(+), 810 deletions(-)
 delete mode 100644 libavcodec/mips/Makefile
 delete mode 100644 libavcodec/mips/dsputil_mmi.c
 delete mode 100644 libavcodec/mips/idct_mmi.c
 delete mode 100644 libavcodec/mips/mmi.h
 delete mode 100644 libavcodec/mips/mpegvideo_mmi.c

diff --git a/Makefile b/Makefile
index 77d51eb..1cbf2aa 100644
--- a/Makefile
+++ b/Makefile
@@ -104,7 +104,7 @@ config.h: .config
 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS  \
ARCH_HEADERS BUILT_HEADERS SKIPHEADERS\
ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS \
-   MMI-OBJS ALTIVEC-OBJS VIS-OBJS\
+   ALTIVEC-OBJS VIS-OBJS \
MMX-OBJS YASM-OBJS\
OBJS HOSTOBJS TESTOBJS
 
diff --git a/arch.mak b/arch.mak
index 33018f3..748783d 100644
--- a/arch.mak
+++ b/arch.mak
@@ -3,8 +3,6 @@ OBJS-$(HAVE_ARMV6)   += $(ARMV6-OBJS)   $(ARMV6-OBJS-yes)
 OBJS-$(HAVE_ARMVFP)  += $(ARMVFP-OBJS)  $(ARMVFP-OBJS-yes)
 OBJS-$(HAVE_NEON)+= $(NEON-OBJS)$(NEON-OBJS-yes)
 
-OBJS-$(HAVE_MMI) += $(MMI-OBJS) $(MMI-OBJS-yes)
-
 OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
 
 OBJS-$(HAVE_VIS) += $(VIS-OBJS) $(VIS-OBJS-yes)
diff --git a/configure b/configure
index 17f38ec..5c32e04 100755
--- a/configure
+++ b/configure
@@ -259,7 +259,6 @@ Optimization options (experts only):
   --disable-armv6  disable armv6 optimizations
   --disable-armv6t2disable armv6t2 optimizations
   --disable-armvfp disable ARM VFP optimizations
-  --disable-mmidisable MMI optimizations
   --disable-neon   disable NEON optimizations
   --disable-visdisable VIS optimizations
   --disable-inline-asm disable use of inline assembler
@@ -1101,7 +1100,6 @@ ARCH_EXT_LIST=
 armv6
 armv6t2
 armvfp
-mmi
 neon
 ppc4xx
 vfpv3
@@ -1350,8 +1348,6 @@ armvfp_deps=arm
 neon_deps=arm
 vfpv3_deps=armvfp
 
-mmi_deps=mips
-
 altivec_deps=ppc
 ppc4xx_deps=ppc
 
@@ -3026,7 +3022,6 @@ EOF
 elif enabled mips; then
 
 check_inline_asm loongson 'dmult.g $1, $2, $3'
-enabled mmi  check_inline_asm mmi 'lq $2, 0($2)'
 
 elif enabled ppc; then
 
@@ -3572,9 +3567,6 @@ if enabled arm; then
 echo ARM VFP enabled   ${armvfp-no}
 echo NEON enabled  ${neon-no}
 fi
-if enabled mips; then
-echo MMI enabled   ${mmi-no}
-fi
 if enabled ppc; then
 echo AltiVec enabled   ${altivec-no}
 echo PPC 4xx optimizations ${ppc4xx-no}
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 32a7dcb..51270e6 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2623,7 +2623,9 @@ typedef struct AVCodecContext {
 #if FF_API_LIBMPEG2
 #define FF_IDCT_LIBMPEG2MMX   4
 #endif
+#if FF_API_MMI
 #define FF_IDCT_MMI   5
+#endif
 #define FF_IDCT_ARM   7
 #define FF_IDCT_ALTIVEC   8
 #define FF_IDCT_SH4   9
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index ec43bf1..aeade1e 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -2968,7 +2968,6 @@ av_cold void ff_dsputil_init(DSPContext* c, 
AVCodecContext *avctx)
 if (HAVE_VIS)ff_dsputil_init_vis   (c, avctx);
 if (ARCH_ALPHA)  ff_dsputil_init_alpha (c, avctx);
 if (ARCH_PPC)ff_dsputil_init_ppc   (c, avctx);
-if (HAVE_MMI)ff_dsputil_init_mmi   (c, avctx);
 if (ARCH_SH4)ff_dsputil_init_sh4   (c, avctx);
 if (ARCH_BFIN)   ff_dsputil_init_bfin  (c, avctx);
 
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index 3131e26..af9114e 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -598,7 +598,6 @@ static inline int get_penalty_factor(int lambda, int 
lambda2, int type){
 void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
 void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
 void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
-void 

Re: [libav-devel] [PATCH] avcodec: Remove broken MMI optimizations

2012-10-11 Thread Kostya Shishkov
On Thu, Oct 11, 2012 at 04:51:08PM +0200, Diego Biurrun wrote:
 The code fails to compile and is broken beyond repair.
 ---
 Removed file content deleted from the diff to avoid patch spam.
 
  Makefile|2 +-
  arch.mak|2 -
  configure   |8 -
  libavcodec/avcodec.h|2 +
  libavcodec/dsputil.c|1 -
  libavcodec/dsputil.h|3 +-
  libavcodec/mips/Makefile|4 -
  libavcodec/mips/dsputil_mmi.c   |  162 -
  libavcodec/mips/idct_mmi.c  |  361 
 ---
  libavcodec/mips/mmi.h   |  179 ---
  libavcodec/mips/mpegvideo_mmi.c |   87 --
  libavcodec/mpegvideo.c  |2 -
  libavcodec/mpegvideo.h  |1 -
  libavcodec/options_table.h  |3 +
  libavcodec/version.h|3 +
  15 files changed, 10 insertions(+), 810 deletions(-)
  delete mode 100644 libavcodec/mips/Makefile
  delete mode 100644 libavcodec/mips/dsputil_mmi.c
  delete mode 100644 libavcodec/mips/idct_mmi.c
  delete mode 100644 libavcodec/mips/mmi.h
  delete mode 100644 libavcodec/mips/mpegvideo_mmi.c

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


Re: [libav-devel] [PATCH] avcodec: Remove broken MMI optimizations

2012-10-11 Thread Måns Rullgård
Diego Biurrun di...@biurrun.de writes:

 The code fails to compile and is broken beyond repair.
 ---
 Removed file content deleted from the diff to avoid patch spam.

  Makefile|2 +-
  arch.mak|2 -
  configure   |8 -
  libavcodec/avcodec.h|2 +
  libavcodec/dsputil.c|1 -
  libavcodec/dsputil.h|3 +-
  libavcodec/mips/Makefile|4 -
  libavcodec/mips/dsputil_mmi.c   |  162 -
  libavcodec/mips/idct_mmi.c  |  361 
 ---
  libavcodec/mips/mmi.h   |  179 ---
  libavcodec/mips/mpegvideo_mmi.c |   87 --
  libavcodec/mpegvideo.c  |2 -
  libavcodec/mpegvideo.h  |1 -
  libavcodec/options_table.h  |3 +
  libavcodec/version.h|3 +
  15 files changed, 10 insertions(+), 810 deletions(-)
  delete mode 100644 libavcodec/mips/Makefile
  delete mode 100644 libavcodec/mips/dsputil_mmi.c
  delete mode 100644 libavcodec/mips/idct_mmi.c
  delete mode 100644 libavcodec/mips/mmi.h
  delete mode 100644 libavcodec/mips/mpegvideo_mmi.c

Fine with me.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] Remove libmpeg2 #define remnants

2012-10-11 Thread Diego Biurrun
---
 libavcodec/avcodec.h |2 ++
 libavcodec/version.h |3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 223db9c..32a7dcb 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2620,7 +2620,9 @@ typedef struct AVCodecContext {
 #define FF_IDCT_INT   1
 #define FF_IDCT_SIMPLE2
 #define FF_IDCT_SIMPLEMMX 3
+#if FF_API_LIBMPEG2
 #define FF_IDCT_LIBMPEG2MMX   4
+#endif
 #define FF_IDCT_MMI   5
 #define FF_IDCT_ARM   7
 #define FF_IDCT_ALTIVEC   8
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 5b2d7b9..b97439c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -85,5 +85,8 @@
 #ifndef FF_API_AVCODEC_RESAMPLE
 #define FF_API_AVCODEC_RESAMPLE  (LIBAVCODEC_VERSION_MAJOR  55)
 #endif
+#ifndef FF_API_LIBMPEG2
+#define FF_API_LIBMPEG2  (LIBAVCODEC_VERSION_MAJOR  55)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
-- 
1.7.1

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


Re: [libav-devel] [PATCH 1/1] prepare 9_beta1 release

2012-10-11 Thread Diego Biurrun
On Thu, Oct 11, 2012 at 11:51:15AM +0200, Janne Grunau wrote:
 ---
  Changelog | 3 +++
  RELEASE   | 2 +-
  2 files changed, 4 insertions(+), 1 deletion(-)

OK

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


[libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.

2012-10-11 Thread Diego Biurrun
---
I have duplicated the table with an ff_ prefix and marked it as to
be removed on the next libavutil bump.  Alternatively, one could
play tricks with the preprocessor and avoid the source-level
duplication, but I thought this was not worth the trouble.

 libavcodec/asvdec.c |7 ---
 libavcodec/asvenc.c |7 ---
 libavcodec/bitstream.c  |9 +
 libavcodec/indeo2.c |6 --
 libavcodec/ivi_common.c |7 ---
 libavcodec/mathops.h|1 +
 libavcodec/mathtables.c |   19 +++
 libavcodec/pcm.c|   11 ++-
 libavcodec/s302m.c  |   39 ---
 libavcodec/tiff.c   |7 ---
 libavcodec/vble.c   |3 ++-
 libavcodec/wnv1.c   |6 +++---
 libavcodec/xbmenc.c |4 ++--
 libavutil/common.h  |4 
 libavutil/mathematics.c |6 +-
 libavutil/version.h |3 +++
 16 files changed, 90 insertions(+), 49 deletions(-)

diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c
index ceb8f63..a546d24 100644
--- a/libavcodec/asvdec.c
+++ b/libavcodec/asvdec.c
@@ -23,13 +23,14 @@
  * ASUS V1/V2 decoder.
  */
 
-#include libavutil/common.h
+#include libavutil/attributes.h
 #include libavutil/mem.h
 
 #include asv.h
 #include avcodec.h
 #include put_bits.h
 #include dsputil.h
+#include mathops.h
 #include mpeg12data.h
 
 //#undef NDEBUG
@@ -70,7 +71,7 @@ static av_cold void init_vlcs(ASV1Context *a){
 
 //FIXME write a reversed bitstream reader to avoid the double reverse
 static inline int asv2_get_bits(GetBitContext *gb, int n){
-return av_reverse[ get_bits(gb, n)  (8-n) ];
+return ff_reverse[ get_bits(gb, n)  (8-n) ];
 }
 
 static inline int asv1_get_level(GetBitContext *gb){
@@ -210,7 +211,7 @@ static int decode_frame(AVCodecContext *avctx,
 else{
 int i;
 for(i=0; ibuf_size; i++)
-a-bitstream_buffer[i]= av_reverse[ buf[i] ];
+a-bitstream_buffer[i]= ff_reverse[ buf[i] ];
 }
 
 init_get_bits(a-gb, a-bitstream_buffer, buf_size*8);
diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index bf2cdaf..4ab9ddb 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -23,15 +23,16 @@
  * ASUS V1/V2 encoder.
  */
 
-#include libavutil/common.h
+#include libavutil/attributes.h
 #include libavutil/mem.h
 
 #include asv.h
 #include avcodec.h
+#include mathops.h
 #include mpeg12data.h
 
 static inline void asv2_put_bits(PutBitContext *pb, int n, int v){
-put_bits(pb, n, av_reverse[ v  (8-n) ]);
+put_bits(pb, n, ff_reverse[ v  (8-n) ]);
 }
 
 static inline void asv1_put_level(PutBitContext *pb, int level){
@@ -226,7 +227,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 else{
 int i;
 for(i=0; i4*size; i++)
-pkt-data[i] = av_reverse[pkt-data[i]];
+pkt-data[i] = ff_reverse[pkt-data[i]];
 }
 
 pkt-size   = size*4;
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 93ea9e2..eec2f6d 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -29,6 +29,7 @@
  */
 
 #include avcodec.h
+#include mathops.h
 #include get_bits.h
 #include put_bits.h
 
@@ -114,10 +115,10 @@ static int alloc_table(VLC *vlc, int size, int use_static)
 }
 
 static av_always_inline uint32_t bitswap_32(uint32_t x) {
-return (uint32_t)av_reverse[x0xFF]24
- | (uint32_t)av_reverse[(x8)0xFF]16
- | (uint32_t)av_reverse[(x16)0xFF]8
- | (uint32_t)av_reverse[x24];
+return (uint32_t)ff_reverse[x0xFF]24
+ | (uint32_t)ff_reverse[(x8)0xFF]16
+ | (uint32_t)ff_reverse[(x16)0xFF]8
+ | (uint32_t)ff_reverse[x24];
 }
 
 typedef struct {
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 0fa7922..76592d6 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -23,11 +23,13 @@
  * @file
  * Intel Indeo 2 decoder.
  */
+
 #define BITSTREAM_READER_LE
+#include libavutil/attributes.h
 #include avcodec.h
 #include get_bits.h
 #include indeo2data.h
-#include libavutil/common.h
+#include mathops.h
 
 typedef struct Ir2Context{
 AVCodecContext *avctx;
@@ -168,7 +170,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
 /* decide whether frame uses deltas or not */
 #ifndef BITSTREAM_READER_LE
 for (i = 0; i  buf_size; i++)
-buf[i] = av_reverse[buf[i]];
+buf[i] = ff_reverse[buf[i]];
 #endif
 
 init_get_bits(s-gb, buf + start, (buf_size - start) * 8);
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index d48014c..149fffe 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -27,10 +27,11 @@
  */
 
 #define BITSTREAM_READER_LE
+#include libavutil/attributes.h
 #include avcodec.h
 #include get_bits.h
+#include mathops.h
 #include ivi_common.h
-#include libavutil/common.h
 #include ivi_dsp.h
 
 extern const IVIHuffDesc ff_ivi_mb_huff_desc[8];  /// static macroblock 
huffman tables
@@ -48,9 +49,9 @@ static uint16_t inv_bits(uint16_t val, int 

Re: [libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.

2012-10-11 Thread Martin Storsjö

On Thu, 11 Oct 2012, Diego Biurrun wrote:


---
I have duplicated the table with an ff_ prefix and marked it as to
be removed on the next libavutil bump.  Alternatively, one could
play tricks with the preprocessor and avoid the source-level
duplication, but I thought this was not worth the trouble.





diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index 1655e1c..a628fbd 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -26,9 +26,12 @@
#include assert.h
#include stdint.h
#include limits.h
+
#include mathematics.h
+#include version.h

-const uint8_t av_reverse[256]={
+#ifndef FF_API_AV_REVERSE
+const uint8_t ff_reverse[256]={
0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
@@ -46,6 +49,7 @@ const uint8_t av_reverse[256]={
0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
};
+#endif


You're renaming the original table here as well, which I guess you didn't 
intend to? That'd break anything that tries to link to it currently.


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


Re: [libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.

2012-10-11 Thread Diego Biurrun
On Thu, Oct 11, 2012 at 07:56:26PM +0300, Martin Storsjö wrote:
 On Thu, 11 Oct 2012, Diego Biurrun wrote:
 
 ---
 I have duplicated the table with an ff_ prefix and marked it as to
 be removed on the next libavutil bump.  Alternatively, one could
 play tricks with the preprocessor and avoid the source-level
 duplication, but I thought this was not worth the trouble.
 
 --- a/libavutil/mathematics.c
 +++ b/libavutil/mathematics.c
 @@ -26,9 +26,12 @@
 
 -const uint8_t av_reverse[256]={
 +#ifndef FF_API_AV_REVERSE
 +const uint8_t ff_reverse[256]={
 
 You're renaming the original table here as well, which I guess you
 didn't intend to? That'd break anything that tries to link to it
 currently.

Crap, that's a remnant from the sed expression, updating ...

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


[libav-devel] [PATCH 2/3] svq3: fix pointer type warning

2012-10-11 Thread Mans Rullgard
Fixes:
libavcodec/svq3.c:661:9: warning: passing argument 2 of 'svq3_decode_block' 
from incompatible pointer type
libavcodec/svq3.c:208:19: note: expected 'DCTELEM *' but argument is of type 
'DCTELEM (*)[32]'

Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavcodec/svq3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 6099e77..bc1a77a 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -658,7 +658,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int 
mb_type)
 if (IS_INTRA16x16(mb_type)) {
 AV_ZERO128(h-mb_luma_dc[0]+0);
 AV_ZERO128(h-mb_luma_dc[0]+8);
-if (svq3_decode_block(s-gb, h-mb_luma_dc, 0, 1)){
+if (svq3_decode_block(s-gb, h-mb_luma_dc[0], 0, 1)){
 av_log(h-s.avctx, AV_LOG_ERROR, error while decoding intra luma 
dc\n);
 return -1;
 }
-- 
1.7.12

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


[libav-devel] [PATCH 3/3] svq3: fix indentation in svq3_decode_slice_header()

2012-10-11 Thread Mans Rullgard
Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavcodec/svq3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index bc1a77a..4652b5c 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -738,7 +738,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
 if (svq3-next_slice_index  s-gb.size_in_bits) {
 av_log(avctx, AV_LOG_ERROR, slice after bitstream end\n);
 return -1;
-}
+}
 
 s-gb.size_in_bits = svq3-next_slice_index - 8*(length - 1);
 skip_bits(s-gb, 8);
-- 
1.7.12

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


[libav-devel] [PATCH 1/3] svq3: replace unsafe pointer casting with intreadwrite macros

2012-10-11 Thread Mans Rullgard
Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavcodec/svq3.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index c4d5a1b..6099e77 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -409,17 +409,17 @@ static inline int svq3_mc_dir(H264Context *h, int size, 
int mode, int dir,
 int32_t mv = pack16to32(mx,my);
 
 if (part_height == 8  i  8) {
-*(int32_t *) h-mv_cache[dir][scan8[k] + 1*8] = mv;
+AV_WN32A(h-mv_cache[dir][scan8[k] + 1*8], mv);
 
 if (part_width == 8  j  8) {
-*(int32_t *) h-mv_cache[dir][scan8[k] + 1 + 1*8] = mv;
+AV_WN32A(h-mv_cache[dir][scan8[k] + 1 + 1*8], mv);
 }
 }
 if (part_width == 8  j  8) {
-*(int32_t *) h-mv_cache[dir][scan8[k] + 1] = mv;
+AV_WN32A(h-mv_cache[dir][scan8[k] + 1], mv);
 }
 if (part_width == 4 || part_height == 4) {
-*(int32_t *) h-mv_cache[dir][scan8[k]] = mv;
+AV_WN32A(h-mv_cache[dir][scan8[k]], mv);
 }
 }
 
@@ -487,11 +487,11 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int 
mb_type)
 for (m = 0; m  2; m++) {
 if (s-mb_x  0  h-intra4x4_pred_mode[h-mb2br_xy[mb_xy - 1]+6] 
!= -1) {
 for (i = 0; i  4; i++) {
-*(uint32_t *) h-mv_cache[m][scan8[0] - 1 + i*8] = 
*(uint32_t *) s-current_picture.f.motion_val[m][b_xy - 1 + i*h-b_stride];
+AV_COPY32(h-mv_cache[m][scan8[0] - 1 + i*8], 
s-current_picture.f.motion_val[m][b_xy - 1 + i*h-b_stride]);
 }
 } else {
 for (i = 0; i  4; i++) {
-*(uint32_t *) h-mv_cache[m][scan8[0] - 1 + i*8] = 0;
+AV_ZERO32(h-mv_cache[m][scan8[0] - 1 + i*8]);
 }
 }
 if (s-mb_y  0) {
@@ -499,14 +499,14 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int 
mb_type)
 memset(h-ref_cache[m][scan8[0] - 1*8], 
(h-intra4x4_pred_mode[h-mb2br_xy[mb_xy - s-mb_stride]] == -1) ? 
PART_NOT_AVAILABLE : 1, 4);
 
 if (s-mb_x  (s-mb_width - 1)) {
-*(uint32_t *) h-mv_cache[m][scan8[0] + 4 - 1*8] = 
*(uint32_t *) s-current_picture.f.motion_val[m][b_xy - h-b_stride + 4];
+AV_COPY32(h-mv_cache[m][scan8[0] + 4 - 1*8], 
s-current_picture.f.motion_val[m][b_xy - h-b_stride + 4]);
 h-ref_cache[m][scan8[0] + 4 - 1*8] =
 (h-intra4x4_pred_mode[h-mb2br_xy[mb_xy - 
s-mb_stride + 1]+6] == -1 ||
  h-intra4x4_pred_mode[h-mb2br_xy[mb_xy - 
s-mb_stride]  ] == -1) ? PART_NOT_AVAILABLE : 1;
 }else
 h-ref_cache[m][scan8[0] + 4 - 1*8] = PART_NOT_AVAILABLE;
 if (s-mb_x  0) {
-*(uint32_t *) h-mv_cache[m][scan8[0] - 1 - 1*8] = 
*(uint32_t *) s-current_picture.f.motion_val[m][b_xy - h-b_stride - 1];
+AV_COPY32(h-mv_cache[m][scan8[0] - 1 - 1*8], 
s-current_picture.f.motion_val[m][b_xy - h-b_stride - 1]);
 h-ref_cache[m][scan8[0] - 1 - 1*8] = 
(h-intra4x4_pred_mode[h-mb2br_xy[mb_xy - s-mb_stride - 1]+3] == -1) ? 
PART_NOT_AVAILABLE : 1;
 }else
 h-ref_cache[m][scan8[0] - 1 - 1*8] = PART_NOT_AVAILABLE;
-- 
1.7.12

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


Re: [libav-devel] [PATCH 3/3] svq3: fix indentation in svq3_decode_slice_header()

2012-10-11 Thread Diego Biurrun
On Thu, Oct 11, 2012 at 06:05:00PM +0100, Mans Rullgard wrote:
 Signed-off-by: Mans Rullgard m...@mansr.com
 ---
  libavcodec/svq3.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Don't bother, this file is on schedule to receive a makeover.

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


Re: [libav-devel] [PATCH 3/3] svq3: fix indentation in svq3_decode_slice_header()

2012-10-11 Thread Måns Rullgård
Diego Biurrun di...@biurrun.de writes:

 On Thu, Oct 11, 2012 at 06:05:00PM +0100, Mans Rullgard wrote:
 Signed-off-by: Mans Rullgard m...@mansr.com
 ---
  libavcodec/svq3.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 Don't bother, this file is on schedule to receive a makeover.

I was looking at that function and the wrong intendtation had me
confused for a while, so I fixed it.  Don't worry, there's plenty more
for you to clean up in the rest of the file.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] vc1: Use codec ID from AVCodecContext while parsing frame header

2012-10-11 Thread Mashiat Sarker Shakkhar
This fixes a segfault with samples that I have (both of them MPEG-TS). Looks 
like
avctx-codec is not being set during parsing.
---
 libavcodec/vc1.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index c7edc25..a8dd38a 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -576,7 +576,7 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* 
gb)
 
 if (v-finterpflag)
 v-interpfrm = get_bits1(gb);
-if (v-s.avctx-codec-id == AV_CODEC_ID_MSS2)
+if (v-s.avctx-codec_id == AV_CODEC_ID_MSS2)
 v-respic   =
 v-rangered =
 v-multires = get_bits(gb, 2) == 1;
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH 1/3] svq3: replace unsafe pointer casting with intreadwrite macros

2012-10-11 Thread Kostya Shishkov
On Thu, Oct 11, 2012 at 06:04:58PM +0100, Mans Rullgard wrote:
 Signed-off-by: Mans Rullgard m...@mansr.com
 ---
  libavcodec/svq3.c | 16 
  1 file changed, 8 insertions(+), 8 deletions(-)

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


Re: [libav-devel] [PATCH 2/3] svq3: fix pointer type warning

2012-10-11 Thread Kostya Shishkov
On Thu, Oct 11, 2012 at 06:04:59PM +0100, Mans Rullgard wrote:
 Fixes:
 libavcodec/svq3.c:661:9: warning: passing argument 2 of 'svq3_decode_block' 
 from incompatible pointer type
 libavcodec/svq3.c:208:19: note: expected 'DCTELEM *' but argument is of type 
 'DCTELEM (*)[32]'
 
 Signed-off-by: Mans Rullgard m...@mansr.com
 ---
  libavcodec/svq3.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
 index 6099e77..bc1a77a 100644
 --- a/libavcodec/svq3.c
 +++ b/libavcodec/svq3.c
 @@ -658,7 +658,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int 
 mb_type)
  if (IS_INTRA16x16(mb_type)) {
  AV_ZERO128(h-mb_luma_dc[0]+0);
  AV_ZERO128(h-mb_luma_dc[0]+8);
 -if (svq3_decode_block(s-gb, h-mb_luma_dc, 0, 1)){
 +if (svq3_decode_block(s-gb, h-mb_luma_dc[0], 0, 1)){
  av_log(h-s.avctx, AV_LOG_ERROR, error while decoding intra 
 luma dc\n);
  return -1;
  }
 -- 

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


Re: [libav-devel] [PATCH] vc1: Use codec ID from AVCodecContext while parsing frame header

2012-10-11 Thread Kostya Shishkov
On Thu, Oct 11, 2012 at 01:13:56PM -0400, Mashiat Sarker Shakkhar wrote:
 This fixes a segfault with samples that I have (both of them MPEG-TS). Looks 
 like
 avctx-codec is not being set during parsing.
 ---
  libavcodec/vc1.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
 index c7edc25..a8dd38a 100644
 --- a/libavcodec/vc1.c
 +++ b/libavcodec/vc1.c
 @@ -576,7 +576,7 @@ int ff_vc1_parse_frame_header(VC1Context *v, 
 GetBitContext* gb)
  
  if (v-finterpflag)
  v-interpfrm = get_bits1(gb);
 -if (v-s.avctx-codec-id == AV_CODEC_ID_MSS2)
 +if (v-s.avctx-codec_id == AV_CODEC_ID_MSS2)
  v-respic   =
  v-rangered =
  v-multires = get_bits(gb, 2) == 1;
 -- 

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


[libav-devel] [PATCH] build: add support for Tru64 (OSF/1)

2012-10-11 Thread Mans Rullgard
Signed-off-by: Mans Rullgard m...@mansr.com
---
 configure | 4 
 1 file changed, 4 insertions(+)

diff --git a/configure b/configure
index a782009..161033b 100755
--- a/configure
+++ b/configure
@@ -2884,6 +2884,10 @@ case $target_os in
   -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
   -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
 ;;
+osf1)
+add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
+AVSERVERLDFLAGS=
+;;
 none)
 ;;
 *)
-- 
1.7.12

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


[libav-devel] [PATCH] dca: allocate a secondary buffer for extra channels when downmixing

2012-10-11 Thread Justin Ruggles
The output AVFrame buffer only has data for the downmix channels.
Fixes a segfault when decoding dca with request_channels == 2.
---
 libavcodec/dcadec.c |   32 ++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index d38dff8..eb12eb2 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -32,6 +32,7 @@
 #include libavutil/intreadwrite.h
 #include libavutil/mathematics.h
 #include libavutil/audioconvert.h
+#include libavutil/samplefmt.h
 #include avcodec.h
 #include dsputil.h
 #include fft.h
@@ -357,6 +358,9 @@ typedef struct {
 
 DECLARE_ALIGNED(32, float, 
subband_samples)[DCA_BLOCKS_MAX][DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][8];
 float *samples_chanptr[DCA_PRIM_CHANNELS_MAX + 1];
+float *extra_channels[DCA_PRIM_CHANNELS_MAX + 1];
+uint8_t *extra_channels_buffer;
+unsigned int extra_channels_buffer_size;
 
 uint8_t dca_buffer[DCA_MAX_FRAME_SIZE + DCA_MAX_EXSS_HEADER_SIZE + 
DCA_BUFFER_PADDING_SIZE];
 int dca_buffer_size;/// how much data is in the dca_buffer
@@ -1656,7 +1660,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void 
*data,
 int i, ret;
 float  **samples_flt;
 DCAContext *s = avctx-priv_data;
-int channels;
+int channels, full_channels;
 int core_ss_end;
 
 
@@ -1790,7 +1794,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void 
*data,
 
 avctx-profile = s-profile;
 
-channels = s-prim_channels + !!s-lfe;
+full_channels = channels = s-prim_channels + !!s-lfe;
 
 if (s-amode  16) {
 avctx-channel_layout = dca_core_channel_layout[s-amode];
@@ -1852,12 +1856,35 @@ static int dca_decode_frame(AVCodecContext *avctx, void 
*data,
 }
 samples_flt = (float  **) s-frame.extended_data;
 
+/* allocate buffer for extra channels if downmixing */
+if (avctx-channels  full_channels) {
+ret = av_samples_get_buffer_size(NULL, full_channels - channels,
+ s-frame.nb_samples,
+ avctx-sample_fmt, 0);
+if (ret  0)
+return ret;
+
+av_fast_malloc(s-extra_channels_buffer,
+   s-extra_channels_buffer_size, ret);
+if (!s-extra_channels_buffer)
+return AVERROR(ENOMEM);
+
+ret = av_samples_fill_arrays((uint8_t **)s-extra_channels, NULL,
+ s-extra_channels_buffer,
+ full_channels - channels,
+ s-frame.nb_samples, avctx-sample_fmt, 
0);
+if (ret  0)
+return ret;
+}
+
 /* filter to get final output */
 for (i = 0; i  (s-sample_blocks / 8); i++) {
 int ch;
 
 for (ch = 0; ch  channels; ch++)
 s-samples_chanptr[ch] = samples_flt[ch] + i * 256;
+for (; ch  full_channels; ch++)
+s-samples_chanptr[ch] = s-extra_channels[ch - channels] + i * 
256;
 
 dca_filter_channels(s, i);
 
@@ -1922,6 +1949,7 @@ static av_cold int dca_decode_end(AVCodecContext *avctx)
 {
 DCAContext *s = avctx-priv_data;
 ff_mdct_end(s-imdct);
+av_freep(s-extra_channels_buffer);
 return 0;
 }
 
-- 
1.7.1

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


Re: [libav-devel] [PATCH] build: add support for Tru64 (OSF/1)

2012-10-11 Thread Kostya Shishkov
On Thu, Oct 11, 2012 at 07:07:01PM +0100, Mans Rullgard wrote:
 Signed-off-by: Mans Rullgard m...@mansr.com
 ---
  configure | 4 
  1 file changed, 4 insertions(+)
 
 diff --git a/configure b/configure
 index a782009..161033b 100755
 --- a/configure
 +++ b/configure
 @@ -2884,6 +2884,10 @@ case $target_os in
-l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
-l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  ;;
 +osf1)
 +add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
 +AVSERVERLDFLAGS=
 +;;
  none)
  ;;
  *)
 -- 

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


Re: [libav-devel] [PATCH] dca: allocate a secondary buffer for extra channels when downmixing

2012-10-11 Thread Kostya Shishkov
On Thu, Oct 11, 2012 at 02:25:15PM -0400, Justin Ruggles wrote:
 The output AVFrame buffer only has data for the downmix channels.
 Fixes a segfault when decoding dca with request_channels == 2.
 ---
  libavcodec/dcadec.c |   32 ++--
  1 files changed, 30 insertions(+), 2 deletions(-)

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


Re: [libav-devel] [PATCH 7/9] lavc: do not use av_pix_fmt_descriptors directly.

2012-10-11 Thread Martin Storsjö

On Sat, 6 Oct 2012, Anton Khirnov wrote:


---
libavcodec/imgconvert.c |   30 ++
libavcodec/libopenjpegdec.c |   34 ++
libavcodec/libopenjpegenc.c |   13 ++---
libavcodec/mpegvideo.c  |   10 ++
libavcodec/rawdec.c |3 ++-
libavcodec/rawenc.c |4 +++-
libavcodec/tiffenc.c|2 +-
libavcodec/utils.c  |6 --
libavcodec/xwdenc.c |5 +++--
9 files changed, 61 insertions(+), 46 deletions(-)


LGTM

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


Re: [libav-devel] [PATCH 9/9] lavu, lavd: do not use av_pix_fmt_descriptors directly.

2012-10-11 Thread Martin Storsjö

On Sat, 6 Oct 2012, Anton Khirnov wrote:


---
libavdevice/fbdev.c  |2 +-
libavutil/imgutils.c |   24 +++-
2 files changed, 16 insertions(+), 10 deletions(-)


LGTM

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


Re: [libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.

2012-10-11 Thread Martin Storsjö

On Thu, 11 Oct 2012, Diego Biurrun wrote:


---
Now w/o accidentally renaming the copy in libavutil...

libavcodec/asvdec.c |7 ---
libavcodec/asvenc.c |7 ---
libavcodec/bitstream.c  |9 +
libavcodec/indeo2.c |6 --
libavcodec/ivi_common.c |7 ---
libavcodec/mathops.h|1 +
libavcodec/mathtables.c |   19 +++
libavcodec/pcm.c|   11 ++-
libavcodec/s302m.c  |   39 ---
libavcodec/tiff.c   |7 ---
libavcodec/vble.c   |3 ++-
libavcodec/wnv1.c   |6 +++---
libavcodec/xbmenc.c |4 ++--
libavutil/common.h  |4 
libavutil/mathematics.c |4 
libavutil/version.h |3 +++
16 files changed, 89 insertions(+), 48 deletions(-)



diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index 1655e1c..36839ab 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -26,8 +26,11 @@
#include assert.h
#include stdint.h
#include limits.h
+
#include mathematics.h
+#include version.h

+#ifndef FF_API_AV_REVERSE
const uint8_t av_reverse[256]={
0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,


This should be #if FF_API_AV_REVERSE (sorry for not noticing in the 
previous round), LGTM with that fixed.


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


[libav-devel] [PATCH 1/3] mpegvideo: remove write-only variable

2012-10-11 Thread Mans Rullgard
Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavcodec/mpegvideo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f739c2d..a0ec3dc 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -828,7 +828,7 @@ fail:
  */
 av_cold int ff_MPV_common_init(MpegEncContext *s)
 {
-int i, err;
+int i;
 int nb_slices = (HAVE_THREADS 
  s-avctx-active_thread_type  FF_THREAD_SLICE) ?
 s-avctx-thread_count : 1;
@@ -915,7 +915,7 @@ av_cold int ff_MPV_common_init(MpegEncContext *s)
 }
 
 if (s-width  s-height) {
-if ((err = init_context_frame(s)))
+if (init_context_frame(s))
 goto fail;
 
 s-parse_context.state = -1;
-- 
1.7.12

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


[libav-devel] [PATCH 2/3] smjpeg: fix type of 'ret' variable in smjpeg_read_packet()

2012-10-11 Thread Mans Rullgard
The 'ret' variable is used for negative error codes so it should
be a signed type.

Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavformat/smjpegdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/smjpegdec.c b/libavformat/smjpegdec.c
index 7764c0f..4cbfa2a 100644
--- a/libavformat/smjpegdec.c
+++ b/libavformat/smjpegdec.c
@@ -135,8 +135,9 @@ static int smjpeg_read_header(AVFormatContext *s)
 static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
 SMJPEGContext *sc = s-priv_data;
-uint32_t dtype, ret, size, timestamp;
+uint32_t dtype, size, timestamp;
 int64_t pos;
+int ret;
 
 if (s-pb-eof_reached)
 return AVERROR_EOF;
-- 
1.7.12

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


[libav-devel] [PATCH 3/3] rtpdec_xiph: fix function return type

2012-10-11 Thread Mans Rullgard
parse_packed_headers() returns either zero or a negative error code
so its return type must be signed.

Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavformat/rtpdec_xiph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
index dc739ee..38f12bb 100644
--- a/libavformat/rtpdec_xiph.c
+++ b/libavformat/rtpdec_xiph.c
@@ -243,7 +243,7 @@ static int get_base128(const uint8_t ** buf, const uint8_t 
* buf_end)
 /**
  * Based off parse_packed_headers in Vorbis RTP
  */
-static unsigned int
+static int
 parse_packed_headers(const uint8_t * packed_headers,
  const uint8_t * packed_headers_end,
  AVCodecContext * codec, PayloadContext * xiph_data)
-- 
1.7.12

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


Re: [libav-devel] [PATCH 3/3] rtpdec_xiph: fix function return type

2012-10-11 Thread Martin Storsjö

On Thu, 11 Oct 2012, Mans Rullgard wrote:


parse_packed_headers() returns either zero or a negative error code
so its return type must be signed.

Signed-off-by: Mans Rullgard m...@mansr.com
---
libavformat/rtpdec_xiph.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
index dc739ee..38f12bb 100644
--- a/libavformat/rtpdec_xiph.c
+++ b/libavformat/rtpdec_xiph.c
@@ -243,7 +243,7 @@ static int get_base128(const uint8_t ** buf, const uint8_t 
* buf_end)
/**
 * Based off parse_packed_headers in Vorbis RTP
 */
-static unsigned int
+static int
parse_packed_headers(const uint8_t * packed_headers,
 const uint8_t * packed_headers_end,
 AVCodecContext * codec, PayloadContext * xiph_data)
--
1.7.12


LGTM

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


Re: [libav-devel] [PATCH 2/3] smjpeg: fix type of 'ret' variable in smjpeg_read_packet()

2012-10-11 Thread Martin Storsjö

On Thu, 11 Oct 2012, Mans Rullgard wrote:


The 'ret' variable is used for negative error codes so it should
be a signed type.

Signed-off-by: Mans Rullgard m...@mansr.com
---
libavformat/smjpegdec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/smjpegdec.c b/libavformat/smjpegdec.c
index 7764c0f..4cbfa2a 100644
--- a/libavformat/smjpegdec.c
+++ b/libavformat/smjpegdec.c
@@ -135,8 +135,9 @@ static int smjpeg_read_header(AVFormatContext *s)
static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
{
SMJPEGContext *sc = s-priv_data;
-uint32_t dtype, ret, size, timestamp;
+uint32_t dtype, size, timestamp;
int64_t pos;
+int ret;

if (s-pb-eof_reached)
return AVERROR_EOF;
--
1.7.12


LGTM

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


Re: [libav-devel] [PATCH 1/3] mpegvideo: remove write-only variable

2012-10-11 Thread Martin Storsjö

On Thu, 11 Oct 2012, Mans Rullgard wrote:


Signed-off-by: Mans Rullgard m...@mansr.com
---
libavcodec/mpegvideo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f739c2d..a0ec3dc 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -828,7 +828,7 @@ fail:
 */
av_cold int ff_MPV_common_init(MpegEncContext *s)
{
-int i, err;
+int i;
int nb_slices = (HAVE_THREADS 
 s-avctx-active_thread_type  FF_THREAD_SLICE) ?
s-avctx-thread_count : 1;
@@ -915,7 +915,7 @@ av_cold int ff_MPV_common_init(MpegEncContext *s)
}

if (s-width  s-height) {
-if ((err = init_context_frame(s)))
+if (init_context_frame(s))
goto fail;

s-parse_context.state = -1;
--
1.7.12


Ok

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


[libav-devel] [PATCH] avutil: add yuva422p and yuva444p formats

2012-10-11 Thread Luca Barbato
---

Rebased, if nobody is against it I'd push it

 libavcodec/utils.c|  2 ++
 libavutil/pixdesc.c   | 26 ++
 libswscale/utils.c|  2 ++
 tests/ref/lavfi/pixdesc   |  2 ++
 tests/ref/lavfi/pixfmts_copy  |  2 ++
 tests/ref/lavfi/pixfmts_null  |  2 ++
 tests/ref/lavfi/pixfmts_scale |  2 ++
 tests/ref/lavfi/pixfmts_vflip |  2 ++
 8 files changed, 40 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 48d6348..5cbf36a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -180,6 +180,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int 
*width, int *height,
 case AV_PIX_FMT_YUVJ440P:
 case AV_PIX_FMT_YUVJ444P:
 case AV_PIX_FMT_YUVA420P:
+case AV_PIX_FMT_YUVA422P:
+case AV_PIX_FMT_YUVA444P:
 case AV_PIX_FMT_YUV420P9LE:
 case AV_PIX_FMT_YUV420P9BE:
 case AV_PIX_FMT_YUV420P10LE:
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index f5098a7..bb23460 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -527,6 +527,32 @@ const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 },
 .flags = PIX_FMT_PLANAR,
 },
+[AV_PIX_FMT_YUVA422P] = {
+.name = yuva422p,
+.nb_components = 4,
+.log2_chroma_w = 1,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 0, 1, 0, 7 },/* Y */
+{ 1, 0, 1, 0, 7 },/* U */
+{ 2, 0, 1, 0, 7 },/* V */
+{ 3, 0, 1, 0, 7 },/* A */
+},
+.flags = PIX_FMT_PLANAR,
+},
+[AV_PIX_FMT_YUVA444P] = {
+.name = yuva444p,
+.nb_components = 4,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 0, 1, 0, 7 },/* Y */
+{ 1, 0, 1, 0, 7 },/* U */
+{ 2, 0, 1, 0, 7 },/* V */
+{ 3, 0, 1, 0, 7 },/* A */
+},
+.flags = PIX_FMT_PLANAR,
+},
 [AV_PIX_FMT_VDPAU_H264] = {
 .name = vdpau_h264,
 .log2_chroma_w = 1,
diff --git a/libswscale/utils.c b/libswscale/utils.c
index fcdd04a..8d04e27 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -108,6 +108,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
 [AV_PIX_FMT_YUV440P] = { 1, 1 },
 [AV_PIX_FMT_YUVJ440P]= { 1, 1 },
 [AV_PIX_FMT_YUVA420P]= { 1, 1 },
+[AV_PIX_FMT_YUVA422P]= { 1, 1 },
+[AV_PIX_FMT_YUVA444P]= { 1, 1 },
 [AV_PIX_FMT_RGB48BE] = { 1, 1 },
 [AV_PIX_FMT_RGB48LE] = { 1, 1 },
 [AV_PIX_FMT_RGB565BE]= { 1, 1 },
diff --git a/tests/ref/lavfi/pixdesc b/tests/ref/lavfi/pixdesc
index 5dfa270..dc1b857 100644
--- a/tests/ref/lavfi/pixdesc
+++ b/tests/ref/lavfi/pixdesc
@@ -57,6 +57,8 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4
 yuv444p9be  6ab31f4c12b533ce318ecdff83cdd054
 yuv444p9le  f0606604a5c08becab6ba500124c4b7c
 yuva420pa29884f3f3dfe1e00b961bc17bef3d47
+yuva422p92b6815f465297284cdb843711682cee
+yuva444pc523716e4900cfe515eaab1d7124fdd9
 yuvj420p32eec78ba51857b16ce9b813a49b7189
 yuvj422p0dfa0ed434f73be51428758c69e082cb
 yuvj440p657501a28004e27a592757a7509f5189
diff --git a/tests/ref/lavfi/pixfmts_copy b/tests/ref/lavfi/pixfmts_copy
index 5dfa270..dc1b857 100644
--- a/tests/ref/lavfi/pixfmts_copy
+++ b/tests/ref/lavfi/pixfmts_copy
@@ -57,6 +57,8 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4
 yuv444p9be  6ab31f4c12b533ce318ecdff83cdd054
 yuv444p9le  f0606604a5c08becab6ba500124c4b7c
 yuva420pa29884f3f3dfe1e00b961bc17bef3d47
+yuva422p92b6815f465297284cdb843711682cee
+yuva444pc523716e4900cfe515eaab1d7124fdd9
 yuvj420p32eec78ba51857b16ce9b813a49b7189
 yuvj422p0dfa0ed434f73be51428758c69e082cb
 yuvj440p657501a28004e27a592757a7509f5189
diff --git a/tests/ref/lavfi/pixfmts_null b/tests/ref/lavfi/pixfmts_null
index 5dfa270..dc1b857 100644
--- a/tests/ref/lavfi/pixfmts_null
+++ b/tests/ref/lavfi/pixfmts_null
@@ -57,6 +57,8 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4
 yuv444p9be  6ab31f4c12b533ce318ecdff83cdd054
 yuv444p9le  f0606604a5c08becab6ba500124c4b7c
 yuva420pa29884f3f3dfe1e00b961bc17bef3d47
+yuva422p92b6815f465297284cdb843711682cee
+yuva444pc523716e4900cfe515eaab1d7124fdd9
 yuvj420p32eec78ba51857b16ce9b813a49b7189
 yuvj422p0dfa0ed434f73be51428758c69e082cb
 yuvj440p657501a28004e27a592757a7509f5189
diff --git a/tests/ref/lavfi/pixfmts_scale b/tests/ref/lavfi/pixfmts_scale
index 4a5bf67..acd40e3 100644
--- a/tests/ref/lavfi/pixfmts_scale
+++ b/tests/ref/lavfi/pixfmts_scale
@@ -57,6 +57,8 @@ yuv444p16le a0c5d3c7bf3f181db503cf8e450d1335
 yuv444p9be  9ac2643ce7f7e5c4e17c8c9fd8494d4a
 yuv444p9le  

Re: [libav-devel] FFv1.3 support

2012-10-11 Thread Luca Barbato
On 10/05/2012 05:31 PM, Peter B. wrote:
 On 10/01/2012 05:30 PM, Luca Barbato wrote:
 I'm rebasing old patches supporting some pixel formats and possibly
 I'll have a look at ffv1 to see what really changed.
 In order to avoid misunderstandings, I wanted to ask if you are trying
 to merge the new FFv1.3 code into libav, or just the colorspaces?

It took me a bit of time, here the not clean yet version.

https://github.com/lu-zero/libav/tree/ffv1.3

lu


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


Re: [libav-devel] [PATCH] nut: support high depth pcm codecs

2012-10-11 Thread Janne Grunau
On 2012-10-11 14:39:14 +0200, Luca Barbato wrote:
 Give priority to the native tags when encoding.
 ---
  libavformat/nut.c| 20 
  libavformat/nut.h|  1 +
  libavformat/nutdec.c |  9 +++--
  libavformat/nutenc.c | 20 ++--
  4 files changed, 42 insertions(+), 8 deletions(-)
 
 diff --git a/libavformat/nut.c b/libavformat/nut.c
 index 4e46b98..0e866da 100644
 --- a/libavformat/nut.c
 +++ b/libavformat/nut.c
 @@ -89,6 +89,26 @@ const AVCodecTag ff_nut_video_tags[] = {
  { AV_CODEC_ID_NONE, 0 }
  };
  
 +const AVCodecTag ff_nut_audio_tags[] = {
 +{ AV_CODEC_ID_PCM_ALAW,  MKTAG('A', 'L', 'A', 'W') },
 +{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
 +{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
 +{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
 +{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },
 +{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) },
 +{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') },
 +{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) },
 +{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D',  8 ) },
 +{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') },
 +{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) },
 +{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') },
 +{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) },
 +{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
 +{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
 +{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D',  8 ) },
 +{ AV_CODEC_ID_NONE,  0 }
 +};
 +
  void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){
  int i;
  for(i=0; inut-avf-nb_streams; i++){
 diff --git a/libavformat/nut.h b/libavformat/nut.h
 index 3f09689..933b9c5 100644
 --- a/libavformat/nut.h
 +++ b/libavformat/nut.h
 @@ -105,6 +105,7 @@ typedef struct NUTContext {
  
  extern const AVCodecTag ff_nut_subtitle_tags[];
  extern const AVCodecTag ff_nut_video_tags[];
 +extern const AVCodecTag ff_nut_audio_tags[];
  
  typedef struct Dispositions {
  char str[9];
 diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
 index dd02aad..a3ff2e6 100644
 --- a/libavformat/nutdec.c
 +++ b/libavformat/nutdec.c
 @@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut)
  break;
  case 1:
  st-codec-codec_type = AVMEDIA_TYPE_AUDIO;
 -st-codec-codec_id   = ff_codec_get_id(ff_codec_wav_tags, tmp);
 +st-codec-codec_id   = av_codec_get_id((const AVCodecTag * const 
 []) {
 +ff_codec_wav_tags,
 +ff_nut_audio_tags,
 +0
 +},
 +tmp);
  break;
  case 2:
  st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
 @@ -993,6 +998,6 @@ AVInputFormat ff_nut_demuxer = {
  .extensions = nut,
  .codec_tag  = (const AVCodecTag * const []) {
  ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags,
 -ff_nut_subtitle_tags, 0
 +ff_nut_subtitle_tags, ff_nut_audio_tags, 0
  },

could share the nut_codec_tags from the encoder, but not really
important since it's unlikely that it'll be extended soon. ok as is

  };
 diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
 index 4b1e663..ba79d8f 100644
 --- a/libavformat/nutenc.c
 +++ b/libavformat/nutenc.c
 @@ -371,9 +371,16 @@ static void write_mainheader(NUTContext *nut, 
 AVIOContext *bc){
  }
  }
  
 +static const AVCodecTag * const nut_codec_tags[] = {
 +ff_nut_audio_tags, ff_nut_video_tags, ff_nut_subtitle_tags,
 +ff_codec_bmp_tags, ff_codec_wav_tags, 0
 +};
 +
  static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, 
 AVStream *st, int i){
  NUTContext *nut = avctx-priv_data;
  AVCodecContext *codec = st-codec;
 +unsigned codec_tag = av_codec_get_tag(nut_codec_tags, codec-codec_id);
 +
  ff_put_v(bc, i);
  switch(codec-codec_type){
  case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break;
 @@ -382,8 +389,12 @@ static int write_streamheader(AVFormatContext *avctx, 
 AVIOContext *bc, AVStream
  default  : ff_put_v(bc, 3); break;
  }
  ff_put_v(bc, 4);
 -if (codec-codec_tag){
 -avio_wl32(bc, codec-codec_tag);
 +
 +if (!codec_tag)
 +codec_tag = codec-codec_tag;
 +
 +if (codec_tag) {
 +avio_wl32(bc, codec_tag);
  } else {
  av_log(avctx, AV_LOG_ERROR, No codec tag defined for stream %d\n, 
 i);
  return AVERROR(EINVAL);
 @@ -873,8 +884,5 @@ AVOutputFormat ff_nut_muxer = {
  .write_packet   = nut_write_packet,
  .write_trailer  = nut_write_trailer,
  .flags  = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
 -.codec_tag  = 

[libav-devel] Improve PCM support in nut

2012-10-11 Thread Luca Barbato
Here is the patch broken in 3, I'd squash it if is ok.

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


[libav-devel] [PATCH 1/3] nut: support high depth pcm codecs

2012-10-11 Thread Luca Barbato
Give priority to the native tags when encoding.
---
 libavformat/nut.c| 20 
 libavformat/nut.h|  1 +
 libavformat/nutdec.c |  9 +++--
 libavformat/nutenc.c | 20 ++--
 4 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/libavformat/nut.c b/libavformat/nut.c
index 4e46b98..0e866da 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -89,6 +89,26 @@ const AVCodecTag ff_nut_video_tags[] = {
 { AV_CODEC_ID_NONE, 0 }
 };
 
+const AVCodecTag ff_nut_audio_tags[] = {
+{ AV_CODEC_ID_PCM_ALAW,  MKTAG('A', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
+{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) },
+{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D',  8 ) },
+{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) },
+{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) },
+{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D',  8 ) },
+{ AV_CODEC_ID_NONE,  0 }
+};
+
 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){
 int i;
 for(i=0; inut-avf-nb_streams; i++){
diff --git a/libavformat/nut.h b/libavformat/nut.h
index 3f09689..933b9c5 100644
--- a/libavformat/nut.h
+++ b/libavformat/nut.h
@@ -105,6 +105,7 @@ typedef struct NUTContext {
 
 extern const AVCodecTag ff_nut_subtitle_tags[];
 extern const AVCodecTag ff_nut_video_tags[];
+extern const AVCodecTag ff_nut_audio_tags[];
 
 typedef struct Dispositions {
 char str[9];
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index dd02aad..a3ff2e6 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut)
 break;
 case 1:
 st-codec-codec_type = AVMEDIA_TYPE_AUDIO;
-st-codec-codec_id   = ff_codec_get_id(ff_codec_wav_tags, tmp);
+st-codec-codec_id   = av_codec_get_id((const AVCodecTag * const []) {
+ff_codec_wav_tags,
+ff_nut_audio_tags,
+0
+},
+tmp);
 break;
 case 2:
 st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
@@ -993,6 +998,6 @@ AVInputFormat ff_nut_demuxer = {
 .extensions = nut,
 .codec_tag  = (const AVCodecTag * const []) {
 ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags,
-ff_nut_subtitle_tags, 0
+ff_nut_subtitle_tags, ff_nut_audio_tags, 0
 },
 };
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 4b1e663..ba79d8f 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -371,9 +371,16 @@ static void write_mainheader(NUTContext *nut, AVIOContext 
*bc){
 }
 }
 
+static const AVCodecTag * const nut_codec_tags[] = {
+ff_nut_audio_tags, ff_nut_video_tags, ff_nut_subtitle_tags,
+ff_codec_bmp_tags, ff_codec_wav_tags, 0
+};
+
 static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, 
AVStream *st, int i){
 NUTContext *nut = avctx-priv_data;
 AVCodecContext *codec = st-codec;
+unsigned codec_tag = av_codec_get_tag(nut_codec_tags, codec-codec_id);
+
 ff_put_v(bc, i);
 switch(codec-codec_type){
 case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break;
@@ -382,8 +389,12 @@ static int write_streamheader(AVFormatContext *avctx, 
AVIOContext *bc, AVStream
 default  : ff_put_v(bc, 3); break;
 }
 ff_put_v(bc, 4);
-if (codec-codec_tag){
-avio_wl32(bc, codec-codec_tag);
+
+if (!codec_tag)
+codec_tag = codec-codec_tag;
+
+if (codec_tag) {
+avio_wl32(bc, codec_tag);
 } else {
 av_log(avctx, AV_LOG_ERROR, No codec tag defined for stream %d\n, i);
 return AVERROR(EINVAL);
@@ -873,8 +884,5 @@ AVOutputFormat ff_nut_muxer = {
 .write_packet   = nut_write_packet,
 .write_trailer  = nut_write_trailer,
 .flags  = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
-.codec_tag  = (const AVCodecTag * const []){
-ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags,
-ff_nut_subtitle_tags, 0
-},
+.codec_tag  = nut_codec_tags,
 };
-- 
1.7.12

___
libav-devel mailing list
libav-devel@libav.org

[libav-devel] [PATCH 2/3] nut: support float PCM

2012-10-11 Thread Luca Barbato
---
 libavformat/nut.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/nut.c b/libavformat/nut.c
index 0e866da..72b7575 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -92,6 +92,10 @@ const AVCodecTag ff_nut_video_tags[] = {
 const AVCodecTag ff_nut_audio_tags[] = {
 { AV_CODEC_ID_PCM_ALAW,  MKTAG('A', 'L', 'A', 'W') },
 { AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_F32BE, MKTAG(32 , 'D', 'F', 'P') },
+{ AV_CODEC_ID_PCM_F32LE, MKTAG('P', 'F', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_F64BE, MKTAG(64 , 'D', 'F', 'P') },
+{ AV_CODEC_ID_PCM_F64LE, MKTAG('P', 'F', 'D', 64 ) },
 { AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
 { AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
 { AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },
-- 
1.7.12

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


[libav-devel] [PATCH 3/3] nut: pcm planar support

2012-10-11 Thread Luca Barbato
---
 doc/nut.texi  | 2 +-
 libavformat/nut.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/nut.texi b/doc/nut.texi
index dafbb39..1c23934 100644
--- a/doc/nut.texi
+++ b/doc/nut.texi
@@ -50,7 +50,7 @@ to be read big-endian.
 @end multitable
 
 type is S for signed integer, U for unsigned integer, F for IEEE float
-interleaving is D for default, as a historical artefact.
+interleaving is D for default, P is for planar.
 bits is 8/16/24/32
 
 @example
diff --git a/libavformat/nut.c b/libavformat/nut.c
index 72b7575..cf63fc9 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -110,6 +110,8 @@ const AVCodecTag ff_nut_audio_tags[] = {
 { AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
 { AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
 { AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D',  8 ) },
+{ AV_CODEC_ID_PCM_S8_PLANAR,MKTAG('P', 'S', 'P',   8 ) },
+{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P',  16 ) },
 { AV_CODEC_ID_NONE,  0 }
 };
 
-- 
1.7.12

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


Re: [libav-devel] [PATCH] avutil: add yuva422p and yuva444p formats

2012-10-11 Thread Luca Barbato
On 10/12/2012 12:46 AM, Janne Grunau wrote:
 On 2012-10-12 00:21:18 +0200, Luca Barbato wrote:
 ---

 Rebased, if nobody is against it I'd push it

  libavcodec/utils.c|  2 ++
  libavutil/pixdesc.c   | 26 ++
  libswscale/utils.c|  2 ++
  tests/ref/lavfi/pixdesc   |  2 ++
  tests/ref/lavfi/pixfmts_copy  |  2 ++
  tests/ref/lavfi/pixfmts_null  |  2 ++
  tests/ref/lavfi/pixfmts_scale |  2 ++
  tests/ref/lavfi/pixfmts_vflip |  2 ++
 
 I'm missing a change to libavutil/pixfmt.h AV_PIX_FMT_YUVA422P and
 AV_PIX_FMT_YUVA444P should be undefined with this patch.
 

Let me update it, looks like I botched that part...

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


[libav-devel] [PATCH] avutil: add yuva422p and yuva444p formats

2012-10-11 Thread Luca Barbato
---

One hunk ended up in the ffv1.3 patch...

 libavcodec/utils.c|  2 ++
 libavutil/pixdesc.c   | 26 ++
 libavutil/pixfmt.h|  2 ++
 libswscale/utils.c|  2 ++
 tests/ref/lavfi/pixdesc   |  2 ++
 tests/ref/lavfi/pixfmts_copy  |  2 ++
 tests/ref/lavfi/pixfmts_null  |  2 ++
 tests/ref/lavfi/pixfmts_scale |  2 ++
 tests/ref/lavfi/pixfmts_vflip |  2 ++
 9 files changed, 42 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 48d6348..5cbf36a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -180,6 +180,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int 
*width, int *height,
 case AV_PIX_FMT_YUVJ440P:
 case AV_PIX_FMT_YUVJ444P:
 case AV_PIX_FMT_YUVA420P:
+case AV_PIX_FMT_YUVA422P:
+case AV_PIX_FMT_YUVA444P:
 case AV_PIX_FMT_YUV420P9LE:
 case AV_PIX_FMT_YUV420P9BE:
 case AV_PIX_FMT_YUV420P10LE:
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index f5098a7..bb23460 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -527,6 +527,32 @@ const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 },
 .flags = PIX_FMT_PLANAR,
 },
+[AV_PIX_FMT_YUVA422P] = {
+.name = yuva422p,
+.nb_components = 4,
+.log2_chroma_w = 1,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 0, 1, 0, 7 },/* Y */
+{ 1, 0, 1, 0, 7 },/* U */
+{ 2, 0, 1, 0, 7 },/* V */
+{ 3, 0, 1, 0, 7 },/* A */
+},
+.flags = PIX_FMT_PLANAR,
+},
+[AV_PIX_FMT_YUVA444P] = {
+.name = yuva444p,
+.nb_components = 4,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 0, 1, 0, 7 },/* Y */
+{ 1, 0, 1, 0, 7 },/* U */
+{ 2, 0, 1, 0, 7 },/* V */
+{ 3, 0, 1, 0, 7 },/* A */
+},
+.flags = PIX_FMT_PLANAR,
+},
 [AV_PIX_FMT_VDPAU_H264] = {
 .name = vdpau_h264,
 .log2_chroma_w = 1,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index fbc2845..b11a034 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -158,6 +158,8 @@ enum AVPixelFormat {
 AV_PIX_FMT_GBRP10LE,  /// planar GBR 4:4:4 30bpp, little endian
 AV_PIX_FMT_GBRP16BE,  /// planar GBR 4:4:4 48bpp, big endian
 AV_PIX_FMT_GBRP16LE,  /// planar GBR 4:4:4 48bpp, little endian
+AV_PIX_FMT_YUVA422P,  /// planar YUV 4:2:2 24bpp, (1 Cr  Cb sample per 
2x1 Y  A samples)
+AV_PIX_FMT_YUVA444P,  /// planar YUV 4:4:4 32bpp, (1 Cr  Cb sample per 
1x1 Y  A samples)
 AV_PIX_FMT_NB,/// number of pixel formats, DO NOT USE THIS if you 
want to link with shared libav* because the number of formats might differ 
between versions
 
 #if FF_API_PIX_FMT
diff --git a/libswscale/utils.c b/libswscale/utils.c
index fcdd04a..8d04e27 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -108,6 +108,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
 [AV_PIX_FMT_YUV440P] = { 1, 1 },
 [AV_PIX_FMT_YUVJ440P]= { 1, 1 },
 [AV_PIX_FMT_YUVA420P]= { 1, 1 },
+[AV_PIX_FMT_YUVA422P]= { 1, 1 },
+[AV_PIX_FMT_YUVA444P]= { 1, 1 },
 [AV_PIX_FMT_RGB48BE] = { 1, 1 },
 [AV_PIX_FMT_RGB48LE] = { 1, 1 },
 [AV_PIX_FMT_RGB565BE]= { 1, 1 },
diff --git a/tests/ref/lavfi/pixdesc b/tests/ref/lavfi/pixdesc
index 5dfa270..dc1b857 100644
--- a/tests/ref/lavfi/pixdesc
+++ b/tests/ref/lavfi/pixdesc
@@ -57,6 +57,8 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4
 yuv444p9be  6ab31f4c12b533ce318ecdff83cdd054
 yuv444p9le  f0606604a5c08becab6ba500124c4b7c
 yuva420pa29884f3f3dfe1e00b961bc17bef3d47
+yuva422p92b6815f465297284cdb843711682cee
+yuva444pc523716e4900cfe515eaab1d7124fdd9
 yuvj420p32eec78ba51857b16ce9b813a49b7189
 yuvj422p0dfa0ed434f73be51428758c69e082cb
 yuvj440p657501a28004e27a592757a7509f5189
diff --git a/tests/ref/lavfi/pixfmts_copy b/tests/ref/lavfi/pixfmts_copy
index 5dfa270..dc1b857 100644
--- a/tests/ref/lavfi/pixfmts_copy
+++ b/tests/ref/lavfi/pixfmts_copy
@@ -57,6 +57,8 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4
 yuv444p9be  6ab31f4c12b533ce318ecdff83cdd054
 yuv444p9le  f0606604a5c08becab6ba500124c4b7c
 yuva420pa29884f3f3dfe1e00b961bc17bef3d47
+yuva422p92b6815f465297284cdb843711682cee
+yuva444pc523716e4900cfe515eaab1d7124fdd9
 yuvj420p32eec78ba51857b16ce9b813a49b7189
 yuvj422p0dfa0ed434f73be51428758c69e082cb
 yuvj440p657501a28004e27a592757a7509f5189
diff --git a/tests/ref/lavfi/pixfmts_null b/tests/ref/lavfi/pixfmts_null
index 5dfa270..dc1b857 100644
--- a/tests/ref/lavfi/pixfmts_null
+++ b/tests/ref/lavfi/pixfmts_null
@@ -57,6 +57,8 @@ yuv444p16le 

Re: [libav-devel] [PATCH 2/3] nut: support float PCM

2012-10-11 Thread Janne Grunau
On 2012-10-12 01:01:15 +0200, Luca Barbato wrote:
 ---
  libavformat/nut.c | 4 
  1 file changed, 4 insertions(+)
 
 diff --git a/libavformat/nut.c b/libavformat/nut.c
 index 0e866da..72b7575 100644
 --- a/libavformat/nut.c
 +++ b/libavformat/nut.c
 @@ -92,6 +92,10 @@ const AVCodecTag ff_nut_video_tags[] = {
  const AVCodecTag ff_nut_audio_tags[] = {
  { AV_CODEC_ID_PCM_ALAW,  MKTAG('A', 'L', 'A', 'W') },
  { AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
 +{ AV_CODEC_ID_PCM_F32BE, MKTAG(32 , 'D', 'F', 'P') },
 +{ AV_CODEC_ID_PCM_F32LE, MKTAG('P', 'F', 'D', 32 ) },
 +{ AV_CODEC_ID_PCM_F64BE, MKTAG(64 , 'D', 'F', 'P') },
 +{ AV_CODEC_ID_PCM_F64LE, MKTAG('P', 'F', 'D', 64 ) },
  { AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
  { AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
  { AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },

ok

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


Re: [libav-devel] [PATCH 3/3] nut: pcm planar support

2012-10-11 Thread Janne Grunau
On 2012-10-12 01:01:16 +0200, Luca Barbato wrote:
 ---
  doc/nut.texi  | 2 +-
  libavformat/nut.c | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/doc/nut.texi b/doc/nut.texi
 index dafbb39..1c23934 100644
 --- a/doc/nut.texi
 +++ b/doc/nut.texi
 @@ -50,7 +50,7 @@ to be read big-endian.
  @end multitable
  
  type is S for signed integer, U for unsigned integer, F for IEEE float
 -interleaving is D for default, as a historical artefact.
 +interleaving is D for default, P is for planar.
  bits is 8/16/24/32
  
  @example
 diff --git a/libavformat/nut.c b/libavformat/nut.c
 index 72b7575..cf63fc9 100644
 --- a/libavformat/nut.c
 +++ b/libavformat/nut.c
 @@ -110,6 +110,8 @@ const AVCodecTag ff_nut_audio_tags[] = {
  { AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
  { AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
  { AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D',  8 ) },
 +{ AV_CODEC_ID_PCM_S8_PLANAR,MKTAG('P', 'S', 'P',   8 ) },
 +{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P',  16 ) },
  { AV_CODEC_ID_NONE,  0 }
  };

looks ok

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


[libav-devel] [PATCH] nut: cosmetic

2012-10-11 Thread Luca Barbato
Align the tags in ff_nut_audio_tags.
---
 libavformat/nut.c | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/libavformat/nut.c b/libavformat/nut.c
index cf63fc9..57bc017 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -90,29 +90,29 @@ const AVCodecTag ff_nut_video_tags[] = {
 };
 
 const AVCodecTag ff_nut_audio_tags[] = {
-{ AV_CODEC_ID_PCM_ALAW,  MKTAG('A', 'L', 'A', 'W') },
-{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
-{ AV_CODEC_ID_PCM_F32BE, MKTAG(32 , 'D', 'F', 'P') },
-{ AV_CODEC_ID_PCM_F32LE, MKTAG('P', 'F', 'D', 32 ) },
-{ AV_CODEC_ID_PCM_F64BE, MKTAG(64 , 'D', 'F', 'P') },
-{ AV_CODEC_ID_PCM_F64LE, MKTAG('P', 'F', 'D', 64 ) },
-{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
-{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
-{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },
-{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) },
-{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') },
-{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) },
-{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D',  8 ) },
-{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') },
-{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) },
-{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') },
-{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) },
-{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
-{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
-{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D',  8 ) },
-{ AV_CODEC_ID_PCM_S8_PLANAR,MKTAG('P', 'S', 'P',   8 ) },
-{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P',  16 ) },
-{ AV_CODEC_ID_NONE,  0 }
+{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_MULAW,MKTAG('U', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_F32BE,MKTAG(32 , 'D', 'F', 'P') },
+{ AV_CODEC_ID_PCM_F32LE,MKTAG('P', 'F', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_F64BE,MKTAG(64 , 'D', 'F', 'P') },
+{ AV_CODEC_ID_PCM_F64LE,MKTAG('P', 'F', 'D', 64 ) },
+{ AV_CODEC_ID_PCM_S16BE,MKTAG(16 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S16LE,MKTAG('P', 'S', 'D', 16 ) },
+{ AV_CODEC_ID_PCM_S24BE,MKTAG(24 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S24LE,MKTAG('P', 'S', 'D', 24 ) },
+{ AV_CODEC_ID_PCM_S32BE,MKTAG(32 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S32LE,MKTAG('P', 'S', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_S8,   MKTAG('P', 'S', 'D',  8 ) },
+{ AV_CODEC_ID_PCM_U16BE,MKTAG(16 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U16LE,MKTAG('P', 'U', 'D', 16 ) },
+{ AV_CODEC_ID_PCM_U24BE,MKTAG(24 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U24LE,MKTAG('P', 'U', 'D', 24 ) },
+{ AV_CODEC_ID_PCM_U32BE,MKTAG(32 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U32LE,MKTAG('P', 'U', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_U8,   MKTAG('P', 'U', 'D',  8 ) },
+{ AV_CODEC_ID_PCM_S8_PLANAR,MKTAG('P', 'S', 'P',  8 ) },
+{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) },
+{ AV_CODEC_ID_NONE, 0 }
 };
 
 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){
-- 
1.7.12

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


Re: [libav-devel] [PATCH] avutil: add yuva422p and yuva444p formats

2012-10-11 Thread Janne Grunau
On 2012-10-12 01:08:10 +0200, Luca Barbato wrote:
 ---
 
 One hunk ended up in the ffv1.3 patch...
 
  libavcodec/utils.c|  2 ++
  libavutil/pixdesc.c   | 26 ++
  libavutil/pixfmt.h|  2 ++
  libswscale/utils.c|  2 ++
  tests/ref/lavfi/pixdesc   |  2 ++
  tests/ref/lavfi/pixfmts_copy  |  2 ++
  tests/ref/lavfi/pixfmts_null  |  2 ++
  tests/ref/lavfi/pixfmts_scale |  2 ++
  tests/ref/lavfi/pixfmts_vflip |  2 ++
  9 files changed, 42 insertions(+)
 
 diff --git a/libavcodec/utils.c b/libavcodec/utils.c
 index 48d6348..5cbf36a 100644
 --- a/libavcodec/utils.c
 +++ b/libavcodec/utils.c
 @@ -180,6 +180,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int 
 *width, int *height,
  case AV_PIX_FMT_YUVJ440P:
  case AV_PIX_FMT_YUVJ444P:
  case AV_PIX_FMT_YUVA420P:
 +case AV_PIX_FMT_YUVA422P:
 +case AV_PIX_FMT_YUVA444P:
  case AV_PIX_FMT_YUV420P9LE:
  case AV_PIX_FMT_YUV420P9BE:
  case AV_PIX_FMT_YUV420P10LE:
 diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
 index f5098a7..bb23460 100644
 --- a/libavutil/pixdesc.c
 +++ b/libavutil/pixdesc.c
 @@ -527,6 +527,32 @@ const AVPixFmtDescriptor 
 av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
  },
  .flags = PIX_FMT_PLANAR,
  },
 +[AV_PIX_FMT_YUVA422P] = {
 +.name = yuva422p,
 +.nb_components = 4,
 +.log2_chroma_w = 1,
 +.log2_chroma_h = 0,
 +.comp = {
 +{ 0, 0, 1, 0, 7 },/* Y */
 +{ 1, 0, 1, 0, 7 },/* U */
 +{ 2, 0, 1, 0, 7 },/* V */
 +{ 3, 0, 1, 0, 7 },/* A */
 +},
 +.flags = PIX_FMT_PLANAR,
 +},
 +[AV_PIX_FMT_YUVA444P] = {
 +.name = yuva444p,
 +.nb_components = 4,
 +.log2_chroma_w = 0,
 +.log2_chroma_h = 0,
 +.comp = {
 +{ 0, 0, 1, 0, 7 },/* Y */
 +{ 1, 0, 1, 0, 7 },/* U */
 +{ 2, 0, 1, 0, 7 },/* V */
 +{ 3, 0, 1, 0, 7 },/* A */
 +},
 +.flags = PIX_FMT_PLANAR,
 +},
  [AV_PIX_FMT_VDPAU_H264] = {
  .name = vdpau_h264,
  .log2_chroma_w = 1,
 diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
 index fbc2845..b11a034 100644
 --- a/libavutil/pixfmt.h
 +++ b/libavutil/pixfmt.h
 @@ -158,6 +158,8 @@ enum AVPixelFormat {
  AV_PIX_FMT_GBRP10LE,  /// planar GBR 4:4:4 30bpp, little endian
  AV_PIX_FMT_GBRP16BE,  /// planar GBR 4:4:4 48bpp, big endian
  AV_PIX_FMT_GBRP16LE,  /// planar GBR 4:4:4 48bpp, little endian
 +AV_PIX_FMT_YUVA422P,  /// planar YUV 4:2:2 24bpp, (1 Cr  Cb sample per 
 2x1 Y  A samples)
 +AV_PIX_FMT_YUVA444P,  /// planar YUV 4:4:4 32bpp, (1 Cr  Cb sample per 
 1x1 Y  A samples)
  AV_PIX_FMT_NB,/// number of pixel formats, DO NOT USE THIS if 
 you want to link with shared libav* because the number of formats might 
 differ between versions
  
  #if FF_API_PIX_FMT


libavutil changes are ok

 diff --git a/libswscale/utils.c b/libswscale/utils.c
 index fcdd04a..8d04e27 100644
 --- a/libswscale/utils.c
 +++ b/libswscale/utils.c
 @@ -108,6 +108,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
  [AV_PIX_FMT_YUV440P] = { 1, 1 },
  [AV_PIX_FMT_YUVJ440P]= { 1, 1 },
  [AV_PIX_FMT_YUVA420P]= { 1, 1 },
 +[AV_PIX_FMT_YUVA422P]= { 1, 1 },
 +[AV_PIX_FMT_YUVA444P]= { 1, 1 },
  [AV_PIX_FMT_RGB48BE] = { 1, 1 },
  [AV_PIX_FMT_RGB48LE] = { 1, 1 },
  [AV_PIX_FMT_RGB565BE]= { 1, 1 },

is this really enough to support new pixel formats? swscale can use
pixel format descriptor in the general scaler?


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


Re: [libav-devel] [PATCH] nut: cosmetic

2012-10-11 Thread Janne Grunau
On 2012-10-12 01:25:35 +0200, Luca Barbato wrote:
 Align the tags in ff_nut_audio_tags.
 ---
  libavformat/nut.c | 46 +++---
  1 file changed, 23 insertions(+), 23 deletions(-)

ok I guess

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


Re: [libav-devel] [PATCH] avutil: add yuva422p and yuva444p formats

2012-10-11 Thread Luca Barbato
On 10/12/2012 01:24 AM, Janne Grunau wrote:
 On 2012-10-12 01:08:10 +0200, Luca Barbato wrote:
 ---

 One hunk ended up in the ffv1.3 patch...

  libavcodec/utils.c|  2 ++
  libavutil/pixdesc.c   | 26 ++
  libavutil/pixfmt.h|  2 ++
  libswscale/utils.c|  2 ++
  tests/ref/lavfi/pixdesc   |  2 ++
  tests/ref/lavfi/pixfmts_copy  |  2 ++
  tests/ref/lavfi/pixfmts_null  |  2 ++
  tests/ref/lavfi/pixfmts_scale |  2 ++
  tests/ref/lavfi/pixfmts_vflip |  2 ++
  9 files changed, 42 insertions(+)

 diff --git a/libavcodec/utils.c b/libavcodec/utils.c
 index 48d6348..5cbf36a 100644
 --- a/libavcodec/utils.c
 +++ b/libavcodec/utils.c
 @@ -180,6 +180,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int 
 *width, int *height,
  case AV_PIX_FMT_YUVJ440P:
  case AV_PIX_FMT_YUVJ444P:
  case AV_PIX_FMT_YUVA420P:
 +case AV_PIX_FMT_YUVA422P:
 +case AV_PIX_FMT_YUVA444P:
  case AV_PIX_FMT_YUV420P9LE:
  case AV_PIX_FMT_YUV420P9BE:
  case AV_PIX_FMT_YUV420P10LE:
 diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
 index f5098a7..bb23460 100644
 --- a/libavutil/pixdesc.c
 +++ b/libavutil/pixdesc.c
 @@ -527,6 +527,32 @@ const AVPixFmtDescriptor 
 av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
  },
  .flags = PIX_FMT_PLANAR,
  },
 +[AV_PIX_FMT_YUVA422P] = {
 +.name = yuva422p,
 +.nb_components = 4,
 +.log2_chroma_w = 1,
 +.log2_chroma_h = 0,
 +.comp = {
 +{ 0, 0, 1, 0, 7 },/* Y */
 +{ 1, 0, 1, 0, 7 },/* U */
 +{ 2, 0, 1, 0, 7 },/* V */
 +{ 3, 0, 1, 0, 7 },/* A */
 +},
 +.flags = PIX_FMT_PLANAR,
 +},
 +[AV_PIX_FMT_YUVA444P] = {
 +.name = yuva444p,
 +.nb_components = 4,
 +.log2_chroma_w = 0,
 +.log2_chroma_h = 0,
 +.comp = {
 +{ 0, 0, 1, 0, 7 },/* Y */
 +{ 1, 0, 1, 0, 7 },/* U */
 +{ 2, 0, 1, 0, 7 },/* V */
 +{ 3, 0, 1, 0, 7 },/* A */
 +},
 +.flags = PIX_FMT_PLANAR,
 +},
  [AV_PIX_FMT_VDPAU_H264] = {
  .name = vdpau_h264,
  .log2_chroma_w = 1,
 diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
 index fbc2845..b11a034 100644
 --- a/libavutil/pixfmt.h
 +++ b/libavutil/pixfmt.h
 @@ -158,6 +158,8 @@ enum AVPixelFormat {
  AV_PIX_FMT_GBRP10LE,  /// planar GBR 4:4:4 30bpp, little endian
  AV_PIX_FMT_GBRP16BE,  /// planar GBR 4:4:4 48bpp, big endian
  AV_PIX_FMT_GBRP16LE,  /// planar GBR 4:4:4 48bpp, little endian
 +AV_PIX_FMT_YUVA422P,  /// planar YUV 4:2:2 24bpp, (1 Cr  Cb sample 
 per 2x1 Y  A samples)
 +AV_PIX_FMT_YUVA444P,  /// planar YUV 4:4:4 32bpp, (1 Cr  Cb sample 
 per 1x1 Y  A samples)
  AV_PIX_FMT_NB,/// number of pixel formats, DO NOT USE THIS if 
 you want to link with shared libav* because the number of formats might 
 differ between versions
  
  #if FF_API_PIX_FMT
 
 
 libavutil changes are ok
 
 diff --git a/libswscale/utils.c b/libswscale/utils.c
 index fcdd04a..8d04e27 100644
 --- a/libswscale/utils.c
 +++ b/libswscale/utils.c
 @@ -108,6 +108,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = 
 {
  [AV_PIX_FMT_YUV440P] = { 1, 1 },
  [AV_PIX_FMT_YUVJ440P]= { 1, 1 },
  [AV_PIX_FMT_YUVA420P]= { 1, 1 },
 +[AV_PIX_FMT_YUVA422P]= { 1, 1 },
 +[AV_PIX_FMT_YUVA444P]= { 1, 1 },
  [AV_PIX_FMT_RGB48BE] = { 1, 1 },
  [AV_PIX_FMT_RGB48LE] = { 1, 1 },
  [AV_PIX_FMT_RGB565BE]= { 1, 1 },
 
 is this really enough to support new pixel formats? swscale can use
 pixel format descriptor in the general scaler?

Yes, but just for the non-rgb-planar formats (that's why Derek patch had
problems and I'm not happy yet with my solution to support it)

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


[libav-devel] [PATCH] nut: support high depth pcm codecs

2012-10-11 Thread Luca Barbato
Give priority to the native tags when encoding.
Update fate refs due the change of tags in use.
---
Made sure fate remains green.

 libavformat/nut.c|  20 +++
 libavformat/nut.h|   1 +
 libavformat/nutdec.c |   9 +++-
 libavformat/nutenc.c |  20 ---
 tests/ref/lavfi/crop |   2 +-
 tests/ref/lavfi/crop_scale   |   2 +-
 tests/ref/lavfi/crop_scale_vflip |   2 +-
 tests/ref/lavfi/crop_vflip   |   2 +-
 tests/ref/lavfi/null |   2 +-
 tests/ref/lavfi/pixdesc  | 114 +++
 tests/ref/lavfi/pixfmts_copy | 114 +++
 tests/ref/lavfi/pixfmts_crop |  82 ++--
 tests/ref/lavfi/pixfmts_hflip|  82 ++--
 tests/ref/lavfi/pixfmts_null | 114 +++
 tests/ref/lavfi/pixfmts_pad  |  34 ++--
 tests/ref/lavfi/pixfmts_scale| 114 +++
 tests/ref/lavfi/pixfmts_vflip| 114 +++
 tests/ref/lavfi/scale200 |   2 +-
 tests/ref/lavfi/scale500 |   2 +-
 tests/ref/lavfi/vflip|   2 +-
 tests/ref/lavfi/vflip_crop   |   2 +-
 tests/ref/lavfi/vflip_vflip  |   2 +-
 22 files changed, 436 insertions(+), 402 deletions(-)

diff --git a/libavformat/nut.c b/libavformat/nut.c
index 6a68e28..ea6ff23 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -89,6 +89,26 @@ const AVCodecTag ff_nut_video_tags[] = {
 { AV_CODEC_ID_NONE, 0 }
 };
 
+const AVCodecTag ff_nut_audio_tags[] = {
+{ AV_CODEC_ID_PCM_ALAW,  MKTAG('A', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
+{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
+{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) },
+{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') },
+{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D',  8 ) },
+{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) },
+{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) },
+{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
+{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
+{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D',  8 ) },
+{ AV_CODEC_ID_NONE,  0 }
+};
+
 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){
 int i;
 for(i=0; inut-avf-nb_streams; i++){
diff --git a/libavformat/nut.h b/libavformat/nut.h
index 3f09689..933b9c5 100644
--- a/libavformat/nut.h
+++ b/libavformat/nut.h
@@ -105,6 +105,7 @@ typedef struct NUTContext {
 
 extern const AVCodecTag ff_nut_subtitle_tags[];
 extern const AVCodecTag ff_nut_video_tags[];
+extern const AVCodecTag ff_nut_audio_tags[];
 
 typedef struct Dispositions {
 char str[9];
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index dd02aad..a3ff2e6 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut)
 break;
 case 1:
 st-codec-codec_type = AVMEDIA_TYPE_AUDIO;
-st-codec-codec_id   = ff_codec_get_id(ff_codec_wav_tags, tmp);
+st-codec-codec_id   = av_codec_get_id((const AVCodecTag * const []) {
+ff_codec_wav_tags,
+ff_nut_audio_tags,
+0
+},
+tmp);
 break;
 case 2:
 st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
@@ -993,6 +998,6 @@ AVInputFormat ff_nut_demuxer = {
 .extensions = nut,
 .codec_tag  = (const AVCodecTag * const []) {
 ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags,
-ff_nut_subtitle_tags, 0
+ff_nut_subtitle_tags, ff_nut_audio_tags, 0
 },
 };
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 4b1e663..ba79d8f 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -371,9 +371,16 @@ static void write_mainheader(NUTContext *nut, AVIOContext 
*bc){
 }
 }
 
+static const AVCodecTag * const nut_codec_tags[] = {
+ff_nut_audio_tags, ff_nut_video_tags, ff_nut_subtitle_tags,
+ff_codec_bmp_tags, ff_codec_wav_tags, 0
+};
+
 static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, 
AVStream *st, int i){
 NUTContext *nut = avctx-priv_data;
 AVCodecContext *codec = st-codec;
+unsigned codec_tag = av_codec_get_tag(nut_codec_tags, codec-codec_id);
+
 

[libav-devel] [PATCH] mov: Do not apply dts shift from edit lists coming from data tracks.

2012-10-11 Thread Alex Converse
Some files in the wild have time code tracks with very negative initial
offsets.
---
 libavformat/mov.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 63049f5..2a41dd5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1790,7 +1790,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
 AVIndexEntry *mem;
 
 /* adjust first dts according to edit list */
-if (sc-time_offset  mov-time_scale  0) {
+if (sc-time_offset  mov-time_scale  0  st-codec-codec_type != 
AVMEDIA_TYPE_DATA) {
 if (sc-time_offset  0)
 sc-time_offset = av_rescale(sc-time_offset, sc-time_scale, 
mov-time_scale);
 current_dts = -sc-time_offset;
-- 
1.7.7.3

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