diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-01-20 04:49:24 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-01-20 04:49:24 +0300 |
commit | 085d9d98e8afbab9cb78d98128c58e0ca54d98db (patch) | |
tree | ca5f3b2d82dea00d7f27734212f8c89d52da8604 /libavcodec/h264_loopfilter.c | |
parent | 948180e7b1dbfc201efb48097fc12930fd0a1e1c (diff) |
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
Diffstat (limited to 'libavcodec/h264_loopfilter.c')
-rw-r--r-- | libavcodec/h264_loopfilter.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c index 3bd1e4c170..fac1f5185e 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -594,18 +594,20 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u if( dir == 0 ) { filter_mb_edgev( h, &img_y[4*edge], linesize, bS, qp ); if( (edge&1) == 0 ) { - filter_mb_edgecv( h, &img_cb[2*edge], uvlinesize, bS, - ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); - filter_mb_edgecv( h, &img_cr[2*edge], uvlinesize, bS, - ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); + int qp= ( 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); + if(h->pps.chroma_qp_diff) + 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 { filter_mb_edgeh( h, &img_y[4*edge*linesize], linesize, bS, qp ); if( (edge&1) == 0 ) { - filter_mb_edgech( h, &img_cb[2*edge*uvlinesize], uvlinesize, bS, - ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); - filter_mb_edgech( h, &img_cr[2*edge*uvlinesize], uvlinesize, bS, - ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1); + int qp= ( 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); + if(h->pps.chroma_qp_diff) + 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); } } } |