aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-01-18 05:15:31 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-01-18 05:15:31 +0000
commit6d7e6b2657ae7ec577f3a55bc8c8b48075d51ba2 (patch)
tree0056c59696827fcdf7f6a4cee03c4665f80d4845 /libavcodec/h264.c
parent5bc3fc2187e6186cfeb3cac193ab99b3045e9f58 (diff)
downloadffmpeg-6d7e6b2657ae7ec577f3a55bc8c8b48075d51ba2.tar.gz
Perform reference remapping at fill_cache() time instead of in the
loop filter. This removes one obstacle of getting ff_h264_filter_mb_fast() bitexact. code is maybe 0.1% faster Originally committed as revision 21280 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8d7478c0f1..8146ab6cf0 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2087,16 +2087,35 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
}
for(j=0; j<2; j++){
+ int id_list[16];
int *ref2frm= h->ref2frm[h->slice_num&(MAX_SLICES-1)][j];
+ for(i=0; i<16; i++){
+ id_list[i]= 60;
+ if(h->ref_list[j][i].data[0]){
+ int k;
+ uint8_t *base= h->ref_list[j][i].base[0];
+ for(k=0; k<h->short_ref_count; k++)
+ if(h->short_ref[k]->base[0] == base){
+ id_list[i]= k;
+ break;
+ }
+ for(k=0; k<h->long_ref_count; k++)
+ if(h->long_ref[k] && h->long_ref[k]->base[0] == base){
+ id_list[i]= h->short_ref_count + k;
+ break;
+ }
+ }
+ }
+
ref2frm[0]=
ref2frm[1]= -1;
for(i=0; i<16; i++)
- ref2frm[i+2]= 4*h->ref_list[j][i].frame_num
+ ref2frm[i+2]= 4*id_list[i]
+(h->ref_list[j][i].reference&3);
ref2frm[18+0]=
ref2frm[18+1]= -1;
for(i=16; i<48; i++)
- ref2frm[i+4]= 4*h->ref_list[j][i].frame_num
+ ref2frm[i+4]= 4*id_list[(i-16)>>1]
+(h->ref_list[j][i].reference&3);
}