if (less8x8)
bsize = BLOCK_8X8;
+#if CONFIG_INTERNAL_STATS
+ pbi->total_block_in_8x8 += (1 << (num_pels_log2_lookup[bsize] - 6));
+ if (!is_inter_block(mbmi))
+ pbi->intra_block_in_8x8 += (1 << (num_pels_log2_lookup[bsize] - 6));
+#endif
+
if (mbmi->skip) {
reset_skip_context(xd, bsize);
}
"Uninitialized entropy context.");
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;
+#endif
xd->corrupted = 0;
new_fb->corrupted = read_compressed_header(pbi, data, first_partition_size);
// Non frame parallel update frame context here.
if (cm->refresh_frame_context && !context_updated)
cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
+
+#if CONFIG_INTERNAL_STATS
+ vp9_clear_system_state();
+ {
+ FILE *pf = fopen("frame_level_stats.stt", "a");
+ double subpel_mc = (double)pbi->subpel_mc_block_in_4x4 /
+ (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);
+ fclose(pf);
+ }
+#endif
}
mi->bmi[j].as_mv[0].as_int = block[0].as_int;
if (is_compound)
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 +=
+ (1 << (num_pels_log2_lookup[bsize] - 4));
+ if (mi->bmi[j].as_mv[0].as_mv.col & 0x07)
+ pbi->subpel_mc_block_in_4x4 +=
+ (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 +=
+ (1 << (num_pels_log2_lookup[bsize] - 4));
+ if (mi->bmi[j].as_mv[1].as_mv.col & 0x07)
+ pbi->subpel_mc_block_in_4x4 +=
+ (1 << (num_pels_log2_lookup[bsize] - 4));
+ }
+#endif
if (num_4x4_h == 2)
mi->bmi[j + 2] = mi->bmi[j];
if (num_4x4_w == 2)
} else {
xd->corrupted |= !assign_mv(cm, xd, mbmi->mode, mbmi->mv, nearestmv,
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));
+ if (mbmi->mv[0].as_mv.col & 0x07)
+ pbi->subpel_mc_block_in_4x4 += (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));
+ if (mbmi->mv[1].as_mv.col & 0x07)
+ pbi->subpel_mc_block_in_4x4 += (1 << (num_pels_log2_lookup[bsize] - 4));
+ }
+#endif
}
}
int inv_tile_order;
int need_resync; // wait for key/intra-only frame.
int hold_ref_buf; // hold the reference buffer.
+
+#if CONFIG_INTERNAL_STATS
+ // total blocks in unit of 8x8 inside the frame.
+ int total_block_in_8x8;
+ // 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;
+ // nubmer of blocks using intra prediction mode.
+ int intra_block_in_8x8;
+#endif
} VP9Decoder;
int vp9_receive_compressed_data(struct VP9Decoder *pbi,