Mercurial > libavcodec.hg
comparison h264_loopfilter.c @ 10896:f112b4d030fa libavcodec
Avoid wasting 4 cpu cycles per MB in redundantly calculating qp_thresh.
author | michael |
---|---|
date | Sat, 16 Jan 2010 11:55:35 +0000 |
parents | f6fc6ace95e3 |
children | 28ac79270704 |
comparison
equal
deleted
inserted
replaced
10895:1cebb3ea364b | 10896:f112b4d030fa |
---|---|
652 av_unused int dir; | 652 av_unused int dir; |
653 | 653 |
654 //for sufficiently low qp, filtering wouldn't do anything | 654 //for sufficiently low qp, filtering wouldn't do anything |
655 //this is a conservative estimate: could also check beta_offset and more accurate chroma_qp | 655 //this is a conservative estimate: could also check beta_offset and more accurate chroma_qp |
656 if(!FRAME_MBAFF){ | 656 if(!FRAME_MBAFF){ |
657 int qp_thresh = 15 - h->slice_alpha_c0_offset - FFMAX3(0, h->pps.chroma_qp_index_offset[0], h->pps.chroma_qp_index_offset[1]); | 657 int qp_thresh = h->qp_thresh; |
658 int qp = s->current_picture.qscale_table[mb_xy]; | 658 int qp = s->current_picture.qscale_table[mb_xy]; |
659 if(qp <= qp_thresh | 659 if(qp <= qp_thresh |
660 && (mb_x == 0 || ((qp + s->current_picture.qscale_table[mb_xy-1] + 1)>>1) <= qp_thresh) | 660 && (mb_x == 0 || ((qp + s->current_picture.qscale_table[mb_xy-1] + 1)>>1) <= qp_thresh) |
661 && (h->top_mb_xy < 0 || ((qp + s->current_picture.qscale_table[h->top_mb_xy] + 1)>>1) <= qp_thresh)){ | 661 && (h->top_mb_xy < 0 || ((qp + s->current_picture.qscale_table[h->top_mb_xy] + 1)>>1) <= qp_thresh)){ |
662 return; | 662 return; |