[FFmpeg-devel] [PATCH] add ff_static_sine_window_init
Michael Niedermayer
michaelni
Sat Oct 31 10:19:55 CET 2009
On Thu, Oct 22, 2009 at 11:21:15PM +0200, Reimar D?ffinger wrote:
> On Thu, Oct 22, 2009 at 10:46:28PM +0200, Michael Niedermayer wrote:
> > On Thu, Oct 15, 2009 at 10:28:39PM +0200, Reimar D?ffinger wrote:
> > > Hello,
> > > this patch adds a special function to initialize the static ff_sine_*
> > > arrays.
> > > It makes the code slightly simpler and makes it easier to hardcode the
> > > tables later (it's messy to make ff_sine_window_init a nop when used on
> > > the hardcoded tables but not otherwise).
> >
> > > aac.c | 4 ++--
> > > aacenc.c | 4 ++--
> > > atrac1.c | 2 +-
> > > dsputil.h | 5 +++++
> > > mdct.c | 5 +++++
> > > nellymoserdec.c | 2 +-
> > > twinvq.c | 6 +++---
> > > wma.c | 4 +---
> > > wmaprodec.c | 3 +--
> > > 9 files changed,
> >
> > > 21 insertions(+), 14 deletions(-)
> >
> > i wouldnt call that slightly simpler, but rather slightly bigger
>
> Maybe you only counted the lines and not what they contain?
> Also it allows to merge the if (!ff_sine_128[127]) checks
> into that function.
>
> > also i think the previous code is clearer.
> > With the new, one unfamiliar
> > with the code (which is everyone a month after working with it)
> > will not know which table is initialized if its not a argument of the
> > function.
>
> Well, that does not apply for twinvq, wma and wmaprodec tough IMO.
> Though if that is the only objection, it's of course possible to
> keep the same function signature, or like for ff_cos having a single
> function that always initializes all of them.
> Any of those acceptable?
having sin and cos init consistant would be nice.
Allocating all is bad due to higher memory requirement.
id like to keep a pointer to the array and check in the function that this
matches the fixed array.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091031/7046a324/attachment.pgp>
More information about the ffmpeg-devel
mailing list