2 * FreeRDP: A Remote Desktop Protocol client.
5 * Copyright 2011 Samsung, Author Jiten Pathy
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
23 #include <freerdp/api.h>
24 #include <freerdp/types.h>
25 #include <freerdp/utils/stream.h>
31 #define BYTESUM(_bs) (_bs[0] + _bs[1] + _bs[2] + _bs[3])
32 #define ROUND_UP_TO(_b, _n) (_b + ((~(_b & (_n-1)) + 0x1) & (_n-1)));
34 /* NSCODEC_BITMAP_STREAM */
37 uint32 PlaneByteCount[4];
39 uint8 ChromaSubSamplingLevel;
43 typedef struct _NSC_STREAM NSC_STREAM;
47 uint32 OrgByteCount[4]; /* original byte length of luma, chroma orange, chroma green, alpha variable in order */
48 NSC_STREAM* nsc_stream;
51 uint8* bmpdata; /* final argb values in little endian order */
52 STREAM* org_buf[4]; /* Decompressed Plane Buffers in the respective order */
54 typedef struct _NSC_CONTEXT NSC_CONTEXT;
56 FREERDP_API NSC_CONTEXT* nsc_context_new(void);
57 FREERDP_API void nsc_process_message(NSC_CONTEXT* context, uint8* data, uint32 length);
58 FREERDP_API void nsc_context_initialize(NSC_CONTEXT* context, STREAM* s);
59 FREERDP_API void nsc_stream_initialize(NSC_CONTEXT* context, STREAM* s);
60 FREERDP_API void nsc_rle_decompress_data(NSC_CONTEXT* context);
61 FREERDP_API void nsc_ycocg_rgb_convert(NSC_CONTEXT* context);
62 FREERDP_API void nsc_rle_decode(STREAM* in, STREAM* out, uint32 origsz);
63 FREERDP_API void nsc_chroma_supersample(NSC_CONTEXT* context);
64 FREERDP_API void nsc_cl_expand(STREAM* stream, uint8 shiftcount, uint32 origsz);
65 FREERDP_API void nsc_colorloss_recover(NSC_CONTEXT* context);
66 FREERDP_API void nsc_ycocg_rgb(NSC_CONTEXT* context);
67 FREERDP_API void nsc_context_destroy(NSC_CONTEXT* context);