35 |
// of pixel 0,0), not the macroblock one. |
// of pixel 0,0), not the macroblock one. |
36 |
// Conversely, *dst is the macroblock top-left adress. |
// Conversely, *dst is the macroblock top-left adress. |
37 |
|
|
|
|
|
38 |
void Predict_16x16_C(const NEW_GMC_DATA * const This, |
void Predict_16x16_C(const NEW_GMC_DATA * const This, |
39 |
uint8_t *dst, const uint8_t *src, |
uint8_t *dst, const uint8_t *src, |
40 |
int dststride, int srcstride, int x, int y, int rounding) |
int dststride, int srcstride, int x, int y, int rounding) |
55 |
int i, j; |
int i, j; |
56 |
|
|
57 |
dst += 16; |
dst += 16; |
58 |
for (j=16; j>0; --j) |
for (j=16; j>0; --j) { |
|
{ |
|
59 |
int U = Uo, V = Vo; |
int U = Uo, V = Vo; |
60 |
Uo += dUy; Vo += dVy; |
Uo += dUy; Vo += dVy; |
61 |
for (i=-16; i<0; ++i) |
for (i=-16; i<0; ++i) { |
62 |
{ |
unsigned int f0, f1, ri = 16, rj = 16; |
|
unsigned int f0, f1, ri, rj; |
|
63 |
int Offset; |
int Offset; |
|
|
|
64 |
int u = ( U >> 16 ) << rho; |
int u = ( U >> 16 ) << rho; |
65 |
int v = ( V >> 16 ) << rho; |
int v = ( V >> 16 ) << rho; |
66 |
|
|
67 |
U += dUx; V += dVx; |
U += dUx; V += dVx; |
68 |
|
|
69 |
ri = 16; |
if (u > 0 && u <= W) { ri = MTab[u&15]; Offset = u>>4; } |
|
if ((uint32_t)u<=(uint32_t)W) { ri = MTab[u&15]; Offset = u>>4; } |
|
70 |
else if (u>W) Offset = W>>4; |
else if (u>W) Offset = W>>4; |
71 |
else Offset = -1; |
else Offset = -1; |
72 |
|
|
73 |
rj = 16; |
if (v > 0 && v <= H) { rj = MTab[v&15]; Offset += (v>>4)*srcstride; } |
|
if ((uint32_t)v<=(uint32_t)H) { rj = MTab[v&15]; Offset += (v>>4)*srcstride; } |
|
74 |
else if (v>H) Offset += (H>>4)*srcstride; |
else if (v>H) Offset += (H>>4)*srcstride; |
75 |
else Offset -= srcstride; |
else Offset -= srcstride; |
76 |
|
|
89 |
} |
} |
90 |
} |
} |
91 |
|
|
|
|
|
92 |
void Predict_8x8_C(const NEW_GMC_DATA * const This, |
void Predict_8x8_C(const NEW_GMC_DATA * const This, |
93 |
uint8_t *uDst, const uint8_t *uSrc, |
uint8_t *uDst, const uint8_t *uSrc, |
94 |
uint8_t *vDst, const uint8_t *vSrc, |
uint8_t *vDst, const uint8_t *vSrc, |
111 |
|
|
112 |
uDst += 8; |
uDst += 8; |
113 |
vDst += 8; |
vDst += 8; |
114 |
for (j=8; j>0; --j) |
for (j=8; j>0; --j) { |
|
{ |
|
115 |
int32_t U = Uo, V = Vo; |
int32_t U = Uo, V = Vo; |
116 |
Uo += dUy; Vo += dVy; |
Uo += dUy; Vo += dVy; |
117 |
|
|
118 |
for (i=-8; i<0; ++i) |
for (i=-8; i<0; ++i) { |
|
{ |
|
119 |
int Offset; |
int Offset; |
120 |
uint32_t f0, f1, ri, rj; |
uint32_t f0, f1, ri, rj; |
121 |
int32_t u, v; |
int32_t u, v; |
124 |
v = ( V >> 16 ) << rho; |
v = ( V >> 16 ) << rho; |
125 |
U += dUx; V += dVx; |
U += dUx; V += dVx; |
126 |
|
|
127 |
if ((uint32_t)u<=(uint32_t)W) { |
if (u > 0 && u <= W) { |
128 |
ri = MTab[u&15]; |
ri = MTab[u&15]; |
129 |
Offset = u>>4; |
Offset = u>>4; |
130 |
} |
} else { |
|
else { |
|
131 |
ri = 16; |
ri = 16; |
132 |
if (u>W) Offset = W>>4; |
if (u>W) Offset = W>>4; |
133 |
else Offset = -1; |
else Offset = -1; |
134 |
} |
} |
135 |
if ((uint32_t)v<=(uint32_t)H) { |
|
136 |
|
if (v > 0 && v <= H) { |
137 |
rj = MTab[v&15]; |
rj = MTab[v&15]; |
138 |
Offset += (v>>4)*srcstride; |
Offset += (v>>4)*srcstride; |
139 |
} |
} else { |
|
else { |
|
140 |
rj = 16; |
rj = 16; |
141 |
if (v>H) Offset += (H>>4)*srcstride; |
if (v>H) Offset += (H>>4)*srcstride; |
142 |
else Offset -= srcstride; |
else Offset -= srcstride; |
169 |
} |
} |
170 |
} |
} |
171 |
|
|
|
|
|
172 |
void get_average_mv_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv, |
void get_average_mv_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv, |
173 |
int x, int y, int qpel) |
int x, int y, int qpel) |
174 |
{ |
{ |
198 |
////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////// |
199 |
// simplified version for 1 warp point |
// simplified version for 1 warp point |
200 |
|
|
|
|
|
201 |
void Predict_1pt_16x16_C(const NEW_GMC_DATA * const This, |
void Predict_1pt_16x16_C(const NEW_GMC_DATA * const This, |
202 |
uint8_t *Dst, const uint8_t *Src, |
uint8_t *Dst, const uint8_t *Src, |
203 |
int dststride, int srcstride, int x, int y, int rounding) |
int dststride, int srcstride, int x, int y, int rounding) |
243 |
} |
} |
244 |
} |
} |
245 |
|
|
|
|
|
246 |
void Predict_1pt_8x8_C(const NEW_GMC_DATA * const This, |
void Predict_1pt_8x8_C(const NEW_GMC_DATA * const This, |
247 |
uint8_t *uDst, const uint8_t *uSrc, |
uint8_t *uDst, const uint8_t *uSrc, |
248 |
uint8_t *vDst, const uint8_t *vSrc, |
uint8_t *vDst, const uint8_t *vSrc, |
299 |
} |
} |
300 |
} |
} |
301 |
|
|
|
|
|
302 |
void get_average_mv_1pt_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv, |
void get_average_mv_1pt_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv, |
303 |
int x, int y, int qpel) |
int x, int y, int qpel) |
304 |
{ |
{ |
405 |
|
|
406 |
////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////// |
407 |
|
|
|
|
|
408 |
/* quick and dirty routine to generate the full warped image (pGMC != NULL) |
/* quick and dirty routine to generate the full warped image (pGMC != NULL) |
409 |
or just all average Motion Vectors (pGMC == NULL) */ |
or just all average Motion Vectors (pGMC == NULL) */ |
410 |
|
|