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)

Originally committed as revision 21342 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2010-01-20 01:49:24 +00:00
parent 948180e7b1
commit 085d9d98e8
1 changed files with 10 additions and 8 deletions

View File

@ -594,18 +594,20 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u
if( dir == 0 ) { if( dir == 0 ) {
filter_mb_edgev( h, &img_y[4*edge], linesize, bS, qp ); filter_mb_edgev( h, &img_y[4*edge], linesize, bS, qp );
if( (edge&1) == 0 ) { if( (edge&1) == 0 ) {
filter_mb_edgecv( h, &img_cb[2*edge], uvlinesize, bS, int qp= ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1;
( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); filter_mb_edgecv( h, &img_cb[2*edge], uvlinesize, bS, qp);
filter_mb_edgecv( h, &img_cr[2*edge], uvlinesize, bS, if(h->pps.chroma_qp_diff)
( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); qp= ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1;
filter_mb_edgecv( h, &img_cr[2*edge], uvlinesize, bS, qp);
} }
} else { } else {
filter_mb_edgeh( h, &img_y[4*edge*linesize], linesize, bS, qp ); filter_mb_edgeh( h, &img_y[4*edge*linesize], linesize, bS, qp );
if( (edge&1) == 0 ) { if( (edge&1) == 0 ) {
filter_mb_edgech( h, &img_cb[2*edge*uvlinesize], uvlinesize, bS, int qp= ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1;
( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); filter_mb_edgech( h, &img_cb[2*edge*uvlinesize], uvlinesize, bS, qp);
filter_mb_edgech( h, &img_cr[2*edge*uvlinesize], uvlinesize, bS, if(h->pps.chroma_qp_diff)
( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); qp= ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1;
filter_mb_edgech( h, &img_cr[2*edge*uvlinesize], uvlinesize, bS, qp);
} }
} }
} }