2.2.2.2.1 NSCodec RLE Run Segment (NSCODEC_RLE_RUN_SEGMENT)
The NSCODEC_RLE_RUN_SEGMENT structure is used to represent an RLE run (section 3.1.8.1).
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
3 |
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
RunValue |
RunConfirm |
RunLengthFactor1 |
RunLengthFactor2 (optional) |
||||||||||||||||||||||||||||
|
... |
|||||||||||||||||||||||||||||||
RunValue (1 byte): An 8-bit, unsigned integer that contains a value from the uncompressed A, Y, Co, or Cg color plane (the Co and Cg planes MUST have color loss reduction ([MS-RDPEGDI] section 3.1.9.1.4) applied prior to RLE compression, as specified in section 3.1.8.3). The allowed ranges of the values contained in the A, Y, Co, and Cg color planes are specified in [MS-RDPEGDI] section 3.1.9.1.2 (note that color loss reduction will reduce the range of the values in the Co and Cg planes by at least half). The RunValue field MUST be equal to the RunConfirm field to identify the structure as an NSCodec RLE Run Segment.
RunConfirm (1 byte): An 8-bit, unsigned integer that MUST be equal to the RunValue field value to identify the structure as an NSCodec RLE run segment.
RunLengthFactor1 (1 byte): An 8-bit field. If this value is less than 255 (0xFF), the RunLengthFactor2 field MUST NOT be present, and the run length (the number of times the value of the RunValue field was repeated in the original color plane data) equals RunLengthFactor1 + 2. If RunLengthFactor1 equals 255 (0xFF), the RunLengthFactor2 field MUST be present, and the run length is calculated based solely on the RunLengthFactor2 field.
RunLengthFactor2 (4 bytes): An optional 32-bit field that contains the run length. This field SHOULD NOT be used if the run length is smaller than 256.