FreeRDP
|
#include <freerdp/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/sysinfo.h>
#include <winpr/bitstream.h>
#include <winpr/intrin.h>
#include "rfx_bitstream.h"
#include "rfx_rlgr.h"
Macros | |
#define | KPMAX (80) /* max value for kp or krp */ |
#define | LSGR (3) /* shift count to convert kp to k */ |
#define | UP_GR (4) /* increase in kp after a zero run in RL mode */ |
#define | DN_GR (6) /* decrease in kp after a nonzero symbol in RL mode */ |
#define | UQ_GR (3) /* increase in kp after nonzero symbol in GR mode */ |
#define | DQ_GR (3) /* decrease in kp after zero symbol in GR mode */ |
#define | GetMinBits(_val, _nbits) |
#define | UpdateParam(_param, _deltaP, _k) |
#define | GetNextInput(_n) |
#define | OutputBits(numBits, bitPattern) rfx_bitstream_put_bits(bs, bitPattern, numBits) |
#define | OutputBit(count, bit) |
#define | Get2MagSign(input) ((input) >= 0 ? 2 * (input) : -2 * (input)-1) |
#define | CodeGR(krp, val) rfx_rlgr_code_gr(bs, krp, val) |
Functions | |
static BOOL CALLBACK | rfx_rlgr_init (PINIT_ONCE once, PVOID param, PVOID *context) |
static INLINE UINT32 | lzcnt_s (UINT32 x) |
int | rfx_rlgr_decode (RLGR_MODE mode, const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, INT16 *WINPR_RESTRICT pDstData, UINT32 rDstSize) |
static void | rfx_rlgr_code_gr (RFX_BITSTREAM *bs, int *krp, UINT32 val) |
int | rfx_rlgr_encode (RLGR_MODE mode, const INT16 *WINPR_RESTRICT data, UINT32 data_size, BYTE *WINPR_RESTRICT buffer, UINT32 buffer_size) |
Variables | |
static BOOL | g_LZCNT = FALSE |
static INIT_ONCE | rfx_rlgr_init_once = INIT_ONCE_STATIC_INIT |
#define CodeGR | ( | krp, | |
val | |||
) | rfx_rlgr_code_gr(bs, krp, val) |
#define DN_GR (6) /* decrease in kp after a nonzero symbol in RL mode */ |
#define DQ_GR (3) /* decrease in kp after zero symbol in GR mode */ |
#define Get2MagSign | ( | input | ) | ((input) >= 0 ? 2 * (input) : -2 * (input)-1) |
#define GetMinBits | ( | _val, | |
_nbits | |||
) |
#define GetNextInput | ( | _n | ) |
#define KPMAX (80) /* max value for kp or krp */ |
FreeRDP: A Remote Desktop Protocol Implementation RemoteFX Codec Library - RLGR
Copyright 2011 Vic Lee
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. This implementation of RLGR refers to [MS-RDPRFX] 3.1.8.1.7.3 RLGR1/RLGR3 Pseudocode
#define OutputBit | ( | count, | |
bit | |||
) |
#define OutputBits | ( | numBits, | |
bitPattern | |||
) | rfx_bitstream_put_bits(bs, bitPattern, numBits) |
#define UP_GR (4) /* increase in kp after a zero run in RL mode */ |
#define UpdateParam | ( | _param, | |
_deltaP, | |||
_k | |||
) |
#define UQ_GR (3) /* increase in kp after nonzero symbol in GR mode */ |
|
static |
|
static |
int rfx_rlgr_decode | ( | RLGR_MODE | mode, |
const BYTE *WINPR_RESTRICT | pSrcData, | ||
UINT32 | SrcSize, | ||
INT16 *WINPR_RESTRICT | pDstData, | ||
UINT32 | rDstSize | ||
) |
int rfx_rlgr_encode | ( | RLGR_MODE | mode, |
const INT16 *WINPR_RESTRICT | data, | ||
UINT32 | data_size, | ||
BYTE *WINPR_RESTRICT | buffer, | ||
UINT32 | buffer_size | ||
) |
|
static |
|
static |
|
static |