[Spice-devel] principle of compute_lines_gradual_score

Frediano Ziglio fziglio at redhat.com
Mon Apr 25 13:01:57 UTC 2016


> 
> Hi, I'm a beginner at SPICE project. Today, I was reading the code,
> the function which named `_get_bitmap_graduality_level` at line 5979
> in file server/red_worker.c (the version of spice is 0.12.7 and my OS
> is Fedora 23). It seems that get a score value from a image by the
> function and I also found the function `void
> FNAME(compute_lines_gradual_score)` at line 116 in file
> server/red_bitmap_utils.h. I really can't understand the what these
> two functions do, the logic, I mean.
> 
> So the question is that could you tell me the principle of the
> algorithm? thanks : )

Basically try to detect if a picture is a natural one or a result of
a draw.
Natural picture are better to be compressed with some algorithms (like
jpeg).
The idea is that you take some samples in the image and score based on
the variation (let's say for instance the color change less that 20%
from a pixel to the next you score 1 otherwise you score 0).

Frediano


More information about the Spice-devel mailing list