static int decode_byterun(uint8_t *dst, int dst_size,

                          const uint8_t *buf, const uint8_t *const buf_end)

{

    const uint8_t *const buf_start = buf;

    unsigned x;

    for (x = 0; x < dst_size && buf < buf_end;) {

        unsigned length;

        const int8_t value = *buf++;

        if (value >= 0) {

            length = value + 1;

            memcpy(dst + x, buf, FFMIN3(length, dst_size - x, buf_end - buf));

            buf += length;

        } else if (value > -128) {

            length = -value + 1;

            memset(dst + x, *buf++, FFMIN(length, dst_size - x));

        } else { // noop

            continue;

        }

        x += length;

    }

    if (x < dst_size) {

        av_log(NULL, AV_LOG_WARNING, "decode_byterun ended before plane size\n");

        memset(dst+x, 0, dst_size - x);

    }

    return buf - buf_start;

}

static int decode_byterun(uint8_t *dst, int dst_size,

                          const uint8_t *buf, const uint8_t *const buf_end)

{

    const uint8_t *const buf_start = buf;

    unsigned x;

    for (x = 0; x < dst_size && buf < buf_end;) {

        unsigned length;

        const int8_t value = *buf++;

        if (value >= 0) {

            length = value + 1;

            memcpy(dst + x, buf, FFMIN3(length, dst_size - x, buf_end - buf));

            buf += length;

        } else if (value > -128) {

            length = -value + 1;

            memset(dst + x, *buf++, FFMIN(length, dst_size - x));

        } else { 

            continue;

        }

        x += length;

    }

    if (x < dst_size) {

        av_log(NULL, AV_LOG_WARNING, "decode_byterun ended before plane size\n");

        memset(dst+x, 0, dst_size - x);

    }

    return buf - buf_start;

}

            length = value + 1;             memcpy(dst + x, buf, FFMIN3(length, dst_size - x, buf_end - buf));             length = -value + 1;             memset(dst + x, *buf++, FFMIN(length, dst_size - x));
static int FUNC_0(uint8_t *VAR_0, int VAR_1,

                          const uint8_t *VAR_2, const uint8_t *const VAR_3)

{

    const uint8_t *const VAR_4 = VAR_2;

    unsigned VAR_5;

    for (VAR_5 = 0; VAR_5 < VAR_1 && VAR_2 < VAR_3;) {

        unsigned length;

        const int8_t value = *VAR_2++;

        if (value >= 0) {

            length = value + 1;

            memcpy(VAR_0 + VAR_5, VAR_2, FFMIN3(length, VAR_1 - VAR_5, VAR_3 - VAR_2));

            VAR_2 += length;

        } else if (value > -128) {

            length = -value + 1;

            memset(VAR_0 + VAR_5, *VAR_2++, FFMIN(length, VAR_1 - VAR_5));

        } else { 

            continue;

        }

        VAR_5 += length;

    }

    if (VAR_5 < VAR_1) {

        av_log(NULL, AV_LOG_WARNING, "FUNC_0 ended before plane size\n");

        memset(VAR_0+VAR_5, 0, VAR_1 - VAR_5);

    }

    return VAR_2 - VAR_4;

}

static int FUNC_0(uint8_t *VAR_0, int VAR_1,
const uint8_t *VAR_2, const uint8_t *const VAR_3)
{ const uint8_t *const VAR_4 = VAR_2; unsigned VAR_5; for (VAR_5 = 0; VAR_5 < VAR_1 && VAR_2 < VAR_3;) { unsigned length; const int8_t value = *VAR_2++; if (value >= 0) { length = value + 1; memcpy(VAR_0 + VAR_5, VAR_2, FFMIN3(length, VAR_1 - VAR_5, VAR_3 - VAR_2)); VAR_2 += length; } else if (value > -128) { length = -value + 1; memset(VAR_0 + VAR_5, *VAR_2++, FFMIN(length, VAR_1 - VAR_5)); } else { continue; } VAR_5 += length; } if (VAR_5 < VAR_1) { av_log(NULL, AV_LOG_WARNING, "FUNC_0 ended before plane size\n"); memset(VAR_0+VAR_5, 0, VAR_1 - VAR_5); } return VAR_2 - VAR_4; }