diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2013-02-17 05:07:51 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2013-02-17 05:09:46 -0500 |
commit | 8c97066098970b9fc6b21fb0fbcd3357bbe76e4a (patch) | |
tree | 03da7d7a0ff45aee8798f60a222f3eec9760179b | |
parent | f68afe7fbe033f733c5e715d98ca6edd293ff0ee (diff) |
TODOtrace
compre
TODO
-rw-r--r-- | trace/TODO | 89 | ||||
-rw-r--r-- | trace/compress | 32 |
2 files changed, 89 insertions, 32 deletions
diff --git a/trace/TODO b/trace/TODO new file mode 100644 index 00000000..fa823c04 --- /dev/null +++ b/trace/TODO @@ -0,0 +1,89 @@ +Keep track of memory that are returned to the application: + + - what if any ID owns it currently + - what file position does it correspond to + +Also a map from image pointer to ID. Maybe this map could just be +extended, though we do need the ability to get a file position from an +application pointer. + +There are the following commands: +- COPY (d, s, n) that copies n bytes from file offset s to file offset d. +- BZERO (d, n) that zeros n bytes at file offset d +- SKIP (n) that causes the interpreter to skip n bytes in addition to + the 8 it already processed. + +For CREATE_BITS, the data pointer is never NULL, and it is given as a +file offset. + +When a new image is created: + +- If bits is NULL, then + - generate a SKIP command that skips over the requested + number of bytes + - if initializing, generate a BZERO command that initializes + those bytes + - emit CREATE_BITS with a pointer to allocated bytes + +- If bits is not NULL, then + - if the address is completely within the space of an + older image, then + - if the older image has been freed, + - store the new data and SKIP over them + - generate a COPY to copy into the older space + - generate a CREATE_BITS with a pointer to the + position within the file + + - else, store new data and SKIP, and generate CREATE_BITS with a + pointer to that data. + +* Tracking write access + +When an image is created, the data is write protected. If the +application draws to the image, it is marked as externally modified +and unprotected. + +When an image is used, if it is marked as externally modified, the +data is emitted and COPYed into the original position. If it is not +marked as externally modified, it is unprotected, the operation is +carried out, and then the image is protected again. + + + +* Compression: + +- It may be interesting to compress some of the image data. In + particular data that is only used by COPY commands. + + Random ideas: + + - When a new image arrives, find a compression candidate based on the + image properties. Ie., the latest image with similar size and + properties. + + Then compute the bytewise difference "new - old", with overflow. If + there are no differences anywhere, then simply store a pointer to + the old image. + + If there are differences, then store the residual tile by tile, + compressed with something that handles runlength encoding well. + + Depths: 1, 4, 8, 16, 32 + + Stride is fortunately a whole number of bytes. + + 1: 1 byte @8 lines + 4: 4 bytes @8 lines + 8: 8 bytes @8 lines + 16: 16 bytes @8 lines + 32: 32 bytes @8 lines + + Do we store x-bytes? Yes. + + Endianness? Simplest thing is to just ignore big endian. + + At the end of the file, store an index of all the images. + + Worth considering: If an image is the result of compositing other + images, it could conceivably be stored in the trace as simply "image + foo followed by composite operation bar" diff --git a/trace/compress b/trace/compress deleted file mode 100644 index a3225334..00000000 --- a/trace/compress +++ /dev/null @@ -1,32 +0,0 @@ -- Keep a list of images, marked with size, format, hashcode, dst/src - -- When a new image arrives, find a compression candidate based on the - image properties. Ie., the latest image with similar size and - properties. - - Then compute the bytewise difference "new - old", with overflow. If - there are no differences anywhere, then simply store a pointer to - the old image. - - If there are differences, then store the residual tile by tile, - compressed with something that handles runlength encoding well. - -Depths: 1, 4, 8, 16, 32 - -Stride is fortunately a whole number of bytes. - -1: 1 byte @8 lines -4: 4 bytes @8 lines -8: 8 bytes @8 lines -16: 16 bytes @8 lines -32: 32 bytes @8 lines - -Do we store x-bytes? Yes. - -Endianness? Simplest thing is to just ignore big endian. - -At the end of the file, store an index of all the images. - -Worth considering: If an image is the result of compositing other -images, it could conceivably be stored in the trace as simply "image -foo followed by composite operation bar" |