Rockbox mail archive
Subject: Re: Grayscale framework & demo plugin (patch #931098)
From: Jens Arnold (arnold-j_at_t-online.de)
>> I have posted a plugin to the patch tracker that contains a
>> grayscale framework primary useful to incorporate grayscale
>> display capabilities into other plugins. This could be games,
>> image viewers or whatever else you could imagine.
> - For speedup, I guess you
> can use a way simpler randomization, maybe just some mixup of
> the coords will do.
I already tried using various coordinate mixups. Since these are
always regular patterns, using them leads to moire patterns on the
display. I already implemented your "random bit reservoir" idea
and found that the rand() function isn't that slow after all.
Together with another optimization (having the mask of necessary
random bits available saves me one "division remainder"
operation in C) it yields ~33 % speedup for the max. number of
> - We could place the core halftoning into
> Rockbox, more specifically into IRAM. Potentially way faster.
This should of course be quite a bit faster, especially if you
place the gray_fillrect() function also into IRAM, but I didn't
try this yet for 2 reasons:
- The IRAM space isn't infinite, as well as the size of the
whole firmware (we are about to approach the 200 KB limit soon)
- The framework is primarily aimed at plugin developers and
shouldn't disturb core firmware operation (at least until
someone decides to use grayscale also in the core)
> - If you're short of screen buffer, you can use the mp3
> buffer. Who writes the first halftoned game?
I know that I can use the mp3 buffer as well, the framework is
flexible enough to use any DRAM part you give it. But if a
plugin uses the mp3 buffer you cannot listen to music while it
is running. This is why I didn't do so in my demo.
The space requirements for the grayscale buffer aren't that big
after all, and you can reduce the number of grayscales to save
some more. The Framework supports any number of grayscales from
2 to 33, not just powers of 2.
Page was last modified "Jan 10 2012" The Rockbox Crew