FreeRDP
progressive.c File Reference
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/bitstream.h>
#include <freerdp/primitives.h>
#include <freerdp/codec/color.h>
#include <freerdp/codec/progressive.h>
#include <freerdp/codec/region.h>
#include <freerdp/log.h>
#include "rfx_differential.h"
#include "rfx_quantization.h"
#include "rfx_rlgr.h"
#include "progressive.h"

Macros

#define TAG   FREERDP_TAG("codec.progressive")
 

Functions

static const char * progressive_get_block_type_string (UINT16 blockType)
 
static INLINE void progressive_component_codec_quant_read (const BYTE *block, RFX_COMPONENT_CODEC_QUANT *quantVal)
 
static INLINE void progressive_rfx_quant_ladd (RFX_COMPONENT_CODEC_QUANT *q, int val)
 
static INLINE void progressive_rfx_quant_add (RFX_COMPONENT_CODEC_QUANT *q1, RFX_COMPONENT_CODEC_QUANT *q2, RFX_COMPONENT_CODEC_QUANT *dst)
 
static INLINE void progressive_rfx_quant_lsub (RFX_COMPONENT_CODEC_QUANT *q, int val)
 
static INLINE void progressive_rfx_quant_sub (RFX_COMPONENT_CODEC_QUANT *q1, RFX_COMPONENT_CODEC_QUANT *q2, RFX_COMPONENT_CODEC_QUANT *dst)
 
static INLINE BOOL progressive_rfx_quant_lcmp_less_equal (RFX_COMPONENT_CODEC_QUANT *q, int val)
 
static INLINE BOOL progressive_rfx_quant_cmp_less_equal (RFX_COMPONENT_CODEC_QUANT *q1, RFX_COMPONENT_CODEC_QUANT *q2)
 
static INLINE BOOL progressive_rfx_quant_lcmp_greater_equal (RFX_COMPONENT_CODEC_QUANT *q, int val)
 
static INLINE BOOL progressive_rfx_quant_cmp_greater_equal (RFX_COMPONENT_CODEC_QUANT *q1, RFX_COMPONENT_CODEC_QUANT *q2)
 
static INLINE BOOL progressive_rfx_quant_cmp_equal (RFX_COMPONENT_CODEC_QUANT *q1, RFX_COMPONENT_CODEC_QUANT *q2)
 
static void progressive_rfx_quant_print (RFX_COMPONENT_CODEC_QUANT *q, const char *name)
 
static INLINE BOOL progressive_set_surface_data (PROGRESSIVE_CONTEXT *progressive, UINT16 surfaceId, void *pData)
 
static INLINE voidprogressive_get_surface_data (PROGRESSIVE_CONTEXT *progressive, UINT16 surfaceId)
 
static PROGRESSIVE_SURFACE_CONTEXT * progressive_surface_context_new (UINT16 surfaceId, UINT32 width, UINT32 height)
 
static void progressive_surface_context_free (PROGRESSIVE_SURFACE_CONTEXT *surface)
 
INT32 progressive_create_surface_context (PROGRESSIVE_CONTEXT *progressive, UINT16 surfaceId, UINT32 width, UINT32 height)
 
int progressive_delete_surface_context (PROGRESSIVE_CONTEXT *progressive, UINT16 surfaceId)
 
static INLINE void progressive_rfx_idwt_x (INT16 *pLowBand, int nLowStep, INT16 *pHighBand, int nHighStep, INT16 *pDstBand, int nDstStep, int nLowCount, int nHighCount, int nDstCount)
 
static INLINE void progressive_rfx_idwt_y (INT16 *pLowBand, int nLowStep, INT16 *pHighBand, int nHighStep, INT16 *pDstBand, int nDstStep, int nLowCount, int nHighCount, int nDstCount)
 
static INLINE int progressive_rfx_get_band_l_count (int level)
 
static INLINE int progressive_rfx_get_band_h_count (int level)
 
static INLINE void progressive_rfx_dwt_2d_decode_block (INT16 *buffer, INT16 *temp, int level)
 
static INLINE void progressive_rfx_dwt_2d_decode (INT16 *buffer, INT16 *temp, INT16 *current, INT16 *sign, BOOL diff)
 
static INLINE void progressive_rfx_decode_block (const primitives_t *prims, INT16 *buffer, int length, UINT32 shift)
 
static INLINE int progressive_rfx_decode_component (PROGRESSIVE_CONTEXT *progressive, RFX_COMPONENT_CODEC_QUANT *shift, const BYTE *data, int length, INT16 *buffer, INT16 *current, INT16 *sign, BOOL diff)
 
static INLINE int progressive_decompress_tile_first (PROGRESSIVE_CONTEXT *progressive, RFX_PROGRESSIVE_TILE *tile)
 
static INLINE INT16 progressive_rfx_srl_read (RFX_PROGRESSIVE_UPGRADE_STATE *state, UINT32 numBits)
 
static INLINE int progressive_rfx_upgrade_state_finish (RFX_PROGRESSIVE_UPGRADE_STATE *state)
 
static INLINE int progressive_rfx_upgrade_block (RFX_PROGRESSIVE_UPGRADE_STATE *state, INT16 *buffer, INT16 *sign, UINT32 length, UINT32 shift, UINT32 bitPos, UINT32 numBits)
 
static INLINE int progressive_rfx_upgrade_component (PROGRESSIVE_CONTEXT *progressive, RFX_COMPONENT_CODEC_QUANT *shift, RFX_COMPONENT_CODEC_QUANT *bitPos, RFX_COMPONENT_CODEC_QUANT *numBits, INT16 *buffer, INT16 *current, INT16 *sign, const BYTE *srlData, UINT32 srlLen, const BYTE *rawData, UINT32 rawLen)
 
static INLINE int progressive_decompress_tile_upgrade (PROGRESSIVE_CONTEXT *progressive, RFX_PROGRESSIVE_TILE *tile)
 
static INLINE int progressive_process_tiles (PROGRESSIVE_CONTEXT *progressive, const BYTE *blocks, UINT32 blocksLen, const PROGRESSIVE_SURFACE_CONTEXT *surface)
 
INT32 progressive_decompress (PROGRESSIVE_CONTEXT *progressive, const BYTE *pSrcData, UINT32 SrcSize, BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, REGION16 *invalidRegion, UINT16 surfaceId)
 
int progressive_compress (PROGRESSIVE_CONTEXT *progressive, const BYTE *pSrcData, UINT32 SrcSize, BYTE **ppDstData, UINT32 *pDstSize)
 
BOOL progressive_context_reset (PROGRESSIVE_CONTEXT *progressive)
 
PROGRESSIVE_CONTEXT * progressive_context_new (BOOL Compressor)
 
void progressive_context_free (PROGRESSIVE_CONTEXT *progressive)
 

Macro Definition Documentation

#define TAG   FREERDP_TAG("codec.progressive")

FreeRDP: A Remote Desktop Protocol Implementation Progressive Codec Bitmap Compression

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

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 void progressive_component_codec_quant_read ( const BYTE block,
RFX_COMPONENT_CODEC_QUANT *  quantVal 
)
static

Here is the caller graph for this function:

int progressive_compress ( PROGRESSIVE_CONTEXT *  progressive,
const BYTE pSrcData,
UINT32  SrcSize,
BYTE **  ppDstData,
UINT32 pDstSize 
)
void progressive_context_free ( PROGRESSIVE_CONTEXT *  progressive)

Here is the call graph for this function:

Here is the caller graph for this function:

PROGRESSIVE_CONTEXT* progressive_context_new ( BOOL  Compressor)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL progressive_context_reset ( PROGRESSIVE_CONTEXT *  progressive)

Here is the caller graph for this function:

INT32 progressive_create_surface_context ( PROGRESSIVE_CONTEXT *  progressive,
UINT16  surfaceId,
UINT32  width,
UINT32  height 
)

Here is the call graph for this function:

Here is the caller graph for this function:

INT32 progressive_decompress ( PROGRESSIVE_CONTEXT *  progressive,
const BYTE pSrcData,
UINT32  SrcSize,
BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
REGION16 *  invalidRegion,
UINT16  surfaceId 
)

If the number of elements specified by the regionCount field is larger than the actual number of elements in the regions field, the decoder SHOULD ignore this inconsistency.

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE int progressive_decompress_tile_first ( PROGRESSIVE_CONTEXT *  progressive,
RFX_PROGRESSIVE_TILE *  tile 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE int progressive_decompress_tile_upgrade ( PROGRESSIVE_CONTEXT *  progressive,
RFX_PROGRESSIVE_TILE *  tile 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int progressive_delete_surface_context ( PROGRESSIVE_CONTEXT *  progressive,
UINT16  surfaceId 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* progressive_get_block_type_string ( UINT16  blockType)
static

Here is the caller graph for this function:

static INLINE void* progressive_get_surface_data ( PROGRESSIVE_CONTEXT *  progressive,
UINT16  surfaceId 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE int progressive_process_tiles ( PROGRESSIVE_CONTEXT *  progressive,
const BYTE blocks,
UINT32  blocksLen,
const PROGRESSIVE_SURFACE_CONTEXT *  surface 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE void progressive_rfx_decode_block ( const primitives_t prims,
INT16 *  buffer,
int  length,
UINT32  shift 
)
static

Here is the caller graph for this function:

static INLINE int progressive_rfx_decode_component ( PROGRESSIVE_CONTEXT *  progressive,
RFX_COMPONENT_CODEC_QUANT *  shift,
const BYTE data,
int  length,
INT16 *  buffer,
INT16 *  current,
INT16 *  sign,
BOOL  diff 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE void progressive_rfx_dwt_2d_decode ( INT16 *  buffer,
INT16 *  temp,
INT16 *  current,
INT16 *  sign,
BOOL  diff 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE void progressive_rfx_dwt_2d_decode_block ( INT16 *  buffer,
INT16 *  temp,
int  level 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE int progressive_rfx_get_band_h_count ( int  level)
static

Here is the caller graph for this function:

static INLINE int progressive_rfx_get_band_l_count ( int  level)
static

Here is the caller graph for this function:

static INLINE void progressive_rfx_idwt_x ( INT16 *  pLowBand,
int  nLowStep,
INT16 *  pHighBand,
int  nHighStep,
INT16 *  pDstBand,
int  nDstStep,
int  nLowCount,
int  nHighCount,
int  nDstCount 
)
static

Here is the caller graph for this function:

static INLINE void progressive_rfx_idwt_y ( INT16 *  pLowBand,
int  nLowStep,
INT16 *  pHighBand,
int  nHighStep,
INT16 *  pDstBand,
int  nDstStep,
int  nLowCount,
int  nHighCount,
int  nDstCount 
)
static

Here is the caller graph for this function:

static INLINE void progressive_rfx_quant_add ( RFX_COMPONENT_CODEC_QUANT *  q1,
RFX_COMPONENT_CODEC_QUANT *  q2,
RFX_COMPONENT_CODEC_QUANT *  dst 
)
static

Here is the caller graph for this function:

static INLINE BOOL progressive_rfx_quant_cmp_equal ( RFX_COMPONENT_CODEC_QUANT *  q1,
RFX_COMPONENT_CODEC_QUANT *  q2 
)
static

Here is the caller graph for this function:

static INLINE BOOL progressive_rfx_quant_cmp_greater_equal ( RFX_COMPONENT_CODEC_QUANT *  q1,
RFX_COMPONENT_CODEC_QUANT *  q2 
)
static
static INLINE BOOL progressive_rfx_quant_cmp_less_equal ( RFX_COMPONENT_CODEC_QUANT *  q1,
RFX_COMPONENT_CODEC_QUANT *  q2 
)
static
static INLINE void progressive_rfx_quant_ladd ( RFX_COMPONENT_CODEC_QUANT *  q,
int  val 
)
static
static INLINE BOOL progressive_rfx_quant_lcmp_greater_equal ( RFX_COMPONENT_CODEC_QUANT *  q,
int  val 
)
static

Here is the caller graph for this function:

static INLINE BOOL progressive_rfx_quant_lcmp_less_equal ( RFX_COMPONENT_CODEC_QUANT *  q,
int  val 
)
static

Here is the caller graph for this function:

static INLINE void progressive_rfx_quant_lsub ( RFX_COMPONENT_CODEC_QUANT *  q,
int  val 
)
static

Here is the caller graph for this function:

static void progressive_rfx_quant_print ( RFX_COMPONENT_CODEC_QUANT *  q,
const char *  name 
)
static
static INLINE void progressive_rfx_quant_sub ( RFX_COMPONENT_CODEC_QUANT *  q1,
RFX_COMPONENT_CODEC_QUANT *  q2,
RFX_COMPONENT_CODEC_QUANT *  dst 
)
static

Here is the caller graph for this function:

static INLINE INT16 progressive_rfx_srl_read ( RFX_PROGRESSIVE_UPGRADE_STATE *  state,
UINT32  numBits 
)
static

Here is the caller graph for this function:

static INLINE int progressive_rfx_upgrade_block ( RFX_PROGRESSIVE_UPGRADE_STATE *  state,
INT16 *  buffer,
INT16 *  sign,
UINT32  length,
UINT32  shift,
UINT32  bitPos,
UINT32  numBits 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE int progressive_rfx_upgrade_component ( PROGRESSIVE_CONTEXT *  progressive,
RFX_COMPONENT_CODEC_QUANT *  shift,
RFX_COMPONENT_CODEC_QUANT *  bitPos,
RFX_COMPONENT_CODEC_QUANT *  numBits,
INT16 *  buffer,
INT16 *  current,
INT16 *  sign,
const BYTE srlData,
UINT32  srlLen,
const BYTE rawData,
UINT32  rawLen 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE int progressive_rfx_upgrade_state_finish ( RFX_PROGRESSIVE_UPGRADE_STATE *  state)
static

Here is the caller graph for this function:

static INLINE BOOL progressive_set_surface_data ( PROGRESSIVE_CONTEXT *  progressive,
UINT16  surfaceId,
void pData 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void progressive_surface_context_free ( PROGRESSIVE_SURFACE_CONTEXT *  surface)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static PROGRESSIVE_SURFACE_CONTEXT* progressive_surface_context_new ( UINT16  surfaceId,
UINT32  width,
UINT32  height 
)
static

Here is the caller graph for this function: