comparison h264_loopfilter.c @ 10958:304db572a69a libavcodec

Make calculation of mask_edge free of branches, faster of course but probably little effect overall as this is not that often executed.
author michael
date Thu, 21 Jan 2010 16:50:31 +0000
parents 4776a56132e1
children 10759fd39860
comparison
equal deleted inserted replaced
10957:0c50a3c33c03 10958:304db572a69a
432 const int mbm_type = s->current_picture.mb_type[mbm_xy]; 432 const int mbm_type = s->current_picture.mb_type[mbm_xy];
433 433
434 const int edges = (mb_type & (MB_TYPE_16x16|MB_TYPE_SKIP)) 434 const int edges = (mb_type & (MB_TYPE_16x16|MB_TYPE_SKIP))
435 == (MB_TYPE_16x16|MB_TYPE_SKIP) ? 1 : 4; 435 == (MB_TYPE_16x16|MB_TYPE_SKIP) ? 1 : 4;
436 // how often to recheck mv-based bS when iterating between edges 436 // how often to recheck mv-based bS when iterating between edges
437 const int mask_edge = (mb_type & (MB_TYPE_16x16 | (MB_TYPE_16x8 << dir))) ? 3 : 437 static const uint8_t mask_edge_tab[2][8]={{0,3,3,3,1,1,1,1},
438 (mb_type & (MB_TYPE_8x16 >> dir)) ? 1 : 0; 438 {0,3,1,1,3,3,3,3}};
439 const int mask_edge = mask_edge_tab[dir][(mb_type>>3)&7];
439 // how often to recheck mv-based bS when iterating along each edge 440 // how often to recheck mv-based bS when iterating along each edge
440 const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)); 441 const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir));
441 int start = h->slice_table[mbm_xy] == 0xFFFF 442 int start = h->slice_table[mbm_xy] == 0xFFFF
442 || first_vertical_edge_done 443 || first_vertical_edge_done
443 || (h->deblocking_filter==2 && h->slice_table[mbm_xy] != h->slice_num); 444 || (h->deblocking_filter==2 && h->slice_table[mbm_xy] != h->slice_num);