On 6 Sep 2000, Gerd Knorr wrote: > code was robust and easy to understand. As the clipping usually does'nt > change that often performance is'nt that critical IMHO. Also the bitmapped > clipping code is much faster in current versions than in 0.6.x. I think you're wrong about it not mattering. There are real cases when the clipping overlay will change very often. One example is moving a normal window across a TV capture window. Every time the window moves a small amount, the clipping changes as it covers up new areas of the overlay window. Another example is closed caption overlay. New characters can be added to the overlay on a frame by frame bases as they are decoded. Each time a new character appears, the clipping must change. Third example is time sharing the capture over multiple windows. The bt848 windows software will let you watch 16 channels in 16 different windows, by switching the overlay from window to window as fast as possible. But, even if you don't change the overlay often, the speed matters because of the latency in updating the RISC program! An NTSC field is 16 milliseconds long. If the time it takes to generate a new overlay is a significant fraction of 16 ms, then the chance of the next field starting before the RISC program can be changed is significant. If it takes longer than 16ms to generate a new program, multiple fields will be overlaid using the old program, while the CPU is generating the new one. When an app tells the driver to change the overlay, it means change NOW, not after ten more fields have been decoded in the wrong spot! So, does generating a new RISC program take a significant fraction of 16ms? Well, I benchmarked the code, and the answer is yes! The code in the 2.2.16 kernel takes several hundereds of ms for 6480x480 images! Larger PAL images would be even worse. Better can be done. I've written a new overlay generator, which is around 1000 times faster than the kernel version. I'll post some benchmarks later, but my code is faster than every overlay generator I've found, bttv-0.7.41 included. It's also simpler, with fewer non-comment lines of code.