[Spice-devel] [7/ ]quic: generalize QuicEncoder.prototype.decode_run

Christophe Fergeau cfergeau at redhat.com
Fri Sep 28 11:37:42 PDT 2012


I think I've already ACK'ed this one.

Christophe

On Mon, Sep 24, 2012 at 10:52:48AM -0500, Aric Stewart wrote:
> Signed-off-by: Aric Stewart <aric at codeweavers.com>
> ---
> quic.js |   26 +++++++++++++-------------
> 1 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/quic.js b/quic.js
> index 699820f..26a021f 100644
> --- a/quic.js
> +++ b/quic.js
> @@ -775,7 +775,7 @@ QuicEncoder.prototype.quic_rgb32_uncompress_row_seg = function( prev_row, cur_ro
>                         /* do run */
>                         this.rgb_state.waitcnt = stopidx - i;
>                         run_index = i;
> -                        run_end = i + this.decode_run();
> +                        run_end = i + this.decode_run(this.rgb_state);
> 
>                         for (; i < run_end; i++) {
>                             var pixel = i * rgb32_pixel_size;
> @@ -833,7 +833,7 @@ QuicEncoder.prototype.quic_rgb32_uncompress_row_seg = function( prev_row, cur_ro
>                     /* do run */
>                     this.rgb_state.waitcnt = stopidx - i;
>                     run_index = i;
> -                    run_end = i + this.decode_run();
> +                    run_end = i + this.decode_run(this.rgb_state);
> 
>                     for (; i < run_end; i++) {
>                         var pixel = i * rgb32_pixel_size;
> @@ -875,7 +875,7 @@ QuicEncoder.prototype.quic_rgb32_uncompress_row_seg = function( prev_row, cur_ro
>         }
> }
> 
> -QuicEncoder.prototype.decode_run = function()
> +QuicEncoder.prototype.decode_run = function(state)
> {
>     var runlen = 0;
> 
> @@ -885,11 +885,11 @@ QuicEncoder.prototype.decode_run = function()
>         var temp = zeroLUT[x];
> 
>         for (hits = 1; hits <= temp; hits++) {
> -            runlen += this.rgb_state.melcorder;
> +            runlen += state.melcorder;
> 
> -            if (this.rgb_state.melcstate < 32) {
> -                this.rgb_state.melclen = J[++this.rgb_state.melcstate];
> -                this.rgb_state.melcorder = (1 << this.rgb_state.melclen);
> +            if (state.melcstate < 32) {
> +                state.melclen = J[++state.melcstate];
> +                state.melcorder = (1 << state.melclen);
>             }
>         }
>         if (temp != 8) {
> @@ -900,14 +900,14 @@ QuicEncoder.prototype.decode_run = function()
>         this.decode_eatbits(8);
>     } while (true);
> 
> -    if (this.rgb_state.melclen) {
> -        runlen += this.io_word >>> (32 - this.rgb_state.melclen);
> -        this.decode_eatbits(this.rgb_state.melclen);
> +    if (state.melclen) {
> +        runlen += this.io_word >>> (32 - state.melclen);
> +        this.decode_eatbits(state.melclen);
>     }
> 
> -    if (this.rgb_state.melcstate) {
> -        this.rgb_state.melclen = J[--this.rgb_state.melcstate];
> -        this.rgb_state.melcorder = (1 << this.rgb_state.melclen);
> +    if (state.melcstate) {
> +        state.melclen = J[--state.melcstate];
> +        state.melcorder = (1 << state.melclen);
>     }
> 
>     return runlen;
> -- 
> 1.7.7.5 (Apple Git-26)
> 
> 


> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120928/1fdeed59/attachment.pgp>


More information about the Spice-devel mailing list