libfreerdp-codec: fix handling of PACKET_AT_FRONT, PACKET_FLUSHED in MPPC compression

This commit is contained in:
Marc-André Moreau 2014-04-20 21:28:09 -04:00
parent d893cee87a
commit d08b6fe4bd
9 changed files with 219 additions and 76 deletions

View File

@ -46,7 +46,7 @@ typedef struct _MPPC_CONTEXT MPPC_CONTEXT;
extern "C" {
#endif
FREERDP_API int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE* pDstData, UINT32* pDstSize, UINT32* pFlags);
FREERDP_API int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags);
FREERDP_API int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags);
FREERDP_API void mppc_set_compression_level(MPPC_CONTEXT* mppc, DWORD CompressionLevel);

View File

@ -458,14 +458,18 @@ int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** p
return 1;
}
int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE* pDstData, UINT32* pDstSize, UINT32* pFlags)
int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags)
{
BYTE* pSrcPtr;
BYTE* pSrcEnd;
BYTE* pDstEnd;
BYTE* MatchPtr;
UINT32 DstSize;
BYTE* pDstData;
UINT32 MatchIndex;
UINT32 accumulator;
BOOL PacketFlushed;
BOOL PacketAtFront;
DWORD CopyOffset;
DWORD LengthOfMatch;
BYTE* HistoryBuffer;
@ -483,23 +487,41 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE* pDst
HistoryPtr = mppc->HistoryPtr;
HistoryOffset = mppc->HistoryOffset;
BitStream_Attach(bs, pDstData, SrcSize);
*pFlags = 0;
PacketFlushed = FALSE;
if (((HistoryOffset + SrcSize) < (HistoryBufferSize - 3)) && HistoryOffset)
{
*pFlags = 0;
PacketAtFront = FALSE;
}
else
{
if (HistoryOffset == (HistoryBufferSize + 1))
PacketFlushed = TRUE;
HistoryOffset = 0;
*pFlags = PACKET_AT_FRONT;
PacketAtFront = TRUE;
}
HistoryPtr = &(HistoryBuffer[HistoryOffset]);
pDstData = *ppDstData;
if (!pDstData)
return -1;
DstSize = *pDstSize;
if (DstSize < SrcSize)
return -1;
DstSize = SrcSize;
BitStream_Attach(bs, pDstData, DstSize);
pSrcPtr = pSrcData;
pSrcEnd = &(pSrcData[SrcSize - 1]);
pDstEnd = &(pDstData[*pDstSize - 1]);
pDstEnd = &(pDstData[DstSize - 1]);
while (pSrcPtr < (pSrcEnd - 2))
{
@ -522,11 +544,14 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE* pDst
(&MatchPtr[1] > mppc->HistoryPtr) || (MatchPtr == HistoryBuffer) ||
(MatchPtr == (HistoryPtr - 1)) || (MatchPtr == HistoryPtr))
{
if ((((bs->position + 7) / 8) + 2) > (*pDstSize - 1))
if (((bs->position / 8) + 2) > (DstSize - 1))
{
*pFlags |= PACKET_FLUSHED;
ZeroMemory(HistoryBuffer, HistoryBufferSize);
ZeroMemory(mppc->MatchBuffer, sizeof(mppc->MatchBuffer));
mppc->HistoryOffset = HistoryBufferSize + 1;
*pFlags |= PACKET_FLUSHED;
*pFlags |= CompressionLevel;
*ppDstData = pSrcData;
*pDstSize = SrcSize;
return 1;
}
@ -573,11 +598,14 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE* pDst
/* Encode CopyOffset */
if ((((bs->position + 7) / 8) + 7) > (*pDstSize - 1))
if (((bs->position / 8) + 7) > (DstSize - 1))
{
*pFlags = PACKET_FLUSHED;
ZeroMemory(HistoryBuffer, HistoryBufferSize);
ZeroMemory(mppc->MatchBuffer, sizeof(mppc->MatchBuffer));
mppc->HistoryOffset = HistoryBufferSize + 1;
*pFlags |= PACKET_FLUSHED;
*pFlags |= CompressionLevel;
*ppDstData = pSrcData;
*pDstSize = SrcSize;
return 1;
}
@ -729,11 +757,14 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE* pDst
while (pSrcPtr <= pSrcEnd)
{
if ((((bs->position + 7) / 8) + 2) > (*pDstSize - 1))
if (((bs->position / 8) + 2) > (DstSize - 1))
{
*pFlags |= PACKET_FLUSHED;
ZeroMemory(HistoryBuffer, HistoryBufferSize);
ZeroMemory(mppc->MatchBuffer, sizeof(mppc->MatchBuffer));
mppc->HistoryOffset = HistoryBufferSize + 1;
*pFlags |= PACKET_FLUSHED;
*pFlags |= CompressionLevel;
*ppDstData = pSrcData;
*pDstSize = SrcSize;
return 1;
}
@ -763,6 +794,13 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE* pDst
*pFlags |= PACKET_COMPRESSED;
*pFlags |= CompressionLevel;
if (PacketAtFront)
*pFlags |= PACKET_AT_FRONT;
if (PacketFlushed)
*pFlags |= PACKET_FLUSHED;
*pDstSize = ((bs->position + 7) / 8);
mppc->HistoryPtr = HistoryPtr;

View File

@ -711,6 +711,7 @@ int test_MppcCompressBellsRdp5()
UINT32 SrcSize;
BYTE* pSrcData;
UINT32 DstSize;
BYTE* pDstData;
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
@ -719,10 +720,12 @@ int test_MppcCompressBellsRdp5()
SrcSize = sizeof(TEST_MPPC_BELLS) - 1;
pSrcData = (BYTE*) TEST_MPPC_BELLS;
DstSize = sizeof(OutputBuffer);
expectedSize = sizeof(TEST_MPPC_BELLS_RDP5) - 1;
status = mppc_compress(mppc, pSrcData, SrcSize, OutputBuffer, &DstSize, &Flags);
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
printf("Flags: 0x%04X DstSize: %d\n", Flags, DstSize);
@ -732,12 +735,12 @@ int test_MppcCompressBellsRdp5()
return -1;
}
if (memcmp(OutputBuffer, TEST_MPPC_BELLS_RDP5, DstSize) != 0)
if (memcmp(pDstData, TEST_MPPC_BELLS_RDP5, DstSize) != 0)
{
printf("MppcCompressBellsRdp5: output mismatch\n");
printf("Actual\n");
BitDump(OutputBuffer, DstSize * 8, 0);
BitDump(pDstData, DstSize * 8, 0);
printf("Expected\n");
BitDump(TEST_MPPC_BELLS_RDP5, DstSize * 8, 0);
@ -757,6 +760,7 @@ int test_MppcCompressBellsRdp4()
BYTE* pSrcData;
UINT32 SrcSize;
UINT32 DstSize;
BYTE* pDstData;
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
@ -766,9 +770,11 @@ int test_MppcCompressBellsRdp4()
SrcSize = sizeof(TEST_MPPC_BELLS) - 1;
pSrcData = (BYTE*) TEST_MPPC_BELLS;
expectedSize = sizeof(TEST_MPPC_BELLS_RDP4) - 1;
DstSize = sizeof(OutputBuffer);
status = mppc_compress(mppc, pSrcData, SrcSize, OutputBuffer, &DstSize, &Flags);
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
printf("flags: 0x%04X size: %d\n", Flags, DstSize);
@ -778,12 +784,12 @@ int test_MppcCompressBellsRdp4()
return -1;
}
if (memcmp(OutputBuffer, TEST_MPPC_BELLS_RDP4, DstSize) != 0)
if (memcmp(pDstData, TEST_MPPC_BELLS_RDP4, DstSize) != 0)
{
printf("MppcCompressBellsRdp4: output mismatch\n");
printf("Actual\n");
BitDump(OutputBuffer, DstSize * 8, 0);
BitDump(pDstData, DstSize * 8, 0);
printf("Expected\n");
BitDump(TEST_MPPC_BELLS_RDP4, DstSize * 8, 0);
@ -879,20 +885,22 @@ int test_MppcCompressBufferRdp5()
BYTE* pSrcData;
UINT32 SrcSize;
UINT32 DstSize;
BYTE* pDstData;
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
BYTE* pDstData = NULL;
mppc = mppc_context_new(1, TRUE);
SrcSize = sizeof(TEST_RDP5_UNCOMPRESSED_DATA);
pSrcData = (BYTE*) TEST_RDP5_UNCOMPRESSED_DATA;
expectedSize = sizeof(TEST_RDP5_COMPRESSED_DATA);
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, pDstData, &DstSize, &Flags);
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
printf("flags: 0x%04X size: %d\n", Flags, DstSize);
if (DstSize != expectedSize)
@ -901,7 +909,7 @@ int test_MppcCompressBufferRdp5()
return -1;
}
if (memcmp(OutputBuffer, TEST_RDP5_COMPRESSED_DATA, DstSize) != 0)
if (memcmp(pDstData, TEST_RDP5_COMPRESSED_DATA, DstSize) != 0)
{
printf("MppcCompressBufferRdp5: output mismatch: compressed output does not match Microsoft implementation\n");
return -1;

View File

@ -25,6 +25,30 @@
//#define WITH_BULK_DEBUG 1
const char* bulk_get_compression_flags_string(UINT32 flags)
{
flags &= BULK_COMPRESSION_FLAGS_MASK;
if (flags == 0)
return "PACKET_UNCOMPRESSED";
else if (flags == PACKET_COMPRESSED)
return "PACKET_COMPRESSED";
else if (flags == PACKET_AT_FRONT)
return "PACKET_AT_FRONT";
else if (flags == PACKET_FLUSHED)
return "PACKET_FLUSHED";
else if (flags == (PACKET_COMPRESSED | PACKET_AT_FRONT))
return "PACKET_COMPRESSED | PACKET_AT_FRONT";
else if (flags == (PACKET_COMPRESSED | PACKET_FLUSHED))
return "PACKET_COMPRESSED | PACKET_FLUSHED";
else if (flags == (PACKET_AT_FRONT | PACKET_FLUSHED))
return "PACKET_AT_FRONT | PACKET_FLUSHED";
else if (flags == (PACKET_COMPRESSED | PACKET_AT_FRONT | PACKET_FLUSHED))
return "PACKET_COMPRESSED | PACKET_AT_FRONT | PACKET_FLUSHED";
return "PACKET_UNKNOWN";
}
UINT32 bulk_compression_level(rdpBulk* bulk)
{
rdpSettings* settings = bulk->context->settings;
@ -39,14 +63,60 @@ UINT32 bulk_compression_max_size(rdpBulk* bulk)
return bulk->CompressionMaxSize;
}
int bulk_compress_validate(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags)
{
int status;
BYTE* _pSrcData = NULL;
BYTE* _pDstData = NULL;
UINT32 _SrcSize = 0;
UINT32 _DstSize = 0;
UINT32 _Flags = 0;
_pSrcData = *ppDstData;
_SrcSize = *pDstSize;
_Flags = *pFlags | bulk->CompressionLevel;
status = bulk_decompress(bulk, _pSrcData, _SrcSize, &_pDstData, &_DstSize, _Flags);
if (status < 0)
{
printf("compression/decompression failure\n");
return status;
}
if (_DstSize != SrcSize)
{
printf("compression/decompression size mismatch: Actual: %d, Expected: %d\n", _DstSize, SrcSize);
return -1;
}
if (memcmp(_pDstData, pSrcData, SrcSize) != 0)
{
printf("compression/decompression input/output mismatch! flags: 0x%04X\n", _Flags);
printf("Actual:\n");
winpr_HexDump(_pDstData, SrcSize);
printf("Expected:\n");
winpr_HexDump(pSrcData, SrcSize);
return -1;
}
return status;
}
int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags)
{
UINT32 type;
int status = -1;
UINT32 CompressedBytes;
UINT32 UncompressedBytes;
UINT32 type = flags & 0x0F;
if (flags & PACKET_COMPRESSED)
bulk_compression_max_size(bulk);
type = flags & BULK_COMPRESSION_TYPE_MASK;
if (flags & BULK_COMPRESSION_FLAGS_MASK)
{
switch (type)
{
@ -96,8 +166,10 @@ int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstD
CompressionRatio = ((double) CompressedBytes) / ((double) UncompressedBytes);
TotalCompressionRatio = ((double) bulk->TotalCompressedBytes) / ((double) bulk->TotalUncompressedBytes);
printf("Type: %d Flags: 0x%04X Compression Ratio: %f Total: %f %d / %d\n",
type, flags, CompressionRatio, TotalCompressionRatio, CompressedBytes, UncompressedBytes);
printf("Type: %d Flags: %s (0x%04X) Compression Ratio: %f (%d / %d), Total: %f (%d / %d)\n",
type, bulk_get_compression_flags_string(flags), flags,
CompressionRatio, CompressedBytes, UncompressedBytes,
TotalCompressionRatio, bulk->TotalCompressedBytes, bulk->TotalUncompressedBytes);
}
#endif
}
@ -115,12 +187,21 @@ int bulk_compress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstDat
UINT32 CompressedBytes;
UINT32 UncompressedBytes;
if ((SrcSize <= 50) || (SrcSize >= 16384))
{
*ppDstData = pSrcData;
*pDstSize = SrcSize;
return 0;
}
*ppDstData = bulk->OutputBuffer;
*pDstSize = sizeof(bulk->OutputBuffer);
bulk_compression_level(bulk);
bulk_compression_max_size(bulk);
mppc_set_compression_level(bulk->mppcSend, bulk->CompressionLevel);
status = mppc_compress(bulk->mppcSend, pSrcData, SrcSize, *ppDstData, pDstSize, pFlags);
status = mppc_compress(bulk->mppcSend, pSrcData, SrcSize, ppDstData, pDstSize, pFlags);
if (status >= 0)
{
@ -141,12 +222,19 @@ int bulk_compress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstDat
CompressionRatio = ((double) CompressedBytes) / ((double) UncompressedBytes);
TotalCompressionRatio = ((double) bulk->TotalCompressedBytes) / ((double) bulk->TotalUncompressedBytes);
printf("Type: %d Flags: 0x%04X Compression Ratio: %f Total: %f %d / %d\n",
type, *pFlags, CompressionRatio, TotalCompressionRatio, CompressedBytes, UncompressedBytes);
printf("Type: %d Flags: %s (0x%04X) Compression Ratio: %f (%d / %d), Total: %f (%d / %d)\n",
type, bulk_get_compression_flags_string(*pFlags), *pFlags,
CompressionRatio, CompressedBytes, UncompressedBytes,
TotalCompressionRatio, bulk->TotalCompressedBytes, bulk->TotalUncompressedBytes);
}
#endif
}
#if 0
if (bulk_compress_validate(bulk, pSrcData, SrcSize, ppDstData, pDstSize, pFlags) < 0)
status = -1;
#endif
return status;
}

View File

@ -36,11 +36,13 @@ struct rdp_bulk
MPPC_CONTEXT* mppcRecv;
NCRUSH_CONTEXT* ncrushRecv;
BYTE OutputBuffer[65536];
UINT64 TotalCompressedBytes;
UINT64 TotalUncompressedBytes;
};
#define BULK_COMPRESSION_FLAGS_MASK 0xE0
#define BULK_COMPRESSION_TYPE_MASK 0x0F
UINT32 bulk_compression_level(rdpBulk* bulk);
UINT32 bulk_compression_max_size(rdpBulk* bulk);

View File

@ -932,7 +932,7 @@ BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s
{
if (bulk_compress(rdp->bulk, pSrcData, SrcSize, &pDstData, &DstSize, &compressionFlags) >= 0)
{
if (compressionFlags & PACKET_COMPRESSED)
if (compressionFlags)
{
fpUpdateHeader.compressionFlags = compressionFlags;
fpUpdateHeader.compression = FASTPATH_OUTPUT_COMPRESSION_USED;

View File

@ -1,17 +1,17 @@
-----BEGIN CERTIFICATE-----
MIICyzCCAbOgAwIBAgIJANbqtAWwlQZuMA0GCSqGSIb3DQEBBQUAMBIxEDAOBgNV
BAMTB0ZyZWVSRFAwHhcNMDkxMDI5MDA0MTQ5WhcNMDkxMTI4MDA0MTQ5WjASMRAw
DgYDVQQDEwdGcmVlUkRQMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
q7mxFgRbS2FYJZX7BzpNd4T/n4nEVDBY6YaObLjGpaB1TptzXTcmfDrDslTGwcEY
hTFAC4ZvY6yOURExqbph4LSgvkoa6J722RjVPfshGa4mlh2SXvTiaV26VPPxddGb
o6fbs2u029lbtBlpIVbhx5RN9vstNkll26oSZ6wfEdBNHQJLd2SU4ItWHj8zjz1f
eGxjgChHihUlwcBYKDJs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enefy4JTM8M1pi
Osp+WPokxRGEN+enhDxA7IKAtIC5lV8vPFYpxel3ALwzQyIB11a7QwyZ0HV9DGyD
SWgqMV16cSsCgYEApKmznvQvZgGn9pnzA1GRoAmxmkJyrg+Qvgl11Iu26bk5+jQq
nTv+UiaNxHnrjR8gG3Ggo0amJg/zK5TN7QfGc8HXfEwMOFwPW2hpQ6I+UlrgsCRI
vYzcMhxaMugtjws5b4FvrpiMF+He09uqBAdtbs0e7oJPtuLkPEpfj8rnRpUCgYEA
l1TgdoxPTCFetC2hZgdlqEZPa6crhZO7W48qF2acZun/ylTQ1WAjQAZGNuP50+5G
7+eAlaE3n+VyGidqosQFeb2awknP4u9WK/35F4P6Uh4+iBvnKVheUKXv4Grbpfp2
5ctHDnRBYr8XbyWrVKLdfdf5j+YS531o1bmKgK75HysCgYAi1jqD5KSG5sLhO0kF
7BD9qYTIzW6Ocn4x1FRY6kxyGrE7Vb7VGNW2ULVexyn73pxhueuS4Qy5xHVDmdhO
ibolvvEr2TnSC0XR7QfOeXjmyV0m5Uvz97QNxoMnAHA60LWy8isj97LRAXuoSLEp
f2wfaMPwVN0WlBwa2PWAVm3zWA==
-----END PRIVATE KEY-----

View File

@ -325,7 +325,7 @@ static BOOL test_sleep_tsdiff(UINT32 *old_sec, UINT32 *old_usec, UINT32 new_sec,
{
INT32 sec, usec;
if (*old_sec==0 && *old_usec==0)
if ((*old_sec == 0) && (*old_usec == 0))
{
*old_sec = new_sec;
*old_usec = new_usec;
@ -335,7 +335,7 @@ static BOOL test_sleep_tsdiff(UINT32 *old_sec, UINT32 *old_usec, UINT32 new_sec,
sec = new_sec - *old_sec;
usec = new_usec - *old_usec;
if (sec<0 || (sec==0 && usec<0))
if ((sec < 0) || ((sec == 0) && (usec < 0)))
{
printf("Invalid time stamp detected.\n");
return FALSE;
@ -393,6 +393,9 @@ void tf_peer_dump_rfx(freerdp_peer* client)
break;
update->SurfaceCommand(update->context, s);
if (client->CheckFileDescriptor(client) != TRUE)
break;
}
}
@ -528,6 +531,9 @@ BOOL tf_peer_activate(freerdp_peer* client)
rfx_context_reset(context->rfx_context);
context->activated = TRUE;
//client->settings->CompressionLevel = PACKET_COMPR_TYPE_8K;
client->settings->CompressionLevel = PACKET_COMPR_TYPE_64K;
if (test_pcap_file != NULL)
{
client->update->dump_rfx = TRUE;