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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: image.c,v 1.33 2005-12-17 11:24:32 syskin Exp $ |
* $Id: image.c,v 1.34 2005-12-17 12:04:52 syskin Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
236 |
} |
} |
237 |
} |
} |
238 |
|
|
|
/* bframe encoding requires image-based u,v interpolation */ |
|
239 |
void |
void |
240 |
image_interpolate(const IMAGE * refn, |
image_interpolate(const uint8_t * refn, |
241 |
IMAGE * refh, |
uint8_t * refh, |
242 |
IMAGE * refv, |
uint8_t * refv, |
243 |
IMAGE * refhv, |
uint8_t * refhv, |
244 |
uint32_t edged_width, |
uint32_t edged_width, |
245 |
uint32_t edged_height, |
uint32_t edged_height, |
246 |
uint32_t quarterpel, |
uint32_t quarterpel, |
249 |
const uint32_t offset = EDGE_SIZE2 * (edged_width + 1); /* we only interpolate half of the edge area */ |
const uint32_t offset = EDGE_SIZE2 * (edged_width + 1); /* we only interpolate half of the edge area */ |
250 |
const uint32_t stride_add = 7 * edged_width; |
const uint32_t stride_add = 7 * edged_width; |
251 |
|
|
252 |
uint8_t *n_ptr, *h_ptr, *v_ptr, *hv_ptr; |
uint8_t *n_ptr; |
253 |
|
uint8_t *h_ptr, *v_ptr, *hv_ptr; |
254 |
uint32_t x, y; |
uint32_t x, y; |
255 |
|
|
256 |
|
n_ptr = (uint8_t*)refn; |
257 |
n_ptr = refn->y; |
h_ptr = refh; |
258 |
h_ptr = refh->y; |
v_ptr = refhv; |
|
v_ptr = refv->y; |
|
259 |
|
|
260 |
n_ptr -= offset; |
n_ptr -= offset; |
261 |
h_ptr -= offset; |
h_ptr -= offset; |
284 |
n_ptr += stride_add; |
n_ptr += stride_add; |
285 |
} |
} |
286 |
|
|
287 |
h_ptr = refh->y + (edged_height - EDGE_SIZE - EDGE_SIZE2)*edged_width - EDGE_SIZE2; |
h_ptr = refh + (edged_height - EDGE_SIZE - EDGE_SIZE2)*edged_width - EDGE_SIZE2; |
288 |
hv_ptr = refhv->y + (edged_height - EDGE_SIZE - EDGE_SIZE2)*edged_width - EDGE_SIZE2; |
hv_ptr = refhv + (edged_height - EDGE_SIZE - EDGE_SIZE2)*edged_width - EDGE_SIZE2; |
289 |
|
|
290 |
for (y = 0; y < (edged_height - EDGE_SIZE); y = y + 8) { |
for (y = 0; y < (edged_height - EDGE_SIZE); y = y + 8) { |
291 |
hv_ptr -= stride_add; |
hv_ptr -= stride_add; |
301 |
} |
} |
302 |
} else { |
} else { |
303 |
|
|
304 |
hv_ptr = refhv->y; |
hv_ptr = refhv; |
305 |
hv_ptr -= offset; |
hv_ptr -= offset; |
306 |
|
|
307 |
for (y = 0; y < (edged_height - EDGE_SIZE); y += 8) { |
for (y = 0; y < (edged_height - EDGE_SIZE); y += 8) { |