home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17948 < prev    next >
Encoding:
Text File  |  1992-12-30  |  6.7 KB  |  144 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!mcsun!Germany.EU.net!mpifr-bonn.mpg.de!speckled.mpifr-bonn.mpg.de!mlelstv
  3. From: mlelstv@speckled.mpifr-bonn.mpg.de (Michael van Elst)
  4. Subject: Re: Chunky Pixels vs. Bitplanes (was: Chunky Chip Set...)
  5. Message-ID: <1992Dec30.115759.22097@mpifr-bonn.mpg.de>
  6. Sender: news@mpifr-bonn.mpg.de
  7. Nntp-Posting-Host: speckled
  8. Organization: Max-Planck-Institut f"ur Radioastronomie
  9. References: <Karsten_Weiss.0n2o@ibase.stgt.sub.org> <1hbngoINNglt@uwm.edu>         <1992Dec29.010853.12840@mpifr-bonn.mpg.de> <doiron.0k7v@starpt.UUCP>
  10. Date: Wed, 30 Dec 1992 11:57:59 GMT
  11. Lines: 131
  12.  
  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.  
  23. >the same word boundary", you are talking special hardware.  BTW you are
  24. >still confusing the issue;  you are comparing a 32-bit cpu access planar system
  25. >to an 8-bit cpu access chunky system.
  26.  
  27. A 32 point line with 8 bitplanes needs 32 * 8 reads and writes _worst_case_.
  28. A two pixel wide line will need the same if all pixels are in one memory word
  29. (bytes, words,longwords whatever).
  30.  
  31. Where do I refer to a 32bit CPU ??? Where do I even _talk_ about a CPU ?
  32.  
  33. >> However, your line drawing routine will need cycles itself. So unless
  34. >> your rendering is done in hardware the difference gets smaller.
  35.  
  36. >TMS340x0's have Bresenham's line-drawing algorithm embedded in hardware.
  37. >They also support chunky-pixel displays.  They don't support planar
  38. >displays.  I wonder why.  Oops, I strayed from the topic too, sorry...
  39.  
  40. Simple. The display hardware to _show_ bitplanes needs additional
  41. shiftregisters and buffer which makes the hardware more expensive.
  42.  
  43. >> > 32x32 blit:      1536 reads 512 writes      1024 reads, up to 1024 writes
  44. >> >         or up to 2304 reads 768 writes
  45. >> > (second case if either source or dest. non-aligned)
  46. >> > (including transparency/masking)
  47. >> 
  48. >> 32x32 blit is 512 reads/writes. more for non-aligned objects. chunky
  49. >> needs 512 reads/writes and a little more for non-aligned objects.
  50. >(I was using the Amiga's blitter as a reference here)
  51. >> (Both do word accesses).
  52.  
  53. >Here you go again.  First you're talking about 16-bit accesses, now 32-bit
  54. >accesses.  Please compare planar 32-bit vs. chunky 32-bit, not planar
  55. >32-bit vs. chunky 8-bit, as you seem oblivious to the differences.  In any
  56. >case, the planar system will almost always lose for two reasons:
  57.  
  58. 32x32 pixels (well-aligned) with 8 bitplanes need 2x32x8 fetches and stores.
  59. (2 words per line, 32 lines, 8 planes). In chunky you have 16x32 fetches 
  60. and stores (16 wrods per line, 32 lines).
  61.  
  62. I didn't ever say anything about 32bit accesses not do I refer to 8bit
  63. chunky accesses. Both used 16bit transfers.
  64.  
  65. >  1  Chunky doesn't need to do a write if this is a transparent pixel.
  66. >  2  Chunky doesn't lose time if the data is not perfectly/wholly aligned.
  67.  
  68. Chunky _needs_ to write transparent pixels and _needs_ to care about
  69. alignment _if_ you do memory access larger than a pixel. You either
  70. have to use _8bit_ accesses or use the complete buswidth with the
  71. same constraints as in bitplanes.
  72.  
  73. >Here's the point:  <<EACH SYSTEM HAS TO MOVE THE SAME AMOUNT OF DATA>>,
  74. >but <<PLANAR MUST AFFECT ANY ADJACENT PIXELS IN THE BOUNDARY WHILE CHUNKY
  75. >DOES NOT>>.  (once again ignoring the shifting/masking aspects which you
  76. >seem to patently ignore as if they were of no consequence at all)
  77.  
  78. Shifting/Masking is a no-time operation in hardware. If you talk about
  79. general purpose CPUs then please account for instruction fetches as well.
  80.  
  81. >So how is doing 8x the number of mathematical transformations possibly
  82. >going to be faster, not to mention the masking/bit shifting?  And 'table
  83. >look-up' isn't anywheres close to general purpose.  Once again, you're
  84. >talking about a special-case optimisation, one that can also be done with
  85. >chunky pixels just as well.
  86.  
  87. You were refering to the _special_ case of expanding a bitmap by the factor
  88. of 2. I gave an example.
  89.  
  90. You also do not use 8x the number of mathematical transforms.
  91.  
  92. There is either the application of having numerical data to transform
  93. and display (remember: bitplanes are just for _display_ operations).
  94. There you need the chunky->bitplane conversion but which is only
  95. a small fraction of the _whole_ operation.
  96.  
  97. And when operations in the bitplane domain are feasible (i.e. when the
  98. numerical _value_ of a pixel is of no concern) then you can operate
  99. on individual bitplanes and get _multiple_ pixels per memory fetch
  100. which _exactly_ outweighs the factor of havint _multiple_ bitplanes.
  101. As I said, in the end the memory bandwidth determines the speed of
  102. your operation and bitplanes do not use more memory than chunky pixels.
  103.  
  104. >Planars's losses go up directly as your blit gets larger.  The overhead for
  105. >the mathematical xforms is the same, but with what you're saying, planar
  106. >will take N times longer, where N is the number of bitplanes.
  107.  
  108. Which is complete garbage. In bitplanes you write your transforms to handle
  109. several pixel bits at _once_.
  110.  
  111. >Bitplanes will be faster for 12.5% whenever you have data that is perfectly
  112. >aligned, perfectly sized, and special hardware to do those shifting and
  113. >masking operations which you seemingly dismiss as taking no cpu-time
  114. >whatsoever {evil grin}.  Unfortunately, this is seldom the case, and even
  115. >in 7-bit color chunky will win in most of the operations being discussed.
  116.  
  117. Why do you  deny the facts ?
  118.  
  119. >Now, if you are talking about copying entire screens of data, like ANIM,
  120. >yes, planar can take that 12.5% speedup.  But most graphic operations will
  121. >do much better on planar than chunky.
  122.  
  123. Correct :) Most graphic operations do much better on planar than chunky :)
  124.  
  125. >Tell you what.  Code a routine that
  126. >will plot a line from (X1,Y1) to (X2,Y2) in color C on an 8-bitplane 32-bit
  127. >access system.  Now do the same thing for an 8-bit chunky 32-bit access
  128. >system.  Look at the code.  Tell me which one is doing (a *hell of a lot*)
  129. >more calculations.   Which one accessing video memory (a *hell of a lot*)
  130. >more often.  Now, tell me which one is going to run faster on *any*
  131. >machine?
  132.  
  133. As I said, drawing a single pixel wide line wins on chunky.
  134.  
  135. Now render a 64 color image to your 256 color display :) Or render
  136. a black/white text in your window on a 256 color desktop.
  137.  
  138. Regards,
  139. -- 
  140. Michael van Elst
  141. UUCP:     universe!local-cluster!milky-way!sol!earth!uunet!unido!mpirbn!p554mve
  142. Internet: p554mve@mpirbn.mpifr-bonn.mpg.de
  143.                                 "A potential Snark may lurk in every tree."
  144.