static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,

                                const uint8_t *src, int src_size)

{

    int h, w;

    uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;

    int ret;



    if (src_size < avctx->width * avctx->height * 9LL / 8) {

        av_log(avctx, AV_LOG_ERROR, "packet too small\n");

        return AVERROR_INVALIDDATA;

    }



    avctx->pix_fmt = AV_PIX_FMT_YUV410P;

    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)

        return ret;



    Y1 = pic->data[0];

    Y2 = pic->data[0] + pic->linesize[0];

    Y3 = pic->data[0] + pic->linesize[0] * 2;

    Y4 = pic->data[0] + pic->linesize[0] * 3;

    U  = pic->data[1];

    V  = pic->data[2];

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

        for (w = 0; w < avctx->width; w += 4) {

            AV_COPY32U(Y1 + w, src);

            AV_COPY32U(Y2 + w, src + 4);

            AV_COPY32U(Y3 + w, src + 8);

            AV_COPY32U(Y4 + w, src + 12);

            U[w >> 2] = src[16] + 0x80;

            V[w >> 2] = src[17] + 0x80;

            src += 18;

        }

        Y1 += pic->linesize[0] << 2;

        Y2 += pic->linesize[0] << 2;

        Y3 += pic->linesize[0] << 2;

        Y4 += pic->linesize[0] << 2;

        U  += pic->linesize[1];

        V  += pic->linesize[2];

    }



    return 0;

}

static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,

                                const uint8_t *src, int src_size)

{

    int h, w;

    uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;

    int ret;



    if (src_size < avctx->width * avctx->height * 9LL / 8) {

        av_log(avctx, AV_LOG_ERROR, "packet too small\n");

        return AVERROR_INVALIDDATA;

    }



    avctx->pix_fmt = AV_PIX_FMT_YUV410P;

    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)

        return ret;



    Y1 = pic->data[0];

    Y2 = pic->data[0] + pic->linesize[0];

    Y3 = pic->data[0] + pic->linesize[0] * 2;

    Y4 = pic->data[0] + pic->linesize[0] * 3;

    U  = pic->data[1];

    V  = pic->data[2];

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

        for (w = 0; w < avctx->width; w += 4) {

            AV_COPY32U(Y1 + w, src);

            AV_COPY32U(Y2 + w, src + 4);

            AV_COPY32U(Y3 + w, src + 8);

            AV_COPY32U(Y4 + w, src + 12);

            U[w >> 2] = src[16] + 0x80;

            V[w >> 2] = src[17] + 0x80;

            src += 18;

        }

        Y1 += pic->linesize[0] << 2;

        Y2 += pic->linesize[0] << 2;

        Y3 += pic->linesize[0] << 2;

        Y4 += pic->linesize[0] << 2;

        U  += pic->linesize[1];

        V  += pic->linesize[2];

    }



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, AVFrame *VAR_1,

                                const uint8_t *VAR_2, int VAR_3)

{

    int VAR_4, VAR_5;

    uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;

    int VAR_6;



    if (VAR_3 < VAR_0->width * VAR_0->height * 9LL / 8) {

        av_log(VAR_0, AV_LOG_ERROR, "packet too small\n");

        return AVERROR_INVALIDDATA;

    }



    VAR_0->pix_fmt = AV_PIX_FMT_YUV410P;

    if ((VAR_6 = ff_get_buffer(VAR_0, VAR_1, 0)) < 0)

        return VAR_6;



    Y1 = VAR_1->data[0];

    Y2 = VAR_1->data[0] + VAR_1->linesize[0];

    Y3 = VAR_1->data[0] + VAR_1->linesize[0] * 2;

    Y4 = VAR_1->data[0] + VAR_1->linesize[0] * 3;

    U  = VAR_1->data[1];

    V  = VAR_1->data[2];

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

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

            AV_COPY32U(Y1 + VAR_5, VAR_2);

            AV_COPY32U(Y2 + VAR_5, VAR_2 + 4);

            AV_COPY32U(Y3 + VAR_5, VAR_2 + 8);

            AV_COPY32U(Y4 + VAR_5, VAR_2 + 12);

            U[VAR_5 >> 2] = VAR_2[16] + 0x80;

            V[VAR_5 >> 2] = VAR_2[17] + 0x80;

            VAR_2 += 18;

        }

        Y1 += VAR_1->linesize[0] << 2;

        Y2 += VAR_1->linesize[0] << 2;

        Y3 += VAR_1->linesize[0] << 2;

        Y4 += VAR_1->linesize[0] << 2;

        U  += VAR_1->linesize[1];

        V  += VAR_1->linesize[2];

    }



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, AVFrame *VAR_1,
const uint8_t *VAR_2, int VAR_3)
{ int VAR_4, VAR_5; uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V; int VAR_6; if (VAR_3 < VAR_0->width * VAR_0->height * 9LL / 8) { av_log(VAR_0, AV_LOG_ERROR, "packet too small\n"); return AVERROR_INVALIDDATA; } VAR_0->pix_fmt = AV_PIX_FMT_YUV410P; if ((VAR_6 = ff_get_buffer(VAR_0, VAR_1, 0)) < 0)
return VAR_6; Y1 = VAR_1->data[0]; Y2 = VAR_1->data[0] + VAR_1->linesize[0]; Y3 = VAR_1->data[0] + VAR_1->linesize[0] * 2; Y4 = VAR_1->data[0] + VAR_1->linesize[0] * 3; U  = VAR_1->data[1]; V  = VAR_1->data[2]; for (VAR_4 = 0; VAR_4 < VAR_0->height; VAR_4 += 4) { for (VAR_5 = 0; VAR_5 < VAR_0->width; VAR_5 += 4) { AV_COPY32U(Y1 + VAR_5, VAR_2); AV_COPY32U(Y2 + VAR_5, VAR_2 + 4); AV_COPY32U(Y3 + VAR_5, VAR_2 + 8); AV_COPY32U(Y4 + VAR_5, VAR_2 + 12); U[VAR_5 >> 2] = VAR_2[16] + 0x80; V[VAR_5 >> 2] = VAR_2[17] + 0x80; VAR_2 += 18; } Y1 += VAR_1->linesize[0] << 2; Y2 += VAR_1->linesize[0] << 2; Y3 += VAR_1->linesize[0] << 2; Y4 += VAR_1->linesize[0] << 2; U  += VAR_1->linesize[1]; V  += VAR_1->linesize[2]; } return 0; }