static void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n)
static void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, UINT8 *scan_table)
static void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n){    int level, run, last, i, j, last_index, last_non_zero, sign, slevel;    int code, dc_pred_dir;    const RLTable *rl;    if (s->mb_intra) {	/* mpeg4 based DC predictor */	mpeg4_encode_dc(s, block[0], n, &dc_pred_dir);	i = 1;        rl = &rl_intra;    } else {	i = 0;        rl = &rl_inter;    }    /* AC coefs */    last_index = s->block_last_index[n];    last_non_zero = i - 1;    for (; i <= last_index; i++) {	j = zigzag_direct[i];	level = block[j];	if (level) {	    run = i - last_non_zero - 1;	    last = (i == last_index);	    sign = 0;	    slevel = level;	    if (level < 0) {		sign = 1;		level = -level;	    }            code = get_rl_index(rl, last, run, level);            put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);            if (code == rl->n) {                int level1, run1;                level1 = level - rl->max_level[last][run];                if (level1 < 1)                     goto esc2;                code = get_rl_index(rl, last, run, level1);                if (code == rl->n) {                esc2:                    put_bits(&s->pb, 1, 1);                    if (level > MAX_LEVEL)                        goto esc3;                    run1 = run - rl->max_run[last][level] - 1;                    if (run1 < 0)                        goto esc3;                    code = get_rl_index(rl, last, run1, level);                    if (code == rl->n) {                    esc3:                        /* third escape */                        put_bits(&s->pb, 1, 1);                        put_bits(&s->pb, 1, last);                        put_bits(&s->pb, 6, run);                        put_bits(&s->pb, 1, 1);                        put_bits(&s->pb, 12, slevel & 0xfff);                        put_bits(&s->pb, 1, 1);                    } else {                        /* second escape */                        put_bits(&s->pb, 1, 0);                        put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);                        put_bits(&s->pb, 1, sign);                    }                } else {                    /* first escape */                    put_bits(&s->pb, 1, 0);                    put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);                    put_bits(&s->pb, 1, sign);                }            } else {                put_bits(&s->pb, 1, sign);            }	    last_non_zero = i;	}    }}