home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17940 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  6.3 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.0k7v@starpt.UUCP>
  6. Date: 30 Dec 92 03:16:54 GMT
  7. References: <Karsten_Weiss.0n2o@ibase.stgt.sub.org> <1hbngoINNglt@uwm.edu>         <1992Dec29.010853.12840@mpifr-bonn.mpg.de>
  8. Organization: 68K Software Development
  9. Lines: 121
  10. X-NewsSoftware: GRn 1.16f (10.17.92) by Mike Schwartz & Michael B. Smith
  11.  
  12. In article <1992Dec29.010853.12840@mpifr-bonn.mpg.de> mlelstv@specklec.mpifr-bonn.mpg.de (Michael van Elst) writes:
  13. > In <doiron.0k4a@starpt.UUCP> doiron@starpt.UUCP (Glenn Doiron) writes:
  14. > > 32-point line,
  15. > > 2 pixels thick:  512 reads 512 writes       64 writes
  16. > > (Why are bitplanes better for this?  Seems like an additional 960 memory
  17. > >  accesses to me.)
  18. > It would be still 256 reads 256 writes unless the line spans over a word
  19. > boundary. More, shallow lines will need less reads and writes.
  20.  
  21. Whoa, where I come from, you draw a double-thick line by (1) drawing 2
  22. lines next to each other or (2) plotting a 4x4 brush along the course of
  23. the line.  (1) being faster than (2), since you are plotting 1/2 the
  24. points.  When you say "plot this point and the one next to it if it's in
  25. the same word boundary", you are talking special hardware.  BTW you are
  26. still confusing the issue;  you are comparing a 32-bit cpu access planar system
  27. to an 8-bit cpu access chunky system.  I will tell you right now that you will
  28. *NOT* find an 8-bit CPU access chunky pixel system on an Amiga; they will all
  29. be 16-bit or 32-bit.  Chunky can pull 4 pixels in one fell swoop on a 32-bit
  30. system.
  31.  
  32. > However, your line drawing routine will need cycles itself. So unless
  33. > your rendering is done in hardware the difference gets smaller.
  34.  
  35. TMS340x0's have Bresenham's line-drawing algorithm embedded in hardware.
  36. They also support chunky-pixel displays.  They don't support planar
  37. displays.  I wonder why.  Oops, I strayed from the topic too, sorry...
  38.  
  39. > > 32x32 blit:      1536 reads 512 writes      1024 reads, up to 1024 writes
  40. > >         or up to 2304 reads 768 writes
  41. > > (second case if either source or dest. non-aligned)
  42. > > (including transparency/masking)
  43. > 32x32 blit is 512 reads/writes. more for non-aligned objects. chunky
  44. > needs 512 reads/writes and a little more for non-aligned objects.
  45. (I was using the Amiga's blitter as a reference here)
  46. > (Both do word accesses).
  47.  
  48. Here you go again.  First you're talking about 16-bit accesses, now 32-bit
  49. accesses.  Please compare planar 32-bit vs. chunky 32-bit, not planar
  50. 32-bit vs. chunky 8-bit, as you seem oblivious to the differences.  In any
  51. case, the planar system will almost always lose for two reasons:
  52.  
  53.   1  Chunky doesn't need to do a write if this is a transparent pixel.
  54.   2  Chunky doesn't lose time if the data is not perfectly/wholly aligned.
  55.  
  56. Here's the point:  <<EACH SYSTEM HAS TO MOVE THE SAME AMOUNT OF DATA>>,
  57. but <<PLANAR MUST AFFECT ANY ADJACENT PIXELS IN THE BOUNDARY WHILE CHUNKY
  58. DOES NOT>>.  (once again ignoring the shifting/masking aspects which you
  59. seem to patently ignore as if they were of no consequence at all)
  60.  
  61. > > Scaling: 32x32 image, blow up to 64x64
  62. > >  convert to chunky: 8192 reads              no-op
  63. > >  do mathematical xforms                     do mathematical xforms
  64. > >  convert to bitplane: 32768 reads           no-op
  65. > That's easy. 'blow up' is a table lookup which can be done on each bitplane
  66. > independently. No need to convert from and to chunky. If you use a selected
  67. > colormap then you get filtering/dithering of the image for free.
  68. > BTW, that's the same speed for chunky/bitplanes.
  69.  
  70. So how is doing 8x the number of mathematical transformations possibly
  71. going to be faster, not to mention the masking/bit shifting?  And 'table
  72. look-up' isn't anywheres close to general purpose.  Once again, you're
  73. talking about a special-case optimisation, one that can also be done with
  74. chunky pixels just as well.
  75.  
  76. > >OK, now tell me which one will be slower?  I'm not even factoring in the
  77. > >ridiculous amount of bit-shifting and masking involved in all these
  78. > >operations for AGA (excluding the 32x32 blit... blitter was assumed).
  79. > Chunky wins slightly in most operations IF you use a 256 color image.
  80. > It looses with a depth != 8.
  81.  
  82. Planar loses almost *always* in these operations, even if you have
  83. dedicated hardware like the Amiga's blitter.
  84.  
  85. > BTW, 32x32 blit is tiny, what about 50x50
  86. > or 156x200 ? 
  87.  
  88. Planars's losses go up directly as your blit gets larger.  The overhead for
  89. the mathematical xforms is the same, but with what you're saying, planar
  90. will take N times longer, where N is the number of bitplanes.
  91.  
  92. > And since we were talking about 'image processing'. Most tools
  93. > have some sort of GUI which eats some of the 256 colors. The easiest
  94. > way is to go down to 128 colors. Bitplanes will then be faster for 12.5%.
  95.  
  96. Bitplanes will be faster for 12.5% whenever you have data that is perfectly
  97. aligned, perfectly sized, and special hardware to do those shifting and
  98. masking operations which you seemingly dismiss as taking no cpu-time
  99. whatsoever {evil grin}.  Unfortunately, this is seldom the case, and even
  100. in 7-bit color chunky will win in most of the operations being discussed.
  101. Now, if you are talking about copying entire screens of data, like ANIM,
  102. yes, planar can take that 12.5% speedup.  But most graphic operations will
  103. do much better on planar than chunky.
  104.  
  105. Tell you what.  Code a routine that
  106. will plot a line from (X1,Y1) to (X2,Y2) in color C on an 8-bitplane 32-bit
  107. access system.  Now do the same thing for an 8-bit chunky 32-bit access
  108. system.  Look at the code.  Tell me which one is doing (a *hell of a lot*)
  109. more calculations.   Which one accessing video memory (a *hell of a lot*)
  110. more often.  Now, tell me which one is going to run faster on *any*
  111. machine?
  112.  
  113.  INCLUDE "misc/end_of_thread.i"
  114.  
  115. > Regards,
  116. > -- 
  117. > Michael van Elst
  118. > UUCP:     universe!local-cluster!milky-way!sol!earth!uunet!unido!mpirbn!p554mve
  119. > Internet: p554mve@mpirbn.mpifr-bonn.mpg.de
  120. >                                 "A potential Snark may lurk in every tree."
  121.  
  122. Glenn Doiron
  123. --
  124. Amiga UUCP+
  125. Origin:  uunet.uu.net!starpt.UUCP!doiron (Organization:68K Software Development)
  126.          BIX: gdoiron
  127. ** Not enough memory to perform requested operation.  Add 4 megs and retry.
  128.