1 |
#include "../utils/mem_transfer.h" |
2 |
|
3 |
typedef void (INTERPOLATE8X8) (uint8_t * const dst, |
4 |
const uint8_t * const src, |
5 |
const uint32_t stride, |
6 |
const uint32_t rounding); |
7 |
typedef INTERPOLATE8X8 *INTERPOLATE8X8_PTR; |
8 |
|
9 |
extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_h; |
10 |
extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_v; |
11 |
extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_hv; |
12 |
|
13 |
INTERPOLATE8X8 interpolate8x8_halfpel_h_c; |
14 |
INTERPOLATE8X8 interpolate8x8_halfpel_v_c; |
15 |
INTERPOLATE8X8 interpolate8x8_halfpel_hv_c; |
16 |
|
17 |
INTERPOLATE8X8 interpolate8x8_halfpel_h_mmx; |
18 |
INTERPOLATE8X8 interpolate8x8_halfpel_v_mmx; |
19 |
INTERPOLATE8X8 interpolate8x8_halfpel_hv_mmx; |
20 |
|
21 |
INTERPOLATE8X8 interpolate8x8_halfpel_h_xmm; |
22 |
INTERPOLATE8X8 interpolate8x8_halfpel_v_xmm; |
23 |
INTERPOLATE8X8 interpolate8x8_halfpel_hv_xmm; |
24 |
|
25 |
INTERPOLATE8X8 interpolate8x8_halfpel_h_3dn; |
26 |
INTERPOLATE8X8 interpolate8x8_halfpel_v_3dn; |
27 |
INTERPOLATE8X8 interpolate8x8_halfpel_hv_3dn; |
28 |
|
29 |
static __inline void |
30 |
interpolate8x8_switch(uint8_t * const cur, |
31 |
const uint8_t * const refn, |
32 |
const uint32_t x, |
33 |
const uint32_t y, |
34 |
const int32_t dx, |
35 |
const int dy, |
36 |
const uint32_t stride, |
37 |
const uint32_t rounding) |
38 |
{ |
39 |
int32_t ddx, ddy; |
40 |
|
41 |
switch (((dx & 1) << 1) + (dy & 1)) // ((dx%2)?2:0)+((dy%2)?1:0) |
42 |
{ |
43 |
case 0: |
44 |
ddx = dx / 2; |
45 |
ddy = dy / 2; |
46 |
transfer8x8_copy(cur + y * stride + x, |
47 |
refn + (y + ddy) * stride + x + ddx, stride); |
48 |
break; |
49 |
|
50 |
case 1: |
51 |
ddx = dx / 2; |
52 |
ddy = (dy - 1) / 2; |
53 |
interpolate8x8_halfpel_v(cur + y * stride + x, |
54 |
refn + (y + ddy) * stride + x + ddx, stride, |
55 |
rounding); |
56 |
break; |
57 |
|
58 |
case 2: |
59 |
ddx = (dx - 1) / 2; |
60 |
ddy = dy / 2; |
61 |
interpolate8x8_halfpel_h(cur + y * stride + x, |
62 |
refn + (y + ddy) * stride + x + ddx, stride, |
63 |
rounding); |
64 |
break; |
65 |
|
66 |
default: |
67 |
ddx = (dx - 1) / 2; |
68 |
ddy = (dy - 1) / 2; |
69 |
interpolate8x8_halfpel_hv(cur + y * stride + x, |
70 |
refn + (y + ddy) * stride + x + ddx, stride, |
71 |
rounding); |
72 |
break; |
73 |
} |
74 |
} |
75 |
|
76 |
|
77 |
void interpolate8x8_c(uint8_t * const dst, |
78 |
const uint8_t * const src, |
79 |
const uint32_t x, |
80 |
const uint32_t y, |
81 |
const uint32_t stride); |