locked
[MS-RDPEGDI] Incomplete RDP6 RLE Planar Compression Documentation RRS feed

  • Question

  • Hi,

    I have just completed the first working RDP6 planar codec compressor in the FreeRDP libraries, but I struggled for the last two months on it. Compressing is far more complex than decompressing, and the documentation is definitely lacking in many aspects. Here is my feedback and the undocumented portions I found which are very important for a successful implementation.

    3.1.9.2.1 Encoding Run-Length Sequences: http://msdn.microsoft.com/en-us/library/cc241705.aspx

    Figure 15 is a flow chart describing the logic for the encoding of an RLE segment.

    On the bottom left, in the part right after (RAW Count < 16) and (RUN Length > 15), the following is missing:

    if (RUN Length < 18) {

    Build Control Byte (RAW Count, 13)

    RAWPtr += RAW Count

    RAW Count = 0

    RUN Length -= 13

    }

    else { same as in current diagram }

    On the right side, right after (RUN Length > 47), the following is missing:

    if (RUN Length < 50) {

    Build Control Byte (13, 2)

    RUN Length -= 45

    } else { same as in current diagram }

    The two missing branches are very important as they prevent the encoding of invalid sequences, since values 1 and 2 are special values in the control byte.

    Other than this, MS-RDPEGDI really doesn't have enough examples. The given examples are simply way too short to be useful and do not cover most of the complex cases. To be useful, sample segments would need more than just a few bytes, as encoding is quite different up to over 47 bytes.

    The documentation also does not cover the "production" of the run length sequences. The diagram only covers the encoding of a complete sequence, not how you reach the point where you identify that a sequence is complete and ready to be encoded. It also gets a lot more complicated when you include into the mix special sequences that are RUNs of zeros.

    For instance, it's possible to see the following:

    00 00 00 -> RAW[] RUN[3]

    While this normally doesn't make sense. I understood that when the RAW sequence is omitted (and assumed to be zero) it already counts towards the run length. For non-zero symbols, here's how the same encodes:

    AA AA AA AA -> RAW[AA] RUN[3]

    This is it for now.

    Wednesday, January 15, 2014 2:01 AM

All replies

  • Hello Marc -

    Thank you for contacting Microsoft Support. A support engineer will contact you and assist.

    Regards


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Wednesday, January 15, 2014 5:24 AM
  • Marc - I am researching this for you.

    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Wednesday, January 15, 2014 9:07 PM
  • We accepted Marcs' valuable feedback and added a sequence diagram in section 3.1.9.2.1 of MS-RDPEGDI (https://msdn.microsoft.com/en-us/library/cc241705.aspx) to illustrate the flow.

    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Tuesday, January 5, 2016 10:33 PM