Mercurial > libavcodec.hg
comparison h263.c @ 905:2b93dc762f9a libavcodec
fixing illegal 3. esc bug (the mpeg4 std only requires encoders to use unescaped symbols but not esc1 or esc2 if they are shorter than esc3, andjust beause its logical to use the shortest possible vlc doesnt mean encoders do that)
author | michaelni |
---|---|
date | Wed, 04 Dec 2002 11:47:24 +0000 |
parents | 22ee74da2cd3 |
children | bbe0c99231a7 |
comparison
equal
deleted
inserted
replaced
904:06776293eabb | 905:2b93dc762f9a |
---|---|
3622 return -1; | 3622 return -1; |
3623 } | 3623 } |
3624 #if 1 | 3624 #if 1 |
3625 { | 3625 { |
3626 const int abs_level= ABS(level); | 3626 const int abs_level= ABS(level); |
3627 if(abs_level<=MAX_LEVEL && run<=MAX_RUN && ((s->workaround_bugs&FF_BUG_AC_VLC)==0)){ | 3627 if(abs_level<=MAX_LEVEL && run<=MAX_RUN){ |
3628 const int run1= run - rl->max_run[last][abs_level] - 1; | 3628 const int run1= run - rl->max_run[last][abs_level] - 1; |
3629 if(abs_level <= rl->max_level[last][run]){ | 3629 if(abs_level <= rl->max_level[last][run]){ |
3630 fprintf(stderr, "illegal 3. esc, vlc encoding possible\n"); | 3630 fprintf(stderr, "illegal 3. esc, vlc encoding possible\n"); |
3631 return -1; | 3631 return -1; |
3632 } | 3632 } |
3633 if(abs_level <= rl->max_level[last][run]*2){ | 3633 if(s->error_resilience > FF_ER_COMPLIANT){ |
3634 fprintf(stderr, "illegal 3. esc, esc 1 encoding possible\n"); | 3634 if(abs_level <= rl->max_level[last][run]*2){ |
3635 return -1; | 3635 fprintf(stderr, "illegal 3. esc, esc 1 encoding possible\n"); |
3636 } | 3636 return -1; |
3637 if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){ | 3637 } |
3638 fprintf(stderr, "illegal 3. esc, esc 2 encoding possible\n"); | 3638 if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){ |
3639 return -1; | 3639 fprintf(stderr, "illegal 3. esc, esc 2 encoding possible\n"); |
3640 return -1; | |
3641 } | |
3640 } | 3642 } |
3641 } | 3643 } |
3642 } | 3644 } |
3643 #endif | 3645 #endif |
3644 if (level>0) level= level * qmul + qadd; | 3646 if (level>0) level= level * qmul + qadd; |