Skip to content

Commit

Permalink
Merge changes Ifb450710,I61c4a132
Browse files Browse the repository at this point in the history
* changes:
  Eliminated reconintra_mt.c
  Eliminated vp8mt_build_intra_predictors_mbuv_s
  • Loading branch information
Scott LaVarnway authored and Gerrit Code Review committed Feb 28, 2012
2 parents aab70f4 + bcba86e commit ce328b8
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 1,065 deletions.
33 changes: 18 additions & 15 deletions vp8/common/reconintra.c
Expand Up @@ -136,21 +136,21 @@ void vp8_build_intra_predictors_mby_c(MACROBLOCKD *x)
}
}

void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x)
void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x,
unsigned char * yabove_row,
unsigned char * yleft,
int left_stride,
unsigned char * ypred_ptr)
{

unsigned char *yabove_row = x->dst.y_buffer - x->dst.y_stride;
unsigned char yleft_col[16];
unsigned char ytop_left = yabove_row[-1];
unsigned char *ypred_ptr = x->predictor;
int r, c, i;

int y_stride = x->dst.y_stride;
ypred_ptr = x->dst.y_buffer; /*x->predictor;*/

for (i = 0; i < 16; i++)
{
yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
yleft_col[i] = yleft[i* left_stride];
}

/* for Y */
Expand Down Expand Up @@ -400,24 +400,27 @@ void vp8_build_intra_predictors_mbuv_c(MACROBLOCKD *x)
}
}

void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x)
void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x,
unsigned char * uabove_row,
unsigned char * vabove_row,
unsigned char * uleft,
unsigned char * vleft,
int left_stride,
unsigned char * upred_ptr,
unsigned char * vpred_ptr)
{
unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride;
unsigned char uleft_col[16];
unsigned char uleft_col[8];
unsigned char utop_left = uabove_row[-1];
unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride;
unsigned char vleft_col[20];
unsigned char vleft_col[8];
unsigned char vtop_left = vabove_row[-1];
unsigned char *upred_ptr = x->dst.u_buffer; /*&x->predictor[256];*/
unsigned char *vpred_ptr = x->dst.v_buffer; /*&x->predictor[320];*/
int uv_stride = x->dst.uv_stride;

int i, j;

for (i = 0; i < 8; i++)
{
uleft_col[i] = x->dst.u_buffer [i* x->dst.uv_stride -1];
vleft_col[i] = x->dst.v_buffer [i* x->dst.uv_stride -1];
uleft_col[i] = uleft [i* left_stride];
vleft_col[i] = vleft [i* left_stride];
}

switch (x->mode_info_context->mbmi.uv_mode)
Expand Down
46 changes: 18 additions & 28 deletions vp8/common/reconintra4x4.c
Expand Up @@ -13,20 +13,19 @@
#include "vpx_rtcd.h"
#include "blockd.h"

void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
int b_mode,
unsigned char *dst, int dst_stride)
void vp8_intra4x4_predict_d_c(unsigned char *Above,
unsigned char *yleft, int left_stride,
int b_mode,
unsigned char *dst, int dst_stride,
unsigned char top_left)
{
int i, r, c;

unsigned char *Above = src - src_stride;
unsigned char Left[4];
unsigned char top_left = Above[-1];

Left[0] = src[-1];
Left[1] = src[-1 + src_stride];
Left[2] = src[-1 + 2 * src_stride];
Left[3] = src[-1 + 3 * src_stride];
Left[0] = yleft[0];
Left[1] = yleft[left_stride];
Left[2] = yleft[2 * left_stride];
Left[3] = yleft[3 * left_stride];

switch (b_mode)
{
Expand Down Expand Up @@ -295,24 +294,15 @@ void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
}
}





/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
* to the right prediction have filled in pixels to use.
*/
void vp8_intra_prediction_down_copy(MACROBLOCKD *x)
void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
int b_mode,
unsigned char *dst, int dst_stride)
{
int dst_stride = x->dst.y_stride;
unsigned char *above_right = x->dst.y_buffer - dst_stride + 16;

unsigned int *src_ptr = (unsigned int *)above_right;
unsigned int *dst_ptr0 = (unsigned int *)(above_right + 4 * dst_stride);
unsigned int *dst_ptr1 = (unsigned int *)(above_right + 8 * dst_stride);
unsigned int *dst_ptr2 = (unsigned int *)(above_right + 12 * dst_stride);
unsigned char *Above = src - src_stride;

*dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr;
*dst_ptr2 = *src_ptr;
vp8_intra4x4_predict_d_c(Above,
src - 1, src_stride,
b_mode,
dst, dst_stride,
Above[-1]);
}
17 changes: 15 additions & 2 deletions vp8/common/reconintra4x4.h
Expand Up @@ -11,9 +11,22 @@

#ifndef __INC_RECONINTRA4x4_H
#define __INC_RECONINTRA4x4_H
#include "vp8/common/blockd.h"

struct macroblockd;
static void intra_prediction_down_copy(MACROBLOCKD *xd,
unsigned char *above_right_src)
{
int dst_stride = xd->dst.y_stride;
unsigned char *above_right_dst = xd->dst.y_buffer - dst_stride + 16;

extern void vp8_intra_prediction_down_copy(struct macroblockd *x);
unsigned int *src_ptr = (unsigned int *)above_right_src;
unsigned int *dst_ptr0 = (unsigned int *)(above_right_dst + 4 * dst_stride);
unsigned int *dst_ptr1 = (unsigned int *)(above_right_dst + 8 * dst_stride);
unsigned int *dst_ptr2 = (unsigned int *)(above_right_dst + 12 * dst_stride);

*dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr;
*dst_ptr2 = *src_ptr;
}

#endif
8 changes: 4 additions & 4 deletions vp8/common/rtcd_defs.sh
Expand Up @@ -125,14 +125,14 @@ vp8_copy_mem8x4_media=vp8_copy_mem8x4_v6
prototype void vp8_build_intra_predictors_mby "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby sse2 ssse3 neon

prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby_s sse2 ssse3 neon
prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr"
#TODO: fix assembly --- specialize vp8_build_intra_predictors_mby_s sse2 ssse3 neon

prototype void vp8_build_intra_predictors_mbuv "struct macroblockd *x"
specialize vp8_build_intra_predictors_mbuv sse2 ssse3

prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mbuv_s sse2 ssse3
prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr"
#TODO: fix assembly --- specialize vp8_build_intra_predictors_mbuv_s sse2 ssse3

prototype void vp8_intra4x4_predict "unsigned char *src, int src_stride, int b_mode, unsigned char *dst, int dst_stride"
specialize vp8_intra4x4_predict media
Expand Down
36 changes: 29 additions & 7 deletions vp8/decoder/decodframe.c
Expand Up @@ -156,11 +156,21 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
/* do prediction */
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{
vp8_build_intra_predictors_mbuv_s(xd);
vp8_build_intra_predictors_mbuv_s(xd,
xd->dst.u_buffer - xd->dst.uv_stride,
xd->dst.v_buffer - xd->dst.uv_stride,
xd->dst.u_buffer - 1,
xd->dst.v_buffer - 1,
xd->dst.uv_stride,
xd->dst.u_buffer, xd->dst.v_buffer);

if (mode != B_PRED)
{
vp8_build_intra_predictors_mby_s(xd);
vp8_build_intra_predictors_mby_s(xd,
xd->dst.y_buffer - xd->dst.y_stride,
xd->dst.y_buffer - 1,
xd->dst.y_stride,
xd->dst.y_buffer);
}
else
{
Expand All @@ -172,16 +182,28 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
if(xd->mode_info_context->mbmi.mb_skip_coeff)
vpx_memset(xd->eobs, 0, 25);

vp8_intra_prediction_down_copy(xd);
intra_prediction_down_copy(xd, xd->dst.y_buffer - dst_stride + 16);

for (i = 0; i < 16; i++)
{
BLOCKD *b = &xd->block[i];
int b_mode = xd->mode_info_context->bmi[i].as_mode;


vp8_intra4x4_predict (base_dst + b->offset, dst_stride, b_mode,
base_dst + b->offset, dst_stride );
unsigned char *yabove;
unsigned char *yleft;
int left_stride;
unsigned char top_left;

yabove = base_dst + b->offset - dst_stride;
yleft = base_dst + b->offset - 1;
left_stride = dst_stride;
top_left = yabove[-1];

// vp8_intra4x4_predict (base_dst + b->offset, dst_stride, b_mode,
// base_dst + b->offset, dst_stride );
vp8_intra4x4_predict_d_c(yabove, yleft, left_stride,
b_mode,
base_dst + b->offset, dst_stride,
top_left);

if (xd->eobs[i])
{
Expand Down

0 comments on commit ce328b8

Please sign in to comment.