struct intra_args arg = {xd, r, mbmi->segment_id};
vp9_foreach_transformed_block(xd, bsize,
predict_and_reconstruct_intra_block, &arg);
+#if CONFIG_INTERNAL_STATS
+ pbi->sub8x8_intra += less8x8;
+#endif
} else {
// Prediction
dec_build_inter_predictors_sb(pbi, xd, mi_row, mi_col, bsize);
}
}
+#if CONFIG_INTERNAL_STATS
+ pbi->sub8x8_inter += less8x8;
+#endif
+
xd->corrupted |= vp9_reader_has_error(r);
}
vp9_zero(cm->counts);
#if CONFIG_INTERNAL_STATS
// Reset internal stats
- pbi->total_block_in_8x8 = 0;
- pbi->subpel_mc_block_in_4x4 = 0;
- pbi->intra_block_in_8x8 = 0;
+ if (cm->current_video_frame == 0) {
+ pbi->total_block_in_8x8 = 0;
+ pbi->subpel_mc_block_in_4x4_h = 0;
+ pbi->subpel_mc_block_in_4x4_v = 0;
+ pbi->sub8x8_inter = 0;
+ pbi->sub8x8_intra = 0;
+ pbi->intra_block_in_8x8 = 0;
+ pbi->compound_inter_block_in_8x8 = 0;
+ }
#endif
xd->corrupted = 0;
vp9_clear_system_state();
{
FILE *pf = fopen("frame_level_stats.stt", "a");
- double subpel_mc = (double)pbi->subpel_mc_block_in_4x4 /
+ double subpel_mc_h = (double)pbi->subpel_mc_block_in_4x4_h /
+ (double)pbi->total_block_in_8x8;
+ double subpel_mc_v = (double)pbi->subpel_mc_block_in_4x4_v /
(double)pbi->total_block_in_8x8;
double intra_mode = (double)pbi->intra_block_in_8x8 /
(double)pbi->total_block_in_8x8;
- fprintf(pf, "frame index %d, sub-pel mc %7.3f\tintra mode%7.3f\n",
- cm->current_video_frame, 25 * subpel_mc, 100 * intra_mode);
+ double compound_block = (double)pbi->compound_inter_block_in_8x8 /
+ (double)pbi->total_block_in_8x8;
+ double sub8x8_inter = (double)pbi->sub8x8_inter /
+ (double)pbi->total_block_in_8x8;
+ double sub8x8_intra = (double)pbi->sub8x8_intra /
+ (double)pbi->total_block_in_8x8;
+
+ fprintf(pf, "frame index %d, sub-pel mc (%7.3f, %7.3f)\tintra mode%7.3f\tcompound inter block%7.3f\t",
+ cm->current_video_frame, 25 * subpel_mc_h, 25 * subpel_mc_v, 100 * intra_mode,
+ 100 * compound_block);
+ fprintf(pf, "sub8x8 inter %7.3f intra %7.3f\n", 100 * sub8x8_inter, 100 * sub8x8_intra);
fclose(pf);
}
#endif
read_ref_frames(cm, xd, r, mbmi->segment_id, mbmi->ref_frame);
is_compound = has_second_ref(mbmi);
+#if CONFIG_INTERNAL_STATS
+ pbi->compound_inter_block_in_8x8 += is_compound;
+#endif
+
for (ref = 0; ref < 1 + is_compound; ++ref) {
const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
RefBuffer *ref_buf = &cm->frame_refs[frame - LAST_FRAME];
mi->bmi[j].as_mv[1].as_int = block[1].as_int;
#if CONFIG_INTERNAL_STATS
if (mi->bmi[j].as_mv[0].as_mv.row & 0x07)
- pbi->subpel_mc_block_in_4x4 +=
+ pbi->subpel_mc_block_in_4x4_v +=
(1 << (num_pels_log2_lookup[bsize] - 4));
if (mi->bmi[j].as_mv[0].as_mv.col & 0x07)
- pbi->subpel_mc_block_in_4x4 +=
+ pbi->subpel_mc_block_in_4x4_h +=
(1 << (num_pels_log2_lookup[bsize] - 4));
if (is_compound) {
if (mi->bmi[j].as_mv[1].as_mv.row & 0x07)
- pbi->subpel_mc_block_in_4x4 +=
+ pbi->subpel_mc_block_in_4x4_v +=
(1 << (num_pels_log2_lookup[bsize] - 4));
if (mi->bmi[j].as_mv[1].as_mv.col & 0x07)
- pbi->subpel_mc_block_in_4x4 +=
+ pbi->subpel_mc_block_in_4x4_h +=
(1 << (num_pels_log2_lookup[bsize] - 4));
}
#endif
nearestmv, nearmv, is_compound, allow_hp, r);
#if CONFIG_INTERNAL_STATS
if (mbmi->mv[0].as_mv.row & 0x07)
- pbi->subpel_mc_block_in_4x4 += (1 << (num_pels_log2_lookup[bsize] - 4));
+ pbi->subpel_mc_block_in_4x4_v += (1 << (num_pels_log2_lookup[bsize] - 4));
if (mbmi->mv[0].as_mv.col & 0x07)
- pbi->subpel_mc_block_in_4x4 += (1 << (num_pels_log2_lookup[bsize] - 4));
+ pbi->subpel_mc_block_in_4x4_h += (1 << (num_pels_log2_lookup[bsize] - 4));
if (is_compound) {
if (mbmi->mv[1].as_mv.row & 0x07)
- pbi->subpel_mc_block_in_4x4 += (1 << (num_pels_log2_lookup[bsize] - 4));
+ pbi->subpel_mc_block_in_4x4_v += (1 << (num_pels_log2_lookup[bsize] - 4));
if (mbmi->mv[1].as_mv.col & 0x07)
- pbi->subpel_mc_block_in_4x4 += (1 << (num_pels_log2_lookup[bsize] - 4));
+ pbi->subpel_mc_block_in_4x4_h += (1 << (num_pels_log2_lookup[bsize] - 4));
}
#endif
}
#if CONFIG_INTERNAL_STATS
// total blocks in unit of 8x8 inside the frame.
- int total_block_in_8x8;
+ int64_t total_block_in_8x8;
+
+ // sub8x8 blocks in unit of 8x8.
+ int64_t sub8x8_inter;
+ int64_t sub8x8_intra;
+
// number of blocks using 1-D sub-pixel filtering for motion compensated
// prediction. if a block is using sub-pixel filter in both vertical and
// horizontal directions, it counts as using 1-D sub-pixel filter twice.
- int subpel_mc_block_in_4x4;
+ int64_t subpel_mc_block_in_4x4_h;
+ int64_t subpel_mc_block_in_4x4_v;
+
// nubmer of blocks using intra prediction mode.
- int intra_block_in_8x8;
+ int64_t intra_block_in_8x8;
+
+ // number of blocks using compound prediction mode.
+ int64_t compound_inter_block_in_8x8;
#endif
} VP9Decoder;