[FFmpeg-devel] [PATCH] add ff_static_sine_window_init

Reimar Döffinger Reimar.Doeffinger
Thu Oct 22 23:21:15 CEST 2009


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?



More information about the ffmpeg-devel mailing list