static int xan_decode_frame_type1(AVCodecContext *avctx, AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    XanContext *s = avctx->priv_data;

    uint8_t *ybuf, *src = s->scratch_buffer;

    int cur, last;

    int i, j;

    int ret;



    if ((ret = xan_decode_chroma(avctx, avpkt)) != 0)

        return ret;



    ret = xan_unpack_luma(buf + 16, avpkt->size - 16, src,

                          s->buffer_size >> 1);

    if (ret) {

        av_log(avctx, AV_LOG_ERROR, "Luma decoding failed\n");

        return ret;

    }



    ybuf = s->y_buffer;

    for (i = 0; i < avctx->height; i++) {

        last = (ybuf[0] + (*src++ << 1)) & 0x3F;

        ybuf[0] = last;

        for (j = 1; j < avctx->width - 1; j += 2) {

            cur = (ybuf[j + 1] + (*src++ << 1)) & 0x3F;

            ybuf[j]   = (last + cur) >> 1;

            ybuf[j+1] = cur;

            last = cur;

        }

        ybuf[j] = last;

        ybuf += avctx->width;

    }



    src = s->y_buffer;

    ybuf = s->pic.data[0];

    for (j = 0; j < avctx->height; j++) {

        for (i = 0; i < avctx->width; i++)

            ybuf[i] = (src[i] << 2) | (src[i] >> 3);

        src  += avctx->width;

        ybuf += s->pic.linesize[0];

    }



    return 0;

}

static int xan_decode_frame_type1(AVCodecContext *avctx, AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    XanContext *s = avctx->priv_data;

    uint8_t *ybuf, *src = s->scratch_buffer;

    int cur, last;

    int i, j;

    int ret;



    if ((ret = xan_decode_chroma(avctx, avpkt)) != 0)

        return ret;



    ret = xan_unpack_luma(buf + 16, avpkt->size - 16, src,

                          s->buffer_size >> 1);

    if (ret) {

        av_log(avctx, AV_LOG_ERROR, "Luma decoding failed\n");

        return ret;

    }



    ybuf = s->y_buffer;

    for (i = 0; i < avctx->height; i++) {

        last = (ybuf[0] + (*src++ << 1)) & 0x3F;

        ybuf[0] = last;

        for (j = 1; j < avctx->width - 1; j += 2) {

            cur = (ybuf[j + 1] + (*src++ << 1)) & 0x3F;

            ybuf[j]   = (last + cur) >> 1;

            ybuf[j+1] = cur;

            last = cur;

        }

        ybuf[j] = last;

        ybuf += avctx->width;

    }



    src = s->y_buffer;

    ybuf = s->pic.data[0];

    for (j = 0; j < avctx->height; j++) {

        for (i = 0; i < avctx->width; i++)

            ybuf[i] = (src[i] << 2) | (src[i] >> 3);

        src  += avctx->width;

        ybuf += s->pic.linesize[0];

    }



    return 0;

}

    const uint8_t *buf = avpkt->data;     const uint8_t *buf = avpkt->data;     if ((ret = xan_decode_chroma(avctx, avpkt)) != 0) static int xan_decode_frame_type1(AVCodecContext *avctx, AVPacket *avpkt)     const uint8_t *buf = avpkt->data;     if ((ret = xan_decode_chroma(avctx, avpkt)) != 0)     ret = xan_unpack_luma(buf + 16, avpkt->size - 16, src,
static int FUNC_0(AVCodecContext *VAR_0, AVPacket *VAR_1)

{

    const uint8_t *VAR_2 = VAR_1->data;

    XanContext *s = VAR_0->priv_data;

    uint8_t *ybuf, *src = s->scratch_buffer;

    int VAR_3, VAR_4;

    int VAR_5, VAR_6;

    int VAR_7;



    if ((VAR_7 = xan_decode_chroma(VAR_0, VAR_1)) != 0)

        return VAR_7;



    VAR_7 = xan_unpack_luma(VAR_2 + 16, VAR_1->size - 16, src,

                          s->buffer_size >> 1);

    if (VAR_7) {

        av_log(VAR_0, AV_LOG_ERROR, "Luma decoding failed\n");

        return VAR_7;

    }



    ybuf = s->y_buffer;

    for (VAR_5 = 0; VAR_5 < VAR_0->height; VAR_5++) {

        VAR_4 = (ybuf[0] + (*src++ << 1)) & 0x3F;

        ybuf[0] = VAR_4;

        for (VAR_6 = 1; VAR_6 < VAR_0->width - 1; VAR_6 += 2) {

            VAR_3 = (ybuf[VAR_6 + 1] + (*src++ << 1)) & 0x3F;

            ybuf[VAR_6]   = (VAR_4 + VAR_3) >> 1;

            ybuf[VAR_6+1] = VAR_3;

            VAR_4 = VAR_3;

        }

        ybuf[VAR_6] = VAR_4;

        ybuf += VAR_0->width;

    }



    src = s->y_buffer;

    ybuf = s->pic.data[0];

    for (VAR_6 = 0; VAR_6 < VAR_0->height; VAR_6++) {

        for (VAR_5 = 0; VAR_5 < VAR_0->width; VAR_5++)

            ybuf[VAR_5] = (src[VAR_5] << 2) | (src[VAR_5] >> 3);

        src  += VAR_0->width;

        ybuf += s->pic.linesize[0];

    }



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, AVPacket *VAR_1)
{ const uint8_t *VAR_2 = VAR_1->data; XanContext *s = VAR_0->priv_data; uint8_t *ybuf, *src = s->scratch_buffer; int VAR_3, VAR_4; int VAR_5, VAR_6; int VAR_7; if ((VAR_7 = xan_decode_chroma(VAR_0, VAR_1)) != 0)
return VAR_7; VAR_7 = xan_unpack_luma(VAR_2 + 16, VAR_1->size - 16, src,
s->buffer_size >> 1); if (VAR_7) { av_log(VAR_0, AV_LOG_ERROR, "Luma decoding failed\n"); return VAR_7; } ybuf = s->y_buffer; for (VAR_5 = 0; VAR_5 < VAR_0->height; VAR_5++) { VAR_4 = (ybuf[0] + (*src++ << 1)) & 0x3F; ybuf[0] = VAR_4; for (VAR_6 = 1; VAR_6 < VAR_0->width - 1; VAR_6 += 2) { VAR_3 = (ybuf[VAR_6 + 1] + (*src++ << 1)) & 0x3F; ybuf[VAR_6]   = (VAR_4 + VAR_3) >> 1; ybuf[VAR_6+1] = VAR_3; VAR_4 = VAR_3; } ybuf[VAR_6] = VAR_4; ybuf += VAR_0->width; } src = s->y_buffer; ybuf = s->pic.data[0]; for (VAR_6 = 0; VAR_6 < VAR_0->height; VAR_6++) { for (VAR_5 = 0; VAR_5 < VAR_0->width; VAR_5++) ybuf[VAR_5] = (src[VAR_5] << 2) | (src[VAR_5] >> 3); src  += VAR_0->width; ybuf += s->pic.linesize[0]; } return 0; }