static void ipvideo_decode_opcodes(IpvideoContext *s, AVFrame *frame)

{

    int x, y;

    unsigned char opcode;

    int ret;

    GetBitContext gb;



    bytestream2_skip(&s->stream_ptr, 14); /* data starts 14 bytes in */

    if (!s->is_16bpp) {

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

        memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);



        s->stride = frame->linesize[0];

    } else {

        s->stride = frame->linesize[0] >> 1;

        s->mv_ptr = s->stream_ptr;

        bytestream2_skip(&s->mv_ptr, bytestream2_get_le16(&s->stream_ptr));

    }

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

    s->upper_motion_limit_offset = (s->avctx->height - 8) * frame->linesize[0]

                                  + (s->avctx->width - 8) * (1 + s->is_16bpp);



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

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

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



            opcode = get_bits(&gb, 4);



            ff_tlog(s->avctx,

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

                    x, y, opcode, bytestream2_tell(&s->stream_ptr));



            if (!s->is_16bpp) {

                s->pixel_ptr = frame->data[0] + x

                              + y*frame->linesize[0];

                ret = ipvideo_decode_block[opcode](s, frame);

            } else {

                s->pixel_ptr = frame->data[0] + x*2

                              + y*frame->linesize[0];

                ret = ipvideo_decode_block16[opcode](s, frame);

            }

            if (ret != 0) {

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

                       s->avctx->frame_number, x, y);


            }

        }

    }

    if (bytestream2_get_bytes_left(&s->stream_ptr) > 1) {

        av_log(s->avctx, AV_LOG_DEBUG,

               "decode finished with %d bytes left over\n",

               bytestream2_get_bytes_left(&s->stream_ptr));

    }

}
static void ipvideo_decode_opcodes(IpvideoContext *s, AVFrame *frame)

{

    int x, y;

    unsigned char opcode;

    int ret;

    GetBitContext gb;



    bytestream2_skip(&s->stream_ptr, 14); 

    if (!s->is_16bpp) {

        

        memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);



        s->stride = frame->linesize[0];

    } else {

        s->stride = frame->linesize[0] >> 1;

        s->mv_ptr = s->stream_ptr;

        bytestream2_skip(&s->mv_ptr, bytestream2_get_le16(&s->stream_ptr));

    }

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

    s->upper_motion_limit_offset = (s->avctx->height - 8) * frame->linesize[0]

                                  + (s->avctx->width - 8) * (1 + s->is_16bpp);



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

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

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



            opcode = get_bits(&gb, 4);



            ff_tlog(s->avctx,

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

                    x, y, opcode, bytestream2_tell(&s->stream_ptr));



            if (!s->is_16bpp) {

                s->pixel_ptr = frame->data[0] + x

                              + y*frame->linesize[0];

                ret = ipvideo_decode_block[opcode](s, frame);

            } else {

                s->pixel_ptr = frame->data[0] + x*2

                              + y*frame->linesize[0];

                ret = ipvideo_decode_block16[opcode](s, frame);

            }

            if (ret != 0) {

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

                       s->avctx->frame_number, x, y);


            }

        }

    }

    if (bytestream2_get_bytes_left(&s->stream_ptr) > 1) {

        av_log(s->avctx, AV_LOG_DEBUG,

               "decode finished with %d bytes left over\n",

               bytestream2_get_bytes_left(&s->stream_ptr));

    }

}
static void FUNC_0(IpvideoContext *VAR_0, AVFrame *VAR_1)

{

    int VAR_2, VAR_3;

    unsigned char VAR_4;

    int VAR_5;

    GetBitContext gb;



    bytestream2_skip(&VAR_0->stream_ptr, 14); 

    if (!VAR_0->is_16bpp) {

        

        memcpy(VAR_1->data[1], VAR_0->pal, AVPALETTE_SIZE);



        VAR_0->stride = VAR_1->linesize[0];

    } else {

        VAR_0->stride = VAR_1->linesize[0] >> 1;

        VAR_0->mv_ptr = VAR_0->stream_ptr;

        bytestream2_skip(&VAR_0->mv_ptr, bytestream2_get_le16(&VAR_0->stream_ptr));

    }

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

    VAR_0->upper_motion_limit_offset = (VAR_0->avctx->height - 8) * VAR_1->linesize[0]

                                  + (VAR_0->avctx->width - 8) * (1 + VAR_0->is_16bpp);



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

    for (VAR_3 = 0; VAR_3 < VAR_0->avctx->height; VAR_3 += 8) {

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



            VAR_4 = get_bits(&gb, 4);



            ff_tlog(VAR_0->avctx,

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

                    VAR_2, VAR_3, VAR_4, bytestream2_tell(&VAR_0->stream_ptr));



            if (!VAR_0->is_16bpp) {

                VAR_0->pixel_ptr = VAR_1->data[0] + VAR_2

                              + VAR_3*VAR_1->linesize[0];

                VAR_5 = ipvideo_decode_block[VAR_4](VAR_0, VAR_1);

            } else {

                VAR_0->pixel_ptr = VAR_1->data[0] + VAR_2*2

                              + VAR_3*VAR_1->linesize[0];

                VAR_5 = ipvideo_decode_block16[VAR_4](VAR_0, VAR_1);

            }

            if (VAR_5 != 0) {

                av_log(VAR_0->avctx, AV_LOG_ERROR, "decode problem on VAR_1 %d, @ block (%d, %d)\n",

                       VAR_0->avctx->frame_number, VAR_2, VAR_3);


            }

        }

    }

    if (bytestream2_get_bytes_left(&VAR_0->stream_ptr) > 1) {

        av_log(VAR_0->avctx, AV_LOG_DEBUG,

               "decode finished with %d bytes left over\n",

               bytestream2_get_bytes_left(&VAR_0->stream_ptr));

    }

}
static void FUNC_0(IpvideoContext *VAR_0, AVFrame *VAR_1)
{ int VAR_2, VAR_3; unsigned char VAR_4; int VAR_5; GetBitContext gb; bytestream2_skip(&VAR_0->stream_ptr, 14); if (!VAR_0->is_16bpp) { memcpy(VAR_1->data[1], VAR_0->pal, AVPALETTE_SIZE); VAR_0->stride = VAR_1->linesize[0]; } else { VAR_0->stride = VAR_1->linesize[0] >> 1; VAR_0->mv_ptr = VAR_0->stream_ptr; bytestream2_skip(&VAR_0->mv_ptr, bytestream2_get_le16(&VAR_0->stream_ptr)); } VAR_0->line_inc = VAR_0->stride - 8; VAR_0->upper_motion_limit_offset = (VAR_0->avctx->height - 8) * VAR_1->linesize[0]
+ (VAR_0->avctx->width - 8) * (1 + VAR_0->is_16bpp); init_get_bits(&gb, VAR_0->decoding_map, VAR_0->decoding_map_size * 8); for (VAR_3 = 0; VAR_3 < VAR_0->avctx->height; VAR_3 += 8) { for (VAR_2 = 0; VAR_2 < VAR_0->avctx->width; VAR_2 += 8) { VAR_4 = get_bits(&gb, 4); ff_tlog(VAR_0->avctx,
"  block @ (%3d, %3d): encoding 0x%X, data ptr offset %d\n",
VAR_2, VAR_3, VAR_4, bytestream2_tell(&VAR_0->stream_ptr)); if (!VAR_0->is_16bpp) { VAR_0->pixel_ptr = VAR_1->data[0] + VAR_2
+ VAR_3*VAR_1->linesize[0]; VAR_5 = ipvideo_decode_block[VAR_4](VAR_0, VAR_1); } else { VAR_0->pixel_ptr = VAR_1->data[0] + VAR_2*2
+ VAR_3*VAR_1->linesize[0]; VAR_5 = ipvideo_decode_block16[VAR_4](VAR_0, VAR_1); } if (VAR_5 != 0) { av_log(VAR_0->avctx, AV_LOG_ERROR, "decode problem on VAR_1 %d, @ block (%d, %d)\n",
VAR_0->avctx->frame_number, VAR_2, VAR_3); } } } if (bytestream2_get_bytes_left(&VAR_0->stream_ptr) > 1) { av_log(VAR_0->avctx, AV_LOG_DEBUG,
"decode finished with %d bytes left over\n",
bytestream2_get_bytes_left(&VAR_0->stream_ptr)); } }