示例#1
0
		private int DecodeSignificantAbsLevel(CAdaptiveHuffman pAHexpt)
		{
			int iFixed, iLevel;

			uint iIndex = (uint)pAHexpt.GetHuff(bitIO);
			System.Diagnostics.Debug.Assert( iIndex <= 6 );

			pAHexpt.m_iDiscriminant += pAHexpt.m_pDelta[iIndex];
			if (iIndex < 2)
			{
				iLevel = (int)(iIndex + 2);
			}
			else if (iIndex < 6)
			{
				iFixed = (int)Constant.aFixedLength[iIndex];
				iLevel = (int)Constant.aRemap[iIndex] + bitIO.GetBit16((uint)iFixed);
			}
			else
			{
				iFixed = (int)bitIO.GetBit16(4) + 4;
				if (iFixed == 19)
				{
					iFixed += bitIO.GetBit16(2);
					if (iFixed == 22)
					{
						iFixed += bitIO.GetBit16(3);
					}
				}
				iLevel = 2 + (1 << (byte)iFixed);
				iIndex = bitIO.GetBit32((uint)iFixed);
				iLevel += (int)iIndex;
			}

			return iLevel;
		}
示例#2
0
		private void DecodeFirstIndex(out int pIndex, out int pSign, CAdaptiveHuffman pAHexpt)
		{
			pIndex = pAHexpt.GetHuff(bitIO);
			pAHexpt.m_iDiscriminant  += pAHexpt.m_pDelta[(uint)pIndex];
			pAHexpt.m_iDiscriminant1 += pAHexpt.m_pDelta1[(uint)pIndex];
			pSign = -bitIO.GetBit16(1);
		}