Mercurial > libavcodec.hg
changeset 774:baa66649df35 libavcodec
mergeing inter & intra rl_length tables (50% smaller & no meassureable difference in filesize/quality)
author | michaelni |
---|---|
date | Sun, 27 Oct 2002 12:20:58 +0000 |
parents | ab67f85da840 |
children | e96776e1d2ae |
files | msmpeg4.c |
diffstat | 1 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/msmpeg4.c Sun Oct 27 12:09:25 2002 +0000 +++ b/msmpeg4.c Sun Oct 27 12:20:58 2002 +0000 @@ -74,7 +74,7 @@ #include "msmpeg4data.h" -static UINT8 rl_length[2][NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2]; +static UINT8 rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2]; #ifdef STATS @@ -234,8 +234,7 @@ for(run=0; run<=MAX_RUN; run++){ int last; for(last=0; last<2; last++){ - rl_length[0][i][level][run][last]= get_size_of_code(s, &rl_table[ i], last, run, level,0); - rl_length[1][i][level][run][last]= get_size_of_code(s, &rl_table[ i], last, run, level,1); + rl_length[i][level][run][last]= get_size_of_code(s, &rl_table[ i], last, run, level, 0); } } } @@ -310,12 +309,12 @@ int intra_chroma_count= s->ac_stats[1][1][level][run][last]; if(s->pict_type==I_TYPE){ - size += intra_luma_count *rl_length[1][i ][level][run][last]; - chroma_size+= intra_chroma_count*rl_length[1][i+3][level][run][last]; + size += intra_luma_count *rl_length[i ][level][run][last]; + chroma_size+= intra_chroma_count*rl_length[i+3][level][run][last]; }else{ - size+= intra_luma_count *rl_length[1][i ][level][run][last] - +intra_chroma_count*rl_length[1][i+3][level][run][last] - +inter_count *rl_length[0][i+3][level][run][last]; + size+= intra_luma_count *rl_length[i ][level][run][last] + +intra_chroma_count*rl_length[i+3][level][run][last] + +inter_count *rl_length[i+3][level][run][last]; } } if(last_size == size+chroma_size) break;