static av_always_inline void RENAME(decode_line)(FFV1Context *s, int w,

                                                 TYPE *sample[2],

                                                 int plane_index, int bits)

{

    PlaneContext *const p = &s->plane[plane_index];

    RangeCoder *const c   = &s->c;

    int x;

    int run_count = 0;

    int run_mode  = 0;

    int run_index = s->run_index;



    if (s->slice_coding_mode == 1) {

        int i;

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

            int v = 0;

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

                uint8_t state = 128;

                v += v + get_rac(c, &state);

            }

            sample[1][x] = v;

        }

        return;

    }



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

        int diff, context, sign;



        context = RENAME(get_context)(p, sample[1] + x, sample[0] + x, sample[1] + x);

        if (context < 0) {

            context = -context;

            sign    = 1;

        } else

            sign = 0;



        av_assert2(context < p->context_count);



        if (s->ac != AC_GOLOMB_RICE) {

            diff = get_symbol_inline(c, p->state[context], 1);

        } else {

            if (context == 0 && run_mode == 0)

                run_mode = 1;



            if (run_mode) {

                if (run_count == 0 && run_mode == 1) {

                    if (get_bits1(&s->gb)) {

                        run_count = 1 << ff_log2_run[run_index];

                        if (x + run_count <= w)

                            run_index++;

                    } else {

                        if (ff_log2_run[run_index])

                            run_count = get_bits(&s->gb, ff_log2_run[run_index]);

                        else

                            run_count = 0;

                        if (run_index)

                            run_index--;

                        run_mode = 2;

                    }

                }

                run_count--;

                if (run_count < 0) {

                    run_mode  = 0;

                    run_count = 0;

                    diff      = get_vlc_symbol(&s->gb, &p->vlc_state[context],

                                               bits);

                    if (diff >= 0)

                        diff++;

                } else

                    diff = 0;

            } else

                diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);



            ff_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",

                    run_count, run_index, run_mode, x, get_bits_count(&s->gb));

        }



        if (sign)

            diff = -diff;



        sample[1][x] = av_mod_uintp2(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits);

    }

    s->run_index = run_index;

}

static av_always_inline void RENAME(decode_line)(FFV1Context *s, int w,

                                                 TYPE *sample[2],

                                                 int plane_index, int bits)

{

    PlaneContext *const p = &s->plane[plane_index];

    RangeCoder *const c   = &s->c;

    int x;

    int run_count = 0;

    int run_mode  = 0;

    int run_index = s->run_index;



    if (s->slice_coding_mode == 1) {

        int i;

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

            int v = 0;

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

                uint8_t state = 128;

                v += v + get_rac(c, &state);

            }

            sample[1][x] = v;

        }

        return;

    }



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

        int diff, context, sign;



        context = RENAME(get_context)(p, sample[1] + x, sample[0] + x, sample[1] + x);

        if (context < 0) {

            context = -context;

            sign    = 1;

        } else

            sign = 0;



        av_assert2(context < p->context_count);



        if (s->ac != AC_GOLOMB_RICE) {

            diff = get_symbol_inline(c, p->state[context], 1);

        } else {

            if (context == 0 && run_mode == 0)

                run_mode = 1;



            if (run_mode) {

                if (run_count == 0 && run_mode == 1) {

                    if (get_bits1(&s->gb)) {

                        run_count = 1 << ff_log2_run[run_index];

                        if (x + run_count <= w)

                            run_index++;

                    } else {

                        if (ff_log2_run[run_index])

                            run_count = get_bits(&s->gb, ff_log2_run[run_index]);

                        else

                            run_count = 0;

                        if (run_index)

                            run_index--;

                        run_mode = 2;

                    }

                }

                run_count--;

                if (run_count < 0) {

                    run_mode  = 0;

                    run_count = 0;

                    diff      = get_vlc_symbol(&s->gb, &p->vlc_state[context],

                                               bits);

                    if (diff >= 0)

                        diff++;

                } else

                    diff = 0;

            } else

                diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);



            ff_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",

                    run_count, run_index, run_mode, x, get_bits_count(&s->gb));

        }



        if (sign)

            diff = -diff;



        sample[1][x] = av_mod_uintp2(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits);

    }

    s->run_index = run_index;

}

            diff = -diff;
static av_always_inline void FUNC_0(decode_line)(FFV1Context *s, int w,

                                                 TYPE *sample[2],

                                                 int plane_index, int bits)

{

    PlaneContext *const p = &s->plane[plane_index];

    RangeCoder *const c   = &s->c;

    int VAR_0;

    int VAR_1 = 0;

    int VAR_2  = 0;

    int VAR_3 = s->VAR_3;



    if (s->slice_coding_mode == 1) {

        int VAR_4;

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

            int v = 0;

            for (VAR_4=0; VAR_4<bits; VAR_4++) {

                uint8_t state = 128;

                v += v + get_rac(c, &state);

            }

            sample[1][VAR_0] = v;

        }

        return;

    }



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

        int diff, context, sign;



        context = FUNC_0(get_context)(p, sample[1] + VAR_0, sample[0] + VAR_0, sample[1] + VAR_0);

        if (context < 0) {

            context = -context;

            sign    = 1;

        } else

            sign = 0;



        av_assert2(context < p->context_count);



        if (s->ac != AC_GOLOMB_RICE) {

            diff = get_symbol_inline(c, p->state[context], 1);

        } else {

            if (context == 0 && VAR_2 == 0)

                VAR_2 = 1;



            if (VAR_2) {

                if (VAR_1 == 0 && VAR_2 == 1) {

                    if (get_bits1(&s->gb)) {

                        VAR_1 = 1 << ff_log2_run[VAR_3];

                        if (VAR_0 + VAR_1 <= w)

                            VAR_3++;

                    } else {

                        if (ff_log2_run[VAR_3])

                            VAR_1 = get_bits(&s->gb, ff_log2_run[VAR_3]);

                        else

                            VAR_1 = 0;

                        if (VAR_3)

                            VAR_3--;

                        VAR_2 = 2;

                    }

                }

                VAR_1--;

                if (VAR_1 < 0) {

                    VAR_2  = 0;

                    VAR_1 = 0;

                    diff      = get_vlc_symbol(&s->gb, &p->vlc_state[context],

                                               bits);

                    if (diff >= 0)

                        diff++;

                } else

                    diff = 0;

            } else

                diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);



            ff_dlog(s->avctx, "count:%d index:%d, mode:%d, VAR_0:%d pos:%d\n",

                    VAR_1, VAR_3, VAR_2, VAR_0, get_bits_count(&s->gb));

        }



        if (sign)

            diff = -diff;



        sample[1][VAR_0] = av_mod_uintp2(FUNC_0(predict)(sample[1] + VAR_0, sample[0] + VAR_0) + (SUINT)diff, bits);

    }

    s->VAR_3 = VAR_3;

}

static av_always_inline void FUNC_0(decode_line)(FFV1Context *s, int w,
TYPE *sample[2],
int plane_index, int bits)
{ PlaneContext *const p = &s->plane[plane_index]; RangeCoder *const c   = &s->c; int VAR_0; int VAR_1 = 0; int VAR_2  = 0; int VAR_3 = s->VAR_3; if (s->slice_coding_mode == 1) { int VAR_4; for (VAR_0 = 0; VAR_0 < w; VAR_0++) { int v = 0; for (VAR_4=0; VAR_4<bits; VAR_4++) { uint8_t state = 128; v += v + get_rac(c, &state); } sample[1][VAR_0] = v; } return; } for (VAR_0 = 0; VAR_0 < w; VAR_0++) { int diff, context, sign; context = FUNC_0(get_context)(p, sample[1] + VAR_0, sample[0] + VAR_0, sample[1] + VAR_0); if (context < 0) { context = -context; sign    = 1; } else sign = 0; av_assert2(context < p->context_count); if (s->ac != AC_GOLOMB_RICE) { diff = get_symbol_inline(c, p->state[context], 1); } else { if (context == 0 && VAR_2 == 0)
VAR_2 = 1; if (VAR_2) { if (VAR_1 == 0 && VAR_2 == 1) { if (get_bits1(&s->gb)) { VAR_1 = 1 << ff_log2_run[VAR_3]; if (VAR_0 + VAR_1 <= w)
VAR_3++; } else { if (ff_log2_run[VAR_3])
VAR_1 = get_bits(&s->gb, ff_log2_run[VAR_3]); else
VAR_1 = 0; if (VAR_3)
VAR_3--; VAR_2 = 2; } } VAR_1--; if (VAR_1 < 0) { VAR_2  = 0; VAR_1 = 0; diff      = get_vlc_symbol(&s->gb, &p->vlc_state[context],
bits); if (diff >= 0)
diff++; } else diff = 0; } else diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], bits); ff_dlog(s->avctx, "count:%d index:%d, mode:%d, VAR_0:%d pos:%d\n",
VAR_1, VAR_3, VAR_2, VAR_0, get_bits_count(&s->gb)); } if (sign)
diff = -diff; sample[1][VAR_0] = av_mod_uintp2(FUNC_0(predict)(sample[1] + VAR_0, sample[0] + VAR_0) + (SUINT)diff, bits); } s->VAR_3 = VAR_3; }