mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-06 23:12:17 +00:00
remove glz_encoder_config.h
Move all code from glz_encoder_config.h into other files. Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
aef334e6e8
commit
0410c6f165
@ -71,7 +71,6 @@ libspice_server_la_SOURCES = \
|
||||
demarshallers.h \
|
||||
glz-encoder.c \
|
||||
glz-encoder.h \
|
||||
glz_encoder_config.h \
|
||||
glz-encoder-dict.c \
|
||||
glz-encoder-dict.h \
|
||||
glz-encoder-priv.h \
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
#include "red-channel.h"
|
||||
#include "red-parse-qxl.h"
|
||||
#include "image-cache.h"
|
||||
#include "glz-encoder-dict.h"
|
||||
#include "glz-encoder.h"
|
||||
#include "jpeg-encoder.h"
|
||||
#ifdef USE_LZ4
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "glz-encoder.h"
|
||||
#include "glz-encoder-dict.h"
|
||||
#include "glz-encoder-priv.h"
|
||||
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
#define GLZ_ENCODER_DICT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "glz_encoder_config.h"
|
||||
|
||||
/*
|
||||
Interface for maintaining lz dictionary that is shared among several encoders.
|
||||
@ -30,6 +29,9 @@
|
||||
typedef void GlzEncDictContext;
|
||||
typedef void GlzEncDictImageContext;
|
||||
|
||||
typedef void GlzUsrImageContext;
|
||||
typedef struct GlzEncoderUsrContext GlzEncoderUsrContext;
|
||||
|
||||
/* NOTE: DISPLAY_MIGRATE_DATA_VERSION should change in case GlzEncDictRestoreData changes*/
|
||||
typedef struct GlzEncDictRestoreData {
|
||||
uint32_t size;
|
||||
|
||||
@ -183,4 +183,16 @@ void glz_dictionary_post_encode(uint32_t encoder_id, GlzEncoderUsrContext *usr,
|
||||
(dict)->window.encoders_heads[enc_id]].pixels_so_far <= \
|
||||
ref_seg->pixels_so_far)))
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#define GLZ_ASSERT(usr, x) \
|
||||
if (!(x)) (usr)->error(usr, "%s: ASSERT %s failed\n", __FUNCTION__, #x);
|
||||
|
||||
#else
|
||||
|
||||
#define GLZ_ASSERT(usr, x)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // GLZ_ENCODER_PRIV_H_
|
||||
|
||||
@ -23,7 +23,25 @@
|
||||
#include <stdint.h>
|
||||
#include "common/lz_common.h"
|
||||
#include "glz-encoder-dict.h"
|
||||
#include "glz_encoder_config.h"
|
||||
|
||||
struct GlzEncoderUsrContext {
|
||||
SPICE_GNUC_PRINTF(2, 3) void (*error)(GlzEncoderUsrContext *usr, const char *fmt, ...);
|
||||
SPICE_GNUC_PRINTF(2, 3) void (*warn)(GlzEncoderUsrContext *usr, const char *fmt, ...);
|
||||
SPICE_GNUC_PRINTF(2, 3) void (*info)(GlzEncoderUsrContext *usr, const char *fmt, ...);
|
||||
void *(*malloc)(GlzEncoderUsrContext *usr, int size);
|
||||
void (*free)(GlzEncoderUsrContext *usr, void *ptr);
|
||||
|
||||
// get the next chunk of the image which is entered to the dictionary. If the image is down to
|
||||
// top, return it from the last line to the first one (stride should always be positive)
|
||||
int (*more_lines)(GlzEncoderUsrContext *usr, uint8_t **lines);
|
||||
|
||||
// get the next chunk of the compressed buffer.return number of bytes in the chunk.
|
||||
int (*more_space)(GlzEncoderUsrContext *usr, uint8_t **io_ptr);
|
||||
|
||||
// called when an image is removed from the dictionary, due to the window size limit
|
||||
void (*free_image)(GlzEncoderUsrContext *usr, GlzUsrImageContext *image);
|
||||
|
||||
};
|
||||
|
||||
typedef void GlzEncoderContext;
|
||||
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _H_GLZ_ENCODER_CONFIG
|
||||
#define _H_GLZ_ENCODER_CONFIG
|
||||
|
||||
#include <spice/macros.h>
|
||||
#include "common/lz_common.h"
|
||||
|
||||
typedef void GlzUsrImageContext;
|
||||
typedef struct GlzEncoderUsrContext GlzEncoderUsrContext;
|
||||
|
||||
struct GlzEncoderUsrContext {
|
||||
SPICE_GNUC_PRINTF(2, 3) void (*error)(GlzEncoderUsrContext *usr, const char *fmt, ...);
|
||||
SPICE_GNUC_PRINTF(2, 3) void (*warn)(GlzEncoderUsrContext *usr, const char *fmt, ...);
|
||||
SPICE_GNUC_PRINTF(2, 3) void (*info)(GlzEncoderUsrContext *usr, const char *fmt, ...);
|
||||
void *(*malloc)(GlzEncoderUsrContext *usr, int size);
|
||||
void (*free)(GlzEncoderUsrContext *usr, void *ptr);
|
||||
|
||||
// get the next chunk of the image which is entered to the dictionary. If the image is down to
|
||||
// top, return it from the last line to the first one (stride should always be positive)
|
||||
int (*more_lines)(GlzEncoderUsrContext *usr, uint8_t **lines);
|
||||
|
||||
// get the next chunk of the compressed buffer.return number of bytes in the chunk.
|
||||
int (*more_space)(GlzEncoderUsrContext *usr, uint8_t **io_ptr);
|
||||
|
||||
// called when an image is removed from the dictionary, due to the window size limit
|
||||
void (*free_image)(GlzEncoderUsrContext *usr, GlzUsrImageContext *image);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#define GLZ_ASSERT(usr, x) \
|
||||
if (!(x)) (usr)->error(usr, "%s: ASSERT %s failed\n", __FUNCTION__, #x);
|
||||
|
||||
#else
|
||||
|
||||
#define GLZ_ASSERT(usr, x)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user