Commit d9af8ac3 authored by Angie Chiang's avatar Angie Chiang
Browse files

Count superblock num in symbol rate accounting

Change-Id: Id955e62c89b44781cef6b562fbc1e5782fccf95e
parent 08032ca7
......@@ -438,6 +438,7 @@ typedef struct FRAME_COUNTS {
#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
......
......@@ -2550,6 +2550,9 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
#if CONFIG_NCOBMC_ADAPT_WEIGHT
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);
......
......@@ -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 @@ static INLINE void av1_record_coeff(FRAME_COUNTS *counts, tran_low_t qcoeff) {
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) \
......
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