summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2011-05-19 18:37:13 -0700
committerYaowu Xu <yaowu@google.com>2011-05-19 19:06:03 -0700
commita4c69e9a0f4e7d8a46433c4b6f1d0cca66328fd6 (patch)
treeb9fbd66fb9592f015b74e9516c3fa3f2118e746f
parent1f3f18443db5820157448515579c14efd19eea1b (diff)
downloadlibvpx-a4c69e9a0f4e7d8a46433c4b6f1d0cca66328fd6.tar
libvpx-a4c69e9a0f4e7d8a46433c4b6f1d0cca66328fd6.tar.gz
libvpx-a4c69e9a0f4e7d8a46433c4b6f1d0cca66328fd6.tar.bz2
libvpx-a4c69e9a0f4e7d8a46433c4b6f1d0cca66328fd6.zip
revise two function definitions with less parameters
Change-Id: Ia96e5bf915e4d3c0ac9c1795114bd9e5dd07327a
-rw-r--r--vp8/encoder/encodeintra.c18
-rw-r--r--vp8/encoder/encodeintra.h4
-rw-r--r--vp8/encoder/firstpass.c6
-rw-r--r--vp8/encoder/pickinter.c12
4 files changed, 19 insertions, 21 deletions
diff --git a/vp8/encoder/encodeintra.c b/vp8/encoder/encodeintra.c
index 6f7e66371..307064153 100644
--- a/vp8/encoder/encodeintra.c
+++ b/vp8/encoder/encodeintra.c
@@ -27,10 +27,16 @@
#else
#define IF_RTCD(x) NULL
#endif
-void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x, BLOCK *be, BLOCKD *b, int best_mode)
+
+
+void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd,
+ MACROBLOCK *x, int ib)
{
+ BLOCKD *b = &x->e_mbd.block[ib];
+ BLOCK *be = &x->block[ib];
+
RECON_INVOKE(&rtcd->common->recon, intra4x4_predict)
- (b, best_mode, b->predictor);
+ (b, b->bmi.mode, b->predictor);
ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, b, 16);
@@ -51,13 +57,7 @@ void vp8_encode_intra4x4mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *mb)
vp8_intra_prediction_down_copy(x);
for (i = 0; i < 16; i++)
- {
- BLOCK *be = &mb->block[i];
- BLOCKD *b = &x->block[i];
-
- vp8_encode_intra4x4block(rtcd, mb, be, b, b->bmi.mode);
- }
-
+ vp8_encode_intra4x4block(rtcd, mb, i);
return;
}
diff --git a/vp8/encoder/encodeintra.h b/vp8/encoder/encodeintra.h
index 8159097c6..5861fd1fc 100644
--- a/vp8/encoder/encodeintra.h
+++ b/vp8/encoder/encodeintra.h
@@ -16,6 +16,6 @@
void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *, MACROBLOCK *x);
void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *, MACROBLOCK *x);
void vp8_encode_intra4x4mby(const VP8_ENCODER_RTCD *, MACROBLOCK *mb);
-void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *, MACROBLOCK *x, BLOCK *be, BLOCKD *b, int best_mode);
-
+void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd,
+ MACROBLOCK *x, int ib);
#endif
diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c
index 7334a465d..839e53a12 100644
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -100,10 +100,8 @@ static int encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred)
{
for (i = 0; i < 16; i++)
{
- BLOCKD *b = &x->e_mbd.block[i];
- BLOCK *be = &x->block[i];
-
- vp8_encode_intra4x4block(IF_RTCD(&cpi->rtcd), x, be, b, B_DC_PRED);
+ x->e_mbd.block[i].bmi.mode = B_DC_PRED;
+ vp8_encode_intra4x4block(IF_RTCD(&cpi->rtcd), x, i);
}
}
diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c
index c2524921d..7940a518e 100644
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -170,8 +170,7 @@ static int get_prediction_error(BLOCK *be, BLOCKD *b, const vp8_variance_rtcd_vt
static int pick_intra4x4block(
const VP8_ENCODER_RTCD *rtcd,
MACROBLOCK *x,
- BLOCK *be,
- BLOCKD *b,
+ int ib,
B_PREDICTION_MODE *best_mode,
B_PREDICTION_MODE above,
B_PREDICTION_MODE left,
@@ -179,6 +178,9 @@ static int pick_intra4x4block(
int *bestrate,
int *bestdistortion)
{
+
+ BLOCKD *b = &x->e_mbd.block[ib];
+ BLOCK *be = &x->block[ib];
B_PREDICTION_MODE mode;
int best_rd = INT_MAX; // 1<<30
int rate;
@@ -214,8 +216,7 @@ static int pick_intra4x4block(
}
b->bmi.mode = (B_PREDICTION_MODE)(*best_mode);
- vp8_encode_intra4x4block(rtcd, x, be, b, b->bmi.mode);
-
+ vp8_encode_intra4x4block(rtcd, x, ib);
return best_rd;
}
@@ -245,8 +246,7 @@ int vp8_pick_intra4x4mby_modes
B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_mode);
int UNINITIALIZED_IS_SAFE(r), UNINITIALIZED_IS_SAFE(d);
- pick_intra4x4block(rtcd, mb, mb->block + i, xd->block + i,
- &best_mode, A, L, &r, &d);
+ pick_intra4x4block(rtcd, mb, i, &best_mode, A, L, &r, &d);
cost += r;
distortion += d;