static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s)

{

    int x, y;

    unsigned char P[2];

    unsigned int flags;



    /* 2-color encoding */

    CHECK_STREAM_PTR(2);



    P[0] = *s->stream_ptr++;

    P[1] = *s->stream_ptr++;



    if (P[0] <= P[1]) {



        /* need 8 more bytes from the stream */

        CHECK_STREAM_PTR(8);



        for (y = 0; y < 8; y++) {

            flags = *s->stream_ptr++ | 0x100;

            for (; flags != 1; flags >>= 1)

                *s->pixel_ptr++ = P[flags & 1];

            s->pixel_ptr += s->line_inc;

        }



    } else {



        /* need 2 more bytes from the stream */

        CHECK_STREAM_PTR(2);



        flags = bytestream_get_le16(&s->stream_ptr);

        for (y = 0; y < 8; y += 2) {

            for (x = 0; x < 8; x += 2, flags >>= 1) {

                s->pixel_ptr[x                ] =

                s->pixel_ptr[x + 1            ] =

                s->pixel_ptr[x +     s->stride] =

                s->pixel_ptr[x + 1 + s->stride] = P[flags & 1];

            }

            s->pixel_ptr += s->stride * 2;

        }

    }



    /* report success */

    return 0;

}

static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s)

{

    int x, y;

    unsigned char P[2];

    unsigned int flags;



    

    CHECK_STREAM_PTR(2);



    P[0] = *s->stream_ptr++;

    P[1] = *s->stream_ptr++;



    if (P[0] <= P[1]) {



        

        CHECK_STREAM_PTR(8);



        for (y = 0; y < 8; y++) {

            flags = *s->stream_ptr++ | 0x100;

            for (; flags != 1; flags >>= 1)

                *s->pixel_ptr++ = P[flags & 1];

            s->pixel_ptr += s->line_inc;

        }



    } else {



        

        CHECK_STREAM_PTR(2);



        flags = bytestream_get_le16(&s->stream_ptr);

        for (y = 0; y < 8; y += 2) {

            for (x = 0; x < 8; x += 2, flags >>= 1) {

                s->pixel_ptr[x                ] =

                s->pixel_ptr[x + 1            ] =

                s->pixel_ptr[x +     s->stride] =

                s->pixel_ptr[x + 1 + s->stride] = P[flags & 1];

            }

            s->pixel_ptr += s->stride * 2;

        }

    }



    

    return 0;

}

static int FUNC_0(IpvideoContext *VAR_0)

{

    int VAR_1, VAR_2;

    unsigned char VAR_3[2];

    unsigned int VAR_4;



    

    CHECK_STREAM_PTR(2);



    VAR_3[0] = *VAR_0->stream_ptr++;

    VAR_3[1] = *VAR_0->stream_ptr++;



    if (VAR_3[0] <= VAR_3[1]) {



        

        CHECK_STREAM_PTR(8);



        for (VAR_2 = 0; VAR_2 < 8; VAR_2++) {

            VAR_4 = *VAR_0->stream_ptr++ | 0x100;

            for (; VAR_4 != 1; VAR_4 >>= 1)

                *VAR_0->pixel_ptr++ = VAR_3[VAR_4 & 1];

            VAR_0->pixel_ptr += VAR_0->line_inc;

        }



    } else {



        

        CHECK_STREAM_PTR(2);



        VAR_4 = bytestream_get_le16(&VAR_0->stream_ptr);

        for (VAR_2 = 0; VAR_2 < 8; VAR_2 += 2) {

            for (VAR_1 = 0; VAR_1 < 8; VAR_1 += 2, VAR_4 >>= 1) {

                VAR_0->pixel_ptr[VAR_1                ] =

                VAR_0->pixel_ptr[VAR_1 + 1            ] =

                VAR_0->pixel_ptr[VAR_1 +     VAR_0->stride] =

                VAR_0->pixel_ptr[VAR_1 + 1 + VAR_0->stride] = VAR_3[VAR_4 & 1];

            }

            VAR_0->pixel_ptr += VAR_0->stride * 2;

        }

    }



    

    return 0;

}

static int FUNC_0(IpvideoContext *VAR_0)
{ int VAR_1, VAR_2; unsigned char VAR_3[2]; unsigned int VAR_4; CHECK_STREAM_PTR(2); VAR_3[0] = *VAR_0->stream_ptr++; VAR_3[1] = *VAR_0->stream_ptr++; if (VAR_3[0] <= VAR_3[1]) { CHECK_STREAM_PTR(8); for (VAR_2 = 0; VAR_2 < 8; VAR_2++) { VAR_4 = *VAR_0->stream_ptr++ | 0x100; for (; VAR_4 != 1; VAR_4 >>= 1) *VAR_0->pixel_ptr++ = VAR_3[VAR_4 & 1]; VAR_0->pixel_ptr += VAR_0->line_inc; } } else { CHECK_STREAM_PTR(2); VAR_4 = bytestream_get_le16(&VAR_0->stream_ptr); for (VAR_2 = 0; VAR_2 < 8; VAR_2 += 2) { for (VAR_1 = 0; VAR_1 < 8; VAR_1 += 2, VAR_4 >>= 1) { VAR_0->pixel_ptr[VAR_1                ] =
VAR_0->pixel_ptr[VAR_1 + 1            ] =
VAR_0->pixel_ptr[VAR_1 +     VAR_0->stride] =
VAR_0->pixel_ptr[VAR_1 + 1 + VAR_0->stride] = VAR_3[VAR_4 & 1]; } VAR_0->pixel_ptr += VAR_0->stride * 2; } } return 0; }