20 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: motion_comp.c,v 1.18.2.8 2003-08-22 15:52:35 Isibaar Exp $ |
* $Id: motion_comp.c,v 1.18.2.9 2003-09-10 22:19:00 edgomez Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
66 |
#endif |
#endif |
67 |
} |
} |
68 |
|
|
69 |
|
/* |
70 |
|
* getref: calculate reference image pointer |
71 |
|
* the decision to use interpolation h/v/hv or the normal image is |
72 |
|
* based on dx & dy. |
73 |
|
*/ |
74 |
|
|
75 |
|
static __inline const uint8_t * |
76 |
|
get_ref(const uint8_t * const refn, |
77 |
|
const uint8_t * const refh, |
78 |
|
const uint8_t * const refv, |
79 |
|
const uint8_t * const refhv, |
80 |
|
const uint32_t x, |
81 |
|
const uint32_t y, |
82 |
|
const uint32_t block, |
83 |
|
const int32_t dx, |
84 |
|
const int32_t dy, |
85 |
|
const int32_t stride) |
86 |
|
{ |
87 |
|
switch (((dx & 1) << 1) + (dy & 1)) { |
88 |
|
case 0: |
89 |
|
return refn + (int) ((x * block + dx / 2) + (y * block + dy / 2) * stride); |
90 |
|
case 1: |
91 |
|
return refv + (int) ((x * block + dx / 2) + (y * block + (dy - 1) / 2) * stride); |
92 |
|
case 2: |
93 |
|
return refh + (int) ((x * block + (dx - 1) / 2) + (y * block + dy / 2) * stride); |
94 |
|
default: |
95 |
|
return refhv + (int) ((x * block + (dx - 1) / 2) + (y * block + (dy - 1) / 2) * stride); |
96 |
|
} |
97 |
|
} |
98 |
|
|
99 |
static __inline void |
static __inline void |
100 |
compensate16x16_interpolate(int16_t * const dct_codes, |
compensate16x16_interpolate(int16_t * const dct_codes, |