static always_inline void encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
static inline void encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
static always_inline void encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){    PlaneContext * const p= &s->plane[plane_index];    CABACContext * const c= &s->c;    int x;    int run_index= s->run_index;    int run_count=0;    int run_mode=0;    for(x=0; x<w; x++){        int diff, context;                context= get_context(s, sample[1]+x, sample[0]+x, sample[1]+x);        diff= sample[1][x] - predict(sample[1]+x, sample[0]+x);        if(context < 0){            context = -context;            diff= -diff;        }        diff= fold(diff, bits);                if(s->ac){            put_symbol(c, p->state[context], diff, 1, bits-1);        }else{            if(context == 0) run_mode=1;                        if(run_mode){                if(diff){                    while(run_count >= 1<<log2_run[run_index]){                        run_count -= 1<<log2_run[run_index];                        run_index++;                        put_bits(&s->pb, 1, 1);                    }                                        put_bits(&s->pb, 1 + log2_run[run_index], run_count);                    if(run_index) run_index--;                    run_count=0;                    run_mode=0;                    if(diff>0) diff--;                }else{                    run_count++;                }            }            //            printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, (int)get_bit_count(&s->pb));            if(run_mode == 0)                put_vlc_symbol(&s->pb, &p->vlc_state[context], diff, bits);        }    }    if(run_mode){        while(run_count >= 1<<log2_run[run_index]){            run_count -= 1<<log2_run[run_index];            run_index++;            put_bits(&s->pb, 1, 1);        }        if(run_count)            put_bits(&s->pb, 1, 1);    }    s->run_index= run_index;}