From: Jason Garrett-Glaser Date: Wed, 30 Nov 2011 21:02:12 +0000 (-0800) Subject: Modify MBAFF chroma deblock functions to handle U/V at the same time X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=0637cd67cb245fce5ba190fa4b9c341319ea2b37;p=x264.git Modify MBAFF chroma deblock functions to handle U/V at the same time Allows for more convenient asm implementations. --- diff --git a/common/deblock.c b/common/deblock.c index 2ae5f75c..d52d53c3 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<