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

  1. Path: sparky!uunet!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.0kil@starpt.UUCP>
  6. Date: 3 Jan 93 00:16:36 GMT
  7. References: <Karsten_Weiss.0n2o@ibase.stgt.sub.org> <1hbngoINNglt@uwm.edu>            <1993Jan1.141207.20262@mpifr-bonn.mpg.de>
  8. Organization: 68K Software Development
  9. Lines: 247
  10. X-NewsSoftware: GRn 1.16f (10.17.92) by Mike Schwartz & Michael B. Smith
  11.  
  12. In article <1993Jan1.141207.20262@mpifr-bonn.mpg.de> mlelstv@speckled.mpifr-bonn.mpg.de (Michael van Elst) writes:
  13. > In <doiron.0kd5@starpt.UUCP> doiron@starpt.UUCP (Glenn Doiron) writes:
  14. > >> 
  15. > >> Never said that you get an advantage in this situation. Here it is a tie.
  16. > >It's a tie if you're using special hardware, with a 32-point wide vertical
  17. > >line which happens to lie entirely within the span of a single longword.
  18. > >Wow, it was a tie.  Now, how about some more realistic examples?
  19. > We were talking about blitting a rectangle.
  20.  
  21. ... and you still haven't convinced me that chunky isn't faster.  As was
  22. said before, the best you can hope for is break-even, and far more often
  23. chunky will be faster - the bigger the blit, the smaller the difference.
  24.  
  25. > >> >> Simple. The display hardware to _show_ bitplanes needs additional
  26. > >> >> shiftregisters and buffer which makes the hardware more expensive.
  27. > >> 
  28. > >> >Nope.  RAMDAC's show the display, buddy.  Not the TI chip.  And getting a
  29. > >> >planar display out of VRAM is a trick I'd like to see... well it could be
  30. > >> >done, if you want to store one plane in each VRAM, then muck about with the
  31. > >> >hardware, majorly.
  32. > >> 
  33. > >> Sure, RAMDAC's generate the analog signal. RAMDAC's however use chunky pixels
  34. > >> (they need all bits of a pixel to generate the analog signal for the pixel).
  35. > >So what, planar systems still need all bits of a pixel to generate the
  36. > >pixel, too.  Your point?
  37. > Read again. I said one would need additional shift registers and buffers
  38. > for the display hardware. You denied telling that the RAMDAC would do that.
  39. > I pointed out that all RAMDACS await chunky pixels which can't be delivered
  40. > directly by a plane oriented memory system. So you need _shift registers_
  41. > and _buffers_.
  42.  
  43. OK.  Point granted, I took that statement the wrong way.
  44.  
  45. > >> So if you have a plane oriented memory (which is no real problem with VRAMs
  46. > >> although you may get some alignment restrictions) then you have to convert
  47. > >> it in hardware. This needs _shiftregisters_ and _buffers_. An example for
  48. > >> such a hardware is the Denise and the Lisa chip (both also have a priority
  49. > >> logic and Denise includes the RAMDAC).
  50. > >... which use DRAM's, not VRAMS.  No amount of 'alignment restrictions' is
  51. > >going to cut it for VRAM planar, unless, as I said, you do funky
  52. > >address/data schemes and put one plane in each VRAM, then mess further with
  53. > >your RAMDAC feeding setup.  Using VRAMS like DRAMS will result in a loss of
  54. > >all the performance gains VRAMS were supposed to give you in the first
  55. > >place.
  56. > Rubbish. VRAMs simply give you a second I/O port for sequential output.
  57. > The advantage is that you all the display refresh accesses do not stall
  58. > the first port used by the rendering processor (CPU, blitter, what else).
  59. > This gives you twice the bandwidth at 130% the cost for this special
  60. > application.
  61.  
  62. As I said, you lose all the performance gains VRAMS were supposed to give
  63. you in the first place, since you can't use the serial registers for video
  64. fetch in planar setups.
  65.  
  66. > >> >> 32x32 pixels (well-aligned) with 8 bitplanes need 2x32x8 fetches and stores.
  67. > >> >> (2 words per line, 32 lines, 8 planes). In chunky you have 16x32 fetches 
  68. > >> >> and stores (16 wrods per line, 32 lines).
  69. > >> 
  70. > >> >Once again, you are considering the best, break-even case, where all your
  71. > >> >data is perfectly sized and aligned.  If you're going to be doing just
  72. > >> >that, why bother with bitmap displays at all, when a character based
  73. > >> >display will do just as good?
  74. > >> 
  75. > >> Because we do not talk about _text_ displays. You are right that we get
  76. > >> some inefficiencies with non-aligned data. But so with chunky pixels
  77. > >> if your memory isn't pixel oriented (f.e. if the memory is 16bit wide
  78. > >> you "waste" bandwidth on odd addresses).
  79. > >> 
  80. > >> Thus bitplane devices are usually same speed as chunky pixel devices. But
  81. > >> you can scale bitplane devices easily with the obvious performance advantages.
  82. > >> You can never scale chunky pixel devices.
  83. > >"Scale"??  Remember, scaling is at least (in this example) 8x slower in
  84. > >planar than chunky.
  85. > I'm talking about "scaling" the display to different display depths.
  86.  
  87. Chunky has this property too, although only to a power of two.  This
  88. however, is not nearly good enough justification for all the penalties you
  89. get in planar doing everyday operations.  Why use a lesser number of colors
  90. when you can use more for the same, if not better, performance?
  91.  
  92. > And as I also pointed out, bitmap scaling (that's what you thought of)
  93. > is about same speed for chunky and bitplanes.
  94.  
  95. No.  It is not.  You are doing N time the amount of work in planar, where N
  96. is the number of planes.
  97.  
  98. > >> >Oh, obviously.  If you can make this magical piece of hardware, I'm sure
  99. > >> >Commodore has a job position open for you.  Or any other number of chip
  100. > >> >designers.
  101. > >> 
  102. > >> I could probably make that from discrete parts of fpgas but I have no
  103. > >> experience in doing asics or even full custom designs.
  104. > >Why hasn't someone done it already?  Musn't be very cost-effective.
  105. > Correct. Bitplanes have the additional burden to feed a RAMDAC still
  106. > with chunky pixels. Read what I said above. If someone came out with
  107. > a RAMDAC that includes the necessary logic the price difference would
  108. > become much smaller.
  109.  
  110. Best of luck to you.  You are talking really expensive hardware now.  Not
  111. something you'd tack onto an Amiga, or anything, since chunky is here now,
  112. costs less, and doesn't have any of these deficiencies to which your
  113. special-purpose hardware would address.
  114.  
  115. > >Rubbish.  Show me a piece of code that can do that.  More special-case
  116. > >optimizations? (sigh...)
  117. > That's not reall "special case". It is _optimization_, you need to use
  118. > more complicated algorithms with a planar system. I always said: chunky
  119. > is _simpler_ to use.
  120.  
  121. Nope.  "Special case".  You can't use the same algorithm to stretch that
  122. 32x32 image into, say, 64x57 or shrink it to 17x13.  You might be able to
  123. do 64x32 or 32x64.  But that's still a special case optimization.
  124.  
  125. > >But you're saying chunky->bitplane conversion is a small fraction of the
  126. > >whole operation.  It's not.  That ridiculous amount of masking/shifting
  127. > >might even take longer than the matrix multiplications.  For instance, on a
  128. > >68000, each shift takes *2* additional clock cycles! (yuck!)
  129. > Then do not use shifts on 68000. Seems that you talk about advantages
  130. > and disadvantages when using a 68000 processor. Don't forget that an
  131. > 68000 is too slow in any case. That's why the Amiga has a blitter.
  132.  
  133. Shifting is too slow on almost any general purpose processor, not just the
  134. 68000.  Irregardless, you need to do a lot of shifting/masking, which isn't
  135. going to be free on --any-- processor, although custom chips can go a long
  136. way towards hiding this via pipelining/superpipelining.
  137.  
  138. > >> bitmap scaling can bit done on a per-plane basis.
  139. > >As I said, this is 8x the amount of work chunky has to do.  (You're doing
  140. > >it a bit at a time instead of a byte at a time.)
  141. > YOU may do it that way. I simply use a table that maps several pixels
  142. > to their scaled counterparts.
  143.  
  144. Can you use that table to do another transformation, as noted above?  No.
  145. It's a special case optimization.
  146.  
  147. > >You gave enough examples where special vaporware or special-case
  148. > >optimizations might make them break even with chunky's results without
  149. > >any optimization whatsoever.
  150. > My optimizations (which are possible for nearly any operation) show that
  151. > bitplanes break even with chunky's results. That's what I was trying to
  152. > show you. Both are about _same_ speed when handling the same amount of
  153. > data. But bitplanes can be scaled in depth easily while chunky pixels
  154. > cannot. This happends to be a slight advantage for chunky when you use
  155. > 8bit, 16bit or 32bit displays.
  156.  
  157. I'm not going to argue with you about depth scaling.  Given the same depth,
  158. chunky will be faster for all of the above operations, with exception of a
  159. few break-even cases.  Sometimes it will even be faster on chunky *even
  160. with a reduced scale for planar*, since chunky doesn't need 'bit
  161. thrashing'.
  162.  
  163. > >Oh, yeah.  Right.  Most graphics operations consist of 32-bit wide
  164. > >vertical lines, conincidentally placed on a long-word boundary.  Most
  165. > >operations consist of exactly doubling the size of horizontal/vertical
  166. > >dimension.  Most operations consist of blitting data that's perfectly sized
  167. > >and aligned to a perfectly aligned place on the screen.  Yep, that's all of
  168. > >them.  I can't think of any other graphics operations you can do.
  169. > Most time consuming graphics operations consist of modifying larger areas,
  170. > drawing diagonal lines or lots of number crunching to generate an image.
  171. > In the first case bitplanes have an advantage when the image depth is
  172. > different from the memory architecture and a slight disadvantage when
  173. > the image directly maps to the memroy architecture (f.e. 8bits/pixel).
  174. > In the second case you have a major advantage for chunky pixels. But
  175. > the fact that lines cover less memory than filled areas and some
  176. > optimizations possible with non-vertical lines make this advantage less
  177. > important.
  178. > In the third case the rendering speed isn't important as the calculations
  179. > outweigh any efficiency differences.
  180.  
  181. In all cases, you've admitted that chunky is faster than planar (w/
  182. exception of you special case optimization where it breaks even).  I rest
  183. my case.
  184.  
  185. > >Suppose you have hundreds, thousands of blits?  In general the speed of
  186. > >blits isn't that critical for most productivity software, but
  187. > >graphically-oriented software will benefit greatly from chunky
  188. > >architecture.
  189. > Not at all.
  190.  
  191. Do a histogram of a chunky and a planar display.  Tell me how many pixels
  192. of each color are on the screen.  Yet another situation where chunky wins,
  193. bigtime.
  194.  
  195. > >On WHAT???  Where you live?  If you wear underoos?  WHAT???!?? <foaming at
  196. > >the mouth>
  197. > Think of rendering a 2 color horzontal line (the base case for chunky).
  198.  
  199. Would help if you didn't delete too much from the above references.
  200. Plotting an alternating color horizontal line will still be (w/ 8-bit
  201. color) 8x faster on chunky than planar.  Plotting every other pixel a
  202. different color isn't going to make planar faster.
  203.  
  204. > >Oh, I see.  More special case optimizations.  So you SAY it's a 256-color
  205. > >display-  BUT you guarantee the top 2 bitplanes are already clear?
  206. > I don't say it is a 256 color display. That's the major point of bitplanes.
  207. > It can be a 2,4,8,16,32,64,128 or 256 color display and the layering software
  208. > will take into account what you need. Clearing the unused bitplanes (which
  209. > happens if you have several depths in a single viewport) is done _once_
  210. > for each newly created layer.
  211.  
  212. :)  Look, if you want a 128-color display, I won't forbid you from using a
  213. planar architecture.  However, drawing a line will be far faster on a
  214. 256-color chunky than a 128-color planar display.  If you need a
  215. 4,16,256,65536, or true-color display, however, your losses using planar
  216. will be even more dramatic as the number of colors goes up, since you are
  217. wasting 2x, 4x, 8x, 16x, or 32x the amount of time accessing irrelevant
  218. data (still not counting shifting/masking).
  219.  
  220. [another fragment of agreement - color expansion]
  221.  
  222. > Regards,
  223. > -- 
  224. > Michael van Elst
  225. > UUCP:     universe!local-cluster!milky-way!sol!earth!uunet!unido!mpirbn!p554mve
  226. > Internet: p554mve@mpirbn.mpifr-bonn.mpg.de
  227. >                                 "A potential Snark may lurk in every tree."
  228.  
  229. Glenn Doiron
  230. [who thinks planar is fine for dual-playfields in limited video bandwidth,
  231. but would rather have separated dual-chunky playfields instead.]
  232. --
  233. Amiga UUCP+
  234. Origin:  uunet.uu.net!starpt.UUCP!doiron (Organization:68K Software Development)
  235.          BIX: gdoiron
  236. ** Not enough memory to perform requested operation.  Add 4 megs and retry.
  237.