Count superblock num in symbol rate accounting
Change-Id: Id955e62c89b44781cef6b562fbc1e5782fccf95e
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index db48884..e032af9 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -438,6 +438,7 @@
#endif // CONFIG_LV_MAP
#if CONFIG_SYMBOLRATE
+ unsigned int superblock_num;
unsigned int coeff_num[2]; // 0: zero coeff 1: non-zero coeff
unsigned int symbol_num[2]; // 0: entropy symbol 1: non-entropy symbol
#endif
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index cd14201..d3e22a9 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -2551,6 +2551,9 @@
alloc_ncobmc_pred_buffer(&td->xd);
set_sb_mi_boundaries(cm, &td->xd, mi_row, mi_col);
#endif
+#if CONFIG_SYMBOLRATE
+ av1_record_superblock(td->xd.counts);
+#endif
decode_partition(pbi, &td->xd, mi_row, mi_col, &td->bit_reader,
cm->sb_size);
#if NC_MODE_INFO && CONFIG_MOTION_VAR
diff --git a/av1/decoder/symbolrate.h b/av1/decoder/symbolrate.h
index c5608be..167eb19 100644
--- a/av1/decoder/symbolrate.h
+++ b/av1/decoder/symbolrate.h
@@ -17,9 +17,9 @@
#if CONFIG_SYMBOLRATE
static INLINE void av1_dump_symbol_rate(struct AV1Common *cm) {
const FRAME_COUNTS *counts = &cm->counts;
- printf("%d %d %d %d %d %d\n", cm->current_video_frame, cm->show_frame,
- counts->coeff_num[0], counts->coeff_num[1], counts->symbol_num[0],
- counts->symbol_num[1]);
+ printf("%d %d %d %d %d %d %d\n", cm->current_video_frame, cm->show_frame,
+ counts->superblock_num, counts->coeff_num[0], counts->coeff_num[1],
+ counts->symbol_num[0], counts->symbol_num[1]);
}
static INLINE int av1_read_record_symbol(FRAME_COUNTS *counts, aom_reader *r,
aom_cdf_prob *cdf, int nsymbs,
@@ -65,6 +65,10 @@
assert(qcoeff >= 0);
if (counts) ++counts->coeff_num[qcoeff != 0];
}
+
+static INLINE void av1_record_superblock(FRAME_COUNTS *counts) {
+ if (counts) ++counts->superblock_num;
+}
#else // CONFIG_SYMBOLRATE
#define av1_read_record_symbol(counts, r, cdf, nsymbs, ACCT_STR_NAME) \