3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* image stuff |
* image stuff |
5 |
* |
* |
6 |
|
* This program is an implementation of a part of one or more MPEG-4 |
7 |
|
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
8 |
|
* to use this software module in hardware or software products are |
9 |
|
* advised that its use may infringe existing patents or copyrights, and |
10 |
|
* any such use would be at such party's own risk. The original |
11 |
|
* developer of this software module and his/her company, and subsequent |
12 |
|
* editors and their companies, will have no liability for use of this |
13 |
|
* software or modifications or derivatives thereof. |
14 |
|
* |
15 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
16 |
* 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 |
* the Free Software Foundation; either version 2 of the License, or |
* the Free Software Foundation; either version 2 of the License, or |
174 |
src = image->y; |
src = image->y; |
175 |
|
|
176 |
for (i = 0; i < EDGE_SIZE; i++) { |
for (i = 0; i < EDGE_SIZE; i++) { |
177 |
/* // if interlacing, edges contain top-most data from each field |
// if interlacing, edges contain top-most data from each field |
178 |
if (interlacing && (i & 1)) { |
if (interlacing && (i & 1)) { |
179 |
memset(dst, *(src + edged_width), EDGE_SIZE); |
memset(dst, *(src + edged_width), EDGE_SIZE); |
180 |
memcpy(dst + EDGE_SIZE, src + edged_width, width); |
memcpy(dst + EDGE_SIZE, src + edged_width, width); |
181 |
memset(dst + edged_width - EDGE_SIZE, |
memset(dst + edged_width - EDGE_SIZE, |
182 |
*(src + edged_width + width - 1), EDGE_SIZE); |
*(src + edged_width + width - 1), EDGE_SIZE); |
183 |
} else {*/ |
} else { |
184 |
memset(dst, *src, EDGE_SIZE); |
memset(dst, *src, EDGE_SIZE); |
185 |
memcpy(dst + EDGE_SIZE, src, width); |
memcpy(dst + EDGE_SIZE, src, width); |
186 |
memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), |
memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), |
187 |
EDGE_SIZE); |
EDGE_SIZE); |
188 |
/*}*/ |
} |
189 |
dst += edged_width; |
dst += edged_width; |
190 |
} |
} |
191 |
|
|
198 |
|
|
199 |
src -= edged_width; |
src -= edged_width; |
200 |
for (i = 0; i < EDGE_SIZE; i++) { |
for (i = 0; i < EDGE_SIZE; i++) { |
201 |
/* // if interlacing, edges contain bottom-most data from each field |
// if interlacing, edges contain bottom-most data from each field |
202 |
if (interlacing && !(i & 1)) { |
if (interlacing && !(i & 1)) { |
203 |
memset(dst, *(src - edged_width), EDGE_SIZE); |
memset(dst, *(src - edged_width), EDGE_SIZE); |
204 |
memcpy(dst + EDGE_SIZE, src - edged_width, width); |
memcpy(dst + EDGE_SIZE, src - edged_width, width); |
205 |
memset(dst + edged_width - EDGE_SIZE, |
memset(dst + edged_width - EDGE_SIZE, |
206 |
*(src - edged_width + width - 1), EDGE_SIZE); |
*(src - edged_width + width - 1), EDGE_SIZE); |
207 |
} else {*/ |
} else { |
208 |
memset(dst, *src, EDGE_SIZE); |
memset(dst, *src, EDGE_SIZE); |
209 |
memcpy(dst + EDGE_SIZE, src, width); |
memcpy(dst + EDGE_SIZE, src, width); |
210 |
memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), |
memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), |
211 |
EDGE_SIZE); |
EDGE_SIZE); |
212 |
/*}*/ |
} |
213 |
dst += edged_width; |
dst += edged_width; |
214 |
} |
} |
215 |
|
|
304 |
v_ptr -= offset; |
v_ptr -= offset; |
305 |
hv_ptr -= offset; |
hv_ptr -= offset; |
306 |
|
|
307 |
for (y = 0; y < edged_height; y = y + 8) { |
for (y = 0; y < edged_height; y += 8) { |
308 |
for (x = 0; x < edged_width; x = x + 8) { |
for (x = 0; x < edged_width; x += 8) { |
309 |
interpolate8x8_halfpel_h(h_ptr, n_ptr, edged_width, rounding); |
interpolate8x8_halfpel_h(h_ptr, n_ptr, edged_width, rounding); |
310 |
interpolate8x8_halfpel_v(v_ptr, n_ptr, edged_width, rounding); |
interpolate8x8_halfpel_v(v_ptr, n_ptr, edged_width, rounding); |
311 |
interpolate8x8_halfpel_hv(hv_ptr, n_ptr, edged_width, rounding); |
interpolate8x8_halfpel_hv(hv_ptr, n_ptr, edged_width, rounding); |
320 |
hv_ptr += stride_add; |
hv_ptr += stride_add; |
321 |
n_ptr += stride_add; |
n_ptr += stride_add; |
322 |
} |
} |
323 |
|
/* |
324 |
#ifdef BFRAMES |
#ifdef BFRAMES |
325 |
n_ptr = refn->u; |
n_ptr = refn->u; |
326 |
h_ptr = refh->u; |
h_ptr = refh->u; |
332 |
v_ptr -= offset2; |
v_ptr -= offset2; |
333 |
hv_ptr -= offset2; |
hv_ptr -= offset2; |
334 |
|
|
335 |
for (y = 0; y < edged_height2; y = y + 8) { |
for (y = 0; y < edged_height2; y += 8) { |
336 |
for (x = 0; x < edged_width2; x = x + 8) { |
for (x = 0; x < edged_width2; x += 8) { |
337 |
interpolate8x8_halfpel_h(h_ptr, n_ptr, edged_width2, rounding); |
interpolate8x8_halfpel_h(h_ptr, n_ptr, edged_width2, rounding); |
338 |
interpolate8x8_halfpel_v(v_ptr, n_ptr, edged_width2, rounding); |
interpolate8x8_halfpel_v(v_ptr, n_ptr, edged_width2, rounding); |
339 |
interpolate8x8_halfpel_hv(hv_ptr, n_ptr, edged_width2, rounding); |
interpolate8x8_halfpel_hv(hv_ptr, n_ptr, edged_width2, rounding); |
376 |
n_ptr += stride_add2; |
n_ptr += stride_add2; |
377 |
} |
} |
378 |
#endif |
#endif |
379 |
|
*/ |
380 |
/* |
/* |
381 |
interpolate_halfpel_h( |
interpolate_halfpel_h( |
382 |
refh->y - offset, |
refh->y - offset, |