static int bitpacked_decode_yuv422p10(AVCodecContext *avctx, AVFrame *frame,

                                      AVPacket *avpkt)

{

    uint64_t frame_size = (uint64_t)avctx->width * (uint64_t)avctx->height * 20;

    uint64_t packet_size = avpkt->size * 8;

    GetBitContext bc;

    uint16_t *y, *u, *v;

    int ret, i;



    ret = ff_get_buffer(avctx, frame, 0);

    if (ret < 0)

        return ret;



    y = (uint16_t*)frame->data[0];

    u = (uint16_t*)frame->data[1];

    v = (uint16_t*)frame->data[2];



    if (frame_size > packet_size)

        return AVERROR_INVALIDDATA;



    if (avctx->width % 2)

        return AVERROR_PATCHWELCOME;



    ret = init_get_bits(&bc, avpkt->data, avctx->width * avctx->height * 20);

    if (ret)

        return ret;



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

        y = (uint16_t*)(frame->data[0] + i * frame->linesize[0]);

        u = (uint16_t*)(frame->data[1] + i * frame->linesize[1]);

        v = (uint16_t*)(frame->data[2] + i * frame->linesize[2]);



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

            *u++ = get_bits(&bc, 10);

            *y++ = get_bits(&bc, 10);

            *v++ = get_bits(&bc, 10);

            *y++ = get_bits(&bc, 10);

        }

    }



    return 0;

}

static int bitpacked_decode_yuv422p10(AVCodecContext *avctx, AVFrame *frame,

                                      AVPacket *avpkt)

{

    uint64_t frame_size = (uint64_t)avctx->width * (uint64_t)avctx->height * 20;

    uint64_t packet_size = avpkt->size * 8;

    GetBitContext bc;

    uint16_t *y, *u, *v;

    int ret, i;



    ret = ff_get_buffer(avctx, frame, 0);

    if (ret < 0)

        return ret;



    y = (uint16_t*)frame->data[0];

    u = (uint16_t*)frame->data[1];

    v = (uint16_t*)frame->data[2];



    if (frame_size > packet_size)

        return AVERROR_INVALIDDATA;



    if (avctx->width % 2)

        return AVERROR_PATCHWELCOME;



    ret = init_get_bits(&bc, avpkt->data, avctx->width * avctx->height * 20);

    if (ret)

        return ret;



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

        y = (uint16_t*)(frame->data[0] + i * frame->linesize[0]);

        u = (uint16_t*)(frame->data[1] + i * frame->linesize[1]);

        v = (uint16_t*)(frame->data[2] + i * frame->linesize[2]);



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

            *u++ = get_bits(&bc, 10);

            *y++ = get_bits(&bc, 10);

            *v++ = get_bits(&bc, 10);

            *y++ = get_bits(&bc, 10);

        }

    }



    return 0;

}

    uint64_t packet_size = avpkt->size * 8;
static int FUNC_0(AVCodecContext *VAR_0, AVFrame *VAR_1,

                                      AVPacket *VAR_2)

{

    uint64_t frame_size = (uint64_t)VAR_0->width * (uint64_t)VAR_0->height * 20;

    uint64_t packet_size = VAR_2->size * 8;

    GetBitContext bc;

    uint16_t *y, *u, *v;

    int VAR_3, VAR_4;



    VAR_3 = ff_get_buffer(VAR_0, VAR_1, 0);

    if (VAR_3 < 0)

        return VAR_3;



    y = (uint16_t*)VAR_1->data[0];

    u = (uint16_t*)VAR_1->data[1];

    v = (uint16_t*)VAR_1->data[2];



    if (frame_size > packet_size)

        return AVERROR_INVALIDDATA;



    if (VAR_0->width % 2)

        return AVERROR_PATCHWELCOME;



    VAR_3 = init_get_bits(&bc, VAR_2->data, VAR_0->width * VAR_0->height * 20);

    if (VAR_3)

        return VAR_3;



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

        y = (uint16_t*)(VAR_1->data[0] + VAR_4 * VAR_1->linesize[0]);

        u = (uint16_t*)(VAR_1->data[1] + VAR_4 * VAR_1->linesize[1]);

        v = (uint16_t*)(VAR_1->data[2] + VAR_4 * VAR_1->linesize[2]);



        for (int j = 0; j < VAR_0->width; j += 2) {

            *u++ = get_bits(&bc, 10);

            *y++ = get_bits(&bc, 10);

            *v++ = get_bits(&bc, 10);

            *y++ = get_bits(&bc, 10);

        }

    }



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, AVFrame *VAR_1,
AVPacket *VAR_2)
{ uint64_t frame_size = (uint64_t)VAR_0->width * (uint64_t)VAR_0->height * 20; uint64_t packet_size = VAR_2->size * 8; GetBitContext bc; uint16_t *y, *u, *v; int VAR_3, VAR_4; VAR_3 = ff_get_buffer(VAR_0, VAR_1, 0); if (VAR_3 < 0)
return VAR_3; y = (uint16_t*)VAR_1->data[0]; u = (uint16_t*)VAR_1->data[1]; v = (uint16_t*)VAR_1->data[2]; if (frame_size > packet_size)
return AVERROR_INVALIDDATA; if (VAR_0->width % 2)
return AVERROR_PATCHWELCOME; VAR_3 = init_get_bits(&bc, VAR_2->data, VAR_0->width * VAR_0->height * 20); if (VAR_3)
return VAR_3; for (VAR_4 = 0; VAR_4 < VAR_0->height; VAR_4++) { y = (uint16_t*)(VAR_1->data[0] + VAR_4 * VAR_1->linesize[0]); u = (uint16_t*)(VAR_1->data[1] + VAR_4 * VAR_1->linesize[1]); v = (uint16_t*)(VAR_1->data[2] + VAR_4 * VAR_1->linesize[2]); for (int j = 0; j < VAR_0->width; j += 2) { *u++ = get_bits(&bc, 10); *y++ = get_bits(&bc, 10); *v++ = get_bits(&bc, 10); *y++ = get_bits(&bc, 10); } } return 0; }