Mercurial > libavcodec.hg
comparison h264_loopfilter.c @ 10949:4c9b8e3065ee libavcodec
Simplify/Optimize another of the mbaff loop filter cases.
Its faster but too rarely used to make a differnce.
author | michael |
---|---|
date | Wed, 20 Jan 2010 03:00:08 +0000 |
parents | c80f0dfbf47d |
children | 4776a56132e1 |
comparison
equal
deleted
inserted
replaced
10948:c80f0dfbf47d | 10949:4c9b8e3065ee |
---|---|
451 // frame macroblock. | 451 // frame macroblock. |
452 // | 452 // |
453 unsigned int tmp_linesize = 2 * linesize; | 453 unsigned int tmp_linesize = 2 * linesize; |
454 unsigned int tmp_uvlinesize = 2 * uvlinesize; | 454 unsigned int tmp_uvlinesize = 2 * uvlinesize; |
455 int mbn_xy = mb_xy - 2 * s->mb_stride; | 455 int mbn_xy = mb_xy - 2 * s->mb_stride; |
456 int qp; | 456 int j; |
457 int i, j; | |
458 int16_t bS[4]; | |
459 | 457 |
460 for(j=0; j<2; j++, mbn_xy += s->mb_stride){ | 458 for(j=0; j<2; j++, mbn_xy += s->mb_stride){ |
459 int16_t bS[4]; | |
460 int qp; | |
461 if( IS_INTRA(mb_type|s->current_picture.mb_type[mbn_xy]) ) { | 461 if( IS_INTRA(mb_type|s->current_picture.mb_type[mbn_xy]) ) { |
462 *(uint64_t*)bS= 0x0003000300030003ULL; | 462 *(uint64_t*)bS= 0x0003000300030003ULL; |
463 } else { | 463 } else { |
464 const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy]; | 464 const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy] + 4+3*8; |
465 int i; | |
465 for( i = 0; i < 4; i++ ) { | 466 for( i = 0; i < 4; i++ ) { |
466 if( h->non_zero_count_cache[scan8[0]+i] != 0 || | 467 bS[i] = 1 + !!(h->non_zero_count_cache[scan8[0]+i] | mbn_nnz[i]); |
467 mbn_nnz[i+4+3*8] != 0 ) | |
468 bS[i] = 2; | |
469 else | |
470 bS[i] = 1; | |
471 } | 468 } |
472 } | 469 } |
473 // Do not use s->qscale as luma quantizer because it has not the same | 470 // Do not use s->qscale as luma quantizer because it has not the same |
474 // value in IPCM macroblocks. | 471 // value in IPCM macroblocks. |
475 qp = ( s->current_picture.qscale_table[mb_xy] + s->current_picture.qscale_table[mbn_xy] + 1 ) >> 1; | 472 qp = ( s->current_picture.qscale_table[mb_xy] + s->current_picture.qscale_table[mbn_xy] + 1 ) >> 1; |