[ptx] RLE encoding images.

Pablo d'Angelo pablo.dangelo at web.de
Tue May 4 18:09:55 BST 2004


On Tue, 04 May 2004, Terje Mathisen wrote:

> [Terje, all your messages are being delayed on the server because
> they are being sent to ptx-bounces at email-lists.org instead of
> the right address: ptx at email-lists.org - Bruno]
> 
> ptx-bounces at email-lists.org wrote:
> 
> It will be faster for read access, and _much_ faster for reading off 
> disks, but random, in-place, updates are going to be quite slow:
> 
> There is almost no chance of doing any modifications to an RL-encoded 
> line without changing the total length, which means that you'll need to 
> reallocate memory for it.

Actually, the masks do not change significantly, in the majority of cases,
its just the border that moves. These changes can be done without adding a
new entry in the RL array. And with preallocated data structures, like the
stl::vector, allocations are not really needed most of the time, just
copying.. but if the mask consists of only 10 or 20 RLE elements in a row, I
don't think this is a major problem.

> The easiest approach is to use copy-on-write, where you allow random 
> access to the compressed array, but expand it when starting any updates, 
> and re-compress when you're done, or when flushing back to disk.

As noted above, I think its not nessecary to do this for the computations
involving masks, but we'll see in the future. There are some vertical
traversals in the distance transform code which would make that technique
quite slow, I think.

ciao
  Pablo


More information about the ptX mailing list