fprintf(stderr, "dc overflow-\n");
fprintf(stderr, "dc overflow- block: %d qscale: %d
static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,                              int n, int coded){    int code, level, i, j, last, run, run_diff;    int dc_pred_dir;    RLTable *rl;    const UINT8 *scan_table;    int qmul, qadd;    if (s->mb_intra) {        qmul=1;        qadd=0;	/* DC coef */        set_stat(ST_DC);        level = msmpeg4_decode_dc(s, n, &dc_pred_dir);        if (level < 0){            fprintf(stderr, "dc overflow-\n");            return -1;        }        if (n < 4) {            rl = &rl_table[s->rl_table_index];            if(level > 256*s->y_dc_scale){                fprintf(stderr, "dc overflow+\n");                return -1;            }        } else {            rl = &rl_table[3 + s->rl_chroma_table_index];            if(level > 256*s->c_dc_scale){                fprintf(stderr, "dc overflow+\n");                return -1;            }        }        block[0] = level;        run_diff = 0;	i = 1;        if (!coded) {            goto not_coded;        }        if (s->ac_pred) {            if (dc_pred_dir == 0)                 scan_table = s->intra_v_scantable; /* left */            else                scan_table = s->intra_h_scantable; /* top */        } else {            scan_table = s->intra_scantable;        }        set_stat(ST_INTRA_AC);    } else {        qmul = s->qscale << 1;        qadd = (s->qscale - 1) | 1;	i = 0;        rl = &rl_table[3 + s->rl_table_index];        if(s->msmpeg4_version==2)            run_diff = 0;        else            run_diff = 1;        if (!coded) {            s->block_last_index[n] = i - 1;            return 0;        }        scan_table = s->inter_scantable;        set_stat(ST_INTER_AC);    }    for(;;) {        code = get_vlc(&s->gb, &rl->vlc);        if (code < 0){            fprintf(stderr, "illegal AC-VLC code at %d %d\n", s->mb_x, s->mb_y);            return -1;        }        if (code == rl->n) {            /* escape */            if (s->msmpeg4_version==1 || get_bits1(&s->gb) == 0) {                if (s->msmpeg4_version==1 || get_bits1(&s->gb) == 0) {                    /* third escape */                    if(s->msmpeg4_version<=3){                        last= get_bits1(&s->gb);                        run= get_bits(&s->gb, 6);                          level= get_bits(&s->gb, 8);                        level= ((int8_t)level);                    }else{                        int sign;                        last= get_bits1(&s->gb);                        if(!s->esc3_level_length){                            int ll;                            //printf("ESC-3 %X at %d %d\n", show_bits(&s->gb, 24), s->mb_x, s->mb_y);                            if(s->qscale<8){                                ll= get_bits(&s->gb, 3);                                if(ll==0){                                    if(get_bits1(&s->gb)) printf("cool a new vlc code ,contact the ffmpeg developers and upload the file\n");                                    ll=8;                                }                            }else{                                ll=2;                                while(ll<8 && get_bits1(&s->gb)==0) ll++;                            }                            s->esc3_level_length= ll;                            s->esc3_run_length= get_bits(&s->gb, 2) + 3;//printf("level length:%d, run length: %d\n", ll, s->esc3_run_length);                        }                        run= get_bits(&s->gb, s->esc3_run_length);                          sign= get_bits1(&s->gb);                        level= get_bits(&s->gb, s->esc3_level_length);                        if(sign) level= -level;                    }//printf("level: %d, run: %d at %d %d\n", level, run, s->mb_x, s->mb_y);#if 0 // waste of time / this will detect very few errors                    {                        const int abs_level= ABS(level);                        const int run1= run - rl->max_run[last][abs_level] - run_diff;                        if(abs_level<=MAX_LEVEL && run<=MAX_RUN){                            if(abs_level <= rl->max_level[last][run]){                                fprintf(stderr, "illegal 3. esc, vlc encoding possible\n");                                return DECODING_AC_LOST;                            }                            if(abs_level <= rl->max_level[last][run]*2){                                fprintf(stderr, "illegal 3. esc, esc 1 encoding possible\n");                                return DECODING_AC_LOST;                            }                            if(run1>=0 && abs_level <= rl->max_level[last][run1]){                                fprintf(stderr, "illegal 3. esc, esc 2 encoding possible\n");                                return DECODING_AC_LOST;                            }                        }                    }#endif		    //level = level * qmul + (level>0) * qadd - (level<=0) * qadd ;		    if (level>0) level= level * qmul + qadd;                    else         level= level * qmul - qadd;#if 0 // waste of time too :(                    if(level>2048 || level<-2048){                        fprintf(stderr, "|level| overflow in 3. esc\n");                        return DECODING_AC_LOST;                    }#endif                } else {                    /* second escape */                    code = get_vlc(&s->gb, &rl->vlc);                    if (code < 0 || code >= rl->n){                        fprintf(stderr, "illegal ESC2-VLC code %d at %d %d\n", code, s->mb_x, s->mb_y);                        return -1;                    }                    run = rl->table_run[code];                    level = rl->table_level[code];                    last = code >= rl->last;                    run += rl->max_run[last][level] + run_diff;                    level= level * qmul + qadd;                    if (get_bits1(&s->gb))                        level = -level;                }            } else {                /* first escape */                code = get_vlc(&s->gb, &rl->vlc);                if (code < 0 || code >= rl->n){                    fprintf(stderr, "illegal ESC2-VLC code %d at %d %d\n", code, s->mb_x, s->mb_y);                    return -1;                }                run = rl->table_run[code];                level = rl->table_level[code];                last = code >= rl->last;                level += rl->max_level[last][run];                level= level * qmul + qadd;                if (get_bits1(&s->gb))                    level = -level;            }        } else {            run = rl->table_run[code];            level = rl->table_level[code] * qmul + qadd;            last = code >= rl->last;            if (get_bits1(&s->gb))                level = -level;        }        i += run;        if (i >= 64){            fprintf(stderr, "run too long at %d %d\n", s->mb_x, s->mb_y);            return -1;        }	j = scan_table[i];        block[j] = level;        i++;        if (last)            break;    } not_coded:    if (s->mb_intra) {        mpeg4_pred_ac(s, block, n, dc_pred_dir);        if (s->ac_pred) {            i = 64; /* XXX: not optimal */        }    }    if(s->msmpeg4_version==4 && i>1) i=64; //FIXME/XXX optimize    s->block_last_index[n] = i - 1;        return 0;}