From ddb009425cdf724a67d5c0932f5287414f464ef8 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 21 Nov 2012 19:28:02 +0100 Subject: [PATCH 1/6] riff: Make ff_riff_tags static and move under appropriate #ifdef The table is not used outside the file. --- libavformat/riff.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavformat/riff.c b/libavformat/riff.c index f44feff9a5..11e2a6438f 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -367,13 +367,6 @@ const AVMetadataConv ff_riff_info_conv[] = { { 0 }, }; -const char ff_riff_tags[][5] = { - "IARL", "IART", "ICMS", "ICMT", "ICOP", "ICRD", "ICRP", "IDIM", "IDPI", - "IENG", "IGNR", "IKEY", "ILGT", "ILNG", "IMED", "INAM", "IPLT", "IPRD", - "IPRT", "ISBJ", "ISFT", "ISHP", "ISRC", "ISRF", "ITCH", - {0} -}; - #if CONFIG_MUXERS int64_t ff_start_tag(AVIOContext *pb, const char *tag) { @@ -575,12 +568,19 @@ void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str) } } +static const char riff_tags[][5] = { + "IARL", "IART", "ICMS", "ICMT", "ICOP", "ICRD", "ICRP", "IDIM", "IDPI", + "IENG", "IGNR", "IKEY", "ILGT", "ILNG", "IMED", "INAM", "IPLT", "IPRD", + "IPRT", "ISBJ", "ISFT", "ISHP", "ISRC", "ISRF", "ITCH", + {0} +}; + static int riff_has_valid_tags(AVFormatContext *s) { int i; - for (i = 0; *ff_riff_tags[i]; i++) { - if (av_dict_get(s->metadata, ff_riff_tags[i], NULL, AV_DICT_MATCH_CASE)) + for (i = 0; *riff_tags[i]; i++) { + if (av_dict_get(s->metadata, riff_tags[i], NULL, AV_DICT_MATCH_CASE)) return 1; } @@ -602,8 +602,8 @@ void ff_riff_write_info(AVFormatContext *s) list_pos = ff_start_tag(pb, "LIST"); ffio_wfourcc(pb, "INFO"); - for (i = 0; *ff_riff_tags[i]; i++) { - if ((t = av_dict_get(s->metadata, ff_riff_tags[i], NULL, AV_DICT_MATCH_CASE))) + for (i = 0; *riff_tags[i]; i++) { + if ((t = av_dict_get(s->metadata, riff_tags[i], NULL, AV_DICT_MATCH_CASE))) ff_riff_write_info_tag(s->pb, t->key, t->value); } ff_end_tag(pb, list_pos); From f2ce813e37600d9715e9afaf30a0965ebb210e9f Mon Sep 17 00:00:00 2001 From: Sean McGovern Date: Sun, 25 Nov 2012 01:32:57 -0500 Subject: [PATCH 2/6] configure: suncc: Add compiler arch support for Nehalem & Sandy Bridge GCC does not appear to have a -march= string for Westmere, which is a bit surprising as it has a few more instructions than a Nehalem, but a few less than a Sandy Bridge. Signed-off-by: Diego Biurrun --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 6d9ed503cb..eb6986a83c 100755 --- a/configure +++ b/configure @@ -2182,6 +2182,8 @@ suncc_flags(){ prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;; *-sse3) echo -xarch=sse3 ;; core2) echo -xarch=ssse3 -xchip=core2 ;; + corei7) echo -xarch=sse4_2 -xchip=nehalem ;; + corei7-avx) echo -xarch=avx -xchip=sandybridge ;; amdfam10|barcelona|bdver*) echo -xarch=sse4_1 ;; athlon-4|athlon-[mx]p) echo -xarch=ssea ;; k8|opteron|athlon64|athlon-fx) @@ -2655,7 +2657,7 @@ elif enabled x86; then disable cmov ;; # targets that do support conditional mov (cmov) - i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom|bdver*) + i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|corei7*|amdfam10|barcelona|atom|bdver*) cpuflags="-march=$cpu" enable cmov enable fast_cmov From 2bf794b69820273e2284d69e9b9c98f5b7136add Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Mon, 19 Nov 2012 21:39:20 +0100 Subject: [PATCH 3/6] doc: avtools-common-opts: Fix terminology concerning metric prefixes 'k', 'M', and 'G' are SI (unit) prefixes or metric prefixes, not 'number postfixes'. Also, the statement regarding binary prefixes ("powers of 2 are used instead of powers of 10") might be misinterpreted (1 kB = 10^3 B, but 1 KiB != 2^3 B). Signed-off-by: Diego Biurrun --- doc/avtools-common-opts.texi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/avtools-common-opts.texi b/doc/avtools-common-opts.texi index d07505d2e4..afd2cc3876 100644 --- a/doc/avtools-common-opts.texi +++ b/doc/avtools-common-opts.texi @@ -1,10 +1,11 @@ All the numerical options, if not specified otherwise, accept in input a string representing a number, which may contain one of the -International System number postfixes, for example 'K', 'M', 'G'. -If 'i' is appended after the postfix, powers of 2 are used instead of -powers of 10. The 'B' postfix multiplies the value for 8, and can be -appended after another postfix or used alone. This allows using for -example 'KB', 'MiB', 'G' and 'B' as postfix. +SI unit prefixes, for example 'K', 'M', 'G'. +If 'i' is appended after the prefix, binary prefixes are used, +which are based on powers of 1024 instead of powers of 1000. +The 'B' postfix multiplies the value by 8, and can be +appended after a unit prefix or used alone. This allows using for +example 'KB', 'MiB', 'G' and 'B' as number postfix. Options which do not take arguments are boolean options, and set the corresponding value to true. They can be set to false by prefixing From 4632abc7a3a64b23c243b21cae7a08e5af92231e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 24 Nov 2012 07:55:42 +0100 Subject: [PATCH 4/6] avconv: fix copying per-stream metadata. It is handled separately from other types because it uses stream specifiers and currently that triggers an assert in SET_DICT. CC:libav-stable@libav.org --- avconv_opt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/avconv_opt.c b/avconv_opt.c index 03544545c9..0ea2f45d7e 100644 --- a/avconv_opt.c +++ b/avconv_opt.c @@ -351,6 +351,8 @@ static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFor METADATA_CHECK_INDEX(index, context->nb_programs, "program")\ meta = &context->programs[index]->metadata;\ break;\ + case 's':\ + break; /* handled separately below */ \ default: av_assert0(0);\ }\ From b491da18d1df50428411b40d76db496068861496 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 21 Nov 2012 20:15:02 +0000 Subject: [PATCH 5/6] yop: fix typo Signed-off-by: Paul B Mahol Signed-off-by: Justin Ruggles --- libavformat/yop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/yop.c b/libavformat/yop.c index 351938b7e9..5fe6bdc7d4 100644 --- a/libavformat/yop.c +++ b/libavformat/yop.c @@ -75,7 +75,7 @@ static int yop_read_header(AVFormatContext *s) audio_dec->codec_type = AVMEDIA_TYPE_AUDIO; audio_dec->codec_id = AV_CODEC_ID_ADPCM_IMA_APC; audio_dec->channels = 1; - audio_dec->channels = AV_CH_LAYOUT_MONO; + audio_dec->channel_layout = AV_CH_LAYOUT_MONO; audio_dec->sample_rate = 22050; // Video From 28c8e288fa0342fdef532a7522a4707bebf831cc Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 27 Jul 2012 14:25:46 +0200 Subject: [PATCH 6/6] x86: h264_chromamc: port to cpuflags --- libavcodec/x86/h264_chromamc.asm | 83 +++++++++++++++++--------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm index 2dd4603917..1be37dec78 100644 --- a/libavcodec/x86/h264_chromamc.asm +++ b/libavcodec/x86/h264_chromamc.asm @@ -89,7 +89,7 @@ SECTION .text jne .next4rows %endmacro -%macro chroma_mc8_mmx_func 3 +%macro chroma_mc8_mmx_func 2-3 %ifidn %2, rv40 %ifdef PIC %define rnd_1d_rv40 r8 @@ -103,9 +103,9 @@ SECTION .text %else %define extra_regs 0 %endif ; rv40 -; put/avg_h264_chroma_mc8_mmx_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/, -; int stride, int h, int mx, int my) -cglobal %1_%2_chroma_mc8_%3, 6, 7 + extra_regs, 0 +; put/avg_h264_chroma_mc8_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/, +; int stride, int h, int mx, int my) +cglobal %1_%2_chroma_mc8%3, 6, 7 + extra_regs, 0 %if ARCH_X86_64 movsxd r2, r2d %endif @@ -282,14 +282,14 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7 + extra_regs, 0 RET %endmacro -%macro chroma_mc4_mmx_func 3 +%macro chroma_mc4_mmx_func 2 %define extra_regs 0 %ifidn %2, rv40 %ifdef PIC %define extra_regs 1 %endif ; PIC %endif ; rv40 -cglobal %1_%2_chroma_mc4_%3, 6, 6 + extra_regs, 0 +cglobal %1_%2_chroma_mc4, 6, 6 + extra_regs, 0 %if ARCH_X86_64 movsxd r2, r2d %endif @@ -373,8 +373,8 @@ cglobal %1_%2_chroma_mc4_%3, 6, 6 + extra_regs, 0 REP_RET %endmacro -%macro chroma_mc2_mmx_func 3 -cglobal %1_%2_chroma_mc2_%3, 6, 7, 0 +%macro chroma_mc2_mmx_func 2 +cglobal %1_%2_chroma_mc2, 6, 7, 0 %if ARCH_X86_64 movsxd r2, r2d %endif @@ -434,35 +434,38 @@ cglobal %1_%2_chroma_mc2_%3, 6, 7, 0 PAVG %1, %2 %endmacro -INIT_MMX +INIT_MMX mmx %define CHROMAMC_AVG NOTHING %define CHROMAMC_AVG4 NOTHING -chroma_mc8_mmx_func put, h264, rnd_mmx -chroma_mc8_mmx_func put, vc1, nornd_mmx -chroma_mc8_mmx_func put, rv40, mmx -chroma_mc4_mmx_func put, h264, mmx -chroma_mc4_mmx_func put, rv40, mmx -chroma_mc2_mmx_func put, h264, mmxext +chroma_mc8_mmx_func put, h264, _rnd +chroma_mc8_mmx_func put, vc1, _nornd +chroma_mc8_mmx_func put, rv40 +chroma_mc4_mmx_func put, h264 +chroma_mc4_mmx_func put, rv40 + +INIT_MMX mmxext +chroma_mc2_mmx_func put, h264 %define CHROMAMC_AVG DIRECT_AVG %define CHROMAMC_AVG4 COPY_AVG %define PAVG pavgb -chroma_mc8_mmx_func avg, h264, rnd_mmxext -chroma_mc8_mmx_func avg, vc1, nornd_mmxext -chroma_mc8_mmx_func avg, rv40, mmxext -chroma_mc4_mmx_func avg, h264, mmxext -chroma_mc4_mmx_func avg, rv40, mmxext -chroma_mc2_mmx_func avg, h264, mmxext +chroma_mc8_mmx_func avg, h264, _rnd +chroma_mc8_mmx_func avg, vc1, _nornd +chroma_mc8_mmx_func avg, rv40 +chroma_mc4_mmx_func avg, h264 +chroma_mc4_mmx_func avg, rv40 +chroma_mc2_mmx_func avg, h264 %define PAVG pavgusb -chroma_mc8_mmx_func avg, h264, rnd_3dnow -chroma_mc8_mmx_func avg, vc1, nornd_3dnow -chroma_mc8_mmx_func avg, rv40, 3dnow -chroma_mc4_mmx_func avg, h264, 3dnow -chroma_mc4_mmx_func avg, rv40, 3dnow +INIT_MMX 3dnow +chroma_mc8_mmx_func avg, h264, _rnd +chroma_mc8_mmx_func avg, vc1, _nornd +chroma_mc8_mmx_func avg, rv40 +chroma_mc4_mmx_func avg, h264 +chroma_mc4_mmx_func avg, rv40 -%macro chroma_mc8_ssse3_func 3 -cglobal %1_%2_chroma_mc8_%3, 6, 7, 8 +%macro chroma_mc8_ssse3_func 2-3 +cglobal %1_%2_chroma_mc8%3, 6, 7, 8 %if ARCH_X86_64 movsxd r2, r2d %endif @@ -609,8 +612,8 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7, 8 REP_RET %endmacro -%macro chroma_mc4_ssse3_func 3 -cglobal %1_%2_chroma_mc4_%3, 6, 7, 0 +%macro chroma_mc4_ssse3_func 2 +cglobal %1_%2_chroma_mc4, 6, 7, 0 %if ARCH_X86_64 movsxd r2, r2d %endif @@ -663,16 +666,16 @@ cglobal %1_%2_chroma_mc4_%3, 6, 7, 0 %endmacro %define CHROMAMC_AVG NOTHING -INIT_XMM -chroma_mc8_ssse3_func put, h264, rnd_ssse3 -chroma_mc8_ssse3_func put, vc1, nornd_ssse3 -INIT_MMX -chroma_mc4_ssse3_func put, h264, ssse3 +INIT_XMM ssse3 +chroma_mc8_ssse3_func put, h264, _rnd +chroma_mc8_ssse3_func put, vc1, _nornd +INIT_MMX ssse3 +chroma_mc4_ssse3_func put, h264 %define CHROMAMC_AVG DIRECT_AVG %define PAVG pavgb -INIT_XMM -chroma_mc8_ssse3_func avg, h264, rnd_ssse3 -chroma_mc8_ssse3_func avg, vc1, nornd_ssse3 -INIT_MMX -chroma_mc4_ssse3_func avg, h264, ssse3 +INIT_XMM ssse3 +chroma_mc8_ssse3_func avg, h264, _rnd +chroma_mc8_ssse3_func avg, vc1, _nornd +INIT_MMX ssse3 +chroma_mc4_ssse3_func avg, h264