Re: [FFmpeg-devel] [PATCH] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Paul B Mahol
On 12/10/17, Nicolas George  wrote:
> Paul B Mahol (2017-12-10):
>> And how do you know that?
>>
>> Only users you care about are mplayer users.
>
> Stop your nonsensical ad-hominem attacks. You are wasting your time and
> mine.
>
> The patch as is is rejected, I have given reasons. Update it or discuss
> them. But I will no longer answer to ad-hominem attacks.

Than I will put this matter to voting comitee.

Mplayer devs are there in minority.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Nicolas George
Paul B Mahol (2017-12-10):
> And how do you know that?
> 
> Only users you care about are mplayer users.

Stop your nonsensical ad-hominem attacks. You are wasting your time and
mine.

The patch as is is rejected, I have given reasons. Update it or discuss
them. But I will no longer answer to ad-hominem attacks.

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] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Paul B Mahol
On 12/10/17, Nicolas George  wrote:
> Paul B Mahol (2017-12-10):
>> I spent enought time porting this filter and do not intend to waste any
>> more
>> time in void discussion with your ego.
>
> Keep your ad-hominem attacks for yourself. It is not a matter about me,
> it is a matter about the usability of the project.
>
> The patch as is is unacceptable since it is confusing for users.

And how do you know that?

Only users you care about are mplayer users.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Nicolas George
Paul B Mahol (2017-12-10):
> I spent enought time porting this filter and do not intend to waste any more
> time in void discussion with your ego.

Keep your ad-hominem attacks for yourself. It is not a matter about me,
it is a matter about the usability of the project.

The patch as is is unacceptable since it is confusing for users.

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] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Paul B Mahol
On 12/10/17, Nicolas George  wrote:
> Paul B Mahol (2017-12-10):
>> Just leave for once.
>
> I have "left" with you more times than I can count. Not today.
> Committing like this would be bad for the users, and you can make it
> good with not much effort.
>
> If you do not care about the good of the users, then why are you
> contributing to the project?

I spent enought time porting this filter and do not intend to waste any more
time in void discussion with your ego.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Nicolas George
Paul B Mahol (2017-12-10):
> Just leave for once.

I have "left" with you more times than I can count. Not today.
Committing like this would be bad for the users, and you can make it
good with not much effort.

If you do not care about the good of the users, then why are you
contributing to the project?

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] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Paul B Mahol
On 12/10/17, Nicolas George  wrote:
> Paul B Mahol (2017-12-10):
>> I will then just apply this.
>
> No, you will not. You will discuss a solution that is good for the
> project as a whole.
>
>> If Carl Eugen can ignore you, I can too.
>
> Two wrongs do not make a right.
>
> If you feel you have been wronged by Carl Eugene, then complain about it
> with facts (because as is, you sentence is just slander).
>
> But it does not give you any extra right.
>
> If you commit as is, you will be violating the project's policy, and you
> would be doing knowingly and on purpose.

Just leave for once.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Nicolas George
Paul B Mahol (2017-12-10):
> I will then just apply this.

No, you will not. You will discuss a solution that is good for the
project as a whole.

> If Carl Eugen can ignore you, I can too.

Two wrongs do not make a right.

If you feel you have been wronged by Carl Eugene, then complain about it
with facts (because as is, you sentence is just slander).

But it does not give you any extra right.

If you commit as is, you will be violating the project's policy, and you
would be doing knowingly and on purpose.

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] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Paul B Mahol
On 12/10/17, Nicolas George  wrote:
> Paul B Mahol (2017-12-10):
>> That is very extreme step, if you insist on such step.
>>
>> Could you please change your statement?
>
> I do not understand what you mean.
>
> For users, having several filters that do almost exactly the same thing
> is confusing. It should be avoided, with the convenience of users in
> mind.
>
> With your patch, we would have exactly that. Please find a good way of
> avoiding it.

I will then just apply this.

If Carl Eugen can ignore you, I can too.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Nicolas George
Paul B Mahol (2017-12-10):
> That is very extreme step, if you insist on such step.
> 
> Could you please change your statement?

I do not understand what you mean.

For users, having several filters that do almost exactly the same thing
is confusing. It should be avoided, with the convenience of users in
mind.

With your patch, we would have exactly that. Please find a good way of
avoiding it.

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] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Paul B Mahol
On 12/10/17, Nicolas George  wrote:
> Paul B Mahol (2017-12-10):
>> For increased tempo it have much better quality.
>> For decreased tempo is have similar quality.
>>
>> Also it have more options and is more configurable
>> and have increased range of tempo scaling.
>
> Is there any benefit in atempo, then?
>
> If not, then this filter should replace atempo, but keeping the name,
> and as much as possible the options, for maximum convenience for users.

That is very extreme step, if you insist on such step.

Could you please change your statement?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Nicolas George
Paul B Mahol (2017-12-10):
> For increased tempo it have much better quality.
> For decreased tempo is have similar quality.
> 
> Also it have more options and is more configurable
> and have increased range of tempo scaling.

Is there any benefit in atempo, then?

If not, then this filter should replace atempo, but keeping the name,
and as much as possible the options, for maximum convenience for users.

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] avfilter: port scaletempo filter from mpv

2017-12-10 Thread Nicolas George
Paul B Mahol (2017-12-02):
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/Makefile|   1 +
>  libavfilter/af_scaletempo.c | 529 
> 
>  libavfilter/allfilters.c|   1 +
>  3 files changed, 531 insertions(+)
>  create mode 100644 libavfilter/af_scaletempo.c

Missing documentation.

Also, how does it compare to atempo?

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter: port scaletempo filter from mpv

2017-12-02 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/Makefile|   1 +
 libavfilter/af_scaletempo.c | 529 
 libavfilter/allfilters.c|   1 +
 3 files changed, 531 insertions(+)
 create mode 100644 libavfilter/af_scaletempo.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 1c0cc1da80..4c025c8d07 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -107,6 +107,7 @@ OBJS-$(CONFIG_PAN_FILTER)+= af_pan.o
 OBJS-$(CONFIG_REPLAYGAIN_FILTER) += af_replaygain.o
 OBJS-$(CONFIG_RESAMPLE_FILTER)   += af_resample.o
 OBJS-$(CONFIG_RUBBERBAND_FILTER) += af_rubberband.o
+OBJS-$(CONFIG_SCALETEMPO_FILTER) += af_scaletempo.o
 OBJS-$(CONFIG_SIDECHAINCOMPRESS_FILTER)  += af_sidechaincompress.o
 OBJS-$(CONFIG_SIDECHAINGATE_FILTER)  += af_agate.o
 OBJS-$(CONFIG_SILENCEDETECT_FILTER)  += af_silencedetect.o
diff --git a/libavfilter/af_scaletempo.c b/libavfilter/af_scaletempo.c
new file mode 100644
index 00..1e673d3e34
--- /dev/null
+++ b/libavfilter/af_scaletempo.c
@@ -0,0 +1,529 @@
+/*
+ * scaletempo audio filter
+ *
+ * scale tempo while maintaining pitch
+ * (WSOLA technique with cross correlation)
+ * inspired by SoundTouch library by Olli Parviainen
+ *
+ * basic algorithm
+ *   - produce 'stride' output samples per loop
+ *   - consume stride*scale input samples per loop
+ *
+ * to produce smoother transitions between strides, blend next overlap
+ * samples from last stride with correlated samples of current input
+ *
+ * Copyright (c) 2007 Robert Juliano
+ *
+ * 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, see .
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include "libavutil/channel_layout.h"
+#include "libavutil/opt.h"
+#include "libavutil/samplefmt.h"
+
+#include "avfilter.h"
+#include "audio.h"
+#include "internal.h"
+
+typedef struct ScaleTempoContext
+{
+AVClass *class;
+
+// stride
+float scale;
+float speed;
+int frames_stride;
+float frames_stride_scaled;
+float frames_stride_error;
+int bytes_per_frame;
+int bytes_stride;
+int bytes_queue;
+int bytes_queued;
+int bytes_to_slide;
+int8_t *buf_queue;
+// overlap
+int samples_overlap;
+int samples_standing;
+int bytes_overlap;
+int bytes_standing;
+void *buf_overlap;
+void *table_blend;
+void (*output_overlap)(struct ScaleTempoContext *s, void *out_buf,
+   int bytes_off);
+// best overlap
+int frames_search;
+int num_channels;
+void *buf_pre_corr;
+void *table_window;
+int (*best_overlap_offset)(struct ScaleTempoContext *s);
+// command line
+float scale_nominal;
+float ms_stride;
+float percent_overlap;
+float ms_search;
+#define SCALE_TEMPO 1
+#define SCALE_PITCH 2
+int speed_opt;
+
+int64_t pts;
+} ScaleTempoContext;
+
+static int query_formats(AVFilterContext *ctx)
+{
+AVFilterChannelLayouts *layouts = NULL;
+AVFilterFormats*formats = NULL;
+static const enum AVSampleFormat sample_fmts[] = {
+AV_SAMPLE_FMT_S16,
+AV_SAMPLE_FMT_FLT,
+AV_SAMPLE_FMT_NONE
+};
+int ret;
+
+layouts = ff_all_channel_counts();
+if (!layouts) {
+return AVERROR(ENOMEM);
+}
+ret = ff_set_common_channel_layouts(ctx, layouts);
+if (ret < 0)
+return ret;
+
+formats = ff_make_format_list(sample_fmts);
+if (!formats) {
+return AVERROR(ENOMEM);
+}
+ret = ff_set_common_formats(ctx, formats);
+if (ret < 0)
+return ret;
+
+formats = ff_all_samplerates();
+if (!formats) {
+return AVERROR(ENOMEM);
+}
+return ff_set_common_samplerates(ctx, formats);
+}
+
+static int fill_queue(AVFilterContext *ctx, AVFrame *in, int offset)
+{
+ScaleTempoContext *s = ctx->priv;
+int bytes_in = in->nb_samples * s->bytes_per_frame - offset;
+int offset_unchanged = offset;
+
+if (s->bytes_to_slide > 0) {
+if (s->bytes_to_slide < s->bytes_queued) {
+int bytes_move = s->bytes_queued - s->bytes_to_slide;
+
+memmove(s->buf_queue, s->buf_queue + s->bytes_to_slide, 
bytes_move);
+s->bytes_to_slide = 0;
+s->bytes_queued =