# HG changeset patch # User michael # Date 1263956408 0 # Node ID 4c9b8e3065ee82c5dce69d09e1d16aa34c93b14b # Parent c80f0dfbf47d236e23b0cfaacd1fff9656f0bf12 Simplify/Optimize another of the mbaff loop filter cases. Its faster but too rarely used to make a differnce. diff -r c80f0dfbf47d -r 4c9b8e3065ee h264_loopfilter.c --- a/h264_loopfilter.c Wed Jan 20 01:49:24 2010 +0000 +++ b/h264_loopfilter.c Wed Jan 20 03:00:08 2010 +0000 @@ -453,21 +453,18 @@ unsigned int tmp_linesize = 2 * linesize; unsigned int tmp_uvlinesize = 2 * uvlinesize; int mbn_xy = mb_xy - 2 * s->mb_stride; - int qp; - int i, j; - int16_t bS[4]; + int j; for(j=0; j<2; j++, mbn_xy += s->mb_stride){ + int16_t bS[4]; + int qp; if( IS_INTRA(mb_type|s->current_picture.mb_type[mbn_xy]) ) { *(uint64_t*)bS= 0x0003000300030003ULL; } else { - const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy]; + const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy] + 4+3*8; + int i; for( i = 0; i < 4; i++ ) { - if( h->non_zero_count_cache[scan8[0]+i] != 0 || - mbn_nnz[i+4+3*8] != 0 ) - bS[i] = 2; - else - bS[i] = 1; + bS[i] = 1 + !!(h->non_zero_count_cache[scan8[0]+i] | mbn_nnz[i]); } } // Do not use s->qscale as luma quantizer because it has not the same