# HG changeset patch # User Sunset # Date 1707360623 28800 # Wed Feb 07 18:50:23 2024 -0800 # Branch quail # Node ID 823a61189fae0277c3ff1209f33503e71326ad50 # Parent 97e700811f197178a0d825e8da91edddfdf8a4a5 Updated spec diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -30,17 +30,19 @@ #### Indexes -QUAIL uses three indexes - Microindex (8 entries), Macroindex (256 entries), Last Level Index (4096 entries). Accessed via hash of pixel, modulo size of index. Pixel encoding is hashed index. Every index miss (ie, falling through to a longer word type) results in insertion of pixel into the index. +QUAIL uses three indexes - Microindex (8 entries), Macroindex (256 entries), Last Level Index (4096 entries). These work similarly to the single-level index on QOI; the pixel value is hashed using the algorithm above to access the index. If an identical pixel is present in the index, a Retrieve From Index word is emitted for this pixel; if it is not, then the pixel is inserted into the index for future use. + +As an example, if a pixel is not present in the microindex and is instead emitted as a "diff" word, it is also added to the microindex and, unless evicted by another pixel with the same hash, can be used by a later identical pixel using a Retrieve From Microindex word. ### Encoding Words -- 1iii - Index Into Microindex -- 0010 llll - short run -- 0100 iiii iiii - Index into Macroindex -- 0011 llll llll - long run +- 1iii - Retrieve From Microindex +- 0010 llll - Short Run +- 0100 iiii iiii - Retrieve From Macroindex +- 0011 llll llll - Long Run - 000r rrgg gbbb - Diff - 0110 gggg ggrr rbbb - Microluma; like Medium Luma with shrunken fields -- 0101 0010 iiii iiii iiii - Index into pixel Last Level Index +- 0101 0010 iiii iiii iiii - Retrieve From Last Level Index - 0111 gggg ggrr rrrb bbbb - Medium Luma, where g is difference green, r is (difference red - difference green), b is (difference blue - difference green) - 0101 1ggg gggg rrrr rrbb bbbb - Megaluma; like Medium Luma with expanded fields - 0101 0001 rrrr rrrr gggg gggg bbbb bbbb - Immediate RGB pixel