[FFmpeg-devel] [PATCH] avfilter: add anoisesrc
Nicolas George
george at nsup.org
Wed Nov 4 20:30:13 CET 2015
Le quartidi 14 brumaire, an CCXXIV, Kyle Swanson a écrit :
> I can change this, but most filters I've seen have used floating point
> sample formats. Anyone else have any opinions on this?
Floating point is easier, that explains why a lot of code use it. But it is
less efficient, and most importantly: it is not bit-exact, and therefore it
makes it much harder to do regression tests (either for the source itself or
using the source as input for a filter that needs testing): instead of
comparing the output to a constant reference, it requires using a mean
deviation.
> This makes it easier for someone to add different flavors of filtered
> noise later on, and define their own sample buffer. I understand this
> is a tiny buffer, but why allocate too much memory if we won't need
> it?
Dynamic allocation has a cost too. With padding and structure overhead, when
allocating 1 cell, you end up reserving 24-32 octets, possibly more, while
the current code only requires 56 at most. And of course, avoiding the
dynamic allocation and the indirection makes the code itself smaller: unless
a lot of instances of the source are created, the benefit is larger than the
cost.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151104/8f9dff29/attachment.sig>
More information about the ffmpeg-devel
mailing list