diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-01-21 19:50:31 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-01-21 19:50:31 +0300 |
commit | 31f6e3c19e1e967d94a616c4fbc585460ded443c (patch) | |
tree | 633f7c2ab81df352123fd348cd99cd720931eeb7 /libavcodec/h264_loopfilter.c | |
parent | b4d68544c8d684ec80864705f7b1e2abfc319575 (diff) |
Make calculation of mask_edge free of branches, faster of course but probably
little effect overall as this is not that often executed.
Originally committed as revision 21366 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_loopfilter.c')
-rw-r--r-- | libavcodec/h264_loopfilter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c index e05610e20c..e7725bf900 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -434,8 +434,9 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u 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 |