comparison h264_loopfilter.c @ 10914:edd918a4c0b8 libavcodec

Move CAVLC 8x8 DCT special case from ff_h264_filter_mb() to fill_caches that way it is also available for ff_h264_filter_mb_fast().
author michael
date Mon, 18 Jan 2010 13:09:53 +0000
parents 497929e9d912
children f36f33e673b4
comparison
equal deleted inserted replaced
10913:497929e9d912 10914:edd918a4c0b8
646 const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4; 646 const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;
647 int first_vertical_edge_done = 0; 647 int first_vertical_edge_done = 0;
648 av_unused int dir; 648 av_unused int dir;
649 int list; 649 int list;
650 650
651 // CAVLC 8x8dct requires NNZ values for residual decoding that differ from what the loop filter needs
652 if(!h->pps.cabac && h->pps.transform_8x8_mode){
653 int top_type, left_type[2];
654 top_type = s->current_picture.mb_type[h->top_mb_xy] ;
655 left_type[0] = s->current_picture.mb_type[h->left_mb_xy[0]];
656 left_type[1] = s->current_picture.mb_type[h->left_mb_xy[1]];
657
658 if(IS_8x8DCT(top_type)){
659 h->non_zero_count_cache[4+8*0]=
660 h->non_zero_count_cache[5+8*0]= h->cbp_table[h->top_mb_xy] & 4;
661 h->non_zero_count_cache[6+8*0]=
662 h->non_zero_count_cache[7+8*0]= h->cbp_table[h->top_mb_xy] & 8;
663 }
664 if(IS_8x8DCT(left_type[0])){
665 h->non_zero_count_cache[3+8*1]=
666 h->non_zero_count_cache[3+8*2]= h->cbp_table[h->left_mb_xy[0]]&2; //FIXME check MBAFF
667 }
668 if(IS_8x8DCT(left_type[1])){
669 h->non_zero_count_cache[3+8*3]=
670 h->non_zero_count_cache[3+8*4]= h->cbp_table[h->left_mb_xy[1]]&8; //FIXME check MBAFF
671 }
672
673 if(IS_8x8DCT(mb_type)){
674 h->non_zero_count_cache[scan8[0 ]]= h->non_zero_count_cache[scan8[1 ]]=
675 h->non_zero_count_cache[scan8[2 ]]= h->non_zero_count_cache[scan8[3 ]]= h->cbp_table[mb_xy] & 1;
676
677 h->non_zero_count_cache[scan8[0+ 4]]= h->non_zero_count_cache[scan8[1+ 4]]=
678 h->non_zero_count_cache[scan8[2+ 4]]= h->non_zero_count_cache[scan8[3+ 4]]= h->cbp_table[mb_xy] & 2;
679
680 h->non_zero_count_cache[scan8[0+ 8]]= h->non_zero_count_cache[scan8[1+ 8]]=
681 h->non_zero_count_cache[scan8[2+ 8]]= h->non_zero_count_cache[scan8[3+ 8]]= h->cbp_table[mb_xy] & 4;
682
683 h->non_zero_count_cache[scan8[0+12]]= h->non_zero_count_cache[scan8[1+12]]=
684 h->non_zero_count_cache[scan8[2+12]]= h->non_zero_count_cache[scan8[3+12]]= h->cbp_table[mb_xy] & 8;
685 }
686 }
687
688 if (FRAME_MBAFF 651 if (FRAME_MBAFF
689 // left mb is in picture 652 // left mb is in picture
690 && h->slice_table[mb_xy-1] != 0xFFFF 653 && h->slice_table[mb_xy-1] != 0xFFFF
691 // and current and left pair do not have the same interlaced type 654 // and current and left pair do not have the same interlaced type
692 && (IS_INTERLACED(mb_type) != IS_INTERLACED(s->current_picture.mb_type[mb_xy-1])) 655 && (IS_INTERLACED(mb_type) != IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]))