From 9f61a83bf9201be73083dd09fbb67f93955f4ac2 Mon Sep 17 00:00:00 2001 From: Fritz Koenig Date: Fri, 29 Oct 2010 17:09:33 -0700 Subject: [PATCH] postproc : Added SPLITMV visualization, fix line constrain. Now draw 16 vectors for SPLITMV mode. Fixed constrain line to block divide by zero issues. Blend block was not centering the shaded area correctly. Change-Id: I1edabd8b4e553aac8d980f7b45c80159e9202434 --- vp8/common/postproc.c | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c index 6f41943..d7044fd 100644 --- a/vp8/common/postproc.c +++ b/vp8/common/postproc.c @@ -484,7 +484,7 @@ void vp8_blend_mb_c (unsigned char *y, unsigned char *u, unsigned char *v, int u1_const = u1*((1<<16)-alpha); int v1_const = v1*((1<<16)-alpha); - y += stride + 2; + y += stride + 1; for (i = 0; i < 14; i++) { for (j = 0; j < 14; j++) @@ -522,7 +522,7 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei dy = *y1 - y0; *x1 = width; - if (dy) + if (dx) *y1 = ((width-x0)*dy)/dx + y0; } if (*x1 < 0) @@ -531,7 +531,7 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei dy = *y1 - y0; *x1 = 0; - if (dy) + if (dx) *y1 = ((0-x0)*dy)/dx + y0; } if (*y1 > height) @@ -540,7 +540,7 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei dy = *y1 - y0; *y1 = height; - if (dx) + if (dy) *x1 = ((height-y0)*dx)/dy + x0; } if (*y1 < 0) @@ -549,7 +549,7 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei dy = *y1 - y0; *y1 = 0; - if (dx) + if (dy) *x1 = ((0-y0)*dx)/dy + x0; } } @@ -753,8 +753,36 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l { for (x0 = 8; x0 < (width + 8); x0 += 16) { - int x1, y1; - if (mi->mbmi.mode >= NEARESTMV) + int x1, y1; + + if (mi->mbmi.mode == SPLITMV) + { + int bx0, by0; + + B_MODE_INFO *bmi = mi->bmi; + MV *mv = &bmi->mv.as_mv; + + for (by0 = (y0-8); by0 < y0+8; by0 += 4) + { + for (bx0 = (x0-8); bx0 < x0+8; bx0 += 4) + { + + x1 = bx0 + (mv->col >> 3); + y1 = by0 + (mv->row >> 3); + + if (x1 != bx0 && y1 != by0) + { + constrain_line (bx0, &x1, by0, &y1, width, height); + vp8_blit_line (bx0, x1, by0, y1, y_buffer, y_stride); + } + else + vp8_blit_line (bx0, x1, by0, y1, y_buffer, y_stride); + + mv++; + } + } + } + else if (mi->mbmi.mode >= NEARESTMV) { MV *mv = &mi->mbmi.mv.as_mv; -- 2.7.4