[FFmpeg-cvslog] r21342 - trunk/libavcodec/h264_loopfilter.c

michael subversion
Wed Jan 20 02:49:24 CET 2010


Author: michael
Date: Wed Jan 20 02:49:24 2010
New Revision: 21342

Log:
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)

Modified:
   trunk/libavcodec/h264_loopfilter.c

Modified: trunk/libavcodec/h264_loopfilter.c
==============================================================================
--- trunk/libavcodec/h264_loopfilter.c	Wed Jan 20 02:38:32 2010	(r21341)
+++ trunk/libavcodec/h264_loopfilter.c	Wed Jan 20 02:49:24 2010	(r21342)
@@ -594,18 +594,20 @@ static av_always_inline void filter_mb_d
         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);
             }
         }
     }



More information about the ffmpeg-cvslog mailing list