/* We build coding trees compactly in arrays. Eachnodeofthetreeisapairofvpx_tree_indices. Arrayindexoftenreferencesacorrespondingprobabilitytable. Index<=0meansdoneencoding/decodingandvalue=-Index, Index>0meansneedanotherbit,specificationatindex.
Nonnegative indices are always even; processing begins at node 0. */
typedefconst vpx_tree_index vpx_tree[];
static INLINE vpx_prob get_prob(unsigned int num, unsigned int den) {
assert(den != 0);
{ const int p = (int)(((uint64_t)num * 256 + (den >> 1)) / den); // (p > 255) ? 255 : (p < 1) ? 1 : p; const int clipped_prob = p | ((255 - p) >> 23) | (p == 0); return (vpx_prob)clipped_prob;
}
}
static INLINE vpx_prob get_binary_prob(unsigned int n0, unsigned int n1) { constunsigned int den = n0 + n1;
if (den == 0) return128u; return get_prob(n0, den);
}
/* This function assumes prob1 and prob2 are already within [1,255] range. */ static INLINE vpx_prob weighted_prob(int prob1, int prob2, int factor) { return ROUND_POWER_OF_TWO(prob1 * (256 - factor) + prob2 * factor, 8);
}
static INLINE vpx_prob merge_probs(vpx_prob pre_prob, constunsigned int ct[2], unsigned int count_sat, unsigned int max_update_factor) { const vpx_prob prob = get_binary_prob(ct[0], ct[1]); constunsigned int count = VPXMIN(ct[0] + ct[1], count_sat); constunsigned int factor = max_update_factor * count / count_sat; return weighted_prob(pre_prob, prob, factor);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.