mi_cols = int(word_ls[5])
bs = int(word_ls[7])
ref_frame_idx = int(word_ls[9])
+ rf_idx = int(word_ls[11])
+ gf_frame_offset = int(word_ls[13])
+ ref_gf_frame_offset = int(word_ls[15])
mi_size = bs / 8
mv_ls = []
mv_rows = int((math.ceil(mi_rows * 1. / mi_size)))
feature_score = read_feature_score(fp, mv_rows, mv_cols)
img = yuv_to_rgb(read_frame(fp))
ref = yuv_to_rgb(read_frame(fp))
- return frame_idx, ref_frame_idx, mv_ls, img, ref, bs, feature_score
+ return rf_idx, frame_idx, ref_frame_idx, gf_frame_offset, ref_gf_frame_offset, mv_ls, img, ref, bs, feature_score
def read_dpl_stats_file(filename, frame_num=0):
if __name__ == '__main__':
filename = sys.argv[1]
data_ls = read_dpl_stats_file(filename, frame_num=5)
- for frame_idx, ref_frame_idx, mv_ls, img, ref, bs, feature_score in data_ls:
+ for rf_idx, frame_idx, ref_frame_idx, gf_frame_offset, ref_gf_frame_offset, mv_ls, img, ref, bs, feature_score in data_ls:
fig, axes = plt.subplots(2, 2)
axes[0][0].imshow(img)
feature_score_bins = np.arange(feature_score_min, feature_score_max, step)
axes[1][1].hist(feature_score_arr, bins=feature_score_bins)
- print frame_idx, ref_frame_idx, len(mv_ls)
+ print rf_idx, frame_idx, ref_frame_idx, gf_frame_offset, ref_gf_frame_offset, len(mv_ls)
plt.show()
}
static void dump_tpl_stats(const VP9_COMP *cpi, int tpl_group_frames,
+ const GF_GROUP *gf_group,
const GF_PICTURE *gf_picture, BLOCK_SIZE bsize) {
int frame_idx;
const VP9_COMMON *cm = &cpi->common;
ref_frame_idx = gf_picture[frame_idx].ref_frame[rf_idx];
if (ref_frame_idx != -1) {
YV12_BUFFER_CONFIG *ref_frame_buf = gf_picture[ref_frame_idx].frame;
+ const int gf_frame_offset = gf_group->frame_gop_index[frame_idx];
+ const int ref_gf_frame_offset =
+ gf_group->frame_gop_index[ref_frame_idx];
printf("=\n");
- printf("frame_idx %d mi_rows %d mi_cols %d bsize %d ref_frame_idx %d\n",
- frame_idx, cm->mi_rows, cm->mi_cols, mi_width * MI_SIZE,
- ref_frame_idx);
+ printf(
+ "frame_idx %d mi_rows %d mi_cols %d bsize %d ref_frame_idx %d "
+ "rf_idx %d gf_frame_offset %d ref_gf_frame_offset %d\n",
+ frame_idx, cm->mi_rows, cm->mi_cols, mi_width * MI_SIZE,
+ ref_frame_idx, rf_idx, gf_frame_offset, ref_gf_frame_offset);
for (mi_row = 0; mi_row < cm->mi_rows; ++mi_row) {
for (mi_col = 0; mi_col < cm->mi_cols; ++mi_col) {
if ((mi_row % mi_height) == 0 && (mi_col % mi_width) == 0) {
#if CONFIG_NON_GREEDY_MV
cpi->tpl_ready = 1;
#if DUMP_TPL_STATS
- dump_tpl_stats(cpi, tpl_group_frames, gf_picture, cpi->tpl_bsize);
+ dump_tpl_stats(cpi, tpl_group_frames, gf_group, gf_picture, cpi->tpl_bsize);
#endif // DUMP_TPL_STATS
#endif // CONFIG_NON_GREEDY_MV
}