[x264-devel] Modify MBAFF chroma deblock functions to handle U/V at the same time

Jason Garrett-Glaser git at videolan.org
Tue Dec 6 01:00:48 CET 2011


x264 | branch: master | Jason Garrett-Glaser <jason at x264.com> | Wed Nov 30 13:02:12 2011 -0800| [0637cd67cb245fce5ba190fa4b9c341319ea2b37] | committer: Jason Garrett-Glaser

Modify MBAFF chroma deblock functions to handle U/V at the same time
Allows for more convenient asm implementations.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=0637cd67cb245fce5ba190fa4b9c341319ea2b37
---

 common/deblock.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/common/deblock.c b/common/deblock.c
index 2ae5f75..d52d53c 100644
--- a/common/deblock.c
+++ b/common/deblock.c
@@ -165,13 +165,11 @@ static ALWAYS_INLINE void deblock_chroma_c( pixel *pix, int height, int xstride,
 }
 static void deblock_h_chroma_mbaff_c( pixel *pix, int stride, int alpha, int beta, int8_t *tc0 )
 {
-    for( int i = 0; i < 4; i++, pix += stride )
-        deblock_edge_chroma_c( pix, 2, alpha, beta, tc0[i] );
+    deblock_chroma_c( pix, 1, 2, stride, alpha, beta, tc0 );
 }
 static void deblock_h_chroma_422_mbaff_c( pixel *pix, int stride, int alpha, int beta, int8_t *tc0 )
 {
-    for( int i = 0; i < 8; i++, pix += stride )
-        deblock_edge_chroma_c( pix, 2, alpha, beta, tc0[i>>1] );
+    deblock_chroma_c( pix, 2, 2, stride, alpha, beta, tc0 );
 }
 static void deblock_v_chroma_c( pixel *pix, int stride, int alpha, int beta, int8_t *tc0 )
 {
@@ -265,13 +263,11 @@ static ALWAYS_INLINE void deblock_chroma_intra_c( pixel *pix, int width, int hei
 }
 static void deblock_h_chroma_intra_mbaff_c( pixel *pix, int stride, int alpha, int beta )
 {
-    for( int i = 0; i < 4; i++, pix += stride )
-        deblock_edge_chroma_intra_c( pix, 2, alpha, beta );
+    deblock_chroma_intra_c( pix, 2, 4, 2, stride, alpha, beta );
 }
 static void deblock_h_chroma_422_intra_mbaff_c( pixel *pix, int stride, int alpha, int beta )
 {
-    for( int i = 0; i < 8; i++, pix += stride )
-        deblock_edge_chroma_intra_c( pix, 2, alpha, beta );
+    deblock_chroma_intra_c( pix, 2, 8, 2, stride, alpha, beta );
 }
 static void deblock_v_chroma_intra_c( pixel *pix, int stride, int alpha, int beta )
 {
@@ -474,13 +470,15 @@ void x264_frame_deblock_row( x264_t *h, int mb_y )
                 {
                     deblock_edge_intra( h, pixy,           2*stridey,  bs[0][0], luma_qp[0],   a, b, 0, luma_intra_deblock );
                     deblock_edge_intra( h, pixuv,          2*strideuv, bs[0][0], chroma_qp[0], a, b, c, chroma_intra_deblock );
-                    deblock_edge_intra( h, pixuv + uvdiff, 2*strideuv, bs[0][0], chroma_qp[0], a, b, c, chroma_intra_deblock );
+                    if( chroma444 )
+                        deblock_edge_intra( h, pixuv + uvdiff, 2*strideuv, bs[0][0], chroma_qp[0], a, b, c, chroma_intra_deblock );
                 }
                 else
                 {
                     deblock_edge( h, pixy,           2*stridey,  bs[0][0], luma_qp[0],   a, b, 0, luma_deblock );
                     deblock_edge( h, pixuv,          2*strideuv, bs[0][0], chroma_qp[0], a, b, c, chroma_deblock );
-                    deblock_edge( h, pixuv + uvdiff, 2*strideuv, bs[0][0], chroma_qp[0], a, b, c, chroma_deblock );
+                    if( chroma444 )
+                        deblock_edge( h, pixuv + uvdiff, 2*strideuv, bs[0][0], chroma_qp[0], a, b, c, chroma_deblock );
                 }
 
                 int offy = MB_INTERLACED ? 4 : 0;
@@ -492,13 +490,15 @@ void x264_frame_deblock_row( x264_t *h, int mb_y )
                 {
                     deblock_edge_intra( h, pixy           + (stridey<<offy),   2*stridey,  bs[0][4], luma_qp[1],   a, b, 0, luma_intra_deblock );
                     deblock_edge_intra( h, pixuv          + (strideuv<<offuv), 2*strideuv, bs[0][4], chroma_qp[1], a, b, c, chroma_intra_deblock );
-                    deblock_edge_intra( h, pixuv + uvdiff + (strideuv<<offuv), 2*strideuv, bs[0][4], chroma_qp[1], a, b, c, chroma_intra_deblock );
+                    if( chroma444 )
+                        deblock_edge_intra( h, pixuv + uvdiff + (strideuv<<offuv), 2*strideuv, bs[0][4], chroma_qp[1], a, b, c, chroma_intra_deblock );
                 }
                 else
                 {
                     deblock_edge( h, pixy           + (stridey<<offy),   2*stridey,  bs[0][4], luma_qp[1],   a, b, 0, luma_deblock );
                     deblock_edge( h, pixuv          + (strideuv<<offuv), 2*strideuv, bs[0][4], chroma_qp[1], a, b, c, chroma_deblock );
-                    deblock_edge( h, pixuv + uvdiff + (strideuv<<offuv), 2*strideuv, bs[0][4], chroma_qp[1], a, b, c, chroma_deblock );
+                    if( chroma444 )
+                        deblock_edge( h, pixuv + uvdiff + (strideuv<<offuv), 2*strideuv, bs[0][4], chroma_qp[1], a, b, c, chroma_deblock );
                 }
             }
             else



More information about the x264-devel mailing list