Mercurial > libavcodec.hg
comparison h264_loopfilter.c @ 10948:c80f0dfbf47d libavcodec
Only calculate the second chroma qp if it differs from the firstin the main
loop filter. (a little faster for the common case where they are equal)
author | michael |
---|---|
date | Wed, 20 Jan 2010 01:49:24 +0000 |
parents | df6bda2aa59a |
children | 4c9b8e3065ee |
comparison
equal
deleted
inserted
replaced
10947:df6bda2aa59a | 10948:c80f0dfbf47d |
---|---|
592 tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize); | 592 tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize); |
593 //{ int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); } | 593 //{ int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); } |
594 if( dir == 0 ) { | 594 if( dir == 0 ) { |
595 filter_mb_edgev( h, &img_y[4*edge], linesize, bS, qp ); | 595 filter_mb_edgev( h, &img_y[4*edge], linesize, bS, qp ); |
596 if( (edge&1) == 0 ) { | 596 if( (edge&1) == 0 ) { |
597 filter_mb_edgecv( h, &img_cb[2*edge], uvlinesize, bS, | 597 int qp= ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1; |
598 ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); | 598 filter_mb_edgecv( h, &img_cb[2*edge], uvlinesize, bS, qp); |
599 filter_mb_edgecv( h, &img_cr[2*edge], uvlinesize, bS, | 599 if(h->pps.chroma_qp_diff) |
600 ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); | 600 qp= ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1; |
601 filter_mb_edgecv( h, &img_cr[2*edge], uvlinesize, bS, qp); | |
601 } | 602 } |
602 } else { | 603 } else { |
603 filter_mb_edgeh( h, &img_y[4*edge*linesize], linesize, bS, qp ); | 604 filter_mb_edgeh( h, &img_y[4*edge*linesize], linesize, bS, qp ); |
604 if( (edge&1) == 0 ) { | 605 if( (edge&1) == 0 ) { |
605 filter_mb_edgech( h, &img_cb[2*edge*uvlinesize], uvlinesize, bS, | 606 int qp= ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1; |
606 ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); | 607 filter_mb_edgech( h, &img_cb[2*edge*uvlinesize], uvlinesize, bS, qp); |
607 filter_mb_edgech( h, &img_cr[2*edge*uvlinesize], uvlinesize, bS, | 608 if(h->pps.chroma_qp_diff) |
608 ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); | 609 qp= ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1; |
610 filter_mb_edgech( h, &img_cr[2*edge*uvlinesize], uvlinesize, bS, qp); | |
609 } | 611 } |
610 } | 612 } |
611 } | 613 } |
612 } | 614 } |
613 | 615 |