From c1dcbfddf9d8c484121824f876a1d8faee26d7fa Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 3 Jun 2011 20:58:01 +0200 Subject: [PATCH 01/18] tty: add framerate private option. --- libavformat/tty.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libavformat/tty.c b/libavformat/tty.c index 970274eb54..ecd3f58c77 100644 --- a/libavformat/tty.c +++ b/libavformat/tty.c @@ -37,6 +37,7 @@ typedef struct { int chars_per_frame; uint64_t fsize; /**< file size less metadata buffer */ char *video_size;/**< A string describing video size, set by a private option. */ + char *framerate; /**< Set by a private option. */ } TtyDemuxContext; /** @@ -75,6 +76,7 @@ static int read_header(AVFormatContext *avctx, TtyDemuxContext *s = avctx->priv_data; int width = 0, height = 0, ret = 0; AVStream *st = av_new_stream(avctx, 0); + AVRational framerate; if (!st) { ret = AVERROR(ENOMEM); @@ -88,20 +90,21 @@ static int read_header(AVFormatContext *avctx, av_log (avctx, AV_LOG_ERROR, "Couldn't parse video size.\n"); goto fail; } + if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) { + av_log(avctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate); + goto fail; + } #if FF_API_FORMAT_PARAMETERS if (ap->width > 0) width = ap->width; if (ap->height > 0) height = ap->height; + if (ap->time_base.num) + framerate = (AVRational){ap->time_base.den, ap->time_base.num}; #endif st->codec->width = width; st->codec->height = height; - - if (!ap->time_base.num) { - av_set_pts_info(st, 60, 1, 25); - } else { - av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); - } + av_set_pts_info(st, 60, framerate.den, framerate.num); /* simulate tty display speed */ #if FF_API_FORMAT_PARAMETERS @@ -152,6 +155,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt) static const AVOption options[] = { { "chars_per_frame", "", offsetof(TtyDemuxContext, chars_per_frame), FF_OPT_TYPE_INT, {.dbl = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM}, { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, + { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, { NULL }, }; From f33e2a51d9e704a48a7c72333d1d720633eed98a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 4 Jun 2011 00:13:35 +0200 Subject: [PATCH 02/18] img2: add pixel_format private option. --- libavformat/img2.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/libavformat/img2.c b/libavformat/img2.c index 1d50fbf567..fdd6a3ce82 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -22,18 +22,23 @@ #include "libavutil/intreadwrite.h" #include "libavutil/avstring.h" +#include "libavutil/log.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" #include "avformat.h" #include "avio_internal.h" #include "internal.h" #include typedef struct { + const AVClass *class; /**< Class for private options. */ int img_first; int img_last; int img_number; int img_count; int is_pipe; char path[1024]; + char *pixel_format; /**< Set by a private option. */ } VideoData; typedef struct { @@ -200,6 +205,7 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) VideoData *s = s1->priv_data; int first_index, last_index; AVStream *st; + enum PixelFormat pix_fmt = PIX_FMT_NONE; s1->ctx_flags |= AVFMTCTX_NOHEADER; @@ -208,6 +214,15 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) return AVERROR(ENOMEM); } + if (s->pixel_format && (pix_fmt = av_get_pix_fmt(s->pixel_format)) == PIX_FMT_NONE) { + av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n", s->pixel_format); + return AVERROR(EINVAL); + } +#if FF_API_FORMAT_PARAMETERS + if (ap->pix_fmt != PIX_FMT_NONE) + pix_fmt = ap->pix_fmt; +#endif + av_strlcpy(s->path, s1->filename, sizeof(s->path)); s->img_number = 0; s->img_count = 0; @@ -252,8 +267,8 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = av_str2id(img_tags, s->path); } - if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE) - st->codec->pix_fmt = ap->pix_fmt; + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && pix_fmt != PIX_FMT_NONE) + st->codec->pix_fmt = pix_fmt; return 0; } @@ -421,6 +436,20 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) #endif /* CONFIG_IMAGE2_MUXER || CONFIG_IMAGE2PIPE_MUXER */ +#define OFFSET(x) offsetof(VideoData, x) +#define DEC AV_OPT_FLAG_DECODING_PARAM +static const AVOption options[] = { + { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, + { NULL }, +}; + +static const AVClass img2_class = { + .class_name = "image2 demuxer", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + /* input */ #if CONFIG_IMAGE2_DEMUXER AVInputFormat ff_image2_demuxer = { @@ -431,6 +460,7 @@ AVInputFormat ff_image2_demuxer = { .read_header = read_header, .read_packet = read_packet, .flags = AVFMT_NOFILE, + .priv_class = &img2_class, }; #endif #if CONFIG_IMAGE2PIPE_DEMUXER @@ -440,6 +470,7 @@ AVInputFormat ff_image2pipe_demuxer = { .priv_data_size = sizeof(VideoData), .read_header = read_header, .read_packet = read_packet, + .priv_class = &img2_class, }; #endif From a915bf64ccae3b341b7a416d509f7f807ab65777 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 4 Jun 2011 00:17:31 +0200 Subject: [PATCH 03/18] img2: add video_size private option. --- libavformat/img2.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/libavformat/img2.c b/libavformat/img2.c index fdd6a3ce82..802ad6fbc8 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -25,6 +25,7 @@ #include "libavutil/log.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" +#include "libavutil/parseutils.h" #include "avformat.h" #include "avio_internal.h" #include "internal.h" @@ -39,6 +40,7 @@ typedef struct { int is_pipe; char path[1024]; char *pixel_format; /**< Set by a private option. */ + char *video_size; /**< Set by a private option. */ } VideoData; typedef struct { @@ -203,7 +205,8 @@ enum CodecID av_guess_image2_codec(const char *filename){ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) { VideoData *s = s1->priv_data; - int first_index, last_index; + int first_index, last_index, ret = 0; + int width = 0, height = 0; AVStream *st; enum PixelFormat pix_fmt = PIX_FMT_NONE; @@ -218,9 +221,17 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n", s->pixel_format); return AVERROR(EINVAL); } + if (s->video_size && (ret = av_parse_video_size(&width, &height, s->video_size)) < 0) { + av_log(s, AV_LOG_ERROR, "Could not parse video size: %s.\n", s->video_size); + return ret; + } #if FF_API_FORMAT_PARAMETERS if (ap->pix_fmt != PIX_FMT_NONE) pix_fmt = ap->pix_fmt; + if (ap->width > 0) + width = ap->width; + if (ap->height > 0) + height = ap->height; #endif av_strlcpy(s->path, s1->filename, sizeof(s->path)); @@ -241,9 +252,9 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); } - if(ap->width && ap->height){ - st->codec->width = ap->width; - st->codec->height= ap->height; + if (width && height) { + st->codec->width = width; + st->codec->height = height; } if (!s->is_pipe) { @@ -440,6 +451,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) #define DEC AV_OPT_FLAG_DECODING_PARAM static const AVOption options[] = { { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, + { "video_size", "", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { NULL }, }; From abcedfac60efa679e18a561bce0e93f8535b60e3 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 4 Jun 2011 00:21:26 +0200 Subject: [PATCH 04/18] img2: add framerate private option. --- libavformat/img2.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libavformat/img2.c b/libavformat/img2.c index 802ad6fbc8..4e82aa301b 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -41,6 +41,7 @@ typedef struct { char path[1024]; char *pixel_format; /**< Set by a private option. */ char *video_size; /**< Set by a private option. */ + char *framerate; /**< Set by a private option. */ } VideoData; typedef struct { @@ -209,6 +210,7 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) int width = 0, height = 0; AVStream *st; enum PixelFormat pix_fmt = PIX_FMT_NONE; + AVRational framerate; s1->ctx_flags |= AVFMTCTX_NOHEADER; @@ -225,6 +227,10 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) av_log(s, AV_LOG_ERROR, "Could not parse video size: %s.\n", s->video_size); return ret; } + if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) { + av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate); + return ret; + } #if FF_API_FORMAT_PARAMETERS if (ap->pix_fmt != PIX_FMT_NONE) pix_fmt = ap->pix_fmt; @@ -232,6 +238,8 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) width = ap->width; if (ap->height > 0) height = ap->height; + if (ap->time_base.num) + framerate = (AVRational){ap->time_base.den, ap->time_base.num}; #endif av_strlcpy(s->path, s1->filename, sizeof(s->path)); @@ -246,11 +254,7 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) st->need_parsing = AVSTREAM_PARSE_FULL; } - if (!ap->time_base.num) { - av_set_pts_info(st, 60, 1, 25); - } else { - av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); - } + av_set_pts_info(st, 60, framerate.den, framerate.num); if (width && height) { st->codec->width = width; @@ -452,6 +456,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) static const AVOption options[] = { { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "video_size", "", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, + { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, { NULL }, }; From b2592ea42ca0d7c81b6e6ae90189d43e3e3fce59 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 4 Jun 2011 00:23:14 +0200 Subject: [PATCH 05/18] lavf: deprecate AVFormatParameters.time_base. --- libavformat/avformat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 27cd0f7763..5b67211959 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -227,8 +227,8 @@ typedef struct AVProbeData { #define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer typedef struct AVFormatParameters { - AVRational time_base; #if FF_API_FORMAT_PARAMETERS + attribute_deprecated AVRational time_base; attribute_deprecated int sample_rate; attribute_deprecated int channels; attribute_deprecated int width; From dc435c4e9dfb10c81f177970a14e64a7b232ba54 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Mon, 6 Jun 2011 12:37:06 +0100 Subject: [PATCH 06/18] configure: remove --source-path option This option does not work, and the implied functionality is at best pointless. Signed-off-by: Mans Rullgard --- configure | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure b/configure index fe5b700db5..d680337dce 100755 --- a/configure +++ b/configure @@ -191,7 +191,6 @@ External library support: --enable-zlib enable zlib [autodetect] Advanced options (experts only): - --source-path=PATH path to source code [$source_path] --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix] --enable-cross-compile assume a cross-compiler is used --sysroot=PATH root of cross-build tree @@ -1184,7 +1183,6 @@ CMDLINE_SET=" nm pkg_config samples - source_path sysinclude sysroot target_exec From 8477f2deefbebe7dab9dce4c9ed5f3bc8030206d Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Mon, 6 Jun 2011 12:56:26 +0100 Subject: [PATCH 07/18] configure: simplify source_path setup Signed-off-by: Mans Rullgard --- configure | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index d680337dce..34c1ed6d25 100755 --- a/configure +++ b/configure @@ -1684,13 +1684,12 @@ DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F) DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM' # find source path -source_path="$(dirname "$0")" -enable source_path_used if test -f configure; then source_path="$(pwd)" disable source_path_used else - source_path="$(cd "$source_path"; pwd)" + source_path=$(cd $(dirname "$0"); pwd) + enable source_path_used echo "$source_path" | grep -q '[[:blank:]]' && die "Out of tree builds are impossible with whitespace in source path." test -e "$source_path/config.h" && From ceff045dbecb63bbe42da6d7d33f614ae67fbebd Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 6 Jun 2011 09:27:54 -0400 Subject: [PATCH 08/18] utils.c: fix crash with threading enabled. --- libavcodec/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 2b417defbf..1e5886473d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -783,7 +783,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) avctx->codec->close(avctx); avcodec_default_free_buffers(avctx); avctx->coded_frame = NULL; - if (avctx->codec->priv_class) + if (avctx->codec && avctx->codec->priv_class) av_opt_free(avctx->priv_data); av_opt_free(avctx); av_freep(&avctx->priv_data); From 5eaba041a07a667eabd9a0784ead94e8d83c51fc Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 5 Jun 2011 22:16:16 +0100 Subject: [PATCH 09/18] build: do not add CFLAGS-yes to CFLAGS CFLAGS-yes is never set so this serves no purpose. Signed-off-by: Mans Rullgard --- common.mak | 1 - 1 file changed, 1 deletion(-) diff --git a/common.mak b/common.mak index 20876c0951..5511a3016d 100644 --- a/common.mak +++ b/common.mak @@ -73,7 +73,6 @@ endif OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes) -CFLAGS += $(CFLAGS-yes) OBJS += $(OBJS-yes) FFLIBS := $(FFLIBS-yes) $(FFLIBS) TESTPROGS += $(TESTPROGS-yes) From 171ae1eb0da284dec03c996ac68920823a71644d Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Mon, 6 Jun 2011 13:21:05 +0100 Subject: [PATCH 10/18] build: remove stale dependency This dependency is implicitly covered elsewhere. Signed-off-by: Mans Rullgard --- common.mak | 2 -- 1 file changed, 2 deletions(-) diff --git a/common.mak b/common.mak index 5511a3016d..5195c9911d 100644 --- a/common.mak +++ b/common.mak @@ -45,8 +45,6 @@ HOSTCFLAGS += $(IFLAGS) %.ho: %.h $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $< -%$(EXESUF): %.c - %.ver: %.v $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@ From 0e28e9ca8f0025c34c3c6df8bf699a9a2db43abe Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Mon, 6 Jun 2011 09:13:05 -0500 Subject: [PATCH 11/18] flvenc: propagate error properly avio_flush can fail, in particular when used with the rtmp/librtmp protocol. --- libavformat/flvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index b8ae113905..b20a3f80c5 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -434,7 +434,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) av_free(data); - return 0; + return pb->error; } AVOutputFormat ff_flv_muxer = { From d7a72d250b0deeaed68798f23476be30b28af064 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 5 Jun 2011 21:52:32 +0100 Subject: [PATCH 12/18] build: move all (un)install* target aliases to toplevel Makefile Signed-off-by: Mans Rullgard --- Makefile | 6 ++++-- common.mak | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f626332482..0fb217a3ab 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,9 @@ doc/%.1: TAG = MAN doc/%.1: doc/%.pod $(M)pod2man --section=1 --center=" " --release=" " $< > $@ -install: $(INSTALL_TARGETS-yes) +install: install-libs install-headers $(INSTALL_TARGETS-yes) + +install-libs: install-libs-yes install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes) $(Q)mkdir -p "$(BINDIR)" @@ -142,7 +144,7 @@ install-man: $(MANPAGES) $(Q)mkdir -p "$(MANDIR)/man1" $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1" -uninstall: uninstall-progs uninstall-data uninstall-man +uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data uninstall-man uninstall-progs: $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS)) diff --git a/common.mak b/common.mak index 5195c9911d..d50d8234e9 100644 --- a/common.mak +++ b/common.mak @@ -54,11 +54,6 @@ HOSTCFLAGS += $(IFLAGS) %.h: @: -install: install-libs install-headers -install-libs: install-libs-yes - -uninstall: uninstall-libs uninstall-headers - .PHONY: all depend dep *clean install* uninstall* examples testprogs # Disable suffix rules. Most of the builtin rules are suffix rules, From 0018b7f04378a0ff83c6c6d097fc6bdc97212970 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 5 Jun 2011 21:57:03 +0100 Subject: [PATCH 13/18] build: clean up .PHONY lists This removes nonexisting targets from phony lists and puts them all in one place. Signed-off-by: Mans Rullgard --- Makefile | 3 ++- common.mak | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0fb217a3ab..708f5e5134 100644 --- a/Makefile +++ b/Makefile @@ -289,4 +289,5 @@ $(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF)) fate-list: @printf '%s\n' $(sort $(FATE)) -.PHONY: documentation *test regtest-* alltools check config +.PHONY: all alltools *clean check config documentation examples install* +.PHONY: *test testprogs uninstall* diff --git a/common.mak b/common.mak index d50d8234e9..3fbf1a7629 100644 --- a/common.mak +++ b/common.mak @@ -54,8 +54,6 @@ HOSTCFLAGS += $(IFLAGS) %.h: @: -.PHONY: all depend dep *clean install* uninstall* examples testprogs - # Disable suffix rules. Most of the builtin rules are suffix rules, # so this saves some time on slow systems. .SUFFIXES: From 21c65125424ef3dd7e276dea14f8e8ef3292e388 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 5 Jun 2011 13:44:28 +0100 Subject: [PATCH 14/18] ARM: remove MUL64 and MAC64 inline asm Current GCC versions know how to generate these instructions properly and avoiding inline asm gives better code. The MULH function for ARMv5 uses the same instruction and is also not needed any more. The MLS64 macro remains since negating an input would normally not be allowed as it would fail for INT_MIN. In our uses, the inputs never have this value and thus negating is safe. Signed-off-by: Mans Rullgard --- libavcodec/arm/mathops.h | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/libavcodec/arm/mathops.h b/libavcodec/arm/mathops.h index 3870fce3e2..b27b18f871 100644 --- a/libavcodec/arm/mathops.h +++ b/libavcodec/arm/mathops.h @@ -28,45 +28,16 @@ #if HAVE_INLINE_ASM -#define MULH MULH -#define MUL64 MUL64 - #if HAVE_ARMV6 +#define MULH MULH static inline av_const int MULH(int a, int b) { int r; __asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b)); return r; } - -static inline av_const int64_t MUL64(int a, int b) -{ - int64_t x; - __asm__ ("smull %Q0, %R0, %1, %2" : "=r"(x) : "r"(a), "r"(b)); - return x; -} -#else -static inline av_const int MULH(int a, int b) -{ - int lo, hi; - __asm__ ("smull %0, %1, %2, %3" : "=&r"(lo), "=&r"(hi) : "r"(b), "r"(a)); - return hi; -} - -static inline av_const int64_t MUL64(int a, int b) -{ - int64_t x; - __asm__ ("smull %Q0, %R0, %1, %2" : "=&r"(x) : "r"(a), "r"(b)); - return x; -} #endif -static inline av_const int64_t MAC64(int64_t d, int a, int b) -{ - __asm__ ("smlal %Q0, %R0, %1, %2" : "+r"(d) : "r"(a), "r"(b)); - return d; -} -#define MAC64(d, a, b) ((d) = MAC64(d, a, b)) #define MLS64(d, a, b) MAC64(d, -(a), b) #if HAVE_ARMV5TE From 4f8da7e7dc9244342da6c97ca489a8e6f712f3b4 Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Sat, 4 Jun 2011 14:36:30 +0200 Subject: [PATCH 15/18] s302m: fix resampling for 16 and 24bits. --- libavcodec/s302m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 9d623efa8f..2e261b612e 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -97,7 +97,7 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data, *o++ = (av_reverse[buf[6] & 0xf0] << 28) | (av_reverse[buf[5]] << 20) | (av_reverse[buf[4]] << 12) | - (av_reverse[buf[3] & 0x0f] << 8); + (av_reverse[buf[3] & 0x0f] << 4); buf += 7; } *data_size = (uint8_t*) o - (uint8_t*) data; @@ -120,7 +120,7 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data, av_reverse[buf[0]]; *o++ = (av_reverse[buf[4] & 0xf0] << 12) | (av_reverse[buf[3]] << 4) | - av_reverse[buf[2] & 0x0f]; + (av_reverse[buf[2]] >> 4); buf += 5; } *data_size = (uint8_t*) o - (uint8_t*) data; From d93d7349ceb963150100d3c1b8649d234e396616 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Mon, 6 Jun 2011 19:57:10 +0100 Subject: [PATCH 16/18] build: rearrange some lines in a more logical way Signed-off-by: Mans Rullgard --- Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 708f5e5134..f745a939bc 100644 --- a/Makefile +++ b/Makefile @@ -74,12 +74,15 @@ endef $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) +ffplay.o: CFLAGS += $(SDL_CFLAGS) ffplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS) ffserver$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS) %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS) +alltools: $(TOOLS) + tools/%$(EXESUF): tools/%.o $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS) @@ -89,8 +92,6 @@ tools/%.o: tools/%.c -include $(wildcard tools/*.d) -include $(wildcard tests/*.d) -ffplay.o: CFLAGS += $(SDL_CFLAGS) - VERSION_SH = $(SRC_PATH_BARE)/version.sh GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD @@ -104,8 +105,6 @@ version.h .version: # force version.sh to run whenever version might have changed -include .version -alltools: $(TOOLS) - DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES) documentation: $(DOCS) From 6d170962bd611d6336362d5da067d5a757d627f7 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Mon, 6 Jun 2011 23:00:26 +0100 Subject: [PATCH 17/18] build: make rule for linking ff* apply only to these targets This ensures that the special link command using cmdutils.o only applies to the targets it should. Signed-off-by: Mans Rullgard --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f745a939bc..db1a9bd150 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ ffplay.o: CFLAGS += $(SDL_CFLAGS) ffplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS) ffserver$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS) -%$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) +$(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS) alltools: $(TOOLS) From b9c6c7cb25932b594fd684a0cb553e439d49fe12 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Mon, 6 Jun 2011 21:46:18 +0100 Subject: [PATCH 18/18] build: remove empty $(OBJS) target This target was added to prevent some files being deleted by make when using chains of implicit rules. This is no longer required. Signed-off-by: Mans Rullgard --- common.mak | 2 -- 1 file changed, 2 deletions(-) diff --git a/common.mak b/common.mak index 3fbf1a7629..b5ccadbe6e 100644 --- a/common.mak +++ b/common.mak @@ -58,8 +58,6 @@ HOSTCFLAGS += $(IFLAGS) # so this saves some time on slow systems. .SUFFIXES: -# Do not delete intermediate files from chains of implicit rules -$(OBJS): endif OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)