[Spice-commits] server/lz4-encoder.c spice-common
Frediano Ziglio
fziglio at kemper.freedesktop.org
Mon Nov 28 18:39:53 UTC 2016
server/lz4-encoder.c | 9 ++++++++-
spice-common | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit bb74d7ad47936518d4c85a1d0c0f0df66d6c10cb
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Nov 28 18:38:14 2016 +0000
Use LZ4_compress_fast_continue if available
This make compression faster and avoids a warning on newer
lz4 versions.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/lz4-encoder.c b/server/lz4-encoder.c
index f193fd8..9fabc35 100644
--- a/server/lz4-encoder.c
+++ b/server/lz4-encoder.c
@@ -75,9 +75,16 @@ int lz4_encode(Lz4EncoderContext *lz4, int height, int stride, uint8_t *io_ptr,
in_buf = lines;
in_size = stride * num_lines;
lines += in_size;
- compressed_lines = (uint8_t *) malloc(LZ4_compressBound(in_size) + 4);
+ int bound_size = LZ4_compressBound(in_size);
+ compressed_lines = (uint8_t *) malloc(bound_size + 4);
+#ifdef HAVE_LZ4_COMPRESS_FAST_CONTINUE
+ enc_size = LZ4_compress_fast_continue(stream, (const char *) in_buf,
+ (char *) compressed_lines + 4, in_size,
+ bound_size, 1);
+#else
enc_size = LZ4_compress_continue(stream, (const char *) in_buf,
(char *) compressed_lines + 4, in_size);
+#endif
if (enc_size <= 0) {
spice_error("compress failed!");
free(compressed_lines);
diff --git a/spice-common b/spice-common
index 31819a2..6b409c4 160000
--- a/spice-common
+++ b/spice-common
@@ -1 +1 @@
-Subproject commit 31819a24248ba5311e7293ddac519b8134e67fa0
+Subproject commit 6b409c4a7979f043a997ae762f16c6edec68345e
More information about the Spice-commits
mailing list