FreeRDP
nsc_encode.c File Reference
#include <freerdp/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <freerdp/codec/nsc.h>
#include <freerdp/codec/color.h>
#include "nsc_types.h"
#include "nsc_encode.h"

Functions

static BOOL nsc_write_message (NSC_CONTEXT *context, wStream *s, const NSC_MESSAGE *message)
 
static BOOL nsc_context_initialize_encode (NSC_CONTEXT *context)
 
static BOOL nsc_encode_argb_to_aycocg (NSC_CONTEXT *context, const BYTE *data, UINT32 scanline)
 
static BOOL nsc_encode_subsampling (NSC_CONTEXT *context)
 
BOOL nsc_encode (NSC_CONTEXT *context, const BYTE *bmpdata, UINT32 rowstride)
 
static UINT32 nsc_rle_encode (const BYTE *in, BYTE *out, UINT32 originalSize)
 
static void nsc_rle_compress_data (NSC_CONTEXT *context)
 
static UINT32 nsc_compute_byte_count (NSC_CONTEXT *context, UINT32 *ByteCount, UINT32 width, UINT32 height)
 
BOOL nsc_compose_message (NSC_CONTEXT *context, wStream *s, const BYTE *data, UINT32 width, UINT32 height, UINT32 scanline)
 
BOOL nsc_decompose_message (NSC_CONTEXT *context, wStream *s, BYTE *bmpdata, UINT32 x, UINT32 y, UINT32 width, UINT32 height, UINT32 rowstride, UINT32 format, UINT32 flip)
 

Function Documentation

◆ nsc_compose_message()

BOOL nsc_compose_message ( NSC_CONTEXT *  context,
wStream s,
const BYTE data,
UINT32  width,
UINT32  height,
UINT32  scanline 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsc_compute_byte_count()

static UINT32 nsc_compute_byte_count ( NSC_CONTEXT *  context,
UINT32 *  ByteCount,
UINT32  width,
UINT32  height 
)
static

◆ nsc_context_initialize_encode()

static BOOL nsc_context_initialize_encode ( NSC_CONTEXT *  context)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsc_decompose_message()

BOOL nsc_decompose_message ( NSC_CONTEXT *  context,
wStream s,
BYTE bmpdata,
UINT32  x,
UINT32  y,
UINT32  width,
UINT32  height,
UINT32  rowstride,
UINT32  format,
UINT32  flip 
)
Here is the call graph for this function:

◆ nsc_encode()

BOOL nsc_encode ( NSC_CONTEXT *  context,
const BYTE bmpdata,
UINT32  rowstride 
)

FreeRDP: A Remote Desktop Protocol Implementation NSCodec Encoder

Copyright 2012 Vic Lee 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsc_encode_argb_to_aycocg()

static BOOL nsc_encode_argb_to_aycocg ( NSC_CONTEXT *  context,
const BYTE data,
UINT32  scanline 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsc_encode_subsampling()

static BOOL nsc_encode_subsampling ( NSC_CONTEXT *  context)
static
Here is the caller graph for this function:

◆ nsc_rle_compress_data()

static void nsc_rle_compress_data ( NSC_CONTEXT *  context)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsc_rle_encode()

static UINT32 nsc_rle_encode ( const BYTE in,
BYTE out,
UINT32  originalSize 
)
static

We quit the loop if the running compressed size is larger than the original. In such cases data will be sent uncompressed.

Here is the caller graph for this function:

◆ nsc_write_message()

BOOL nsc_write_message ( NSC_CONTEXT *  context,
wStream s,
const NSC_MESSAGE *  message 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: