static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst,

                                      const uint8_t *src, int w, int left)

{

    int i;

    if (s->bps <= 8) {

        if (w < 32) {

            for (i = 0; i < w; i++) {

                const int temp = src[i];

                dst[i] = temp - left;

                left   = temp;

            }

            return left;

        } else {

            for (i = 0; i < 32; i++) {

                const int temp = src[i];

                dst[i] = temp - left;

                left   = temp;

            }

            s->llvidencdsp.diff_bytes(dst + 32, src + 32, src + 31, w - 32);

            return src[w-1];

        }

    } else {

        const uint16_t *src16 = (const uint16_t *)src;

        uint16_t       *dst16 = (      uint16_t *)dst;

        if (w < 32) {

            for (i = 0; i < w; i++) {

                const int temp = src16[i];

                dst16[i] = temp - left;

                left   = temp;

            }

            return left;

        } else {

            for (i = 0; i < 16; i++) {

                const int temp = src16[i];

                dst16[i] = temp - left;

                left   = temp;

            }

            s->hencdsp.diff_int16(dst16 + 16, src16 + 16, src16 + 15, s->n - 1, w - 16);

            return src16[w-1];

        }

    }

}

static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst,

                                      const uint8_t *src, int w, int left)

{

    int i;

    if (s->bps <= 8) {

        if (w < 32) {

            for (i = 0; i < w; i++) {

                const int temp = src[i];

                dst[i] = temp - left;

                left   = temp;

            }

            return left;

        } else {

            for (i = 0; i < 32; i++) {

                const int temp = src[i];

                dst[i] = temp - left;

                left   = temp;

            }

            s->llvidencdsp.diff_bytes(dst + 32, src + 32, src + 31, w - 32);

            return src[w-1];

        }

    } else {

        const uint16_t *src16 = (const uint16_t *)src;

        uint16_t       *dst16 = (      uint16_t *)dst;

        if (w < 32) {

            for (i = 0; i < w; i++) {

                const int temp = src16[i];

                dst16[i] = temp - left;

                left   = temp;

            }

            return left;

        } else {

            for (i = 0; i < 16; i++) {

                const int temp = src16[i];

                dst16[i] = temp - left;

                left   = temp;

            }

            s->hencdsp.diff_int16(dst16 + 16, src16 + 16, src16 + 15, s->n - 1, w - 16);

            return src16[w-1];

        }

    }

}

static inline int FUNC_0(HYuvContext *VAR_0, uint8_t *VAR_1,

                                      const uint8_t *VAR_2, int VAR_3, int VAR_4)

{

    int VAR_5;

    if (VAR_0->bps <= 8) {

        if (VAR_3 < 32) {

            for (VAR_5 = 0; VAR_5 < VAR_3; VAR_5++) {

                const int VAR_8 = VAR_2[VAR_5];

                VAR_1[VAR_5] = VAR_8 - VAR_4;

                VAR_4   = VAR_8;

            }

            return VAR_4;

        } else {

            for (VAR_5 = 0; VAR_5 < 32; VAR_5++) {

                const int VAR_8 = VAR_2[VAR_5];

                VAR_1[VAR_5] = VAR_8 - VAR_4;

                VAR_4   = VAR_8;

            }

            VAR_0->llvidencdsp.diff_bytes(VAR_1 + 32, VAR_2 + 32, VAR_2 + 31, VAR_3 - 32);

            return VAR_2[VAR_3-1];

        }

    } else {

        const uint16_t *VAR_7 = (const uint16_t *)VAR_2;

        uint16_t       *dst16 = (      uint16_t *)VAR_1;

        if (VAR_3 < 32) {

            for (VAR_5 = 0; VAR_5 < VAR_3; VAR_5++) {

                const int VAR_8 = VAR_7[VAR_5];

                dst16[VAR_5] = VAR_8 - VAR_4;

                VAR_4   = VAR_8;

            }

            return VAR_4;

        } else {

            for (VAR_5 = 0; VAR_5 < 16; VAR_5++) {

                const int VAR_8 = VAR_7[VAR_5];

                dst16[VAR_5] = VAR_8 - VAR_4;

                VAR_4   = VAR_8;

            }

            VAR_0->hencdsp.diff_int16(dst16 + 16, VAR_7 + 16, VAR_7 + 15, VAR_0->n - 1, VAR_3 - 16);

            return VAR_7[VAR_3-1];

        }

    }

}

static inline int FUNC_0(HYuvContext *VAR_0, uint8_t *VAR_1,
const uint8_t *VAR_2, int VAR_3, int VAR_4)
{ int VAR_5; if (VAR_0->bps <= 8) { if (VAR_3 < 32) { for (VAR_5 = 0; VAR_5 < VAR_3; VAR_5++) { const int VAR_8 = VAR_2[VAR_5]; VAR_1[VAR_5] = VAR_8 - VAR_4; VAR_4   = VAR_8; } return VAR_4; } else { for (VAR_5 = 0; VAR_5 < 32; VAR_5++) { const int VAR_8 = VAR_2[VAR_5]; VAR_1[VAR_5] = VAR_8 - VAR_4; VAR_4   = VAR_8; } VAR_0->llvidencdsp.diff_bytes(VAR_1 + 32, VAR_2 + 32, VAR_2 + 31, VAR_3 - 32); return VAR_2[VAR_3-1]; } } else { const uint16_t *VAR_7 = (const uint16_t *)VAR_2; uint16_t       *dst16 = (      uint16_t *)VAR_1; if (VAR_3 < 32) { for (VAR_5 = 0; VAR_5 < VAR_3; VAR_5++) { const int VAR_8 = VAR_7[VAR_5]; dst16[VAR_5] = VAR_8 - VAR_4; VAR_4   = VAR_8; } return VAR_4; } else { for (VAR_5 = 0; VAR_5 < 16; VAR_5++) { const int VAR_8 = VAR_7[VAR_5]; dst16[VAR_5] = VAR_8 - VAR_4; VAR_4   = VAR_8; } VAR_0->hencdsp.diff_int16(dst16 + 16, VAR_7 + 16, VAR_7 + 15, VAR_0->n - 1, VAR_3 - 16); return VAR_7[VAR_3-1]; } } }