/* * Copyright (c) 2010 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
staticvoid branch_counts(int n, /* n = size of alphabet */
vp8_token tok[/* n */], vp8_tree tree, unsignedint branch_ct[/* n-1 */][2], constunsignedint num_events[/* n */]) { constint tree_len = n - 1; int t = 0;
assert(tree_len);
do {
branch_ct[t][0] = branch_ct[t][1] = 0;
} while (++t < tree_len);
t = 0;
do { int L = tok[t].Len; constint enc = tok[t].value; constunsignedint ct = num_events[t];
vp8_tree_index i = 0;
do { constint b = (enc >> --L) & 1; constint j = i >> 1;
assert(j < tree_len && 0 <= L);
branch_ct[j][b] += ct;
i = tree[i + b];
} while (i > 0);
assert(!L);
} while (++t < n);
}
void vp8_tree_probs_from_distribution(int n, /* n = size of alphabet */
vp8_token tok[/* n */], vp8_tree tree,
vp8_prob probs[/* n-1 */], unsignedint branch_ct[/* n-1 */][2], constunsignedint num_events[/* n */], unsignedint Pfactor, int Round) { constint tree_len = n - 1; int t = 0;
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.