From c5c76370ae240b5e451c4a00a7ab485c0c0e0e98 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Wed, 14 Jun 2017 01:40:40 +0200 Subject: [PATCH 1/7] doc: Drop the legacy symlink to README Windows does not like symlinks and README.md is pretty common nowadays. --- README | 1 - 1 file changed, 1 deletion(-) delete mode 120000 README diff --git a/README b/README deleted file mode 120000 index 42061c01a1..0000000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -README.md \ No newline at end of file From a970f9de865c84ed5360dd0398baee7d48d04620 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Sun, 18 Jun 2017 12:30:16 +0200 Subject: [PATCH 2/7] aarch64: vp9: Fix assembling with Xcode 6.2 and older MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Properly use the b.eq/b.ge forms instead of the nonstandard forms (which both gas and newer clang accept though), and expand the register list that used a range (which the Xcode 6.2 clang, based on clang 3.5 svn, didn't support). Signed-off-by: Martin Storsjö --- libavcodec/aarch64/vp9itxfm_neon.S | 2 +- libavcodec/aarch64/vp9mc_neon.S | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index 97226d1180..3ffb418963 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -1531,7 +1531,7 @@ function ff_vp9_idct_idct_32x32_add_neon, export=1 2: subs x1, x1, #1 .rept 4 - st1 {v16.8h-v19.8h}, [x0], #64 + st1 {v16.8h,v17.8h,v18.8h,v19.8h}, [x0], #64 .endr b.ne 2b 3: diff --git a/libavcodec/aarch64/vp9mc_neon.S b/libavcodec/aarch64/vp9mc_neon.S index 95ed26c232..584c114269 100644 --- a/libavcodec/aarch64/vp9mc_neon.S +++ b/libavcodec/aarch64/vp9mc_neon.S @@ -342,7 +342,7 @@ function \type\()_8tap_\size\()h_\idx1\idx2 subs x9, x9, #16 st1 {v1.16b}, [x0], #16 st1 {v24.16b}, [x6], #16 - beq 3f + b.eq 3f mov v4.16b, v6.16b mov v16.16b, v18.16b ld1 {v6.16b}, [x2], #16 @@ -389,10 +389,10 @@ function ff_vp9_\type\()_\filter\()\size\()_h_neon, export=1 add x9, x6, w5, uxtw #3 mov x5, #\size .if \size >= 16 - bge \type\()_8tap_16h_34 + b.ge \type\()_8tap_16h_34 b \type\()_8tap_16h_43 .else - bge \type\()_8tap_\size\()h_34 + b.ge \type\()_8tap_\size\()h_34 b \type\()_8tap_\size\()h_43 .endif endfunc From 713efb2c0d013a42be4051adb7cd90a7c2cbbb4f Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Thu, 15 Jun 2017 11:20:48 -0700 Subject: [PATCH 3/7] movenc: use correct tag list for AVOutputFormat.codec_tag ff_mp4_obj_type contains the wrong type of tags for AVOutputFormat.codec_tag. AVOutputFormat.codec_tag is used to validate AVCodecParameters.codec_tag so needs to be the same type of tag. Creates new tag lists for mp4 and ismv. New tag lists support same list of codecs found in ff_mp4_obj_type. psp uses the same tag list as mp4 since these both use mp4_get_codec_tag to look up tags. --- libavformat/movenc.c | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index e3890296c6..a5c5e8ad94 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4444,6 +4444,36 @@ error: return res; } +const AVCodecTag codec_mp4_tags[] = { + { AV_CODEC_ID_MPEG4 , MKTAG('m', 'p', '4', 'v') }, + { AV_CODEC_ID_H264 , MKTAG('a', 'v', 'c', '1') }, + { AV_CODEC_ID_HEVC , MKTAG('h', 'e', 'v', '1') }, + { AV_CODEC_ID_MPEG2VIDEO , MKTAG('m', 'p', '4', 'v') }, + { AV_CODEC_ID_MPEG1VIDEO , MKTAG('m', 'p', '4', 'v') }, + { AV_CODEC_ID_MJPEG , MKTAG('m', 'p', '4', 'v') }, + { AV_CODEC_ID_PNG , MKTAG('m', 'p', '4', 'v') }, + { AV_CODEC_ID_JPEG2000 , MKTAG('m', 'p', '4', 'v') }, + { AV_CODEC_ID_VC1 , MKTAG('v', 'c', '-', '1') }, + { AV_CODEC_ID_DIRAC , MKTAG('d', 'r', 'a', 'c') }, + { AV_CODEC_ID_TSCC2 , MKTAG('m', 'p', '4', 'v') }, + { AV_CODEC_ID_AAC , MKTAG('m', 'p', '4', 'a') }, + { AV_CODEC_ID_MP4ALS , MKTAG('m', 'p', '4', 'a') }, + { AV_CODEC_ID_MP3 , MKTAG('m', 'p', '4', 'a') }, + { AV_CODEC_ID_MP2 , MKTAG('m', 'p', '4', 'a') }, + { AV_CODEC_ID_AC3 , MKTAG('a', 'c', '-', '3') }, + { AV_CODEC_ID_DTS , MKTAG('m', 'p', '4', 'a') }, + { AV_CODEC_ID_VORBIS , MKTAG('m', 'p', '4', 'a') }, + { AV_CODEC_ID_QCELP , MKTAG('m', 'p', '4', 'a') }, + { AV_CODEC_ID_DVD_SUBTITLE, MKTAG('m', 'p', '4', 's') }, + { AV_CODEC_ID_MOV_TEXT , MKTAG('t', 'x', '3', 'g') }, + { AV_CODEC_ID_NONE , 0 }, +}; + +const AVCodecTag codec_ism_tags[] = { + { AV_CODEC_ID_WMAPRO , MKTAG('w', 'm', 'a', ' ') }, + { AV_CODEC_ID_NONE , 0 }, +}; + #if CONFIG_MOV_MUXER MOV_CLASS(mov) AVOutputFormat ff_mov_muxer = { @@ -4496,7 +4526,7 @@ AVOutputFormat ff_mp4_muxer = { .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 }, + .codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, 0 }, .priv_class = &mp4_muxer_class, }; #endif @@ -4514,7 +4544,7 @@ AVOutputFormat ff_psp_muxer = { .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 }, + .codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, 0 }, .priv_class = &psp_muxer_class, }; #endif @@ -4567,7 +4597,8 @@ AVOutputFormat ff_ismv_muxer = { .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 }, + .codec_tag = (const AVCodecTag* const []){ + codec_mp4_tags, codec_ism_tags, 0 }, .priv_class = &ismv_muxer_class, }; #endif From f6f86f432fe51526a7aad2bdb025d6a45d239883 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Mon, 19 Jun 2017 07:46:48 -0700 Subject: [PATCH 4/7] movenc: simplify codec_tag lookup mux.c init_muxer() already sets codec_tag correctly in the cases simplified here. This also adds the capability to support alternative tags for the same codec_id. --- libavformat/movenc.c | 60 ++++++++++---------------------------------- 1 file changed, 13 insertions(+), 47 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index a5c5e8ad94..13e6b4ff4b 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -32,6 +32,7 @@ #include "isom.h" #include "avc.h" +#include "libavcodec/internal.h" #include "libavcodec/bitstream.h" #include "libavcodec/put_bits.h" #include "libavcodec/vc1_common.h" @@ -778,26 +779,6 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track) return 0; } -static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track) -{ - int tag = track->par->codec_tag; - - if (!ff_codec_get_tag(ff_mp4_obj_type, track->par->codec_id)) - return 0; - - if (track->par->codec_id == AV_CODEC_ID_H264) tag = MKTAG('a','v','c','1'); - else if (track->par->codec_id == AV_CODEC_ID_HEVC) tag = MKTAG('h','e','v','1'); - else if (track->par->codec_id == AV_CODEC_ID_AC3) tag = MKTAG('a','c','-','3'); - else if (track->par->codec_id == AV_CODEC_ID_DIRAC) tag = MKTAG('d','r','a','c'); - else if (track->par->codec_id == AV_CODEC_ID_MOV_TEXT) tag = MKTAG('t','x','3','g'); - else if (track->par->codec_id == AV_CODEC_ID_VC1) tag = MKTAG('v','c','-','1'); - else if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) tag = MKTAG('m','p','4','v'); - else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) tag = MKTAG('m','p','4','a'); - else if (track->par->codec_id == AV_CODEC_ID_DVD_SUBTITLE) tag = MKTAG('m','p','4','s'); - - return tag; -} - static const AVCodecTag codec_ipod_tags[] = { { AV_CODEC_ID_H264, MKTAG('a','v','c','1') }, { AV_CODEC_ID_MPEG4, MKTAG('m','p','4','v') }, @@ -809,23 +790,6 @@ static const AVCodecTag codec_ipod_tags[] = { { AV_CODEC_ID_NONE, 0 }, }; -static int ipod_get_codec_tag(AVFormatContext *s, MOVTrack *track) -{ - int tag = track->par->codec_tag; - - // keep original tag for subs, ipod supports both formats - if (!(track->par->codec_type == AVMEDIA_TYPE_SUBTITLE && - (tag == MKTAG('t', 'x', '3', 'g') || - tag == MKTAG('t', 'e', 'x', 't')))) - tag = ff_codec_get_tag(codec_ipod_tags, track->par->codec_id); - - if (!av_match_ext(s->filename, "m4a") && !av_match_ext(s->filename, "m4v")) - av_log(s, AV_LOG_WARNING, "Warning, extension is not .m4a nor .m4v " - "Quicktime/Ipod might not play the file\n"); - - return tag; -} - static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track) { int tag; @@ -951,17 +915,19 @@ static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track) int tag; if (track->mode == MODE_MP4 || track->mode == MODE_PSP) - tag = mp4_get_codec_tag(s, track); - else if (track->mode == MODE_ISM) { - tag = mp4_get_codec_tag(s, track); - if (!tag && track->par->codec_id == AV_CODEC_ID_WMAPRO) - tag = MKTAG('w', 'm', 'a', ' '); - } else if (track->mode == MODE_IPOD) - tag = ipod_get_codec_tag(s, track); - else if (track->mode & MODE_3GP) - tag = ff_codec_get_tag(codec_3gp_tags, track->par->codec_id); + tag = track->par->codec_tag; + else if (track->mode == MODE_ISM) + tag = track->par->codec_tag; + else if (track->mode == MODE_IPOD) { + if (!av_match_ext(s->filename, "m4a") && + !av_match_ext(s->filename, "m4v")) + av_log(s, AV_LOG_WARNING, "Warning, extension is not .m4a nor .m4v " + "Quicktime/Ipod might not play the file\n"); + tag = track->par->codec_tag; + } else if (track->mode & MODE_3GP) + tag = track->par->codec_tag; else if (track->mode == MODE_F4V) - tag = ff_codec_get_tag(codec_f4v_tags, track->par->codec_id); + tag = track->par->codec_tag; else tag = mov_get_codec_tag(s, track); From 1c64bae648eeb39c8d8a8d81ee142b9eec9fae7b Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Mon, 19 Jun 2017 07:53:45 -0700 Subject: [PATCH 5/7] movenc: move tags definitions to where they are used --- libavformat/movenc.c | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 13e6b4ff4b..7791007b09 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -779,17 +779,6 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track) return 0; } -static const AVCodecTag codec_ipod_tags[] = { - { AV_CODEC_ID_H264, MKTAG('a','v','c','1') }, - { AV_CODEC_ID_MPEG4, MKTAG('m','p','4','v') }, - { AV_CODEC_ID_AAC, MKTAG('m','p','4','a') }, - { AV_CODEC_ID_ALAC, MKTAG('a','l','a','c') }, - { AV_CODEC_ID_AC3, MKTAG('a','c','-','3') }, - { AV_CODEC_ID_MOV_TEXT, MKTAG('t','x','3','g') }, - { AV_CODEC_ID_MOV_TEXT, MKTAG('t','e','x','t') }, - { AV_CODEC_ID_NONE, 0 }, -}; - static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track) { int tag; @@ -890,26 +879,6 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track) return tag; } -static const AVCodecTag codec_3gp_tags[] = { - { AV_CODEC_ID_H263, MKTAG('s','2','6','3') }, - { AV_CODEC_ID_H264, MKTAG('a','v','c','1') }, - { AV_CODEC_ID_MPEG4, MKTAG('m','p','4','v') }, - { AV_CODEC_ID_AAC, MKTAG('m','p','4','a') }, - { AV_CODEC_ID_AMR_NB, MKTAG('s','a','m','r') }, - { AV_CODEC_ID_AMR_WB, MKTAG('s','a','w','b') }, - { AV_CODEC_ID_MOV_TEXT, MKTAG('t','x','3','g') }, - { AV_CODEC_ID_NONE, 0 }, -}; - -static const AVCodecTag codec_f4v_tags[] = { - { AV_CODEC_ID_MP3, MKTAG('.','m','p','3') }, - { AV_CODEC_ID_AAC, MKTAG('m','p','4','a') }, - { AV_CODEC_ID_H264, MKTAG('a','v','c','1') }, - { AV_CODEC_ID_VP6A, MKTAG('V','P','6','A') }, - { AV_CODEC_ID_VP6F, MKTAG('V','P','6','F') }, - { AV_CODEC_ID_NONE, 0 }, -}; - static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track) { int tag; @@ -4410,6 +4379,17 @@ error: return res; } +static const AVCodecTag codec_3gp_tags[] = { + { AV_CODEC_ID_H263, MKTAG('s','2','6','3') }, + { AV_CODEC_ID_H264, MKTAG('a','v','c','1') }, + { AV_CODEC_ID_MPEG4, MKTAG('m','p','4','v') }, + { AV_CODEC_ID_AAC, MKTAG('m','p','4','a') }, + { AV_CODEC_ID_AMR_NB, MKTAG('s','a','m','r') }, + { AV_CODEC_ID_AMR_WB, MKTAG('s','a','w','b') }, + { AV_CODEC_ID_MOV_TEXT, MKTAG('t','x','3','g') }, + { AV_CODEC_ID_NONE, 0 }, +}; + const AVCodecTag codec_mp4_tags[] = { { AV_CODEC_ID_MPEG4 , MKTAG('m', 'p', '4', 'v') }, { AV_CODEC_ID_H264 , MKTAG('a', 'v', 'c', '1') }, @@ -4440,6 +4420,26 @@ const AVCodecTag codec_ism_tags[] = { { AV_CODEC_ID_NONE , 0 }, }; +static const AVCodecTag codec_ipod_tags[] = { + { AV_CODEC_ID_H264, MKTAG('a','v','c','1') }, + { AV_CODEC_ID_MPEG4, MKTAG('m','p','4','v') }, + { AV_CODEC_ID_AAC, MKTAG('m','p','4','a') }, + { AV_CODEC_ID_ALAC, MKTAG('a','l','a','c') }, + { AV_CODEC_ID_AC3, MKTAG('a','c','-','3') }, + { AV_CODEC_ID_MOV_TEXT, MKTAG('t','x','3','g') }, + { AV_CODEC_ID_MOV_TEXT, MKTAG('t','e','x','t') }, + { AV_CODEC_ID_NONE, 0 }, +}; + +static const AVCodecTag codec_f4v_tags[] = { + { AV_CODEC_ID_MP3, MKTAG('.','m','p','3') }, + { AV_CODEC_ID_AAC, MKTAG('m','p','4','a') }, + { AV_CODEC_ID_H264, MKTAG('a','v','c','1') }, + { AV_CODEC_ID_VP6A, MKTAG('V','P','6','A') }, + { AV_CODEC_ID_VP6F, MKTAG('V','P','6','F') }, + { AV_CODEC_ID_NONE, 0 }, +}; + #if CONFIG_MOV_MUXER MOV_CLASS(mov) AVOutputFormat ff_mov_muxer = { From 1ea9b7fdf99b60c0db95a2ce97b2108469bbb245 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Thu, 15 Jun 2017 11:41:15 -0700 Subject: [PATCH 6/7] movenc: write correct format hvcc when tag is hvc1 --- libavformat/movenc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7791007b09..f63750890a 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -727,7 +727,10 @@ static int mov_write_hvcc_tag(AVIOContext *pb, MOVTrack *track) avio_wb32(pb, 0); ffio_wfourcc(pb, "hvcC"); - ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0); + if (track->tag == MKTAG('h','v','c','1')) + ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 1); + else + ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0); return update_size(pb, pos); } From 84ab1cc437fa47a00532f305b9fe15b5b66c8c5e Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Thu, 15 Jun 2017 11:47:16 -0700 Subject: [PATCH 7/7] movenc: allow alternative hvc1 h.265 codec tag If AVCodecParameters.codec_tag is 'hvc1' use it instead of 'hev1' for h.265 streams. QuickTime (and other Apple software) requires 'hvc1'. --- libavformat/movenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f63750890a..a546fdfead 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4397,6 +4397,7 @@ const AVCodecTag codec_mp4_tags[] = { { AV_CODEC_ID_MPEG4 , MKTAG('m', 'p', '4', 'v') }, { AV_CODEC_ID_H264 , MKTAG('a', 'v', 'c', '1') }, { AV_CODEC_ID_HEVC , MKTAG('h', 'e', 'v', '1') }, + { AV_CODEC_ID_HEVC , MKTAG('h', 'v', 'c', '1') }, { AV_CODEC_ID_MPEG2VIDEO , MKTAG('m', 'p', '4', 'v') }, { AV_CODEC_ID_MPEG1VIDEO , MKTAG('m', 'p', '4', 'v') }, { AV_CODEC_ID_MJPEG , MKTAG('m', 'p', '4', 'v') },