On Wed, Mar 16, 2022 at 9:08 PM Nicolas George <geo...@nsup.org> wrote:
> Paul B Mahol (12022-03-09): > > Signed-off-by: Paul B Mahol <one...@gmail.com> > > --- > > libavfilter/Makefile | 1 + > > libavfilter/allfilters.c | 1 + > > libavfilter/src_avsynctest.c | 399 +++++++++++++++++++++++++++++++++++ > > 3 files changed, 401 insertions(+) > > create mode 100644 libavfilter/src_avsynctest.c > > I opposed to this patch the first time, on the basis that our existing > sources (testsrc and sine) would do the job just as well, and you never > bothered to explain what this particular version would bring. I have > found out on my own and therefore withdraw my objection. > > > > +static int32_t sin32(int32_t x, int shift) > > +{ > > + const double pi = M_PI; > > + const int32_t a = ((2.0 * pi) * (1 << 24)); > > + const int32_t b = (1 << 7) * (12.0 / pi - 1.0 - pi) * (1 << 24); > > + const int32_t c = (1 << 9) * 3.0 * (2.0 + pi - 16.0 / pi) * (1 << > 24); > > + int64_t x2, result; > > + int32_t t1, t2; > > Can you consider reuse the code from asrc_sine to generate a bit-exact > sin table? > This one uses s32 instead of s16. and should be already bitexact, no? (That constants should always be same fixed precision number...) I think that using limited size table will make sine less precise when viewed in spectrum analyser, it will have side lobes, extra sinusoids but with small gain. Also sine filter does not allow volume adjustment at all (unless one use volume filter, but that have drawbacks). This one allow at least some limited signal amplitude adjustments in power of 2 and is very compact. > > Regards, > > -- > Nicolas George > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".