Browse Source

ValuesAsInt --> Values

pull/90/head
Anton Firszov 10 years ago
parent
commit
9ee1c75d51
  1. 12
      src/ImageSharp.Formats.Jpeg/Components/Decoder/HuffmanTree.cs

12
src/ImageSharp.Formats.Jpeg/Components/Decoder/HuffmanTree.cs

@ -63,7 +63,7 @@ namespace ImageSharp.Formats.Jpg
/// <summary> /// <summary>
/// Gets the the decoded values, sorted by their encoding. /// Gets the the decoded values, sorted by their encoding.
/// </summary> /// </summary>
public int[] ValuesAsInt; public int[] Values;
/// <summary> /// <summary>
/// Gets the array of minimum codes. /// Gets the array of minimum codes.
@ -112,7 +112,7 @@ namespace ImageSharp.Formats.Jpg
public void Dispose() public void Dispose()
{ {
IntPool256.Return(this.Lut, true); IntPool256.Return(this.Lut, true);
IntPool256.Return(this.ValuesAsInt, true); IntPool256.Return(this.Values, true);
CodesPool16.Return(this.MinCodes, true); CodesPool16.Return(this.MinCodes, true);
CodesPool16.Return(this.MaxCodes, true); CodesPool16.Return(this.MaxCodes, true);
CodesPool16.Return(this.Indices, true); CodesPool16.Return(this.Indices, true);
@ -165,7 +165,7 @@ namespace ImageSharp.Formats.Jpg
for (int i = 0; i < values.Length; i++) for (int i = 0; i < values.Length; i++)
{ {
this.ValuesAsInt[i] = values[i]; this.Values[i] = values[i];
} }
} }
finally finally
@ -193,7 +193,7 @@ namespace ImageSharp.Formats.Jpg
// The high 8 bits of lutValue are the encoded value. // The high 8 bits of lutValue are the encoded value.
// The low 8 bits are 1 plus the codeLength. // The low 8 bits are 1 plus the codeLength.
int base2 = code << (7 - i); int base2 = code << (7 - i);
int lutValue = (this.ValuesAsInt[x] << 8) | (2 + i); int lutValue = (this.Values[x] << 8) | (2 + i);
for (int k = 0; k < 1 << (7 - i); k++) for (int k = 0; k < 1 << (7 - i); k++)
{ {
@ -237,7 +237,7 @@ namespace ImageSharp.Formats.Jpg
/// <returns>The value</returns> /// <returns>The value</returns>
public int GetValue(int code, int codeLength) public int GetValue(int code, int codeLength)
{ {
return this.ValuesAsInt[this.Indices[codeLength] + code - this.MinCodes[codeLength]]; return this.Values[this.Indices[codeLength] + code - this.MinCodes[codeLength]];
} }
/// <summary> /// <summary>
@ -246,7 +246,7 @@ namespace ImageSharp.Formats.Jpg
private void Init() private void Init()
{ {
this.Lut = IntPool256.Rent(MaxNCodes); this.Lut = IntPool256.Rent(MaxNCodes);
this.ValuesAsInt = IntPool256.Rent(MaxNCodes); this.Values = IntPool256.Rent(MaxNCodes);
this.MinCodes = CodesPool16.Rent(MaxCodeLength); this.MinCodes = CodesPool16.Rent(MaxCodeLength);
this.MaxCodes = CodesPool16.Rent(MaxCodeLength); this.MaxCodes = CodesPool16.Rent(MaxCodeLength);
this.Indices = CodesPool16.Rent(MaxCodeLength); this.Indices = CodesPool16.Rent(MaxCodeLength);

Loading…
Cancel
Save