[vorbis] mdct.c pointer to array conversion
Govind Kharbanda
govind.kharbanda at sli-institute.ac.uk
Tue Aug 13 08:17:29 PDT 2002
Hi all,
I'm attempting to convert all the pointers to arrays the mdct_backward
function so it can be partitioned off for a hardware implementation.
Although this code is quite short I'm finding it a little tricky.
As it stands, mdct_backward is passed values by reference i.e.
void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out)
o my modified version starts
void mdct_backward_2(mdct_lookup init, DATA_TYPE in[], DATA_TYPE out[])
The function contains statements such as
DATA_TYPE *iX = in + n2-7
from which it appears that iX, oX are being used to index the in[] array
and out[] array respectively. I've posted more detailed observations on
http://www.sli-institute.ac.uk/~gk/mdct_hw.htm (or /mdct_hw.doc)
I wonder if anyone has already done this conversion? Using a pointer to
access memory elements means you do not have to keep thinking about the
width of your index, however you do have to think about this if you take
the pointers away which is what I'm having problems with.
For instance, init-> trig :
T[0] through to T[7] contain the values of memory stored at
(init->trig)+n4 onwards. I can't pass the pointer init->trig directly
to hardware since the hardware core will not be able to access the
memory of the host PC (mapping0.c which calls mdct_backward will remain
on the host PC for now) so I'm having to transfer the structure back and
forth using DMA. So the structure will have to be modified slightly so
the values from init->trig are contained as part of the structure. How
big should this trig array be?
Hope someone can make this less confusing,
Gov
--
Govind S Kharbanda Institute for System Level Integration
MSc Course Rep. Alba Campus, Livingston, EH54 7EG
http://www.sli-institute.ac.uk/~gk/ Tel: 01506 469340
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis
mailing list