本文整理汇总了C#中NVorbis.DataPacket.ReadUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# DataPacket.ReadUInt32方法的具体用法?C# DataPacket.ReadUInt32怎么用?C# DataPacket.ReadUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NVorbis.DataPacket
的用法示例。
在下文中一共展示了DataPacket.ReadUInt32方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitLookupTable
void InitLookupTable(DataPacket packet)
{
MapType = (int)packet.ReadBits(4);
if (MapType == 0) return;
var minValue = Utils.ConvertFromVorbisFloat32(packet.ReadUInt32());
var deltaValue = Utils.ConvertFromVorbisFloat32(packet.ReadUInt32());
var valueBits = (int)packet.ReadBits(4) + 1;
var sequence_p = packet.ReadBit();
var lookupValueCount = Entries * Dimensions;
var lookupTable = new float[lookupValueCount];
if (MapType == 1)
{
lookupValueCount = lookup1_values();
}
var multiplicands = new uint[lookupValueCount];
for (var i = 0; i < lookupValueCount; i++)
{
multiplicands[i] = (uint)packet.ReadBits(valueBits);
}
// now that we have the initial data read in, calculate the entry tree
if (MapType == 1)
{
for (var idx = 0; idx < Entries; idx++)
{
var last = 0.0;
var idxDiv = 1;
for (var i = 0; i < Dimensions; i++)
{
var moff = (idx / idxDiv) % lookupValueCount;
var value = (float)multiplicands[moff] * deltaValue + minValue + last;
lookupTable[idx * Dimensions + i] = (float)value;
if (sequence_p) last = value;
idxDiv *= lookupValueCount;
}
}
}
else
{
for (var idx = 0; idx < Entries; idx++)
{
var last = 0.0;
var moff = idx * Dimensions;
for (var i = 0; i < Dimensions; i++)
{
var value = multiplicands[moff] * deltaValue + minValue + last;
lookupTable[idx * Dimensions + i] = (float)value;
if (sequence_p) last = value;
++moff;
}
}
}
LookupTable = lookupTable;
}
示例2: InitLookupTable
private void InitLookupTable(DataPacket packet)
{
this.MapType = (int) packet.ReadBits(4);
if (this.MapType == 0)
return;
float num1 = Utils.ConvertFromVorbisFloat32(packet.ReadUInt32());
float num2 = Utils.ConvertFromVorbisFloat32(packet.ReadUInt32());
int count = (int) packet.ReadBits(4) + 1;
bool flag = packet.ReadBit();
int length = this.Entries * this.Dimensions;
float[] numArray1 = new float[length];
if (this.MapType == 1)
length = this.lookup1_values();
uint[] numArray2 = new uint[length];
for (int index = 0; index < length; ++index)
numArray2[index] = (uint) packet.ReadBits(count);
if (this.MapType == 1)
{
for (int index1 = 0; index1 < this.Entries; ++index1)
{
double num3 = 0.0;
int num4 = 1;
for (int index2 = 0; index2 < this.Dimensions; ++index2)
{
int index3 = index1 / num4 % length;
double num5 = (double) numArray2[index3] * (double) num2 + (double) num1 + num3;
numArray1[index1 * this.Dimensions + index2] = (float) num5;
if (flag)
num3 = num5;
num4 *= length;
}
}
}
else
{
for (int index1 = 0; index1 < this.Entries; ++index1)
{
double num3 = 0.0;
int index2 = index1 * this.Dimensions;
for (int index3 = 0; index3 < this.Dimensions; ++index3)
{
double num4 = (double) numArray2[index2] * (double) num2 + (double) num1 + num3;
numArray1[index1 * this.Dimensions + index3] = (float) num4;
if (flag)
num3 = num4;
++index2;
}
}
}
this.LookupTable = numArray1;
}