本文整理汇总了C#中csogg.csBuffer.look方法的典型用法代码示例。如果您正苦于以下问题:C# csBuffer.look方法的具体用法?C# csBuffer.look怎么用?C# csBuffer.look使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类csogg.csBuffer
的用法示例。
在下文中一共展示了csBuffer.look方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: decode
// Decode side is specced and easier, because we don't need to find
// matches using different criteria; we simply read and map. There are
// two things we need to do 'depending':
//
// We may need to support interleave. We don't really, but it's
// convenient to do it here rather than rebuild the vector later.
//
// Cascades may be additive or multiplicitive; this is not inherent in
// the codebook, but set in the code using the codebook. Like
// interleaving, it's easiest to do it here.
// stage==0 -> declarative (set the value)
// stage==1 -> additive
// stage==2 -> multiplicitive
// returns the entry number or -1 on eof
internal int decode(csBuffer b)
{
int ptr=0;
DecodeAux t=decode_tree;
int lok=b.look(t.tabn);
//System.err.println(this+" "+t+" lok="+lok+", tabn="+t.tabn);
if(lok>=0)
{
ptr=t.tab[lok];
b.adv(t.tabl[lok]);
if(ptr<=0)
{
return -ptr;
}
}
do
{
switch(b.read1())
{
case 0:
ptr=t.ptr0[ptr];
break;
case 1:
ptr=t.ptr1[ptr];
break;
case -1:
default:
return(-1);
}
}
while(ptr>0);
return(-ptr);
}