home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 18011 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  10.0 KB

  1. Path: sparky!uunet!spool.mu.edu!olivea!bunker!nuconvex!starpt!doiron
  2. From: doiron@starpt.UUCP (Glenn Doiron)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Chunky Pixels vs. Bitplanes (was: Chunky Chip Set...)
  5. Message-ID: <doiron.0kd5@starpt.UUCP>
  6. Date: 1 Jan 93 00:58:35 GMT
  7. References: <Karsten_Weiss.0n2o@ibase.stgt.sub.org> <1hbngoINNglt@uwm.edu>           <1992Dec31.011428.2926@mpifr-bonn.mpg.de>
  8. Organization: 68K Software Development
  9. Lines: 209
  10. X-NewsSoftware: GRn 1.16f (10.17.92) by Mike Schwartz & Michael B. Smith
  11.  
  12. In article <1992Dec31.011428.2926@mpifr-bonn.mpg.de> mlelstv@specklec.mpifr-bonn.mpg.de (Michael van Elst) writes:
  13. > In <doiron.0ka3@starpt.UUCP> doiron@starpt.UUCP (Glenn Doiron) writes:
  14. > >Once again, you are talking about special hardware.  Even then, chunky can
  15. > >have the same optimization.  Where is this awesome planar advantage?
  16. > >Chunky is still going to take 32 writes, max.
  17. > Never said that you get an advantage in this situation. Here it is a tie.
  18.  
  19. It's a tie if you're using special hardware, with a 32-point wide vertical
  20. line which happens to lie entirely within the span of a single longword.
  21. Wow, it was a tie.  Now, how about some more realistic examples?
  22.  
  23. > >> Simple. The display hardware to _show_ bitplanes needs additional
  24. > >> shiftregisters and buffer which makes the hardware more expensive.
  25. > >Nope.  RAMDAC's show the display, buddy.  Not the TI chip.  And getting a
  26. > >planar display out of VRAM is a trick I'd like to see... well it could be
  27. > >done, if you want to store one plane in each VRAM, then muck about with the
  28. > >hardware, majorly.
  29. > Sure, RAMDAC's generate the analog signal. RAMDAC's however use chunky pixels
  30. > (they need all bits of a pixel to generate the analog signal for the pixel).
  31.  
  32. So what, planar systems still need all bits of a pixel to generate the
  33. pixel, too.  Your point?
  34.  
  35. > So if you have a plane oriented memory (which is no real problem with VRAMs
  36. > although you may get some alignment restrictions) then you have to convert
  37. > it in hardware. This needs _shiftregisters_ and _buffers_. An example for
  38. > such a hardware is the Denise and the Lisa chip (both also have a priority
  39. > logic and Denise includes the RAMDAC).
  40.  
  41. ... which use DRAM's, not VRAMS.  No amount of 'alignment restrictions' is
  42. going to cut it for VRAM planar, unless, as I said, you do funky
  43. address/data schemes and put one plane in each VRAM, then mess further with
  44. your RAMDAC feeding setup.  Using VRAMS like DRAMS will result in a loss of
  45. all the performance gains VRAMS were supposed to give you in the first
  46. place.
  47.  
  48. > >> 32x32 pixels (well-aligned) with 8 bitplanes need 2x32x8 fetches and stores.
  49. > >> (2 words per line, 32 lines, 8 planes). In chunky you have 16x32 fetches 
  50. > >> and stores (16 wrods per line, 32 lines).
  51. > >Once again, you are considering the best, break-even case, where all your
  52. > >data is perfectly sized and aligned.  If you're going to be doing just
  53. > >that, why bother with bitmap displays at all, when a character based
  54. > >display will do just as good?
  55. > Because we do not talk about _text_ displays. You are right that we get
  56. > some inefficiencies with non-aligned data. But so with chunky pixels
  57. > if your memory isn't pixel oriented (f.e. if the memory is 16bit wide
  58. > you "waste" bandwidth on odd addresses).
  59. > Thus bitplane devices are usually same speed as chunky pixel devices. But
  60. > you can scale bitplane devices easily with the obvious performance advantages.
  61. > You can never scale chunky pixel devices.
  62.  
  63. "Scale"??  Remember, scaling is at least (in this example) 8x slower in
  64. planar than chunky.
  65.  
  66. > >Do you know what data port sizes are?  Even if that was the case, worst
  67. > >case chunky could be blowing, say, 3/4 of it's time because only one pixel
  68. > >was needed.  Planar will be wasting 31/32 of it's time worst case.
  69. > Correct. But that's worst case. Average case will waste 2/4 or 16/32.
  70.  
  71. Oh, obviously.  Pardon me, I should have realized that the average cases
  72. waste exactly 1/2 the time.  Let's put it this way:  Chunky will be wasting
  73. 2*8/32= 1/2 a cycle, while planar will be wasting 16*8/32=4 cycles.  Each
  74. time this happens, which will likely be as many times as there are
  75. horizontal lines in the image you are blitting.
  76.  
  77. > >Oh, obviously.  If you can make this magical piece of hardware, I'm sure
  78. > >Commodore has a job position open for you.  Or any other number of chip
  79. > >designers.
  80. > I could probably make that from discrete parts of fpgas but I have no
  81. > experience in doing asics or even full custom designs.
  82.  
  83. Why hasn't someone done it already?  Musn't be very cost-effective.
  84.  
  85. > >You are doing the same transformations 8 times, once for each bitplane.
  86. > >This is not 8x the number of transformations?  You deny facts?
  87. > Again, with the example of doubling a bitmap you handle multiple pixels
  88. > at a time which exactly compensates for the number of bitplanes.
  89.  
  90. Rubbish.  Show me a piece of code that can do that.  More special-case
  91. optimizations? (sigh...)
  92.  
  93. > >> There is either the application of having numerical data to transform
  94. > >> and display (remember: bitplanes are just for _display_ operations).
  95. > >> There you need the chunky->bitplane conversion but which is only
  96. > >> a small fraction of the _whole_ operation.
  97. > >With this highly magical vaporhardware you keep falling back on,
  98. > >chunky->bitplane conversion should take no time at all!
  99. > I'm not talking about vaporhardware. But you are right, a special hardware
  100. > could do the chunky->bitplane conversion in no time. But I never talked
  101. > about a chunky->bitplane hardware.
  102.  
  103. But you're saying chunky->bitplane conversion is a small fraction of the
  104. whole operation.  It's not.  That ridiculous amount of masking/shifting
  105. might even take longer than the matrix multiplications.  For instance, on a
  106. 68000, each shift takes *2* additional clock cycles! (yuck!)
  107.  
  108. > >> And when operations in the bitplane domain are feasible (i.e. when the
  109. > >> numerical _value_ of a pixel is of no concern)
  110. > >huh?  How about an example to un-confuse me?
  111. > bitmap scaling can bit done on a per-plane basis.
  112.  
  113. As I said, this is 8x the amount of work chunky has to do.  (You're doing
  114. it a bit at a time instead of a byte at a time.)
  115.  
  116. > >I don't deny that bitplanes don't use more memory than chunky pixels, it's
  117. > >just that 90% of all operations are going to be faster on chunky pixels.
  118. > I gave enough examples that they are not faster or not significantly faster.
  119.  
  120. You gave enough examples where special vaporware or special-case
  121. optimizations might make them break even with chunky's results without
  122. any optimization whatsoever.
  123.  
  124. > >> Which is complete garbage. In bitplanes you write your transforms to handle
  125. > >> several pixel bits at _once_.
  126. > >Some magical software to go with that magical hardware?  Or more
  127. > >special-case optimizations?
  128. > Special-case optimizations. Right. But the "special cases" cover most graphics
  129. > operations.
  130.  
  131. Oh, yeah.  Right.  Most graphics operations consist of 32-bit wide
  132. vertical lines, conincidentally placed on a long-word boundary.  Most
  133. operations consist of exactly doubling the size of horizontal/vertical
  134. dimension.  Most operations consist of blitting data that's perfectly sized
  135. and aligned to a perfectly aligned place on the screen.  Yep, that's all of
  136. them.  I can't think of any other graphics operations you can do.
  137.  
  138. > >I don't.  However, you seem oblivious to the drawbacks of pixel-based
  139. > >operations in a planar display.  Even blit operations will almost always
  140. > >take more time on planar displays.
  141. > they take more time in the worst case (because a single memory word stores
  142. > several pixels). In the average a blit is done in equal speed if the amount
  143. > of data is equal.
  144.  
  145. Suppose you have hundreds, thousands of blits?  In general the speed of
  146. blits isn't that critical for most productivity software, but
  147. graphically-oriented software will benefit greatly from chunky
  148. architecture.
  149.  
  150. > >> As I said, drawing a single pixel wide line wins on chunky.
  151. > >Wow... agreement.. (even if slightly incorrect)
  152. > >However, drawing a n-pixel wide line also wins on chunky (where n>0 :)
  153. > Depends.
  154.  
  155. On WHAT???  Where you live?  If you wear underoos?  WHAT???!?? <foaming at
  156. the mouth>
  157.  
  158. > >> Now render a 64 color image to your 256 color display :) 
  159. > >See the above mentioned case of blits.  The best you can hope for is a tie,
  160. > >since with planar you have to clear the top two bitplanes anyways.
  161. > Except if you can guarantee that they are already cleared.
  162.  
  163. Oh, I see.  More special case optimizations.  So you SAY it's a 256-color
  164. display-  BUT you guarantee the top 2 bitplanes are already clear?
  165.  
  166. > >> Or render
  167. > >> a black/white text in your window on a 256 color desktop.
  168. > >See above.  You still have to clear the other bitplanes.  And some chunky
  169. > >hardware supports color expansion, too, where you take a single-bit image
  170. > >and can expand all 0's to one color and 1's to another.  Of course, a
  171. > >similar thing could be done for planar, but you still have the
  172. > >masking/shifting/bandwidth on unaffected pixels problems.  (Say it 3 times
  173. > >real fast.)
  174. > The special hardware cannot magically expand the pixels since the bitmap
  175. > in the frame buffer (VRAM) needs all pixels to be defined. In chunky you
  176. > cannot write single bits into a pixel and have any speed advantage.
  177.  
  178. Urrm, maybe I didn't explain that correctly.  Some chips will take a
  179. 1-pixel chunky image (same as 1-plane planar image), and write out 8-bit
  180. data of value X for a 1 and Y for a 0.  So your character sets in chunky
  181. actually only take up 1/8th as much, and foreground/background colors can
  182. be set before you start the blit.  It's a function of the processor being
  183. used, not chunky pixels.
  184.  
  185. > Regards,
  186. > -- 
  187. > Michael van Elst
  188. > UUCP:     universe!local-cluster!milky-way!sol!earth!uunet!unido!mpirbn!p554mve
  189. > Internet: p554mve@mpirbn.mpifr-bonn.mpg.de
  190. >                                 "A potential Snark may lurk in every tree."
  191.  
  192. Glenn Doiron
  193. --
  194. Amiga UUCP+
  195. Origin:  uunet.uu.net!starpt.UUCP!doiron (Organization:68K Software Development)
  196.          BIX: gdoiron
  197. ** Not enough memory to perform requested operation.  Add 4 megs and retry.
  198.