26 |
* along with this program; if not, write to the xvid_free Software |
* along with this program; if not, write to the xvid_free Software |
27 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
28 |
* |
* |
29 |
* $Id: mbprediction.h,v 1.6 2002-05-03 00:45:10 chenm001 Exp $ |
* $Id: mbprediction.h,v 1.7 2002-05-07 19:40:36 chl Exp $ |
30 |
* |
* |
31 |
*************************************************************************/ |
*************************************************************************/ |
32 |
|
|
214 |
if ((x == 0) && (block == 0)) // first column, first block |
if ((x == 0) && (block == 0)) // first column, first block |
215 |
{ |
{ |
216 |
pmv[0] = pmv[1] = pmv[2] = pmv[3] = zeroMV; |
pmv[0] = pmv[1] = pmv[2] = pmv[3] = zeroMV; |
217 |
psad[0] = psad[1] = psad[2] = psad[3] = MV_MAX_ERROR; |
psad[0] = psad[1] = psad[2] = psad[3] = 0; |
218 |
return 0; |
return 0; |
219 |
} |
} |
220 |
if (block == 1) // second block; has only a left neighbour |
if (block == 1) // second block; has only a left neighbour |
222 |
pmv[0] = pmv[1] = pMBs[index].mvs[0]; |
pmv[0] = pmv[1] = pMBs[index].mvs[0]; |
223 |
pmv[2] = pmv[3] = zeroMV; |
pmv[2] = pmv[3] = zeroMV; |
224 |
psad[0] = psad[1] = pMBs[index].sad8[0]; |
psad[0] = psad[1] = pMBs[index].sad8[0]; |
225 |
psad[2] = psad[3] = MV_MAX_ERROR; |
psad[2] = psad[3] = 0; |
226 |
return 0; |
return 0; |
227 |
} |
} |
228 |
else /* block==0, but x!=0, so again, there is a left neighbour*/ |
else /* block==0, but x!=0, so again, there is a left neighbour*/ |
230 |
pmv[0] = pmv[1] = pMBs[index-1].mvs[1]; |
pmv[0] = pmv[1] = pMBs[index-1].mvs[1]; |
231 |
pmv[2] = pmv[3] = zeroMV; |
pmv[2] = pmv[3] = zeroMV; |
232 |
psad[0] = psad[1] = pMBs[index-1].sad8[1]; |
psad[0] = psad[1] = pMBs[index-1].sad8[1]; |
233 |
psad[2] = psad[3] = MV_MAX_ERROR; |
psad[2] = psad[3] = 0; |
234 |
return 0; |
return 0; |
235 |
} |
} |
236 |
} |
} |
306 |
} |
} |
307 |
|
|
308 |
if ( (MVequal(pmv[1],pmv[2])) && (MVequal(pmv[1],pmv[3])) ) |
if ( (MVequal(pmv[1],pmv[2])) && (MVequal(pmv[1],pmv[3])) ) |
309 |
{ pmv[0]=pmv[1]; |
{ |
310 |
psad[0]=psad[1]; |
pmv[0]=pmv[1]; |
311 |
|
psad[0]=MIN(MIN(psad[1],psad[2]),psad[3]); |
312 |
return 1; |
return 1; |
313 |
} |
} |
314 |
|
|