Re: [libav-devel] [PATCH 3/3] avconv: warn about inappropriate output stream format

2012-10-24 Thread Kostya Shishkov
On Wed, Oct 24, 2012 at 09:27:57PM +0200, Luca Barbato wrote:
> On 10/24/2012 04:15 PM, Tomas Härdin wrote:
> > Oh boy, here we go.
> > 
> > On Wed, 2012-10-24 at 12:10 +0200, Kostya Shishkov wrote:
> >> @@ -1605,6 +1606,12 @@ static int transcode_init(void)
> >>  codec->codec_tag = icodec->codec_tag;
> >>  }
> >>  
> >> +desc = avcodec_descriptor_get(codec->codec_id);
> >> +if (desc && (desc->props & AV_CODEC_PROP_IDIOTIC)) {
> > 
> > AV_CODEC_PROP_IDIOTIC? How professional.
> 
> Surely AV_CODEC_PROP_DISCOURAGED with a -strict suggest mode to output a
> rationale on why certain codecs should not be generally used beside for
> compatibility, might be a good service.
> 
> The patchset as it doesn't really help anybody since "idiotic" as for
> "lovely" is one of those English words with too many meanings and nuances.

This patchset was not serious and it should be obvious from the property name
selection. But I hoped it might encourage people do something good instead.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/4] aacdec: use float planar sample format for output

2012-10-24 Thread Alex Converse
On Sun, Oct 14, 2012 at 2:40 PM, Justin Ruggles
 wrote:
> ---
>  libavcodec/aac.h|7 ++-
>  libavcodec/aacdec.c |  104 
> +++
>  libavcodec/aacsbr.c |6 +--
>  3 files changed, 69 insertions(+), 48 deletions(-)
>
> diff --git a/libavcodec/aac.h b/libavcodec/aac.h
> index 32baf9d..70470dd 100644
> --- a/libavcodec/aac.h
> +++ b/libavcodec/aac.h
> @@ -237,9 +237,10 @@ typedef struct SingleChannelElement {
>  uint8_t zeroes[128];///< band is not coded 
> (used by encoder)
>  DECLARE_ALIGNED(32, float,   coeffs)[1024]; ///< coefficients for 
> IMDCT
>  DECLARE_ALIGNED(32, float,   saved)[1024];  ///< overlap
> -DECLARE_ALIGNED(32, float,   ret)[2048];///< PCM output
> +DECLARE_ALIGNED(32, float,   ret_buf)[2048];///< PCM output buffer
>  DECLARE_ALIGNED(16, float,   ltp_state)[3072];  ///< time signal for LTP
>  PredictorState predictor_state[MAX_PREDICTORS];
> +float *ret; ///< PCM output
>  } SingleChannelElement;
>

[...]

> +static int frame_configure_elements(AVCodecContext *avctx, int get_new_frame)
> +{
> +AACContext *ac = avctx->priv_data;
> +int type, id;
> +
> +/* set channel pointers to internal buffers by default */
> +for (type = 0; type < 4; type++) {
> +for (id = 0; id < MAX_ELEM_ID; id++) {
> +ChannelElement *che = ac->che[type][id];
> +if (che) {
> +che->ch[0].ret = che->ch[0].ret_buf;
> +che->ch[1].ret = che->ch[1].ret_buf;
> +}
> +}
> +}
> +
> +if (get_new_frame) {
> +int ch, ret;
> +
> +/* get output buffer */
> +ac->frame.nb_samples = 2048;
> +if ((ret = avctx->get_buffer(avctx, &ac->frame)) < 0) {
> +av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
> +return ret;
> +}
> +
> +/* map output channel pointers to AVFrame data */
> +for (ch = 0; ch < avctx->channels; ch++) {
> +if (ac->output_element[ch])
> +ac->output_element[ch]->ret = (float 
> *)ac->frame.extended_data[ch];
> +}
> +}
> +
> +return 0;
> +}
> +

I'm somewhat unclear on the case where we are actually decoding to the
internal buffers. output_configure() without get_new_frame only seems
to be called from header parsing code.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] x86inc: support stack mem allocation and re-alignment in PROLOGUE.

2012-10-24 Thread Ronald S. Bultje
Hi,

On Wed, Oct 24, 2012 at 10:07 AM, Måns Rullgård  wrote:
> "Ronald S. Bultje"  writes:
>
>> From: "Ronald S. Bultje" 
>>
>> Use this in VP8/H264-8bit loopfilter functions so they can be used if
>> there is no aligned stack (e.g. MSVC 32bit or ICC 10.x).
>> ---
>>  libavcodec/x86/h264_deblock.asm |  27 ++-
>>  libavcodec/x86/h264dsp_init.c   |   4 +-
>>  libavcodec/x86/vp8dsp.asm   |  68 
>>  libavcodec/x86/vp8dsp_init.c|   8 --
>>  libavutil/x86/x86inc.asm| 167 
>> +---
>>  5 files changed, 181 insertions(+), 93 deletions(-)
>
> What happened to this?  Is there something wrong with the patch?

I am addressing reviews from the x264 people and am somewhat slow at
testing new revisions because of other work...

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


Re: [libav-devel] [PATCH 2/4] g722: refactor out of rawdec.c

2012-10-24 Thread Janne Grunau
On 2012-10-24 21:19:41 +0200, Luca Barbato wrote:
> ---
>  libavformat/Makefile |  2 +-
>  libavformat/g722.c   | 58 
> 
>  libavformat/rawdec.c | 12 ---
>  3 files changed, 59 insertions(+), 13 deletions(-)
>  create mode 100644 libavformat/g722.c
> 
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index a285af1..832ea41 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -101,7 +101,7 @@ OBJS-$(CONFIG_GIF_MUXER) += gif.o
>  OBJS-$(CONFIG_GSM_DEMUXER)   += gsmdec.o
>  OBJS-$(CONFIG_GXF_DEMUXER)   += gxf.o
>  OBJS-$(CONFIG_GXF_MUXER) += gxfenc.o audiointerleave.o
> -OBJS-$(CONFIG_G722_DEMUXER)  += rawdec.o
> +OBJS-$(CONFIG_G722_DEMUXER)  += g722.o rawdec.o
>  OBJS-$(CONFIG_G722_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_G723_1_DEMUXER)+= g723_1.o
>  OBJS-$(CONFIG_H261_DEMUXER)  += h261dec.o rawdec.o
> diff --git a/libavformat/g722.c b/libavformat/g722.c
> new file mode 100644
> index 000..5dc3b57
> --- /dev/null
> +++ b/libavformat/g722.c
> @@ -0,0 +1,58 @@
> +/*
> + * g722 raw demuxer
> + * Copyright (c) 2010 Martin Storsjo
> + *
> + * This file is part of Libav.
> + *
> + * Libav is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * Libav is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with Libav; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +
> +#include "avformat.h"
> +#include "internal.h"
> +#include "rawdec.h"
> +
> +static int g722_read_header(AVFormatContext *s)
> +{
> +AVStream *st;
> +
> +st = avformat_new_stream(s, NULL);
> +if (!st)
> +return AVERROR(ENOMEM);
> +
> +st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
> +st->codec->codec_id= AV_CODEC_ID_ADPCM_G722;
> +st->codec->sample_rate = 16000;
> +st->codec->channels= 1;
> +
> +st->codec->bits_per_coded_sample =
> +av_get_bits_per_sample(st->codec->codec_id);
> +
> +assert(st->codec->bits_per_coded_sample > 0);
> +st->codec->block_align =
> +st->codec->bits_per_coded_sample * st->codec->channels / 8;

block_align will be constant 0 (4 * 1 / 8), I guess it's not used by the
g722 decoder. No need to set to 0.

> +
> +avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
> +return 0;
> +}
> +
> +AVInputFormat ff_g722_demuxer = {
> +.name   = "g722",
> +.long_name  = NULL_IF_CONFIG_SMALL("raw G.722"),
> +.read_header= g722_read_header,
> +.read_packet= ff_raw_read_partial_packet,
> +.flags  = AVFMT_GENERIC_INDEX,
> +.extensions = "g722,722",
> +.raw_codec_id   = AV_CODEC_ID_ADPCM_G722,
> +};
> diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
> index 7ea3d2b..fd1e9b9 100644
> --- a/libavformat/rawdec.c
> +++ b/libavformat/rawdec.c
> @@ -177,18 +177,6 @@ const AVOption ff_rawvideo_options[] = {
>  { NULL },
>  };
>  
> -#if CONFIG_G722_DEMUXER
> -AVInputFormat ff_g722_demuxer = {
> -.name   = "g722",
> -.long_name  = NULL_IF_CONFIG_SMALL("raw G.722"),
> -.read_header= ff_raw_read_header,
> -.read_packet= ff_raw_read_partial_packet,
> -.flags  = AVFMT_GENERIC_INDEX,
> -.extensions = "g722,722",
> -.raw_codec_id   = AV_CODEC_ID_ADPCM_G722,
> -};
> -#endif
> -
>  #if CONFIG_LATM_DEMUXER
>  AVInputFormat ff_latm_demuxer = {
>  .name   = "latm",

looks ok otherwise

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


Re: [libav-devel] [PATCH 4/4] rawdec: remove ff_raw_read_header

2012-10-24 Thread Janne Grunau
On 2012-10-24 21:19:43 +0200, Luca Barbato wrote:
> It is not used anymore and is a kludge.
> ---
>  libavformat/rawdec.c | 70 
> 
>  libavformat/rawdec.h |  8 --
>  2 files changed, 78 deletions(-)

ok

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


Re: [libav-devel] [PATCH 3/4] pcmdec: remove dependency from rawdec

2012-10-24 Thread Janne Grunau
On 2012-10-24 21:19:42 +0200, Luca Barbato wrote:
> The code shared is not actually shared with anything else.
> ---
>  libavformat/Makefile | 40 
>  libavformat/pcmdec.c | 37 +++--
>  2 files changed, 55 insertions(+), 22 deletions(-)
> 
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 832ea41..acf0500 100644
> --- a/libavformat/pcmdec.c
> +++ b/libavformat/pcmdec.c
> @@ -20,13 +20,46 @@
>   */
>  
>  #include "avformat.h"
> -#include "rawdec.h"
> +#include "internal.h"
>  #include "pcm.h"
>  #include "libavutil/log.h"
>  #include "libavutil/opt.h"
>  
>  #define RAW_SAMPLES 1024
>  
> +typedef struct RawAudioDemuxerContext {
> +AVClass *class;
> +int sample_rate;
> +int channels;
> +} RawAudioDemuxerContext;
> +
> +static int raw_read_header(AVFormatContext *s)

bikeshed: pcm might be a better prefix for the function and context

> +{
> +RawAudioDemuxerContext *s1 = s->priv_data;
> +AVStream *st;
> +
> +st = avformat_new_stream(s, NULL);
> +if (!st)
> +return AVERROR(ENOMEM);
> +
> +
> +st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
> +st->codec->codec_id= s->iformat->raw_codec_id;
> +st->codec->sample_rate = s1->sample_rate;
> +st->codec->channels= s1->channels;
> +
> +st->codec->bits_per_coded_sample =
> +av_get_bits_per_sample(st->codec->codec_id);
> +
> +assert(st->codec->bits_per_coded_sample > 0);
> +
> +st->codec->block_align =
> +st->codec->bits_per_coded_sample * st->codec->channels / 8;
> +
> +avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
> +return 0;
> +}
> +
>  static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
>  {
>  int ret, size, bps;
> @@ -65,7 +98,7 @@ AVInputFormat ff_pcm_ ## name_ ## _demuxer = {  
> \
>  .name   = #name_,   \
>  .long_name  = NULL_IF_CONFIG_SMALL(long_name_), \
>  .priv_data_size = sizeof(RawAudioDemuxerContext),   \
> -.read_header= ff_raw_read_header,   \
> +.read_header= raw_read_header,  \
>  .read_packet= raw_read_packet,  \
>  .read_seek  = ff_pcm_read_seek, \
>  .flags  = AVFMT_GENERIC_INDEX,  \

ok

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


Re: [libav-devel] [PATCH 1/4] rawvideo: use a specific read_header

2012-10-24 Thread Janne Grunau
On 2012-10-24 21:19:40 +0200, Luca Barbato wrote:
> ff_raw_read_header is used only for this demuxer for video.
> ---
>  libavformat/Makefile  |  2 +-
>  libavformat/rawvideodec.c | 68 
> ++-
>  2 files changed, 62 insertions(+), 8 deletions(-)
> 
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 2d66a6d..a285af1 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -239,7 +239,7 @@ OBJS-$(CONFIG_PMP_DEMUXER)   += pmpdec.o
>  OBJS-$(CONFIG_PVA_DEMUXER)   += pva.o
>  OBJS-$(CONFIG_QCP_DEMUXER)   += qcp.o
>  OBJS-$(CONFIG_R3D_DEMUXER)   += r3d.o
> -OBJS-$(CONFIG_RAWVIDEO_DEMUXER)  += rawvideodec.o rawdec.o
> +OBJS-$(CONFIG_RAWVIDEO_DEMUXER)  += rawvideodec.o
>  OBJS-$(CONFIG_RAWVIDEO_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_RL2_DEMUXER)   += rl2.o
>  OBJS-$(CONFIG_RM_DEMUXER)+= rmdec.o rm.o rmsipr.o
> diff --git a/libavformat/rawvideodec.c b/libavformat/rawvideodec.c
> index f71ea0a..5f372c9 100644
> --- a/libavformat/rawvideodec.c
> +++ b/libavformat/rawvideodec.c
> @@ -19,8 +19,63 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
>  
> +#include "libavutil/parseutils.h"
> +#include "libavutil/pixdesc.h"
> +#include "libavutil/opt.h"
> +#include "internal.h"
>  #include "avformat.h"
> -#include "rawdec.h"
> +
> +typedef struct RawVideoDemuxerContext {
> +const AVClass *class; /**< Class for private options. */
> +char *video_size; /**< String describing video size, set by a 
> private option. */
> +char *pixel_format;   /**< Set by a private option. */
> +char *framerate;  /**< String describing framerate, set by a 
> private option. */
> +} RawVideoDemuxerContext;
> +
> +
> +static int rawvideo_read_header(AVFormatContext *ctx)
> +{
> +RawVideoDemuxerContext *s = ctx->priv_data;
> +int width = 0, height = 0, ret = 0;
> +enum AVPixelFormat pix_fmt;
> +AVRational framerate;
> +AVStream *st;
> +
> +st = avformat_new_stream(ctx, NULL);
> +if (!st)
> +return AVERROR(ENOMEM);
> +
> +st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
> +
> +st->codec->codec_id = ctx->iformat->raw_codec_id;
> +
> +if (s->video_size &&
> +(ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
> +av_log(ctx, AV_LOG_ERROR, "Couldn't parse video size.\n");
> +return ret;
> +}
> +
> +if ((pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
> +av_log(ctx, AV_LOG_ERROR, "No such pixel format: %s.\n",
> +   s->pixel_format);
> +return AVERROR(EINVAL);
> +}
> +
> +if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
> +av_log(ctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n",
> +   s->framerate);
> +return ret;
> +}
> +
> +avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
> +
> +st->codec->width  = width;
> +st->codec->height = height;
> +st->codec->pix_fmt = pix_fmt;
> +
> +return 0;
> +}
> +
>  
>  static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
>  {
> @@ -34,9 +89,8 @@ static int rawvideo_read_packet(AVFormatContext *s, 
> AVPacket *pkt)
>  if (packet_size < 0)
>  return -1;
>  
> -ret= av_get_packet(s->pb, pkt, packet_size);
> -pkt->pts=
> -pkt->dts= pkt->pos / packet_size;
> +ret = av_get_packet(s->pb, pkt, packet_size);
> +pkt->pts = pkt->dts = pkt->pos / packet_size;
>  
>  pkt->stream_index = 0;
>  if (ret < 0)
> @@ -44,7 +98,7 @@ static int rawvideo_read_packet(AVFormatContext *s, 
> AVPacket *pkt)
>  return 0;
>  }
>  
> -#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
> +#define OFFSET(x) offsetof(RawVideoDemuxerContext, x)
>  #define DEC AV_OPT_FLAG_DECODING_PARAM
>  static const AVOption rawvideo_options[] = {
>  { "video_size", "A string describing frame size, such as 640x480 or 
> hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
> @@ -63,8 +117,8 @@ static const AVClass rawvideo_demuxer_class = {
>  AVInputFormat ff_rawvideo_demuxer = {
>  .name   = "rawvideo",
>  .long_name  = NULL_IF_CONFIG_SMALL("raw video"),
> -.priv_data_size = sizeof(FFRawVideoDemuxerContext),
> -.read_header= ff_raw_read_header,
> +.priv_data_size = sizeof(RawVideoDemuxerContext),
> +.read_header= rawvideo_read_header,
>  .read_packet= rawvideo_read_packet,
>  .flags  = AVFMT_GENERIC_INDEX,
>  .extensions = "yuv,cif,qcif,rgb",

ok

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


Re: [libav-devel] [PATCH 3/3] avconv: warn about inappropriate output stream format

2012-10-24 Thread Luca Barbato
On 10/24/2012 04:15 PM, Tomas Härdin wrote:
> Oh boy, here we go.
> 
> On Wed, 2012-10-24 at 12:10 +0200, Kostya Shishkov wrote:
>> @@ -1605,6 +1606,12 @@ static int transcode_init(void)
>>  codec->codec_tag = icodec->codec_tag;
>>  }
>>  
>> +desc = avcodec_descriptor_get(codec->codec_id);
>> +if (desc && (desc->props & AV_CODEC_PROP_IDIOTIC)) {
> 
> AV_CODEC_PROP_IDIOTIC? How professional.

Surely AV_CODEC_PROP_DISCOURAGED with a -strict suggest mode to output a
rationale on why certain codecs should not be generally used beside for
compatibility, might be a good service.

The patchset as it doesn't really help anybody since "idiotic" as for
"lovely" is one of those English words with too many meanings and nuances.

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


[libav-devel] [PATCH 4/4] rawdec: remove ff_raw_read_header

2012-10-24 Thread Luca Barbato
It is not used anymore and is a kludge.
---
 libavformat/rawdec.c | 70 
 libavformat/rawdec.h |  8 --
 2 files changed, 78 deletions(-)

diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index fd1e9b9..1c9aabd 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -28,76 +28,6 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/pixdesc.h"
 
-/* raw input */
-int ff_raw_read_header(AVFormatContext *s)
-{
-AVStream *st;
-enum AVCodecID id;
-
-st = avformat_new_stream(s, NULL);
-if (!st)
-return AVERROR(ENOMEM);
-
-id = s->iformat->raw_codec_id;
-if (id == AV_CODEC_ID_RAWVIDEO) {
-st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-} else {
-st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-}
-st->codec->codec_id = id;
-
-switch(st->codec->codec_type) {
-case AVMEDIA_TYPE_AUDIO: {
-RawAudioDemuxerContext *s1 = s->priv_data;
-
-st->codec->channels = 1;
-
-if (id == AV_CODEC_ID_ADPCM_G722)
-st->codec->sample_rate = 16000;
-
-if (s1 && s1->sample_rate)
-st->codec->sample_rate = s1->sample_rate;
-if (s1 && s1->channels)
-st->codec->channels= s1->channels;
-
-st->codec->bits_per_coded_sample = 
av_get_bits_per_sample(st->codec->codec_id);
-assert(st->codec->bits_per_coded_sample > 0);
-st->codec->block_align = 
st->codec->bits_per_coded_sample*st->codec->channels/8;
-avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-break;
-}
-case AVMEDIA_TYPE_VIDEO: {
-FFRawVideoDemuxerContext *s1 = s->priv_data;
-int width = 0, height = 0, ret = 0;
-enum AVPixelFormat pix_fmt;
-AVRational framerate;
-
-if (s1->video_size && (ret = av_parse_video_size(&width, &height, 
s1->video_size)) < 0) {
-av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");
-goto fail;
-}
-if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == 
AV_PIX_FMT_NONE) {
-av_log(s, AV_LOG_ERROR, "No such pixel format: %s.\n", 
s1->pixel_format);
-ret = AVERROR(EINVAL);
-goto fail;
-}
-if ((ret = av_parse_video_rate(&framerate, s1->framerate)) < 0) {
-av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", 
s1->framerate);
-goto fail;
-}
-avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
-st->codec->width  = width;
-st->codec->height = height;
-st->codec->pix_fmt = pix_fmt;
-fail:
-return ret;
-}
-default:
-return -1;
-}
-return 0;
-}
-
 #define RAW_PACKET_SIZE 1024
 
 int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h
index 4cce2cf..a548778 100644
--- a/libavformat/rawdec.h
+++ b/libavformat/rawdec.h
@@ -26,12 +26,6 @@
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 
-typedef struct RawAudioDemuxerContext {
-AVClass *class;
-int sample_rate;
-int channels;
-} RawAudioDemuxerContext;
-
 typedef struct FFRawVideoDemuxerContext {
 const AVClass *class; /**< Class for private options. */
 char *video_size; /**< String describing video size, set by a 
private option. */
@@ -41,8 +35,6 @@ typedef struct FFRawVideoDemuxerContext {
 
 extern const AVOption ff_rawvideo_options[];
 
-int ff_raw_read_header(AVFormatContext *s);
-
 int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
 
 int ff_raw_audio_read_header(AVFormatContext *s);
-- 
1.7.12

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


[libav-devel] [PATCH 3/4] pcmdec: remove dependency from rawdec

2012-10-24 Thread Luca Barbato
The code shared is not actually shared with anything else.
---
 libavformat/Makefile | 40 
 libavformat/pcmdec.c | 37 +++--
 2 files changed, 55 insertions(+), 22 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 832ea41..acf0500 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -195,45 +195,45 @@ OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \
 vorbiscomment.o
 OBJS-$(CONFIG_OMA_DEMUXER)   += omadec.o pcm.o oma.o
 OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o oma.o id3v2enc.o
-OBJS-$(CONFIG_PCM_ALAW_DEMUXER)  += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_ALAW_DEMUXER)  += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_ALAW_MUXER)+= pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_F32BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_F32BE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_F32BE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_F32LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_F32LE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_F32LE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_F64BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_F64BE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_F64BE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_F64LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_F64LE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_F64LE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_MULAW_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_MULAW_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_MULAW_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S16BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S16BE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_S16BE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S16LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S16LE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_S16LE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S24BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S24BE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_S24BE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S24LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S24LE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_S24LE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S32BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S32BE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_S32BE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S32LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S32LE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_S32LE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S8_DEMUXER)+= pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S8_DEMUXER)+= pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_S8_MUXER)  += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U16BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U16BE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_U16BE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U16LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U16LE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_U16LE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U24BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U24BE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_U24BE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U24LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U24LE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_U24LE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U32BE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U32BE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_U32BE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U32LE_DEMUXER) += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U32LE_DEMUXER) += pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_U32LE_MUXER)   += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U8_DEMUXER)+= pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U8_DEMUXER)+= pcmdec.o pcm.o
 OBJS-$(CONFIG_PCM_U8_MUXER)  += pcmenc.o rawenc.o
 OBJS-$(CONFIG_PMP_DEMUXER)   += pmpdec.o
 OBJS-$(CONFIG_PVA_DEMUXER)   += pva.o
diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
index ad47885..40446c2 100644
--- a/libavformat/pcmdec.c
+++ b/libavformat/pcmdec.c
@@ -20,13 +20,46 @@
  */
 
 #include "avformat.h"
-#include "rawdec.h"
+#include "internal.h"
 #include "pcm.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 
 #define RAW_SAMPLES 1024
 
+typedef struct RawAudioDemuxerContex

[libav-devel] [PATCH 2/4] g722: refactor out of rawdec.c

2012-10-24 Thread Luca Barbato
---
 libavformat/Makefile |  2 +-
 libavformat/g722.c   | 58 
 libavformat/rawdec.c | 12 ---
 3 files changed, 59 insertions(+), 13 deletions(-)
 create mode 100644 libavformat/g722.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index a285af1..832ea41 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -101,7 +101,7 @@ OBJS-$(CONFIG_GIF_MUXER) += gif.o
 OBJS-$(CONFIG_GSM_DEMUXER)   += gsmdec.o
 OBJS-$(CONFIG_GXF_DEMUXER)   += gxf.o
 OBJS-$(CONFIG_GXF_MUXER) += gxfenc.o audiointerleave.o
-OBJS-$(CONFIG_G722_DEMUXER)  += rawdec.o
+OBJS-$(CONFIG_G722_DEMUXER)  += g722.o rawdec.o
 OBJS-$(CONFIG_G722_MUXER)+= rawenc.o
 OBJS-$(CONFIG_G723_1_DEMUXER)+= g723_1.o
 OBJS-$(CONFIG_H261_DEMUXER)  += h261dec.o rawdec.o
diff --git a/libavformat/g722.c b/libavformat/g722.c
new file mode 100644
index 000..5dc3b57
--- /dev/null
+++ b/libavformat/g722.c
@@ -0,0 +1,58 @@
+/*
+ * g722 raw demuxer
+ * Copyright (c) 2010 Martin Storsjo
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "internal.h"
+#include "rawdec.h"
+
+static int g722_read_header(AVFormatContext *s)
+{
+AVStream *st;
+
+st = avformat_new_stream(s, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+
+st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
+st->codec->codec_id= AV_CODEC_ID_ADPCM_G722;
+st->codec->sample_rate = 16000;
+st->codec->channels= 1;
+
+st->codec->bits_per_coded_sample =
+av_get_bits_per_sample(st->codec->codec_id);
+
+assert(st->codec->bits_per_coded_sample > 0);
+st->codec->block_align =
+st->codec->bits_per_coded_sample * st->codec->channels / 8;
+
+avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
+return 0;
+}
+
+AVInputFormat ff_g722_demuxer = {
+.name   = "g722",
+.long_name  = NULL_IF_CONFIG_SMALL("raw G.722"),
+.read_header= g722_read_header,
+.read_packet= ff_raw_read_partial_packet,
+.flags  = AVFMT_GENERIC_INDEX,
+.extensions = "g722,722",
+.raw_codec_id   = AV_CODEC_ID_ADPCM_G722,
+};
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index 7ea3d2b..fd1e9b9 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -177,18 +177,6 @@ const AVOption ff_rawvideo_options[] = {
 { NULL },
 };
 
-#if CONFIG_G722_DEMUXER
-AVInputFormat ff_g722_demuxer = {
-.name   = "g722",
-.long_name  = NULL_IF_CONFIG_SMALL("raw G.722"),
-.read_header= ff_raw_read_header,
-.read_packet= ff_raw_read_partial_packet,
-.flags  = AVFMT_GENERIC_INDEX,
-.extensions = "g722,722",
-.raw_codec_id   = AV_CODEC_ID_ADPCM_G722,
-};
-#endif
-
 #if CONFIG_LATM_DEMUXER
 AVInputFormat ff_latm_demuxer = {
 .name   = "latm",
-- 
1.7.12

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


[libav-devel] Raw demuxers cleanup

2012-10-24 Thread Luca Barbato
Here an initial set of patches to clean up a little rawdec.
All started while I was working on rawdata muxer/demuxer (not avdevice,
those will come a little later) for my little project of supporting
generic data.

Possibly I'd get avfilter to support text data so we can output statistics
as a stream and use the rawdata or the nut muxer to extract or store it
in a nicer way.

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


[libav-devel] [PATCH 1/4] rawvideo: use a specific read_header

2012-10-24 Thread Luca Barbato
ff_raw_read_header is used only for this demuxer for video.
---
 libavformat/Makefile  |  2 +-
 libavformat/rawvideodec.c | 68 ++-
 2 files changed, 62 insertions(+), 8 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 2d66a6d..a285af1 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -239,7 +239,7 @@ OBJS-$(CONFIG_PMP_DEMUXER)   += pmpdec.o
 OBJS-$(CONFIG_PVA_DEMUXER)   += pva.o
 OBJS-$(CONFIG_QCP_DEMUXER)   += qcp.o
 OBJS-$(CONFIG_R3D_DEMUXER)   += r3d.o
-OBJS-$(CONFIG_RAWVIDEO_DEMUXER)  += rawvideodec.o rawdec.o
+OBJS-$(CONFIG_RAWVIDEO_DEMUXER)  += rawvideodec.o
 OBJS-$(CONFIG_RAWVIDEO_MUXER)+= rawenc.o
 OBJS-$(CONFIG_RL2_DEMUXER)   += rl2.o
 OBJS-$(CONFIG_RM_DEMUXER)+= rmdec.o rm.o rmsipr.o
diff --git a/libavformat/rawvideodec.c b/libavformat/rawvideodec.c
index f71ea0a..5f372c9 100644
--- a/libavformat/rawvideodec.c
+++ b/libavformat/rawvideodec.c
@@ -19,8 +19,63 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/parseutils.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "internal.h"
 #include "avformat.h"
-#include "rawdec.h"
+
+typedef struct RawVideoDemuxerContext {
+const AVClass *class; /**< Class for private options. */
+char *video_size; /**< String describing video size, set by a 
private option. */
+char *pixel_format;   /**< Set by a private option. */
+char *framerate;  /**< String describing framerate, set by a 
private option. */
+} RawVideoDemuxerContext;
+
+
+static int rawvideo_read_header(AVFormatContext *ctx)
+{
+RawVideoDemuxerContext *s = ctx->priv_data;
+int width = 0, height = 0, ret = 0;
+enum AVPixelFormat pix_fmt;
+AVRational framerate;
+AVStream *st;
+
+st = avformat_new_stream(ctx, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+
+st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+
+st->codec->codec_id = ctx->iformat->raw_codec_id;
+
+if (s->video_size &&
+(ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
+av_log(ctx, AV_LOG_ERROR, "Couldn't parse video size.\n");
+return ret;
+}
+
+if ((pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
+av_log(ctx, AV_LOG_ERROR, "No such pixel format: %s.\n",
+   s->pixel_format);
+return AVERROR(EINVAL);
+}
+
+if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
+av_log(ctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n",
+   s->framerate);
+return ret;
+}
+
+avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
+
+st->codec->width  = width;
+st->codec->height = height;
+st->codec->pix_fmt = pix_fmt;
+
+return 0;
+}
+
 
 static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
@@ -34,9 +89,8 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (packet_size < 0)
 return -1;
 
-ret= av_get_packet(s->pb, pkt, packet_size);
-pkt->pts=
-pkt->dts= pkt->pos / packet_size;
+ret = av_get_packet(s->pb, pkt, packet_size);
+pkt->pts = pkt->dts = pkt->pos / packet_size;
 
 pkt->stream_index = 0;
 if (ret < 0)
@@ -44,7 +98,7 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 return 0;
 }
 
-#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
+#define OFFSET(x) offsetof(RawVideoDemuxerContext, x)
 #define DEC AV_OPT_FLAG_DECODING_PARAM
 static const AVOption rawvideo_options[] = {
 { "video_size", "A string describing frame size, such as 640x480 or 
hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
@@ -63,8 +117,8 @@ static const AVClass rawvideo_demuxer_class = {
 AVInputFormat ff_rawvideo_demuxer = {
 .name   = "rawvideo",
 .long_name  = NULL_IF_CONFIG_SMALL("raw video"),
-.priv_data_size = sizeof(FFRawVideoDemuxerContext),
-.read_header= ff_raw_read_header,
+.priv_data_size = sizeof(RawVideoDemuxerContext),
+.read_header= rawvideo_read_header,
 .read_packet= rawvideo_read_packet,
 .flags  = AVFMT_GENERIC_INDEX,
 .extensions = "yuv,cif,qcif,rgb",
-- 
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] avconv: warn about inappropriate output stream format

2012-10-24 Thread Tomas Härdin
Oh boy, here we go.

On Wed, 2012-10-24 at 12:10 +0200, Kostya Shishkov wrote:
> @@ -1605,6 +1606,12 @@ static int transcode_init(void)
>  codec->codec_tag = icodec->codec_tag;
>  }
>  
> +desc = avcodec_descriptor_get(codec->codec_id);
> +if (desc && (desc->props & AV_CODEC_PROP_IDIOTIC)) {

AV_CODEC_PROP_IDIOTIC? How professional.

> +av_log(NULL, AV_LOG_FATAL, "You are trying to copy stream in 
> idiotic format, don't do that!\n");

What is the motivation behind this? To eventually remove support for
remuxing such formats? To tell users not to file tickets for code that
no one wants to touch? I'm curious.

> +// return AVERROR(EINVAL);

Useless.

> @@ -1810,6 +1818,13 @@ static int transcode_init(void)
>  ost->file_index, ost->index);
>  goto dump_format;
>  }
> +
> +desc = avcodec_descriptor_get(ost->st->codec->codec_id);
> +if (desc && (desc->props & AV_CODEC_PROP_IDIOTIC)) {
> +av_log(NULL, AV_LOG_FATAL, "You are trying to encode stream 
> in idiotic format, don't do that!\n");

If so, then why not remove those encoders?

/Tomas

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


Re: [libav-devel] [PATCH 18/45] flacdec: use av_samples_* functions for sample buffer allocation

2012-10-24 Thread Anton Khirnov

On Tue, 23 Oct 2012 17:43:33 -0400, Justin Ruggles  
wrote:
> Also, return an error on allocation failure.
> ---
>  libavcodec/flacdec.c |   43 +--
>  1 files changed, 29 insertions(+), 14 deletions(-)
> 
> diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
> index a1fdc35..4ecf5f2 100644
> --- a/libavcodec/flacdec.c
> +++ b/libavcodec/flacdec.c
> @@ -60,6 +60,8 @@ typedef struct FLACContext {
>  int got_streaminfo; ///< indicates if the STREAMINFO 
> has been read
>  
>  int32_t *decoded[FLAC_MAX_CHANNELS];///< decoded samples
> +uint8_t *decoded_buffer;
> +unsigned int decoded_buffer_size;
>  
>  FLACDSPContext dsp;
>  } FLACContext;
> @@ -73,7 +75,7 @@ static const int64_t flac_channel_layouts[6] = {
>  AV_CH_LAYOUT_5POINT1
>  };
>  
> -static void allocate_buffers(FLACContext *s);
> +static int allocate_buffers(FLACContext *s);
>  
>  static void flac_set_bps(FLACContext *s)
>  {
> @@ -101,6 +103,7 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
>  {
>  enum FLACExtradataFormat format;
>  uint8_t *streaminfo;
> +int ret;
>  FLACContext *s = avctx->priv_data;
>  s->avctx = avctx;
>  
> @@ -114,7 +117,9 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
>  
>  /* initialize based on the demuxer-supplied streamdata header */
>  avpriv_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo);
> -allocate_buffers(s);
> +ret = allocate_buffers(s);
> +if (ret < 0)
> +return ret;
>  flac_set_bps(s);
>  ff_flacdsp_init(&s->dsp, avctx->sample_fmt, s->bps);
>  s->got_streaminfo = 1;
> @@ -137,15 +142,24 @@ static void dump_headers(AVCodecContext *avctx, 
> FLACStreaminfo *s)
>  av_log(avctx, AV_LOG_DEBUG, "  Bits: %d\n", s->bps);
>  }
>  
> -static void allocate_buffers(FLACContext *s)
> +static int allocate_buffers(FLACContext *s)
>  {
> -int i;
> +int buf_size;
>  
>  assert(s->max_blocksize);
>  
> -for (i = 0; i < s->channels; i++) {
> -s->decoded[i] = av_malloc(sizeof(int32_t)*s->max_blocksize);
> -}
> +buf_size = av_samples_get_buffer_size(NULL, s->channels, 
> s->max_blocksize,
> +  AV_SAMPLE_FMT_S32P, 0);
> +if (buf_size < 0)
> +return buf_size;
> +
> +av_fast_malloc(&s->decoded_buffer, &s->decoded_buffer_size, buf_size);
> +if (!s->decoded_buffer)
> +return AVERROR(ENOMEM);
> +
> +return av_samples_fill_arrays((uint8_t **)s->decoded, NULL,
> +  s->decoded_buffer, s->channels,
> +  s->max_blocksize, AV_SAMPLE_FMT_S32P, 0);
>  }
>  
>  /**
> @@ -157,7 +171,7 @@ static void allocate_buffers(FLACContext *s)
>   */
>  static int parse_streaminfo(FLACContext *s, const uint8_t *buf, int buf_size)
>  {
> -int metadata_type, metadata_size;
> +int metadata_type, metadata_size, ret;
>  
>  if (buf_size < FLAC_STREAMINFO_SIZE+8) {
>  /* need more data */
> @@ -169,7 +183,9 @@ static int parse_streaminfo(FLACContext *s, const uint8_t 
> *buf, int buf_size)
>  return AVERROR_INVALIDDATA;
>  }
>  avpriv_flac_parse_streaminfo(s->avctx, (FLACStreaminfo *)s, &buf[8]);
> -allocate_buffers(s);
> +ret = allocate_buffers(s);
> +if (ret < 0)
> +return ret;
>  flac_set_bps(s);
>  ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
>  s->got_streaminfo = 1;
> @@ -462,7 +478,9 @@ static int decode_frame(FLACContext *s)
>  s->samplerate = s->avctx->sample_rate = fi.samplerate;
>  
>  if (!s->got_streaminfo) {
> -allocate_buffers(s);
> +int ret = allocate_buffers(s);
> +if (ret < 0)
> +return ret;
>  ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
>  s->got_streaminfo = 1;
>  dump_headers(s->avctx, (FLACStreaminfo *)s);
> @@ -552,11 +570,8 @@ static int flac_decode_frame(AVCodecContext *avctx, void 
> *data,
>  static av_cold int flac_decode_close(AVCodecContext *avctx)
>  {
>  FLACContext *s = avctx->priv_data;
> -int i;
>  
> -for (i = 0; i < s->channels; i++) {
> -av_freep(&s->decoded[i]);
> -}
> +av_freep(&s->decoded_buffer);
>  
>  return 0;
>  }
> -- 
> 1.7.1
> 

Looks ok.

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


Re: [libav-devel] [PATCH] x86inc: support stack mem allocation and re-alignment in PROLOGUE.

2012-10-24 Thread Måns Rullgård
"Ronald S. Bultje"  writes:

> From: "Ronald S. Bultje" 
>
> Use this in VP8/H264-8bit loopfilter functions so they can be used if
> there is no aligned stack (e.g. MSVC 32bit or ICC 10.x).
> ---
>  libavcodec/x86/h264_deblock.asm |  27 ++-
>  libavcodec/x86/h264dsp_init.c   |   4 +-
>  libavcodec/x86/vp8dsp.asm   |  68 
>  libavcodec/x86/vp8dsp_init.c|   8 --
>  libavutil/x86/x86inc.asm| 167 
> +---
>  5 files changed, 181 insertions(+), 93 deletions(-)

What happened to this?  Is there something wrong with the patch?

-- 
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 5/5] avutil: Make LZO decoder code configure-time selectable

2012-10-24 Thread Diego Biurrun
On Thu, Oct 18, 2012 at 07:50:31PM +0200, Diego Biurrun wrote:
> ---
>  configure |6 +-
>  libavcodec/Makefile   |1 -
>  libavformat/matroskadec.c |9 +++--
>  libavutil/Makefile|6 --
>  4 files changed, 16 insertions(+), 6 deletions(-)

OKed by Kostya on IRC.

> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -433,7 +433,6 @@ OBJS-$(CONFIG_PCM_ALAW_DECODER)   += pcm.o
>  OBJS-$(CONFIG_PCM_BLURAY_DECODER) += pcm-mpeg.o
>  OBJS-$(CONFIG_PCM_DVD_DECODER)+= pcm.o
> -OBJS-$(CONFIG_PCM_DVD_ENCODER)+= pcm.o
>  OBJS-$(CONFIG_PCM_F32BE_DECODER)  += pcm.o

This has already been OKed and pushed as a separate patch is not part of
the rebased version I have locally.

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


Re: [libav-devel] [PATCH] avutil: Move memcpy_backptr() to mem.c

2012-10-24 Thread Diego Biurrun
On Tue, Oct 23, 2012 at 08:20:26PM +0200, Diego Biurrun wrote:
> The function is used elsewhere and does not belong with the LZO code.
> ---
> Rebased on top of the patches that removed padding requirements.
> 
>  libavcodec/dfa.c  |2 +-
>  libavcodec/eatgv.c|2 +-
>  libavcodec/g723_1.c   |2 +-
>  libavcodec/lcldec.c   |2 +-
>  libavcodec/wmavoice.c |2 +-
>  libavcodec/xan.c  |3 +--
>  libavcodec/xxan.c |3 +--
>  libavutil/lzo.c   |   45 ++---
>  libavutil/lzo.h   |   13 ++---
>  libavutil/mem.c   |   37 +
>  libavutil/mem.h   |   12 
>  11 files changed, 60 insertions(+), 63 deletions(-)

OKed by Kostya on IRC.

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


Re: [libav-devel] [PATCH 2/2] dv: fix indentation

2012-10-24 Thread Diego Biurrun
On Wed, Oct 24, 2012 at 06:17:53PM +0200, Anton Khirnov wrote:
> ---
>  libavformat/dv.c |   60 
> +++---
>  1 file changed, 30 insertions(+), 30 deletions(-)

OK

> --- a/libavformat/dv.c
> +++ b/libavformat/dv.c
> @@ -339,16 +339,16 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, 
> AVPacket *pkt,
>  for (i = 0; i < c->ach; i++) {
> -   c->audio_pkt[i].size = size;
> -   c->audio_pkt[i].pts  = c->abytes * 3*8 / 
> c->ast[i]->codec->bit_rate;
> -   ppcm[i] = c->audio_buf[i];
> +c->audio_pkt[i].size = size;
> +c->audio_pkt[i].pts  = c->abytes * 3*8 / 
> c->ast[i]->codec->bit_rate;
> +ppcm[i] = c->audio_buf[i];

Maybe add space around * while you're at it.

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


[libav-devel] [PATCH 2/2] dv: fix indentation

2012-10-24 Thread Anton Khirnov
---
 libavformat/dv.c |   60 +++---
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 17c545c..f89a37c 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -230,24 +230,24 @@ static int dv_extract_audio_info(DVDemuxContext* c, 
uint8_t* frame)
 
 /* Dynamic handling of the audio streams in DV */
 for (i = 0; i < ach; i++) {
-   if (!c->ast[i]) {
-   c->ast[i] = avformat_new_stream(c->fctx, NULL);
-   if (!c->ast[i])
-   break;
-   avpriv_set_pts_info(c->ast[i], 64, 1, 3);
-   c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-   c->ast[i]->codec->codec_id   = AV_CODEC_ID_PCM_S16LE;
-
-   av_init_packet(&c->audio_pkt[i]);
-   c->audio_pkt[i].size = 0;
-   c->audio_pkt[i].data = c->audio_buf[i];
-   c->audio_pkt[i].stream_index = c->ast[i]->index;
-   c->audio_pkt[i].flags   |= AV_PKT_FLAG_KEY;
-   }
-   c->ast[i]->codec->sample_rate = dv_audio_frequency[freq];
-   c->ast[i]->codec->channels= 2;
-   c->ast[i]->codec->bit_rate= 2 * dv_audio_frequency[freq] * 16;
-   c->ast[i]->start_time = 0;
+if (!c->ast[i]) {
+c->ast[i] = avformat_new_stream(c->fctx, NULL);
+if (!c->ast[i])
+break;
+avpriv_set_pts_info(c->ast[i], 64, 1, 3);
+c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+c->ast[i]->codec->codec_id   = AV_CODEC_ID_PCM_S16LE;
+
+av_init_packet(&c->audio_pkt[i]);
+c->audio_pkt[i].size = 0;
+c->audio_pkt[i].data = c->audio_buf[i];
+c->audio_pkt[i].stream_index = c->ast[i]->index;
+c->audio_pkt[i].flags   |= AV_PKT_FLAG_KEY;
+}
+c->ast[i]->codec->sample_rate = dv_audio_frequency[freq];
+c->ast[i]->codec->channels= 2;
+c->ast[i]->codec->bit_rate= 2 * dv_audio_frequency[freq] * 16;
+c->ast[i]->start_time = 0;
 }
 c->ach = i;
 
@@ -265,7 +265,7 @@ static int dv_extract_video_info(DVDemuxContext *c, 
uint8_t* frame)
 avctx = c->vst->codec;
 
 avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
-c->sys->time_base.den);
+c->sys->time_base.den);
 avctx->time_base= c->sys->time_base;
 if (!avctx->width){
 avctx->width = c->sys->width;
@@ -277,7 +277,7 @@ static int dv_extract_video_info(DVDemuxContext *c, 
uint8_t* frame)
 vsc_pack = dv_extract_pack(frame, dv_video_control);
 apt  = frame[4] & 0x07;
 is16_9   = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
-(!apt && (vsc_pack[2] & 0x07) == 0x07)));
+ (!apt && (vsc_pack[2] & 0x07) == 0x07)));
 c->vst->sample_aspect_ratio = c->sys->sar[is16_9];
 avctx->bit_rate = av_rescale_q(c->sys->frame_size, (AVRational){8,1},
c->sys->time_base);
@@ -319,12 +319,12 @@ int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
 int i;
 
 for (i = 0; i < c->ach; i++) {
-   if (c->ast[i] && c->audio_pkt[i].size) {
-   *pkt = c->audio_pkt[i];
-   c->audio_pkt[i].size = 0;
-   size = pkt->size;
-   break;
-   }
+if (c->ast[i] && c->audio_pkt[i].size) {
+*pkt = c->audio_pkt[i];
+c->audio_pkt[i].size = 0;
+size = pkt->size;
+break;
+}
 }
 
 return size;
@@ -339,16 +339,16 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket 
*pkt,
 if (buf_size < DV_PROFILE_BYTES ||
 !(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
 buf_size < c->sys->frame_size) {
-  return -1;   /* Broken frame, or not enough data */
+return -1;   /* Broken frame, or not enough data */
 }
 
 /* Queueing audio packet */
 /* FIXME: in case of no audio/bad audio we have to do something */
 size = dv_extract_audio_info(c, buf);
 for (i = 0; i < c->ach; i++) {
-   c->audio_pkt[i].size = size;
-   c->audio_pkt[i].pts  = c->abytes * 3*8 / c->ast[i]->codec->bit_rate;
-   ppcm[i] = c->audio_buf[i];
+c->audio_pkt[i].size = size;
+c->audio_pkt[i].pts  = c->abytes * 3*8 / 
c->ast[i]->codec->bit_rate;
+ppcm[i] = c->audio_buf[i];
 }
 if (c->ach)
 dv_extract_audio(buf, ppcm, c->sys);
-- 
1.7.10.4

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


[libav-devel] [PATCH 1/2] dv: use AVStream.index instead of abusing AVStream.id

2012-10-24 Thread Anton Khirnov
---
 libavformat/dv.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 70786b1..17c545c 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -372,7 +372,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket 
*pkt,
 pkt->data = buf;
 pkt->size = size;
 pkt->flags   |= AV_PKT_FLAG_KEY;
-pkt->stream_index = c->vst->id;
+pkt->stream_index = c->vst->index;
 pkt->pts  = c->frames;
 
 c->frames++;
-- 
1.7.10.4

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


Re: [libav-devel] [PATCH 28/45] libopencore-amr: set channel layout for amr-nb or if not set by the user

2012-10-24 Thread Martin Storsjö

On Wed, 24 Oct 2012, Justin Ruggles wrote:


---
libavcodec/libopencore-amr.c |   14 +-
1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index 9a543b4..a754d52 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

+#include "libavutil/audioconvert.h"
#include "avcodec.h"
#include "libavutil/avstring.h"
#include "libavutil/common.h"
@@ -30,13 +31,16 @@ static void amr_decode_fix_avctx(AVCodecContext *avctx)
{
const int is_amr_wb = 1 + (avctx->codec_id == AV_CODEC_ID_AMR_WB);

-if (!avctx->sample_rate)
-avctx->sample_rate = 8000 * is_amr_wb;
+avctx->sample_rate = 8000 * is_amr_wb;

-if (!avctx->channels)
-avctx->channels = 1;
+if (avctx->channels > 1) {
+av_log_missing_feature(avctx, "multi-channel AMR", 0);
+return AVERROR_PATCHWELCOME;
+}

-avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+avctx->channels   = 1;
+avctx->channel_layout = AV_CH_LAYOUT_MONO;
+avctx->sample_fmt = AV_SAMPLE_FMT_S16;
}

#if CONFIG_LIBOPENCORE_AMRNB
--
1.7.1


LGTM

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


Re: [libav-devel] [PATCH 05/45] amrwbdec: set channels, channel_layout, and sample_rate

2012-10-24 Thread Martin Storsjö

On Wed, 24 Oct 2012, Justin Ruggles wrote:


Only mono 16kHz is supported.
---
libavcodec/amrwbdec.c |   11 ++-
1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 5cc96ab..3b9ca05 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -24,6 +24,7 @@
 * AMR wideband decoder
 */

+#include "libavutil/audioconvert.h"
#include "libavutil/common.h"
#include "libavutil/lfg.h"

@@ -90,7 +91,15 @@ static av_cold int amrwb_decode_init(AVCodecContext *avctx)
AMRWBContext *ctx = avctx->priv_data;
int i;

-avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+if (avctx->channels > 1) {
+av_log_missing_feature(avctx, "multi-channel AMR", 0);
+return AVERROR_PATCHWELCOME;
+}
+
+avctx->channels   = 1;
+avctx->channel_layout = AV_CH_LAYOUT_MONO;
+avctx->sample_rate= 16000;
+avctx->sample_fmt = AV_SAMPLE_FMT_FLT;

av_lfg_init(&ctx->prng, 1);

--
1.7.1


LGTM

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


Re: [libav-devel] [PATCH 04/45] amrnbdec: set channels, channel_layout, and sample_rate

2012-10-24 Thread Martin Storsjö

On Wed, 24 Oct 2012, Justin Ruggles wrote:


Only mono 8kHz is supported.
---
libavcodec/amrnbdec.c |   11 ++-
1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index 2cb06a6..2196645 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -43,6 +43,7 @@
#include 
#include 

+#include "libavutil/audioconvert.h"
#include "avcodec.h"
#include "dsputil.h"
#include "libavutil/common.h"
@@ -154,7 +155,15 @@ static av_cold int amrnb_decode_init(AVCodecContext *avctx)
AMRContext *p = avctx->priv_data;
int i;

-avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+if (avctx->channels > 1) {
+av_log_missing_feature(avctx, "multi-channel AMR", 0);
+return AVERROR_PATCHWELCOME;
+}
+
+avctx->channels   = 1;
+avctx->channel_layout = AV_CH_LAYOUT_MONO;
+avctx->sample_rate= 8000;
+avctx->sample_fmt = AV_SAMPLE_FMT_FLT;

// p->excitation always points to the same position in p->excitation_buf
p->excitation = &p->excitation_buf[PITCH_DELAY_MAX + LP_FILTER_ORDER + 1];
--
1.7.1


LGTM

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


Re: [libav-devel] ffv1.3 framemd5: segmentation fault

2012-10-24 Thread Luca Barbato
On 10/24/2012 04:52 PM, Peter B. wrote:
> I've just seen that it also segfaults with files produced by avconv:

if the files produced with avconv work in ffplay then at least we know
that the encoder works as intended.

I'll check what I overlooked in the -coder 1 and -coder 2 path and
hopefully I'll fix it soon.

Thanks for the notice.

lu

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


Re: [libav-devel] [PATCH 1/1] avconv: fix bitrate report when writing to /dev/null

2012-10-24 Thread Luca Barbato
On 10/24/2012 04:51 PM, Janne Grunau wrote:
> avio_size() reports the filesize which returns 0 for /dev/null.
> avio_tell() reports the current position.
> 

Ok.

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


Re: [libav-devel] [PATCH 02/45] lavc: check channel count after decoder init

2012-10-24 Thread Luca Barbato
On 10/24/2012 03:59 PM, Justin Ruggles wrote:
> On 10/24/2012 06:02 AM, Luca Barbato wrote:
>> On 10/23/12 11:43 PM, Justin Ruggles wrote:
>>> Ensures the decoder did not set channel count to an insanely high value
>>> during initialization, which could cause large memory usage when it
>>> tries to
>>> get a buffer during decoding.
>>> ---
>>>   libavcodec/utils.c |5 +
>>>   1 files changed, 5 insertions(+), 0 deletions(-)
>>>
>>
>> I'd make it tunable (e.g. adding an -strict insane value for the cases
>> in which it is needed).
> 
> Why? If you're worried about cases where people might actually want that
> many channels to be decoded, we can increase the value. This is mainly
> for situations where the decoder reads channel count from extradata
> during init(). I'm not worried about 256 vs. 128 or whatever. I'm
> worried about channel counts in the hundreds-of-thousands or millions.
> 

Keep it as is for now.

lu

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


[libav-devel] [PATCH 28/45] libopencore-amr: set channel layout for amr-nb or if not set by the user

2012-10-24 Thread Justin Ruggles
---
 libavcodec/libopencore-amr.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index 9a543b4..a754d52 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/audioconvert.h"
 #include "avcodec.h"
 #include "libavutil/avstring.h"
 #include "libavutil/common.h"
@@ -30,13 +31,16 @@ static void amr_decode_fix_avctx(AVCodecContext *avctx)
 {
 const int is_amr_wb = 1 + (avctx->codec_id == AV_CODEC_ID_AMR_WB);
 
-if (!avctx->sample_rate)
-avctx->sample_rate = 8000 * is_amr_wb;
+avctx->sample_rate = 8000 * is_amr_wb;
 
-if (!avctx->channels)
-avctx->channels = 1;
+if (avctx->channels > 1) {
+av_log_missing_feature(avctx, "multi-channel AMR", 0);
+return AVERROR_PATCHWELCOME;
+}
 
-avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+avctx->channels   = 1;
+avctx->channel_layout = AV_CH_LAYOUT_MONO;
+avctx->sample_fmt = AV_SAMPLE_FMT_S16;
 }
 
 #if CONFIG_LIBOPENCORE_AMRNB
-- 
1.7.1

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


[libav-devel] [PATCH 05/45] amrwbdec: set channels, channel_layout, and sample_rate

2012-10-24 Thread Justin Ruggles
Only mono 16kHz is supported.
---
 libavcodec/amrwbdec.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 5cc96ab..3b9ca05 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -24,6 +24,7 @@
  * AMR wideband decoder
  */
 
+#include "libavutil/audioconvert.h"
 #include "libavutil/common.h"
 #include "libavutil/lfg.h"
 
@@ -90,7 +91,15 @@ static av_cold int amrwb_decode_init(AVCodecContext *avctx)
 AMRWBContext *ctx = avctx->priv_data;
 int i;
 
-avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+if (avctx->channels > 1) {
+av_log_missing_feature(avctx, "multi-channel AMR", 0);
+return AVERROR_PATCHWELCOME;
+}
+
+avctx->channels   = 1;
+avctx->channel_layout = AV_CH_LAYOUT_MONO;
+avctx->sample_rate= 16000;
+avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
 
 av_lfg_init(&ctx->prng, 1);
 
-- 
1.7.1

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


[libav-devel] [PATCH 04/45] amrnbdec: set channels, channel_layout, and sample_rate

2012-10-24 Thread Justin Ruggles
Only mono 8kHz is supported.
---
 libavcodec/amrnbdec.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index 2cb06a6..2196645 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -43,6 +43,7 @@
 #include 
 #include 
 
+#include "libavutil/audioconvert.h"
 #include "avcodec.h"
 #include "dsputil.h"
 #include "libavutil/common.h"
@@ -154,7 +155,15 @@ static av_cold int amrnb_decode_init(AVCodecContext *avctx)
 AMRContext *p = avctx->priv_data;
 int i;
 
-avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+if (avctx->channels > 1) {
+av_log_missing_feature(avctx, "multi-channel AMR", 0);
+return AVERROR_PATCHWELCOME;
+}
+
+avctx->channels   = 1;
+avctx->channel_layout = AV_CH_LAYOUT_MONO;
+avctx->sample_rate= 8000;
+avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
 
 // p->excitation always points to the same position in p->excitation_buf
 p->excitation = &p->excitation_buf[PITCH_DELAY_MAX + LP_FILTER_ORDER + 1];
-- 
1.7.1

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


[libav-devel] [PATCH 01/45] lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders

2012-10-24 Thread Justin Ruggles
---
 libavcodec/internal.h |2 ++
 libavcodec/pcm.c  |6 ++
 libavcodec/utils.c|3 +--
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index e5b1958..231d4b6 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -30,6 +30,8 @@
 #include "libavutil/pixfmt.h"
 #include "avcodec.h"
 
+#define FF_SANE_NB_CHANNELS 128U
+
 typedef struct InternalBuffer {
 uint8_t *base[AV_NUM_DATA_POINTERS];
 uint8_t *data[AV_NUM_DATA_POINTERS];
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 1f8f22d..832cb43 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -31,8 +31,6 @@
 #include "mathops.h"
 #include "pcm_tablegen.h"
 
-#define MAX_CHANNELS 64
-
 static av_cold int pcm_encode_init(AVCodecContext *avctx)
 {
 avctx->frame_size = 0;
@@ -210,7 +208,7 @@ static av_cold int pcm_decode_init(AVCodecContext *avctx)
 PCMDecode *s = avctx->priv_data;
 int i;
 
-if (avctx->channels <= 0 || avctx->channels > MAX_CHANNELS) {
+if (avctx->channels <= 0) {
 av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
 return AVERROR(EINVAL);
 }
@@ -340,7 +338,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void 
*data,
 break;
 case AV_CODEC_ID_PCM_S16LE_PLANAR:
 {
-const uint8_t *src2[MAX_CHANNELS];
+const uint8_t *src2[FF_SANE_NB_CHANNELS];
 n /= avctx->channels;
 for (c = 0; c < avctx->channels; c++)
 src2[c] = &src[c * n * 2];
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 10230ca..be6d7ae 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -758,8 +758,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext 
*avctx, const AVCodec *code
 if (av_codec_is_decoder(codec))
 av_freep(&avctx->subtitle_header);
 
-#define SANE_NB_CHANNELS 128U
-if (avctx->channels > SANE_NB_CHANNELS) {
+if (avctx->channels > FF_SANE_NB_CHANNELS) {
 ret = AVERROR(EINVAL);
 goto free_and_end;
 }
-- 
1.7.1

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


Re: [libav-devel] [PATCH 1/4] configure: generalise 64-bit test

2012-10-24 Thread Diego Biurrun
On Wed, Oct 24, 2012 at 04:57:10PM +0200, Janne Grunau wrote:
> On 2012-10-24 14:27:09 +0200, Luca Barbato wrote:
> > On 10/24/2012 01:33 PM, Mans Rullgard wrote:
> > > Signed-off-by: Mans Rullgard 
> > > ---
> > >  configure | 11 +--
> > >  1 file changed, 9 insertions(+), 2 deletions(-)
> > > 
> > 
> > The patchset looks ok.
> 
> +1

same here

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


Re: [libav-devel] [PATCH 1/4] configure: generalise 64-bit test

2012-10-24 Thread Janne Grunau
On 2012-10-24 14:27:09 +0200, Luca Barbato wrote:
> On 10/24/2012 01:33 PM, Mans Rullgard wrote:
> > Signed-off-by: Mans Rullgard 
> > ---
> >  configure | 11 +--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> > 
> 
> The patchset looks ok.

+1

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


Re: [libav-devel] ffv1.3 framemd5: segmentation fault

2012-10-24 Thread Peter B.
I've just seen that it also segfaults with files produced by avconv:

//---
$ avconv -i "waterfall_cif.y4m" -an -vcodec ffv1 -level 3 -context 1
-coder 1 -g 300 -threads 8 -strict experimental -slices 30 -slicecrc 1
"waterfall_ffv1.avi"
-
avconv version v9_beta1-212-g5e28e97, Copyright (c) 2000-2012 the Libav
developers
  built on Oct 23 2012 20:39:35 with gcc 4.6.1 (Ubuntu/Linaro
4.6.1-9ubuntu3)
[yuv4mpegpipe @ 0x2fdf760] Estimating duration from bitrate, this may be
inaccurate
Input #0, yuv4mpegpipe, from 'waterfall_cif.y4m':
  Duration: N/A, bitrate: N/A
Stream #0.0: Video: rawvideo, yuv420p, 352x288, PAR 128:117 DAR
1408:1053, 29.97 fps, 29.97 tbr, 29.97 tbn
Output #0, avi, to 'waterfall_ffv1.avi':
  Metadata:
ISFT: Lavf54.19.0
Stream #0.0: Video: ffv1, yuv420p, 352x288 [PAR 128:117 DAR
1408:1053], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> ffv1)
Press ctrl-c to stop encoding
frame=  260 fps=  0 q=0.0 Lsize=   21983kB time=8.68
bitrate=20758.1kbits/s   
video:21971kB audio:0kB global headers:0kB muxing overhead 0.053880%
Execution return value: 0
Encoding finished: Wed Oct 24 11:59:20 CEST 2012
ffprobe version N-45924-ge2820d9 Copyright (c) 2007-2012 the FFmpeg
developers
  built on Oct 23 2012 20:00:42 with gcc 4.6.1 (Ubuntu/Linaro
4.6.1-9ubuntu3)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree
--enable-version3 --enable-postproc --enable-swscale --enable-avfilter
--enable-pthreads --enable-bzlib --enable-libmp3lame --enable-libvorbis
--enable-libxvid --enable-zlib --enable-libopenjpeg --enable-decoder=png
--enable-encoder=png --enable-libfreetype --enable-libschroedinger
  libavutil  52.  0.100 / 52.  0.100
  libavcodec 54. 68.100 / 54. 68.100
  libavformat54. 34.100 / 54. 34.100
  libavdevice54.  3.100 / 54.  3.100
  libavfilter 3. 20.104 /  3. 20.104
  libswscale  2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc52.  1.100 / 52.  1.100
Input #0, avi, from 'waterfall_ffv1.avi':
  Metadata:
encoder : Lavf54.19.0
  Duration: 00:00:08.67, start: 0.00, bitrate: 20758 kb/s
Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv420p, 352x288, SAR
128:117 DAR 1408:1053, 29.97 tbr, 29.97 tbn, 29.97 tbc
//---

==
./avconv -i "waterfall_ffv1.avi" -an -f framemd5
waterfall_ffv1.avi.avconv.framemd5
-
Waiting 0 seconds...
avconv version v9_beta1-212-g5e28e97, Copyright (c) 2000-2012 the Libav
developers
  built on Oct 23 2012 20:39:35 with gcc 4.6.1 (Ubuntu/Linaro
4.6.1-9ubuntu3)
[ffv1 @ 0x1668800] quant_table_index out of range
[ffv1 @ 0x1668800] bytestream end mismatching by 1650
[ffv1 @ 0x1668800] bytestream end mismatching by 1255
[ffv1 @ 0x1668800] bytestream end mismatching by 997
[ffv1 @ 0x1668800] bytestream end mismatching by 1225
[ffv1 @ 0x1668800] bytestream end mismatching by 1290
[ffv1 @ 0x1668800] quant_table_index out of range
[ffv1 @ 0x1668800] bytestream end mismatching by 1630
[ffv1 @ 0x1668800] bytestream end mismatching by 1172
[ffv1 @ 0x1668800] quant_table_index out of range
Last message repeated 1 times
[ffv1 @ 0x1668800] bytestream end mismatching by 1790
[ffv1 @ 0x1668800] bytestream end mismatching by 1462
[ffv1 @ 0x1668800] quant_table_index out of range
Last message repeated 2 times
[ffv1 @ 0x1668800] bytestream end mismatching by 982
[ffv1 @ 0x1668800] bytestream end mismatching by 395
[ffv1 @ 0x1668800] bytestream end mismatching by -734
Input #0, avi, from 'waterfall_ffv1.avi':
  Metadata:
encoder : Lavf54.19.0
  Duration: 00:00:08.67, start: 0.00, bitrate: 20758 kb/s
Stream #0.0: Video: ffv1, yuv420p, 352x288, PAR 128:117 DAR
1408:1053, 29.97 fps, 29.97 tbr, 29.97 tbn
Output #0, framemd5, to 'waterfall_ffv1.avi.avconv.framemd5':
  Metadata:
encoder : Lavf54.19.0
Stream #0.0: Video: rawvideo, yuv420p, 352x288 [PAR 128:117 DAR
1408:1053], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (ffv1 -> rawvideo)
Press ctrl-c to stop encoding
[ffv1 @ 0x1668800] quant_table_index out of range
Last message repeated 3 times
[ffv1 @ 0x1668800] bytestream end mismatching by 1172
[ffv1 @ 0x1668800] quant_table_index out of range
Last message repeated 2 times
[ffv1 @ 0x1668800] bytestream end mismatching by 1630
Last message repeated 2 times
[ffv1 @ 0x1668800] bytestream end mismatching by 1650
Last message repeated 2 times
[ffv1 @ 0x1668800] bytestream end mismatching by 997
Last message repeated 2 times
[ffv1 @ 0x1668800] bytestream end mismatching by 1255
Last message repeated 2 times
[ffv1 @ 0x1668800] bytestream end mismatching by 1290
[ffv1 @ 0x1668800] bytestream end mismatching by 982
[ffv1 @ 0x1668800] bytestream end mismatching by 1462
[ffv1 @ 0x1668800] bytestream end mismatching by 395
[ffv1 @ 0x1668800] 

[libav-devel] [PATCH 1/1] avconv: fix bitrate report when writing to /dev/null

2012-10-24 Thread Janne Grunau
avio_size() reports the filesize which returns 0 for /dev/null.
avio_tell() reports the current position.

Also handle errors from avio_tell().
---
 avconv.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/avconv.c b/avconv.c
index bf1e2fa..54a0e2a 100644
--- a/avconv.c
+++ b/avconv.c
@@ -807,8 +807,15 @@ static void print_report(int is_last_report, int64_t 
timer_start)
 oc = output_files[0]->ctx;
 
 total_size = avio_size(oc->pb);
-if (total_size < 0) // FIXME improve avio_size() so it works with non 
seekable output too
+if (total_size <= 0) // FIXME improve avio_size() so it works with non 
seekable output too
 total_size = avio_tell(oc->pb);
+if (total_size < 0) {
+char errbuf[128];
+av_strerror(total_size, errbuf, sizeof(errbuf));
+av_log(NULL, AV_LOG_VERBOSE, "Bitrate not available, "
+   "avio_tell() failed: %s\n", errbuf);
+total_size = 0;
+}
 
 buf[0] = '\0';
 ti1 = 1e10;
-- 
1.7.12.3

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


[libav-devel] [PATCH 1/1] h263: avoid memcpys over array bound in motion vector caching for obmc

2012-10-24 Thread Janne Grunau
Fixes CID602232.
---
 libavcodec/mpegvideo_motion.c | 34 +-
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
index 22948e2..9168793 100644
--- a/libavcodec/mpegvideo_motion.c
+++ b/libavcodec/mpegvideo_motion.c
@@ -638,37 +638,45 @@ static av_always_inline void 
MPV_motion_internal(MpegEncContext *s,
 prefetch_motion(s, ref_picture, dir);
 
 if(!is_mpeg12 && s->obmc && s->pict_type != AV_PICTURE_TYPE_B){
-int16_t mv_cache[4][4][2];
+LOCAL_ALIGNED_8(int16_t, mv_cache, [4], [4][2]);
+AVFrame *cur_frame = &s->current_picture.f;
 const int xy= s->mb_x + s->mb_y*s->mb_stride;
 const int mot_stride= s->b8_stride;
 const int mot_xy= mb_x*2 + mb_y*2*mot_stride;
 
 assert(!s->mb_skipped);
 
-memcpy(mv_cache[1][1], s->current_picture.f.motion_val[0][mot_xy   
  ], sizeof(int16_t) * 4);
-memcpy(mv_cache[2][1], s->current_picture.f.motion_val[0][mot_xy + 
mot_stride], sizeof(int16_t) * 4);
-memcpy(mv_cache[3][1], s->current_picture.f.motion_val[0][mot_xy + 
mot_stride], sizeof(int16_t) * 4);
+AV_COPY32(mv_cache[1][1], cur_frame->motion_val[0][mot_xy]);
+AV_COPY32(mv_cache[1][2], cur_frame->motion_val[0][mot_xy + 1]);
 
-if (mb_y == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - 
s->mb_stride])) {
-memcpy(mv_cache[0][1], mv_cache[1][1], sizeof(int16_t)*4);
+AV_COPY32(mv_cache[2][1], cur_frame->motion_val[0][mot_xy + mot_stride 
   ]);
+AV_COPY32(mv_cache[2][2], cur_frame->motion_val[0][mot_xy + mot_stride 
+ 1]);
+
+AV_COPY32(mv_cache[3][1], cur_frame->motion_val[0][mot_xy + mot_stride 
   ]);
+AV_COPY32(mv_cache[3][2], cur_frame->motion_val[0][mot_xy + mot_stride 
+ 1]);
+
+if (mb_y == 0 || IS_INTRA(cur_frame->mb_type[xy - s->mb_stride])) {
+AV_COPY32(mv_cache[0][1], mv_cache[1][1]);
+AV_COPY32(mv_cache[0][2], mv_cache[1][2]);
 }else{
-memcpy(mv_cache[0][1], s->current_picture.f.motion_val[0][mot_xy - 
mot_stride], sizeof(int16_t) * 4);
+AV_COPY32(mv_cache[0][1], cur_frame->motion_val[0][mot_xy - 
mot_stride]);
+AV_COPY32(mv_cache[0][2], cur_frame->motion_val[0][mot_xy - 
mot_stride + 1]);
 }
 
-if (mb_x == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - 1])) {
+if (mb_x == 0 || IS_INTRA(cur_frame->mb_type[xy - 1])) {
 AV_COPY32(mv_cache[1][0], mv_cache[1][1]);
 AV_COPY32(mv_cache[2][0], mv_cache[2][1]);
 }else{
-AV_COPY32(mv_cache[1][0], 
s->current_picture.f.motion_val[0][mot_xy - 1]);
-AV_COPY32(mv_cache[2][0], 
s->current_picture.f.motion_val[0][mot_xy - 1 + mot_stride]);
+AV_COPY32(mv_cache[1][0], cur_frame->motion_val[0][mot_xy - 1]);
+AV_COPY32(mv_cache[2][0], cur_frame->motion_val[0][mot_xy - 1 + 
mot_stride]);
 }
 
-if (mb_x + 1 >= s->mb_width || 
IS_INTRA(s->current_picture.f.mb_type[xy + 1])) {
+if (mb_x + 1 >= s->mb_width || IS_INTRA(cur_frame->mb_type[xy + 1])) {
 AV_COPY32(mv_cache[1][3], mv_cache[1][2]);
 AV_COPY32(mv_cache[2][3], mv_cache[2][2]);
 }else{
-AV_COPY32(mv_cache[1][3], 
s->current_picture.f.motion_val[0][mot_xy + 2]);
-AV_COPY32(mv_cache[2][3], 
s->current_picture.f.motion_val[0][mot_xy + 2 + mot_stride]);
+AV_COPY32(mv_cache[1][3], cur_frame->motion_val[0][mot_xy + 2]);
+AV_COPY32(mv_cache[2][3], cur_frame->motion_val[0][mot_xy + 2 + 
mot_stride]);
 }
 
 mx = 0;
-- 
1.7.12.3

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


Re: [libav-devel] [PATCH 1/1] h263: avoid memcpys over array bound in motion vector caching for obmc

2012-10-24 Thread Måns Rullgård
Janne Grunau  writes:

> Also changes existing AV_COPY32 calls to the unaligned variant.
> Fixes CID602232.
> ---
>  libavcodec/mpegvideo_motion.c | 40 
>  1 file changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
> index 22948e2..6676707 100644
> --- a/libavcodec/mpegvideo_motion.c
> +++ b/libavcodec/mpegvideo_motion.c
> @@ -639,36 +639,44 @@ static av_always_inline void 
> MPV_motion_internal(MpegEncContext *s,
>  
>  if(!is_mpeg12 && s->obmc && s->pict_type != AV_PICTURE_TYPE_B){
>  int16_t mv_cache[4][4][2];

This could be made aligned.  The motion_val pointer in AVFrame is
probably malloced and thus already aligned.

-- 
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] [libav-commits] libxvid: switch to encode2().

2012-10-24 Thread Diego Biurrun
On Wed, Oct 24, 2012 at 04:13:46PM +0200, Anton Khirnov wrote:
> 
> On Wed, 24 Oct 2012 11:47:24 +0200, Diego Biurrun  wrote:
> > On Thu, Aug 09, 2012 at 02:38:18AM +0200, Diego Biurrun wrote:
> > > On Thu, Feb 23, 2012 at 08:28:35PM +0100, Anton Khirnov wrote:
> > > > Module: libav
> > > > Branch: master
> > > > Commit: 4da6d194e5b00404f4d545adcaa8e206592ae746
> > > > 
> > > > Author:Anton Khirnov 
> > > > Committer: Anton Khirnov 
> > > > Date:  Thu Feb 23 08:19:13 2012 +0100
> > > > 
> > > > libxvid: switch to encode2().
> > > > 
> > > > --- a/libavcodec/libxvidff.c
> > > > +++ b/libavcodec/libxvidff.c
> > > > @@ -551,16 +569,16 @@ static av_cold int 
> > > > xvid_encode_close(AVCodecContext *avctx) {
> > > >   * @return Returns new length of frame data
> > > >   */
> > > >  int xvid_strip_vol_header(AVCodecContext *avctx,
> > > > -  unsigned char *frame,
> > > > +  AVPacket *pkt,
> > > >unsigned int header_len,
> > > >unsigned int frame_len) {
> > > 
> > > ditto
> > 
> > .. this one was not.
> 
> I don't see what is to be "fixed" here.

The Doxygen should be adapted to document pkt instead of frame.

> Unlike the stuff I removed, this comment
> is nontrivial and should be kept.

Yes.

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


[libav-devel] [PATCH 1/1] h263: avoid memcpys over array bound in motion vector caching for obmc

2012-10-24 Thread Janne Grunau
Also changes existing AV_COPY32 calls to the unaligned variant.
Fixes CID602232.
---
 libavcodec/mpegvideo_motion.c | 40 
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
index 22948e2..6676707 100644
--- a/libavcodec/mpegvideo_motion.c
+++ b/libavcodec/mpegvideo_motion.c
@@ -639,36 +639,44 @@ static av_always_inline void 
MPV_motion_internal(MpegEncContext *s,
 
 if(!is_mpeg12 && s->obmc && s->pict_type != AV_PICTURE_TYPE_B){
 int16_t mv_cache[4][4][2];
+AVFrame *cur_frame = &s->current_picture.f;
 const int xy= s->mb_x + s->mb_y*s->mb_stride;
 const int mot_stride= s->b8_stride;
 const int mot_xy= mb_x*2 + mb_y*2*mot_stride;
 
 assert(!s->mb_skipped);
 
-memcpy(mv_cache[1][1], s->current_picture.f.motion_val[0][mot_xy   
  ], sizeof(int16_t) * 4);
-memcpy(mv_cache[2][1], s->current_picture.f.motion_val[0][mot_xy + 
mot_stride], sizeof(int16_t) * 4);
-memcpy(mv_cache[3][1], s->current_picture.f.motion_val[0][mot_xy + 
mot_stride], sizeof(int16_t) * 4);
+AV_COPY32U(mv_cache[1][1], cur_frame->motion_val[0][mot_xy]);
+AV_COPY32U(mv_cache[1][2], cur_frame->motion_val[0][mot_xy + 1]);
 
-if (mb_y == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - 
s->mb_stride])) {
-memcpy(mv_cache[0][1], mv_cache[1][1], sizeof(int16_t)*4);
+AV_COPY32U(mv_cache[2][1], cur_frame->motion_val[0][mot_xy + 
mot_stride]);
+AV_COPY32U(mv_cache[2][2], cur_frame->motion_val[0][mot_xy + 
mot_stride + 1]);
+
+AV_COPY32U(mv_cache[3][1], cur_frame->motion_val[0][mot_xy + 
mot_stride]);
+AV_COPY32U(mv_cache[3][2], cur_frame->motion_val[0][mot_xy + 
mot_stride + 1]);
+
+if (mb_y == 0 || IS_INTRA(cur_frame->mb_type[xy - s->mb_stride])) {
+AV_COPY32U(mv_cache[0][1], mv_cache[1][1]);
+AV_COPY32U(mv_cache[0][2], mv_cache[1][2]);
 }else{
-memcpy(mv_cache[0][1], s->current_picture.f.motion_val[0][mot_xy - 
mot_stride], sizeof(int16_t) * 4);
+AV_COPY32U(mv_cache[0][1], cur_frame->motion_val[0][mot_xy - 
mot_stride]);
+AV_COPY32U(mv_cache[0][2], cur_frame->motion_val[0][mot_xy - 
mot_stride + 1]);
 }
 
-if (mb_x == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - 1])) {
-AV_COPY32(mv_cache[1][0], mv_cache[1][1]);
-AV_COPY32(mv_cache[2][0], mv_cache[2][1]);
+if (mb_x == 0 || IS_INTRA(cur_frame->mb_type[xy - 1])) {
+AV_COPY32U(mv_cache[1][0], mv_cache[1][1]);
+AV_COPY32U(mv_cache[2][0], mv_cache[2][1]);
 }else{
-AV_COPY32(mv_cache[1][0], 
s->current_picture.f.motion_val[0][mot_xy - 1]);
-AV_COPY32(mv_cache[2][0], 
s->current_picture.f.motion_val[0][mot_xy - 1 + mot_stride]);
+AV_COPY32U(mv_cache[1][0], cur_frame->motion_val[0][mot_xy - 1]);
+AV_COPY32U(mv_cache[2][0], cur_frame->motion_val[0][mot_xy - 1 + 
mot_stride]);
 }
 
-if (mb_x + 1 >= s->mb_width || 
IS_INTRA(s->current_picture.f.mb_type[xy + 1])) {
-AV_COPY32(mv_cache[1][3], mv_cache[1][2]);
-AV_COPY32(mv_cache[2][3], mv_cache[2][2]);
+if (mb_x + 1 >= s->mb_width || IS_INTRA(cur_frame->mb_type[xy + 1])) {
+AV_COPY32U(mv_cache[1][3], mv_cache[1][2]);
+AV_COPY32U(mv_cache[2][3], mv_cache[2][2]);
 }else{
-AV_COPY32(mv_cache[1][3], 
s->current_picture.f.motion_val[0][mot_xy + 2]);
-AV_COPY32(mv_cache[2][3], 
s->current_picture.f.motion_val[0][mot_xy + 2 + mot_stride]);
+AV_COPY32U(mv_cache[1][3], cur_frame->motion_val[0][mot_xy + 2]);
+AV_COPY32U(mv_cache[2][3], cur_frame->motion_val[0][mot_xy + 2 + 
mot_stride]);
 }
 
 mx = 0;
-- 
1.7.12.3

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


Re: [libav-devel] [libav-commits] libxvid: switch to encode2().

2012-10-24 Thread Anton Khirnov

On Wed, 24 Oct 2012 11:47:24 +0200, Diego Biurrun  wrote:
> On Thu, Aug 09, 2012 at 02:38:18AM +0200, Diego Biurrun wrote:
> > On Thu, Feb 23, 2012 at 08:28:35PM +0100, Anton Khirnov wrote:
> > > Module: libav
> > > Branch: master
> > > Commit: 4da6d194e5b00404f4d545adcaa8e206592ae746
> > > 
> > > Author:Anton Khirnov 
> > > Committer: Anton Khirnov 
> > > Date:  Thu Feb 23 08:19:13 2012 +0100
> > > 
> > > libxvid: switch to encode2().
> > > 
> > > --- a/libavcodec/libxvidff.c
> > > +++ b/libavcodec/libxvidff.c
> > > @@ -408,17 +409,25 @@ static av_cold int xvid_encode_init(AVCodecContext 
> > > *avctx)  {
> > >   * @param data Pointer to AVFrame of unencoded frame
> > >   * @return Returns 0 on success, -1 on failure
> > >   */
> > > -static int xvid_encode_frame(AVCodecContext *avctx,
> > > - unsigned char *frame, int buf_size, void *data) 
> > > {
> > > -int xerr, i;
> > > +static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> > > + const AVFrame *picture, int *got_packet)
> > 
> > This changes the function signature without adapting the Doxygen
> > comments.
> 
> This was fixed, but ..
> 
> > > @@ -551,16 +569,16 @@ static av_cold int xvid_encode_close(AVCodecContext 
> > > *avctx) {
> > >   * @return Returns new length of frame data
> > >   */
> > >  int xvid_strip_vol_header(AVCodecContext *avctx,
> > > -  unsigned char *frame,
> > > +  AVPacket *pkt,
> > >unsigned int header_len,
> > >unsigned int frame_len) {
> > 
> > ditto
> 
> .. this one was not.
> 

I don't see what is to be "fixed" here. Unlike the stuff I removed, this comment
is nontrivial and should be kept.

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


[libav-devel] [PATCH] rawvideo: refactor

2012-10-24 Thread Luca Barbato
ff_raw_read_header is used only for this demuxer for video.
---

ff_raw_read_header looks strange and we have the variants
ff_raw{audio,video}_read_header that do less and are actually used.

I'd remove ff_raw_read_header and add somethin specific for pcm and c722

 libavformat/Makefile  |  2 +-
 libavformat/rawvideodec.c | 68 ++-
 2 files changed, 62 insertions(+), 8 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 2d66a6d..a285af1 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -239,7 +239,7 @@ OBJS-$(CONFIG_PMP_DEMUXER)   += pmpdec.o
 OBJS-$(CONFIG_PVA_DEMUXER)   += pva.o
 OBJS-$(CONFIG_QCP_DEMUXER)   += qcp.o
 OBJS-$(CONFIG_R3D_DEMUXER)   += r3d.o
-OBJS-$(CONFIG_RAWVIDEO_DEMUXER)  += rawvideodec.o rawdec.o
+OBJS-$(CONFIG_RAWVIDEO_DEMUXER)  += rawvideodec.o
 OBJS-$(CONFIG_RAWVIDEO_MUXER)+= rawenc.o
 OBJS-$(CONFIG_RL2_DEMUXER)   += rl2.o
 OBJS-$(CONFIG_RM_DEMUXER)+= rmdec.o rm.o rmsipr.o
diff --git a/libavformat/rawvideodec.c b/libavformat/rawvideodec.c
index f71ea0a..5f372c9 100644
--- a/libavformat/rawvideodec.c
+++ b/libavformat/rawvideodec.c
@@ -19,8 +19,63 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/parseutils.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "internal.h"
 #include "avformat.h"
-#include "rawdec.h"
+
+typedef struct RawVideoDemuxerContext {
+const AVClass *class; /**< Class for private options. */
+char *video_size; /**< String describing video size, set by a 
private option. */
+char *pixel_format;   /**< Set by a private option. */
+char *framerate;  /**< String describing framerate, set by a 
private option. */
+} RawVideoDemuxerContext;
+
+
+static int rawvideo_read_header(AVFormatContext *ctx)
+{
+RawVideoDemuxerContext *s = ctx->priv_data;
+int width = 0, height = 0, ret = 0;
+enum AVPixelFormat pix_fmt;
+AVRational framerate;
+AVStream *st;
+
+st = avformat_new_stream(ctx, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+
+st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+
+st->codec->codec_id = ctx->iformat->raw_codec_id;
+
+if (s->video_size &&
+(ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
+av_log(ctx, AV_LOG_ERROR, "Couldn't parse video size.\n");
+return ret;
+}
+
+if ((pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
+av_log(ctx, AV_LOG_ERROR, "No such pixel format: %s.\n",
+   s->pixel_format);
+return AVERROR(EINVAL);
+}
+
+if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
+av_log(ctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n",
+   s->framerate);
+return ret;
+}
+
+avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
+
+st->codec->width  = width;
+st->codec->height = height;
+st->codec->pix_fmt = pix_fmt;
+
+return 0;
+}
+
 
 static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
@@ -34,9 +89,8 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (packet_size < 0)
 return -1;
 
-ret= av_get_packet(s->pb, pkt, packet_size);
-pkt->pts=
-pkt->dts= pkt->pos / packet_size;
+ret = av_get_packet(s->pb, pkt, packet_size);
+pkt->pts = pkt->dts = pkt->pos / packet_size;
 
 pkt->stream_index = 0;
 if (ret < 0)
@@ -44,7 +98,7 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 return 0;
 }
 
-#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
+#define OFFSET(x) offsetof(RawVideoDemuxerContext, x)
 #define DEC AV_OPT_FLAG_DECODING_PARAM
 static const AVOption rawvideo_options[] = {
 { "video_size", "A string describing frame size, such as 640x480 or 
hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
@@ -63,8 +117,8 @@ static const AVClass rawvideo_demuxer_class = {
 AVInputFormat ff_rawvideo_demuxer = {
 .name   = "rawvideo",
 .long_name  = NULL_IF_CONFIG_SMALL("raw video"),
-.priv_data_size = sizeof(FFRawVideoDemuxerContext),
-.read_header= ff_raw_read_header,
+.priv_data_size = sizeof(RawVideoDemuxerContext),
+.read_header= rawvideo_read_header,
 .read_packet= rawvideo_read_packet,
 .flags  = AVFMT_GENERIC_INDEX,
 .extensions = "yuv,cif,qcif,rgb",
-- 
1.7.12

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


Re: [libav-devel] [PATCH 02/45] lavc: check channel count after decoder init

2012-10-24 Thread Justin Ruggles
On 10/24/2012 06:02 AM, Luca Barbato wrote:
> On 10/23/12 11:43 PM, Justin Ruggles wrote:
>> Ensures the decoder did not set channel count to an insanely high value
>> during initialization, which could cause large memory usage when it
>> tries to
>> get a buffer during decoding.
>> ---
>>   libavcodec/utils.c |5 +
>>   1 files changed, 5 insertions(+), 0 deletions(-)
>>
> 
> I'd make it tunable (e.g. adding an -strict insane value for the cases
> in which it is needed).

Why? If you're worried about cases where people might actually want that
many channels to be decoded, we can increase the value. This is mainly
for situations where the decoder reads channel count from extradata
during init(). I'm not worried about 256 vs. 128 or whatever. I'm
worried about channel counts in the hundreds-of-thousands or millions.

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


Re: [libav-devel] [PATCH 1/4] configure: generalise 64-bit test

2012-10-24 Thread Luca Barbato
On 10/24/2012 01:33 PM, Mans Rullgard wrote:
> Signed-off-by: Mans Rullgard 
> ---
>  configure | 11 +--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 

The patchset looks ok.

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


[libav-devel] [PATCH 4/4] configure: detect parisc64 automatically

2012-10-24 Thread Mans Rullgard
Signed-off-by: Mans Rullgard 
---
 configure | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 7559605..01b0f67 100755
--- a/configure
+++ b/configure
@@ -2482,13 +2482,9 @@ case "$arch" in
 mips*|IP*)
 arch="mips"
 ;;
-parisc|hppa)
+parisc*|hppa*)
 arch="parisc"
 ;;
-parisc64|hppa64)
-arch="parisc"
-subarch="parisc64"
-;;
 "Power Macintosh"|ppc*|powerpc*)
 arch="ppc"
 ;;
@@ -2695,13 +2691,17 @@ check_64bit(){
 }
 
 case "$arch" in
-alpha|ia64|parisc|sparc)
+alpha|ia64|sparc)
 spic=$shared
 ;;
 mips)
 check_64bit mips mips64 '_MIPS_SIM > 1'
 spic=$shared
 ;;
+parisc)
+check_64bit parisc parisc64 'sizeof(void *) > 4'
+spic=$shared
+;;
 ppc)
 check_64bit ppc ppc64 'sizeof(void *) > 4'
 ;;
-- 
1.7.12.4

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


[libav-devel] [PATCH 3/4] configure: detect ppc64 automatically

2012-10-24 Thread Mans Rullgard
Signed-off-by: Mans Rullgard 
---
 configure | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index c1f7fe0..7559605 100755
--- a/configure
+++ b/configure
@@ -2489,13 +2489,9 @@ case "$arch" in
 arch="parisc"
 subarch="parisc64"
 ;;
-"Power Macintosh"|ppc|powerpc)
+"Power Macintosh"|ppc*|powerpc*)
 arch="ppc"
 ;;
-ppc64|powerpc64)
-arch="ppc"
-subarch="ppc64"
-;;
 s390|s390x)
 arch="s390"
 ;;
@@ -2706,6 +2702,9 @@ case "$arch" in
 check_64bit mips mips64 '_MIPS_SIM > 1'
 spic=$shared
 ;;
+ppc)
+check_64bit ppc ppc64 'sizeof(void *) > 4'
+;;
 x86)
 check_64bit x86_32 x86_64 'sizeof(void *) > 4'
 if test "$subarch" = "x86_64"; then
-- 
1.7.12.4

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


[libav-devel] [PATCH 1/4] configure: generalise 64-bit test

2012-10-24 Thread Mans Rullgard
Signed-off-by: Mans Rullgard 
---
 configure | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 158ce99..c626e07 100755
--- a/configure
+++ b/configure
@@ -2694,13 +2694,20 @@ EOF
 check_host_cflags -std=c99
 check_host_cflags -Wall
 
+check_64bit(){
+arch32=$1
+arch64=$2
+expr=$3
+check_code cc "" "int test[2*($expr) - 1]" &&
+subarch=$arch64 || subarch=$arch32
+}
+
 case "$arch" in
 alpha|ia64|mips|parisc|sparc)
 spic=$shared
 ;;
 x86)
-subarch="x86_32"
-check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
+check_64bit x86_32 x86_64 'sizeof(void *) > 4'
 if test "$subarch" = "x86_64"; then
 spic=$shared
 fi
-- 
1.7.12.4

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


[libav-devel] [PATCH 2/4] configure: detect mips64 automatically

2012-10-24 Thread Mans Rullgard
Signed-off-by: Mans Rullgard 
---
 configure | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index c626e07..c1f7fe0 100755
--- a/configure
+++ b/configure
@@ -2479,13 +2479,9 @@ case "$arch" in
 arm*)
 arch="arm"
 ;;
-mips|mipsel|IP*)
+mips*|IP*)
 arch="mips"
 ;;
-mips64*)
-arch="mips"
-subarch="mips64"
-;;
 parisc|hppa)
 arch="parisc"
 ;;
@@ -2703,7 +2699,11 @@ check_64bit(){
 }
 
 case "$arch" in
-alpha|ia64|mips|parisc|sparc)
+alpha|ia64|parisc|sparc)
+spic=$shared
+;;
+mips)
+check_64bit mips mips64 '_MIPS_SIM > 1'
 spic=$shared
 ;;
 x86)
-- 
1.7.12.4

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


Re: [libav-devel] [PATCH 42/45] wma: do not keep private copies of some AVCodecContext fields

2012-10-24 Thread Benjamin Larsson

OK

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


Re: [libav-devel] [PATCH 40/45] twinvq: validate sample rate code

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 39/45] twinvq: set channel layout

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 38/45] twinvq: validate that channels is not <= 0

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 36/45] sipr: set channel layout

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 32/45] qdm2: remove unneeded checks for channel count

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 31/45] qdm2: make sure channels is not <= 0 and set channel layout

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 17/45] dcadec: allow the decoder to change the channel layout mid-stream

2012-10-24 Thread Benjamin Larsson
Well, a dca stream isn't allowed to change configuration midstream. But 
I guess is the decoder can handle it the patch is OK even though it is a 
violation of the specs.


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


Re: [libav-devel] [PATCH 15/45] cook: move samples_per_frame from COOKSubpacket to where it is used

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 14/45] cook: use av_get_channel_layout_nb_channels() instead of cook_count_channels()

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 13/45] cook: reverse a condition so that the code makes more sense

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 12/45] cook: remove unneeded COOKContext variable, sample_rate

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 11/45] cook: remove unneeded COOKContext variable, bit_rate

2012-10-24 Thread Benjamin Larsson

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


Re: [libav-devel] [PATCH 10/45] cook: use AVCodecContext.channels instead of keeping a private copy

2012-10-24 Thread Benjamin Larsson

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


[libav-devel] [PATCH 3/3] avconv: warn about inappropriate output stream format

2012-10-24 Thread Kostya Shishkov
---
 avconv.c |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/avconv.c b/avconv.c
index bf1e2fa..d6e0099 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1566,6 +1566,7 @@ static int transcode_init(void)
 /* for each output stream, we compute the right encoding parameters */
 for (i = 0; i < nb_output_streams; i++) {
 AVCodecContext *icodec = NULL;
+const AVCodecDescriptor *desc;
 ost = output_streams[i];
 oc  = output_files[ost->file_index]->ctx;
 ist = get_input_stream(ost);
@@ -1605,6 +1606,12 @@ static int transcode_init(void)
 codec->codec_tag = icodec->codec_tag;
 }
 
+desc = avcodec_descriptor_get(codec->codec_id);
+if (desc && (desc->props & AV_CODEC_PROP_IDIOTIC)) {
+av_log(NULL, AV_LOG_FATAL, "You are trying to copy stream in 
idiotic format, don't do that!\n");
+// return AVERROR(EINVAL);
+}
+
 codec->bit_rate   = icodec->bit_rate;
 codec->rc_max_rate= icodec->rc_max_rate;
 codec->rc_buffer_size = icodec->rc_buffer_size;
@@ -1789,6 +1796,7 @@ static int transcode_init(void)
 if (ost->encoding_needed) {
 AVCodec  *codec = ost->enc;
 AVCodecContext *dec = NULL;
+const AVCodecDescriptor *desc;
 
 if ((ist = get_input_stream(ost)))
 dec = ist->st->codec;
@@ -1810,6 +1818,13 @@ static int transcode_init(void)
 ost->file_index, ost->index);
 goto dump_format;
 }
+
+desc = avcodec_descriptor_get(ost->st->codec->codec_id);
+if (desc && (desc->props & AV_CODEC_PROP_IDIOTIC)) {
+av_log(NULL, AV_LOG_FATAL, "You are trying to encode stream in 
idiotic format, don't do that!\n");
+// return AVERROR(EINVAL);
+}
+
 assert_avoptions(ost->opts);
 if (ost->st->codec->bit_rate && ost->st->codec->bit_rate < 1000)
 av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too 
low."
-- 
1.7.0.4

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


[libav-devel] [PATCH 2/3] mark codecs that deserve it

2012-10-24 Thread Kostya Shishkov
---
 libavcodec/codec_desc.c |   20 +++-
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 818a35e..35581f2 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -129,21 +129,21 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "msmpeg4v1",
 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant 
version 1"),
-.props = AV_CODEC_PROP_LOSSY,
+.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_IDIOTIC,
 },
 {
 .id= AV_CODEC_ID_MSMPEG4V2,
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "msmpeg4v2",
 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant 
version 2"),
-.props = AV_CODEC_PROP_LOSSY,
+.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_IDIOTIC,
 },
 {
 .id= AV_CODEC_ID_MSMPEG4V3,
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "msmpeg4v3",
 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant 
version 3"),
-.props = AV_CODEC_PROP_LOSSY,
+.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_IDIOTIC,
 },
 {
 .id= AV_CODEC_ID_WMV1,
@@ -1066,7 +1066,8 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "lagarith",
 .long_name = NULL_IF_CONFIG_SMALL("Lagarith lossless"),
-.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS |
+ AV_CODEC_PROP_IDIOTIC,
 },
 {
 .id= AV_CODEC_ID_PRORES,
@@ -1205,7 +1206,8 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "mss2",
 .long_name = NULL_IF_CONFIG_SMALL("MS Windows Media Video V9 Screen"),
-.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
+ AV_CODEC_PROP_IDIOTIC,
 },
 
 /* various PCM "codecs" */
@@ -1837,7 +1839,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .type  = AVMEDIA_TYPE_AUDIO,
 .name  = "tta",
 .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
-.props = AV_CODEC_PROP_LOSSLESS,
+.props = AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_IDIOTIC,
 },
 {
 .id= AV_CODEC_ID_SMACKAUDIO,
@@ -1879,7 +1881,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .type  = AVMEDIA_TYPE_AUDIO,
 .name  = "musepack7",
 .long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"),
-.props = AV_CODEC_PROP_LOSSY,
+.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_IDIOTIC,
 },
 {
 .id= AV_CODEC_ID_MLP,
@@ -1914,7 +1916,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .type  = AVMEDIA_TYPE_AUDIO,
 .name  = "ape",
 .long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
-.props = AV_CODEC_PROP_LOSSLESS,
+.props = AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_IDIOTIC,
 },
 {
 .id= AV_CODEC_ID_NELLYMOSER,
@@ -2089,7 +2091,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .type  = AVMEDIA_TYPE_AUDIO,
 .name  = "ralf",
 .long_name = NULL_IF_CONFIG_SMALL("RealAudio Lossless"),
-.props = AV_CODEC_PROP_LOSSLESS,
+.props = AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_IDIOTIC,
 },
 {
 .id= AV_CODEC_ID_IAC,
-- 
1.7.0.4

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


[libav-devel] [PATCH 1/3] add a new codec property

2012-10-24 Thread Kostya Shishkov
---
 libavcodec/avcodec.h |4 
 libavcodec/version.h |2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c505a92..6b36a9d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -479,6 +479,10 @@ typedef struct AVCodecDescriptor {
  * Codec supports lossless compression. Audio and video codecs only.
  */
 #define AV_CODEC_PROP_LOSSLESS  (1 << 2)
+/**
+ * Codec is badly designed and its use should not be encouraged.
+ */
+#define AV_CODEC_PROP_IDIOTIC  (1 << 3)
 
 #if FF_API_OLD_DECODE_AUDIO
 /* in bytes */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index b702f4b..5ee7c7c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,7 +27,7 @@
  */
 
 #define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR 31
+#define LIBAVCODEC_VERSION_MINOR 32
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
1.7.0.4

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


Re: [libav-devel] [PATCH 08/45] atrac1: do not keep a copy of channel count in the private context

2012-10-24 Thread Luca Barbato

On 10/23/12 11:43 PM, Justin Ruggles wrote:

---
  libavcodec/atrac1.c |6 ++
  1 files changed, 2 insertions(+), 4 deletions(-)


Ok.

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


Re: [libav-devel] [PATCH 02/45] lavc: check channel count after decoder init

2012-10-24 Thread Luca Barbato

On 10/23/12 11:43 PM, Justin Ruggles wrote:

Ensures the decoder did not set channel count to an insanely high value
during initialization, which could cause large memory usage when it tries to
get a buffer during decoding.
---
  libavcodec/utils.c |5 +
  1 files changed, 5 insertions(+), 0 deletions(-)



I'd make it tunable (e.g. adding an -strict insane value for the cases 
in which it is needed).


lu

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


Re: [libav-devel] [PATCH] smoothstreamingenc: Don't assume streams start from timestamp 0

2012-10-24 Thread Luca Barbato

On 10/24/12 10:28 AM, Martin Storsjö wrote:

Also use dts instead of pts for deciding where to split fragments.
---
  libavformat/smoothstreamingenc.c |9 ++---
  1 file changed, 6 insertions(+), 3 deletions(-)


Fine for me.

lu

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


Re: [libav-devel] [PATCH] mention plan 9 support in the changelog

2012-10-24 Thread Luca Barbato

On 10/24/12 10:23 AM, Reinhard Tartler wrote:

The commit message reads: "ffv1: update to ffv1 version 3"

Luca, can you clarify how this reads best?


ffv1 is the "name" of the codec, contraction of ffmpeg video 1.

The version (mind you there is now even a minor field) indicates a 
number of features added over the general basic lossless codec.


Those are experimental and Peter is helping me to keep in in proper 
shape by testing and ensuring we are interoperable.


I had already some issues ironed out (ffmpeg malloc has a strange canary 
so it never returns NULL on 0 sized mallocs, hiding bugs) but apparently 
there are few others.


So the naming 1.3 is common to define it.

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


Re: [libav-devel] [libav-commits] libxvid: switch to encode2().

2012-10-24 Thread Diego Biurrun
On Thu, Aug 09, 2012 at 02:38:18AM +0200, Diego Biurrun wrote:
> On Thu, Feb 23, 2012 at 08:28:35PM +0100, Anton Khirnov wrote:
> > Module: libav
> > Branch: master
> > Commit: 4da6d194e5b00404f4d545adcaa8e206592ae746
> > 
> > Author:Anton Khirnov 
> > Committer: Anton Khirnov 
> > Date:  Thu Feb 23 08:19:13 2012 +0100
> > 
> > libxvid: switch to encode2().
> > 
> > --- a/libavcodec/libxvidff.c
> > +++ b/libavcodec/libxvidff.c
> > @@ -408,17 +409,25 @@ static av_cold int xvid_encode_init(AVCodecContext 
> > *avctx)  {
> >   * @param data Pointer to AVFrame of unencoded frame
> >   * @return Returns 0 on success, -1 on failure
> >   */
> > -static int xvid_encode_frame(AVCodecContext *avctx,
> > - unsigned char *frame, int buf_size, void *data) {
> > -int xerr, i;
> > +static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> > + const AVFrame *picture, int *got_packet)
> 
> This changes the function signature without adapting the Doxygen
> comments.

This was fixed, but ..

> > @@ -551,16 +569,16 @@ static av_cold int xvid_encode_close(AVCodecContext 
> > *avctx) {
> >   * @return Returns new length of frame data
> >   */
> >  int xvid_strip_vol_header(AVCodecContext *avctx,
> > -  unsigned char *frame,
> > +  AVPacket *pkt,
> >unsigned int header_len,
> >unsigned int frame_len) {
> 
> ditto

.. this one was not.

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


Re: [libav-devel] [PATCH] mention plan 9 support in the changelog

2012-10-24 Thread Diego Biurrun
On Wed, Oct 24, 2012 at 09:57:26AM +0200, Reinhard Tartler wrote:
> 
> --- a/Changelog
> +++ b/Changelog
> @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
>  version :
>  - metadata (INFO tag) support in WAV muxer
>  - support for building DLLs using MSVC
> +- support building libav on the Plan 9 operating system

Maybe just make the last entry in the changelog for this release read

  - Plan 9

for that extra bit of comic mystery :)

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


Re: [libav-devel] [PATCH] Announce plain 9 beta 2 release

2012-10-24 Thread Diego Biurrun
On Wed, Oct 24, 2012 at 10:07:06AM +0200, Reinhard Tartler wrote:
> 
> --- a/src/news
> +++ b/src/news
> @@ -1,5 +1,33 @@
> +
> +
> + Support for shared libraries with the MSVC toolchain
> + Metadata (INFO tag) support in WAV muxer
> + Support building on the Plan 9 operating system
> + The SONAME of libavutil was bumped to libavutil.so.52
> + Support FF1 codec version 3
> + Various other bugfixes and cleanups

Close the  tags and drop the stray space at the beginning.

Push with that fixed please.

> @@ -9,7 +37,7 @@ contains several security and bug fixes.
>  
>  
> -The following bug in our Bugzilla have been fixed:
> +The following bugs in our Bugzilla have been fixed:

Didn't I fix this already?  Maybe you need to rebase.

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


Re: [libav-devel] [PATCH] mention plan 9 support in the changelog

2012-10-24 Thread Peter B.
On 10/24/2012 10:23 AM, Reinhard Tartler wrote:
> On Wed, Oct 24, 2012 at 10:14 AM, Kostya Shishkov
>  wrote:
>> On Wed, Oct 24, 2012 at 10:06:22AM +0200, Reinhard Tartler wrote:
>>
>>> maybe "support FFv1 codec version 3" as well? 
>> 1.3 maybe?
> The commit message reads: "ffv1: update to ffv1 version 3"
>
> Luca, can you clarify how this reads best?
I know I wasn't asked, but in practice the new version of FFv1 turned
out to be referred to as "FFv1.3".
Additionally, "update to ffv1 version 3" sounds like version 1 would
have been replaced, which is not true.

What about something like: "ffv1: Added support for version 3 (FFv1.3)"

Just my 2 cents.

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


Re: [libav-devel] ffv1.3 framemd5: segmentation fault

2012-10-24 Thread Peter B.
When creating framemd5 checksums of a FFv1.3 file created with ffmpeg, I
sometimes get a segfault with avconv.

Example:
Input video is "waterfall_cif.y4m" from Derf's collection at xiph.org [1].

//-
$ ffmpeg -i "input/xiph-derf/bis_SD/waterfall_cif.y4m" -an -vcodec ffv1
-level 3 -context 1 -coder 1 -g 300 -threads 8 -strict experimental
-slices 30 -slicecrc 1 "waterfall_ffv1.avi"
//-
ffmpeg version N-45924-ge2820d9 Copyright (c) 2000-2012 the FFmpeg
developers
  built on Oct 23 2012 20:00:42 with gcc 4.6.1 (Ubuntu/Linaro
4.6.1-9ubuntu3)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree
--enable-version3 --enable-postproc --enable-swscale --enable-avfilter
--enable-pthreads --enable-bzlib --enable-libmp3lame --enable-libvorbis
--enable-libxvid --enable-zlib --enable-libopenjpeg --enable-decoder=png
--enable-encoder=png --enable-libfreetype --enable-libschroedinger
  libavutil  52.  0.100 / 52.  0.100
  libavcodec 54. 68.100 / 54. 68.100
  libavformat54. 34.100 / 54. 34.100
  libavdevice54.  3.100 / 54.  3.100
  libavfilter 3. 20.104 /  3. 20.104
  libswscale  2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc52.  1.100 / 52.  1.100
[yuv4mpegpipe @ 0x3313240] Estimating duration from bitrate, this may be
inaccurate
Input #0, yuv4mpegpipe, from 'input/xiph-derf/bis_SD/waterfall_cif.y4m':
  Duration: N/A, bitrate: N/A
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 352x288,
SAR 128:117 DAR 1408:1053, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
Output #0, avi, to 'waterfall_ffv1.avi':
  Metadata:
ISFT: Lavf54.34.100
Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv420p, 352x288 [SAR
128:117 DAR 1408:1053], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> ffv1)
Press [q] to stop, [?] for help
frame=  260 fps=0.0 q=0.0 Lsize=   21983kB time=00:00:08.67
bitrate=20758.1kbits/s   
video:21971kB audio:0kB subtitle:0 global headers:0kB muxing overhead
0.053888%
//-


//-
$ avconv -i "waterfall_ffv1.avi" -an -f framemd5 waterfall_avconv.framemd5
//-
avconv version v9_beta1-212-g5e28e97, Copyright (c) 2000-2012 the Libav
developers
  built on Oct 23 2012 20:39:35 with gcc 4.6.1 (Ubuntu/Linaro
4.6.1-9ubuntu3)
[ffv1 @ 0x1b057a0] quant_table_index out of range
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1650
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1255
[ffv1 @ 0x1b057a0] bytestream end mismatching by 997
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1225
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1290
[ffv1 @ 0x1b057a0] quant_table_index out of range
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1630
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1172
[ffv1 @ 0x1b057a0] quant_table_index out of range
Last message repeated 1 times
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1790
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1462
[ffv1 @ 0x1b057a0] quant_table_index out of range
Last message repeated 2 times
[ffv1 @ 0x1b057a0] bytestream end mismatching by 982
[ffv1 @ 0x1b057a0] bytestream end mismatching by 395
[ffv1 @ 0x1b057a0] bytestream end mismatching by -734
Input #0, avi, from 'waterfall_ffv1.avi':
  Metadata:
encoder : Lavf54.34.100
  Duration: 00:00:08.67, start: 0.00, bitrate: 20758 kb/s
Stream #0.0: Video: ffv1, yuv420p, 352x288, PAR 128:117 DAR
1408:1053, 29.97 fps, 29.97 tbr, 29.97 tbn
Output #0, framemd5, to 'waterfall_avconv.framemd5':
  Metadata:
encoder : Lavf54.19.0
Stream #0.0: Video: rawvideo, yuv420p, 352x288 [PAR 128:117 DAR
1408:1053], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (ffv1 -> rawvideo)
Press ctrl-c to stop encoding
[ffv1 @ 0x1b057a0] quant_table_index out of range
Last message repeated 3 times
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1225
[ffv1 @ 0x1b057a0] quant_table_index out of range
Last message repeated 3 times
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1290
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1172
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1630
[ffv1 @ 0x1b057a0] bytestream end mismatching by 982
[ffv1 @ 0x1b057a0] bytestream end mismatching by 395
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1255
[ffv1 @ 0x1b057a0] bytestream end mismatching by 997
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1650
[ffv1 @ 0x1b057a0] bytestream end mismatching by -734
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1790
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1462
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1658
[ffv1 @ 0x1b057a0] bytestream end mismatching by 1760
[ffv1 @ 0x1b057a0] quant_table_index out of range
Last message repeated 5 times
[ffv1 @ 0x1b057a0] bytestream end mismatching by 2758
[ffv1 @ 0x1b057a0] bytestream end mismatch

[libav-devel] [PATCH] smoothstreamingenc: Don't assume streams start from timestamp 0

2012-10-24 Thread Martin Storsjö
Also use dts instead of pts for deciding where to split fragments.
---
 libavformat/smoothstreamingenc.c |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 69d555f..1ed675a 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -559,12 +559,15 @@ static int ism_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 SmoothStreamingContext *c = s->priv_data;
 AVStream *st = s->streams[pkt->stream_index];
 OutputStream *os = &c->streams[pkt->stream_index];
-int64_t end_pts = (c->nb_fragments + 1) * c->min_frag_duration;
+int64_t end_dts = (c->nb_fragments + 1) * c->min_frag_duration;
 int ret;
 
+if (st->first_dts == AV_NOPTS_VALUE)
+st->first_dts = pkt->dts;
+
 if ((!c->has_video || st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
-av_compare_ts(pkt->pts, st->time_base,
-  end_pts, AV_TIME_BASE_Q) >= 0 &&
+av_compare_ts(pkt->dts - st->first_dts, st->time_base,
+  end_dts, AV_TIME_BASE_Q) >= 0 &&
 pkt->flags & AV_PKT_FLAG_KEY && os->packets_written) {
 
 if ((ret = ism_flush(s, 0)) < 0)
-- 
1.7.10.4

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


Re: [libav-devel] [PATCH] mention plan 9 support in the changelog

2012-10-24 Thread Reinhard Tartler
On Wed, Oct 24, 2012 at 10:14 AM, Kostya Shishkov
 wrote:
> On Wed, Oct 24, 2012 at 10:06:22AM +0200, Reinhard Tartler wrote:
>> On Wed, Oct 24, 2012 at 9:57 AM, Reinhard Tartler  
>> wrote:
>> > Signed-off-by: Reinhard Tartler 
>> > ---
>> >  Changelog |1 +
>> >  1 file changed, 1 insertion(+)
>> >
>> > diff --git a/Changelog b/Changelog
>> > index c3d55c1..3b8ba4a 100644
>> > --- a/Changelog
>> > +++ b/Changelog
>> > @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
>> >  version :
>> >  - metadata (INFO tag) support in WAV muxer
>> >  - support for building DLLs using MSVC
>> > +- support building libav on the Plan 9 operating system
>> >
>> >
>>
>> maybe "support FFv1 codec version 3" as well?
>
> 1.3 maybe?

The commit message reads: "ffv1: update to ffv1 version 3"

Luca, can you clarify how this reads best?


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


Re: [libav-devel] [PATCH] mention plan 9 support in the changelog

2012-10-24 Thread Kostya Shishkov
On Wed, Oct 24, 2012 at 10:06:22AM +0200, Reinhard Tartler wrote:
> On Wed, Oct 24, 2012 at 9:57 AM, Reinhard Tartler  wrote:
> > Signed-off-by: Reinhard Tartler 
> > ---
> >  Changelog |1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Changelog b/Changelog
> > index c3d55c1..3b8ba4a 100644
> > --- a/Changelog
> > +++ b/Changelog
> > @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
> >  version :
> >  - metadata (INFO tag) support in WAV muxer
> >  - support for building DLLs using MSVC
> > +- support building libav on the Plan 9 operating system
> >
> >
> 
> maybe "support FFv1 codec version 3" as well?

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


[libav-devel] [PATCH] Announce plain 9 beta 2 release

2012-10-24 Thread Reinhard Tartler
---
 src/download |   20 ++--
 src/news |   30 +-
 2 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/src/download b/src/download
index 9a53b21..28d7603 100644
--- a/src/download
+++ b/src/download
@@ -213,16 +213,16 @@ new Bugzilla for filing bugs:
 
 
 
-Download bzip2 tarball  
-MD5
-SHA1
-PGP signature
-Download gzip tarball  
-MD5
-SHA1
-PGP signature
-Changelog
-Release Notes
+Download bzip2 tarball  
+MD5
+SHA1
+PGP signature
+Download gzip tarball  
+MD5
+SHA1
+PGP signature
+Changelog
+Release Notes
 
 
 Libav 0.8.4 "Forbidden Fruit"
diff --git a/src/news b/src/news
index b46a98f..db13b7f 100644
--- a/src/news
+++ b/src/news
@@ -1,5 +1,33 @@
 News
 
+October 23 2012
+
+
+We are still on track with our next major release codename "Plain 9".
+Today, we update our beta release based on the feedback and
+testing that we got.
+
+
+
+Compared to the changes listed in the beta_1
+announcement, the following items come in addition:
+
+
+ Support for shared libraries with the MSVC toolchain
+ Metadata (INFO tag) support in WAV muxer
+ Support building on the Plan 9 operating system
+ The SONAME of libavutil was bumped to libavutil.so.52
+ Support FF1 codec version 3
+ Various other bugfixes and cleanups
+
+
+
+
+You can download the new release, as usual,
+from our download page
+
+
+
 October 22 2012
 
 
@@ -9,7 +37,7 @@ contains several security and bug fixes.
 
 
 
-The following bug in our Bugzilla have been fixed:
+The following bugs in our Bugzilla have been fixed:
 
 http://bugzilla.libav.org/show_bug.cgi?id=118";>#118: zzufed 
H.261 file crashes avconv signal 11 (SIGSEGV)
 http://bugzilla.libav.org/show_bug.cgi?id=203";>#203: scale 
filter has a rounding error
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] mention plan 9 support in the changelog

2012-10-24 Thread Reinhard Tartler
On Wed, Oct 24, 2012 at 9:57 AM, Reinhard Tartler  wrote:
> Signed-off-by: Reinhard Tartler 
> ---
>  Changelog |1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Changelog b/Changelog
> index c3d55c1..3b8ba4a 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
>  version :
>  - metadata (INFO tag) support in WAV muxer
>  - support for building DLLs using MSVC
> +- support building libav on the Plan 9 operating system
>
>

maybe "support FFv1 codec version 3" as well?

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


[libav-devel] [PATCH] mention plan 9 support in the changelog

2012-10-24 Thread Reinhard Tartler
Signed-off-by: Reinhard Tartler 
---
 Changelog |1 +
 1 file changed, 1 insertion(+)

diff --git a/Changelog b/Changelog
index c3d55c1..3b8ba4a 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version :
 - metadata (INFO tag) support in WAV muxer
 - support for building DLLs using MSVC
+- support building libav on the Plan 9 operating system
 
 
 version 9_beta1:
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH 28/45] libopencore-amr: set channel layout for amr-nb or if not set by the user

2012-10-24 Thread Martin Storsjö

On Wed, 24 Oct 2012, Justin Ruggles wrote:


On 10/23/2012 06:13 PM, Martin Storsjö wrote:

On Tue, 23 Oct 2012, Justin Ruggles wrote:


---
libavcodec/libopencore-amr.c |   10 ++
1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index 9a543b4..dcee34d 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -19,6 +19,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
 */

+#include "libavutil/audioconvert.h"
#include "avcodec.h"
#include "libavutil/avstring.h"
#include "libavutil/common.h"
@@ -30,11 +31,12 @@ static void amr_decode_fix_avctx(AVCodecContext
*avctx)
{
const int is_amr_wb = 1 + (avctx->codec_id == AV_CODEC_ID_AMR_WB);

-if (!avctx->sample_rate)
-avctx->sample_rate = 8000 * is_amr_wb;
+avctx->sample_rate = 8000 * is_amr_wb;

-if (!avctx->channels)
-avctx->channels = 1;
+if (!avctx->channels || !is_amr_wb) {
+avctx->channels   = 1;
+avctx->channel_layout = AV_CH_LAYOUT_MONO;
+}

avctx->sample_fmt = AV_SAMPLE_FMT_S16;
}
--
1.7.1


Umm, what? AFAIK, both -nb and -wb support stereo just as much (or as
little) - the codec itself doesn't, but the file format for .amr does in
principle allow you to store individual mono frames from the left and
right channels interleaved. Not sure if anything really supports it.

So I don't see why there would be any distinction between -nb and -wb here.


In searching, I couldn't find any reference to amr-nb being anything
other than mono, but if it is theoretically allowed, I'll redo the patch
to check the value from the demuxer and error out as unsupported if it's
more than 1 channel.


Ok, that sounds good.

FWIW, the .amr storage format is specified in RFC 3267, and that also 
specifies how to store multi-channel data, see 
http://tools.ietf.org/html/rfc3267#section-5.2 (and the first paragraph of 
section 5.3).


In practice, I've never seen this though, and since we don't really 
support it, limiting things to 1 channel makes sense.


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


Re: [libav-devel] [PATCH] lavc: add CODEC_CAP_DR1 to all video decoders missing them

2012-10-24 Thread Kostya Shishkov
On Wed, Oct 17, 2012 at 09:41:42PM +0200, Anton Khirnov wrote:
> The remaining ones are:
> libschroedinger -- DR possible in principle / the decoder may be replaced 
> with native
> libvpx -- DR not possible with current API
> rawvideo -- decoded frame depends on input packet, DR not possible with
> current API
> amv -- dr disabled because of a bug

Because of a bug in design. I.e. it's horizontally flipped JPEG and if height
is not multiple of sixteen you can have two possible solutions: decode it
inplace and then memmove the image up to skip low (garbage) lines (ugly), 
decode it
from correct position and write some lines before frame start (that's what we
have now and it works only with padding present), or check if we are decoding
the last row and write only the required amount of lines then (might hurt
performance).

> bmv -- should switch to reget_buffer()

There's no need for that - the decoder uses internal frame buffer (because of
decoding method it should not have padding), hence regetting old frame is not
needed.

> eatgv -- mallocs the memory itself for whatever reason
> ---
>  libavcodec/bink.c|1 +
>  libavcodec/dpx.c |1 +
>  libavcodec/indeo3.c  |1 +
>  libavcodec/indeo4.c  |1 +
>  libavcodec/indeo5.c  |1 +
>  libavcodec/kgv1dec.c |1 +
>  libavcodec/sgidec.c  |1 +
>  libavcodec/vb.c  |1 +
>  libavcodec/yop.c |1 +
>  9 files changed, 9 insertions(+)

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


Re: [libav-devel] [PATCH 03/45] dca_parser: allow the parser to change the sample rate

2012-10-24 Thread Kostya Shishkov
On Wed, Oct 24, 2012 at 01:34:00AM -0400, Justin Ruggles wrote:
> On 10/24/2012 12:13 AM, Kostya Shishkov wrote:
> > On Tue, Oct 23, 2012 at 05:43:18PM -0400, Justin Ruggles wrote:
> >> ---
> >>  libavcodec/dca_parser.c |3 +--
> >>  1 files changed, 1 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c
> >> index 7e65d0b..ab235cf 100644
> >> --- a/libavcodec/dca_parser.c
> >> +++ b/libavcodec/dca_parser.c
> >> @@ -192,8 +192,7 @@ static int dca_parse(AVCodecParserContext * s,
> >>  /* read the duration and sample rate from the frame header */
> >>  if (!dca_parse_params(buf, buf_size, &duration, &sample_rate)) {
> >>  s->duration = duration;
> >> -if (!avctx->sample_rate)
> >> -avctx->sample_rate = sample_rate;
> >> +avctx->sample_rate = sample_rate;
> >>  } else
> >>  s->duration = 0;
> >>  
> >> -- 
> > 
> > LGTM (I wonder what happens when we support extensions like X96k properly 
> > but
> > that's outside the scope of this patch)
> 
> I guess if the sample rate available at the parser level does not
> accurately reflect the real sample rate then we just don't set it there
> at all...

I guess it's better to set it and for decoder to change it if needed.
But it's all bikeshed, let's wait till we get full-featured DTS decoder.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel