diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2013-07-30 18:06:34 -0700 |
---|---|---|
committer | Dmitry Kovalev <dkovalev@google.com> | 2013-07-30 18:06:34 -0700 |
commit | 8701bc11df3dc0b043eb9c80ff5c8d16e1d6d13d (patch) | |
tree | b0df968085abaa4c35d291c5256659b35410286d /vp9/common | |
parent | 18cb8bdd206596b6a18c2d6a0258dd54b008a7f6 (diff) | |
download | libvpx-8701bc11df3dc0b043eb9c80ff5c8d16e1d6d13d.tar libvpx-8701bc11df3dc0b043eb9c80ff5c8d16e1d6d13d.tar.gz libvpx-8701bc11df3dc0b043eb9c80ff5c8d16e1d6d13d.tar.bz2 libvpx-8701bc11df3dc0b043eb9c80ff5c8d16e1d6d13d.zip |
Consistent update for inter_mode probabilities.
Using inter-mode counts instead of inter-mode-tree branch counts inside
FRAME_COUNTS structure.
Change-Id: I60dde13af37d06146d7d15543311c1b5044e9e04
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_entropymode.c | 32 | ||||
-rw-r--r-- | vp9/common/vp9_entropymode.h | 4 | ||||
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 2 |
3 files changed, 6 insertions, 32 deletions
diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c index 9ec3f4f6c..cf3b05c77 100644 --- a/vp9/common/vp9_entropymode.c +++ b/vp9/common/vp9_entropymode.c @@ -356,29 +356,6 @@ void vp9_entropy_mode_init() { vp9_inter_mode_tree, NEARESTMV); } -void vp9_accum_mv_refs(VP9_COMMON *pc, - MB_PREDICTION_MODE m, - const int context) { - unsigned int (*inter_mode_counts)[VP9_INTER_MODES - 1][2] = - pc->counts.inter_mode; - - if (m == ZEROMV) { - ++inter_mode_counts[context][0][0]; - } else { - ++inter_mode_counts[context][0][1]; - if (m == NEARESTMV) { - ++inter_mode_counts[context][1][0]; - } else { - ++inter_mode_counts[context][1][1]; - if (m == NEARMV) { - ++inter_mode_counts[context][2][0]; - } else { - ++inter_mode_counts[context][2][1]; - } - } - } -} - #define COUNT_SAT 20 #define MAX_UPDATE_FACTOR 128 @@ -425,10 +402,11 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) { fc->single_ref_prob[i][j] = update_ct2(pre_fc->single_ref_prob[i][j], counts->single_ref[i][j]); - for (j = 0; j < INTER_MODE_CONTEXTS; j++) - for (i = 0; i < VP9_INTER_MODES - 1; i++) - fc->inter_mode_probs[j][i] = update_ct2(pre_fc->inter_mode_probs[j][i], - counts->inter_mode[j][i]); + for (i = 0; i < INTER_MODE_CONTEXTS; i++) + update_mode_probs(VP9_INTER_MODES, vp9_inter_mode_tree, + counts->inter_mode[i], pre_fc->inter_mode_probs[i], + fc->inter_mode_probs[i], NEARESTMV); + for (i = 0; i < BLOCK_SIZE_GROUPS; i++) update_mode_probs(VP9_INTRA_MODES, vp9_intra_mode_tree, counts->y_mode[i], pre_fc->y_mode_prob[i], diff --git a/vp9/common/vp9_entropymode.h b/vp9/common/vp9_entropymode.h index da152cd7f..17a7c2634 100644 --- a/vp9/common/vp9_entropymode.h +++ b/vp9/common/vp9_entropymode.h @@ -67,10 +67,6 @@ void vp9_init_mbmode_probs(struct VP9Common *x); void vp9_adapt_mode_probs(struct VP9Common *); -void vp9_accum_mv_refs(struct VP9Common *pc, - MB_PREDICTION_MODE m, - const int context); - void tx_counts_to_branch_counts_32x32(unsigned int *tx_count_32x32p, unsigned int (*ct_32x32p)[2]); void tx_counts_to_branch_counts_16x16(unsigned int *tx_count_16x16p, diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 878ea314e..a8ba91475 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -64,7 +64,7 @@ typedef struct { [COEF_BANDS][PREV_COEF_CONTEXTS]; unsigned int switchable_interp[VP9_SWITCHABLE_FILTERS + 1] [VP9_SWITCHABLE_FILTERS]; - unsigned int inter_mode[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1][2]; + unsigned int inter_mode[INTER_MODE_CONTEXTS][VP9_INTER_MODES]; unsigned int intra_inter[INTRA_INTER_CONTEXTS][2]; unsigned int comp_inter[COMP_INTER_CONTEXTS][2]; unsigned int single_ref[REF_CONTEXTS][2][2]; |