Commit 95390b2b authored by Scott LaVarnway's avatar Scott LaVarnway
Browse files

Moving ymode_count, uv_mode_count to macroblock struct

Change-Id: Ib73c7b2bee4cb2eb2528fa6b381fffe9503079a0
parent 03c0af87
......@@ -118,7 +118,7 @@ static void update_mbintra_mode_probs(VP8_COMP *cpi)
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 @@ static void update_mbintra_mode_probs(VP8_COMP *cpi)
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
);
}
}
......
......@@ -130,6 +130,10 @@ typedef struct macroblock
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);
......
......@@ -643,8 +643,6 @@ static void init_encode_frame_mb_context(VP8_COMP *cpi)
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 @@ static void init_encode_frame_mb_context(VP8_COMP *cpi)
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 @@ void vp8_encode_frame(VP8_COMP *cpi)
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 @@ static void sum_intra_stats(VP8_COMP *cpi, MACROBLOCK *x)
#endif
++cpi->ymode_count[m];
++cpi->uv_mode_count[uvm];
++x->ymode_count[m];
++x->uv_mode_count[uvm];
}
......
......@@ -473,6 +473,7 @@ void vp8cx_init_mbrthread_data(VP8_COMP *cpi,
mbd->fullpixel_mask = 0xfffffff8;
vp8_zero(mb->coef_counts);
vp8_zero(x->ymode_count);
mb->skip_true_count = 0;
}
}
......
......@@ -452,9 +452,6 @@ typedef struct VP8_COMP
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];
......
......@@ -242,8 +242,8 @@ void vp8_save_coding_context(VP8_COMP *cpi)
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 @@ void vp8_restore_coding_context(VP8_COMP *cpi)
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
......
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