[FFmpeg-devel] [PATCH] Move Kaiser-Bessel Derived window to mdct.c

Robert Swain robert.swain
Fri Jan 11 13:53:10 CET 2008


Hello,

On 10/01/2008, Justin Ruggles <justinruggles at bellsouth.net> wrote:
> Robert Swain wrote:
> > On 10/01/2008, Michael Niedermayer <michaelni at gmx.at> wrote:
> > OK, I will post more patches for this later this evening.
>
> That sounds good. I know Benjamin has been discussing doing this for a
> while, but I'm guessing there was not a need to share it until native
> aac was ready.

Please see attached. They're git-format-patch generated diffs so I'm
not immediately sure how to apply them with 'patch' but Michael seems
keen on this extra information in git diffs from the git thread and I
agree that the diffstat info is quite informative.

The first patch moves the ac3dec.c Kaiser-Bessel Derived window
generation function to mdct.c. The function gets renamed to
ff_kbd_window_init() as it needs the ff_ prefix and it will be used
for more than just ac3. Also the call in ac3dec.c was edited
accordingly and the prototype was added to dsputil.h.

The second patch extends the flexibility of the function to allow
variable alpha, window size (well, half window size as I understand
they're symmetric) and Bessel I0 approximation iterations. The
prototype in dsputil.h and call in ac3dec.c are edited accordingly.

The third patch is optional and changes the intermediate variable
types from double to float allowing the removal of the local_window
variable.

Enjoy, and comments are of course welcome. :)

> >> And IIRC the num of iterations are just a matter of how good the
> >> approximation should be, what does AAC say about the ierations?
> >
> > I think you're right but, from looking at the AAC spec (page 162 of
> > sp04), all I can see is a sum from 0 to inf in the zeroth order first
> > kind bessel function I0. I've looked around a bit but unless I'm
> > missing something, it doesn't say anything about the suggested number
> > of iterations to use. Maxim used 50 in aac.c, Justin used 100 in
> > ac3dec.c.
>
> 100 is a bit excessive. It could likely be changed to 50 and still match
>  the specification table. Honestly, I don't even care if it doesn't
> match exactly...floating-point tables in specs annoy me...:)  If
> precision matters they should have specified it in fixed-point like all
> the other AC3 tables.

I have used 100 in the call in ac3dec.c to avoid changing anything
unnecessarily. Similarly I'll use 50 in aac.c. If it is decided to
change it to use more or less iterations, it's a quick alteration to
make. If you decide that you want to hard code the iterations, that's
easy enough to do as well.

Regards,
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Move-Kaiser-Bessel-Derived-window-generation-to-mdct.patch
Type: application/octet-stream
Size: 3020 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080111/29b2ee9f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Extend-ff_kbd_window_init-to-allow-variable-alpha-w.patch
Type: application/octet-stream
Size: 2693 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080111/29b2ee9f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Switch-to-float-from-double-and-remove-unnecessary-l.patch
Type: application/octet-stream
Size: 1257 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080111/29b2ee9f/attachment-0002.obj>



More information about the ffmpeg-devel mailing list