Commit 211ff5d3 authored by michael's avatar michael

Branchless calculation of ref_offset.

7 cpu cycles faster.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21685 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0c7b5149
...@@ -361,15 +361,14 @@ single_col: ...@@ -361,15 +361,14 @@ single_col:
}else{ /* direct temporal mv pred */ }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 *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; const int *dist_scale_factor = h->dist_scale_factor;
int ref_offset= 0; int ref_offset;
if(FRAME_MBAFF && IS_INTERLACED(*mb_type)){ 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[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]; 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]; 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 = (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
ref_offset += 16;
if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){ if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){
int y_shift = 2*!IS_INTERLACED(*mb_type); int y_shift = 2*!IS_INTERLACED(*mb_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment