Constant flic::codec::FLI_SS2 [] [src]

pub const FLI_SS2: u16 = 7

Magic for a FLI_SS2 chunk - Word Aligned Delta Compression.

This format contains the differences between consecutive frames. This is the format most often used by Animator Pro for frames other than the first frame of an animation. It is similar to the line coded delta (LC) compression, but is word oriented instead of byte oriented. The data is organized into lines and each line is organized into packets.

The first word in the data following the chunk header contains the number of lines in the chunk. Each line can begin with some optional words that are used to skip lines and set the last byte in the line for animations with odd widths. These optional words are followed by a count of the packets in the line. The line count does not include skipped lines.

The high order two bits of the word is used to determine the contents of the word.

Bit 15 Bit 14 Meaning
0 0 The word contains the packet count. The packets follow this word. The packet count can be zero; this occurs when only the last pixel on a line changes.
1 0 The low order byte is to be stored in the last byte of the current line. The packet count always follows this word.
1 1 The word contains a line skip count. The number of lines skipped is given by the absolute value of the word. This word can be followed by more skip counts, by a last byte word, or by the packet count.

The packets in each line are similar to the packets for the line coded chunk. The first byte of each packet is a column skip count. The second byte is a packet type. If the packet type is positive, the packet type is a count of words to be copied from the packet to the animation image. If the packet type is negative, the packet contains one more word which is to be replicated. The absolute value of the packet type gives the number of times the word is to be replicated. The high and low order byte in the replicated word do not necessarily have the same value.