FreeRDP
xcrush.c File Reference
#include <winpr/assert.h>
#include <freerdp/config.h>
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/bitstream.h>
#include <freerdp/log.h>
#include "xcrush.h"

Macros

#define TAG   FREERDP_TAG("codec")
 

Functions

static UINT32 xcrush_update_hash (const BYTE *WINPR_RESTRICT data, UINT32 size)
 
static int xcrush_append_chunk (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, const BYTE *WINPR_RESTRICT data, UINT32 *WINPR_RESTRICT beg, UINT32 end)
 
static int xcrush_compute_chunks (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, const BYTE *WINPR_RESTRICT data, UINT32 size, UINT32 *WINPR_RESTRICT pIndex)
 
static UINT32 xcrush_compute_signatures (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, const BYTE *WINPR_RESTRICT data, UINT32 size)
 
static void xcrush_clear_hash_table_range (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, UINT32 beg, UINT32 end)
 
static int xcrush_find_next_matching_chunk (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, XCRUSH_CHUNK *WINPR_RESTRICT chunk, XCRUSH_CHUNK **WINPR_RESTRICT pNextChunk)
 
static int xcrush_insert_chunk (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, XCRUSH_SIGNATURE *WINPR_RESTRICT signature, UINT32 offset, XCRUSH_CHUNK **WINPR_RESTRICT pPrevChunk)
 
static int xcrush_find_match_length (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, UINT32 MatchOffset, UINT32 ChunkOffset, UINT32 HistoryOffset, UINT32 SrcSize, UINT32 MaxMatchLength, XCRUSH_MATCH_INFO *WINPR_RESTRICT MatchInfo)
 
static int xcrush_find_all_matches (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, UINT32 SignatureIndex, UINT32 HistoryOffset, UINT32 SrcOffset, UINT32 SrcSize)
 
static int xcrush_optimize_matches (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush)
 
static int xcrush_generate_output (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, BYTE *WINPR_RESTRICT OutputBuffer, UINT32 OutputSize, UINT32 HistoryOffset, UINT32 *WINPR_RESTRICT pDstSize)
 
static INLINE size_t xcrush_copy_bytes_no_overlap (BYTE *WINPR_RESTRICT dst, const BYTE *WINPR_RESTRICT src, size_t num)
 
static INLINE size_t xcrush_copy_bytes (BYTE *dst, const BYTE *src, size_t num)
 
static int xcrush_decompress_l1 (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, const BYTE **WINPR_RESTRICT ppDstData, UINT32 *WINPR_RESTRICT pDstSize, UINT32 flags)
 
int xcrush_decompress (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, const BYTE **WINPR_RESTRICT ppDstData, UINT32 *WINPR_RESTRICT pDstSize, UINT32 flags)
 
static int xcrush_compress_l1 (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, BYTE *WINPR_RESTRICT pDstData, UINT32 *WINPR_RESTRICT pDstSize, UINT32 *WINPR_RESTRICT pFlags)
 
int xcrush_compress (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, BYTE *WINPR_RESTRICT pDstBuffer, const BYTE **WINPR_RESTRICT ppDstData, UINT32 *WINPR_RESTRICT pDstSize, UINT32 *WINPR_RESTRICT pFlags)
 
void xcrush_context_reset (XCRUSH_CONTEXT *WINPR_RESTRICT xcrush, BOOL flush)
 
XCRUSH_CONTEXT * xcrush_context_new (BOOL Compressor)
 
void xcrush_context_free (XCRUSH_CONTEXT *xcrush)
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("codec")

FreeRDP: A Remote Desktop Protocol Implementation XCrush (RDP6.1) 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

◆ xcrush_append_chunk()

static int xcrush_append_chunk ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
const BYTE *WINPR_RESTRICT  data,
UINT32 *WINPR_RESTRICT  beg,
UINT32  end 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_clear_hash_table_range()

static void xcrush_clear_hash_table_range ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
UINT32  beg,
UINT32  end 
)
static
Here is the caller graph for this function:

◆ xcrush_compress()

int xcrush_compress ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  SrcSize,
BYTE *WINPR_RESTRICT  pDstBuffer,
const BYTE **WINPR_RESTRICT  ppDstData,
UINT32 *WINPR_RESTRICT  pDstSize,
UINT32 *WINPR_RESTRICT  pFlags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_compress_l1()

static int xcrush_compress_l1 ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  SrcSize,
BYTE *WINPR_RESTRICT  pDstData,
UINT32 *WINPR_RESTRICT  pDstSize,
UINT32 *WINPR_RESTRICT  pFlags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_compute_chunks()

static int xcrush_compute_chunks ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
const BYTE *WINPR_RESTRICT  data,
UINT32  size,
UINT32 *WINPR_RESTRICT  pIndex 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_compute_signatures()

static UINT32 xcrush_compute_signatures ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
const BYTE *WINPR_RESTRICT  data,
UINT32  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_context_free()

void xcrush_context_free ( XCRUSH_CONTEXT *  xcrush)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_context_new()

XCRUSH_CONTEXT* xcrush_context_new ( BOOL  Compressor)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_context_reset()

void xcrush_context_reset ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
BOOL  flush 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_copy_bytes()

static INLINE size_t xcrush_copy_bytes ( BYTE dst,
const BYTE src,
size_t  num 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_copy_bytes_no_overlap()

static INLINE size_t xcrush_copy_bytes_no_overlap ( BYTE *WINPR_RESTRICT  dst,
const BYTE *WINPR_RESTRICT  src,
size_t  num 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_decompress()

int xcrush_decompress ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  SrcSize,
const BYTE **WINPR_RESTRICT  ppDstData,
UINT32 *WINPR_RESTRICT  pDstSize,
UINT32  flags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_decompress_l1()

static int xcrush_decompress_l1 ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  SrcSize,
const BYTE **WINPR_RESTRICT  ppDstData,
UINT32 *WINPR_RESTRICT  pDstSize,
UINT32  flags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_find_all_matches()

static int xcrush_find_all_matches ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
UINT32  SignatureIndex,
UINT32  HistoryOffset,
UINT32  SrcOffset,
UINT32  SrcSize 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_find_match_length()

static int xcrush_find_match_length ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
UINT32  MatchOffset,
UINT32  ChunkOffset,
UINT32  HistoryOffset,
UINT32  SrcSize,
UINT32  MaxMatchLength,
XCRUSH_MATCH_INFO *WINPR_RESTRICT  MatchInfo 
)
static
Here is the caller graph for this function:

◆ xcrush_find_next_matching_chunk()

static int xcrush_find_next_matching_chunk ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
XCRUSH_CHUNK *WINPR_RESTRICT  chunk,
XCRUSH_CHUNK **WINPR_RESTRICT  pNextChunk 
)
static
Here is the caller graph for this function:

◆ xcrush_generate_output()

static int xcrush_generate_output ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
BYTE *WINPR_RESTRICT  OutputBuffer,
UINT32  OutputSize,
UINT32  HistoryOffset,
UINT32 *WINPR_RESTRICT  pDstSize 
)
static
Here is the caller graph for this function:

◆ xcrush_insert_chunk()

static int xcrush_insert_chunk ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush,
XCRUSH_SIGNATURE *WINPR_RESTRICT  signature,
UINT32  offset,
XCRUSH_CHUNK **WINPR_RESTRICT  pPrevChunk 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcrush_optimize_matches()

static int xcrush_optimize_matches ( XCRUSH_CONTEXT *WINPR_RESTRICT  xcrush)
static
Here is the caller graph for this function:

◆ xcrush_update_hash()

static UINT32 xcrush_update_hash ( const BYTE *WINPR_RESTRICT  data,
UINT32  size 
)
static
Here is the caller graph for this function: