diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-10-27 12:20:58 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-10-27 12:20:58 +0000 |
commit | 060f89b3283b5a00fad483f5da4e967531ef9324 (patch) | |
tree | fb476979272617720dbd5d8b17e09f76265b5b46 | |
parent | f3c09da19fce9773e9f21dcca530492032df5d89 (diff) | |
download | ffmpeg-060f89b3283b5a00fad483f5da4e967531ef9324.tar.gz |
mergeing inter & intra rl_length tables (50% smaller & no meassureable difference in filesize/quality)
Originally committed as revision 1078 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/msmpeg4.c | 15 | ||||
-rw-r--r-- | tests/ffmpeg.regression.ref | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index 19d672627e..81dc91fbb4 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -74,7 +74,7 @@ int frame_count = 0; #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 @@ void ff_msmpeg4_encode_init(MpegEncContext *s) 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 @@ static void find_best_tables(MpegEncContext * s) 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; diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref index cd9d8bbc89..2b1a39064e 100644 --- a/tests/ffmpeg.regression.ref +++ b/tests/ffmpeg.regression.ref @@ -3,7 +3,7 @@ ffmpeg regression test 59a66b108e8bbd3867c4ee27f4bbe2ca *./data/out.yuv 20f237122350f1248d9d51489bb79092 *./data/a-msmpeg4v2.avi 74675eb582376359fbcf76ff2fb034b6 *./data/out.yuv -297793ed0fd5793182a92e63ffd764af *./data/a-msmpeg4.avi +d6367d6abb406b438cb57a7ebc4b927d *./data/a-msmpeg4.avi 951aa2df4ef4c1eeee3ccc8904de8e48 *./data/out.yuv 50b4590a3615a556361d75db8c6d43b3 *./data/a-wmv1.avi 3ed8e11a8a8147c3e7d736593fccae79 *./data/out.yuv |