Commit Graph

11 Commits

Author SHA1 Message Date
Frediano Ziglio
461288534f glz-encode: Remove obsolete reference segment
The GLZ code is basically LZ code (in spice-common) sharing image
segments between multiple images.
The code for RLE check in LZ (common/lz_compress_tmpl.c) is dealing
with both RLE and dictionary matches being:

    if (!distance) {
        /* zero distance means a run */
        PIXEL x = *ref;
        while ((ip < ip_bound) && (ref < ref_limit)) { // TODO: maybe separate a run from
                                                       //       the same seg or from different
                                                       //       ones in order to spare
                                                       //       ref < ref_limit

in GLZ that part was copied to RLE part removing the need for the
second segment ("ref"). However the comment and setting ref variables
were not removed. Remove the old code to avoid confusions.

This also remove a Covscan warning as ref_limit was set not not used
(reported by Uri Lublin).
The warning was:

CLANG warning: "Value stored to 'ref_limit' is never read"

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2019-08-12 10:48:02 +01:00
Frediano Ziglio
ed68d491fd Do not check for HAVE_CONFIG_H
This should always be defined and including config.h is a requirement.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-30 09:26:55 +01:00
Frediano Ziglio
90cd6432da glz: Inline GET_{r,g,b} macros
With last changes are just used once and are straight forward.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-06-27 16:46:52 +01:00
Frediano Ziglio
9d2ec4d5c3 glz: Optimize SAME_PIXEL for RGB16
Do not extract all components and compare one by one, can be easily
compared together.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-06-27 16:46:50 +01:00
Frediano Ziglio
aaef481691 glz: Move some macros to a common place
The macros for both depth are the same, reuse the definition.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-06-27 16:46:30 +01:00
Pavel Grunt
a68c821164 Fix -Werror=format with DEBUG_ENCODE
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-07-01 14:00:37 +02:00
Frediano Ziglio
2cb8b1cc9f Removed unused GET_CODE definition
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-25 14:32:42 +01:00
Uri Lublin
b028c2e38a glz: simplification of do_match and PIXEL_ID
Following commit e8017dd366 here
are some more ifdef simplification.

For PIXEL_ID and PIXEL_DIST macros,
the ifndef LZ_PLT defines are special cases of the LZ_PLT
(#else) defines, when pix_per_byte is 1

Now do_match can accept pix_per_byte param for all different
definitions (implementations).

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-05-20 11:46:30 +01:00
Frediano Ziglio
fb10f5bf52 Simplify #ifdef/#endif in glz code
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-18 00:24:37 +01:00
Frediano Ziglio
e8017dd366 glz: simplification of PIXEL_DIST calls
Make macro have same prototype even if we need an extra argument.
This avoids having different calls for LZ_PLT.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2016-05-17 16:03:38 +01:00
Marc-André Lureau
82fa233fa6 server: rename _tmpl files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-26 13:33:36 +00:00