Commit a82c58c4 authored by Johann's avatar Johann
Browse files

Change vp8_intra4x4_predict call sites

Use the _d variant from the decoder. It moves the pointer calculations
to the caller.

Change-Id: Iae2a793433ef082980a3ffa0a1cabf0264a6a24d
parent 3c208a5a
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
AREA ||.text||, CODE, READONLY, ALIGN=2 AREA ||.text||, CODE, READONLY, ALIGN=2
;void vp8_intra4x4_predict(unsigned char *src, int src_stride, int b_mode, ;void vp8_intra4x4_predict_armv6(unsigned char *src, int src_stride, int b_mode,
; unsigned char *dst, int dst_stride) ; unsigned char *dst, int dst_stride)
|vp8_intra4x4_predict_armv6| PROC |vp8_intra4x4_predict_armv6| PROC
push {r4-r12, lr} push {r4-r12, lr}
......
...@@ -54,10 +54,13 @@ void vp8_encode_intra4x4block(MACROBLOCK *x, int ib) ...@@ -54,10 +54,13 @@ void vp8_encode_intra4x4block(MACROBLOCK *x, int ib)
BLOCKD *b = &x->e_mbd.block[ib]; BLOCKD *b = &x->e_mbd.block[ib];
BLOCK *be = &x->block[ib]; BLOCK *be = &x->block[ib];
int dst_stride = x->e_mbd.dst.y_stride; int dst_stride = x->e_mbd.dst.y_stride;
unsigned char *base_dst = x->e_mbd.dst.y_buffer; unsigned char *dst = x->e_mbd.dst.y_buffer + b->offset;
unsigned char *Above = dst - dst_stride;
unsigned char *yleft = dst - 1;
unsigned char top_left = Above[-1];
vp8_intra4x4_predict(base_dst + b->offset, dst_stride, vp8_intra4x4_predict_d(Above, yleft, dst_stride, b->bmi.as_mode,
b->bmi.as_mode, b->predictor, 16); b->predictor, 16, top_left);
vp8_subtract_b(be, b, 16); vp8_subtract_b(be, b, 16);
...@@ -67,14 +70,11 @@ void vp8_encode_intra4x4block(MACROBLOCK *x, int ib) ...@@ -67,14 +70,11 @@ void vp8_encode_intra4x4block(MACROBLOCK *x, int ib)
if (*b->eob > 1) if (*b->eob > 1)
{ {
vp8_short_idct4x4llm(b->dqcoeff, vp8_short_idct4x4llm(b->dqcoeff, b->predictor, 16, dst, dst_stride);
b->predictor, 16, base_dst + b->offset, dst_stride);
} }
else else
{ {
vp8_dc_only_idct_add vp8_dc_only_idct_add(b->dqcoeff[0], b->predictor, 16, dst, dst_stride);
(b->dqcoeff[0], b->predictor, 16, base_dst + b->offset,
dst_stride);
} }
} }
......
...@@ -141,20 +141,24 @@ static int pick_intra4x4block( ...@@ -141,20 +141,24 @@ static int pick_intra4x4block(
BLOCKD *b = &x->e_mbd.block[ib]; BLOCKD *b = &x->e_mbd.block[ib];
BLOCK *be = &x->block[ib]; BLOCK *be = &x->block[ib];
int dst_stride = x->e_mbd.dst.y_stride; int dst_stride = x->e_mbd.dst.y_stride;
unsigned char *base_dst = x->e_mbd.dst.y_buffer; unsigned char *dst = x->e_mbd.dst.y_buffer + b->offset;
B_PREDICTION_MODE mode; B_PREDICTION_MODE mode;
int best_rd = INT_MAX; int best_rd = INT_MAX;
int rate; int rate;
int distortion; int distortion;
unsigned char *Above = dst - dst_stride;
unsigned char *yleft = dst - 1;
unsigned char top_left = Above[-1];
for (mode = B_DC_PRED; mode <= B_HE_PRED /*B_HU_PRED*/; mode++) for (mode = B_DC_PRED; mode <= B_HE_PRED /*B_HU_PRED*/; mode++)
{ {
int this_rd; int this_rd;
rate = mode_costs[mode]; rate = mode_costs[mode];
vp8_intra4x4_predict
(base_dst + b->offset, dst_stride, vp8_intra4x4_predict_d(Above, yleft, dst_stride, mode,
mode, b->predictor, 16); b->predictor,16, top_left);
distortion = get_prediction_error(be, b); distortion = get_prediction_error(be, b);
this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion); this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion);
......
...@@ -653,7 +653,11 @@ static int rd_pick_intra4x4block( ...@@ -653,7 +653,11 @@ static int rd_pick_intra4x4block(
DECLARE_ALIGNED_ARRAY(16, unsigned char, best_predictor, 16*4); DECLARE_ALIGNED_ARRAY(16, unsigned char, best_predictor, 16*4);
DECLARE_ALIGNED_ARRAY(16, short, best_dqcoeff, 16); DECLARE_ALIGNED_ARRAY(16, short, best_dqcoeff, 16);
int dst_stride = x->e_mbd.dst.y_stride; int dst_stride = x->e_mbd.dst.y_stride;
unsigned char *base_dst = x->e_mbd.dst.y_buffer; unsigned char *dst = x->e_mbd.dst.y_buffer + b->offset;
unsigned char *Above = dst - dst_stride;
unsigned char *yleft = dst - 1;
unsigned char top_left = Above[-1];
for (mode = B_DC_PRED; mode <= B_HU_PRED; mode++) for (mode = B_DC_PRED; mode <= B_HU_PRED; mode++)
{ {
...@@ -662,8 +666,8 @@ static int rd_pick_intra4x4block( ...@@ -662,8 +666,8 @@ static int rd_pick_intra4x4block(
rate = bmode_costs[mode]; rate = bmode_costs[mode];
vp8_intra4x4_predict(base_dst + b->offset, dst_stride, mode, vp8_intra4x4_predict_d(Above, yleft, dst_stride, mode,
b->predictor, 16); b->predictor, 16, top_left);
vp8_subtract_b(be, b, 16); vp8_subtract_b(be, b, 16);
x->short_fdct4x4(be->src_diff, be->coeff, 32); x->short_fdct4x4(be->src_diff, be->coeff, 32);
x->quantize_b(be, b); x->quantize_b(be, b);
...@@ -692,8 +696,7 @@ static int rd_pick_intra4x4block( ...@@ -692,8 +696,7 @@ static int rd_pick_intra4x4block(
} }
b->bmi.as_mode = (B_PREDICTION_MODE)(*best_mode); b->bmi.as_mode = (B_PREDICTION_MODE)(*best_mode);
vp8_short_idct4x4llm(best_dqcoeff, best_predictor, 16, base_dst + b->offset, vp8_short_idct4x4llm(best_dqcoeff, best_predictor, 16, dst, dst_stride);
dst_stride);
return best_rd; return best_rd;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment