Re: [FFmpeg-devel] [PATCH] jpeg2000: split off inverse MCT decoding as Jpeg2000DSP
On 01/10/14 11:16 PM, Michael Niedermayer wrote: On Wed, Oct 01, 2014 at 10:35:59PM -0300, James Almer wrote: This makes the addition of arch optimized functions easier. Signed-off-by: James Almer jamr...@gmail.com --- libavcodec/Makefile | 2 +- libavcodec/jpeg2000dec.c | 71 +-- libavcodec/jpeg2000dsp.c | 98 libavcodec/jpeg2000dsp.h | 35 + libavcodec/jpeg2000dwt.h | 3 +- 5 files changed, 153 insertions(+), 56 deletions(-) create mode 100644 libavcodec/jpeg2000dsp.c create mode 100644 libavcodec/jpeg2000dsp.h LGTM Pushed, thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]Stop demuxing wtv on eof
On 10/1/14, Peter Ross pr...@xvid.org wrote: On Wed, Oct 01, 2014 at 06:18:56PM +0200, Carl Eugen Hoyos wrote: Hi! Attached patch fixes the wtv regression described in tickets #3991 and #3995 for me. Please review, Carl Eugen diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 4cb3295..674ff6e 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -789,6 +789,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p len = avio_rl32(pb); if (len 32) { int ret; +if (avio_feof(pb)) +return AVERROR(EOF); error code should be AVERROR_EOF. av_log(s, AV_LOG_WARNING, encountered broken chunk\n); Please commit. I have tested it also. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]Stop demuxing wtv on eof
Paul B Mahol onemda at gmail.com writes: +if (avio_feof(pb)) +return AVERROR(EOF); error code should be AVERROR_EOF. Pushed with that change. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]Check for OOM in the dirac parser
Michael Niedermayer michaelni at gmx.at writes: Attached patch fixes two possible null pointer dereferences on oom as described in ticket #3996. should be ok Patch applied. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]Fix 32bit pcm audio in mov
Michael Niedermayer michaelni at gmx.at writes: Attached patch fixes decoding 32bit pcm audio in mov as written by the Convergent Design's Odyssey 7Q recorder. should be ok Patch applied. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mxfenc: add jpeg2000 support
On Tue, 2014-09-30 at 15:37 +0200, Benoit Fouet wrote: Hi, this patch adds support for j2k muxing in MXF. tested with: $ ffmpeg -t 5 -f lavfi -i testsrc -y -c:v libopenjpeg -y out.mxf Played back in ffplay (linux), vlc (windows), Acrok MXF converter (windows). I have no idea against what other players this should be tested. Do we have a sample + FATE case for this? /Tomas signature.asc Description: This is a digitally signed message part ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/movenc: add EAC3 muxing support.
Fixes ticket #3074 --- libavformat/isom.c | 1 + libavformat/movenc.c | 44 +++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libavformat/isom.c b/libavformat/isom.c index d768c32..1509021 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -57,6 +57,7 @@ const AVCodecTag ff_mp4_obj_type[] = { { AV_CODEC_ID_VC1 , 0xA3 }, { AV_CODEC_ID_DIRAC , 0xA4 }, { AV_CODEC_ID_AC3 , 0xA5 }, +{ AV_CODEC_ID_EAC3, 0xA6 }, { AV_CODEC_ID_DTS , 0xA9 }, /* mp4ra.org */ { AV_CODEC_ID_VORBIS , 0xDD }, /* non standard, gpac uses it */ { AV_CODEC_ID_DVD_SUBTITLE, 0xE0 }, /* non standard, see unsupported-embedded-subs-2.mp4 */ diff --git a/libavformat/movenc.c b/libavformat/movenc.c index bfee866..62b2d4b 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -31,6 +31,7 @@ #include avio.h #include isom.h #include avc.h +#include libavcodec/ac3_parser.h #include libavcodec/get_bits.h #include libavcodec/put_bits.h #include libavcodec/vc1_common.h @@ -292,6 +293,40 @@ static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track) return 11; } +static int mov_write_eac3_tag(AVIOContext *pb, MOVTrack *track) +{ +GetBitContext gbc; +PutBitContext pbc; +uint8_t buf[5]; +AC3HeaderInfo tmp, *hdr = tmp; + +if (!track-vos_len) +return -1; + +init_get_bits(gbc, track-vos_data, track-vos_len * 8); +if (avpriv_ac3_parse_header2(gbc, hdr) != 0) +return -1; + +avio_wb32(pb, 13); +ffio_wfourcc(pb, dec3); + +init_put_bits(pbc, buf, sizeof(buf)); +put_bits(pbc, 13, hdr-bit_rate); +put_bits(pbc, 3, 0); /* consider there is only one independent substream present */ +put_bits(pbc, 2, hdr-sr_code); +put_bits(pbc, 5, hdr-bitstream_id); +put_bits(pbc, 5, hdr-bitstream_mode); +put_bits(pbc, 3, hdr-channel_mode); +put_bits(pbc, 1, hdr-lfe_on); +put_bits(pbc, 5, 0); /* reserved */ +put_bits(pbc, 4, 0); /* no dependent substream */ +put_bits(pbc, 1, 0); /* reserved */ +flush_put_bits(pbc); +avio_write(pb, buf, sizeof(buf)); + +return 13; +} + /** * This function writes extradata as is. * Extradata must be formatted like a valid atom (with size and tag). @@ -486,6 +521,8 @@ static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track) mov_write_amr_tag(pb, track); } else if (track-enc-codec_id == AV_CODEC_ID_AC3) { mov_write_ac3_tag(pb, track); +} else if (track-enc-codec_id == AV_CODEC_ID_EAC3) { +mov_write_eac3_tag(pb, track); } else if (track-enc-codec_id == AV_CODEC_ID_ALAC || track-enc-codec_id == AV_CODEC_ID_QDM2) { mov_write_extradata_tag(pb, track); @@ -756,6 +793,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) if (track-mode == MODE_MOV (track-enc-codec_id == AV_CODEC_ID_AAC || track-enc-codec_id == AV_CODEC_ID_AC3 || + track-enc-codec_id == AV_CODEC_ID_EAC3 || track-enc-codec_id == AV_CODEC_ID_AMR_NB|| track-enc-codec_id == AV_CODEC_ID_ALAC || track-enc-codec_id == AV_CODEC_ID_ADPCM_MS || @@ -770,6 +808,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) mov_write_amr_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_AC3) mov_write_ac3_tag(pb, track); +else if (track-enc-codec_id == AV_CODEC_ID_EAC3) +mov_write_eac3_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_ALAC) mov_write_extradata_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_WMAPRO) @@ -877,6 +917,7 @@ static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track) if (track-enc-codec_id == AV_CODEC_ID_H264) tag = MKTAG('a','v','c','1'); else if (track-enc-codec_id == AV_CODEC_ID_HEVC) tag = MKTAG('h','e','v','1'); else if (track-enc-codec_id == AV_CODEC_ID_AC3) tag = MKTAG('a','c','-','3'); +else if (track-enc-codec_id == AV_CODEC_ID_EAC3) tag = MKTAG('e','c','-','3'); else if (track-enc-codec_id == AV_CODEC_ID_DIRAC) tag = MKTAG('d','r','a','c'); else if (track-enc-codec_id == AV_CODEC_ID_MOV_TEXT) tag = MKTAG('t','x','3','g'); else if (track-enc-codec_id == AV_CODEC_ID_VC1) tag = MKTAG('v','c','-','1'); @@ -3605,7 +3646,8 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) } if ((enc-codec_id == AV_CODEC_ID_DNXHD || - enc-codec_id == AV_CODEC_ID_AC3) !trk-vos_len) { + enc-codec_id == AV_CODEC_ID_AC3 || + enc-codec_id == AV_CODEC_ID_EAC3) !trk-vos_len) { /* copy frame to create needed atoms */ trk-vos_len = size; trk-vos_data = av_malloc(size); -- 2.1.0.127.g0c72b98 ___ ffmpeg-devel mailing
Re: [FFmpeg-devel] [PATCH] avformat/mxfenc: add jpeg2000 support
Hi, - Mail original - On Tue, 2014-09-30 at 15:37 +0200, Benoit Fouet wrote: Hi, this patch adds support for j2k muxing in MXF. tested with: $ ffmpeg -t 5 -f lavfi -i testsrc -y -c:v libopenjpeg -y out.mxf Played back in ffplay (linux), vlc (windows), Acrok MXF converter (windows). I have no idea against what other players this should be tested. Do we have a sample + FATE case for this? Nope -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 0/2] avfilter: Some OOM fixes
Decided to fuzz some stuff randomly again, using: https://gist.github.com/dwbuiten/7101755 Derek Buitenhuis (2): avfilter/aresample: Check for mmemory alloc failure for out sample rates avfilter: Properly check for failed format query libavfilter/af_aresample.c |5 + libavfilter/avfiltergraph.c |4 +++- 2 files changed, 8 insertions(+), 1 deletions(-) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] avfilter: Properly check for failed format query
Signed-off-by: Derek Buitenhuis derek.buitenh...@gmail.com --- libavfilter/avfiltergraph.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 9178939..a859ecb 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -559,7 +559,9 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) if ((ret = avfilter_insert_filter(link, convert, 0, 0)) 0) return ret; -filter_query_formats(convert); +if ((ret = filter_query_formats(convert)) 0) +return ret; + inlink = convert-inputs[0]; outlink = convert-outputs[0]; av_assert0( inlink- in_formats-refcount 0); -- 1.7.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] avfilter/aresample: Check for mmemory alloc failure for out sample rates
Signed-off-by: Derek Buitenhuis derek.buitenh...@gmail.com --- libavfilter/af_aresample.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index 5f34321..550da54 100644 --- a/libavfilter/af_aresample.c +++ b/libavfilter/af_aresample.c @@ -103,6 +103,11 @@ static int query_formats(AVFilterContext *ctx) } else { out_samplerates = ff_all_samplerates(); } +if (!out_samplerates) { +av_log(ctx, AV_LOG_ERROR, Cannot allocate output sampelrates.\n); +return AVERROR(ENOMEM); +} + ff_formats_ref(out_samplerates, outlink-in_samplerates); if(out_format != AV_SAMPLE_FMT_NONE) { -- 1.7.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 0/2] avfilter: Some OOM fixes
On 10/2/2014 11:55 AM, Derek Buitenhuis wrote: avfilter/aresample: Check for mmemory alloc failure for out sample rates Typo fixed locally. Woops. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] avfilter/aresample: Check for mmemory alloc failure for out sample rates
On Thu, Oct 02, 2014 at 11:58:01AM +0100, Derek Buitenhuis wrote: On 10/2/2014 11:55 AM, Derek Buitenhuis wrote: +av_log(ctx, AV_LOG_ERROR, Cannot allocate output sampelrates.\n); Also fixed locally. patch LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are best at talking, realize last or never when they are wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] avfilter: Properly check for failed format query
On Thu, Oct 02, 2014 at 11:55:52AM +0100, Derek Buitenhuis wrote: Signed-off-by: Derek Buitenhuis derek.buitenh...@gmail.com --- libavfilter/avfiltergraph.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) probably ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 100% positive feedback - All either got their money back or didnt complain Best seller ever, very honest - Seller refunded buyer after failed scam signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] mlpdec: move rematrix_channels code to output_data()
On Tue, Sep 30, 2014 at 03:50:32PM -0300, James Almer wrote: Signed-off-by: James Almer jamr...@gmail.com --- libavcodec/mlpdec.c | 45 ++--- 1 file changed, 18 insertions(+), 27 deletions(-) LGTM thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] x86/mlpdec: add ff_mlp_rematrix_channel_{sse4, avx2}
On 2014-09-30 20:50, James Almer wrote: +pshufdm2, m0, 0xb1 +pshufdm3, m1, 0xb1 +pshufdm3, m1, 0xb1 +pshufdm4, m2, 0xb1 +pshufd xm1, xm0, 0x4e +pshufd xm2, xm0, 0xb1 +pshufd xm3, xm1, 0xb1 +pshufd xm2, xm0, 0xb1 +pshufd xm3, xm1, 0xb1 Are these shuffle constants in base-16 more clear about what they do than the base-4 q defines of x264asm? signature.asc Description: OpenPGP digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] x86/mlpdec: add ff_mlp_rematrix_channel_{sse4, avx2}
On Tue, Sep 30, 2014 at 03:50:33PM -0300, James Almer wrote: 2x to 2.5x faster than the C version. Signed-off-by: James Almer jamr...@gmail.com --- libavcodec/mlpdec.c| 4 +- libavcodec/x86/Makefile| 6 +- libavcodec/x86/mlpdsp.asm | 198 + libavcodec/x86/{mlpdsp.c = mlpdsp_init.c} | 22 +++- 4 files changed, 225 insertions(+), 5 deletions(-) create mode 100644 libavcodec/x86/mlpdsp.asm rename libavcodec/x86/{mlpdsp.c = mlpdsp_init.c} (86%) tested seems working probably ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but the highest form of Human Excellence is to question oneself and others. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] avutil/avstring: Factor av_match_list() out
On Tue, Sep 30, 2014 at 07:41:07PM +0200, Michael Niedermayer wrote: Signed-off-by: Michael Niedermayer michae...@gmx.at --- doc/APIchanges |3 +++ libavformat/format.c | 20 +++- libavutil/avstring.c | 21 + libavutil/avstring.h |7 +++ 4 files changed, 34 insertions(+), 17 deletions(-) applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] FFmpeg IRC meeting October 4th 2014, UTC 16
On date Wednesday 2014-10-01 10:18:58 +0200, Stefano Sabatini encoded: [...] So, since we have already two preferences for Saturday 4 October, I think we should stick with it. If I see no other comments, I'll settle the date. Thanks all. I confirm the FFmpeg meeting on IRC, that will be held on the next Saturday 4th October 2014, at 16 UTC. If you are an FFmpeg developer or an interested third party you're very welcome to join. Find the topics of the day here: http://trac.ffmpeg.org/wiki/FFmeeting/2014-10 The channel and the log will be public, the log will be published on ffmpeg-devel. See you. -- FFmpeg = Fast and Fundamental Multipurpose Prodigious Earthshaking Gem ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] FFmpeg IRC meeting October 4th 2014, UTC 16
On Thu, Oct 2, 2014 at 7:12 AM, Stefano Sabatini stefa...@gmail.com wrote: On date Wednesday 2014-10-01 10:18:58 +0200, Stefano Sabatini encoded: [...] So, since we have already two preferences for Saturday 4 October, I think we should stick with it. If I see no other comments, I'll settle the date. Thanks all. I confirm the FFmpeg meeting on IRC, that will be held on the next Saturday 4th October 2014, at 16 UTC. If you are an FFmpeg developer or an interested third party you're very welcome to join. Find the topics of the day here: http://trac.ffmpeg.org/wiki/FFmeeting/2014-10 The channel and the log will be public, the log will be published on ffmpeg-devel. Which channel will the meeting be on? Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] FFmpeg IRC meeting October 4th 2014, UTC 16
On date Thursday 2014-10-02 07:14:08 -0700, Timothy Gu encoded: On Thu, Oct 2, 2014 at 7:12 AM, Stefano Sabatini stefa...@gmail.com wrote: On date Wednesday 2014-10-01 10:18:58 +0200, Stefano Sabatini encoded: [...] So, since we have already two preferences for Saturday 4 October, I think we should stick with it. If I see no other comments, I'll settle the date. Thanks all. I confirm the FFmpeg meeting on IRC, that will be held on the next Saturday 4th October 2014, at 16 UTC. If you are an FFmpeg developer or an interested third party you're very welcome to join. Find the topics of the day here: http://trac.ffmpeg.org/wiki/FFmeeting/2014-10 The channel and the log will be public, the log will be published on ffmpeg-devel. Which channel will the meeting be on? It is usually #ffmpeg-meeting, but it will be announced before the event. -- FFmpeg = Fanciful Frightening Moronic Proud Enlightened God ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/movenc: add EAC3 muxing support.
2014-10-02 19:39 GMT+09:00 Benoit Fouet benoit.fo...@free.fr: Fixes ticket #3074 --- libavformat/isom.c | 1 + libavformat/movenc.c | 44 +++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libavformat/isom.c b/libavformat/isom.c index d768c32..1509021 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -57,6 +57,7 @@ const AVCodecTag ff_mp4_obj_type[] = { { AV_CODEC_ID_VC1 , 0xA3 }, { AV_CODEC_ID_DIRAC , 0xA4 }, { AV_CODEC_ID_AC3 , 0xA5 }, +{ AV_CODEC_ID_EAC3, 0xA6 }, { AV_CODEC_ID_DTS , 0xA9 }, /* mp4ra.org */ { AV_CODEC_ID_VORBIS , 0xDD }, /* non standard, gpac uses it */ { AV_CODEC_ID_DVD_SUBTITLE, 0xE0 }, /* non standard, see unsupported-embedded-subs-2.mp4 */ diff --git a/libavformat/movenc.c b/libavformat/movenc.c index bfee866..62b2d4b 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -31,6 +31,7 @@ #include avio.h #include isom.h #include avc.h +#include libavcodec/ac3_parser.h #include libavcodec/get_bits.h #include libavcodec/put_bits.h #include libavcodec/vc1_common.h @@ -292,6 +293,40 @@ static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track) return 11; } +static int mov_write_eac3_tag(AVIOContext *pb, MOVTrack *track) +{ +GetBitContext gbc; +PutBitContext pbc; +uint8_t buf[5]; +AC3HeaderInfo tmp, *hdr = tmp; + +if (!track-vos_len) +return -1; + +init_get_bits(gbc, track-vos_data, track-vos_len * 8); +if (avpriv_ac3_parse_header2(gbc, hdr) != 0) +return -1; + +avio_wb32(pb, 13); +ffio_wfourcc(pb, dec3); + +init_put_bits(pbc, buf, sizeof(buf)); +put_bits(pbc, 13, hdr-bit_rate); +put_bits(pbc, 3, 0); /* consider there is only one independent substream present */ So, the muxer rejects EAC3 stream if it contains multiple independent substreams? +put_bits(pbc, 2, hdr-sr_code); +put_bits(pbc, 5, hdr-bitstream_id); +put_bits(pbc, 5, hdr-bitstream_mode); +put_bits(pbc, 3, hdr-channel_mode); +put_bits(pbc, 1, hdr-lfe_on); +put_bits(pbc, 5, 0); /* reserved */ +put_bits(pbc, 4, 0); /* no dependent substream */ +put_bits(pbc, 1, 0); /* reserved */ +flush_put_bits(pbc); +avio_write(pb, buf, sizeof(buf)); + +return 13; +} + /** * This function writes extradata as is. * Extradata must be formatted like a valid atom (with size and tag). @@ -486,6 +521,8 @@ static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track) mov_write_amr_tag(pb, track); } else if (track-enc-codec_id == AV_CODEC_ID_AC3) { mov_write_ac3_tag(pb, track); +} else if (track-enc-codec_id == AV_CODEC_ID_EAC3) { +mov_write_eac3_tag(pb, track); } else if (track-enc-codec_id == AV_CODEC_ID_ALAC || track-enc-codec_id == AV_CODEC_ID_QDM2) { mov_write_extradata_tag(pb, track); @@ -756,6 +793,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) if (track-mode == MODE_MOV (track-enc-codec_id == AV_CODEC_ID_AAC || track-enc-codec_id == AV_CODEC_ID_AC3 || + track-enc-codec_id == AV_CODEC_ID_EAC3 || track-enc-codec_id == AV_CODEC_ID_AMR_NB|| track-enc-codec_id == AV_CODEC_ID_ALAC || track-enc-codec_id == AV_CODEC_ID_ADPCM_MS || @@ -770,6 +808,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) mov_write_amr_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_AC3) mov_write_ac3_tag(pb, track); +else if (track-enc-codec_id == AV_CODEC_ID_EAC3) +mov_write_eac3_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_ALAC) mov_write_extradata_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_WMAPRO) @@ -877,6 +917,7 @@ static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track) if (track-enc-codec_id == AV_CODEC_ID_H264) tag = MKTAG('a','v','c','1'); else if (track-enc-codec_id == AV_CODEC_ID_HEVC) tag = MKTAG('h','e','v','1'); else if (track-enc-codec_id == AV_CODEC_ID_AC3) tag = MKTAG('a','c','-','3'); +else if (track-enc-codec_id == AV_CODEC_ID_EAC3) tag = MKTAG('e','c','-','3'); else if (track-enc-codec_id == AV_CODEC_ID_DIRAC) tag = MKTAG('d','r','a','c'); else if (track-enc-codec_id == AV_CODEC_ID_MOV_TEXT) tag = MKTAG('t','x','3','g'); else if (track-enc-codec_id == AV_CODEC_ID_VC1) tag = MKTAG('v','c','-','1'); @@ -3605,7 +3646,8 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) } if ((enc-codec_id == AV_CODEC_ID_DNXHD || - enc-codec_id == AV_CODEC_ID_AC3) !trk-vos_len) { + enc-codec_id == AV_CODEC_ID_AC3 || +
Re: [FFmpeg-devel] [PATCH] avformat/movenc: add EAC3 muxing support.
Benoit Fouet benoit.fouet at free.fr writes: Fixes ticket #3074 I tested this patch successfully with WMP: mono, stereo and 5.1 play well. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] jpeg2000: Fix a missing compilation of jpeg2000dsp when disabling the encoder.
--- libavcodec/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 04a7944..c6cb6e2 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -277,7 +277,7 @@ OBJS-$(CONFIG_JACOSUB_DECODER) += jacosubdec.o ass.o OBJS-$(CONFIG_JPEG2000_ENCODER)+= j2kenc.o mqcenc.o mqc.o jpeg2000.o \ jpeg2000dwt.o jpeg2000dsp.o OBJS-$(CONFIG_JPEG2000_DECODER)+= jpeg2000dec.o jpeg2000.o \ - jpeg2000dwt.o mqcdec.o mqc.o + jpeg2000dwt.o mqcdec.o mqc.o jpeg2000dsp.o OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o OBJS-$(CONFIG_JV_DECODER) += jvdec.o -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/movenc: add EAC3 muxing support.
2014-10-02 19:39 GMT+09:00 Benoit Fouet benoit.fo...@free.fr: Fixes ticket #3074 --- libavformat/isom.c | 1 + libavformat/movenc.c | 44 +++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libavformat/isom.c b/libavformat/isom.c index d768c32..1509021 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -57,6 +57,7 @@ const AVCodecTag ff_mp4_obj_type[] = { { AV_CODEC_ID_VC1 , 0xA3 }, { AV_CODEC_ID_DIRAC , 0xA4 }, { AV_CODEC_ID_AC3 , 0xA5 }, +{ AV_CODEC_ID_EAC3, 0xA6 }, { AV_CODEC_ID_DTS , 0xA9 }, /* mp4ra.org */ { AV_CODEC_ID_VORBIS , 0xDD }, /* non standard, gpac uses it */ { AV_CODEC_ID_DVD_SUBTITLE, 0xE0 }, /* non standard, see unsupported-embedded-subs-2.mp4 */ diff --git a/libavformat/movenc.c b/libavformat/movenc.c index bfee866..62b2d4b 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -31,6 +31,7 @@ #include avio.h #include isom.h #include avc.h +#include libavcodec/ac3_parser.h #include libavcodec/get_bits.h #include libavcodec/put_bits.h #include libavcodec/vc1_common.h @@ -292,6 +293,40 @@ static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track) return 11; } +static int mov_write_eac3_tag(AVIOContext *pb, MOVTrack *track) +{ +GetBitContext gbc; +PutBitContext pbc; +uint8_t buf[5]; +AC3HeaderInfo tmp, *hdr = tmp; + +if (!track-vos_len) +return -1; + +init_get_bits(gbc, track-vos_data, track-vos_len * 8); +if (avpriv_ac3_parse_header2(gbc, hdr) != 0) +return -1; + +avio_wb32(pb, 13); +ffio_wfourcc(pb, dec3); + +init_put_bits(pbc, buf, sizeof(buf)); +put_bits(pbc, 13, hdr-bit_rate); +put_bits(pbc, 3, 0); /* consider there is only one independent substream present */ +put_bits(pbc, 2, hdr-sr_code); +put_bits(pbc, 5, hdr-bitstream_id); +put_bits(pbc, 5, hdr-bitstream_mode); +put_bits(pbc, 3, hdr-channel_mode); +put_bits(pbc, 1, hdr-lfe_on); +put_bits(pbc, 5, 0); /* reserved */ +put_bits(pbc, 4, 0); /* no dependent substream */ +put_bits(pbc, 1, 0); /* reserved */ +flush_put_bits(pbc); +avio_write(pb, buf, sizeof(buf)); + +return 13; +} + /** * This function writes extradata as is. * Extradata must be formatted like a valid atom (with size and tag). @@ -486,6 +521,8 @@ static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track) mov_write_amr_tag(pb, track); } else if (track-enc-codec_id == AV_CODEC_ID_AC3) { mov_write_ac3_tag(pb, track); +} else if (track-enc-codec_id == AV_CODEC_ID_EAC3) { +mov_write_eac3_tag(pb, track); } else if (track-enc-codec_id == AV_CODEC_ID_ALAC || track-enc-codec_id == AV_CODEC_ID_QDM2) { mov_write_extradata_tag(pb, track); @@ -756,6 +793,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) if (track-mode == MODE_MOV (track-enc-codec_id == AV_CODEC_ID_AAC || track-enc-codec_id == AV_CODEC_ID_AC3 || + track-enc-codec_id == AV_CODEC_ID_EAC3 || track-enc-codec_id == AV_CODEC_ID_AMR_NB|| track-enc-codec_id == AV_CODEC_ID_ALAC || track-enc-codec_id == AV_CODEC_ID_ADPCM_MS || @@ -770,6 +808,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) mov_write_amr_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_AC3) mov_write_ac3_tag(pb, track); +else if (track-enc-codec_id == AV_CODEC_ID_EAC3) +mov_write_eac3_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_ALAC) mov_write_extradata_tag(pb, track); else if (track-enc-codec_id == AV_CODEC_ID_WMAPRO) @@ -877,6 +917,7 @@ static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track) if (track-enc-codec_id == AV_CODEC_ID_H264) tag = MKTAG('a','v','c','1'); else if (track-enc-codec_id == AV_CODEC_ID_HEVC) tag = MKTAG('h','e','v','1'); else if (track-enc-codec_id == AV_CODEC_ID_AC3) tag = MKTAG('a','c','-','3'); +else if (track-enc-codec_id == AV_CODEC_ID_EAC3) tag = MKTAG('e','c','-','3'); else if (track-enc-codec_id == AV_CODEC_ID_DIRAC) tag = MKTAG('d','r','a','c'); else if (track-enc-codec_id == AV_CODEC_ID_MOV_TEXT) tag = MKTAG('t','x','3','g'); else if (track-enc-codec_id == AV_CODEC_ID_VC1) tag = MKTAG('v','c','-','1'); @@ -3605,7 +3646,8 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) } if ((enc-codec_id == AV_CODEC_ID_DNXHD || - enc-codec_id == AV_CODEC_ID_AC3) !trk-vos_len) { + enc-codec_id == AV_CODEC_ID_AC3 || + enc-codec_id == AV_CODEC_ID_EAC3) !trk-vos_len) { /* copy frame to create needed
Re: [FFmpeg-devel] [PATCH 3/3] lavf/webm_dash: some fields should go into Representation
On Wed, Oct 01, 2014 at 10:17:53AM -0700, Vignesh Venkatasubramanian wrote: A new file (dash_video4.webm) is required for this fate test. It can be found here: https://docs.google.com/file/d/0Bx8Q1nhO9b6MbnlfU1QtZkZyMnM/edit?pli=1 Could you please place this file in the fate suite under vp8/ directory before applyingt this patch? done yesterday patch applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have often repented speaking, but never of holding my tongue. -- Xenocrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec, avutil: allow more control about how samples are skipped
On Thu, Oct 02, 2014 at 08:12:41PM +0200, wm4 wrote: On Sat, 27 Sep 2014 16:47:09 +0200 wm4 nfx...@googlemail.com wrote: Add CODEC_FLAG2_SKIP_MANUAL (exposed as skip_manual), which makes the decoder export sample skip information via side data, instead of applying it automatically. The format of the side data is the same as AV_PKT_DATA_SKIP_SAMPLES, but since AVPacket and AVFrame side data constants overlap, AV_FRAME_DATA_SKIP_SAMPLES needs to be introduced. This is useful for applications which want to do the timestamp calculations manually, or which actually want to retrieve the padding. --- I'm doing this because my timestamps are doubles, and can't be expressed in integer timebases. I also think libavcodec shouldn't mess with timestamps at all, just pass them through. --- doc/APIchanges | 7 +++ libavcodec/avcodec.h | 1 + libavcodec/options_table.h | 1 + libavcodec/utils.c | 21 +++-- libavutil/frame.h | 12 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 7fadab3..c0f34c9 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,13 @@ libavutil: 2014-08-09 API changes, most recent first: +2014-08-03 - xxx - lavc 56.x.100 - avcodec.h +2014-08-03 - xxx - lavu 54.x.100 - frame.h + Add AV_FRAME_DATA_SKIP_SAMPLES. Add lavc CODEC_FLAG2_SKIP_MANUAL and + AVOption skip_manual, which makes lavc export skip information via + AV_FRAME_DATA_SKIP_SAMPLES AVFrame side data, instead of skipping and + discarding samples automatically. + 2014-09-24 - xxx - libpostproc 53.1.100 Add visualization support diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 94e82f7..7598748 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -768,6 +768,7 @@ typedef struct RcOverride{ #define CODEC_FLAG2_CHUNKS0x8000 /// Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. #define CODEC_FLAG2_SHOW_ALL 0x0040 /// Show all frames before the first keyframe #define CODEC_FLAG2_EXPORT_MVS0x1000 /// Export motion vectors through frame side data +#define CODEC_FLAG2_SKIP_MANUAL 0x2000 /// Do not skip samples and export skip information as frame side data /* Unsupported options : * Syntax Arithmetic coding (SAC) diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index ad3d52e..b9b79f9 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -89,6 +89,7 @@ static const AVOption avcodec_options[] = { {chunks, Frame data might be split into multiple chunks, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_CHUNKS }, INT_MIN, INT_MAX, V|D, flags2}, {showall, Show all frames before the first keyframe, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, flags2}, {export_mvs, export motion vectors through frame side data, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_EXPORT_MVS}, INT_MIN, INT_MAX, V|D, flags2}, +{skip_manual, do not skip samples and export skip information as frame side data, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SKIP_MANUAL}, INT_MIN, INT_MAX, V|D, flags2}, {me_method, set motion estimation method, OFFSET(me_method), AV_OPT_TYPE_INT, {.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, me_method}, {zero, zero motion estimation (fastest), 0, AV_OPT_TYPE_CONST, {.i64 = ME_ZERO }, INT_MIN, INT_MAX, V|E, me_method }, {full, full motion estimation (slowest), 0, AV_OPT_TYPE_CONST, {.i64 = ME_FULL }, INT_MIN, INT_MAX, V|E, me_method }, diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b27f918..ce0d943 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -2448,6 +2448,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, uint8_t *side; int side_size; uint32_t discard_padding = 0; +uint8_t skip_reason = 0; +uint8_t discard_reason = 0; // copy to ensure we do not change avpkt AVPacket tmp = *avpkt; int did_split = av_packet_split_side_data(tmp); @@ -2488,8 +2490,11 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, av_log(avctx, AV_LOG_DEBUG, skip %d samples due to side data\n, avctx-internal-skip_samples); discard_padding = AV_RL32(side + 4); +skip_reason = AV_RL8(side + 8); +discard_reason = AV_RL8(side + 9); } -if (avctx-internal-skip_samples *got_frame_ptr) { +if (avctx-internal-skip_samples *got_frame_ptr +!(avctx-flags2 CODEC_FLAG2_SKIP_MANUAL)) { if(frame-nb_samples = avctx-internal-skip_samples){ *got_frame_ptr = 0;
[FFmpeg-devel] [PATCH 2/2] x86: hevc_mt: use proxy functions for WP
On Win64: Before: 155576b 64765 decicycles in qpel_bi_w, 8185 runs, 7 skips 13676 decicycles in epel_bi_w, 16378 runs, 6 skips 54402 decicycles in qpel_uni_w, 1023 runs, 1 skips 12328 decicycles in epel_uni_w, 2048 runs, 0 skips After: 94260b 65037 decicycles in qpel_bi_w, 8185 runs, 7 skips 13752 decicycles in epel_bi_w, 16380 runs, 4 skips 54709 decicycles in qpel_uni_w, 1021 runs, 3 skips 12037 decicycles in epel_uni_w, 2047 runs, 1 skips --- libavcodec/x86/hevcdsp_init.c | 542 +++--- 1 file changed, 461 insertions(+), 81 deletions(-) diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c index 4c536ac..a8284db 100644 --- a/libavcodec/x86/hevcdsp_init.c +++ b/libavcodec/x86/hevcdsp_init.c @@ -550,9 +550,23 @@ mc_rep_proxies(qpel_hv,12, 8, sse4); #define ff_hevc_put_hevc_bi_qpel_hv16_12_sse4 proxy_bi_qpel_hv8_12_sse4 mc_rep_funcs(qpel_hv,12, 4, 12, sse4); +#define mc_rep_uni_w_proxy(bitd, step, opt) \ +static void proxy_uni_w##step##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride, \ + int height, int denom, int _wx, int _ox, int width) \ +{ \ +int i; \ +int16_t *src; \ +uint8_t *dst; \ +for (i = 0; i width; i += step) { \ +src= _src + i; \ +dst= _dst + (i * ((bitd + 7) / 8)); \ +ff_hevc_put_hevc_uni_w##step##_##bitd##_##opt(dst, dststride, src, _srcstride, height, denom, _wx, _ox);\ +} \ +} + #define mc_rep_uni_w(bitd, step, W, opt) \ -void ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride,\ - int height, int denom, int _wx, int _ox)\ +static void no_proxy_uni_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride, \ + int height, int denom, int _wx, int _ox, int width) \ { \ int i; \ int16_t *src; \ @@ -560,36 +574,84 @@ void ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststri for (i = 0; i W; i += step) { \ src= _src + i; \ dst= _dst + (i * ((bitd + 7) / 8)); \ -ff_hevc_put_hevc_uni_w##step##_##bitd##_##opt(dst, dststride, src, _srcstride, \ - height, denom, _wx, _ox); \ +ff_hevc_put_hevc_uni_w##step##_##bitd##_##opt(dst, dststride, src, _srcstride, height, denom, _wx, _ox);\ } \ } +#define mc_rep_uni_w_unproxy(bitd, W, opt) \ +static void unproxy_uni_w##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, int16_t *src, ptrdiff_t srcstride, \ + int height, int denom, int _wx, int _ox, int width) \ +{ \ +ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(dst, dststride, src, srcstride, height, denom, _wx, _ox);\ +} + mc_rep_uni_w(8, 6, 12, sse4); -mc_rep_uni_w(8, 8, 16, sse4); -mc_rep_uni_w(8, 8, 24, sse4); -mc_rep_uni_w(8, 8, 32, sse4); -mc_rep_uni_w(8, 8, 48, sse4); -mc_rep_uni_w(8, 8, 64, sse4); +#define
[FFmpeg-devel] [PATCH 1/2] x86: hevc_mc: use proxy functions
Most functions were actually instanciated and unrolled, causing an increase in object size. On Win64, before: stripped object size 185404 36248 decicycles in qpel, 522688 runs, 1600 skips 39808 decicycles in qpel bi, 522920 runs, 1368 skips 6997 decicycles in epel, 1037753 runs, 10823 skips 8042 decicycles in epel bi, 1037563 runs, 11013 skips 14512 decicycles in qpel uni, 516830 runs, 7458 skips 3899 decicycles in epel uni, 1035334 runs, 13242 skips After: stripped object size 155576 36335 decicycles in qpel, 522784 runs, 1504 skips 39727 decicycles in qpel bi, 522873 runs, 1415 skips 7040 decicycles in epel, 1038058 runs, 10518 skips 8068 decicycles in epel bi, 1037684 runs, 10892 skips 14608 decicycles in qpel uni, 516923 runs, 7365 skips 3920 decicycles in epel uni, 1035699 runs, 12877 skips --- libavcodec/x86/hevcdsp_init.c | 456 +- 1 file changed, 361 insertions(+), 95 deletions(-) diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c index eaa97e1..4c536ac 100644 --- a/libavcodec/x86/hevcdsp_init.c +++ b/libavcodec/x86/hevcdsp_init.c @@ -71,6 +71,43 @@ IDCT_FUNCS(32x32, sse2); IDCT_FUNCS(16x16, avx2); IDCT_FUNCS(32x32, avx2); + +#define mc_rep_proxy(name, bitd, step, opt) \ +static void proxy_##name##step##_##bitd##_##opt(int16_t *dst, \ +uint8_t *src, ptrdiff_t srcstride, int height, \ +intptr_t mx, intptr_t my, int width)\ +{ \ +int i, step2 = step * ((bitd + 7) / 8); \ +for (i = 0; i width; i += step, src += step2, dst += step) \ +ff_hevc_put_hevc_##name##step##_##bitd##_##opt(dst, src, srcstride, height, mx, my, width); \ +} +#define mc_rep_uni_proxy(name, bitd, step, opt) \ +static void proxy_uni_##name##step##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, \ +uint8_t *src, ptrdiff_t srcstride, int height, \ +intptr_t mx, intptr_t my, int width)\ +{ \ +int i, step2 = step * ((bitd + 7) / 8); \ +for (i = 0; i width; i += step, src += step2, dst += step2) \ +ff_hevc_put_hevc_uni_##name##step##_##bitd##_##opt(dst, dststride, src, srcstride, \ + height, mx, my, width); \ +} +#define mc_rep_bi_proxy(name, bitd, step, opt) \ +static void proxy_bi_##name##step##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \ + ptrdiff_t srcstride, int16_t* src2, \ + int height, intptr_t mx, intptr_t my, int width) \ +{ \ +int i, step2 = step * ((bitd + 7) / 8); \ +for (i = 0; i width; i += step, src += step2, dst += step2, src2 += step) \ +ff_hevc_put_hevc_bi_##name##step##_##bitd##_##opt(dst, dststride, src, srcstride, src2, \ + height, mx, my, width); \ +} + +// Create the actual proxy functions +#define mc_rep_proxies(name, bitd, step, opt) \ +mc_rep_proxy(name, bitd, step, opt);\ +mc_rep_uni_proxy(name, bitd, step, opt);\ +mc_rep_bi_proxy(name, bitd, step, opt) + #define mc_rep_func(name, bitd, step, W, opt) \ void ff_hevc_put_hevc_##name##W##_##bitd##_##opt(int16_t *_dst, \ uint8_t *_src, ptrdiff_t _srcstride, int height,\ @@ -165,123 +202,352 @@ void ff_hevc_put_hevc_bi_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dsts #if ARCH_X86_64 HAVE_SSE4_EXTERNAL -mc_rep_funcs(pel_pixels, 8, 16, 64, sse4); -mc_rep_funcs(pel_pixels, 8, 16, 48, sse4); -mc_rep_funcs(pel_pixels, 8, 16, 32, sse4); +mc_rep_proxies(pel_pixels, 8, 16, sse4); +#define ff_hevc_put_hevc_pel_pixels64_8_sse4 proxy_pel_pixels16_8_sse4 +#define
Re: [FFmpeg-devel] [PATCH 2/2] av_lockmgr_register defines behavior on failure.
On Wed, Oct 1, 2014 at 5:40 PM, Michael Niedermayer michae...@gmx.at wrote: On Wed, Oct 01, 2014 at 04:37:21PM -0700, Manfred Georg wrote: [snip] @@ -3457,22 +3457,53 @@ AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel) int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) { if (lockmgr_cb) { -if (lockmgr_cb(codec_mutex, AV_LOCK_DESTROY)) -return -1; -if (lockmgr_cb(avformat_mutex, AV_LOCK_DESTROY)) -return -1; +// There is no good way to rollback a failure to destroy the +// mutex, so we ignore failures. +lockmgr_cb(codec_mutex, AV_LOCK_DESTROY); +lockmgr_cb(avformat_mutex, AV_LOCK_DESTROY); +avpriv_atomic_ptr_cas((void * volatile *)lockmgr_cb, + lockmgr_cb, NULL); +avpriv_atomic_ptr_cas((void * volatile *)codec_mutex, + codec_mutex, NULL); +avpriv_atomic_ptr_cas((void * volatile *)avformat_mutex, + avformat_mutex, NULL); +} + +if (lockmgr_cb || codec_mutex || avformat_mutex) { +// Some synchronization error occurred. +lockmgr_cb = NULL; codec_mutex = NULL; avformat_mutex = NULL; +return AVERROR(EDEADLK); } this should be av_assert0() we dont want to continue after we know that the variables have been corrupted also it could be a seperate patch I feel that if we use the atomic operation then this should be included in this patch (since otherwise what's the point in having atomic operations which we never check whether they succeed. I'd be happy to replace the atomic operations with = again. Please advise whether I should use av_assert0() or return to =. the point of the 2nd set of atomic operations is to ensure we dont overwrite a non null pointer the set above could check that the overwritten pointer equals what was set before destroy as they are iam not sure if they provide an advantage over a normal a=b, iam also not sure the first set is really that usefull I reverted to using =. We can switch to atomic operations in a later patch if that is desired. -lockmgr_cb = cb; - -if (lockmgr_cb) { -if (lockmgr_cb(codec_mutex, AV_LOCK_CREATE)) -return -1; -if (lockmgr_cb(avformat_mutex, AV_LOCK_CREATE)) -return -1; +if (cb) { +void *new_codec_mutex = NULL; +void *new_avformat_mutex = NULL; +int err; +if (err = cb(new_codec_mutex, AV_LOCK_CREATE)) { +return err 0 ? -err : err; +} +if (err = cb(new_avformat_mutex, AV_LOCK_CREATE)) { +// Ignore failures to destroy the newly created mutex. +cb(new_codec_mutex, AV_LOCK_DESTROY); +return err 0 ? -err : err; how does this work ? It ensures that the returned value is negative on failure. It also passes through error codes if they are used. Note that we have to do something with positive values, since even the lock manager in ffplay.c uses a positive value to denote failure (it uses 1). return err 0 ? AVERROR(SOMETHING) : err; would also work (or -1). Please advise. AVERROR_EXTERNAL seems like an option Done. New patch: Subject: [PATCH] av_lockmgr_register defines behavior on failure. The register function now specifies that the user callback should leave things in the same state that it found them on failure but that failure to destroy is ignored by the library. The register function is now explicit about its behavior on failure (it unregisters the previous callback and destroys all mutex). --- libavcodec/avcodec.h | 30 -- libavcodec/utils.c | 34 ++ 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 94e82f7..7fb97da 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -5120,16 +5120,26 @@ enum AVLockOp { /** * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void *) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. + * specified by AVLockOp. The mutex argument to the function points +
Re: [FFmpeg-devel] [PATCH 2/2] av_lockmgr_register defines behavior on failure.
On Thu, Oct 02, 2014 at 11:54:31AM -0700, Manfred Georg wrote: On Wed, Oct 1, 2014 at 5:40 PM, Michael Niedermayer michae...@gmx.at wrote: On Wed, Oct 01, 2014 at 04:37:21PM -0700, Manfred Georg wrote: [snip] @@ -3457,22 +3457,53 @@ AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel) int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) { if (lockmgr_cb) { -if (lockmgr_cb(codec_mutex, AV_LOCK_DESTROY)) -return -1; -if (lockmgr_cb(avformat_mutex, AV_LOCK_DESTROY)) -return -1; +// There is no good way to rollback a failure to destroy the +// mutex, so we ignore failures. +lockmgr_cb(codec_mutex, AV_LOCK_DESTROY); +lockmgr_cb(avformat_mutex, AV_LOCK_DESTROY); +avpriv_atomic_ptr_cas((void * volatile *)lockmgr_cb, + lockmgr_cb, NULL); +avpriv_atomic_ptr_cas((void * volatile *)codec_mutex, + codec_mutex, NULL); +avpriv_atomic_ptr_cas((void * volatile *)avformat_mutex, + avformat_mutex, NULL); +} + +if (lockmgr_cb || codec_mutex || avformat_mutex) { +// Some synchronization error occurred. +lockmgr_cb = NULL; codec_mutex = NULL; avformat_mutex = NULL; +return AVERROR(EDEADLK); } this should be av_assert0() we dont want to continue after we know that the variables have been corrupted also it could be a seperate patch I feel that if we use the atomic operation then this should be included in this patch (since otherwise what's the point in having atomic operations which we never check whether they succeed. I'd be happy to replace the atomic operations with = again. Please advise whether I should use av_assert0() or return to =. the point of the 2nd set of atomic operations is to ensure we dont overwrite a non null pointer the set above could check that the overwritten pointer equals what was set before destroy as they are iam not sure if they provide an advantage over a normal a=b, iam also not sure the first set is really that usefull I reverted to using =. We can switch to atomic operations in a later patch if that is desired. -lockmgr_cb = cb; - -if (lockmgr_cb) { -if (lockmgr_cb(codec_mutex, AV_LOCK_CREATE)) -return -1; -if (lockmgr_cb(avformat_mutex, AV_LOCK_CREATE)) -return -1; +if (cb) { +void *new_codec_mutex = NULL; +void *new_avformat_mutex = NULL; +int err; +if (err = cb(new_codec_mutex, AV_LOCK_CREATE)) { +return err 0 ? -err : err; +} +if (err = cb(new_avformat_mutex, AV_LOCK_CREATE)) { +// Ignore failures to destroy the newly created mutex. +cb(new_codec_mutex, AV_LOCK_DESTROY); +return err 0 ? -err : err; how does this work ? It ensures that the returned value is negative on failure. It also passes through error codes if they are used. Note that we have to do something with positive values, since even the lock manager in ffplay.c uses a positive value to denote failure (it uses 1). return err 0 ? AVERROR(SOMETHING) : err; would also work (or -1). Please advise. AVERROR_EXTERNAL seems like an option Done. New patch: Subject: [PATCH] av_lockmgr_register defines behavior on failure. The register function now specifies that the user callback should leave things in the same state that it found them on failure but that failure to destroy is ignored by the library. The register function is now explicit about its behavior on failure (it unregisters the previous callback and destroys all mutex). --- libavcodec/avcodec.h | 30 -- libavcodec/utils.c | 34 ++ 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 94e82f7..7fb97da 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -5120,16 +5120,26 @@ enum AVLockOp { /** * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void *) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. -
Re: [FFmpeg-devel] [PATCH 2/2] av_lockmgr_register defines behavior on failure.
On Thu, Oct 02, 2014 at 09:50:12PM +0200, Michael Niedermayer wrote: On Thu, Oct 02, 2014 at 11:54:31AM -0700, Manfred Georg wrote: On Wed, Oct 1, 2014 at 5:40 PM, Michael Niedermayer michae...@gmx.at wrote: On Wed, Oct 01, 2014 at 04:37:21PM -0700, Manfred Georg wrote: [snip] @@ -3457,22 +3457,53 @@ AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel) int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) { if (lockmgr_cb) { -if (lockmgr_cb(codec_mutex, AV_LOCK_DESTROY)) -return -1; -if (lockmgr_cb(avformat_mutex, AV_LOCK_DESTROY)) -return -1; +// There is no good way to rollback a failure to destroy the +// mutex, so we ignore failures. +lockmgr_cb(codec_mutex, AV_LOCK_DESTROY); +lockmgr_cb(avformat_mutex, AV_LOCK_DESTROY); +avpriv_atomic_ptr_cas((void * volatile *)lockmgr_cb, + lockmgr_cb, NULL); +avpriv_atomic_ptr_cas((void * volatile *)codec_mutex, + codec_mutex, NULL); +avpriv_atomic_ptr_cas((void * volatile *)avformat_mutex, + avformat_mutex, NULL); +} + +if (lockmgr_cb || codec_mutex || avformat_mutex) { +// Some synchronization error occurred. +lockmgr_cb = NULL; codec_mutex = NULL; avformat_mutex = NULL; +return AVERROR(EDEADLK); } this should be av_assert0() we dont want to continue after we know that the variables have been corrupted also it could be a seperate patch I feel that if we use the atomic operation then this should be included in this patch (since otherwise what's the point in having atomic operations which we never check whether they succeed. I'd be happy to replace the atomic operations with = again. Please advise whether I should use av_assert0() or return to =. the point of the 2nd set of atomic operations is to ensure we dont overwrite a non null pointer the set above could check that the overwritten pointer equals what was set before destroy as they are iam not sure if they provide an advantage over a normal a=b, iam also not sure the first set is really that usefull I reverted to using =. We can switch to atomic operations in a later patch if that is desired. -lockmgr_cb = cb; - -if (lockmgr_cb) { -if (lockmgr_cb(codec_mutex, AV_LOCK_CREATE)) -return -1; -if (lockmgr_cb(avformat_mutex, AV_LOCK_CREATE)) -return -1; +if (cb) { +void *new_codec_mutex = NULL; +void *new_avformat_mutex = NULL; +int err; +if (err = cb(new_codec_mutex, AV_LOCK_CREATE)) { +return err 0 ? -err : err; +} +if (err = cb(new_avformat_mutex, AV_LOCK_CREATE)) { +// Ignore failures to destroy the newly created mutex. +cb(new_codec_mutex, AV_LOCK_DESTROY); +return err 0 ? -err : err; how does this work ? It ensures that the returned value is negative on failure. It also passes through error codes if they are used. Note that we have to do something with positive values, since even the lock manager in ffplay.c uses a positive value to denote failure (it uses 1). return err 0 ? AVERROR(SOMETHING) : err; would also work (or -1). Please advise. AVERROR_EXTERNAL seems like an option Done. New patch: Subject: [PATCH] av_lockmgr_register defines behavior on failure. The register function now specifies that the user callback should leave things in the same state that it found them on failure but that failure to destroy is ignored by the library. The register function is now explicit about its behavior on failure (it unregisters the previous callback and destroys all mutex). --- libavcodec/avcodec.h | 30 -- libavcodec/utils.c | 34 ++ 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 94e82f7..7fb97da 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -5120,16 +5120,26 @@ enum AVLockOp { /** * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void *) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this
Re: [FFmpeg-devel] [PATCH] avformat/img2dec: fix glob pattern detection.
On 2014-10-02 22:51 +0200, Alexander Strasser wrote: [...] Maybe something like this patch would be acceptable (WARNING: only lightly tested): diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 16bd699..aa7c2f6 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -160,7 +160,7 @@ static int img_read_probe(AVProbeData *p) if (p-filename ff_guess_image2_codec(p-filename)) { if (av_filename_number_test(p-filename)) return AVPROBE_SCORE_MAX; -else if (is_glob(p-filename)) +else if (p-filename[strcspn(p-filename, *?{\0)]) // glob pattern? I am sorry that superflous NUL slipped in there :( Please ignore it. For as to why I did not include [ in the list of glob chars, is because I think it is too common in file and directory names to use as a heuristic to favour image2 demuxer. return AVPROBE_SCORE_MAX; else if (p-buf_size == 0) return 0; [...] Alexander pgpIhQQ7zlGf4.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] doc/encoders: add basic libx265 documentation
Fixes ticket #3944. Signed-off-by: Lou Logan l...@lrcd.com --- doc/encoders.texi | 28 1 file changed, 28 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index d67bf89..c0e9890 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1886,6 +1886,34 @@ no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT Encoding ffpresets for common usages are provided so they can be used with the general presets system (e.g. passing the @option{pre} option). +@section libx265 + +x265 H.265/HEVC encoder wrapper. + +This encoder requires the presence of the libx265 headers and library +during configuration. You need to explicitly configure the build with +@option{--enable-libx265}. + +@subsection Options + +@table @option +@item preset +Set the x265 preset. + +@item tune +Set the x265 tune parameter. + +@item x265-params +Set x265 options using a list of @var{key}=@var{value} couples separated +by :. See @command{x265 --help} for a list of options. + +For example to specify libx265 encoding options with @option{-x265-params}: + +@example +ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4 +@end example +@end table + @section libxvid Xvid MPEG-4 Part 2 encoder wrapper. -- 2.1.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] mlpdec: move rematrix_channels code to output_data()
On 02/10/14 10:09 AM, Michael Niedermayer wrote: On Tue, Sep 30, 2014 at 03:50:32PM -0300, James Almer wrote: Signed-off-by: James Almer jamr...@gmail.com --- libavcodec/mlpdec.c | 45 ++--- 1 file changed, 18 insertions(+), 27 deletions(-) LGTM thanks Pushed. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] x86/mlpdec: add ff_mlp_rematrix_channel_{sse4, avx2}
On 02/10/14 10:22 AM, Michael Niedermayer wrote: On Tue, Sep 30, 2014 at 03:50:33PM -0300, James Almer wrote: 2x to 2.5x faster than the C version. Signed-off-by: James Almer jamr...@gmail.com --- libavcodec/mlpdec.c| 4 +- libavcodec/x86/Makefile| 6 +- libavcodec/x86/mlpdsp.asm | 198 + libavcodec/x86/{mlpdsp.c = mlpdsp_init.c} | 22 +++- 4 files changed, 225 insertions(+), 5 deletions(-) create mode 100644 libavcodec/x86/mlpdsp.asm rename libavcodec/x86/{mlpdsp.c = mlpdsp_init.c} (86%) tested seems working probably ok Pushed, thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] doc/filters: fix localtime drawtext example.
On 10/09/14 at 00:01, Simon Thelen wrote: The colon after the localtime function call needs an additional layer of escaping or else everything until the next colon is treated as a fontfile. Signed-off-by: Simon Thelen ffmpeg-...@c-14.de --- doc/filters.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/filters.texi b/doc/filters.texi index bb486ea..5d49c5b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -4185,7 +4185,7 @@ drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg' @item Print the date of a real-time encoding (see strftime(3)): @example -drawtext='fontfile=FreeSans.ttf:text=%@{localtime:%a %b %d %Y@}' +drawtext='fontfile=FreeSans.ttf:text=%@{localtime\:%a %b %d %Y@}' @end example @item -- 2.1.0 Ping? -- Simon Thelen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel