1 |
/************************************************************************** |
/***************************************************************************** |
2 |
* |
* |
3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* GMC interpolation module |
* - GMC interpolation module header - |
5 |
|
* |
6 |
|
* Copyright(C) 2002-2003 Pascal Massimino <skal@planet-d.net> |
7 |
* |
* |
8 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
17 |
* |
* |
18 |
* You should have received a copy of the GNU General Public License |
* You should have received a copy of the GNU General Public License |
19 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
|
* |
22 |
|
* $Id: gmc.h,v 1.1.2.3 2003-09-10 22:18:59 edgomez Exp $ |
23 |
* |
* |
24 |
*************************************************************************/ |
****************************************************************************/ |
25 |
|
|
26 |
#include "../portab.h" |
#include "../portab.h" |
27 |
#include "../global.h" |
#include "../global.h" |
28 |
|
|
29 |
/* This is borrowed from decoder.c */ |
/* This is borrowed from decoder.c */ |
30 |
static __inline int gmc_sanitize(int value, int quarterpel, int fcode) |
static __inline int |
31 |
|
gmc_sanitize(int value, int quarterpel, int fcode) |
32 |
{ |
{ |
33 |
int length = 1 << (fcode+4); |
int length = 1 << (fcode+4); |
34 |
|
|
35 |
// if (quarterpel) value *= 2; |
if (quarterpel) value *= 2; |
36 |
|
|
37 |
if (value < -length) |
if (value < -length) |
38 |
return -length; |
return -length; |