You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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
This commit is contained in:
@@ -74,7 +74,7 @@ int frame_count = 0;
|
|||||||
|
|
||||||
#include "msmpeg4data.h"
|
#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
|
#ifdef STATS
|
||||||
|
|
||||||
@@ -234,8 +234,7 @@ void ff_msmpeg4_encode_init(MpegEncContext *s)
|
|||||||
for(run=0; run<=MAX_RUN; run++){
|
for(run=0; run<=MAX_RUN; run++){
|
||||||
int last;
|
int last;
|
||||||
for(last=0; last<2; 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[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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -310,12 +309,12 @@ static void find_best_tables(MpegEncContext * s)
|
|||||||
int intra_chroma_count= s->ac_stats[1][1][level][run][last];
|
int intra_chroma_count= s->ac_stats[1][1][level][run][last];
|
||||||
|
|
||||||
if(s->pict_type==I_TYPE){
|
if(s->pict_type==I_TYPE){
|
||||||
size += intra_luma_count *rl_length[1][i ][level][run][last];
|
size += intra_luma_count *rl_length[i ][level][run][last];
|
||||||
chroma_size+= intra_chroma_count*rl_length[1][i+3][level][run][last];
|
chroma_size+= intra_chroma_count*rl_length[i+3][level][run][last];
|
||||||
}else{
|
}else{
|
||||||
size+= intra_luma_count *rl_length[1][i ][level][run][last]
|
size+= intra_luma_count *rl_length[i ][level][run][last]
|
||||||
+intra_chroma_count*rl_length[1][i+3][level][run][last]
|
+intra_chroma_count*rl_length[i+3][level][run][last]
|
||||||
+inter_count *rl_length[0][i+3][level][run][last];
|
+inter_count *rl_length[i+3][level][run][last];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(last_size == size+chroma_size) break;
|
if(last_size == size+chroma_size) break;
|
||||||
|
@@ -3,7 +3,7 @@ ffmpeg regression test
|
|||||||
59a66b108e8bbd3867c4ee27f4bbe2ca *./data/out.yuv
|
59a66b108e8bbd3867c4ee27f4bbe2ca *./data/out.yuv
|
||||||
20f237122350f1248d9d51489bb79092 *./data/a-msmpeg4v2.avi
|
20f237122350f1248d9d51489bb79092 *./data/a-msmpeg4v2.avi
|
||||||
74675eb582376359fbcf76ff2fb034b6 *./data/out.yuv
|
74675eb582376359fbcf76ff2fb034b6 *./data/out.yuv
|
||||||
297793ed0fd5793182a92e63ffd764af *./data/a-msmpeg4.avi
|
d6367d6abb406b438cb57a7ebc4b927d *./data/a-msmpeg4.avi
|
||||||
951aa2df4ef4c1eeee3ccc8904de8e48 *./data/out.yuv
|
951aa2df4ef4c1eeee3ccc8904de8e48 *./data/out.yuv
|
||||||
50b4590a3615a556361d75db8c6d43b3 *./data/a-wmv1.avi
|
50b4590a3615a556361d75db8c6d43b3 *./data/a-wmv1.avi
|
||||||
3ed8e11a8a8147c3e7d736593fccae79 *./data/out.yuv
|
3ed8e11a8a8147c3e7d736593fccae79 *./data/out.yuv
|
||||||
|
Reference in New Issue
Block a user