[FFmpeg-devel] [PATCH] avfilter/split: support any channel count for asplit filter
Hi, patch attached. From eab0be0e21fe312bf40c6330e493d2d0e9fdff2b Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 5 Feb 2016 09:11:55 +0100 Subject: [PATCH] avfilter/split: support any channel count for asplit filter Signed-off-by: Paul B Mahol --- libavfilter/split.c | 28 1 file changed, 28 insertions(+) diff --git a/libavfilter/split.c b/libavfilter/split.c index 1e4fb42..0d0a96b 100644 --- a/libavfilter/split.c +++ b/libavfilter/split.c @@ -32,6 +32,7 @@ #include "avfilter.h" #include "audio.h" +#include "formats.h" #include "internal.h" #include "video.h" @@ -93,6 +94,32 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) return ret; } +static int asplit_query_formats(AVFilterContext *ctx) +{ +AVFilterChannelLayouts *in_layouts = NULL; +int i, ret; + +if ((ret = ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_AUDIO))) < 0 || +(ret = ff_set_common_samplerates(ctx, ff_all_samplerates())) < 0) +return ret; + +ret = AVERROR(ENOMEM); +if ((in_layouts = ff_all_channel_counts()) == NULL || +(ret = ff_channel_layouts_ref(in_layouts, &ctx->inputs[0]->out_channel_layouts)) < 0) +return ret; + +for (i = 0; i < ctx->nb_outputs; i++) { +AVFilterChannelLayouts *out_layouts = NULL; + +ret = AVERROR(ENOMEM); +if ((out_layouts = ff_all_channel_counts()) == NULL || +(ret = ff_channel_layouts_ref(out_layouts, &ctx->outputs[i]->in_channel_layouts)) < 0) +return ret; +} + +return 0; +} + #define OFFSET(x) offsetof(SplitContext, x) #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM static const AVOption options[] = { @@ -143,6 +170,7 @@ AVFilter ff_af_asplit = { .priv_class = &asplit_class, .init= split_init, .uninit = split_uninit, +.query_formats = asplit_query_formats, .inputs = avfilter_af_asplit_inputs, .outputs = NULL, .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS, -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/dcadsp: replace intptr_t with ptrdiff_t
On Sun, Jan 31, 2016 at 9:41 PM, James Almer wrote: > This is more consistent with the rest of the codebase > > Signed-off-by: James Almer > --- > libavcodec/dcadsp.c | 46 +++--- > libavcodec/dcadsp.h | 34 +- > 2 files changed, 40 insertions(+), 40 deletions(-) > > diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c > index cee3d60..787d7b8 100644 > --- a/libavcodec/dcadsp.c > +++ b/libavcodec/dcadsp.c > @@ -27,8 +27,8 @@ static void decode_hf_c(int32_t **dst, > const int32_t *vq_index, > const int8_t hf_vq[1024][32], > int32_t scale_factors[32][2], > -intptr_t sb_start, intptr_t sb_end, > -intptr_t ofs, intptr_t len) > +ptrdiff_t sb_start, ptrdiff_t sb_end, > +ptrdiff_t ofs, ptrdiff_t len) > { > int i, j; > > @@ -42,8 +42,8 @@ static void decode_hf_c(int32_t **dst, > > static void decode_joint_c(int32_t **dst, int32_t **src, > const int32_t *scale_factors, > - intptr_t sb_start, intptr_t sb_end, > - intptr_t ofs, intptr_t len) > + ptrdiff_t sb_start, ptrdiff_t sb_end, > + ptrdiff_t ofs, ptrdiff_t len) > { > int i, j; > > @@ -55,7 +55,7 @@ static void decode_joint_c(int32_t **dst, int32_t **src, > } > > static void lfe_fir_float_c(float *pcm_samples, int32_t *lfe_samples, > -const float *filter_coeff, intptr_t npcmblocks, > +const float *filter_coeff, ptrdiff_t npcmblocks, > int dec_select) > { > // Select decimation factor > @@ -85,19 +85,19 @@ static void lfe_fir_float_c(float *pcm_samples, int32_t > *lfe_samples, > } > > static void lfe_fir1_float_c(float *pcm_samples, int32_t *lfe_samples, > - const float *filter_coeff, intptr_t npcmblocks) > + const float *filter_coeff, ptrdiff_t npcmblocks) > { > lfe_fir_float_c(pcm_samples, lfe_samples, filter_coeff, npcmblocks, 0); > } > > static void lfe_fir2_float_c(float *pcm_samples, int32_t *lfe_samples, > - const float *filter_coeff, intptr_t npcmblocks) > + const float *filter_coeff, ptrdiff_t npcmblocks) > { > lfe_fir_float_c(pcm_samples, lfe_samples, filter_coeff, npcmblocks, 1); > } > > static void lfe_x96_float_c(float *dst, const float *src, > -float *hist, intptr_t len) > +float *hist, ptrdiff_t len) > { > float prev = *hist; > int i; > @@ -119,7 +119,7 @@ static void sub_qmf32_float_c(SynthFilterContext *synth, >int32_t **subband_samples_lo, >int32_t **subband_samples_hi, >float *hist1, int *offset, float *hist2, > - const float *filter_coeff, intptr_t npcmblocks, > + const float *filter_coeff, ptrdiff_t > npcmblocks, >float scale) > { > LOCAL_ALIGNED(32, float, input, [32]); > @@ -148,7 +148,7 @@ static void sub_qmf64_float_c(SynthFilterContext *synth, >int32_t **subband_samples_lo, >int32_t **subband_samples_hi, >float *hist1, int *offset, float *hist2, > - const float *filter_coeff, intptr_t npcmblocks, > + const float *filter_coeff, ptrdiff_t > npcmblocks, >float scale) > { > LOCAL_ALIGNED(32, float, input, [64]); > @@ -192,7 +192,7 @@ static void sub_qmf64_float_c(SynthFilterContext *synth, > } > > static void lfe_fir_fixed_c(int32_t *pcm_samples, int32_t *lfe_samples, > -const int32_t *filter_coeff, intptr_t npcmblocks) > +const int32_t *filter_coeff, ptrdiff_t > npcmblocks) > { > // Select decimation factor > int nlfesamples = npcmblocks >> 1; > @@ -219,7 +219,7 @@ static void lfe_fir_fixed_c(int32_t *pcm_samples, int32_t > *lfe_samples, > } > > static void lfe_x96_fixed_c(int32_t *dst, const int32_t *src, > -int32_t *hist, intptr_t len) > +int32_t *hist, ptrdiff_t len) > { > int32_t prev = *hist; > int i; > @@ -241,7 +241,7 @@ static void sub_qmf32_fixed_c(SynthFilterContext *synth, >int32_t **subband_samples_lo, >int32_t **subband_samples_hi, >int32_t *hist1, int *offset, int32_t *hist2, > - const int32_t *filter_coeff, intptr_t
Re: [FFmpeg-devel] [PATCH] avfilter/split: support any channel count for asplit filter
Paul B Mahol gmail.com> writes: > patch attached. Please add a reference to ticket #5218 to the commit message. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Problem decoding jpeg2000 video stream in mxf container -- file uploaded to upload.ffmpeg.org/incoming
Kanthan Pillay gmail.com> writes: > Tearing my hair out trying to decode the file “warehouse.mxf” You could try to use --disable-decoder=jpeg2000 --enable-libopenjpeg with latest libopenjpeg. (More complicated workarounds probably exist.) > The file is created by Maxx-2400HD video server from 360systems.com Thank you for the sample! Uploaded to http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket2817/ (Also related to other tickets.) Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 5/5] lavf/asfenc: add support for setting packet size
Marton Balint passwd.hu> writes: > On Thu, 4 Feb 2016, Carl Eugen Hoyos wrote: > > > Marton Balint passwd.hu> writes: > > > >> + item packet_size > >> +Set the muxer packet size. By tuning this setting you may reduce data > >> +fragmentation or muxer overhead depending on your source. > >> Default value is > >> +3200, minimum is 100, maximum is 64k. > > > > Is this related to ticket #4230? > > Well, it is, but this option only enables the user work around > the problem, proper fix would be to magically determine the > optimal packet size based on the source stream settings. Would it help to reduce the size for audio-only? Or is that not related? > Anyway, I can surely reference the ticket number in the > commit message, even if it is only a workaround. Please do! Thank you for the explanation, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] Fwd: Fwd: libavformat/segment : add option to increment timecode
2016-01-30 10:44 GMT+01:00 Stefano Sabatini : > On date Friday 2016-01-29 17:38:13 +0100, Martin Vignali encoded: > > 2016-01-29 12:35 GMT+01:00 Stefano Sabatini : > [...] > > > +AVDictionaryEntry * tcr = av_dict_get(s->metadata, "timecode", > > > NULL, 0); > > > > +if (tcr){ > > > > +if (s->nb_streams > 0){ > > > > > > > +rate = s->streams[0]->avg_frame_rate;//Get fps from > > > first stream > > > > > > this looks a bit arbitrary, why the first stream? > > > > > > > +err = av_timecode_init_from_string(&tc, rate, > > > tcr->value, s); > > > > +if (err < 0) > > > > +return err; > > > > > > > +tc.start += (int)(seg->time / 100.) * > > > av_q2d(rate);//second count * fps > > > > > > You're losing precision here. Consider using the rescaling utilities > > > in libavutil/mathematics.h or something like (seg->time * rate.num) / > > > (rate.den * 100). > [...] > > Thanks you for your comments, i will make the modifications. > > > > For the fps issue, you're right, i use the first stream because in my > tests > > it's always the video stream. > > Is there a better way, to get fps ? without choosing one of the stream ? > > My guess is that timecode is always related to a video stream, right? > > In this case you can loop through the streams and selects the first > video stream (check also the select_reference_stream() function in > segment.c). > > I follow your proposal, and search the first video stream, to take fps. In attach the new patch (and a documentation). Best regards Martin ping 0001-add-increment-timecode-option-using-segment-v2.patch Description: Binary data 0002-doc-for-increment_tc-in-segment.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter/split: support any channel count for asplit filter
Le septidi 17 pluviôse, an CCXXIV, Paul B Mahol a écrit : > From eab0be0e21fe312bf40c6330e493d2d0e9fdff2b Mon Sep 17 00:00:00 2001 > From: Paul B Mahol > Date: Fri, 5 Feb 2016 09:11:55 +0100 > Subject: [PATCH] avfilter/split: support any channel count for asplit filter > > Signed-off-by: Paul B Mahol > --- > libavfilter/split.c | 28 > 1 file changed, 28 insertions(+) > > diff --git a/libavfilter/split.c b/libavfilter/split.c > index 1e4fb42..0d0a96b 100644 > --- a/libavfilter/split.c > +++ b/libavfilter/split.c > @@ -32,6 +32,7 @@ > > #include "avfilter.h" > #include "audio.h" > +#include "formats.h" > #include "internal.h" > #include "video.h" > > @@ -93,6 +94,32 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > *frame) > return ret; > } > > +static int asplit_query_formats(AVFilterContext *ctx) > +{ > +AVFilterChannelLayouts *in_layouts = NULL; > +int i, ret; > + > +if ((ret = ff_set_common_formats(ctx, > ff_all_formats(AVMEDIA_TYPE_AUDIO))) < 0 || > +(ret = ff_set_common_samplerates(ctx, ff_all_samplerates())) < 0) > +return ret; > + > +ret = AVERROR(ENOMEM); > +if ((in_layouts = ff_all_channel_counts()) == NULL || > +(ret = ff_channel_layouts_ref(in_layouts, > &ctx->inputs[0]->out_channel_layouts)) < 0) > +return ret; > + > +for (i = 0; i < ctx->nb_outputs; i++) { > +AVFilterChannelLayouts *out_layouts = NULL; > + > +ret = AVERROR(ENOMEM); > +if ((out_layouts = ff_all_channel_counts()) == NULL || > +(ret = ff_channel_layouts_ref(out_layouts, > &ctx->outputs[i]->in_channel_layouts)) < 0) > +return ret; > +} This look strange. Why do you set a different channel layout on input and all outputs? The way asplit works, the layout need to be the same on input and all outputs, since it's the same frames. Or did I miss something? > + > +return 0; > +} > + > #define OFFSET(x) offsetof(SplitContext, x) > #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM > static const AVOption options[] = { > @@ -143,6 +170,7 @@ AVFilter ff_af_asplit = { > .priv_class = &asplit_class, > .init= split_init, > .uninit = split_uninit, > +.query_formats = asplit_query_formats, > .inputs = avfilter_af_asplit_inputs, > .outputs = NULL, > .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS, Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/mov: Extend extracting XMP in mov files using UUID Box
On 2/4/2016 11:28 PM, Thierry Foucu wrote: > The UUID is based on http://www.adobe.com/devnet/xmp.html > > The patch is made according to XMP SPECIFICATION PART 3 - STORAGE IN > FILES See Table 8 > --- > libavformat/mov.c | 28 > 1 file changed, 28 insertions(+) [...] > if (atom.size < sizeof(uuid) || atom.size == INT64_MAX) > return AVERROR_INVALIDDATA; > @@ -3949,6 +3953,30 @@ static int mov_read_uuid(MOVContext *c, AVIOContext > *pb, MOVAtom atom) > } > > av_free(buffer); > +} else if (!memcmp(uuid, uuid_xmp, sizeof(uuid_xmp))) { NIT: Just for consistency, this could be sizeof(uuid). > +uint8_t *buffer; > +size_t len = atom.size - sizeof(uuid_xmp); Ditto. > + > +if (len < 4) { > +return AVERROR_INVALIDDATA; > +} I'm not sure what this check is for. For uuid boxes with ISML metadata, there are 4 bytes of zeroes here, but there's no such thing for XMP, as far as I know (it's XML). > +buffer = av_mallocz(len + 1); I assume the +1 is for a NULL terminator for the XML string, but I do not see it set before exporting as metadata. I'm not sure if XMP packets are required to contain a NULL terminator or not (if so, it should be checked). - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mp3enc: Assert that the header we assembled is valid
On 2/3/2016 11:20 PM, Michael Niedermayer wrote: > +ret = avpriv_mpegaudio_decode_header(&mpah, header); > +av_assert0(ret >= 0); Why is this an assert and not an normal check? - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/dcadsp: replace intptr_t with ptrdiff_t
On 2/5/2016 5:30 AM, Hendrik Leppkes wrote: > On Sun, Jan 31, 2016 at 9:41 PM, James Almer wrote: >> @@ -67,23 +67,23 @@ typedef struct DCADSPContext { >> int32_t **subband_samples_lo, >> int32_t **subband_samples_hi, >> int32_t *hist1, int *offset, int32_t *hist2, >> - const int32_t *filter_coeff, intptr_t >> npcmblocks); >> + const int32_t *filter_coeff, ptrdiff_t >> npcmblocks); >> >> -void (*decor)(int32_t *dst, const int32_t *src, intptr_t coeff, >> intptr_t len); >> +void (*decor)(int32_t *dst, const int32_t *src, ptrdiff_t coeff, >> ptrdiff_t len); >> >> void (*dmix_sub_xch)(int32_t *dst1, int32_t *dst2, >> - const int32_t *src, intptr_t len); >> + const int32_t *src, ptrdiff_t len); >> >> -void (*dmix_sub)(int32_t *dst, const int32_t *src, intptr_t coeff, >> intptr_t len); >> +void (*dmix_sub)(int32_t *dst, const int32_t *src, ptrdiff_t coeff, >> ptrdiff_t len); >> >> -void (*dmix_add)(int32_t *dst, const int32_t *src, intptr_t coeff, >> intptr_t len); >> +void (*dmix_add)(int32_t *dst, const int32_t *src, ptrdiff_t coeff, >> ptrdiff_t len); > > coeff in decor and dmix_sub/add works similar to scale in dmix_scale, > any reason it was kept as ptrdiff_t here, and converted to int below? I resent this patch fixing it. You are replying to the old one :p > >> >> -void (*dmix_scale)(int32_t *dst, intptr_t scale, intptr_t len); >> +void (*dmix_scale)(int32_t *dst, int scale, ptrdiff_t len); >> >> -void (*dmix_scale_inv)(int32_t *dst, intptr_t scale_inv, intptr_t len); >> +void (*dmix_scale_inv)(int32_t *dst, int scale_inv, ptrdiff_t len); >> >> void (*assemble_freq_bands)(int32_t *dst, int32_t *src0, int32_t *src1, >> -const int32_t *coeff, intptr_t len); >> +const int32_t *coeff, ptrdiff_t len); >> } DCADSPContext; >> >> av_cold void ff_dcadsp_init(DCADSPContext *s); > > The others look fine, its mostly size constraints which we like to > pass as ptrdiff_t to avoid zero extending them in asm. > > - Hendrik Pushed the amended patch where the above was fixed, thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mp3enc: Assert that the header we assembled is valid
On Fri, Feb 05, 2016 at 02:05:57PM +, Derek Buitenhuis wrote: > On 2/3/2016 11:20 PM, Michael Niedermayer wrote: > > +ret = avpriv_mpegaudio_decode_header(&mpah, header); > > +av_assert0(ret >= 0); > > Why is this an assert and not an normal check? because the code builds the header a few lines above, i assume the header we just build is correct [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mp3enc: Assert that the header we assembled is valid
On 2/5/2016 2:19 PM, Michael Niedermayer wrote: > because the code builds the header a few lines above, i assume > the header we just build is correct Perhaps you could elaborate what CID1351343 is then, in the commit messages. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mp3enc: Assert that the header we assembled is valid
On Fri, Feb 5, 2016 at 3:33 PM, Derek Buitenhuis wrote: > On 2/5/2016 2:19 PM, Michael Niedermayer wrote: >> because the code builds the header a few lines above, i assume >> the header we just build is correct > > Perhaps you could elaborate what CID1351343 is then, in the commit > messages. > A Coverity ID, a false positive which we decide to "fix" with an assertion instead of marking it as such in the tool? - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avfilter: add conditional filter
Hi, patch attached. From 07e5e6ef03dc4c5705fe2b76859d8aa9caaaf518 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 5 Feb 2016 12:54:06 +0100 Subject: [PATCH] avfilter: add conditional filter Signed-off-by: Paul B Mahol --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_conditional.c | 375 +++ 3 files changed, 377 insertions(+) create mode 100644 libavfilter/vf_conditional.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index e76d18e..8ffd693 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -123,6 +123,7 @@ OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o OBJS-$(CONFIG_COLORKEY_FILTER) += vf_colorkey.o OBJS-$(CONFIG_COLORLEVELS_FILTER)+= vf_colorlevels.o OBJS-$(CONFIG_COLORMATRIX_FILTER)+= vf_colormatrix.o +OBJS-$(CONFIG_CONDITIONAL_FILTER)+= vf_conditional.o OBJS-$(CONFIG_CONVOLUTION_FILTER)+= vf_convolution.o OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o OBJS-$(CONFIG_COVER_RECT_FILTER) += vf_cover_rect.o lavfutils.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 27d54bc..d4d37c9 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -144,6 +144,7 @@ void avfilter_register_all(void) REGISTER_FILTER(COLORKEY, colorkey, vf); REGISTER_FILTER(COLORLEVELS,colorlevels,vf); REGISTER_FILTER(COLORMATRIX,colormatrix,vf); +REGISTER_FILTER(CONDITIONAL,conditional,vf); REGISTER_FILTER(CONVOLUTION,convolution,vf); REGISTER_FILTER(COPY, copy, vf); REGISTER_FILTER(COVER_RECT, cover_rect, vf); diff --git a/libavfilter/vf_conditional.c b/libavfilter/vf_conditional.c new file mode 100644 index 000..e93ba4c --- /dev/null +++ b/libavfilter/vf_conditional.c @@ -0,0 +1,375 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * conditional video filter + */ + +#include "libavutil/attributes.h" +#include "libavutil/avstring.h" +#include "libavutil/avassert.h" +#include "libavutil/eval.h" +#include "libavutil/opt.h" +#include "libavutil/imgutils.h" +#include "libavutil/internal.h" +#include "libavutil/time.h" +#include "libavutil/timestamp.h" +#include "libavformat/avformat.h" +#include "audio.h" +#include "avfilter.h" +#include "buffersink.h" +#include "buffersrc.h" +#include "formats.h" +#include "internal.h" +#include "video.h" + +static const char *const var_names[] = { +"FRAME_RATE", ///< defined only for constant frame-rate video +"INTERLACED", ///< tell if the current frame is interlaced +"N_IN",///< number of consumed frame, starting at zero +"N_OUT", ///< number of returned frame, starting at zero +"POS", ///< original position in the file of the frame +"PTS", ///< original pts in the file of the frame +"STARTPTS",///< PTS at start of movie +"STARTT", ///< time at start of movie +"T", ///< original time in the file of the frame +"TB", ///< timebase +"RTCTIME", +"RTCSTART", +NULL +}; + +enum var_name { +VAR_FRAME_RATE, +VAR_INTERLACED, +VAR_N_IN, +VAR_N_OUT, +VAR_POS, +VAR_PTS, +VAR_STARTPTS, +VAR_STARTT, +VAR_T, +VAR_TB, +VAR_RTCTIME, +VAR_RTCSTART, +VAR_VARS_NB +}; + +typedef struct ConditionalContext { +const AVClass *class; + +char *expr; +char *filter_name[2]; +char *options[2]; + +AVExpr *e; +int cg; +double var_values[VAR_VARS_NB]; + +AVFilterContext *sink[2]; +AVFilterContext *src[2]; +AVFilterContext *filter[2]; +AVFilterGraph *graph[2]; +} ConditionalContext; + +#define OFFSET(x) offsetof(ConditionalContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption conditional_options[]= { +{ "expr", "specify the expression",OFFSET(expr), AV_OPT_TYPE_STRING, {.str = "1"}, .flags = FLAGS }, +{ "tf","specify filter to call if expression is true", OFFSET(filter_name[0]), AV_OPT_TYPE_STRING, {.str = "null" }
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On Fri, Feb 05, 2016 at 03:29:36AM +0100, Mats Peterson wrote: > On 02/05/2016 03:04 AM, Mats Peterson wrote: > >Yes, it could (regarding stride being zero). Here's an updated patch. > > > If you think it's extremely important to use monow for the case of > raw 1 bpp AVI without a palette, I can remove the "Temporary > solution" comments. But remember this will only be for AVI. patch applied, but i think theres more that needs fixing than pal8 in nut. Most important is that the code which chooses the pixel format for encoding end up choosing monowhite if the inut is PAL8 with 2 matching colors. Then decoders could output PAL8 but encoders would receve monow if they support it and no changes would be needed per codec [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Rewriting code that is poorly written but fully understood is good. Rewriting code that one doesnt understand is a sign that one is less smart then the original author, trying to rewrite it will not make it better. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mp3enc: Assert that the header we assembled is valid
On Fri, Feb 05, 2016 at 03:34:48PM +0100, Hendrik Leppkes wrote: > On Fri, Feb 5, 2016 at 3:33 PM, Derek Buitenhuis > wrote: > > On 2/5/2016 2:19 PM, Michael Niedermayer wrote: > >> because the code builds the header a few lines above, i assume > >> the header we just build is correct > > > > Perhaps you could elaborate what CID1351343 is then, in the commit > > messages. > > > > A Coverity ID, a false positive which we decide to "fix" with an > assertion instead of marking it as such in the tool? yes, i think its more robust if we assert that the header is valid /the return code is ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter: add conditional filter
On 2/5/16, Paul B Mahol wrote: > Hi, > > patch attached. > Improved version attached. From 985c54d508e2e086ddd72e8c6545a7209a771983 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 5 Feb 2016 12:54:06 +0100 Subject: [PATCH] avfilter: add conditional filter Signed-off-by: Paul B Mahol --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_conditional.c | 408 +++ 3 files changed, 410 insertions(+) create mode 100644 libavfilter/vf_conditional.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index e76d18e..8ffd693 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -123,6 +123,7 @@ OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o OBJS-$(CONFIG_COLORKEY_FILTER) += vf_colorkey.o OBJS-$(CONFIG_COLORLEVELS_FILTER)+= vf_colorlevels.o OBJS-$(CONFIG_COLORMATRIX_FILTER)+= vf_colormatrix.o +OBJS-$(CONFIG_CONDITIONAL_FILTER)+= vf_conditional.o OBJS-$(CONFIG_CONVOLUTION_FILTER)+= vf_convolution.o OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o OBJS-$(CONFIG_COVER_RECT_FILTER) += vf_cover_rect.o lavfutils.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 27d54bc..d4d37c9 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -144,6 +144,7 @@ void avfilter_register_all(void) REGISTER_FILTER(COLORKEY, colorkey, vf); REGISTER_FILTER(COLORLEVELS,colorlevels,vf); REGISTER_FILTER(COLORMATRIX,colormatrix,vf); +REGISTER_FILTER(CONDITIONAL,conditional,vf); REGISTER_FILTER(CONVOLUTION,convolution,vf); REGISTER_FILTER(COPY, copy, vf); REGISTER_FILTER(COVER_RECT, cover_rect, vf); diff --git a/libavfilter/vf_conditional.c b/libavfilter/vf_conditional.c new file mode 100644 index 000..7eacde4 --- /dev/null +++ b/libavfilter/vf_conditional.c @@ -0,0 +1,408 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * conditional video filter + */ + +#include "libavutil/attributes.h" +#include "libavutil/avstring.h" +#include "libavutil/avassert.h" +#include "libavutil/eval.h" +#include "libavutil/opt.h" +#include "libavutil/imgutils.h" +#include "libavutil/internal.h" +#include "libavutil/time.h" +#include "libavutil/timestamp.h" +#include "libavformat/avformat.h" +#include "audio.h" +#include "avfilter.h" +#include "buffersink.h" +#include "buffersrc.h" +#include "formats.h" +#include "internal.h" +#include "video.h" + +static const char *const var_names[] = { +"FRAME_RATE", ///< defined only for constant frame-rate video +"INTERLACED", ///< tell if the current frame is interlaced +"N_IN",///< number of consumed frame, starting at zero +"N_OUT", ///< number of returned frame, starting at zero +"POS", ///< original position in the file of the frame +"PTS", ///< original pts in the file of the frame +"STARTPTS",///< PTS at start of movie +"STARTT", ///< time at start of movie +"T", ///< original time in the file of the frame +"TB", ///< timebase +"RTCTIME", +"RTCSTART", +NULL +}; + +enum var_name { +VAR_FRAME_RATE, +VAR_INTERLACED, +VAR_N_IN, +VAR_N_OUT, +VAR_POS, +VAR_PTS, +VAR_STARTPTS, +VAR_STARTT, +VAR_T, +VAR_TB, +VAR_RTCTIME, +VAR_RTCSTART, +VAR_VARS_NB +}; + +typedef struct ConditionalContext { +const AVClass *class; + +char *expr; +char *filter_name[2]; +char *options[2]; + +AVExpr *e; +int cg; +double var_values[VAR_VARS_NB]; + +AVFilterContext *sink[2]; +AVFilterContext *src[2]; +AVFilterContext *filter[2]; +AVFilterContext *format[2]; +AVFilterGraph *graph[2]; +} ConditionalContext; + +#define OFFSET(x) offsetof(ConditionalContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption conditional_options[]= { +{ "expr", "specify the expression",OFFSET(expr), AV_OPT_TYPE_STRING, {.str = "1"}, .flags = FLAGS }, +{ "tf","specify
Re: [FFmpeg-devel] [PATCH] avformat/mp3enc: Assert that the header we assembled is valid
Hi, On Fri, Feb 5, 2016 at 9:34 AM, Hendrik Leppkes wrote: > On Fri, Feb 5, 2016 at 3:33 PM, Derek Buitenhuis > wrote: > > On 2/5/2016 2:19 PM, Michael Niedermayer wrote: > >> because the code builds the header a few lines above, i assume > >> the header we just build is correct > > > > Perhaps you could elaborate what CID1351343 is then, in the commit > > messages. > > > > A Coverity ID, a false positive which we decide to "fix" with an > assertion instead of marking it as such in the tool? So, I don't mind the patch, that's fine. But the commit message is misleading. It suggests that there's a bug and that this patch fixes the bug. That's incorrect. There is no bug, and this patch does not fix anything. It asserts something, and as asserts go, they don't fix anything, they just assert (=confirm) expected behaviour. So, can we change the commit message to not include the word "fix" or any other misleading derivative thereof? Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 04:52 PM, Mats Peterson wrote: patch applied, but i think theres more that needs fixing than pal8 in nut. Most important is that the code which chooses the pixel format for encoding end up choosing monowhite if the inut is PAL8 with 2 matching colors. Then decoders could output PAL8 but encoders would receve monow if they support it and no changes would be needed per codec I don't agree that monowhite should be used at all for palettized formats like AVI and QuickTime. This is the umpteenth time I say this. You don't seem to care about 2- or 4-bit files being converted to pal8, so what's the big deal with 1-bit files? And don't give me the "file explosion" thing again. Furthermore, everything else that concerns palettized 1 bpp data in FFmpeg (QuickTime raw/RLE and BMP) is currently (correctly) converted to pal8 Mats For formats like TIFF or nut B1W0/B0W1 which use BLACK & WHITE EXPLICITLY, monowhite or monoblack is justified, otherwise not. Mats ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 03:43 PM, Michael Niedermayer wrote: On Fri, Feb 05, 2016 at 03:29:36AM +0100, Mats Peterson wrote: On 02/05/2016 03:04 AM, Mats Peterson wrote: Yes, it could (regarding stride being zero). Here's an updated patch. If you think it's extremely important to use monow for the case of raw 1 bpp AVI without a palette, I can remove the "Temporary solution" comments. But remember this will only be for AVI. patch applied, but i think theres more that needs fixing than pal8 in nut. Most important is that the code which chooses the pixel format for encoding end up choosing monowhite if the inut is PAL8 with 2 matching colors. Then decoders could output PAL8 but encoders would receve monow if they support it and no changes would be needed per codec I don't agree that monowhite should be used at all for palettized formats like AVI and QuickTime. This is the umpteenth time I say this. You don't seem to care about 2- or 4-bit files being converted to pal8, so what's the big deal with 1-bit files? And don't give me the "file explosion" thing again. Furthermore, everything else that concerns palettized 1 bpp data in FFmpeg (QuickTime raw/RLE and BMP) is currently (correctly) converted to pal8 Mats ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 04:54 PM, Mats Peterson wrote: On 02/05/2016 04:52 PM, Mats Peterson wrote: patch applied, but i think theres more that needs fixing than pal8 in nut. Most important is that the code which chooses the pixel format for encoding end up choosing monowhite if the inut is PAL8 with 2 matching colors. Then decoders could output PAL8 but encoders would receve monow if they support it and no changes would be needed per codec Alright, you were focusing on encoders here, yes, they aren't handled here of course. I've only changed stuff to use pal8 correctly internally on the *decoder* side for every codec. They should really be the ones who fix, you're right. Mats ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 04:58 PM, Mats Peterson wrote: Alright, you were focusing on encoders here, yes, they aren't handled here of course. I've only changed stuff to use pal8 correctly internally on the *decoder* side for every codec. They should really be the ones who fix, you're right. The ones to fix, rather. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 04:58 PM, Mats Peterson wrote: Alright, you were focusing on encoders here, yes, they aren't handled here of course. I've only changed stuff to use pal8 correctly internally on the *decoder* side for every codec. They should really be the ones who fix, you're right. Mats THE ENCODERS SHOULD BE THE ONES TO FIX. Hope I'm clear enough now. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 05:00 PM, Mats Peterson wrote: On 02/05/2016 04:58 PM, Mats Peterson wrote: Alright, you were focusing on encoders here, yes, they aren't handled here of course. I've only changed stuff to use pal8 correctly internally on the *decoder* side for every codec. They should really be the ones who fix, you're right. Mats THE ENCODERS SHOULD BE THE ONES TO FIX. Hope I'm clear enough now. And ideally, for example, the AVI muxer could use 1 bpp format if the palette only contains 2 colors in spite of being pal8, and it should put a 2-color palette in the output file, etc. A lot of work, which is most probably not justified, since one can always force the pixel format for the output file on the command line. The lack of palette when writing AVI files has to get fixed at some point though, regardless. Mats ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 05:04 PM, Mats Peterson wrote: THE ENCODERS SHOULD BE THE ONES TO FIX. Hope I'm clear enough now. And ideally, for example, the AVI muxer could use 1 bpp format if the palette only contains 2 colors in spite of being pal8, and it should put a 2-color palette in the output file, etc. A lot of work, which is most probably not justified, since one can always force the pixel format for the output file on the command line. The lack of palette when writing AVI files has to get fixed at some point though, regardless. Mats A better way would of course be to peek at the BITMAPINFOHEADER or video sample description of the input file to determine how many bits per pixel it uses, and match that in the output file, rather than trying to guess from the number of colors in the palette. Anyway, this is a lot of work, and to me it's rather superfluous, since one can always force the pixel format on the command line once again. Mats ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 05:18 PM, Mats Peterson wrote: A better way would of course be to peek at the BITMAPINFOHEADER or video sample description of the input file to determine how many bits per pixel it uses, and match that in the output file, rather than trying to guess from the number of colors in the palette. Anyway, this is a lot of work, and to me it's rather superfluous, since one can always force the pixel format on the command line once again. Mats One can't force 2 or 4 bpp, of cousre, so it's not possible to match 2 and 4 bpp input files exactly in the output. Then it's better to use -vcodec copy (which currently works badly with nut, as I mentioned before). ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v3] lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
On 02/05/2016 05:20 PM, Mats Peterson wrote: One can't force 2 or 4 bpp, of cousre, so it's not possible to match 2 and 4 bpp input files exactly in the output. Then it's better to use -vcodec copy (which currently works badly with nut, as I mentioned before). And it works badly with AVI as well, since AVI doesn't write the palette in the output file. But that's not my fault. Mats ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Replacing fate.f.o with fatebeta
On Thu, Feb 4, 2016 at 7:27 PM Timothy Gu wrote: > On Fri, Feb 05, 2016 at 02:58:14AM +0100, Michael Niedermayer wrote: > > On Thu, Feb 04, 2016 at 05:10:16PM -0800, Timothy Gu wrote: > > > As of now, the "top bar" James mentioned has been added, so fatebeta > has full > > > feature parity with the old FATE website. > > > > does fatebeta support the frontpage dropdown lists of failed tests? > > (see attached image) > > Oh right, that I forgot. I'll get it done tomorrow or over the weekend. > Done. Now it **really** has feature parity. Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] avcodec/dcadsp: rename lfe_fir_float functions
Cosmetic change. Signed-off-by: James Almer --- libavcodec/dcadsp.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c index 787d7b8..6acfe0b 100644 --- a/libavcodec/dcadsp.c +++ b/libavcodec/dcadsp.c @@ -84,13 +84,13 @@ static void lfe_fir_float_c(float *pcm_samples, int32_t *lfe_samples, } } -static void lfe_fir1_float_c(float *pcm_samples, int32_t *lfe_samples, +static void lfe_fir0_float_c(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks) { lfe_fir_float_c(pcm_samples, lfe_samples, filter_coeff, npcmblocks, 0); } -static void lfe_fir2_float_c(float *pcm_samples, int32_t *lfe_samples, +static void lfe_fir1_float_c(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks) { lfe_fir_float_c(pcm_samples, lfe_samples, filter_coeff, npcmblocks, 1); @@ -390,8 +390,8 @@ av_cold void ff_dcadsp_init(DCADSPContext *s) s->decode_hf = decode_hf_c; s->decode_joint = decode_joint_c; -s->lfe_fir_float[0] = lfe_fir1_float_c; -s->lfe_fir_float[1] = lfe_fir2_float_c; +s->lfe_fir_float[0] = lfe_fir0_float_c; +s->lfe_fir_float[1] = lfe_fir1_float_c; s->lfe_x96_float= lfe_x96_float_c; s->sub_qmf_float[0] = sub_qmf32_float_c; s->sub_qmf_float[1] = sub_qmf64_float_c; -- 2.7.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] x86/dcadec: add ff_lfe_fir0_float_{sse, sse2, avx, fma3}
Up to ~4 times faster on x86_64, ~8 times on x86_32 if compiling using x87 fp math. Signed-off-by: James Almer --- libavcodec/dcadsp.c | 3 + libavcodec/dcadsp.h | 1 + libavcodec/x86/Makefile | 4 +- libavcodec/x86/dcadsp.asm| 196 +++ libavcodec/x86/dcadsp_init.c | 45 ++ 5 files changed, 247 insertions(+), 2 deletions(-) create mode 100644 libavcodec/x86/dcadsp.asm create mode 100644 libavcodec/x86/dcadsp_init.c diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c index 6acfe0b..09faee5 100644 --- a/libavcodec/dcadsp.c +++ b/libavcodec/dcadsp.c @@ -410,4 +410,7 @@ av_cold void ff_dcadsp_init(DCADSPContext *s) s->dmix_scale_inv = dmix_scale_inv_c; s->assemble_freq_bands = assemble_freq_bands_c; + +if (ARCH_X86) +ff_dcadsp_init_x86(s); } diff --git a/libavcodec/dcadsp.h b/libavcodec/dcadsp.h index f594abf..c82b7b1 100644 --- a/libavcodec/dcadsp.h +++ b/libavcodec/dcadsp.h @@ -87,5 +87,6 @@ typedef struct DCADSPContext { } DCADSPContext; av_cold void ff_dcadsp_init(DCADSPContext *s); +av_cold void ff_dcadsp_init_x86(DCADSPContext *s); #endif diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index ce06b90..7f53b73 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -44,7 +44,7 @@ OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp_init.o OBJS-$(CONFIG_ALAC_DECODER)+= x86/alacdsp_init.o OBJS-$(CONFIG_APNG_DECODER)+= x86/pngdsp_init.o OBJS-$(CONFIG_CAVS_DECODER)+= x86/cavsdsp.o -OBJS-$(CONFIG_DCA_DECODER) += x86/synth_filter_init.o +OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp_init.o x86/synth_filter_init.o OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc_init.o OBJS-$(CONFIG_HEVC_DECODER)+= x86/hevcdsp_init.o OBJS-$(CONFIG_JPEG2000_DECODER)+= x86/jpeg2000dsp_init.o @@ -132,7 +132,7 @@ YASM-OBJS-$(CONFIG_ADPCM_G722_DECODER) += x86/g722dsp.o YASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o YASM-OBJS-$(CONFIG_ALAC_DECODER) += x86/alacdsp.o YASM-OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp.o -YASM-OBJS-$(CONFIG_DCA_DECODER)+= x86/synth_filter.o +YASM-OBJS-$(CONFIG_DCA_DECODER)+= x86/dcadsp.o x86/synth_filter.o YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o \ x86/dwt_yasm.o YASM-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o diff --git a/libavcodec/x86/dcadsp.asm b/libavcodec/x86/dcadsp.asm new file mode 100644 index 000..4fea168 --- /dev/null +++ b/libavcodec/x86/dcadsp.asm @@ -0,0 +1,196 @@ +;** +;* SIMD-optimized functions for the DCA decoder +;* Copyright (C) 2016 James Almer +;* +;* This file is part of FFmpeg. +;* +;* FFmpeg is free software; you can redistribute it and/or +;* modify it under the terms of the GNU Lesser General Public +;* License as published by the Free Software Foundation; either +;* version 2.1 of the License, or (at your option) any later version. +;* +;* FFmpeg is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;* Lesser General Public License for more details. +;* +;* You should have received a copy of the GNU Lesser General Public +;* License along with FFmpeg; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;** + +%include "libavutil/x86/x86util.asm" + +SECTION .text + +%define sizeof_float 4 +%define FMA3_OFFSET (8 * cpuflag(fma3) * ARCH_X86_64) + +%if ARCH_X86_32 +%define m8 m0 +%define m9 m1 +%define m10 m2 +%define m11 m3 +%endif + +%macro LFE_FIR0_FLOAT 0 +cglobal lfe_fir0_float, 4, 6, 12 + cpuflag(fma3)*4, samples, lfe, coeff, nblocks, cnt1, cnt2 +shr nblocksd, 1 +sub lfeq, 7*sizeof_float +movcnt1d, 32*sizeof_float +movcnt2d, 32*sizeof_float-8-FMA3_OFFSET +lea coeffq, [coeffq+cnt1q*8] +add samplesq, cnt1q +negcnt1q + +.loop: +%if cpuflag(avx) +cvtdq2ps m4, [lfeq+16] +cvtdq2ps m5, [lfeq ] +shufpsm7, m4, m4, q0123 +shufpsm6, m5, m5, q0123 +%elif cpuflag(sse2) +movu m4, [lfeq+16] +movu m5, [lfeq ] +cvtdq2ps m4, m4 +cvtdq2ps m5, m5 +pshufdm7, m4, q0123 +pshufdm6, m5, q0123 +%else +cvtpi2ps m4, [lfeq+16] +cvtpi2ps m0, [lfeq+24] +cvtpi2ps m5, [lfeq ] +cvtpi2ps m1, [lfeq+8 ] +shufpsm4, m0, q1010 +shufpsm5, m1, q1010 +shufpsm7, m4, m4, q0123 +shufpsm6, m5, m5, q0123 +%endif + +.inner_loop: +%if ARCH_X86_64 +movapsm8, [coeffq+cnt1q*8 ] +movapsm9, [coeffq+cnt1q*8+16] +movaps
Re: [FFmpeg-devel] [PATCH 2/2] x86/dcadec: add ff_lfe_fir0_float_{sse, sse2, avx, fma3}
On 2/5/16, James Almer wrote: > Up to ~4 times faster on x86_64, ~8 times on x86_32 if compiling using x87 > fp math. Nice! ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] x86/dcadec: add ff_lfe_fir0_float_{sse, sse2, avx, fma3}
On Fri, Feb 5, 2016 at 6:29 PM, James Almer wrote: > Up to ~4 times faster on x86_64, ~8 times on x86_32 if compiling using x87 fp > math. > > Signed-off-by: James Almer Nice numbers! Any overall impact ideas? - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] x86/dcadec: add ff_lfe_fir0_float_{sse, sse2, avx, fma3}
On 2/5/2016 3:57 PM, Hendrik Leppkes wrote: > On Fri, Feb 5, 2016 at 6:29 PM, James Almer wrote: >> Up to ~4 times faster on x86_64, ~8 times on x86_32 if compiling using x87 >> fp math. >> >> Signed-off-by: James Almer > > Nice numbers! Any overall impact ideas? Not much, apparently. With a 10 minute long sample perf on x86_64 said lfe_fir0_float_c was about 3% of overall cputime. > - Hendrik > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] x86/dcadec: add ff_lfe_fir0_float_{sse, sse2, avx, fma3}
Up to ~4 times faster on x86_64, ~8 times on x86_32 if compiling using x87 fp math. Signed-off-by: James Almer --- libavcodec/dcadsp.c | 3 + libavcodec/dcadsp.h | 1 + libavcodec/x86/Makefile | 4 +- libavcodec/x86/dcadsp.asm| 199 +++ libavcodec/x86/dcadsp_init.c | 45 ++ 5 files changed, 250 insertions(+), 2 deletions(-) create mode 100644 libavcodec/x86/dcadsp.asm create mode 100644 libavcodec/x86/dcadsp_init.c diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c index 6acfe0b..09faee5 100644 --- a/libavcodec/dcadsp.c +++ b/libavcodec/dcadsp.c @@ -410,4 +410,7 @@ av_cold void ff_dcadsp_init(DCADSPContext *s) s->dmix_scale_inv = dmix_scale_inv_c; s->assemble_freq_bands = assemble_freq_bands_c; + +if (ARCH_X86) +ff_dcadsp_init_x86(s); } diff --git a/libavcodec/dcadsp.h b/libavcodec/dcadsp.h index f594abf..c82b7b1 100644 --- a/libavcodec/dcadsp.h +++ b/libavcodec/dcadsp.h @@ -87,5 +87,6 @@ typedef struct DCADSPContext { } DCADSPContext; av_cold void ff_dcadsp_init(DCADSPContext *s); +av_cold void ff_dcadsp_init_x86(DCADSPContext *s); #endif diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index ce06b90..7f53b73 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -44,7 +44,7 @@ OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp_init.o OBJS-$(CONFIG_ALAC_DECODER)+= x86/alacdsp_init.o OBJS-$(CONFIG_APNG_DECODER)+= x86/pngdsp_init.o OBJS-$(CONFIG_CAVS_DECODER)+= x86/cavsdsp.o -OBJS-$(CONFIG_DCA_DECODER) += x86/synth_filter_init.o +OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp_init.o x86/synth_filter_init.o OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc_init.o OBJS-$(CONFIG_HEVC_DECODER)+= x86/hevcdsp_init.o OBJS-$(CONFIG_JPEG2000_DECODER)+= x86/jpeg2000dsp_init.o @@ -132,7 +132,7 @@ YASM-OBJS-$(CONFIG_ADPCM_G722_DECODER) += x86/g722dsp.o YASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o YASM-OBJS-$(CONFIG_ALAC_DECODER) += x86/alacdsp.o YASM-OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp.o -YASM-OBJS-$(CONFIG_DCA_DECODER)+= x86/synth_filter.o +YASM-OBJS-$(CONFIG_DCA_DECODER)+= x86/dcadsp.o x86/synth_filter.o YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o \ x86/dwt_yasm.o YASM-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o diff --git a/libavcodec/x86/dcadsp.asm b/libavcodec/x86/dcadsp.asm new file mode 100644 index 000..7036e48 --- /dev/null +++ b/libavcodec/x86/dcadsp.asm @@ -0,0 +1,199 @@ +;** +;* SIMD-optimized functions for the DCA decoder +;* Copyright (C) 2016 James Almer +;* +;* This file is part of FFmpeg. +;* +;* FFmpeg is free software; you can redistribute it and/or +;* modify it under the terms of the GNU Lesser General Public +;* License as published by the Free Software Foundation; either +;* version 2.1 of the License, or (at your option) any later version. +;* +;* FFmpeg is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;* Lesser General Public License for more details. +;* +;* You should have received a copy of the GNU Lesser General Public +;* License along with FFmpeg; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;** + +%include "libavutil/x86/x86util.asm" + +SECTION .text + +%define sizeof_float 4 +%define FMA3_OFFSET (8 * cpuflag(fma3) * ARCH_X86_64) + +%macro LFE_FIR0_FLOAT 0 +cglobal lfe_fir0_float, 4, 6, 12 + cpuflag(fma3)*4, samples, lfe, coeff, nblocks, cnt1, cnt2 +shr nblocksd, 1 +sub lfeq, 7*sizeof_float +movcnt1d, 32*sizeof_float +movcnt2d, 32*sizeof_float-8-FMA3_OFFSET +lea coeffq, [coeffq+cnt1q*8] +add samplesq, cnt1q +negcnt1q + +.loop: +%if cpuflag(avx) +cvtdq2ps m4, [lfeq+16] +cvtdq2ps m5, [lfeq ] +shufpsm7, m4, m4, q0123 +shufpsm6, m5, m5, q0123 +%elif cpuflag(sse2) +movu m4, [lfeq+16] +movu m5, [lfeq ] +cvtdq2ps m4, m4 +cvtdq2ps m5, m5 +pshufdm7, m4, q0123 +pshufdm6, m5, q0123 +%else +cvtpi2ps m4, [lfeq+16] +cvtpi2ps m0, [lfeq+24] +cvtpi2ps m5, [lfeq ] +cvtpi2ps m1, [lfeq+8 ] +shufpsm4, m0, q1010 +shufpsm5, m1, q1010 +shufpsm7, m4, m4, q0123 +shufpsm6, m5, m5, q0123 +%endif + +.inner_loop: +%if ARCH_X86_64 +movapsm8, [coeffq+cnt1q*8 ] +movapsm9, [coeffq+cnt1q*8+16] +movaps m10, [coeffq+cnt1q*8+32] +movaps m11, [coeffq+cnt1q*8+48] +%if cpuflag(fma3) +mov
[FFmpeg-devel] [PATCH] cmdutils: realign for some additional filters with very long name
Hi, patch attached. From a928c1769d858cb778681b9cdc4933b86dab5c72 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 5 Feb 2016 21:18:45 +0100 Subject: [PATCH] cmdutils: realign for some additional filters with very long name Signed-off-by: Paul B Mahol --- cmdutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdutils.c b/cmdutils.c index e0d2807..03a4836 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -1625,7 +1625,7 @@ int show_filters(void *optctx, const char *opt, const char *arg) ( i && (filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|'; } *descr_cur = 0; -printf(" %c%c%c %-16s %-10s %s\n", +printf(" %c%c%c %-17s %-10s %s\n", filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.', filter->flags & AVFILTER_FLAG_SLICE_THREADS? 'S' : '.', filter->process_command? 'C' : '.', -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/h264: Fix segfault in 4:2:2 chroma deblock with 32-bit msvc
Using rNm and x86inc's stack allocation with a negative value at the same time isn't supported, and caused the original stack pointer to be clobbered when using a compiler that doesn't support stack alignment. --- libavcodec/x86/h264_deblock.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm index 8f80863..4aabbc0 100644 --- a/libavcodec/x86/h264_deblock.asm +++ b/libavcodec/x86/h264_deblock.asm @@ -867,7 +867,8 @@ ff_chroma_inter_body_mmxext: %define t5 r4 %define t6 r5 -cglobal deblock_h_chroma422_8, 5, 6, 0, 0-(1+ARCH_X86_64*2)*mmsize +cglobal deblock_h_chroma422_8, 5, 6 +SUB rsp, (1+ARCH_X86_64*2)*mmsize %if ARCH_X86_64 %define buf0 [rsp+16] %define buf1 [rsp+8] @@ -907,6 +908,7 @@ cglobal deblock_h_chroma422_8, 5, 6, 0, 0-(1+ARCH_X86_64*2)*mmsize movq m0, buf0 movq m3, buf1 TRANSPOSE8x4B_STORE PASS8ROWS(t5, r0, r1, t6) +ADD rsp, (1+ARCH_X86_64*2)*mmsize RET ; in: %1=p0 %2=p1 %3=q1 -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] libavcodec: fix building without asm
Hi, Attached patch fixes building ffmpeg on OS X with the following configuration: --disable-optimizations --disable-asm Without this patch the following error is observed: LD ffmpeg_g Undefined symbols for architecture x86_64: "_ff_spatial_idwt_init_mmx", referenced from: _ff_spatial_idwt_init2 in libavcodec.a(dirac_dwt.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [ffmpeg_g] Error 1 This is with clang from Apple LLVM 7.0.2 0001-libavcodec-fix-building-without-asm.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/h264: Fix segfault in 4:2:2 chroma deblock with 32-bit msvc
On 2016-02-05 21:20, Henrik Gramner wrote: > Using rNm and x86inc's stack allocation with a negative value at the same > time isn't supported, and caused the original stack pointer to be clobbered > when using a compiler that doesn't support stack alignment. > --- > libavcodec/x86/h264_deblock.asm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm > index 8f80863..4aabbc0 100644 > --- a/libavcodec/x86/h264_deblock.asm > +++ b/libavcodec/x86/h264_deblock.asm > @@ -867,7 +867,8 @@ ff_chroma_inter_body_mmxext: > %define t5 r4 > %define t6 r5 > > -cglobal deblock_h_chroma422_8, 5, 6, 0, 0-(1+ARCH_X86_64*2)*mmsize > +cglobal deblock_h_chroma422_8, 5, 6 > +SUB rsp, (1+ARCH_X86_64*2)*mmsize > %if ARCH_X86_64 > %define buf0 [rsp+16] > %define buf1 [rsp+8] > @@ -907,6 +908,7 @@ cglobal deblock_h_chroma422_8, 5, 6, 0, > 0-(1+ARCH_X86_64*2)*mmsize > movq m0, buf0 > movq m3, buf1 > TRANSPOSE8x4B_STORE PASS8ROWS(t5, r0, r1, t6) > +ADD rsp, (1+ARCH_X86_64*2)*mmsize > RET > > ; in: %1=p0 %2=p1 %3=q1 > Looks good to me but then I thought the old one did too so you probably want to wait for someone else to sign off too. Sorry everyone. 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 1/5] lavf/asfenc: add AVClass to context
On Thu, 4 Feb 2016, Michael Niedermayer wrote: On Thu, Feb 04, 2016 at 01:57:55AM +0100, Marton Balint wrote: Signed-off-by: Marton Balint --- libavformat/asfenc.c | 17 + 1 file changed, 17 insertions(+) LGTM Thanks, pushed. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/5] lavf/asfenc: check the number of streams in header
On Thu, 4 Feb 2016, Michael Niedermayer wrote: On Thu, Feb 04, 2016 at 01:57:56AM +0100, Marton Balint wrote: Signed-off-by: Marton Balint --- libavformat/asfenc.c | 5 + 1 file changed, 5 insertions(+) LGTM Thanks, pushed. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/5] lavf/asfenc: add support for storing languages
On Fri, 5 Feb 2016, Michael Niedermayer wrote: On Fri, Feb 05, 2016 at 12:10:53AM +0100, Marton Balint wrote: On Thu, 4 Feb 2016, Michael Niedermayer wrote: should be ok if tested with some other software, especially official implemenattion from MS I have tested it VLC, Windows Media ASF View from Microsoft and Windows Media Player 12 as well. Windows Media Player crashed once when changing the language, but usually it works, so I don't think it was because of a malformed file... Do you have any suggestions for other software worth checking? above sounds like a good list already unless someone else has some more ideas Ok, thanks, pushed. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavcodec: fix building without asm
On Fri, Feb 5, 2016 at 9:33 PM, Michael Bradshaw wrote: > Hi, > > Attached patch fixes building ffmpeg on OS X with the following > configuration: --disable-optimizations --disable-asm > > Without this patch the following error is observed: > > LD ffmpeg_g > Undefined symbols for architecture x86_64: > "_ff_spatial_idwt_init_mmx", referenced from: > _ff_spatial_idwt_init2 in libavcodec.a(dirac_dwt.o) > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > make: *** [ffmpeg_g] Error 1 > > Clang fails to figure out that if (x && 0) is dead code? Oh my. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/5] lavf/asfenc: add support for storing creation time
On Thu, 4 Feb 2016, Michael Niedermayer wrote: On Thu, Feb 04, 2016 at 01:57:58AM +0100, Marton Balint wrote: Signed-off-by: Marton Balint --- libavformat/asfenc.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) LGTM Thanks, pushed. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 5/5] lavf/asfenc: add support for setting packet size
On Thu, 4 Feb 2016, Michael Niedermayer wrote: On Thu, Feb 04, 2016 at 01:57:59AM +0100, Marton Balint wrote: Signed-off-by: Marton Balint --- doc/muxers.texi | 20 libavformat/asf.h| 2 -- libavformat/asfenc.c | 41 + 3 files changed, 45 insertions(+), 18 deletions(-) should be ok (with any ticket references that it might fix) Ok, thanks, I have pushed this as well. I have mentioned the trac ticket in the commit message. also please add a fate test that uses this option (and possibly other options if there is something that can easily be tested) Ok, will do later. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavcodec: fix building without asm
On Fri, 5 Feb 2016 21:45:00 +0100 Hendrik Leppkes wrote: > On Fri, Feb 5, 2016 at 9:33 PM, Michael Bradshaw wrote: > > Hi, > > > > Attached patch fixes building ffmpeg on OS X with the following > > configuration: --disable-optimizations --disable-asm > > > > Without this patch the following error is observed: > > > > LD ffmpeg_g > > Undefined symbols for architecture x86_64: > > "_ff_spatial_idwt_init_mmx", referenced from: > > _ff_spatial_idwt_init2 in libavcodec.a(dirac_dwt.o) > > ld: symbol(s) not found for architecture x86_64 > > clang: error: linker command failed with exit code 1 (use -v to see > > invocation) > > make: *** [ffmpeg_g] Error 1 > > > > > > Clang fails to figure out that if (x && 0) is dead code? Oh my. (You know that in theory ffmpeg shouldn't even rely on optional optimizations for build success.) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/h264: Fix segfault in 4:2:2 chroma deblock with 32-bit msvc
Hi, On Fri, Feb 5, 2016 at 3:20 PM, Henrik Gramner wrote: > Using rNm and x86inc's stack allocation with a negative value at the same > time isn't supported, and caused the original stack pointer to be clobbered > when using a compiler that doesn't support stack alignment. > --- > libavcodec/x86/h264_deblock.asm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) lgtm. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/h264: Fix segfault in 4:2:2 chroma deblock with 32-bit msvc
On Fri, Feb 5, 2016 at 9:31 PM, James Darnley wrote: > Looks good to me but then I thought the old one did too so you probably > want to wait for someone else to sign off too. On Fri, Feb 5, 2016 at 10:00 PM, Ronald S. Bultje wrote: > lgtm. Applied, thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] FFplay with 2 video streams in concurrent time
On 2/5/16, Chau Pham wrote: > Dear Senior, > > > I would like to ask something about ffplay. > > > ffmpeg define AVMediaType in avutil.h with 5 type of media as below > > > enum AVMediaType { > AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA > AVMEDIA_TYPE_VIDEO, > AVMEDIA_TYPE_AUDIO, > AVMEDIA_TYPE_DATA, ///< Opaque data information usually > continuous > AVMEDIA_TYPE_SUBTITLE, > AVMEDIA_TYPE_ATTACHMENT,///< Opaque data information usually sparse > AVMEDIA_TYPE_NB > }; > > > as my understanding that AVMEDIA_TYPE_VIDEO allow to play video stream. > > currently ffmpeg can play only 1 video stream, > is there anyway to play 2 video streams in concurrent time? because my avi > content includes 2 video streams.. and others stream Depends what you mean by 'play 2 video streams'. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavcodec: fix building without asm
On Friday, February 5, 2016, Hendrik Leppkes wrote: > On Fri, Feb 5, 2016 at 9:33 PM, Michael Bradshaw > wrote: > > Hi, > > > > Attached patch fixes building ffmpeg on OS X with the following > > configuration: --disable-optimizations --disable-asm > > > Without this patch the following error is observed: > > > > LD ffmpeg_g > > Undefined symbols for architecture x86_64: > > "_ff_spatial_idwt_init_mmx", referenced from: > > _ff_spatial_idwt_init2 in libavcodec.a(dirac_dwt.o) > > ld: symbol(s) not found for architecture x86_64 > > clang: error: linker command failed with exit code 1 (use -v to see > > invocation) > > make: *** [ffmpeg_g] Error 1 > > > > > > Clang fails to figure out that if (x && 0) is dead code? Oh my. Well, this is with --disable-optimizations so the lack of dead code optimization here shouldn't be surprising. I'm actually surprised it even works at all with optimizations turned off. On a separate note, I just realized that patch has a spurious new line. I can send a new patch if that bugs anyone. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] cmdutils: realign for some additional filters with very long name
On 2016-02-05 21:20, Paul B Mahol wrote: > diff --git a/cmdutils.c b/cmdutils.c > index e0d2807..03a4836 100644 > --- a/cmdutils.c > +++ b/cmdutils.c > @@ -1625,7 +1625,7 @@ int show_filters(void *optctx, const char *opt, const > char *arg) >( i && (filter->flags & > AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|'; > } > *descr_cur = 0; > -printf(" %c%c%c %-16s %-10s %s\n", > +printf(" %c%c%c %-17s %-10s %s\n", > filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.', > filter->flags & AVFILTER_FLAG_SLICE_THREADS? 'S' : '.', > filter->process_command? 'C' : '.', Looks good to me. You don't want to future proof it against even longer names? signature.asc Description: OpenPGP digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavf/mov: Extend extracting XMP in mov files using UUID Box
The UUID is based on http://www.adobe.com/devnet/xmp.html The patch is made according to XMP SPECIFICATION PART 3 - STORAGE IN FILES See Table 8 --- libavformat/mov.c | 25 + 1 file changed, 25 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index e2f107f..1c939ba 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3895,6 +3895,10 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd, 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }; +static const uint8_t uuid_xmp[] = { +0xbe, 0x7a, 0xcf, 0xcb, 0x97, 0xa9, 0x42, 0xe8, +0x9c, 0x71, 0x99, 0x94, 0x91, 0xe3, 0xaf, 0xac +}; if (atom.size < sizeof(uuid) || atom.size == INT64_MAX) return AVERROR_INVALIDDATA; @@ -3949,6 +3953,27 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) } av_free(buffer); +} else if (!memcmp(uuid, uuid_xmp, sizeof(uuid))) { +uint8_t *buffer; +size_t len = atom.size - sizeof(uuid); + +buffer = av_mallocz(len + 1); +if (!buffer) { +return AVERROR(ENOMEM); +} +ret = avio_read(pb, buffer, len); +if (ret < 0) { +av_free(buffer); +return ret; +} else if (ret != len) { +av_free(buffer); +return AVERROR_INVALIDDATA; +} +if (c->export_xmp) { +buffer[len] = '\0'; +av_dict_set(&c->fc->metadata, "xmp", buffer, 0); +} +av_free(buffer); } return 0; } -- 2.7.0.rc3.207.g0ac5344 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavcodec: fix building without asm
Michael Bradshaw gmail.com> writes: > Attached patch fixes building ffmpeg on OS X with the following > configuration: --disable-optimizations --disable-asm Patch applied, I believe similar issues were observed in the past. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC][WIP][PATCH] avfilter: add luascript filter
On 2016-02-04 19:40, Paul B Mahol wrote: > +#define FN_ENTRY(name) {#name, script_ ## name} > +struct fn_entry { > +const char *name; > +int (*fn)(lua_State *L); > +}; > + > +static const struct fn_entry main_fns[] = { > +FN_ENTRY(log), > +FN_ENTRY(frame_count), > +FN_ENTRY(filter), > +{0} > +}; Consider using Lua's luaL_Reg type here. It already has the same fields as your struct. Whether it really matters I don't know. > +static int run_script(AVFilterContext *ctx) > +{ > +LuaScriptContext *s = ctx->priv; > +const char *dump; > +int ret, i; > + > +if (s->L) > +lua_close(s->L); > + > +s->L = luaL_newstate(); > +if (!s->L) > +return AVERROR(ENOMEM); > + > +avfilter_graph_free(&s->graph); > +memset(s->fctx, 0, sizeof(s->fctx)); > +s->nbf = 0; > + > +s->graph = avfilter_graph_alloc(); > +if (!s->graph) > +return AVERROR(ENOMEM); > + > +if (lua_cpcall(s->L, run_lua, ctx)) { lua_cpcall was removed in Lua 5.2 but you can replace this by just pushing the function and args on the stack and then calling it like any other function with lua_pcall. Overall I like this and see some potential in it. I know you have a few things to fix after speaking on IRC. I've already made a few changes but I won't do too many while you're still working on it, unless you ask for it of course. You can find my few changes here https://gitlab.com/J_Darnley/ffmpeg/commits/lua use as you see fit. signature.asc Description: OpenPGP digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v2] Add GBRAP12 pixel format
Output still looks a bit odd though --- libavutil/pixdesc.c | 28 libavutil/pixfmt.h| 4 libswscale/input.c| 4 libswscale/swscale_unscaled.c | 3 +++ libswscale/utils.c| 6 ++ 5 files changed, 45 insertions(+) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 58833cf..f546088 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2028,6 +2028,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, }, +[AV_PIX_FMT_GBRAP12LE] = { +.name = "gbrap12le", +.nb_components = 4, +.log2_chroma_w = 0, +.log2_chroma_h = 0, +.comp = { +{ 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */ +{ 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */ +{ 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */ +{ 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */ +}, +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | + AV_PIX_FMT_FLAG_ALPHA, +}, +[AV_PIX_FMT_GBRAP12BE] = { +.name = "gbrap12be", +.nb_components = 4, +.log2_chroma_w = 0, +.log2_chroma_h = 0, +.comp = { +{ 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */ +{ 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */ +{ 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */ +{ 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */ +}, +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, +}, }; #if FF_API_PLUS1_MINUS1 FF_ENABLE_DEPRECATION_WARNINGS diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index c01c057..7d2eac0 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -292,6 +292,9 @@ enum AVPixelFormat { AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian +AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian +AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian + AV_PIX_FMT_NB,///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; @@ -347,6 +350,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_GBRP12AV_PIX_FMT_NE(GBRP12BE,GBRP12LE) #define AV_PIX_FMT_GBRP14AV_PIX_FMT_NE(GBRP14BE,GBRP14LE) #define AV_PIX_FMT_GBRP16AV_PIX_FMT_NE(GBRP16BE,GBRP16LE) +#define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) #define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) #define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) diff --git a/libswscale/input.c b/libswscale/input.c index 1df84a9..078a28d 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -963,6 +963,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GBRP10LE: c->readChrPlanar = planar_rgb10le_to_uv; break; +case AV_PIX_FMT_GBRAP12LE: case AV_PIX_FMT_GBRP12LE: c->readChrPlanar = planar_rgb12le_to_uv; break; @@ -979,6 +980,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GBRP10BE: c->readChrPlanar = planar_rgb10be_to_uv; break; +case AV_PIX_FMT_GBRAP12BE: case AV_PIX_FMT_GBRP12BE: c->readChrPlanar = planar_rgb12be_to_uv; break; @@ -1241,6 +1243,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GBRP10LE: c->readLumPlanar = planar_rgb10le_to_y; break; +case AV_PIX_FMT_GBRAP12LE: case AV_PIX_FMT_GBRP12LE: c->readLumPlanar = planar_rgb12le_to_y; break; @@ -1257,6 +1260,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GBRP10BE: c->readLumPlanar = planar_rgb10be_to_y; break; +case AV_PIX_FMT_GBRAP12BE: case AV_PIX_FMT_GBRP12BE: c->readLumPlanar = planar_rgb12be_to_y; break; diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 74f3467..6d1a384 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -1643,6 +1643,7 @@ void ff_get_unscaled_swscale(SwsContext *c) dstFormat == AV_PIX_FMT_GBRP12LE || dstFormat == AV_PIX_FMT_GBRP12BE || dstFormat == AV_PIX_FMT_GBRP14LE || dstFormat == AV_PIX_FMT_GBRP14BE || dstFormat == AV_PIX_FMT_GBRP16LE || dstFormat == AV_PIX_FMT_GBRP16BE || + dstFormat == AV_PIX_FMT_GBRAP12LE || dstFormat == AV_PIX_FMT_GBRAP12BE || dstFormat == AV_PIX_FMT_GBRAP16LE || dstFormat == AV_PIX_FMT_GBRAP16BE )) c->swscale = Rgb16ToPlanarRgb16Wrappe
[FFmpeg-devel] [PATCH 2/2] dirac_dwt: Rename init2 to init
The functions are all private. --- libavcodec/dirac_dwt.c | 12 ++-- libavcodec/dirac_dwt.h | 6 +++--- libavcodec/dirac_dwt_template.c | 10 +- libavcodec/diracdec.c | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libavcodec/dirac_dwt.c b/libavcodec/dirac_dwt.c index 7ccb310..4f04112 100644 --- a/libavcodec/dirac_dwt.c +++ b/libavcodec/dirac_dwt.c @@ -33,9 +33,9 @@ #define TEMPLATE_12bit #include "dirac_dwt_template.c" -int ff_spatial_idwt_init2(DWTContext *d, uint8_t *buffer, int width, int height, - int stride, enum dwt_type type, int decomposition_count, - uint8_t *temp, int bit_depth) +int ff_spatial_idwt_init(DWTContext *d, uint8_t *buffer, int width, int height, + int stride, enum dwt_type type, int decomposition_count, + uint8_t *temp, int bit_depth) { int ret = 0; @@ -47,11 +47,11 @@ int ff_spatial_idwt_init2(DWTContext *d, uint8_t *buffer, int width, int height, d->temp = temp; if (bit_depth == 8) -ret = ff_spatial_idwt_init2_8bit(d, type); +ret = ff_spatial_idwt_init_8bit(d, type); else if (bit_depth == 10) -ret = ff_spatial_idwt_init2_10bit(d, type); +ret = ff_spatial_idwt_init_10bit(d, type); else if (bit_depth == 12) -ret = ff_spatial_idwt_init2_12bit(d, type); +ret = ff_spatial_idwt_init_12bit(d, type); else av_log(NULL, AV_LOG_WARNING, "Unsupported bit depth = %i\n", bit_depth); diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h index b3be596..1a899b3 100644 --- a/libavcodec/dirac_dwt.h +++ b/libavcodec/dirac_dwt.h @@ -76,9 +76,9 @@ enum dwt_type { }; // -1 if an error occurred, e.g. the dwt_type isn't recognized -int ff_spatial_idwt_init2(DWTContext *d, uint8_t *buffer, int width, int height, - int stride, enum dwt_type type, int decomposition_count, - uint8_t *temp, int bit_depth); +int ff_spatial_idwt_init(DWTContext *d, uint8_t *buffer, int width, int height, + int stride, enum dwt_type type, int decomposition_count, + uint8_t *temp, int bit_depth); void ff_spatial_idwt_init_x86(DWTContext *d, enum dwt_type type); void ff_spatial_idwt_slice2(DWTContext *d, int y); diff --git a/libavcodec/dirac_dwt_template.c b/libavcodec/dirac_dwt_template.c index de17a2d..972c711 100644 --- a/libavcodec/dirac_dwt_template.c +++ b/libavcodec/dirac_dwt_template.c @@ -476,7 +476,7 @@ static void RENAME(spatial_compose_daub97i_dy)(DWTContext *d, int level, int wid cs->y += 2; } -static void RENAME(spatial_compose97i_init2)(DWTCompose *cs, uint8_t *buffer, int height, int stride) +static void RENAME(spatial_compose97i_init)(DWTCompose *cs, uint8_t *buffer, int height, int stride) { cs->b[0] = buffer + avpriv_mirror(-3-1, height-1)*stride; cs->b[1] = buffer + avpriv_mirror(-3 , height-1)*stride; @@ -485,7 +485,7 @@ static void RENAME(spatial_compose97i_init2)(DWTCompose *cs, uint8_t *buffer, in cs->y = -3; } -static void RENAME(spatial_compose53i_init2)(DWTCompose *cs, uint8_t *buffer, int height, int stride) +static void RENAME(spatial_compose53i_init)(DWTCompose *cs, uint8_t *buffer, int height, int stride) { cs->b[0] = buffer + avpriv_mirror(-1-1, height-1)*stride; cs->b[1] = buffer + avpriv_mirror(-1 , height-1)*stride; @@ -516,7 +516,7 @@ static void RENAME(spatial_compose_dd137i_init)(DWTCompose *cs, uint8_t *buffer, cs->y = -5; } -static int RENAME(ff_spatial_idwt_init2)(DWTContext *d, enum dwt_type type) +static int RENAME(ff_spatial_idwt_init)(DWTContext *d, enum dwt_type type) { int level; @@ -531,7 +531,7 @@ static int RENAME(ff_spatial_idwt_init2)(DWTContext *d, enum dwt_type type) RENAME(spatial_compose_dd97i_init)(d->cs+level, d->buffer, hl, stride_l); break; case DWT_DIRAC_LEGALL5_3: -RENAME(spatial_compose53i_init2)(d->cs+level, d->buffer, hl, stride_l); +RENAME(spatial_compose53i_init)(d->cs+level, d->buffer, hl, stride_l); break; case DWT_DIRAC_DD13_7: RENAME(spatial_compose_dd137i_init)(d->cs+level, d->buffer, hl, stride_l); @@ -541,7 +541,7 @@ static int RENAME(ff_spatial_idwt_init2)(DWTContext *d, enum dwt_type type) d->cs[level].y = 1; break; case DWT_DIRAC_DAUB9_7: -RENAME(spatial_compose97i_init2)(d->cs+level, d->buffer, hl, stride_l); +RENAME(spatial_compose97i_init)(d->cs+level, d->buffer, hl, stride_l); break; default: d->cs[level].y = 0; diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index de7daf3..f3a3bbf 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracd
[FFmpeg-devel] [PATCH 1/2] dirac_dwt: Don't pass information in context as arguments
--- libavcodec/dirac_dwt.c | 13 ++--- libavcodec/dirac_dwt_template.c | 25 + 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libavcodec/dirac_dwt.c b/libavcodec/dirac_dwt.c index 732615c..7ccb310 100644 --- a/libavcodec/dirac_dwt.c +++ b/libavcodec/dirac_dwt.c @@ -39,12 +39,19 @@ int ff_spatial_idwt_init2(DWTContext *d, uint8_t *buffer, int width, int height, { int ret = 0; +d->buffer = buffer; +d->width = width; +d->height = height; +d->stride = stride; +d->decomposition_count = decomposition_count; +d->temp = temp; + if (bit_depth == 8) -ret = ff_spatial_idwt_init2_8bit(d, buffer, width, height, stride, type, decomposition_count, temp); +ret = ff_spatial_idwt_init2_8bit(d, type); else if (bit_depth == 10) -ret = ff_spatial_idwt_init2_10bit(d, buffer, width, height, stride, type, decomposition_count, temp); +ret = ff_spatial_idwt_init2_10bit(d, type); else if (bit_depth == 12) -ret = ff_spatial_idwt_init2_12bit(d, buffer, width, height, stride, type, decomposition_count, temp); +ret = ff_spatial_idwt_init2_12bit(d, type); else av_log(NULL, AV_LOG_WARNING, "Unsupported bit depth = %i\n", bit_depth); diff --git a/libavcodec/dirac_dwt_template.c b/libavcodec/dirac_dwt_template.c index dfcf1de..de17a2d 100644 --- a/libavcodec/dirac_dwt_template.c +++ b/libavcodec/dirac_dwt_template.c @@ -516,39 +516,32 @@ static void RENAME(spatial_compose_dd137i_init)(DWTCompose *cs, uint8_t *buffer, cs->y = -5; } -static int RENAME(ff_spatial_idwt_init2)(DWTContext *d, uint8_t *buffer, int width, int height, - int stride, enum dwt_type type, int decomposition_count, - uint8_t *temp) +static int RENAME(ff_spatial_idwt_init2)(DWTContext *d, enum dwt_type type) { int level; -d->buffer = buffer; -d->width = width; -d->height = height; -d->stride = stride; -d->decomposition_count = decomposition_count; -d->temp = (uint8_t *)(((TYPE *)temp) + 8); +d->temp = (uint8_t *)(((TYPE *)d->temp) + 8); -for(level=decomposition_count-1; level>=0; level--){ -int hl = height >> level; -int stride_l = stride << level; +for (level = d->decomposition_count - 1; level >= 0; level--){ +int hl = d->height >> level; +int stride_l = d->stride << level; switch(type){ case DWT_DIRAC_DD9_7: -RENAME(spatial_compose_dd97i_init)(d->cs+level, buffer, hl, stride_l); +RENAME(spatial_compose_dd97i_init)(d->cs+level, d->buffer, hl, stride_l); break; case DWT_DIRAC_LEGALL5_3: -RENAME(spatial_compose53i_init2)(d->cs+level, buffer, hl, stride_l); +RENAME(spatial_compose53i_init2)(d->cs+level, d->buffer, hl, stride_l); break; case DWT_DIRAC_DD13_7: -RENAME(spatial_compose_dd137i_init)(d->cs+level, buffer, hl, stride_l); +RENAME(spatial_compose_dd137i_init)(d->cs+level, d->buffer, hl, stride_l); break; case DWT_DIRAC_HAAR0: case DWT_DIRAC_HAAR1: d->cs[level].y = 1; break; case DWT_DIRAC_DAUB9_7: -RENAME(spatial_compose97i_init2)(d->cs+level, buffer, hl, stride_l); +RENAME(spatial_compose97i_init2)(d->cs+level, d->buffer, hl, stride_l); break; default: d->cs[level].y = 0; -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette
This patch removes the monowhite switching code for 1 bpp raw AVI without a palette. I don't see any reason to keep it, since it's semantically incorrect to use monowhite for palettized data in my book, it adds unnecessary noise to the code, and it's inconsistent with the rest of the code in FFmpeg. Regarding not being able to produce a working nut file with "ffmpeg -i in.avi -vcodec rawvideo out.nut", it's no more of a regression than not being able to produce a working nut file with the same command line from a 2, 4 or 8 bpp file, since nut currently doesn't have a pal8 mode. In order to produce a working nut file from a 1, 2, 4 or 8 bpp AVI or QuickTime file, force the pixel format with "-pix_fmt rgb24" or similar. For black & white files in order to save space, use "-pix_fmt monow" or "-pix_fmt monob". I have also updated the 1 bpp FATE test files (once again). Mats >From 6c1c2223fefb946d128ab71ed38abbfa72af0c28 Mon Sep 17 00:00:00 2001 From: Mats Peterson Date: Sat, 6 Feb 2016 05:02:16 +0100 Subject: [PATCH] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette --- libavcodec/rawdec.c | 21 + tests/ref/vsynth/vsynth1-bpp1 |4 ++-- tests/ref/vsynth/vsynth2-bpp1 |4 ++-- tests/ref/vsynth/vsynth3-bpp1 |4 ++-- tests/ref/vsynth/vsynth_lena-bpp1 |4 ++-- 5 files changed, 9 insertions(+), 28 deletions(-) diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index b7ce2b6..268e1b4 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -100,7 +100,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt); else { memset(context->palette->data, 0, AVPALETTE_SIZE); -if (avctx->bits_per_coded_sample <= 1) +if (avctx->bits_per_coded_sample == 1) memset(context->palette->data, 0xff, 4); } } @@ -128,10 +128,6 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) avctx->pix_fmt == AV_PIX_FMT_YUYV422) context->is_yuv2 = 1; -/* Temporary solution until PAL8 is implemented in nut */ -if (context->is_pal8 && avctx->bits_per_coded_sample == 1) -avctx->pix_fmt = AV_PIX_FMT_NONE; - return 0; } @@ -204,21 +200,6 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, return AVERROR_INVALIDDATA; } -/* Temporary solution until PAL8 is implemented in nut */ -if (avctx->pix_fmt == AV_PIX_FMT_NONE && -avctx->bits_per_coded_sample == 1 && -avctx->frame_number == 0 && -context->palette && -AV_RB64(context->palette->data) == 0x -) { -const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL); -if (!pal) { -avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; -context->is_pal8 = 0; -context->is_mono = 1; -} else -avctx->pix_fmt = AV_PIX_FMT_PAL8; -} desc = av_pix_fmt_desc_get(avctx->pix_fmt); if ((avctx->bits_per_coded_sample == 8 || avctx->bits_per_coded_sample == 4 diff --git a/tests/ref/vsynth/vsynth1-bpp1 b/tests/ref/vsynth/vsynth1-bpp1 index 32dab11..378f990 100644 --- a/tests/ref/vsynth/vsynth1-bpp1 +++ b/tests/ref/vsynth/vsynth1-bpp1 @@ -1,4 +1,4 @@ 3e5e0f4afb3a0350440e86b1ea56cec9 *tests/data/fate/vsynth1-bpp1.avi 640452 tests/data/fate/vsynth1-bpp1.avi -ccef5f5d5b0392f1d01c200499dac657 *tests/data/fate/vsynth1-bpp1.out.rawvideo -stddev: 97.30 PSNR: 8.37 MAXDIFF: 237 bytes: 7603200/ 7603200 +853694f3c1aa3ef3807ab1fccbeefe7b *tests/data/fate/vsynth1-bpp1.out.rawvideo +stddev: 84.44 PSNR: 9.60 MAXDIFF: 221 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-bpp1 b/tests/ref/vsynth/vsynth2-bpp1 index d010bbd..ae8fd27 100644 --- a/tests/ref/vsynth/vsynth2-bpp1 +++ b/tests/ref/vsynth/vsynth2-bpp1 @@ -1,4 +1,4 @@ 771437c9038b44f4e2d4ff764c1c3821 *tests/data/fate/vsynth2-bpp1.avi 640452 tests/data/fate/vsynth2-bpp1.avi -ba70b5aebc786e625af6bd7f7ec82717 *tests/data/fate/vsynth2-bpp1.out.rawvideo -stddev: 81.63 PSNR: 9.89 MAXDIFF: 237 bytes: 7603200/ 7603200 +94261fc8aa20130cbd4361e15b742ef7 *tests/data/fate/vsynth2-bpp1.out.rawvideo +stddev: 70.29 PSNR: 11.19 MAXDIFF: 221 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth3-bpp1 b/tests/ref/vsynth/vsynth3-bpp1 index f84808a..6f71248 100644 --- a/tests/ref/vsynth/vsynth3-bpp1 +++ b/tests/ref/vsynth/vsynth3-bpp1 @@ -1,4 +1,4 @@ a5e6d1eff2f6fc3bba31e3bb8753b905 *tests/data/fate/vsynth3-bpp1.avi 15352 tests/data/fate/vsynth3-bpp1.avi -75e8ee0c0b0ada4515455d9f29377a16 *tests/data/fate/vsynth3-bpp1.out.rawvideo -stddev: 97.70 PSNR: 8.33 MAXDIFF: 248 bytes:86700/86700 +79076b5fc43ee2a2284c0cde991d21f3 *tests/data/fate/vsynth3-bpp1.out.rawvideo +stddev: 84.88 PSNR: 9.55 MAXDIFF: 232 bytes:86700/86
Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette
On 02/06/2016 05:05 AM, Mats Peterson wrote: This patch removes the monowhite switching code for 1 bpp raw AVI without a palette. I don't see any reason to keep it, since it's semantically incorrect to use monowhite for palettized data in my book, it adds unnecessary noise to the code, and it's inconsistent with the rest of the code in FFmpeg. Regarding not being able to produce a working nut file with "ffmpeg -i in.avi -vcodec rawvideo out.nut", it's no more of a regression than not being able to produce a working nut file with the same command line from a 2, 4 or 8 bpp file, since nut currently doesn't have a pal8 mode. In order to produce a working nut file from a 1, 2, 4 or 8 bpp AVI or QuickTime file, force the pixel format with "-pix_fmt rgb24" or similar. For black & white files in order to save space, use "-pix_fmt monow" or "-pix_fmt monob". I have also updated the 1 bpp FATE test files (once again). Mats And I deliberately kept the pal8 placeholders for the future in case you wonder, Michael. Mats ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] x86/dcadec: add ff_lfe_fir0_float_{sse, sse2, avx, fma3}
On 2/5/2016 4:46 PM, James Almer wrote: > Up to ~4 times faster on x86_64, ~8 times on x86_32 if compiling using x87 fp > math. > > Signed-off-by: James Almer > --- > libavcodec/dcadsp.c | 3 + > libavcodec/dcadsp.h | 1 + > libavcodec/x86/Makefile | 4 +- > libavcodec/x86/dcadsp.asm| 199 > +++ > libavcodec/x86/dcadsp_init.c | 45 ++ > 5 files changed, 250 insertions(+), 2 deletions(-) > create mode 100644 libavcodec/x86/dcadsp.asm > create mode 100644 libavcodec/x86/dcadsp_init.c <@BBB> jamrial: lfe patch is ok like this, ty Pushed. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] diracdsp: Make x86 files/functions names consistent
On Tue, Feb 2, 2016 at 6:20 PM Timothy Gu wrote: > > > > diracdsp_init.o should be part of OBJS, not YASM-OBJS. > > Done. > > > > > While you're at it you could also change dirac_dwt in a similar > > fashion. > > And done. > 17:42 < jamrial> Timothy_Gu: yeah, seems ok. you'll have to rebase the dwt patch, though Rebased and pushed. Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel