9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] image/memimage speed
@ 2008-11-30 22:00 Iruata Souza
  2008-11-30 23:54 ` Iruata Souza
  0 siblings, 1 reply; 25+ messages in thread
From: Iruata Souza @ 2008-11-30 22:00 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

9fans,

I'm playing with nearest-neighbor image resampling and wrote two
simple implementations - http://tmp.oitobits.net/iru/nn.c,
http://tmp.oitobits.net/iru/nnmem.c - one using draw(2) and the other
using memdraw(2).

running them on the same image on disk shows that nnmem is way faster:

cpu% nnmem acme.wd
spent 0.127344 seconds on resampling
cpu% nn acme.wd
spent 6.111893 seconds on resampling

looking at the code you see nn.c calls unloadimage() to fill oscan
with the data from m; oscan is then used for the interpolation. that
pass is not needed in nnmem.c because of byteaddr() gives us the
address of the first byte of data in m, the memimage in question.

what I'm seeking is a way to avoid the unloadimage() call in nn.c, if
that's possible - which, by my understanding of the manual and code,
is not.
alternatively I could try drawing the memimage to the screen, which I
did not find possible directly, only by converting it to an image.
any ideas?

sorry if I'm missing the obvious.

iru



^ permalink raw reply	[flat|nested] 25+ messages in thread
* Re: [9fans] image/memimage speed
@ 2008-12-01 15:24 plalonde
  2008-12-05  5:22 ` sqweek
  0 siblings, 1 reply; 25+ messages in thread
From: plalonde @ 2008-12-01 15:24 UTC (permalink / raw)
  To: 9fans; +Cc: 9fans

[-- Attachment #1: Type: text/html, Size: 1202 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2008-12-08  0:17 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-30 22:00 [9fans] image/memimage speed Iruata Souza
2008-11-30 23:54 ` Iruata Souza
2008-12-01  1:29   ` erik quanstrom
2008-12-01  1:54     ` andrey mirtchovski
2008-12-01  2:35       ` erik quanstrom
2008-12-01  3:30         ` andrey mirtchovski
2008-12-01  6:41         ` Paul Lalonde
2008-12-01 14:19     ` Steve Simon
2008-12-01 14:33       ` erik quanstrom
2008-12-05  6:39         ` ron minnich
2008-12-05 13:35           ` erik quanstrom
2008-12-05 18:27             ` Russ Cox
2008-12-05 18:32               ` Russ Cox
2008-12-05 18:49                 ` ron minnich
2008-12-05 19:21                   ` Paul Lalonde
2008-12-05 19:25                     ` erik quanstrom
2008-12-05 19:30                       ` Paul Lalonde
2008-12-05 19:40                         ` erik quanstrom
2008-12-05 20:11                         ` ron minnich
2008-12-06  5:52                           ` Paul Lalonde
2008-12-07 17:00               ` Aki Nyrhinen
2008-12-07 23:22                 ` erik quanstrom
2008-12-08  0:17                   ` Aki Nyrhinen
2008-12-01 15:24 plalonde
2008-12-05  5:22 ` sqweek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).