/* * 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.
*/
/* Small functions to write explicit values and tokens, as well as
estimate their lengths. */
staticvoid vp8_treed_write(vp8_writer *const w, vp8_tree t, const vp8_prob *const p, int v, int n) { /* number of bits in v, assumed nonzero */
vp8_tree_index i = 0;
do { constint b = (v >> --n) & 1;
vp8_write(w, b, p[i >> 1]);
i = t[i + b];
} while (n);
} staticINLINEvoid vp8_write_token(vp8_writer *const w, vp8_tree t, const vp8_prob *const p,
vp8_token *const x) {
vp8_treed_write(w, t, p, x->value, x->Len);
}
staticint vp8_treed_cost(vp8_tree t, const vp8_prob *const p, int v, int n) { /* number of bits in v, assumed nonzero */ int c = 0;
vp8_tree_index i = 0;
do { constint b = (v >> --n) & 1;
c += vp8_cost_bit(p[i >> 1], b);
i = t[i + b];
} while (n);
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.