3.1.8.2.2 Compressing Data

 Compression using RDP6.1-BC is based on the principles outlined in [MS-RDPBCGR] section 3.1.8 with literals and copy-tuples (matches) being encoded using the scheme described in section 2.2.2.4.1. The RDP6.1-BC compressor is stream-based and, as such, is able to include copy-tuples (referred to as "history matches") that have just been added to the current packet being processed; that is, as data is appended to the local history buffer, it can immediately be referenced in the next match. Matches MUST be in stream-order so that a match does not refer to any data not yet received by the target endpoint. Note that every encoded match incurs an overhead of 8 bytes when it is described by the RDP 6.1 Match Details (section 2.2.2.4.1.1) structure. For this reason, an RDP 6.1 compliant compressor SHOULD exclude matches that result in expansion.

The following flowchart describes how the RDP6.1-BC compression algorithm operates.

The RDP 6.1 bulk compression algorithm

Figure 12: The RDP 6.1 bulk compression algorithm