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

Macros

#define TAG   FREERDP_TAG("codec")
 

Functions

static INLINE UINT16 get_word (const BYTE *data)
 
static INLINE UINT32 get_dword (const BYTE *data)
 
static INLINE BOOL NCrushFetchBits (const BYTE **SrcPtr, const BYTE **SrcEnd, INT32 *nbits, UINT32 *bits)
 
static INLINE void NCrushWriteStart (UINT32 *bits, UINT32 *offset, UINT32 *accumulator)
 
static INLINE void NCrushWriteBits (BYTE **DstPtr, UINT32 *accumulator, UINT32 *offset, UINT32 _bits, UINT32 _nbits)
 
static INLINE void NCrushWriteFinish (BYTE **DstPtr, UINT32 accumulator)
 
int ncrush_decompress (NCRUSH_CONTEXT *ncrush, BYTE *pSrcData, UINT32 SrcSize, BYTE **ppDstData, UINT32 *pDstSize, UINT32 flags)
 
static int ncrush_hash_table_add (NCRUSH_CONTEXT *ncrush, const BYTE *pSrcData, UINT32 SrcSize, UINT32 HistoryOffset)
 
static int ncrush_find_match_length (const BYTE *Ptr1, const BYTE *Ptr2, BYTE *HistoryPtr)
 
static int ncrush_find_best_match (NCRUSH_CONTEXT *ncrush, UINT16 HistoryOffset, UINT32 *pMatchOffset)
 
static int ncrush_move_encoder_windows (NCRUSH_CONTEXT *ncrush, BYTE *HistoryPtr)
 
int ncrush_compress (NCRUSH_CONTEXT *ncrush, BYTE *pSrcData, UINT32 SrcSize, BYTE **ppDstData, UINT32 *pDstSize, UINT32 *pFlags)
 
static int ncrush_generate_tables (NCRUSH_CONTEXT *context)
 
void ncrush_context_reset (NCRUSH_CONTEXT *ncrush, BOOL flush)
 
NCRUSH_CONTEXT * ncrush_context_new (BOOL Compressor)
 
void ncrush_context_free (NCRUSH_CONTEXT *ncrush)
 

Variables

static const UINT16 HuffTableLEC [8192]
 
static const UINT16 HuffTableLOM [512]
 
static const BYTE HuffTableMask [39]
 
static const BYTE HuffLengthLEC [294]
 
static const BYTE HuffCodeLEC [588]
 
static const BYTE HuffLengthLOM [32]
 
static const UINT16 HuffCodeLOM [32]
 
static const UINT32 CopyOffsetBitsLUT [32]
 
static const UINT32 CopyOffsetBaseLUT [32]
 
static const UINT32 LOMBitsLUT [30]
 
static const UINT32 LOMBaseLUT [30]
 

Macro Definition Documentation

#define TAG   FREERDP_TAG("codec")

FreeRDP: A Remote Desktop Protocol Implementation NCrush (RDP6) Bulk Data Compression

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2017 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2017 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

static INLINE UINT32 get_dword ( const BYTE data)
static

Here is the caller graph for this function:

static INLINE UINT16 get_word ( const BYTE data)
static

Here is the caller graph for this function:

int ncrush_compress ( NCRUSH_CONTEXT *  ncrush,
BYTE pSrcData,
UINT32  SrcSize,
BYTE **  ppDstData,
UINT32 pDstSize,
UINT32 pFlags 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void ncrush_context_free ( NCRUSH_CONTEXT *  ncrush)

Here is the caller graph for this function:

NCRUSH_CONTEXT* ncrush_context_new ( BOOL  Compressor)

Here is the call graph for this function:

Here is the caller graph for this function:

void ncrush_context_reset ( NCRUSH_CONTEXT *  ncrush,
BOOL  flush 
)

Here is the caller graph for this function:

int ncrush_decompress ( NCRUSH_CONTEXT *  ncrush,
BYTE pSrcData,
UINT32  SrcSize,
BYTE **  ppDstData,
UINT32 pDstSize,
UINT32  flags 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int ncrush_find_best_match ( NCRUSH_CONTEXT *  ncrush,
UINT16  HistoryOffset,
UINT32 pMatchOffset 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int ncrush_find_match_length ( const BYTE Ptr1,
const BYTE Ptr2,
BYTE HistoryPtr 
)
static

Here is the caller graph for this function:

static int ncrush_generate_tables ( NCRUSH_CONTEXT *  context)
static

Here is the caller graph for this function:

static int ncrush_hash_table_add ( NCRUSH_CONTEXT *  ncrush,
const BYTE pSrcData,
UINT32  SrcSize,
UINT32  HistoryOffset 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int ncrush_move_encoder_windows ( NCRUSH_CONTEXT *  ncrush,
BYTE HistoryPtr 
)
static

Here is the caller graph for this function:

static INLINE BOOL NCrushFetchBits ( const BYTE **  SrcPtr,
const BYTE **  SrcEnd,
INT32 *  nbits,
UINT32 bits 
)
static

Here is the caller graph for this function:

static INLINE void NCrushWriteBits ( BYTE **  DstPtr,
UINT32 accumulator,
UINT32 offset,
UINT32  _bits,
UINT32  _nbits 
)
static

Here is the caller graph for this function:

static INLINE void NCrushWriteFinish ( BYTE **  DstPtr,
UINT32  accumulator 
)
static

Here is the caller graph for this function:

static INLINE void NCrushWriteStart ( UINT32 bits,
UINT32 offset,
UINT32 accumulator 
)
static

Here is the caller graph for this function:

Variable Documentation

const UINT32 CopyOffsetBaseLUT[32]
static
const UINT32 CopyOffsetBitsLUT[32]
static
const BYTE HuffCodeLEC[588]
static
const UINT16 HuffCodeLOM[32]
static
const BYTE HuffLengthLEC[294]
static
const BYTE HuffLengthLOM[32]
static
const UINT16 HuffTableLEC[8192]
static
const UINT16 HuffTableLOM[512]
static
const BYTE HuffTableMask[39]
static
const UINT32 LOMBaseLUT[30]
static
const UINT32 LOMBitsLUT[30]
static