comparison vc1.c @ 4683:b4dd7005d807 libavcodec

Zero MV vectors for P frame intra blocks
author kostya
date Sun, 18 Mar 2007 18:07:27 +0000
parents b82cff2e2e83
children ea97803884e1
comparison
equal deleted inserted replaced
4682:95875881b85b 4683:b4dd7005d807
1066 int t1 = 0, t2 = 0; 1066 int t1 = 0, t2 = 0;
1067 for(i=0; i<3;i++) if(!intra[i]) {t1 = i; break;} 1067 for(i=0; i<3;i++) if(!intra[i]) {t1 = i; break;}
1068 for(i= t1+1; i<4; i++)if(!intra[i]) {t2 = i; break;} 1068 for(i= t1+1; i<4; i++)if(!intra[i]) {t2 = i; break;}
1069 tx = (mvx[t1] + mvx[t2]) / 2; 1069 tx = (mvx[t1] + mvx[t2]) / 2;
1070 ty = (mvy[t1] + mvy[t2]) / 2; 1070 ty = (mvy[t1] + mvy[t2]) / 2;
1071 } else 1071 } else {
1072 s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
1073 s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
1072 return; //no need to do MC for inter blocks 1074 return; //no need to do MC for inter blocks
1075 }
1073 1076
1074 s->current_picture.motion_val[1][s->block_index[0]][0] = tx; 1077 s->current_picture.motion_val[1][s->block_index[0]][0] = tx;
1075 s->current_picture.motion_val[1][s->block_index[0]][1] = ty; 1078 s->current_picture.motion_val[1][s->block_index[0]][1] = ty;
1076 uvmx = (tx + ((tx&3) == 3)) >> 1; 1079 uvmx = (tx + ((tx&3) == 3)) >> 1;
1077 uvmy = (ty + ((ty&3) == 3)) >> 1; 1080 uvmy = (ty + ((ty&3) == 3)) >> 1;
2002 xy = s->block_index[n]; 2005 xy = s->block_index[n];
2003 2006
2004 if(s->mb_intra){ 2007 if(s->mb_intra){
2005 s->mv[0][n][0] = s->current_picture.motion_val[0][xy][0] = 0; 2008 s->mv[0][n][0] = s->current_picture.motion_val[0][xy][0] = 0;
2006 s->mv[0][n][1] = s->current_picture.motion_val[0][xy][1] = 0; 2009 s->mv[0][n][1] = s->current_picture.motion_val[0][xy][1] = 0;
2010 s->current_picture.motion_val[1][xy][0] = 0;
2011 s->current_picture.motion_val[1][xy][1] = 0;
2007 if(mv1) { /* duplicate motion data for 1-MV block */ 2012 if(mv1) { /* duplicate motion data for 1-MV block */
2008 s->current_picture.motion_val[0][xy + 1][0] = 0; 2013 s->current_picture.motion_val[0][xy + 1][0] = 0;
2009 s->current_picture.motion_val[0][xy + 1][1] = 0; 2014 s->current_picture.motion_val[0][xy + 1][1] = 0;
2010 s->current_picture.motion_val[0][xy + wrap][0] = 0; 2015 s->current_picture.motion_val[0][xy + wrap][0] = 0;
2011 s->current_picture.motion_val[0][xy + wrap][1] = 0; 2016 s->current_picture.motion_val[0][xy + wrap][1] = 0;
2012 s->current_picture.motion_val[0][xy + wrap + 1][0] = 0; 2017 s->current_picture.motion_val[0][xy + wrap + 1][0] = 0;
2013 s->current_picture.motion_val[0][xy + wrap + 1][1] = 0; 2018 s->current_picture.motion_val[0][xy + wrap + 1][1] = 0;
2019 s->current_picture.motion_val[1][xy + 1][0] = 0;
2020 s->current_picture.motion_val[1][xy + 1][1] = 0;
2021 s->current_picture.motion_val[1][xy + wrap][0] = 0;
2022 s->current_picture.motion_val[1][xy + wrap][1] = 0;
2023 s->current_picture.motion_val[1][xy + wrap + 1][0] = 0;
2024 s->current_picture.motion_val[1][xy + wrap + 1][1] = 0;
2014 } 2025 }
2015 return; 2026 return;
2016 } 2027 }
2017 2028
2018 C = s->current_picture.motion_val[0][xy - 1]; 2029 C = s->current_picture.motion_val[0][xy - 1];