On 5/8/17, Muhammad Faiz <mfc...@gmail.com> wrote: > On Mon, May 8, 2017 at 1:22 AM, Paul B Mahol <one...@gmail.com> wrote: >> Signed-off-by: Paul B Mahol <one...@gmail.com> >> --- >> configure | 2 + >> doc/filters.texi | 30 +++ >> libavfilter/Makefile | 1 + >> libavfilter/af_afir.c | 541 >> +++++++++++++++++++++++++++++++++++++++++++++++ >> libavfilter/allfilters.c | 1 + >> 5 files changed, 575 insertions(+) >> create mode 100644 libavfilter/af_afir.c >> >> +@item auto >> +Enable auto gain calculation of Impulse Response coefficients. >> +By default is enabled. >> +@end table >> + > > Probably, these options aren't required if algo is correct.
Which ones? All of them or just last one? >> + for (i = 0; i < s->nb_partitions; i++) { >> + const int coffset = i * (s->part_size + 1); >> + >> + for (n = 0; n < s->part_size; n++) { >> + const float cre = coeff[coffset + n].re; >> + const float cim = coeff[coffset + n].im; >> + const float tre = block[2 * n ]; >> + const float tim = block[2 * n + 1]; >> + >> + sum[2 * n ] += tre * cre - tim * cim; >> + sum[2 * n + 1] += tre * cim + tim * cre; >> + } >> + sum[2 * n] += block[2 * n] * coeff[coffset + n].re; >> + } > > This is still wrong. > As I read in articles, each ir partition is convoluted with different > data block. Hmm, could you re-check it? The code I looked doesn't do that. > Test: > > aevalsrc = 'if(n, 0, 1)', > firequalizer = > delay = 0.023: > fixed = on: > wfunc = nuttall: > gain = 'if(between(f, 1000, 5000), -INF, 0)', > atrim = end_sample = 2048 [ir]; The size of IR is too short. If I increase it to 12048 I get desired output. > > aevalsrc = '0.7*sin(3000*t*t)' [data]; > > [data][ir] > afir, > asplit [out0], > showspectrum=s=1024x512:win_func=nuttall, > format = rgb24 [out1] > > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel