vp10: allow bw adaptivity for skip/tx probabilities in keyframes.

See issue 1040 point 3.

Change-Id: Ieef6d326b7fb50ceca5936525b7c688225a11fd1
This commit is contained in:
Ronald S. Bultje 2015-10-01 10:32:57 -04:00
Родитель fee146e60b
Коммит 5f589826f3
4 изменённых файлов: 26 добавлений и 5 удалений

Просмотреть файл

@ -334,7 +334,7 @@ const vpx_tree_index vp10_switchable_interp_tree
-EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP
};
void vp10_adapt_mode_probs(VP10_COMMON *cm) {
void vp10_adapt_inter_frame_probs(VP10_COMMON *cm) {
int i, j;
FRAME_CONTEXT *fc = cm->fc;
const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
@ -377,6 +377,13 @@ void vp10_adapt_mode_probs(VP10_COMMON *cm) {
counts->switchable_interp[i],
fc->switchable_interp_prob[i]);
}
}
void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) {
int i;
FRAME_CONTEXT *fc = cm->fc;
const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
const FRAME_COUNTS *counts = &cm->counts;
if (cm->tx_mode == TX_MODE_SELECT) {
int j;

Просмотреть файл

@ -91,7 +91,8 @@ extern const vpx_tree_index vp10_switchable_interp_tree
void vp10_setup_past_independence(struct VP10Common *cm);
void vp10_adapt_mode_probs(struct VP10Common *cm);
void vp10_adapt_intra_frame_probs(struct VP10Common *cm);
void vp10_adapt_inter_frame_probs(struct VP10Common *cm);
void vp10_tx_counts_to_branch_counts_32x32(const unsigned int *tx_count_32x32p,
unsigned int (*ct_32x32p)[2]);

Просмотреть файл

@ -2330,9 +2330,15 @@ void vp10_decode_frame(VP10Decoder *pbi,
if (!xd->corrupted) {
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
vp10_adapt_coef_probs(cm);
#if CONFIG_MISC_FIXES
vp10_adapt_intra_frame_probs(cm);
#endif
if (!frame_is_intra_only(cm)) {
vp10_adapt_mode_probs(cm);
#if !CONFIG_MISC_FIXES
vp10_adapt_intra_frame_probs(cm);
#endif
vp10_adapt_inter_frame_probs(cm);
vp10_adapt_mv_probs(cm, cm->allow_high_precision_mv);
}
} else {

Просмотреть файл

@ -3653,12 +3653,19 @@ static void encode_frame_to_data_rate(VP10_COMP *cpi,
full_to_model_counts(cpi->td.counts->coef[t],
cpi->td.rd_counts.coef_counts[t]);
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD)
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
vp10_adapt_coef_probs(cm);
#if CONFIG_MISC_FIXES
vp10_adapt_intra_frame_probs(cm);
#else
if (!frame_is_intra_only(cm))
vp10_adapt_intra_frame_probs(cm);
#endif
}
if (!frame_is_intra_only(cm)) {
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
vp10_adapt_mode_probs(cm);
vp10_adapt_inter_frame_probs(cm);
vp10_adapt_mv_probs(cm, cm->allow_high_precision_mv);
}
}