private void emitHuffRLE(HuffmanIndex h, int runLength, int v, BinaryWriter writer) { int a = v; int b = v; if (a < 0) { a = -v; b = v - 1; } uint nBits = 0; if (a < 0x100) { nBits = bitCount[a]; } else { nBits = 8 + (uint)bitCount[a >> 8]; } emitHuff(h, (int)((uint)(runLength << 4) | nBits), writer); if (nBits > 0) { emit((uint)b & (uint)((1 << ((int)nBits)) - 1), nBits, writer); } }
private void emitHuff(HuffmanIndex h, int v, BinaryWriter writer) { uint x = DefineHuffmanTableSegment.HuffmanLookUpTables[(int)h].Values[v]; emit(x & ((1 << 24) - 1), x >> 24, writer); }