Sone years ago, I was involved in a DSP project. The data was 44.1KHz
stereo audio. We wanted to do an FFT. The goal was to ultimately change
the base representation from 16-bit integers to floats to expedite such
computations. As proof-of-concept, I converted a significant-length
buffer (about two seconds of samples) from integer to float, called the
FFT, got the array of float result, normalized it for plotting, and
converted it back to integer. All of this was so fast that I coud easily
meet the realtime window constraints to keep te FFT plot updated. This
was more than a “simple” copy,and it took no noticeable time processing
realtime audio. We never did change the base representation, because that
would have taken weeks of coding and testing, and my proof-of-concept took
about ten hours. So I, too, question attempts at premature “optimization”
based on “gut feeling” or “best practice when programming a PDP-11”. And
to te OP, “big” is a useless description, and “several” is likewise a
vague description. You cannot make design decisions based on such
nonsensical terms. “Buffers will not exceed 64K and there may be as many
as 20” could tell us a lot. Such as “you don’t need to worry about
optimizing this”. If you said “Buffers will be 50MB and there can be as
many as 500” requires a different set of decisions.
joe
Jim wrote:
> It is not a big buffer, but may have several buffers.
>
> Problem is that the buffer I am reffering to is going to arrive to an
> AVStream driver probably by a KS_METHOD with type
> KSMETHOD_TYPE_SOURCE. I would like to avoid copy the buffer.
You are guilty of premature optimization. Today’s processors copy data
really, really fast. First make it work, then check the performance to
see if you NEED to optimize.
If you are sending a lot of data, why are you using a KSMETHOD instead
of streaming it through a normal KS pin?
> Not quite sure how KS_METHOD work irp-wise. does it overlapped ? If
> not, can I keep the mdl probed/locked after KS_METHOD return?
Yes, the KS IRPs are always sent asynchronous. If you aren’t ready to
complete it, just have the handler return STATUS_PENDING. The AVStream
library will do the rest. When you’re ready to complete it, call
KsCompletePendingRequest.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
NTDEV is sponsored by OSR
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer