return 0;
}
+int freerdp_bitmap_compress_planar_rle_plane_scanline(BYTE* plane, int size)
+{
+ int i, j;
+ BYTE symbol;
+ int nRunLength;
+ int cRawBytes;
+ BYTE* rawValues;
+ int nSequenceLength;
+
+ cRawBytes = 0;
+ nRunLength = 0;
+ rawValues = plane;
+
+ nSequenceLength = 0;
+
+ for (i = 0; i <= size; i++)
+ {
+ if ((!nSequenceLength) && (i != size))
+ {
+ symbol = plane[i];
+ nSequenceLength = 1;
+ }
+ else
+ {
+ if ((i != size) && (plane[i] == symbol))
+ {
+ nSequenceLength++;
+ }
+ else
+ {
+ if (nSequenceLength > 3)
+ {
+ cRawBytes += 1;
+ nRunLength = nSequenceLength - 1;
+
+ printf("RAW[");
+
+ for (j = 0; j < cRawBytes; j++)
+ printf("%c", rawValues[j]);
+
+ printf("] RUN[%d]\n", nRunLength);
+
+ rawValues = &plane[i];
+ cRawBytes = 0;
+ }
+ else
+ {
+ cRawBytes += nSequenceLength;
+
+ if (i == size)
+ {
+ nRunLength = 0;
+
+ printf("RAW[");
+
+ for (j = 0; j < cRawBytes; j++)
+ printf("%c", rawValues[j]);
+
+ printf("] RUN[%d]\n", nRunLength);
+ }
+ }
+
+ if (i != size)
+ {
+ symbol = plane[i];
+ nSequenceLength = 1;
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
BYTE* freerdp_bitmap_compress_planar(BYTE* data, UINT32 format, int width, int height, int scanline, BYTE* dstData, int* dstSize)
{
int size;
typedef struct _RDP6_BITMAP_STREAM RDP6_BITMAP_STREAM;
int freerdp_split_color_planes(BYTE* data, UINT32 format, int width, int height, int scanline, BYTE* planes[4]);
+int freerdp_bitmap_compress_planar_rle_plane_scanline(BYTE* plane, int size);
#endif /* FREERDP_CODEC_PLANAR_PRIVATE_H */
"\xC3\x80\x61\x00\x00\x00\x00\x00\xCC\x89\x52\x03\x6E\xFF\xFF\x02"
"\xCB\x18\xC6\x84\x08\x42\x08\x42\x08\x42\xFF\xFF";
+const BYTE TEST_RLE_SCANLINE_UNCOMPRESSED[12] =
+ "AAAABBCCCCCD";
+
+#include "../planar.h"
+
int TestFreeRDPCodecPlanar(int argc, char* argv[])
{
int dstSize;
freerdp_bitmap_compress_planar(srcBitmap32, format, 32, 32, 32 * 4, NULL, &dstSize);
+ freerdp_bitmap_compress_planar_rle_plane_scanline((BYTE*) TEST_RLE_SCANLINE_UNCOMPRESSED, 12);
+
freerdp_clrconv_free(clrconv);
free(srcBitmap32);