Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
70a80a81
Commit
70a80a81
authored
Jul 24, 2017
by
Angie Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let adapt_scan's prob precision be adjustable
Change-Id: Ie1f5db74d3b22a46abd09e0207770935622074a5
parent
d39f6b33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
av1/common/entropy.h
av1/common/entropy.h
+5
-1
av1/common/scan.c
av1/common/scan.c
+10
-5
No files found.
av1/common/entropy.h
View file @
70a80a81
...
...
@@ -414,7 +414,11 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128
#if CONFIG_ADAPT_SCAN
#define ADAPT_SCAN_UPDATE_RATE_16 (1 << 13)
#define ADAPT_SCAN_PROB_PRECISION 16
// 1/8 update rate
#define ADAPT_SCAN_UPDATE_LOG_RATE 3
#define ADAPT_SCAN_UPDATE_RATE \
(1 << (ADAPT_SCAN_PROB_PRECISION - ADAPT_SCAN_UPDATE_LOG_RATE))
#endif
static
INLINE
aom_prob
av1_merge_probs
(
aom_prob
pre_prob
,
...
...
av1/common/scan.c
View file @
70a80a81
...
...
@@ -6605,7 +6605,7 @@ static INLINE int clamp_64(int64_t value, int low, int high) {
}
static void update_scan_prob(AV1_COMMON *cm, TX_SIZE tx_size, TX_TYPE tx_type,
int rate
_16
) {
int rate) {
FRAME_CONTEXT *pre_fc = cm->pre_fc;
uint32_t *prev_non_zero_prob = get_non_zero_prob(pre_fc, tx_size, tx_type);
uint32_t *non_zero_prob = get_non_zero_prob(cm->fc, tx_size, tx_type);
...
...
@@ -6615,13 +6615,18 @@ static void update_scan_prob(AV1_COMMON *cm, TX_SIZE tx_size, TX_TYPE tx_type,
int i;
for (i = 0; i < tx2d_size; i++) {
int64_t curr_prob =
block_num == 0 ? 0 : (non_zero_count[i] << 16) / block_num;
block_num == 0
? 0
: (non_zero_count[i] << ADAPT_SCAN_PROB_PRECISION) / block_num;
int64_t prev_prob = prev_non_zero_prob[i];
int64_t pred_prob =
(curr_prob * rate_16 + prev_prob * ((1 << 16) - rate_16)) >> 16;
(curr_prob * rate +
prev_prob * ((1 << ADAPT_SCAN_PROB_PRECISION) - rate)) >>
ADAPT_SCAN_PROB_PRECISION;
// TODO(angiebird): reduce the bit usage of probabilities and remove
// clamp_64()
non_zero_prob[i] = clamp_64(pred_prob, 0, UINT16_MAX);
non_zero_prob[i] =
clamp_64(pred_prob, 0, (1 << ADAPT_SCAN_PROB_PRECISION) - 1);
}
}
...
...
@@ -6840,7 +6845,7 @@ void av1_adapt_scan_order(AV1_COMMON *cm) {
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
TX_TYPE tx_type;
for (tx_type = DCT_DCT; tx_type < TX_TYPES; ++tx_type) {
update_scan_prob(cm, tx_size, tx_type, ADAPT_SCAN_UPDATE_RATE
_16
);
update_scan_prob(cm, tx_size, tx_type, ADAPT_SCAN_UPDATE_RATE);
update_scan_order_facade(cm, tx_size, tx_type);
update_eob_threshold(cm, tx_size, tx_type);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment