justinzane / pulseaudio

pulseaudio fork primarily for the development of modules like module-lfe-lp
Other
2 stars 0 forks source link

Simplify biquad filter API #17

Closed justinzane closed 11 years ago

justinzane commented 11 years ago

Finally, it would be great if you could wrap all the biquad state in a filter object so that modules wouldn't have to manage all that by themselves. The object would have a simple process() function that takes just an input and an output buffer and the requested number of frames to process. Similarly, there would be a simple rewind() function for resetting the filter to an earlier state. Um, ok. I'll try to get that to work.

10 (probably a duplicate of (6)). In general, I think that any direct reference to w0 or y0 in module-lfe-lp.c is a sign of bad API design in biquad.h. Please refactor, so that you don't have to write this:

                hp = filter_biquad(& (u->s1hpdt[chan_idx]), *

(u->hpfs), cur_sample); bqdtel.w0 = u->s1hpdt[chanidx].w0; /* <--- this / bqdtel.y0 = u->s1hpdt[chanidx].y0; / <--- and this */ filter_store_history(u->s1histbuf, &bqdtel);

In fact I think that you don't need u->s1hpdt and its friends at all, you probably can just store all the w and y data in the history buffer directly. Tanu asked me to refactor to simplify the biquad API. I agree with both of you that it is very clumsy now.

justinzane commented 11 years ago

Simplified. Better?