comparison h264_loopfilter.c @ 11056:03cda6ebdc05 libavcodec

Replace ?: by branchless code. about 0.5% faster loop filtering
author michael
date Sat, 30 Jan 2010 13:40:20 +0000
parents 5f712d734793
children e10c891b023c
comparison
equal deleted inserted replaced
11055:dcb38ea8dad0 11056:03cda6ebdc05
372 int edges; 372 int edges;
373 if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 ) { 373 if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 ) {
374 edges = 4; 374 edges = 4;
375 bSv[0][0] = bSv[0][2] = bSv[1][0] = bSv[1][2] = 0x0002000200020002ULL; 375 bSv[0][0] = bSv[0][2] = bSv[1][0] = bSv[1][2] = 0x0002000200020002ULL;
376 } else { 376 } else {
377 int mask_edge1 = (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : 377 int mask_edge1 = (3*!!(mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16))) | (mb_type>>4); //(mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : (mb_type & MB_TYPE_16x8) ? 1 : 0;
378 (mb_type & MB_TYPE_16x8) ? 1 : 0; 378 int mask_edge0 = 3*((mask_edge1>>1) & !!(h->left_type[0] & (MB_TYPE_16x16 | MB_TYPE_8x16))); // (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) && (h->left_type[0] & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : 0;
379 int mask_edge0 = (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) 379 int step = 1+(mb_type>>24); //IS_8x8DCT(mb_type) ? 2 : 1;
380 && (h->left_type[0] & (MB_TYPE_16x16 | MB_TYPE_8x16)) 380 edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15)); //(mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;
381 ? 3 : 0;
382 int step = IS_8x8DCT(mb_type) ? 2 : 1;
383 edges = (mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;
384 s->dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache, 381 s->dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache,
385 h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE); 382 h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE);
386 } 383 }
387 if( IS_INTRA(h->left_type[0]) ) 384 if( IS_INTRA(h->left_type[0]) )
388 bSv[0][0] = 0x0004000400040004ULL; 385 bSv[0][0] = 0x0004000400040004ULL;