High performance mode in Windows Mobile RRS feed

  • Question

  • Hi,


    Currently I'm building an application that is an image filter that should run in real-time. It's filter that transforms image captured from the camera and displays a transformed image just like the camera preview does.

    The problem that I'm having with this is that, the performance is critical to this app, as every captured pixel should be transformed, this gives about 640x480 pixels x3 (the color dimentions; R, G, B) x about 30-50 operations per color dimension, then converting it back to RGB and generating a new image.

    First, when I was testing the algorithm's functional requirements in Matlab, it took about 5-15 seconds to transform a 600x600 image on a quadcore processor. Then I've reimplemented the algorithm in the target platform which is C++ for windows mobile and now I'm getting about 0.2-0.7 frames per second when processing the same image.

    The C++ version already has a lot of optimizations like pre-caching and pre-calculating the values of each color and storing the pre-calculated values in trees, but still the performance was not satisfying.


    I tried to find out the bottleneck of the whole algorithm and started with a plain empty TransformFilter, that had on one of the end of the CaptureGraph, the video camera and on the other end the handle to a window and a renderer that should show the live preview of the camera without doing anything. It appeared to be the biggest bottleneck!

    A pure preview on a windowed application on Windows Mobile 6.5 was giving me an average of 1-2 frames per second and I'm sure that it's not a matter of testing it on a slow phone. I'm testing it on HTC Diamond 2. It has ~530 MHz and it's camera application shows smooth preview at about 15-20 FPS, even when some effect is applied (like BW, Sofia) the preview performance is very high.


    What I'm doing wrong?

    How to get preview performance similar to the native camera application?

    Is there any "mode' in Windows Mobile that would reduce the context switches and give my process a super high priority?


    Thanks in advance for any answer. 

    Tuesday, June 29, 2010 9:38 PM


  • Karim,

    I don't know if you have already tried to play with CeSetThreadPriority() and CeSetThreadQuantum() functions. You can try it and check the performance.

    Wednesday, June 30, 2010 12:00 PM