Commit 5e941728 authored by Yaowu Xu's avatar Yaowu Xu

misc-fix: unify updates of some probabilities

This commit merge the fix that unify the probability updates for UV
intra modes and partitions.

Related tracking issue:
https://bugs.chromium.org/p/webm/issues/detail?id=1040
point#5
Original libvpx commit:
d8f3bb18

Change-Id: I892383a64916364cca42d8725ad05e87bf56de90
parent 1003ed2d
......@@ -1002,17 +1002,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
aom_tree_merge_probs(av1_intra_mode_tree, pre_fc->y_mode_prob[i],
counts->y_mode[i], fc->y_mode_prob[i]);
#if !CONFIG_MISC_FIXES
for (i = 0; i < INTRA_MODES; ++i)
aom_tree_merge_probs(av1_intra_mode_tree, pre_fc->uv_mode_prob[i],
counts->uv_mode[i], fc->uv_mode_prob[i]);
for (i = 0; i < PARTITION_CONTEXTS; i++) {
aom_tree_merge_probs(av1_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]);
}
#endif
if (cm->interp_filter == SWITCHABLE) {
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
aom_tree_merge_probs(
......@@ -1096,7 +1085,6 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
counts->seg.tree_total, fc->seg.tree_probs);
}
#if CONFIG_MISC_FIXES
for (i = 0; i < INTRA_MODES; ++i)
aom_tree_merge_probs(av1_intra_mode_tree, pre_fc->uv_mode_prob[i],
counts->uv_mode[i], fc->uv_mode_prob[i]);
......@@ -1109,7 +1097,6 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
fc->partition_cdf[i]);
#endif
}
#endif
#if CONFIG_DELTA_Q
for (i = 0; i < DELTA_Q_CONTEXTS; ++i)
......
......@@ -2031,7 +2031,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#endif
}
#if CONFIG_MISC_FIXES
for (j = 0; j < INTRA_MODES; j++) {
for (i = 0; i < INTRA_MODES - 1; ++i)
av1_diff_update_prob(&r, &fc->uv_mode_prob[j][i], ACCT_STR);
......@@ -2049,7 +2048,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
fc->partition_cdf[j]);
#endif
}
#endif
if (frame_is_intra_only(cm)) {
av1_copy(cm->kf_y_prob, av1_kf_y_mode_prob);
......@@ -2097,17 +2095,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#endif
}
#if !CONFIG_MISC_FIXES
for (j = 0; j < PARTITION_CONTEXTS; ++j) {
for (i = 0; i < PARTITION_TYPES - 1; ++i)
av1_diff_update_prob(&r, &fc->partition_prob[j][i], ACCT_STR);
#if CONFIG_DAALA_EC
av1_tree_to_cdf(av1_partition_tree, fc->partition_prob[j],
fc->partition_cdf[j]);
#endif
}
#endif
#if CONFIG_REF_MV
for (i = 0; i < NMV_CONTEXTS; ++i)
read_mv_probs(&fc->nmvc[i], cm->allow_high_precision_mv, &r);
......
......@@ -2165,7 +2165,6 @@ static size_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
#endif
update_seg_probs(cpi, header_bc);
#if CONFIG_MISC_FIXES
for (i = 0; i < INTRA_MODES; ++i) {
prob_diff_update(av1_intra_mode_tree, fc->uv_mode_prob[i],
counts->uv_mode[i], INTRA_MODES, probwt, header_bc);
......@@ -2183,7 +2182,6 @@ static size_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
cm->fc->partition_cdf[i]);
#endif
}
#endif
if (frame_is_intra_only(cm)) {
av1_copy(cm->kf_y_prob, av1_kf_y_mode_prob);
......@@ -2266,18 +2264,6 @@ static size_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
#endif
}
#if !CONFIG_MISC_FIXES
for (i = 0; i < PARTITION_CONTEXTS; ++i) {
prob_diff_update(av1_partition_tree, fc->partition_prob[i],
counts->partition[i], PARTITION_TYPES, probwt,
header_bc);
#if CONFIG_DAALA_EC
av1_tree_to_cdf(av1_partition_tree, cm->fc->partition_prob[i],
cm->fc->partition_cdf[i]);
#endif
}
#endif
av1_write_nmv_probs(cm, cm->allow_high_precision_mv, header_bc,
#if CONFIG_REF_MV
counts->mv);
......
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