Context for discussion, section 6.6 of this png rfc

* http://tools.ietf.org/html/rfc2083

The forward filter seems trivial, but the backward filter seems
tricky to me if not using loop.  Any idea on a loop free
solution?


NB. Paeth Predictor
paeth=: 3 : 0
p=. +/ 1 1 _1 * y
y{~ (i.<./) |p-y
)

forward=: 4 : 0
prev=. 10$ 3 5 8
iy=. i.10
pae=. 256&| iy - paeth"1 ((-x)}.(x#0),iy),.prev,.((-x)}.(x#0),prev)
)

   3 forward''
253 252 250 3 3 3 3 3 3 3
   4 forward''
253 252 250 0 1 0 4 2 0 6

NB. backward ??
NB. 4 backward 4 forward ''

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to