
Posted:
Jan 13, 2005 @ 12:04pm
by Johan
You should avoid the multiplication on each pixel - i.e. "backBuffer[jj * pitch + ii]" is bad.
Also, depending on the pocket pc you use, the backbuffer might be aligned in a way that pitch is much larger than one pixel. So you would have to check the pitch value and if it's larger than one pixel you would have to go in the column direction instead of row-direction.
If you do the right optimizations your performance would increase at least 4-5 times, probably more.
Thanks

Posted:
Jan 13, 2005 @ 5:05pm
by Joseph
Thanks for the tips. I implemented the above optimizations (using prefix instead of postfix decrementing in the for loop; I've heard it makes a difference, but haven't ever noticed if it does). It's slick-looking code, but I'm still sitting at 6 fps. I think that the video capture is, by far, the biggest bottleneck. I'm going to try tucking it away into its own thread so that the program doesn't block while it's capturing. Hopefully that will restore performance.
Thanks again for your help.
Joseph