const int mb_xy = mb_y * h->mb.i_mb_stride + mb_x;
const int mb_8x8 = 2 * s8x8 * mb_y + 2 * mb_x;
const int mb_4x4 = 4 * s4x4 * mb_y + 4 * mb_x;
- int i_edge;
- int i_dir;
const int b_8x8_transform = h->mb.mb_transform_size[mb_xy];
+ const int i_edge_end = (h->mb.type[mb_xy] == P_SKIP) ? 1 : 4;
+ int i_edge, i_dir;
/* cavlc + 8x8 transform stores nnz per 16 coeffs for the purpose of
* entropy coding, but per 64 coeffs for the purpose of deblocking */
* i_dir == 1 -> horizontal edge */
for( i_dir = 0; i_dir < 2; i_dir++ )
{
- int i_start;
+ int i_start = (i_dir ? mb_y : mb_x) ? 0 : 1;
int i_qp, i_qpn;
- i_start = (( i_dir == 0 && mb_x != 0 ) || ( i_dir == 1 && mb_y != 0 ) ) ? 0 : 1;
-
- for( i_edge = i_start; i_edge < 4; i_edge++ )
+ for( i_edge = i_start; i_edge < i_edge_end; i_edge++ )
{
- int mbn_xy = i_edge > 0 ? mb_xy : ( i_dir == 0 ? mb_xy - 1 : mb_xy - h->mb.i_mb_stride );
- int mbn_8x8 = i_edge > 0 ? mb_8x8 : ( i_dir == 0 ? mb_8x8 - 2 : mb_8x8 - 2 * s8x8 );
- int mbn_4x4 = i_edge > 0 ? mb_4x4 : ( i_dir == 0 ? mb_4x4 - 4 : mb_4x4 - 4 * s4x4 );
-
+ int mbn_xy, mbn_8x8, mbn_4x4;
int bS[4]; /* filtering strength */
+ if( b_8x8_transform && (i_edge&1) )
+ continue;
+
+ mbn_xy = i_edge > 0 ? mb_xy : ( i_dir == 0 ? mb_xy - 1 : mb_xy - h->mb.i_mb_stride );
+ mbn_8x8 = i_edge > 0 ? mb_8x8 : ( i_dir == 0 ? mb_8x8 - 2 : mb_8x8 - 2 * s8x8 );
+ mbn_4x4 = i_edge > 0 ? mb_4x4 : ( i_dir == 0 ? mb_4x4 - 4 : mb_4x4 - 4 * s4x4 );
+
/* *** Get bS for each 4px for the current edge *** */
if( IS_INTRA( h->mb.type[mb_xy] ) || IS_INTRA( h->mb.type[mbn_xy] ) )
{
if( i_dir == 0 )
{
/* vertical edge */
- if( !b_8x8_transform || !(i_edge & 1) )
- {
- deblock_edge( h, &h->fdec->plane[0][16*mb_y * h->fdec->i_stride[0] + 16*mb_x + 4*i_edge],
- h->fdec->i_stride[0], bS, (i_qp+i_qpn+1) >> 1, 0,
- h->loopf.deblock_h_luma, h->loopf.deblock_h_luma_intra );
- }
+ deblock_edge( h, &h->fdec->plane[0][16*mb_y * h->fdec->i_stride[0] + 16*mb_x + 4*i_edge],
+ h->fdec->i_stride[0], bS, (i_qp+i_qpn+1) >> 1, 0,
+ h->loopf.deblock_h_luma, h->loopf.deblock_h_luma_intra );
if( !(i_edge & 1) )
{
/* U/V planes */
else
{
/* horizontal edge */
- if( !b_8x8_transform || !(i_edge & 1) )
- {
- deblock_edge( h, &h->fdec->plane[0][(16*mb_y + 4*i_edge) * h->fdec->i_stride[0] + 16*mb_x],
- h->fdec->i_stride[0], bS, (i_qp+i_qpn+1) >> 1, 0,
- h->loopf.deblock_v_luma, h->loopf.deblock_v_luma_intra );
- }
+ deblock_edge( h, &h->fdec->plane[0][(16*mb_y + 4*i_edge) * h->fdec->i_stride[0] + 16*mb_x],
+ h->fdec->i_stride[0], bS, (i_qp+i_qpn+1) >> 1, 0,
+ h->loopf.deblock_v_luma, h->loopf.deblock_v_luma_intra );
/* U/V planes */
if( !(i_edge & 1) )
{