static int aasc_decode_frame(AVCodecContext *avctx,

                              void *data, int *got_frame,

                              AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size       = avpkt->size;

    AascContext *s     = avctx->priv_data;

    int compr, i, stride, ret;



    if (buf_size < 4)




    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {

        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");

        return ret;

    }



    compr     = AV_RL32(buf);

    buf      += 4;

    buf_size -= 4;

    switch (compr) {

    case 0:

        stride = (avctx->width * 3 + 3) & ~3;



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

            memcpy(s->frame->data[0] + i * s->frame->linesize[0], buf, avctx->width * 3);

            buf += stride;

        }

        break;

    case 1:

        bytestream2_init(&s->gb, buf, buf_size);

        ff_msrle_decode(avctx, (AVPicture*)s->frame, 8, &s->gb);

        break;

    default:

        av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr);


    }



    *got_frame = 1;

    if ((ret = av_frame_ref(data, s->frame)) < 0)

        return ret;



    /* report that the buffer was completely consumed */

    return buf_size;

}
static int aasc_decode_frame(AVCodecContext *avctx,

                              void *data, int *got_frame,

                              AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size       = avpkt->size;

    AascContext *s     = avctx->priv_data;

    int compr, i, stride, ret;



    if (buf_size < 4)




    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {

        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");

        return ret;

    }



    compr     = AV_RL32(buf);

    buf      += 4;

    buf_size -= 4;

    switch (compr) {

    case 0:

        stride = (avctx->width * 3 + 3) & ~3;



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

            memcpy(s->frame->data[0] + i * s->frame->linesize[0], buf, avctx->width * 3);

            buf += stride;

        }

        break;

    case 1:

        bytestream2_init(&s->gb, buf, buf_size);

        ff_msrle_decode(avctx, (AVPicture*)s->frame, 8, &s->gb);

        break;

    default:

        av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr);


    }



    *got_frame = 1;

    if ((ret = av_frame_ref(data, s->frame)) < 0)

        return ret;



    

    return buf_size;

}
static int FUNC_0(AVCodecContext *VAR_0,

                              void *VAR_1, int *VAR_2,

                              AVPacket *VAR_3)

{

    const uint8_t *VAR_4 = VAR_3->VAR_1;

    int VAR_5       = VAR_3->size;

    AascContext *s     = VAR_0->priv_data;

    int VAR_6, VAR_7, VAR_8, VAR_9;



    if (VAR_5 < 4)




    if ((VAR_9 = ff_reget_buffer(VAR_0, s->frame)) < 0) {

        av_log(VAR_0, AV_LOG_ERROR, "reget_buffer() failed\n");

        return VAR_9;

    }



    VAR_6     = AV_RL32(VAR_4);

    VAR_4      += 4;

    VAR_5 -= 4;

    switch (VAR_6) {

    case 0:

        VAR_8 = (VAR_0->width * 3 + 3) & ~3;



        for (VAR_7 = VAR_0->height - 1; VAR_7 >= 0; VAR_7--) {

            memcpy(s->frame->VAR_1[0] + VAR_7 * s->frame->linesize[0], VAR_4, VAR_0->width * 3);

            VAR_4 += VAR_8;

        }

        break;

    case 1:

        bytestream2_init(&s->gb, VAR_4, VAR_5);

        ff_msrle_decode(VAR_0, (AVPicture*)s->frame, 8, &s->gb);

        break;

    default:

        av_log(VAR_0, AV_LOG_ERROR, "Unknown compression type %d\n", VAR_6);


    }



    *VAR_2 = 1;

    if ((VAR_9 = av_frame_ref(VAR_1, s->frame)) < 0)

        return VAR_9;



    

    return VAR_5;

}
static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2,
AVPacket *VAR_3)
{ const uint8_t *VAR_4 = VAR_3->VAR_1; int VAR_5       = VAR_3->size; AascContext *s     = VAR_0->priv_data; int VAR_6, VAR_7, VAR_8, VAR_9; if (VAR_5 < 4)
if ((VAR_9 = ff_reget_buffer(VAR_0, s->frame)) < 0) { av_log(VAR_0, AV_LOG_ERROR, "reget_buffer() failed\n"); return VAR_9; } VAR_6     = AV_RL32(VAR_4); VAR_4      += 4; VAR_5 -= 4; switch (VAR_6) { case 0:
VAR_8 = (VAR_0->width * 3 + 3) & ~3; for (VAR_7 = VAR_0->height - 1; VAR_7 >= 0; VAR_7--) { memcpy(s->frame->VAR_1[0] + VAR_7 * s->frame->linesize[0], VAR_4, VAR_0->width * 3); VAR_4 += VAR_8; } break; case 1:
bytestream2_init(&s->gb, VAR_4, VAR_5); ff_msrle_decode(VAR_0, (AVPicture*)s->frame, 8, &s->gb); break; default:
av_log(VAR_0, AV_LOG_ERROR, "Unknown compression type %d\n", VAR_6); } *VAR_2 = 1; if ((VAR_9 = av_frame_ref(VAR_1, s->frame)) < 0)
return VAR_9; return VAR_5; }