summaryrefslogtreecommitdiff
path: root/libavcodec/h264_direct.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-08 03:22:17 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-08 03:22:17 +0000
commit542d4a756a260f86eedba1df225ed0b24ab55007 (patch)
tree5d77a64a26139dda8b1ad7486c6294a9d33ec2f8 /libavcodec/h264_direct.c
parentfb70c63f7091070ddd9d6adddfe12d8908561103 (diff)
Branchless calculation of ref_offset.
7 cpu cycles faster. Originally committed as revision 21685 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_direct.c')
-rw-r--r--libavcodec/h264_direct.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index 5a27f85fc3..8da890dbd3 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -361,15 +361,14 @@ single_col:
}else{ /* direct temporal mv pred */
const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]};
const int *dist_scale_factor = h->dist_scale_factor;
- int ref_offset= 0;
+ int ref_offset;
if(FRAME_MBAFF && IS_INTERLACED(*mb_type)){
map_col_to_list0[0] = h->map_col_to_list0_field[s->mb_y&1][0];
map_col_to_list0[1] = h->map_col_to_list0_field[s->mb_y&1][1];
dist_scale_factor =h->dist_scale_factor_field[s->mb_y&1];
}
- if(h->ref_list[1][0].mbaff && IS_INTERLACED(mb_type_col[0]))
- ref_offset += 16;
+ ref_offset = (h->ref_list[1][0].mbaff<<4) & (mb_type_col[0]>>3); //if(h->ref_list[1][0].mbaff && IS_INTERLACED(mb_type_col[0])) ref_offset=16 else 0
if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){
int y_shift = 2*!IS_INTERLACED(*mb_type);