--- trunk/xvidcore/src/image/image.c 2002/07/19 11:15:21 315 +++ branches/dev-api-3/xvidcore/src/image/image.c 2002/09/08 09:49:55 449 @@ -165,18 +165,18 @@ src = image->y; for (i = 0; i < EDGE_SIZE; i++) { - // if interlacing, edges contain top-most data from each field +/* // if interlacing, edges contain top-most data from each field if (interlacing && (i & 1)) { memset(dst, *(src + edged_width), EDGE_SIZE); memcpy(dst + EDGE_SIZE, src + edged_width, width); memset(dst + edged_width - EDGE_SIZE, *(src + edged_width + width - 1), EDGE_SIZE); - } else { + } else {*/ memset(dst, *src, EDGE_SIZE); memcpy(dst + EDGE_SIZE, src, width); memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), EDGE_SIZE); - } + /*}*/ dst += edged_width; } @@ -189,18 +189,18 @@ src -= edged_width; for (i = 0; i < EDGE_SIZE; i++) { - // if interlacing, edges contain bottom-most data from each field +/* // if interlacing, edges contain bottom-most data from each field if (interlacing && !(i & 1)) { memset(dst, *(src - edged_width), EDGE_SIZE); memcpy(dst + EDGE_SIZE, src - edged_width, width); memset(dst + edged_width - EDGE_SIZE, *(src - edged_width + width - 1), EDGE_SIZE); - } else { + } else {*/ memset(dst, *src, EDGE_SIZE); memcpy(dst + EDGE_SIZE, src, width); memset(dst + edged_width - EDGE_SIZE, *(src + width - 1), EDGE_SIZE); - } + /*}*/ dst += edged_width; } @@ -261,7 +261,8 @@ } } -// bframe encoding requires image-based u,v interpolation + +// image-based y,u,v interpolation void image_interpolate(const IMAGE * refn, IMAGE * refh, @@ -274,12 +275,12 @@ const uint32_t offset = EDGE_SIZE * (edged_width + 1); const uint32_t stride_add = 7 * edged_width; -#ifdef BFRAMES + /* --- u,v-image-based interpolation --- const uint32_t edged_width2 = edged_width / 2; const uint32_t edged_height2 = edged_height / 2; const uint32_t offset2 = EDGE_SIZE2 * (edged_width2 + 1); const uint32_t stride_add2 = 7 * edged_width2; -#endif + */ uint8_t *n_ptr, *h_ptr, *v_ptr, *hv_ptr; uint32_t x, y; @@ -312,7 +313,7 @@ n_ptr += stride_add; } -#ifdef BFRAMES +/* --- u,v-image-based interpolation --- n_ptr = refn->u; h_ptr = refh->u; v_ptr = refv->u; @@ -366,68 +367,7 @@ hv_ptr += stride_add2; n_ptr += stride_add2; } -#endif - - /* - interpolate_halfpel_h( - refh->y - offset, - refn->y - offset, - edged_width, edged_height, - rounding); - - interpolate_halfpel_v( - refv->y - offset, - refn->y - offset, - edged_width, edged_height, - rounding); - - interpolate_halfpel_hv( - refhv->y - offset, - refn->y - offset, - edged_width, edged_height, - rounding); - */ - - /* uv-image-based compensation - offset = EDGE_SIZE2 * (edged_width / 2 + 1); - - interpolate_halfpel_h( - refh->u - offset, - refn->u - offset, - edged_width / 2, edged_height / 2, - rounding); - - interpolate_halfpel_v( - refv->u - offset, - refn->u - offset, - edged_width / 2, edged_height / 2, - rounding); - - interpolate_halfpel_hv( - refhv->u - offset, - refn->u - offset, - edged_width / 2, edged_height / 2, - rounding); - - - interpolate_halfpel_h( - refh->v - offset, - refn->v - offset, - edged_width / 2, edged_height / 2, - rounding); - - interpolate_halfpel_v( - refv->v - offset, - refn->v - offset, - edged_width / 2, edged_height / 2, - rounding); - - interpolate_halfpel_hv( - refhv->v - offset, - refn->v - offset, - edged_width / 2, edged_height / 2, - rounding); - */ +*/ } @@ -751,7 +691,7 @@ if(w > width) w = width; w2 = w >> 1; -void __inline + dY = (uint8_t*)out_frm->y + (mby << 4) * out_frm->stride_y + (mbx << 4); dU = (uint8_t*)out_frm->u + (mby << 3) * out_frm->stride_u + (mbx << 3); dV = (uint8_t*)out_frm->v + (mby << 3) * out_frm->stride_v + (mbx << 3); @@ -761,9 +701,9 @@ for(i = 0 ; i < 16 ; i++) { memcpy(dY,sY,w); - dY = out_frm->y + (mby << 4) * out_frm->stride_y + (mbx << 4); - dU = out_frm->u + (mby << 3) * out_frm->stride_u + (mbx << 3); - dV = out_frm->v + (mby << 3) * out_frm->stride_v + (mbx << 3); + dY += out_frm->stride_y; + sY += std; + } for(i = 0 ; i < 8 ; i++) { memcpy(dU,sU,w2); dU += out_frm->stride_u;