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$ |
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; |
71 |
*/ |
*/ |
72 |
/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ |
/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ |
73 |
|
|
|
|
|
|
|
|
|
|
|
74 |
#define RDIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) |
#define RDIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) |
75 |
#define RSHIFT(a,b) ( (a)>0 ? ((a) + (1<<((b)-1)))>>(b) : ((a) + (1<<((b)-1))-1)>>(b)) |
#define RSHIFT(a,b) ( (a)>0 ? ((a) + (1<<((b)-1)))>>(b) : ((a) + (1<<((b)-1))-1)>>(b)) |
76 |
|
|
97 |
uint8_t *vDst, const uint8_t *vSrc, |
uint8_t *vDst, const uint8_t *vSrc, |
98 |
int dststride, int srcstride, int x, int y, int rounding); |
int dststride, int srcstride, int x, int y, int rounding); |
99 |
|
|
100 |
void get_average_mv_C(NEW_GMC_DATA *Dsp, VECTOR * const mv, |
void get_average_mv_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv, |
101 |
int x, int y, int qpel); |
int x, int y, int qpel); |
102 |
|
|
103 |
/* ************************************************************ */ |
/* ************************************************************ */ |
112 |
uint8_t *vDst, const uint8_t *vSrc, |
uint8_t *vDst, const uint8_t *vSrc, |
113 |
int dststride, int srcstride, int x, int y, int rounding); |
int dststride, int srcstride, int x, int y, int rounding); |
114 |
|
|
115 |
void get_average_mv_1pt_C(NEW_GMC_DATA *Dsp, VECTOR * const mv, |
void get_average_mv_1pt_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv, |
116 |
int x, int y, int qpel); |
int x, int y, int qpel); |
117 |
|
|
118 |
/* ************************************************************* */ |
/* ************************************************************* */ |