# HG changeset patch # User michael # Date 1264092631 0 # Node ID 304db572a69a083203fd75f737e98f0a5d4a518d # Parent 0c50a3c33c03023ee28d73500f639466c509816d Make calculation of mask_edge free of branches, faster of course but probably little effect overall as this is not that often executed. diff -r 0c50a3c33c03 -r 304db572a69a h264_loopfilter.c --- a/h264_loopfilter.c Thu Jan 21 13:49:47 2010 +0000 +++ b/h264_loopfilter.c Thu Jan 21 16:50:31 2010 +0000 @@ -434,8 +434,9 @@ const int edges = (mb_type & (MB_TYPE_16x16|MB_TYPE_SKIP)) == (MB_TYPE_16x16|MB_TYPE_SKIP) ? 1 : 4; // how often to recheck mv-based bS when iterating between edges - const int mask_edge = (mb_type & (MB_TYPE_16x16 | (MB_TYPE_16x8 << dir))) ? 3 : - (mb_type & (MB_TYPE_8x16 >> dir)) ? 1 : 0; + static const uint8_t mask_edge_tab[2][8]={{0,3,3,3,1,1,1,1}, + {0,3,1,1,3,3,3,3}}; + const int mask_edge = mask_edge_tab[dir][(mb_type>>3)&7]; // how often to recheck mv-based bS when iterating along each edge const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)); int start = h->slice_table[mbm_xy] == 0xFFFF