Mercurial > libavcodec.hg
comparison h264_loopfilter.c @ 11021:2bc05f2fc993 libavcodec
Optimize loop filtering of the left edge in MBAFF.
60 cpu cycles speedup
| author | michael |
|---|---|
| date | Tue, 26 Jan 2010 22:59:19 +0000 |
| parents | 4aee091df934 |
| children | cd1f5f6a2e45 |
comparison
equal
deleted
inserted
replaced
| 11020:297bd56297a9 | 11021:2bc05f2fc993 |
|---|---|
| 631 if( IS_INTRA(mb_type) ) | 631 if( IS_INTRA(mb_type) ) |
| 632 *(uint64_t*)&bS[0]= | 632 *(uint64_t*)&bS[0]= |
| 633 *(uint64_t*)&bS[4]= 0x0004000400040004ULL; | 633 *(uint64_t*)&bS[4]= 0x0004000400040004ULL; |
| 634 else { | 634 else { |
| 635 for( i = 0; i < 8; i++ ) { | 635 for( i = 0; i < 8; i++ ) { |
| 636 int mbn_xy = MB_FIELD ? h->left_mb_xy[i>>2] : h->left_mb_xy[i&1]; | 636 int j= MB_FIELD ? i>>2 : i&1; |
| 637 | 637 int mbn_xy = h->left_mb_xy[j]; |
| 638 if( IS_INTRA( s->current_picture.mb_type[mbn_xy] ) ) | 638 int mbn_type= h->left_type[j]; |
| 639 | |
| 640 if( IS_INTRA( mbn_type ) ) | |
| 639 bS[i] = 4; | 641 bS[i] = 4; |
| 640 else if( h->non_zero_count_cache[12+8*(i>>1)] != 0 || | 642 else{ |
| 641 ((!h->pps.cabac && IS_8x8DCT(s->current_picture.mb_type[mbn_xy])) ? | 643 bS[i] = 1 + !!(h->non_zero_count_cache[12+8*(i>>1)] | |
| 644 ((!h->pps.cabac && IS_8x8DCT(mbn_type)) ? | |
| 642 (h->cbp_table[mbn_xy] & ((MB_FIELD ? (i&2) : (mb_y&1)) ? 8 : 2)) | 645 (h->cbp_table[mbn_xy] & ((MB_FIELD ? (i&2) : (mb_y&1)) ? 8 : 2)) |
| 643 : | 646 : |
| 644 h->non_zero_count[mbn_xy][7+(MB_FIELD ? (i&3) : (i>>2)+(mb_y&1)*2)*8])) | 647 h->non_zero_count[mbn_xy][7+(MB_FIELD ? (i&3) : (i>>2)+(mb_y&1)*2)*8])); |
| 645 bS[i] = 2; | 648 } |
| 646 else | |
| 647 bS[i] = 1; | |
| 648 } | 649 } |
| 649 } | 650 } |
| 650 | 651 |
| 651 mb_qp = s->current_picture.qscale_table[mb_xy]; | 652 mb_qp = s->current_picture.qscale_table[mb_xy]; |
| 652 mbn0_qp = s->current_picture.qscale_table[h->left_mb_xy[0]]; | 653 mbn0_qp = s->current_picture.qscale_table[h->left_mb_xy[0]]; |
