comparison h264_loopfilter.c @ 11033:b5577677b97d libavcodec

get rid of the start variable. a few cycles faster
author michael
date Thu, 28 Jan 2010 01:31:06 +0000
parents 01bd040f8607
children fd5921186064
comparison
equal deleted inserted replaced
11032:01bd040f8607 11033:b5577677b97d
429 const int mask_edge = mask_edge_tab[dir][(mb_type>>3)&7]; 429 const int mask_edge = mask_edge_tab[dir][(mb_type>>3)&7];
430 const int edges = mask_edge== 3 && !(h->cbp&15) ? 1 : 4; 430 const int edges = mask_edge== 3 && !(h->cbp&15) ? 1 : 4;
431 431
432 // how often to recheck mv-based bS when iterating along each edge 432 // how often to recheck mv-based bS when iterating along each edge
433 const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)); 433 const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir));
434 int start = h->slice_table[mbm_xy] == 0xFFFF 434
435 if(!(h->slice_table[mbm_xy] == 0xFFFF
435 || first_vertical_edge_done 436 || first_vertical_edge_done
436 || (h->deblocking_filter==2 && h->slice_table[mbm_xy] != h->slice_num); 437 || (h->deblocking_filter==2 && h->slice_table[mbm_xy] != h->slice_num))){
437 438
438 439 if (FRAME_MBAFF && (dir == 1) && ((mb_y&1) == 0)
439 if (FRAME_MBAFF && (dir == 1) && ((mb_y&1) == 0) && start == 0
440 && IS_INTERLACED(mbm_type&~mb_type) 440 && IS_INTERLACED(mbm_type&~mb_type)
441 ) { 441 ) {
442 // This is a special case in the norm where the filtering must 442 // This is a special case in the norm where the filtering must
443 // be done twice (one each of the field) even if we are in a 443 // be done twice (one each of the field) even if we are in a
444 // frame macroblock. 444 // frame macroblock.
469 filter_mb_edgech( &img_cb[j*uvlinesize], tmp_uvlinesize, bS, 469 filter_mb_edgech( &img_cb[j*uvlinesize], tmp_uvlinesize, bS,
470 ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1, h); 470 ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1, h);
471 filter_mb_edgech( &img_cr[j*uvlinesize], tmp_uvlinesize, bS, 471 filter_mb_edgech( &img_cr[j*uvlinesize], tmp_uvlinesize, bS,
472 ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1, h); 472 ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1, h);
473 } 473 }
474 474 }else{
475 start = 1;
476 }
477
478 /* Calculate bS */
479 if(start==0) {
480 DECLARE_ALIGNED_8(int16_t, bS)[4]; 475 DECLARE_ALIGNED_8(int16_t, bS)[4];
481 int qp; 476 int qp;
482 477
483 if( IS_INTRA(mb_type|mbm_type)) { 478 if( IS_INTRA(mb_type|mbm_type)) {
484 *(uint64_t*)bS= 0x0003000300030003ULL; 479 *(uint64_t*)bS= 0x0003000300030003ULL;
586 filter_mb_edgech( &img_cr[0], uvlinesize, bS, qp, h); 581 filter_mb_edgech( &img_cr[0], uvlinesize, bS, qp, h);
587 } 582 }
588 } 583 }
589 } 584 }
590 } 585 }
586 }
587
591 /* Calculate bS */ 588 /* Calculate bS */
592 for( edge = 1; edge < edges; edge++ ) { 589 for( edge = 1; edge < edges; edge++ ) {
593 DECLARE_ALIGNED_8(int16_t, bS)[4]; 590 DECLARE_ALIGNED_8(int16_t, bS)[4];
594 int qp; 591 int qp;
595 592