From dcdfb8ede3580cde6acc1c6ca889ad3b610d75dc Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 25 Oct 2012 15:10:22 +0200 Subject: [PATCH 1/6] pcmdec: change default of channels parameter to 1 This was previously implicitly done in ff_raw_read_header(). Fixes fate tests with pcm input. --- libavformat/pcmdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c index 40446c29e3..de6f13e0c5 100644 --- a/libavformat/pcmdec.c +++ b/libavformat/pcmdec.c @@ -83,7 +83,7 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt) static const AVOption pcm_options[] = { { "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, - { "channels", "", offsetof(RawAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, + { "channels", "", offsetof(RawAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { NULL }, }; From 22f7942fe7d7349e3562ac68fa101d9efec522df Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Thu, 25 Oct 2012 15:42:08 +0200 Subject: [PATCH 2/6] ffv1: set the range coder state in decode_slice_header --- libavcodec/ffv1dec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index f5f7a8f2f5..c5329b42ad 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -273,7 +273,12 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs) unsigned ps, i, context_count; memset(state, 128, sizeof(state)); - av_assert0(f->version > 2); + if (fs->ac > 1) { + for (i = 1; i < 256; i++) { + fs->c.one_state[i] = f->state_transition[i]; + fs->c.zero_state[256 - i] = 256 - fs->c.one_state[i]; + } + } fs->slice_x = get_symbol(c, state, 0) * f->width; fs->slice_y = get_symbol(c, state, 0) * f->height; From 254056c4ab6161d687caf8e9b837571db76e60c6 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Mon, 1 Jan 2001 01:08:20 +0100 Subject: [PATCH 3/6] pcm: change references to raw to pcm --- libavformat/pcmdec.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c index de6f13e0c5..716d8b7977 100644 --- a/libavformat/pcmdec.c +++ b/libavformat/pcmdec.c @@ -27,15 +27,15 @@ #define RAW_SAMPLES 1024 -typedef struct RawAudioDemuxerContext { +typedef struct PCMAudioDemuxerContext { AVClass *class; int sample_rate; int channels; -} RawAudioDemuxerContext; +} PCMAudioDemuxerContext; -static int raw_read_header(AVFormatContext *s) +static int pcm_read_header(AVFormatContext *s) { - RawAudioDemuxerContext *s1 = s->priv_data; + PCMAudioDemuxerContext *s1 = s->priv_data; AVStream *st; st = avformat_new_stream(s, NULL); @@ -60,7 +60,7 @@ static int raw_read_header(AVFormatContext *s) return 0; } -static int raw_read_packet(AVFormatContext *s, AVPacket *pkt) +static int pcm_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret, size, bps; // AVStream *st = s->streams[0]; @@ -82,8 +82,8 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt) } static const AVOption pcm_options[] = { - { "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, - { "channels", "", offsetof(RawAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, + { "sample_rate", "", offsetof(PCMAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, + { "channels", "", offsetof(PCMAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { NULL }, }; @@ -97,9 +97,9 @@ static const AVClass name_ ## _demuxer_class = { \ AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \ .name = #name_, \ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ - .priv_data_size = sizeof(RawAudioDemuxerContext), \ - .read_header = raw_read_header, \ - .read_packet = raw_read_packet, \ + .priv_data_size = sizeof(PCMAudioDemuxerContext), \ + .read_header = pcm_read_header, \ + .read_packet = pcm_read_packet, \ .read_seek = ff_pcm_read_seek, \ .flags = AVFMT_GENERIC_INDEX, \ .extensions = ext, \ From 121604b024cfd04644a9aa6012bd0e9a48efbd9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 25 Oct 2012 17:13:06 +0300 Subject: [PATCH 4/6] build: Include HEADERS-yes in the HEADERS variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes sure the previously always installed public header lzo.h is installed if the LZO functionality is enabled. Signed-off-by: Martin Storsjö --- Makefile | 2 +- common.mak | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 07df53871a..1f73a0a6a8 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ config.h: .config @-tput sgr0 2>/dev/null SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \ - ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \ + HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \ ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS \ ALTIVEC-OBJS VIS-OBJS \ MMX-OBJS YASM-OBJS \ diff --git a/common.mak b/common.mak index dd9f4cbbc5..c4d299960e 100644 --- a/common.mak +++ b/common.mak @@ -23,6 +23,7 @@ HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF)) TOOLS += $(TOOLS-yes) TOOLOBJS := $(TOOLS:%=tools/%.o) TOOLS := $(TOOLS:%=tools/%$(EXESUF)) +HEADERS += $(HEADERS-yes) DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME)) From eadfb0560a2f194fbc453bcb22fea73f3c9a27ad Mon Sep 17 00:00:00 2001 From: Michael Kostylev Date: Thu, 25 Oct 2012 11:38:51 +0100 Subject: [PATCH 5/6] configure: recognise more sparc variants as --cpu argument Signed-off-by: Mans Rullgard --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index df07a6f4fb..a39cb7792f 100755 --- a/configure +++ b/configure @@ -2568,12 +2568,12 @@ elif enabled x86; then elif enabled sparc; then case $cpu in - niagara) + cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789]) cpuflags="-mcpu=$cpu" disable vis ;; - sparc64) - cpuflags="-mcpu=v9" + ultrasparc*|niagara[234]) + cpuflags="-mcpu=$cpu" ;; esac From 6aa93689abe8c095cec9fa828c2dee3131008995 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Thu, 25 Oct 2012 15:56:16 +0100 Subject: [PATCH 6/6] configure: sanitise sparc vis check It is wrong to force -mcpu=ultrasparc when checking for vis. Signed-off-by: Mans Rullgard --- configure | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure b/configure index a39cb7792f..bfa3a616e5 100755 --- a/configure +++ b/configure @@ -3100,9 +3100,7 @@ EOF elif enabled sparc; then - enabled vis && - check_inline_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc && - add_cflags -mcpu=ultrasparc -mtune=ultrasparc + enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"' elif enabled x86; then