comparison h264.c @ 7348:39e5cadcebab libavcodec

3rd try to get the loop filter ref/mv check working correctly. Fixes at least: src19td.IBP.264 CVWP3_TOSHIBA_E.264 cvmp_mot_picaff0_full_B.26l CVMP_MOT_FRM_L31_B.26l cvmp_mot_frm0_full_B.26l CVMP_MOT_FLD_L30_B.26l cvmp_mot_fld0_full_B.26l
author michael
date Tue, 22 Jul 2008 17:44:36 +0000
parents 612a78c3b128
children ee0fa5935e1a
comparison
equal deleted inserted replaced
7347:612a78c3b128 7348:39e5cadcebab
6729 } 6729 }
6730 else if( mask_par0 && (edge || (mbn_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)))) ) { 6730 else if( mask_par0 && (edge || (mbn_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)))) ) {
6731 int b_idx= 8 + 4 + edge * (dir ? 8:1); 6731 int b_idx= 8 + 4 + edge * (dir ? 8:1);
6732 int bn_idx= b_idx - (dir ? 8:1); 6732 int bn_idx= b_idx - (dir ? 8:1);
6733 int v = 0; 6733 int v = 0;
6734 int xn= h->slice_type_nos == FF_B_TYPE && ref2frm[0][h->ref_cache[0][b_idx]+2] != ref2frmn[0][h->ref_cache[0][bn_idx]+2];
6735 6734
6736 for( l = 0; !v && l < 1 + (h->slice_type_nos == FF_B_TYPE); l++ ) { 6735 for( l = 0; !v && l < 1 + (h->slice_type_nos == FF_B_TYPE); l++ ) {
6737 int ln= l^xn; 6736 v |= ref2frm[l][h->ref_cache[l][b_idx]+2] != ref2frmn[l][h->ref_cache[l][bn_idx]+2] ||
6738 v |= ref2frm[l][h->ref_cache[l][b_idx]+2] != ref2frmn[ln][h->ref_cache[ln][bn_idx]+2] || 6737 FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] ) >= 4 ||
6739 FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[ln][bn_idx][0] ) >= 4 || 6738 FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit;
6740 FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[ln][bn_idx][1] ) >= mvy_limit;
6741 } 6739 }
6740
6741 if(h->slice_type_nos == FF_B_TYPE && v){
6742 v=0;
6743 for( l = 0; !v && l < 2; l++ ) {
6744 int ln= 1-l;
6745 v |= ref2frm[l][h->ref_cache[l][b_idx]+2] != ref2frmn[ln][h->ref_cache[ln][bn_idx]+2] ||
6746 FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[ln][bn_idx][0] ) >= 4 ||
6747 FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[ln][bn_idx][1] ) >= mvy_limit;
6748 }
6749 }
6750
6742 bS[0] = bS[1] = bS[2] = bS[3] = v; 6751 bS[0] = bS[1] = bS[2] = bS[3] = v;
6743 mv_done = 1; 6752 mv_done = 1;
6744 } 6753 }
6745 else 6754 else
6746 mv_done = 0; 6755 mv_done = 0;
6755 h->non_zero_count_cache[bn_idx] != 0 ) { 6764 h->non_zero_count_cache[bn_idx] != 0 ) {
6756 bS[i] = 2; 6765 bS[i] = 2;
6757 } 6766 }
6758 else if(!mv_done) 6767 else if(!mv_done)
6759 { 6768 {
6760 int xn= h->slice_type_nos == FF_B_TYPE && ref2frm[0][h->ref_cache[0][b_idx]+2] != ref2frmn[0][h->ref_cache[0][bn_idx]+2];
6761 bS[i] = 0; 6769 bS[i] = 0;
6762 for( l = 0; l < 1 + (h->slice_type_nos == FF_B_TYPE); l++ ) { 6770 for( l = 0; l < 1 + (h->slice_type_nos == FF_B_TYPE); l++ ) {
6763 int ln= l^xn; 6771 if( ref2frm[l][h->ref_cache[l][b_idx]+2] != ref2frmn[l][h->ref_cache[l][bn_idx]+2] ||
6764 if( ref2frm[l][h->ref_cache[l][b_idx]+2] != ref2frmn[ln][h->ref_cache[ln][bn_idx]+2] || 6772 FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] ) >= 4 ||
6765 FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[ln][bn_idx][0] ) >= 4 || 6773 FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit ) {
6766 FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[ln][bn_idx][1] ) >= mvy_limit ) {
6767 bS[i] = 1; 6774 bS[i] = 1;
6768 break; 6775 break;
6776 }
6777 }
6778
6779 if(h->slice_type_nos == FF_B_TYPE && bS[i]){
6780 bS[i] = 0;
6781 for( l = 0; l < 2; l++ ) {
6782 int ln= 1-l;
6783 if( ref2frm[l][h->ref_cache[l][b_idx]+2] != ref2frmn[ln][h->ref_cache[ln][bn_idx]+2] ||
6784 FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[ln][bn_idx][0] ) >= 4 ||
6785 FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[ln][bn_idx][1] ) >= mvy_limit ) {
6786 bS[i] = 1;
6787 break;
6788 }
6769 } 6789 }
6770 } 6790 }
6771 } 6791 }
6772 } 6792 }
6773 6793