本文整理汇总了C++中Coder::read_int方法的典型用法代码示例。如果您正苦于以下问题:C++ Coder::read_int方法的具体用法?C++ Coder::read_int怎么用?C++ Coder::read_int使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coder
的用法示例。
在下文中一共展示了Coder::read_int方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read_subtree
bool read_subtree(int pos, Ranges &subrange, Tree &tree) {
PropertyDecisionNode &n = tree[pos];
int p = n.property = coder.read_int(0,nb_properties)-1;
if (p != -1) {
int oldmin = subrange[p].first;
int oldmax = subrange[p].second;
if (oldmin >= oldmax) {
e_printf( "Invalid tree. Aborting tree decoding.\n");
return false;
}
n.count = coder.read_int(CONTEXT_TREE_MIN_COUNT, CONTEXT_TREE_MAX_COUNT); // * CONTEXT_TREE_COUNT_QUANTIZATION;
assert(oldmin < oldmax);
int splitval = n.splitval = coder.read_int(oldmin, oldmax-1);
int childID = n.childID = tree.size();
// e_printf( "Pos %i: prop %i splitval %i in [%i..%i]\n", pos, n.property, splitval, oldmin, oldmax-1);
tree.push_back(PropertyDecisionNode());
tree.push_back(PropertyDecisionNode());
// > splitval
subrange[p].first = splitval+1;
if (!read_subtree(childID, subrange, tree)) return false;
// <= splitval
subrange[p].first = oldmin;
subrange[p].second = splitval;
if (!read_subtree(childID+1, subrange, tree)) return false;
subrange[p].second = oldmax;
}
return true;
}
示例2: read_int
int read_int(Properties &properties, int nbits) {
#ifdef STATS
symbols++;
#endif
CompoundSymbolChances<BitChance,bits> &chances = find_leaf(properties);
set_selection_and_update_property_sums(properties,chances);
CompoundSymbolChances<BitChance,bits> &chances2 = find_leaf(properties);
return coder.read_int(chances2, selection, nbits);
}
示例3: read_int
int read_int(Properties &properties, int min, int max) {
CompoundSymbolChances<BitChance,bits> &chances = find_leaf(properties);
set_selection_and_update_property_sums(properties,chances);
CompoundSymbolChances<BitChance,bits> &chances2 = find_leaf(properties);
return coder.read_int(chances2, selection, min, max);
}