if (!i && s->h263_aic) { level += h263_pred_dc(s, n, &dc_val); if (level < 0) level = 0; else if (level & 1) level++; *dc_val = level * s->y_dc_scale;  }
static int h263_decode_block(MpegEncContext * s, DCTELEM * block,                             int n, int coded){    int code, level, i, j, last, run;    RLTable *rl = &rl_inter;    UINT16 *dc_val;    const UINT8 *scan_table;    scan_table = zigzag_direct;    if (s->h263_aic) {        rl = &rl_intra_aic;        i = 0;        if (s->ac_pred) {            if (s->h263_aic_dir)                 scan_table = ff_alternate_vertical_scan; /* left */            else                scan_table = ff_alternate_horizontal_scan; /* top */        }    } else if (s->mb_intra) {        /* DC coef */        if (s->h263_rv10 && s->rv10_version == 3 && s->pict_type == I_TYPE) {            int component, diff;            component = (n <= 3 ? 0 : n - 4 + 1);            level = s->last_dc[component];            if (s->rv10_first_dc_coded[component]) {                diff = rv_decode_dc(s, n);                if (diff == 0xffff)                    return -1;                level += diff;                level = level & 0xff; /* handle wrap round */                s->last_dc[component] = level;            } else {                s->rv10_first_dc_coded[component] = 1;            }        } else {            level = get_bits(&s->gb, 8);            if (level == 255)                level = 128;        }        block[0] = level;        i = 1;    } else {        i = 0;    }    if (!coded) {        if (s->mb_intra && s->h263_aic) {            level = h263_pred_dc(s, n, &dc_val);            if (level < 0)                level = 0;            *dc_val = level * s->y_dc_scale;              block[0] = level;            h263_pred_ac(s, block, n);            i = 64;            //i = 1;        }        s->block_last_index[n] = i - 1;        return 0;    }    for(;;) {        code = get_vlc(&s->gb, &rl->vlc);        if (code < 0)            return -1;        if (code == rl->n) {            /* escape */            last = get_bits1(&s->gb);            run = get_bits(&s->gb, 6);            level = (INT8)get_bits(&s->gb, 8);            if (s->h263_rv10 && level == -128) {                /* XXX: should patch encoder too */                level = get_bits(&s->gb, 12);                level = (level << 20) >> 20;            }        } else {            run = rl->table_run[code];            level = rl->table_level[code];            last = code >= rl->last;            if (get_bits1(&s->gb))                level = -level;        }        if (!i && s->h263_aic) {            level += h263_pred_dc(s, n, &dc_val);            if (level < 0)                level = 0;            else if (level & 1)                level++;            *dc_val = level * s->y_dc_scale;                    }        i += run;        if (i >= 64)            return -1;        j = scan_table[i];        block[j] = level;        if (last)            break;        i++;    }        if (s->h263_aic) {        h263_pred_ac(s, block, n);        i = 64;    }    s->block_last_index[n] = i;    return 0;}