This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Dithering


Dithering

Postby Kzinti » Jan 23, 2002 @ 5:12am

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Digby » Jan 23, 2002 @ 6:36am

I did this a while back. It isn't Floyd-Steinberg though. <subjectivism> It's much faster. </subjectivism> (i.e. I never profiled it but in theory it should be faster)

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby Kzinti » Jan 23, 2002 @ 6:58am

Pretty much figured out you used ordered dithering... It seems the only way to get some fps out of the device. Did you go with the simple 2x2 Bayer matrix?

Do you still have the code for this? I'm really curious to see how you did it with only two "and"s and a lookup + clamping.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Digby » Jan 23, 2002 @ 8:20am

I used a 4x4 dither matrix. I unable to locate the code right now but I should be able to find it later this week.

Per-pixel, the ordered dither requires two ANDs, one table lookup, 3 adds, and 3 clamps, then a pixel pack.

Have you tried just creating a generic halftone palette and generating a 64K lookup table?

Don't perform the color conversion per-frame. Only do it when the app locks/unlocks a surface.

Personally, unless I had to choose between supporting palettized displays and a having a root canal, I'd do nothing to support these dead devices. They are well over a year old now and there are no future devices being made with 8-bpp displays.
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby Kzinti » Jan 23, 2002 @ 4:57pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Digby » Jan 23, 2002 @ 7:19pm

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby Kzinti » Jan 23, 2002 @ 8:09pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Kzinti » Jan 24, 2002 @ 12:59am

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Digby » Jan 24, 2002 @ 3:23am

If you are exposing a 16-bpp buffer to an app running on an 8-bpp device, then the look up table is 64K bytes. Each byte in the table contains the 8 bit palette index.

If you're going to dither the entire back buffer then the dithering will help the final image, regardless of what size your sprites are. Or are you talking about dithering the sprites individually before copying to the back buffer?

My comment about doing the color conversion at load time was to think about this problem in the same manner as rotating a bitmap at load time to solve the native landscape oriented displays. If you do the conversion up front, you won't have to do it each frame, which is going to be a big perf win.
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby Kzinti » Jan 24, 2002 @ 5:47am

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Digby » Jan 24, 2002 @ 7:53pm

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum