static void ipvideo_decode_opcodes(IpvideoContext *s)

{

    int x, y;

    unsigned char opcode;

    int ret;

    static int frame = 0;

    GetBitContext gb;



    debug_interplay("------------------ frame %d\n", frame);

    frame++;



    /* this is PAL8, so make the palette available */

    memcpy(s->current_frame.data[1], s->avctx->palctrl->palette, PALETTE_COUNT * 4);



    s->stride = s->current_frame.linesize[0];

    s->stream_ptr = s->buf + 14;  /* data starts 14 bytes in */

    s->stream_end = s->buf + s->size;

    s->line_inc = s->stride - 8;

    s->upper_motion_limit_offset = (s->avctx->height - 8) * s->stride

        + s->avctx->width - 8;



    init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8);

    for (y = 0; y < (s->stride * s->avctx->height); y += s->stride * 8) {

        for (x = y; x < y + s->avctx->width; x += 8) {

            opcode = get_bits(&gb, 4);



            debug_interplay("  block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",

                            x - y, y / s->stride, opcode, s->stream_ptr);



            s->pixel_ptr = s->current_frame.data[0] + x;

            ret = ipvideo_decode_block[opcode](s);

            if (ret != 0) {

                av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode problem on frame %d, @ block (%d, %d)\n",

                       frame, x - y, y / s->stride);

                return;

            }

        }

    }

    if (s->stream_end - s->stream_ptr > 1) {

        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode finished with %td bytes left over\n",

               s->stream_end - s->stream_ptr);

    }

}

static void ipvideo_decode_opcodes(IpvideoContext *s)

{

    int x, y;

    unsigned char opcode;

    int ret;

    static int frame = 0;

    GetBitContext gb;



    debug_interplay("------------------ frame %d\n", frame);

    frame++;



    

    memcpy(s->current_frame.data[1], s->avctx->palctrl->palette, PALETTE_COUNT * 4);



    s->stride = s->current_frame.linesize[0];

    s->stream_ptr = s->buf + 14;  

    s->stream_end = s->buf + s->size;

    s->line_inc = s->stride - 8;

    s->upper_motion_limit_offset = (s->avctx->height - 8) * s->stride

        + s->avctx->width - 8;



    init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8);

    for (y = 0; y < (s->stride * s->avctx->height); y += s->stride * 8) {

        for (x = y; x < y + s->avctx->width; x += 8) {

            opcode = get_bits(&gb, 4);



            debug_interplay("  block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",

                            x - y, y / s->stride, opcode, s->stream_ptr);



            s->pixel_ptr = s->current_frame.data[0] + x;

            ret = ipvideo_decode_block[opcode](s);

            if (ret != 0) {

                av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode problem on frame %d, @ block (%d, %d)\n",

                       frame, x - y, y / s->stride);

                return;

            }

        }

    }

    if (s->stream_end - s->stream_ptr > 1) {

        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode finished with %td bytes left over\n",

               s->stream_end - s->stream_ptr);

    }

}

static void FUNC_0(IpvideoContext *VAR_0)

{

    int VAR_1, VAR_2;

    unsigned char VAR_3;

    int VAR_4;

    static int VAR_5 = 0;

    GetBitContext gb;



    debug_interplay("------------------ VAR_5 %d\n", VAR_5);

    VAR_5++;



    

    memcpy(VAR_0->current_frame.data[1], VAR_0->avctx->palctrl->palette, PALETTE_COUNT * 4);



    VAR_0->stride = VAR_0->current_frame.linesize[0];

    VAR_0->stream_ptr = VAR_0->buf + 14;  

    VAR_0->stream_end = VAR_0->buf + VAR_0->size;

    VAR_0->line_inc = VAR_0->stride - 8;

    VAR_0->upper_motion_limit_offset = (VAR_0->avctx->height - 8) * VAR_0->stride

        + VAR_0->avctx->width - 8;



    init_get_bits(&gb, VAR_0->decoding_map, VAR_0->decoding_map_size * 8);

    for (VAR_2 = 0; VAR_2 < (VAR_0->stride * VAR_0->avctx->height); VAR_2 += VAR_0->stride * 8) {

        for (VAR_1 = VAR_2; VAR_1 < VAR_2 + VAR_0->avctx->width; VAR_1 += 8) {

            VAR_3 = get_bits(&gb, 4);



            debug_interplay("  block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",

                            VAR_1 - VAR_2, VAR_2 / VAR_0->stride, VAR_3, VAR_0->stream_ptr);



            VAR_0->pixel_ptr = VAR_0->current_frame.data[0] + VAR_1;

            VAR_4 = ipvideo_decode_block[VAR_3](VAR_0);

            if (VAR_4 != 0) {

                av_log(VAR_0->avctx, AV_LOG_ERROR, " Interplay video: decode problem on VAR_5 %d, @ block (%d, %d)\n",

                       VAR_5, VAR_1 - VAR_2, VAR_2 / VAR_0->stride);

                return;

            }

        }

    }

    if (VAR_0->stream_end - VAR_0->stream_ptr > 1) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, " Interplay video: decode finished with %td bytes left over\n",

               VAR_0->stream_end - VAR_0->stream_ptr);

    }

}

static void FUNC_0(IpvideoContext *VAR_0)
{ int VAR_1, VAR_2; unsigned char VAR_3; int VAR_4; static int VAR_5 = 0; GetBitContext gb; debug_interplay("------------------ VAR_5 %d\n", VAR_5); VAR_5++; memcpy(VAR_0->current_frame.data[1], VAR_0->avctx->palctrl->palette, PALETTE_COUNT * 4); VAR_0->stride = VAR_0->current_frame.linesize[0]; VAR_0->stream_ptr = VAR_0->buf + 14; VAR_0->stream_end = VAR_0->buf + VAR_0->size; VAR_0->line_inc = VAR_0->stride - 8; VAR_0->upper_motion_limit_offset = (VAR_0->avctx->height - 8) * VAR_0->stride
+ VAR_0->avctx->width - 8; init_get_bits(&gb, VAR_0->decoding_map, VAR_0->decoding_map_size * 8); for (VAR_2 = 0; VAR_2 < (VAR_0->stride * VAR_0->avctx->height); VAR_2 += VAR_0->stride * 8) { for (VAR_1 = VAR_2; VAR_1 < VAR_2 + VAR_0->avctx->width; VAR_1 += 8) { VAR_3 = get_bits(&gb, 4); debug_interplay("  block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",
VAR_1 - VAR_2, VAR_2 / VAR_0->stride, VAR_3, VAR_0->stream_ptr); VAR_0->pixel_ptr = VAR_0->current_frame.data[0] + VAR_1; VAR_4 = ipvideo_decode_block[VAR_3](VAR_0); if (VAR_4 != 0) { av_log(VAR_0->avctx, AV_LOG_ERROR, " Interplay video: decode problem on VAR_5 %d, @ block (%d, %d)\n",
VAR_5, VAR_1 - VAR_2, VAR_2 / VAR_0->stride); return; } } } if (VAR_0->stream_end - VAR_0->stream_ptr > 1) { av_log(VAR_0->avctx, AV_LOG_ERROR, " Interplay video: decode finished with %td bytes left over\n",
VAR_0->stream_end - VAR_0->stream_ptr); } }