3.1.9.1.2.1 De-Blocking

Each compressed stream MUST begin with an RDP_SEGMENTED_DATA (section 2.2.5.1) structure. A descriptor field value of SINGLE (0xE0) indicates that the original input was processed as one segment. The segmentCount and uncompressedSize fields are omitted, and the entire remainder of the input is passed as one segment to the decoder.

If the value of the descriptor field is MULTIPART (0xE1), the input was possibly too large to be represented in a single segment, typically because the uncompressed byte count exceeds 65,535 or a smaller count due to compressor implementation limits. The 16-bit segmentCount field indicates the number of segments whose decompressed output will be concatenated to reconstruct the entire output. The 32-bit uncompressedSize field MUST equal the total number of decompressed bytes (the sum of the decompressed size of all segments). The value in the uncompressedSize field can be used by the decompressor to allocate a reassembly buffer.

Each segment of compressed data appears in an RDP_DATA_SEGMENT (section 2.2.5.2) structure. When the value of the descriptor field is MULTIPART (0xE1), the size field of the RDP_DATA_SEGMENT structure indicates the number of encoded bytes to be decoded. When the descriptor field value is SINGLE (0xE0), the size field is omitted, and the number of encoded bytes can be derived from the total size of the provided RDP_SEGMENTED_DATA structure (the total input size minus the size of the 1-byte descriptor field).