Moving ymode_count, uv_mode_count to macroblock struct
Change-Id: Ib73c7b2bee4cb2eb2528fa6b381fffe9503079a0
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c
index 7ab6dc9..f84ae68 100644
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -118,7 +118,7 @@
update_mode(
w, VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree,
- Pnew, x->fc.ymode_prob, bct, (unsigned int *)cpi->ymode_count
+ Pnew, x->fc.ymode_prob, bct, (unsigned int *)cpi->mb.ymode_count
);
}
{
@@ -127,7 +127,7 @@
update_mode(
w, VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
- Pnew, x->fc.uv_mode_prob, bct, (unsigned int *)cpi->uv_mode_count
+ Pnew, x->fc.uv_mode_prob, bct, (unsigned int *)cpi->mb.uv_mode_count
);
}
}
diff --git a/vp8/encoder/block.h b/vp8/encoder/block.h
index e6228ec..1e475b8 100644
--- a/vp8/encoder/block.h
+++ b/vp8/encoder/block.h
@@ -130,6 +130,10 @@
int skip_true_count;
unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
+ int ymode_count [VP8_YMODES]; /* intra MB type cts this frame */
+ int uv_mode_count[VP8_UV_MODES]; /* intra MB type cts this frame */
+
+
void (*short_fdct4x4)(short *input, short *output, int pitch);
void (*short_fdct8x4)(short *input, short *output, int pitch);
diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c
index d580d89..f99bdb3 100644
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -643,8 +643,6 @@
xd->left_context = &cm->left_context;
vp8_zero(cpi->count_mb_ref_frame_usage)
- vp8_zero(cpi->ymode_count)
- vp8_zero(cpi->uv_mode_count)
x->mvc = cm->fc.mvc;
@@ -676,6 +674,8 @@
xd->fullpixel_mask = 0xfffffff8;
vp8_zero(x->coef_counts);
+ vp8_zero(x->ymode_count);
+ vp8_zero(x->uv_mode_count)
}
static void sum_coef_counts(MACROBLOCK *x, MACROBLOCK *x_thread)
@@ -867,10 +867,20 @@
for (i = 0; i < cpi->encoding_thread_count; i++)
{
+ int mode_count;
totalrate += cpi->mb_row_ei[i].totalrate;
cpi->mb.skip_true_count += cpi->mb_row_ei[i].mb.skip_true_count;
+ for(mode_count = 0; mode_count < VP8_YMODES; mode_count++)
+ cpi->mb.ymode_count[mode_count] +=
+ cpi->mb_row_ei[i].mb.ymode_count[mode_count];
+
+ for(mode_count = 0; mode_count < VP8_UV_MODES; mode_count++)
+ cpi->mb.uv_mode_count[mode_count] +=
+ cpi->mb_row_ei[i].mb.uv_mode_count[mode_count];
+
+
/* add up counts for each thread */
sum_coef_counts(x, &cpi->mb_row_ei[i].mb);
}
@@ -1101,8 +1111,8 @@
#endif
- ++cpi->ymode_count[m];
- ++cpi->uv_mode_count[uvm];
+ ++x->ymode_count[m];
+ ++x->uv_mode_count[uvm];
}
diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c
index 9b7805e..1ad6dab 100644
--- a/vp8/encoder/ethreading.c
+++ b/vp8/encoder/ethreading.c
@@ -473,6 +473,7 @@
mbd->fullpixel_mask = 0xfffffff8;
vp8_zero(mb->coef_counts);
+ vp8_zero(x->ymode_count);
mb->skip_true_count = 0;
}
}
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h
index 7cea725..f38bf89 100644
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -452,9 +452,6 @@
int drop_frames_allowed; /* Are we permitted to drop frames? */
int drop_frame; /* Drop this frame? */
- int ymode_count [VP8_YMODES]; /* intra MB type cts this frame */
- int uv_mode_count[VP8_UV_MODES]; /* intra MB type cts this frame */
-
unsigned int MVcount [2] [MVvals]; /* (row,col) MV cts this frame */
vp8_prob frame_coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c
index 1432c14..77c1c5a 100644
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -242,8 +242,8 @@
vp8_copy(cc->ymode_prob, cpi->common.fc.ymode_prob);
vp8_copy(cc->uv_mode_prob, cpi->common.fc.uv_mode_prob);
- vp8_copy(cc->ymode_count, cpi->ymode_count);
- vp8_copy(cc->uv_mode_count, cpi->uv_mode_count);
+ vp8_copy(cc->ymode_count, cpi->mb.ymode_count);
+ vp8_copy(cc->uv_mode_count, cpi->mb.uv_mode_count);
/* Stats */
@@ -280,8 +280,8 @@
vp8_copy(cpi->common.fc.ymode_prob, cc->ymode_prob);
vp8_copy(cpi->common.fc.uv_mode_prob, cc->uv_mode_prob);
- vp8_copy(cpi->ymode_count, cc->ymode_count);
- vp8_copy(cpi->uv_mode_count, cc->uv_mode_count);
+ vp8_copy(cpi->mb.ymode_count, cc->ymode_count);
+ vp8_copy(cpi->mb.uv_mode_count, cc->uv_mode_count);
/* Stats */
#ifdef MODE_STATS