FreeRDP
clear.c File Reference
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/bitstream.h>
#include <freerdp/codec/color.h>
#include <freerdp/codec/clear.h>
#include <freerdp/log.h>

Macros

#define TAG   FREERDP_TAG("codec.clear")
 
#define CLEARCODEC_FLAG_GLYPH_INDEX   0x01
 
#define CLEARCODEC_FLAG_GLYPH_HIT   0x02
 
#define CLEARCODEC_FLAG_CACHE_RESET   0x04
 
#define CLEARCODEC_VBAR_SIZE   32768
 
#define CLEARCODEC_VBAR_SHORT_SIZE   16384
 

Functions

static BOOL convert_color (BYTE *dst, UINT32 nDstStep, UINT32 DstFormat, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE *src, UINT32 nSrcStep, UINT32 SrcFormat, UINT32 nDstWidth, UINT32 nDstHeight, const gdiPalette *palette)
 
static BOOL clear_decompress_nscodec (NSC_CONTEXT *nsc, UINT32 width, UINT32 height, wStream *s, UINT32 bitmapDataByteCount, BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDstRel, UINT32 nYDstRel)
 
static BOOL clear_decompress_subcode_rlex (wStream *s, UINT32 bitmapDataByteCount, UINT32 width, UINT32 height, BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDstRel, UINT32 nYDstRel, UINT32 nDstWidth, UINT32 nDstHeight)
 
static BOOL clear_resize_buffer (CLEAR_CONTEXT *clear, UINT32 width, UINT32 height)
 
static BOOL clear_decompress_residual_data (CLEAR_CONTEXT *clear, wStream *s, UINT32 residualByteCount, UINT32 nWidth, UINT32 nHeight, BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, const gdiPalette *palette)
 
static BOOL clear_decompress_subcodecs_data (CLEAR_CONTEXT *clear, wStream *s, UINT32 subcodecByteCount, UINT32 nWidth, UINT32 nHeight, BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, const gdiPalette *palette)
 
static BOOL resize_vbar_entry (CLEAR_CONTEXT *clear, CLEAR_VBAR_ENTRY *vBarEntry)
 
static BOOL clear_decompress_bands_data (CLEAR_CONTEXT *clear, wStream *s, UINT32 bandsByteCount, UINT32 nWidth, UINT32 nHeight, BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst)
 
static BOOL clear_decompress_glyph_data (CLEAR_CONTEXT *clear, wStream *s, UINT32 glyphFlags, UINT32 nWidth, UINT32 nHeight, BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, const gdiPalette *palette, BYTE **ppGlyphData)
 
static INLINE BOOL updateContextFormat (CLEAR_CONTEXT *clear, UINT32 DstFormat)
 
INT32 clear_decompress (CLEAR_CONTEXT *clear, const BYTE *pSrcData, UINT32 SrcSize, UINT32 nWidth, UINT32 nHeight, BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, const gdiPalette *palette)
 
int clear_compress (CLEAR_CONTEXT *clear, const BYTE *pSrcData, UINT32 SrcSize, BYTE **ppDstData, UINT32 *pDstSize)
 
BOOL clear_context_reset (CLEAR_CONTEXT *clear)
 
CLEAR_CONTEXT * clear_context_new (BOOL Compressor)
 
void clear_context_free (CLEAR_CONTEXT *clear)
 

Variables

static const UINT32 CLEAR_LOG2_FLOOR [256]
 
static const BYTE CLEAR_8BIT_MASKS [9]
 

Macro Definition Documentation

#define CLEARCODEC_FLAG_CACHE_RESET   0x04
#define CLEARCODEC_FLAG_GLYPH_HIT   0x02
#define CLEARCODEC_FLAG_GLYPH_INDEX   0x01
#define CLEARCODEC_VBAR_SHORT_SIZE   16384
#define CLEARCODEC_VBAR_SIZE   32768
#define TAG   FREERDP_TAG("codec.clear")

FreeRDP: A Remote Desktop Protocol Implementation ClearCodec Bitmap Compression

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2016 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2016 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

int clear_compress ( CLEAR_CONTEXT *  clear,
const BYTE pSrcData,
UINT32  SrcSize,
BYTE **  ppDstData,
UINT32 pDstSize 
)
void clear_context_free ( CLEAR_CONTEXT *  clear)

Here is the call graph for this function:

Here is the caller graph for this function:

CLEAR_CONTEXT* clear_context_new ( BOOL  Compressor)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL clear_context_reset ( CLEAR_CONTEXT *  clear)

Here is the caller graph for this function:

INT32 clear_decompress ( CLEAR_CONTEXT *  clear,
const BYTE pSrcData,
UINT32  SrcSize,
UINT32  nWidth,
UINT32  nHeight,
BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nDstWidth,
UINT32  nDstHeight,
const gdiPalette *  palette 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL clear_decompress_bands_data ( CLEAR_CONTEXT *  clear,
wStream *  s,
UINT32  bandsByteCount,
UINT32  nWidth,
UINT32  nHeight,
BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL clear_decompress_glyph_data ( CLEAR_CONTEXT *  clear,
wStream *  s,
UINT32  glyphFlags,
UINT32  nWidth,
UINT32  nHeight,
BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nDstWidth,
UINT32  nDstHeight,
const gdiPalette *  palette,
BYTE **  ppGlyphData 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL clear_decompress_nscodec ( NSC_CONTEXT *  nsc,
UINT32  width,
UINT32  height,
wStream *  s,
UINT32  bitmapDataByteCount,
BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDstRel,
UINT32  nYDstRel 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL clear_decompress_residual_data ( CLEAR_CONTEXT *  clear,
wStream *  s,
UINT32  residualByteCount,
UINT32  nWidth,
UINT32  nHeight,
BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nDstWidth,
UINT32  nDstHeight,
const gdiPalette *  palette 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL clear_decompress_subcode_rlex ( wStream *  s,
UINT32  bitmapDataByteCount,
UINT32  width,
UINT32  height,
BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDstRel,
UINT32  nYDstRel,
UINT32  nDstWidth,
UINT32  nDstHeight 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL clear_decompress_subcodecs_data ( CLEAR_CONTEXT *  clear,
wStream *  s,
UINT32  subcodecByteCount,
UINT32  nWidth,
UINT32  nHeight,
BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nDstWidth,
UINT32  nDstHeight,
const gdiPalette *  palette 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL clear_resize_buffer ( CLEAR_CONTEXT *  clear,
UINT32  width,
UINT32  height 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL convert_color ( BYTE dst,
UINT32  nDstStep,
UINT32  DstFormat,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nWidth,
UINT32  nHeight,
const BYTE src,
UINT32  nSrcStep,
UINT32  SrcFormat,
UINT32  nDstWidth,
UINT32  nDstHeight,
const gdiPalette *  palette 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL resize_vbar_entry ( CLEAR_CONTEXT *  clear,
CLEAR_VBAR_ENTRY *  vBarEntry 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE BOOL updateContextFormat ( CLEAR_CONTEXT *  clear,
UINT32  DstFormat 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const BYTE CLEAR_8BIT_MASKS[9]
static
Initial value:
=
{
0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF
}
const UINT32 CLEAR_LOG2_FLOOR[256]
static
Initial value:
=
{
0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
}