Change vp8_intra4x4_predict call sites
authorJohann <johannkoenig@google.com>
Tue, 31 Jul 2012 21:21:55 +0000 (14:21 -0700)
committerJohann <johannkoenig@google.com>
Wed, 1 Aug 2012 17:48:46 +0000 (10:48 -0700)
Use the _d variant from the decoder. It moves the pointer calculations
to the caller.

Change-Id: Iae2a793433ef082980a3ffa0a1cabf0264a6a24d

vp8/common/arm/armv6/intra4x4_predict_v6.asm
vp8/encoder/encodeintra.c
vp8/encoder/pickinter.c
vp8/encoder/rdopt.c

index a974cd1..75d52db 100644 (file)
@@ -18,8 +18,8 @@
     AREA ||.text||, CODE, READONLY, ALIGN=2
 
 
-;void vp8_intra4x4_predict(unsigned char *src, int src_stride, int b_mode,
-;                          unsigned char *dst, int dst_stride)
+;void vp8_intra4x4_predict_armv6(unsigned char *src, int src_stride, int b_mode,
+;                                unsigned char *dst, int dst_stride)
 
 |vp8_intra4x4_predict_armv6| PROC
     push        {r4-r12, lr}
index 1f445b7..a380367 100644 (file)
@@ -54,10 +54,13 @@ void vp8_encode_intra4x4block(MACROBLOCK *x, int ib)
     BLOCKD *b = &x->e_mbd.block[ib];
     BLOCK *be = &x->block[ib];
     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,
-                 b->bmi.as_mode, b->predictor, 16);
+    vp8_intra4x4_predict_d(Above, yleft, dst_stride, b->bmi.as_mode,
+                           b->predictor, 16, top_left);
 
     vp8_subtract_b(be, b, 16);
 
@@ -67,14 +70,11 @@ void vp8_encode_intra4x4block(MACROBLOCK *x, int ib)
 
     if (*b->eob > 1)
     {
-      vp8_short_idct4x4llm(b->dqcoeff,
-            b->predictor, 16, base_dst + b->offset, dst_stride);
+      vp8_short_idct4x4llm(b->dqcoeff, b->predictor, 16, dst, dst_stride);
     }
     else
     {
-      vp8_dc_only_idct_add
-            (b->dqcoeff[0], b->predictor, 16, base_dst + b->offset,
-                dst_stride);
+      vp8_dc_only_idct_add(b->dqcoeff[0], b->predictor, 16, dst, dst_stride);
     }
 }
 
index 75e262e..171e5a9 100644 (file)
@@ -141,20 +141,24 @@ static int pick_intra4x4block(
     BLOCKD *b = &x->e_mbd.block[ib];
     BLOCK *be = &x->block[ib];
     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;
     int best_rd = INT_MAX;
     int rate;
     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++)
     {
         int this_rd;
 
         rate = mode_costs[mode];
-        vp8_intra4x4_predict
-                     (base_dst + b->offset, dst_stride,
-                      mode, b->predictor, 16);
+
+        vp8_intra4x4_predict_d(Above, yleft, dst_stride, mode,
+                               b->predictor,16, top_left);
         distortion = get_prediction_error(be, b);
         this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion);
 
index a534a0b..8179c9f 100644 (file)
@@ -653,7 +653,11 @@ static int rd_pick_intra4x4block(
     DECLARE_ALIGNED_ARRAY(16, unsigned char,  best_predictor, 16*4);
     DECLARE_ALIGNED_ARRAY(16, short, best_dqcoeff, 16);
     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++)
     {
@@ -662,8 +666,8 @@ static int rd_pick_intra4x4block(
 
         rate = bmode_costs[mode];
 
-        vp8_intra4x4_predict(base_dst + b->offset, dst_stride, mode,
-                             b->predictor, 16);
+        vp8_intra4x4_predict_d(Above, yleft, dst_stride, mode,
+                               b->predictor, 16, top_left);
         vp8_subtract_b(be, b, 16);
         x->short_fdct4x4(be->src_diff, be->coeff, 32);
         x->quantize_b(be, b);
@@ -692,8 +696,7 @@ static int rd_pick_intra4x4block(
     }
     b->bmi.as_mode = (B_PREDICTION_MODE)(*best_mode);
 
-    vp8_short_idct4x4llm(best_dqcoeff, best_predictor, 16, base_dst + b->offset,
-                         dst_stride);
+    vp8_short_idct4x4llm(best_dqcoeff, best_predictor, 16, dst, dst_stride);
 
     return best_rd;
 }