[Spice-devel] [PATCH common 1/3] quic: compile with constant bpp, to help compiler

Hans de Goede hdegoede at redhat.com
Mon Sep 9 00:23:57 PDT 2013


Looks good, ACK series (with the change you mentioned yourself already)

On 09/08/2013 09:07 PM, Marc-André Lureau wrote:
> From: Marc-André Lureau <marcandre.lureau at gmail.com>
>
> ---
>   common/quic_family_tmpl.c |  4 ++--
>   common/quic_rgb_tmpl.c    |  6 +++---
>   common/quic_tmpl.c        | 16 ++++++++--------
>   3 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/common/quic_family_tmpl.c b/common/quic_family_tmpl.c
> index cca2c05..287ff6d 100644
> --- a/common/quic_family_tmpl.c
> +++ b/common/quic_family_tmpl.c
> @@ -74,13 +74,13 @@ static unsigned int FNAME(golomb_decoding)(const unsigned int l, const unsigned
>
>   /* update the bucket using just encoded curval */
>   static void FNAME(update_model)(CommonState *state, s_bucket * const bucket,
> -                                const BYTE curval, unsigned int bpp)
> +                                const BYTE curval)
>   {
> +    const unsigned int bpp = BPC;
>       COUNTER * const pcounters = bucket->pcounters;
>       unsigned int i;
>       unsigned int bestcode;
>       unsigned int bestcodelen;
> -    //unsigned int bpp = encoder->bpp;
>
>       /* update counters, find minimum */
>
> diff --git a/common/quic_rgb_tmpl.c b/common/quic_rgb_tmpl.c
> index 37c908c..19cc348 100644
> --- a/common/quic_rgb_tmpl.c
> +++ b/common/quic_rgb_tmpl.c
> @@ -178,11 +178,11 @@
>
>   #define UPDATE_MODEL(index)                                                                 \
>       update_model(&encoder->rgb_state, find_bucket(channel_r, correlate_row_r[index - 1]),   \
> -                correlate_row_r[index], bpc);                                               \
> +                correlate_row_r[index]);                                               \
>       update_model(&encoder->rgb_state, find_bucket(channel_g, correlate_row_g[index - 1]),   \
> -                correlate_row_g[index], bpc);                                               \
> +                correlate_row_g[index]);                                               \
>       update_model(&encoder->rgb_state, find_bucket(channel_b, correlate_row_b[index - 1]),   \
> -                correlate_row_b[index], bpc);
> +                correlate_row_b[index]);
>
>
>   #ifdef RLE_PRED_1
> diff --git a/common/quic_tmpl.c b/common/quic_tmpl.c
> index b625daf..75f2ff0 100644
> --- a/common/quic_tmpl.c
> +++ b/common/quic_tmpl.c
> @@ -173,7 +173,7 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
>           } else {
>               channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
>               update_model(&channel->state, find_bucket(channel, decorelate_drow[-1]),
> -                         decorelate_drow[i], bpc);
> +                         decorelate_drow[i]);
>           }
>           stopidx = ++i + channel->state.waitcnt;
>       } else {
> @@ -191,7 +191,7 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
>           }
>
>           update_model(&channel->state, find_bucket(channel, decorelate_drow[stopidx - 1]),
> -                     decorelate_drow[stopidx], bpc);
> +                     decorelate_drow[stopidx]);
>           stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
>       }
>
> @@ -272,7 +272,7 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
>           } else {
>               channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
>               update_model(&channel->state, find_bucket(channel, decorelate_drow[-1]),
> -                         decorelate_drow[0], bpc);
> +                         decorelate_drow[0]);
>           }
>           stopidx = ++i + channel->state.waitcnt;
>       } else {
> @@ -295,7 +295,7 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
>               }
>
>               update_model(&channel->state, find_bucket(channel, decorelate_drow[stopidx - 1]),
> -                         decorelate_drow[stopidx], bpc);
> +                         decorelate_drow[stopidx]);
>               stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
>           }
>
> @@ -406,7 +406,7 @@ static void FNAME(uncompress_row0_seg)(Encoder *encoder, Channel *channel, int i
>           } else {
>               channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
>               update_model(&channel->state, find_bucket(channel, correlate_row[-1]),
> -                         correlate_row[0], bpc);
> +                         correlate_row[0]);
>           }
>           stopidx = ++i + channel->state.waitcnt;
>       } else {
> @@ -426,7 +426,7 @@ static void FNAME(uncompress_row0_seg)(Encoder *encoder, Channel *channel, int i
>               decode_eatbits(encoder, codewordlen);
>           }
>
> -        update_model(&channel->state, pbucket, correlate_row[stopidx], bpc);
> +        update_model(&channel->state, pbucket, correlate_row[stopidx]);
>
>           stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
>       }
> @@ -511,7 +511,7 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
>           } else {
>               channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
>               update_model(&channel->state, find_bucket(channel, correlate_row[-1]),
> -                         correlate_row[0], bpc);
> +                         correlate_row[0]);
>           }
>           stopidx = ++i + channel->state.waitcnt;
>       } else {
> @@ -535,7 +535,7 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
>                   decode_eatbits(encoder, codewordlen);
>               }
>
> -            update_model(&channel->state, pbucket, correlate_row[stopidx], bpc);
> +            update_model(&channel->state, pbucket, correlate_row[stopidx]);
>
>               stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
>           }
>


More information about the Spice-devel mailing list