FreeRDP
nsc_encode.c File Reference
#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_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)
 
UINT32 nsc_compute_byte_count (NSC_CONTEXT *context, UINT32 *ByteCount, UINT32 width, UINT32 height)
 
NSC_MESSAGE * nsc_encode_messages (NSC_CONTEXT *context, const BYTE *data, UINT32 x, UINT32 y, UINT32 width, UINT32 height, UINT32 scanline, UINT32 *numMessages, UINT32 maxDataSize)
 
BOOL nsc_write_message (NSC_CONTEXT *context, wStream *s, NSC_MESSAGE *message)
 
void nsc_message_free (NSC_CONTEXT *context, NSC_MESSAGE *message)
 
BOOL nsc_compose_message (NSC_CONTEXT *context, wStream *s, const BYTE *data, UINT32 width, UINT32 height, UINT32 scanline)
 

Function Documentation

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:

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

Here is the caller graph for this function:

static BOOL nsc_context_initialize_encode ( NSC_CONTEXT *  context)
static

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 caller graph for this function:

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:

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_MESSAGE* nsc_encode_messages ( NSC_CONTEXT *  context,
const BYTE data,
UINT32  x,
UINT32  y,
UINT32  width,
UINT32  height,
UINT32  scanline,
UINT32 numMessages,
UINT32  maxDataSize 
)

Here is the call graph for this function:

static BOOL nsc_encode_subsampling ( NSC_CONTEXT *  context)
static

Here is the caller graph for this function:

void nsc_message_free ( NSC_CONTEXT *  context,
NSC_MESSAGE *  message 
)

Here is the call graph for this function:

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:

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:

BOOL nsc_write_message ( NSC_CONTEXT *  context,
wStream *  s,
NSC_MESSAGE *  message 
)

Here is the call graph for this function:

Here is the caller graph for this function: