home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17963 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  9.8 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.0ka3@starpt.UUCP>
  6. Date: 30 Dec 92 22:05:30 GMT
  7. References: <Karsten_Weiss.0n2o@ibase.stgt.sub.org> <1hbngoINNglt@uwm.edu>          <1992Dec30.115759.22097@mpifr-bonn.mpg.de>
  8. Organization: 68K Software Development
  9. Lines: 203
  10. X-NewsSoftware: GRn 1.16f (10.17.92) by Mike Schwartz & Michael B. Smith
  11.  
  12. In article <1992Dec30.115759.22097@mpifr-bonn.mpg.de> mlelstv@speckled.mpifr-bonn.mpg.de (Michael van Elst) writes:
  13. > In <doiron.0k7v@starpt.UUCP> doiron@starpt.UUCP (Glenn Doiron) writes:
  14. > >> In <doiron.0k4a@starpt.UUCP> doiron@starpt.UUCP (Glenn Doiron) writes:
  15. > >> > 32-point line,
  16. > >> > 2 pixels thick:  512 reads 512 writes       64 writes
  17. > >> > (Why are bitplanes better for this?  Seems like an additional 960 memory
  18. > >> >  accesses to me.)
  19. > >> 
  20. > >> It would be still 256 reads 256 writes unless the line spans over a word
  21. > >> boundary. More, shallow lines will need less reads and writes.
  22. > >the same word boundary", you are talking special hardware.  BTW you are
  23. > >still confusing the issue;  you are comparing a 32-bit cpu access planar system
  24. > >to an 8-bit cpu access chunky system.
  25. > A 32 point line with 8 bitplanes needs 32 * 8 reads and writes _worst_case_.
  26. > A two pixel wide line will need the same if all pixels are in one memory word
  27. > (bytes, words,longwords whatever).
  28.  
  29. Once again, you are talking about special hardware.  Even then, chunky can
  30. have the same optimization.  Where is this awesome planar advantage?
  31. Chunky is still going to take 32 writes, max.
  32.  
  33. > Where do I refer to a 32bit CPU ??? Where do I even _talk_ about a CPU ?
  34.  
  35. Well, I was referring to your double-pixel line timings.  Once again, I
  36. wasn't taking into effect your special hardware.
  37.  
  38. > >> However, your line drawing routine will need cycles itself. So unless
  39. > >> your rendering is done in hardware the difference gets smaller.
  40. > >TMS340x0's have Bresenham's line-drawing algorithm embedded in hardware.
  41. > >They also support chunky-pixel displays.  They don't support planar
  42. > >displays.  I wonder why.  Oops, I strayed from the topic too, sorry...
  43. > Simple. The display hardware to _show_ bitplanes needs additional
  44. > shiftregisters and buffer which makes the hardware more expensive.
  45.  
  46. Nope.  RAMDAC's show the display, buddy.  Not the TI chip.  And getting a
  47. planar display out of VRAM is a trick I'd like to see... well it could be
  48. done, if you want to store one plane in each VRAM, then muck about with the
  49. hardware, majorly.
  50.  
  51. > >> > 32x32 blit:      1536 reads 512 writes      1024 reads, up to 1024 writes
  52. > >> >         or up to 2304 reads 768 writes
  53. > >> > (second case if either source or dest. non-aligned)
  54. > >> > (including transparency/masking)
  55. > >> 
  56. > >> 32x32 blit is 512 reads/writes. more for non-aligned objects. chunky
  57. > >> needs 512 reads/writes and a little more for non-aligned objects.
  58. > >(I was using the Amiga's blitter as a reference here)
  59. > >> (Both do word accesses).
  60. > >Here you go again.  First you're talking about 16-bit accesses, now 32-bit
  61. > >accesses.  Please compare planar 32-bit vs. chunky 32-bit, not planar
  62. > >32-bit vs. chunky 8-bit, as you seem oblivious to the differences.  In any
  63. > >case, the planar system will almost always lose for two reasons:
  64. > 32x32 pixels (well-aligned) with 8 bitplanes need 2x32x8 fetches and stores.
  65. > (2 words per line, 32 lines, 8 planes). In chunky you have 16x32 fetches 
  66. > and stores (16 wrods per line, 32 lines).
  67.  
  68. Once again, you are considering the best, break-even case, where all your
  69. data is perfectly sized and aligned.  If you're going to be doing just
  70. that, why bother with bitmap displays at all, when a character based
  71. display will do just as good?
  72.  
  73. > I didn't ever say anything about 32bit accesses not do I refer to 8bit
  74. > chunky accesses. Both used 16bit transfers.
  75. > >  1  Chunky doesn't need to do a write if this is a transparent pixel.
  76. > >  2  Chunky doesn't lose time if the data is not perfectly/wholly aligned.
  77. > Chunky _needs_ to write transparent pixels and _needs_ to care about
  78. > alignment _if_ you do memory access larger than a pixel. You either
  79. > have to use _8bit_ accesses or use the complete buswidth with the
  80. > same constraints as in bitplanes.
  81.  
  82. Do you know what data port sizes are?  Even if that was the case, worst
  83. case chunky could be blowing, say, 3/4 of it's time because only one pixel
  84. was needed.  Planar will be wasting 31/32 of it's time worst case.
  85.  
  86. > >Here's the point:  <<EACH SYSTEM HAS TO MOVE THE SAME AMOUNT OF DATA>>,
  87. > >but <<PLANAR MUST AFFECT ANY ADJACENT PIXELS IN THE BOUNDARY WHILE CHUNKY
  88. > >DOES NOT>>.  (once again ignoring the shifting/masking aspects which you
  89. > >seem to patently ignore as if they were of no consequence at all)
  90. > Shifting/Masking is a no-time operation in hardware. If you talk about
  91. > general purpose CPUs then please account for instruction fetches as well.
  92.  
  93. Oh, obviously.  If you can make this magical piece of hardware, I'm sure
  94. Commodore has a job position open for you.  Or any other number of chip
  95. designers.
  96.  
  97. > >So how is doing 8x the number of mathematical transformations possibly
  98. > >going to be faster, not to mention the masking/bit shifting?  And 'table
  99. > >look-up' isn't anywheres close to general purpose.  Once again, you're
  100. > >talking about a special-case optimisation, one that can also be done with
  101. > >chunky pixels just as well.
  102. > You were refering to the _special_ case of expanding a bitmap by the factor
  103. > of 2. I gave an example.
  104. > You also do not use 8x the number of mathematical transforms.
  105.  
  106. You are doing the same transformations 8 times, once for each bitplane.
  107. This is not 8x the number of transformations?  You deny facts?
  108.  
  109. > There is either the application of having numerical data to transform
  110. > and display (remember: bitplanes are just for _display_ operations).
  111. > There you need the chunky->bitplane conversion but which is only
  112. > a small fraction of the _whole_ operation.
  113.  
  114. With this highly magical vaporhardware you keep falling back on,
  115. chunky->bitplane conversion should take no time at all!
  116.  
  117. > And when operations in the bitplane domain are feasible (i.e. when the
  118. > numerical _value_ of a pixel is of no concern)
  119.  
  120. huh?  How about an example to un-confuse me?
  121.  
  122. > then you can operate
  123. > on individual bitplanes and get _multiple_ pixels per memory fetch
  124. > which _exactly_ outweighs the factor of havint _multiple_ bitplanes.
  125. > As I said, in the end the memory bandwidth determines the speed of
  126. > your operation and bitplanes do not use more memory than chunky pixels.
  127.  
  128. I don't deny that bitplanes don't use more memory than chunky pixels, it's
  129. just that 90% of all operations are going to be faster on chunky pixels.
  130.  
  131. > >Planars's losses go up directly as your blit gets larger.  The overhead for
  132. > >the mathematical xforms is the same, but with what you're saying, planar
  133. > >will take N times longer, where N is the number of bitplanes.
  134. > Which is complete garbage. In bitplanes you write your transforms to handle
  135. > several pixel bits at _once_.
  136.  
  137. Some magical software to go with that magical hardware?  Or more
  138. special-case optimizations?
  139.  
  140. > >Bitplanes will be faster for 12.5% whenever you have data that is perfectly
  141. > >aligned, perfectly sized, and special hardware to do those shifting and
  142. > >masking operations which you seemingly dismiss as taking no cpu-time
  143. > >whatsoever {evil grin}.  Unfortunately, this is seldom the case, and even
  144. > >in 7-bit color chunky will win in most of the operations being discussed.
  145. > Why do you  deny the facts ?
  146.  
  147. I don't.  However, you seem oblivious to the drawbacks of pixel-based
  148. operations in a planar display.  Even blit operations will almost always
  149. take more time on planar displays.
  150.  
  151. > >Now, if you are talking about copying entire screens of data, like ANIM,
  152. > >yes, planar can take that 12.5% speedup.  But most graphic operations will
  153. > >do much better on planar than chunky.
  154. > Correct :) Most graphic operations do much better on planar than chunky :)
  155.  
  156. Tip of the slounge :)
  157.  
  158. > >Tell you what.  Code a routine that
  159. > >will plot a line from (X1,Y1) to (X2,Y2) in color C on an 8-bitplane 32-bit
  160. > >access system.  Now do the same thing for an 8-bit chunky 32-bit access
  161. > >system.  Look at the code.  Tell me which one is doing (a *hell of a lot*)
  162. > >more calculations.   Which one accessing video memory (a *hell of a lot*)
  163. > >more often.  Now, tell me which one is going to run faster on *any*
  164. > >machine?
  165. > As I said, drawing a single pixel wide line wins on chunky.
  166.  
  167. Wow... agreement.. (even if slightly incorrect)
  168. However, drawing a n-pixel wide line also wins on chunky (where n>0 :)
  169.  
  170. > Now render a 64 color image to your 256 color display :) 
  171.  
  172. See the above mentioned case of blits.  The best you can hope for is a tie,
  173. since with planar you have to clear the top two bitplanes anyways.
  174.  
  175. > Or render
  176. > a black/white text in your window on a 256 color desktop.
  177.  
  178. See above.  You still have to clear the other bitplanes.  And some chunky
  179. hardware supports color expansion, too, where you take a single-bit image
  180. and can expand all 0's to one color and 1's to another.  Of course, a
  181. similar thing could be done for planar, but you still have the
  182. masking/shifting/bandwidth on unaffected pixels problems.  (Say it 3 times
  183. real fast.)
  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. (yes, C.A., it's fun, because he's on my own turf, and I WILL fight with
  194. unarmed people)
  195. -- 
  196. Amiga UUCP+
  197. Origin:  uunet.uu.net!starpt.UUCP!doiron (Organization:68K Software Development)
  198.          BIX: gdoiron
  199. ** Not enough memory to perform requested operation.  Add 4 megs and retry.
  200.