pouët.net

ProjectLCD and mobile demos optimizing in general

category: general [glöplog]
 

I am interested about speed. Not much, just a little..

A long time ago, a friend of mine did a java mobile project for his studies. We used all the late shit, like MIDP2.0 and LCDL 1.1 (or LCDC or something, to have sines and more math functions that are missing from 1.0). Jff, I tried to do a very simple effect (again a plasma) and tested in the emulator of Wireless Tollkit compiler. It was about 15fps and we said "Wow! In the modern mobile phones it will possibly be faster". 1-2 years after, my friend succeeds to actually see his programm in the real thing (Siemens S65). Now the plasma screen goes no more than 3fps!!! ;PPP

I tried to optimize it on the compiler and we got double speed on the emulator but then again 3fps on the real thing. At the beginning we thought that the code was slow, but then we thought of doing a test, removed the output routine and run the algorithm itself. It was 30fps on the real thing! Some tests even showed (like his XML parser) that the emulator was actually 3 times slower than his mobile phone! So, the output was the problem..

I was calculating the plasma in an int[] plasma array and then using the function drawRGB to output it. But we found out now that possibly this function is fuckin too slow for realtime output. Are there other faster functions to have a pixel buffer and output it in the screen?

And then both me and my friend were amazed by watching ProjectLCD and wondered what kind of functions does the coder use to have so fast output? Is he also having a pixel buffer where he uses his own triangle and line rasterizer? Or are there inline functions even in MIDP1.0 for drawing fast triangles and lines without having to use a pixel buffer? Still, is it possible with an average mobile phone to output fast enough (even only 15 fps) a pixel buffer to the screen? Did we do something wrong? (I can show you the code if you want). Or is it specific to the mobile phone? (E.g. other devices might have fast output?)

Mobile phone democoders please help us. We are very curious to learn and I want to buy a new mobile phone and do little demos :)))
added on the 2005-06-05 13:10:17 by Optimus Optimus
just to point, 'average mobile phone' sounds as weird as 'average pc' nowadays, probably even more weird.
I believe pretty advanced models ( capable of playing mpegs etc ) can offer decent framerates

you may want to try Jbenchmark on your phone, it benchmarks lot of stuff like fillrate, image manipulation, 3d transformation etc ( JBenchmark 2.0 which supports MIDP 2.0 ).
also take a look at their results database and estimate "average mobile" performance ;)
added on the 2005-06-05 13:55:46 by apricot apricot
Well, as the coder of ProjectLCD I may have some input on this... ;)

The drawRGB() function you were using is only available in MIDP2.0, and as you have discovered, it is rather slow on some devices. I can tell you this, on my Nokia 6630 it's very fast (as it should be, the phone has a 200MHz CPU!) and I have things like plasma, radial twisters etc. running at 30+ fps.

But to get code that runs fast on other phones (and to get it running on MIDP1.0) you have to rely on drawing primitives with the functions in the Graphics class.
In ProjectLCD I'm using drawLine() and fillRect() almost exclusivly (there is on part that uses fillArc(), but I found out that it runs very slow on many phones).

So for example, my polyfiller is a standard scanline filler that uses drawLine to draw horisontal lines to fill the polygons.

/Shadow of Noice
added on the 2005-06-05 14:39:06 by Sdw Sdw
Thanks, that's really interesting. And that jbenchmark page is great. Now, I can have a look there too, in order to decide which mobile phone to buy!
added on the 2005-06-05 16:08:15 by Optimus Optimus
haha. pouetization "shadow of noice" sounds a bit corny, kinda like "solider of death" :)

beats sharing the name with an annoying tropical bird!
added on the 2005-06-05 17:39:38 by Shifter Shifter
Quote:
haha. pouetization "shadow of noice" sounds a bit corny, kinda like "solider of death" :)


Well, I usually type it out to avoid confusion, since there seems to be quite a few "Shadow" in the scene.
added on the 2005-06-05 19:14:13 by Sdw Sdw
java <3 :)
added on the 2005-06-05 22:50:19 by makc makc

login