static void qtrle_decode_1bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change)

{

    int rle_code;

    int pixel_ptr = 0;

    int row_inc = s->frame.linesize[0];

    unsigned char pi0, pi1;  /* 2 8-pixel values */

    unsigned char *rgb = s->frame.data[0];

    int pixel_limit = s->frame.linesize[0] * s->avctx->height;

    int skip;



    while (lines_to_change) {

        CHECK_STREAM_PTR(2);

        skip = s->buf[stream_ptr++];

        rle_code = (signed char)s->buf[stream_ptr++];

        if (rle_code == 0)

            break;

        if(skip & 0x80) {

            lines_to_change--;

            row_ptr += row_inc;

            pixel_ptr = row_ptr + 2 * (skip & 0x7f);

        } else

            pixel_ptr += 2 * skip;

        CHECK_PIXEL_PTR(0);  /* make sure pixel_ptr is positive */



        if (rle_code < 0) {

            /* decode the run length code */

            rle_code = -rle_code;

            /* get the next 2 bytes from the stream, treat them as groups

             * of 8 pixels, and output them rle_code times */

            CHECK_STREAM_PTR(2);

            pi0 = s->buf[stream_ptr++];

            pi1 = s->buf[stream_ptr++];

            CHECK_PIXEL_PTR(rle_code * 2);



            while (rle_code--) {

                rgb[pixel_ptr++] = pi0;

                rgb[pixel_ptr++] = pi1;

            }

        } else {

            /* copy the same pixel directly to output 2 times */

            rle_code *= 2;

            CHECK_STREAM_PTR(rle_code);

            CHECK_PIXEL_PTR(rle_code);



            while (rle_code--)

                rgb[pixel_ptr++] = s->buf[stream_ptr++];

        }

    }

}

static void qtrle_decode_1bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change)

{

    int rle_code;

    int pixel_ptr = 0;

    int row_inc = s->frame.linesize[0];

    unsigned char pi0, pi1;  

    unsigned char *rgb = s->frame.data[0];

    int pixel_limit = s->frame.linesize[0] * s->avctx->height;

    int skip;



    while (lines_to_change) {

        CHECK_STREAM_PTR(2);

        skip = s->buf[stream_ptr++];

        rle_code = (signed char)s->buf[stream_ptr++];

        if (rle_code == 0)

            break;

        if(skip & 0x80) {

            lines_to_change--;

            row_ptr += row_inc;

            pixel_ptr = row_ptr + 2 * (skip & 0x7f);

        } else

            pixel_ptr += 2 * skip;

        CHECK_PIXEL_PTR(0);  



        if (rle_code < 0) {

            

            rle_code = -rle_code;

            



            CHECK_STREAM_PTR(2);

            pi0 = s->buf[stream_ptr++];

            pi1 = s->buf[stream_ptr++];

            CHECK_PIXEL_PTR(rle_code * 2);



            while (rle_code--) {

                rgb[pixel_ptr++] = pi0;

                rgb[pixel_ptr++] = pi1;

            }

        } else {

            

            rle_code *= 2;

            CHECK_STREAM_PTR(rle_code);

            CHECK_PIXEL_PTR(rle_code);



            while (rle_code--)

                rgb[pixel_ptr++] = s->buf[stream_ptr++];

        }

    }

}

static void qtrle_decode_1bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change)         CHECK_STREAM_PTR(2);         skip = s->buf[stream_ptr++];         rle_code = (signed char)s->buf[stream_ptr++];             CHECK_STREAM_PTR(2);             pi0 = s->buf[stream_ptr++];             pi1 = s->buf[stream_ptr++];             CHECK_STREAM_PTR(rle_code);                 rgb[pixel_ptr++] = s->buf[stream_ptr++];         CHECK_STREAM_PTR(2);         CHECK_STREAM_PTR(2);         CHECK_STREAM_PTR(2);         CHECK_STREAM_PTR(2);         CHECK_STREAM_PTR(2);
static void FUNC_0(QtrleContext *VAR_0, int VAR_1, int VAR_2, int VAR_3)

{

    int VAR_4;

    int VAR_5 = 0;

    int VAR_6 = VAR_0->frame.linesize[0];

    unsigned char VAR_7, VAR_8;  

    unsigned char *VAR_9 = VAR_0->frame.data[0];

    int VAR_10 = VAR_0->frame.linesize[0] * VAR_0->avctx->height;

    int VAR_11;



    while (VAR_3) {

        CHECK_STREAM_PTR(2);

        VAR_11 = VAR_0->buf[VAR_1++];

        VAR_4 = (signed char)VAR_0->buf[VAR_1++];

        if (VAR_4 == 0)

            break;

        if(VAR_11 & 0x80) {

            VAR_3--;

            VAR_2 += VAR_6;

            VAR_5 = VAR_2 + 2 * (VAR_11 & 0x7f);

        } else

            VAR_5 += 2 * VAR_11;

        CHECK_PIXEL_PTR(0);  



        if (VAR_4 < 0) {

            

            VAR_4 = -VAR_4;

            



            CHECK_STREAM_PTR(2);

            VAR_7 = VAR_0->buf[VAR_1++];

            VAR_8 = VAR_0->buf[VAR_1++];

            CHECK_PIXEL_PTR(VAR_4 * 2);



            while (VAR_4--) {

                VAR_9[VAR_5++] = VAR_7;

                VAR_9[VAR_5++] = VAR_8;

            }

        } else {

            

            VAR_4 *= 2;

            CHECK_STREAM_PTR(VAR_4);

            CHECK_PIXEL_PTR(VAR_4);



            while (VAR_4--)

                VAR_9[VAR_5++] = VAR_0->buf[VAR_1++];

        }

    }

}

static void FUNC_0(QtrleContext *VAR_0, int VAR_1, int VAR_2, int VAR_3)
{ int VAR_4; int VAR_5 = 0; int VAR_6 = VAR_0->frame.linesize[0]; unsigned char VAR_7, VAR_8; unsigned char *VAR_9 = VAR_0->frame.data[0]; int VAR_10 = VAR_0->frame.linesize[0] * VAR_0->avctx->height; int VAR_11; while (VAR_3) { CHECK_STREAM_PTR(2); VAR_11 = VAR_0->buf[VAR_1++]; VAR_4 = (signed char)VAR_0->buf[VAR_1++]; if (VAR_4 == 0)
break; if(VAR_11 & 0x80) { VAR_3--; VAR_2 += VAR_6; VAR_5 = VAR_2 + 2 * (VAR_11 & 0x7f); } else VAR_5 += 2 * VAR_11; CHECK_PIXEL_PTR(0); if (VAR_4 < 0) { VAR_4 = -VAR_4; CHECK_STREAM_PTR(2); VAR_7 = VAR_0->buf[VAR_1++]; VAR_8 = VAR_0->buf[VAR_1++]; CHECK_PIXEL_PTR(VAR_4 * 2); while (VAR_4--) { VAR_9[VAR_5++] = VAR_7; VAR_9[VAR_5++] = VAR_8; } } else { VAR_4 *= 2; CHECK_STREAM_PTR(VAR_4); CHECK_PIXEL_PTR(VAR_4); while (VAR_4--)
VAR_9[VAR_5++] = VAR_0->buf[VAR_1++]; } } }