diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs
index 99ed59337..ea5a57340 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs
@@ -40,7 +40,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void EnsureNBits(int n, ref InputProcessor inputProcessor)
{
- DecoderErrorCode errorCode = this.EnsureNBitsUnsafe(n, ref inputProcessor);
+ OldDecoderErrorCode errorCode = this.EnsureNBitsUnsafe(n, ref inputProcessor);
errorCode.EnsureNoError();
}
@@ -48,17 +48,17 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// Reads bytes from the byte buffer to ensure that bits.UnreadBits is at
/// least n. For best performance (avoiding function calls inside hot loops),
/// the caller is the one responsible for first checking that bits.UnreadBits < n.
- /// This method does not throw. Returns instead.
+ /// This method does not throw. Returns instead.
///
/// The number of bits to ensure.
/// The
/// Error code
- public DecoderErrorCode EnsureNBitsUnsafe(int n, ref InputProcessor inputProcessor)
+ public OldDecoderErrorCode EnsureNBitsUnsafe(int n, ref InputProcessor inputProcessor)
{
while (true)
{
- DecoderErrorCode errorCode = this.EnsureBitsStepImpl(ref inputProcessor);
- if (errorCode != DecoderErrorCode.NoError || this.UnreadBits >= n)
+ OldDecoderErrorCode errorCode = this.EnsureBitsStepImpl(ref inputProcessor);
+ if (errorCode != OldDecoderErrorCode.NoError || this.UnreadBits >= n)
{
return errorCode;
}
@@ -69,8 +69,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// Unrolled version of for n==8
///
/// The
- /// A
- public DecoderErrorCode Ensure8BitsUnsafe(ref InputProcessor inputProcessor)
+ /// A
+ public OldDecoderErrorCode Ensure8BitsUnsafe(ref InputProcessor inputProcessor)
{
return this.EnsureBitsStepImpl(ref inputProcessor);
}
@@ -79,8 +79,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// Unrolled version of for n==1
///
/// The
- /// A
- public DecoderErrorCode Ensure1BitUnsafe(ref InputProcessor inputProcessor)
+ /// A
+ public OldDecoderErrorCode Ensure1BitUnsafe(ref InputProcessor inputProcessor)
{
return this.EnsureBitsStepImpl(ref inputProcessor);
}
@@ -95,7 +95,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
public int ReceiveExtend(int t, ref InputProcessor inputProcessor)
{
int x;
- DecoderErrorCode errorCode = this.ReceiveExtendUnsafe(t, ref inputProcessor, out x);
+ OldDecoderErrorCode errorCode = this.ReceiveExtendUnsafe(t, ref inputProcessor, out x);
errorCode.EnsureNoError();
return x;
}
@@ -106,13 +106,13 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// Byte
/// The
/// Read bits value
- /// The
- public DecoderErrorCode ReceiveExtendUnsafe(int t, ref InputProcessor inputProcessor, out int x)
+ /// The
+ public OldDecoderErrorCode ReceiveExtendUnsafe(int t, ref InputProcessor inputProcessor, out int x)
{
if (this.UnreadBits < t)
{
- DecoderErrorCode errorCode = this.EnsureNBitsUnsafe(t, ref inputProcessor);
- if (errorCode != DecoderErrorCode.NoError)
+ OldDecoderErrorCode errorCode = this.EnsureNBitsUnsafe(t, ref inputProcessor);
+ if (errorCode != OldDecoderErrorCode.NoError)
{
x = int.MaxValue;
return errorCode;
@@ -129,15 +129,15 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
x += ((-1) << t) + 1;
}
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
- private DecoderErrorCode EnsureBitsStepImpl(ref InputProcessor inputProcessor)
+ private OldDecoderErrorCode EnsureBitsStepImpl(ref InputProcessor inputProcessor)
{
int c;
- DecoderErrorCode errorCode = inputProcessor.Bytes.ReadByteStuffedByteUnsafe(inputProcessor.InputStream, out c);
+ OldDecoderErrorCode errorCode = inputProcessor.Bytes.ReadByteStuffedByteUnsafe(inputProcessor.InputStream, out c);
- if (errorCode != DecoderErrorCode.NoError)
+ if (errorCode != OldDecoderErrorCode.NoError)
{
return errorCode;
}
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bytes.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bytes.cs
index 5a1be35ff..15eec0b0e 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bytes.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bytes.cs
@@ -86,8 +86,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// Input stream
/// The result byte as
- /// The
- public DecoderErrorCode ReadByteStuffedByteUnsafe(Stream inputStream, out int x)
+ /// The
+ public OldDecoderErrorCode ReadByteStuffedByteUnsafe(Stream inputStream, out int x)
{
// Take the fast path if bytes.buf contains at least two bytes.
if (this.I + 2 <= this.J)
@@ -97,48 +97,48 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
this.UnreadableBytes = 1;
if (x != OldJpegConstants.Markers.XFFInt)
{
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
if (this.BufferAsInt[this.I] != 0x00)
{
- return DecoderErrorCode.MissingFF00;
+ return OldDecoderErrorCode.MissingFF00;
}
this.I++;
this.UnreadableBytes = 2;
x = OldJpegConstants.Markers.XFF;
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
this.UnreadableBytes = 0;
- DecoderErrorCode errorCode = this.ReadByteAsIntUnsafe(inputStream, out x);
+ OldDecoderErrorCode errorCode = this.ReadByteAsIntUnsafe(inputStream, out x);
this.UnreadableBytes = 1;
- if (errorCode != DecoderErrorCode.NoError)
+ if (errorCode != OldDecoderErrorCode.NoError)
{
return errorCode;
}
if (x != OldJpegConstants.Markers.XFF)
{
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
errorCode = this.ReadByteAsIntUnsafe(inputStream, out x);
this.UnreadableBytes = 2;
- if (errorCode != DecoderErrorCode.NoError)
+ if (errorCode != OldDecoderErrorCode.NoError)
{
return errorCode;
}
if (x != 0x00)
{
- return DecoderErrorCode.MissingFF00;
+ return OldDecoderErrorCode.MissingFF00;
}
x = OldJpegConstants.Markers.XFF;
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
///
@@ -150,25 +150,25 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
public byte ReadByte(Stream inputStream)
{
byte result;
- DecoderErrorCode errorCode = this.ReadByteUnsafe(inputStream, out result);
+ OldDecoderErrorCode errorCode = this.ReadByteUnsafe(inputStream, out result);
errorCode.EnsureNoError();
return result;
}
///
/// Extracts the next byte, whether buffered or not buffered into the result out parameter. It does not care about byte stuffing.
- /// This method does not throw on format error, it returns a instead.
+ /// This method does not throw on format error, it returns a instead.
///
/// Input stream
/// The result as out parameter
- /// The
- public DecoderErrorCode ReadByteUnsafe(Stream inputStream, out byte result)
+ /// The
+ public OldDecoderErrorCode ReadByteUnsafe(Stream inputStream, out byte result)
{
- DecoderErrorCode errorCode = DecoderErrorCode.NoError;
+ OldDecoderErrorCode errorCode = OldDecoderErrorCode.NoError;
while (this.I == this.J)
{
errorCode = this.FillUnsafe(inputStream);
- if (errorCode != DecoderErrorCode.NoError)
+ if (errorCode != OldDecoderErrorCode.NoError)
{
result = 0;
return errorCode;
@@ -186,15 +186,15 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// The input stream
/// The result
- /// A
+ /// A
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public DecoderErrorCode ReadByteAsIntUnsafe(Stream inputStream, out int result)
+ public OldDecoderErrorCode ReadByteAsIntUnsafe(Stream inputStream, out int result)
{
- DecoderErrorCode errorCode = DecoderErrorCode.NoError;
+ OldDecoderErrorCode errorCode = OldDecoderErrorCode.NoError;
while (this.I == this.J)
{
errorCode = this.FillUnsafe(inputStream);
- if (errorCode != DecoderErrorCode.NoError)
+ if (errorCode != OldDecoderErrorCode.NoError)
{
result = 0;
return errorCode;
@@ -216,18 +216,18 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Fill(Stream inputStream)
{
- DecoderErrorCode errorCode = this.FillUnsafe(inputStream);
+ OldDecoderErrorCode errorCode = this.FillUnsafe(inputStream);
errorCode.EnsureNoError();
}
///
/// Fills up the bytes buffer from the underlying stream.
/// It should only be called when there are no unread bytes in bytes.
- /// This method does not throw , returns a instead!
+ /// This method does not throw , returns a instead!
///
/// Input stream
- /// The
- public DecoderErrorCode FillUnsafe(Stream inputStream)
+ /// The
+ public OldDecoderErrorCode FillUnsafe(Stream inputStream)
{
if (this.I != this.J)
{
@@ -249,7 +249,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
int n = inputStream.Read(this.Buffer, this.J, this.Buffer.Length - this.J);
if (n == 0)
{
- return DecoderErrorCode.UnexpectedEndOfStream;
+ return OldDecoderErrorCode.UnexpectedEndOfStream;
}
this.J += n;
@@ -259,7 +259,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
this.BufferAsInt[i] = this.Buffer[i];
}
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
}
}
\ No newline at end of file
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecoderThrowHelper.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecoderThrowHelper.cs
index 07c5afadb..ac13ec2e8 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecoderThrowHelper.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecoderThrowHelper.cs
@@ -14,19 +14,19 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
internal static class DecoderThrowHelper
{
///
- /// Throws an exception that belongs to the given
+ /// Throws an exception that belongs to the given
///
- /// The
+ /// The
[MethodImpl(MethodImplOptions.NoInlining)]
- public static void ThrowExceptionForErrorCode(this DecoderErrorCode errorCode)
+ public static void ThrowExceptionForErrorCode(this OldDecoderErrorCode errorCode)
{
switch (errorCode)
{
- case DecoderErrorCode.NoError:
+ case OldDecoderErrorCode.NoError:
throw new ArgumentException("ThrowExceptionForErrorCode() called with NoError!", nameof(errorCode));
- case DecoderErrorCode.MissingFF00:
+ case OldDecoderErrorCode.MissingFF00:
throw new MissingFF00Exception();
- case DecoderErrorCode.UnexpectedEndOfStream:
+ case OldDecoderErrorCode.UnexpectedEndOfStream:
throw new EOFException();
default:
throw new ArgumentOutOfRangeException(nameof(errorCode), errorCode, null);
@@ -34,26 +34,26 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
///
- /// Throws an exception if the given defines an error.
+ /// Throws an exception if the given defines an error.
///
- /// The
+ /// The
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static void EnsureNoError(this DecoderErrorCode errorCode)
+ public static void EnsureNoError(this OldDecoderErrorCode errorCode)
{
- if (errorCode != DecoderErrorCode.NoError)
+ if (errorCode != OldDecoderErrorCode.NoError)
{
ThrowExceptionForErrorCode(errorCode);
}
}
///
- /// Throws an exception if the given is .
+ /// Throws an exception if the given is .
///
- /// The
+ /// The
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static void EnsureNoEOF(this DecoderErrorCode errorCode)
+ public static void EnsureNoEOF(this OldDecoderErrorCode errorCode)
{
- if (errorCode == DecoderErrorCode.UnexpectedEndOfStream)
+ if (errorCode == OldDecoderErrorCode.UnexpectedEndOfStream)
{
errorCode.ThrowExceptionForErrorCode();
}
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs
index a9633c977..b8da0551b 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs
@@ -10,7 +10,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
using System.Runtime.CompilerServices;
///
- /// Encapsulates stream reading and processing data and operations for .
+ /// Encapsulates stream reading and processing data and operations for .
/// It's a value type for imporved data locality, and reduced number of CALLVIRT-s
///
internal struct InputProcessor : IDisposable
@@ -29,7 +29,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// Initializes a new instance of the struct.
///
/// The input
- /// Temporal buffer, same as
+ /// Temporal buffer, same as
public InputProcessor(Stream inputStream, byte[] temp)
{
this.Bits = default(Bits);
@@ -45,7 +45,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
public Stream InputStream { get; }
///
- /// Gets the temporal buffer, same instance as
+ /// Gets the temporal buffer, same instance as
///
public byte[] Temp { get; }
@@ -58,11 +58,11 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// If errorCode indicates unexpected EOF, sets to true and returns false.
/// Calls and returns true otherwise.
///
- /// The
+ /// The
/// indicating whether everything is OK
- public bool CheckEOFEnsureNoError(DecoderErrorCode errorCode)
+ public bool CheckEOFEnsureNoError(OldDecoderErrorCode errorCode)
{
- if (errorCode == DecoderErrorCode.UnexpectedEndOfStream)
+ if (errorCode == OldDecoderErrorCode.UnexpectedEndOfStream)
{
this.UnexpectedEndOfStreamReached = true;
return false;
@@ -76,11 +76,11 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// If errorCode indicates unexpected EOF, sets to true and returns false.
/// Returns true otherwise.
///
- /// The
+ /// The
/// indicating whether everything is OK
- public bool CheckEOF(DecoderErrorCode errorCode)
+ public bool CheckEOF(OldDecoderErrorCode errorCode)
{
- if (errorCode == DecoderErrorCode.UnexpectedEndOfStream)
+ if (errorCode == OldDecoderErrorCode.UnexpectedEndOfStream)
{
this.UnexpectedEndOfStreamReached = true;
return false;
@@ -112,13 +112,13 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// TODO: This method (and also the usages) could be optimized by batching!
///
/// The decoded bit as a
- /// The
- public DecoderErrorCode DecodeBitUnsafe(out bool result)
+ /// The
+ public OldDecoderErrorCode DecodeBitUnsafe(out bool result)
{
if (this.Bits.UnreadBits == 0)
{
- DecoderErrorCode errorCode = this.Bits.Ensure1BitUnsafe(ref this);
- if (errorCode != DecoderErrorCode.NoError)
+ OldDecoderErrorCode errorCode = this.Bits.Ensure1BitUnsafe(ref this);
+ if (errorCode != OldDecoderErrorCode.NoError)
{
result = false;
return errorCode;
@@ -128,18 +128,18 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
result = (this.Bits.Accumulator & this.Bits.Mask) != 0;
this.Bits.UnreadBits--;
this.Bits.Mask >>= 1;
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
///
/// Reads exactly length bytes into data. It does not care about byte stuffing.
- /// Does not throw on errors, returns instead!
+ /// Does not throw on errors, returns instead!
///
/// The data to write to.
/// The offset in the source buffer
/// The number of bytes to read
- /// The
- public DecoderErrorCode ReadFullUnsafe(byte[] data, int offset, int length)
+ /// The
+ public OldDecoderErrorCode ReadFullUnsafe(byte[] data, int offset, int length)
{
// Unread the overshot bytes, if any.
if (this.Bytes.UnreadableBytes != 0)
@@ -152,7 +152,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
this.Bytes.UnreadableBytes = 0;
}
- DecoderErrorCode errorCode = DecoderErrorCode.NoError;
+ OldDecoderErrorCode errorCode = OldDecoderErrorCode.NoError;
while (length > 0)
{
if (this.Bytes.J - this.Bytes.I >= length)
@@ -180,8 +180,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// The number of bits to decode.
/// The result
- /// The
- public DecoderErrorCode DecodeBitsUnsafe(int count, out int result)
+ /// The
+ public OldDecoderErrorCode DecodeBitsUnsafe(int count, out int result)
{
if (this.Bits.UnreadBits < count)
{
@@ -192,7 +192,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
result = result & ((1 << count) - 1);
this.Bits.UnreadBits -= count;
this.Bits.Mask >>= count;
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
///
@@ -200,8 +200,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// The huffman value
/// The decoded
- /// The
- public DecoderErrorCode DecodeHuffmanUnsafe(ref HuffmanTree huffmanTree, out int result)
+ /// The
+ public OldDecoderErrorCode DecodeHuffmanUnsafe(ref OldHuffmanTree huffmanTree, out int result)
{
result = 0;
@@ -212,11 +212,11 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
if (this.Bits.UnreadBits < 8)
{
- DecoderErrorCode errorCode = this.Bits.Ensure8BitsUnsafe(ref this);
+ OldDecoderErrorCode errorCode = this.Bits.Ensure8BitsUnsafe(ref this);
- if (errorCode == DecoderErrorCode.NoError)
+ if (errorCode == OldDecoderErrorCode.NoError)
{
- int lutIndex = (this.Bits.Accumulator >> (this.Bits.UnreadBits - HuffmanTree.LutSizeLog2)) & 0xFF;
+ int lutIndex = (this.Bits.Accumulator >> (this.Bits.UnreadBits - OldHuffmanTree.LutSizeLog2)) & 0xFF;
int v = huffmanTree.Lut[lutIndex];
if (v != 0)
@@ -236,7 +236,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
int code = 0;
- for (int i = 0; i < HuffmanTree.MaxCodeLength; i++)
+ for (int i = 0; i < OldHuffmanTree.MaxCodeLength; i++)
{
if (this.Bits.UnreadBits == 0)
{
@@ -254,7 +254,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
if (code <= huffmanTree.MaxCodes[i])
{
result = huffmanTree.GetValue(code, i);
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
code <<= 1;
@@ -264,7 +264,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
DecoderThrowHelper.ThrowImageFormatException.BadHuffmanCode();
// DUMMY RETURN! C# doesn't know we have thrown an exception!
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
///
@@ -274,17 +274,17 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Skip(int count)
{
- DecoderErrorCode errorCode = this.SkipUnsafe(count);
+ OldDecoderErrorCode errorCode = this.SkipUnsafe(count);
errorCode.EnsureNoError();
}
///
/// Skips the next n bytes.
- /// Does not throw, returns instead!
+ /// Does not throw, returns instead!
///
/// The number of bytes to ignore.
- /// The
- public DecoderErrorCode SkipUnsafe(int count)
+ /// The
+ public OldDecoderErrorCode SkipUnsafe(int count)
{
// Unread the overshot bytes, if any.
if (this.Bytes.UnreadableBytes != 0)
@@ -312,14 +312,14 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
break;
}
- DecoderErrorCode errorCode = this.Bytes.FillUnsafe(this.InputStream);
- if (errorCode != DecoderErrorCode.NoError)
+ OldDecoderErrorCode errorCode = this.Bytes.FillUnsafe(this.InputStream);
+ if (errorCode != OldDecoderErrorCode.NoError)
{
return errorCode;
}
}
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
///
@@ -331,7 +331,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ReadFull(byte[] data, int offset, int length)
{
- DecoderErrorCode errorCode = this.ReadFullUnsafe(data, offset, length);
+ OldDecoderErrorCode errorCode = this.ReadFullUnsafe(data, offset, length);
errorCode.EnsureNoError();
}
@@ -359,8 +359,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// Byte
/// Read bits value
- /// The
- public DecoderErrorCode ReceiveExtendUnsafe(int t, out int x)
+ /// The
+ public OldDecoderErrorCode ReceiveExtendUnsafe(int t, out int x)
{
return this.Bits.ReceiveExtendUnsafe(t, ref this, out x);
}
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs
index 1018fab54..d1d23dd35 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs
@@ -44,10 +44,10 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
///
- /// Dequantize, perform the inverse DCT and store the blocks to the into the corresponding instances.
+ /// Dequantize, perform the inverse DCT and store the blocks to the into the corresponding instances.
///
- /// The instance
- public void ProcessAllBlocks(JpegDecoderCore decoder)
+ /// The instance
+ public void ProcessAllBlocks(OldJpegDecoderCore decoder)
{
Buffer blockArray = decoder.DecodedBlocks[this.componentIndex];
for (int i = 0; i < blockArray.Length; i++)
@@ -57,11 +57,11 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
///
- /// Dequantize, perform the inverse DCT and store decodedBlock.Block to the into the corresponding instance.
+ /// Dequantize, perform the inverse DCT and store decodedBlock.Block to the into the corresponding instance.
///
- /// The
+ /// The
/// The
- private void ProcessBlockColors(JpegDecoderCore decoder, ref DecodedBlock decodedBlock)
+ private void ProcessBlockColors(OldJpegDecoderCore decoder, ref DecodedBlock decodedBlock)
{
this.data.Block = decodedBlock.Block;
int qtIndex = decoder.ComponentArray[this.componentIndex].Selector;
@@ -73,8 +73,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
DCT.TransformIDCT(ref *b, ref *this.pointers.Temp1, ref *this.pointers.Temp2);
- JpegPixelArea destChannel = decoder.GetDestinationChannel(this.componentIndex);
- JpegPixelArea destArea = destChannel.GetOffsetedSubAreaForBlock(decodedBlock.Bx, decodedBlock.By);
+ OldJpegPixelArea destChannel = decoder.GetDestinationChannel(this.componentIndex);
+ OldJpegPixelArea destArea = destChannel.GetOffsetedSubAreaForBlock(decodedBlock.Bx, decodedBlock.By);
destArea.LoadColorsFrom(this.pointers.Temp1, this.pointers.Temp2);
}
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecoderErrorCode.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldDecoderErrorCode.cs
similarity index 94%
rename from src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecoderErrorCode.cs
rename to src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldDecoderErrorCode.cs
index e8ce9c603..3f763c45b 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/DecoderErrorCode.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldDecoderErrorCode.cs
@@ -8,7 +8,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// Represents "recoverable" decoder errors.
///
- internal enum DecoderErrorCode
+ internal enum OldDecoderErrorCode
{
///
/// NoError
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/HuffmanTree.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldHuffmanTree.cs
similarity index 95%
rename from src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/HuffmanTree.cs
rename to src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldHuffmanTree.cs
index 108fdbd4b..a5953e3c5 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/HuffmanTree.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldHuffmanTree.cs
@@ -10,7 +10,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// Represents a Huffman tree
///
- internal struct HuffmanTree : IDisposable
+ internal struct OldHuffmanTree : IDisposable
{
///
/// The index of the AC table row
@@ -99,12 +99,12 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
private static readonly ArrayPool CodesPool16 = ArrayPool.Create(MaxCodeLength, 50);
///
- /// Creates and initializes an array of instances of size
+ /// Creates and initializes an array of instances of size
///
- /// An array of instances representing the Huffman tables
- public static HuffmanTree[] CreateHuffmanTrees()
+ /// An array of instances representing the Huffman tables
+ public static OldHuffmanTree[] CreateHuffmanTrees()
{
- HuffmanTree[] result = new HuffmanTree[NumberOfTrees];
+ OldHuffmanTree[] result = new OldHuffmanTree[NumberOfTrees];
for (int i = 0; i < MaxTc + 1; i++)
{
for (int j = 0; j < MaxTh + 1; j++)
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegPixelArea.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegPixelArea.cs
similarity index 88%
rename from src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegPixelArea.cs
rename to src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegPixelArea.cs
index db492c549..7a11d76cf 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegPixelArea.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegPixelArea.cs
@@ -14,15 +14,15 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// Represents an area of a Jpeg subimage (channel)
///
- internal struct JpegPixelArea
+ internal struct OldJpegPixelArea
{
///
- /// Initializes a new instance of the struct from existing data.
+ /// Initializes a new instance of the struct from existing data.
///
/// The pixel buffer
/// The stride
/// The offset
- public JpegPixelArea(Buffer2D pixels, int stride, int offset)
+ public OldJpegPixelArea(Buffer2D pixels, int stride, int offset)
{
this.Stride = stride;
this.Pixels = pixels;
@@ -30,11 +30,11 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
///
- /// Initializes a new instance of the struct from existing buffer.
+ /// Initializes a new instance of the struct from existing buffer.
/// will be set to of and will be set to 0.
///
/// The pixel buffer
- public JpegPixelArea(Buffer2D pixels)
+ public OldJpegPixelArea(Buffer2D pixels)
: this(pixels, pixels.Width, 0)
{
}
@@ -85,10 +85,10 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// The block X index
/// The block Y index
/// The subarea offseted by block indices
- public JpegPixelArea GetOffsetedSubAreaForBlock(int bx, int by)
+ public OldJpegPixelArea GetOffsetedSubAreaForBlock(int bx, int by)
{
int offset = this.Offset + (8 * ((by * this.Stride) + bx));
- return new JpegPixelArea(this.Pixels, this.Stride, offset);
+ return new OldJpegPixelArea(this.Pixels, this.Stride, offset);
}
///
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.ComputationData.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.ComputationData.cs
index 025f0d7b6..5250979a4 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.ComputationData.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.ComputationData.cs
@@ -32,12 +32,12 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// The buffer storing the -s for each component
///
- public fixed byte ScanData[3 * JpegDecoderCore.MaxComponents];
+ public fixed byte ScanData[3 * OldJpegDecoderCore.MaxComponents];
///
/// The DC values for each component
///
- public fixed int Dc[JpegDecoderCore.MaxComponents];
+ public fixed int Dc[OldJpegDecoderCore.MaxComponents];
///
/// Creates and initializes a new instance
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.cs
index e6ea890e7..7932c2585 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.cs
@@ -96,12 +96,12 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
private int eobRun;
///
- /// Initializes a default-constructed instance for reading data from -s stream.
+ /// Initializes a default-constructed instance for reading data from -s stream.
///
/// Pointer to on the stack
- /// The instance
+ /// The instance
/// The remaining bytes in the segment block.
- public static void InitStreamReading(OldJpegScanDecoder* p, JpegDecoderCore decoder, int remaining)
+ public static void InitStreamReading(OldJpegScanDecoder* p, OldJpegDecoderCore decoder, int remaining)
{
p->data = ComputationData.Create();
p->pointers = new DataPointers(&p->data);
@@ -109,8 +109,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
///
- /// Read Huffman data from Jpeg scans in ,
- /// and decode it as into .
+ /// Read Huffman data from Jpeg scans in ,
+ /// and decode it as into .
///
/// The blocks are traversed one MCU at a time. For 4:2:0 chroma
/// subsampling, there are four Y 8x8 blocks in every 16x16 MCU.
@@ -135,8 +135,8 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// 0 1 2
/// 3 4 5
///
- /// The instance
- public void DecodeBlocks(JpegDecoderCore decoder)
+ /// The instance
+ public void DecodeBlocks(OldJpegDecoderCore decoder)
{
int blockCount = 0;
int mcu = 0;
@@ -197,7 +197,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
// but this one assumes well-formed input, and hence the restart marker follows immediately.
if (!decoder.InputProcessor.UnexpectedEndOfStreamReached)
{
- DecoderErrorCode errorCode = decoder.InputProcessor.ReadFullUnsafe(decoder.Temp, 0, 2);
+ OldDecoderErrorCode errorCode = decoder.InputProcessor.ReadFullUnsafe(decoder.Temp, 0, 2);
if (decoder.InputProcessor.CheckEOFEnsureNoError(errorCode))
{
if (decoder.Temp[0] != 0xff || decoder.Temp[1] != expectedRst)
@@ -230,15 +230,15 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
private void ResetDc()
{
- Unsafe.InitBlock(this.pointers.Dc, default(byte), sizeof(int) * JpegDecoderCore.MaxComponents);
+ Unsafe.InitBlock(this.pointers.Dc, default(byte), sizeof(int) * OldJpegDecoderCore.MaxComponents);
}
///
/// The implementation part of as an instance method.
///
- /// The
+ /// The
/// The remaining bytes
- private void InitStreamReadingImpl(JpegDecoderCore decoder, int remaining)
+ private void InitStreamReadingImpl(OldJpegDecoderCore decoder, int remaining)
{
if (decoder.ComponentCount == 0)
{
@@ -305,10 +305,10 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
///
/// The decoder
/// The index of the scan
- private void DecodeBlock(JpegDecoderCore decoder, int scanIndex)
+ private void DecodeBlock(OldJpegDecoderCore decoder, int scanIndex)
{
Block8x8F* b = this.pointers.Block;
- int huffmannIdx = (HuffmanTree.AcTableIndex * HuffmanTree.ThRowSize) + this.pointers.ComponentScan[scanIndex].AcTableSelector;
+ int huffmannIdx = (OldHuffmanTree.AcTableIndex * OldHuffmanTree.ThRowSize) + this.pointers.ComponentScan[scanIndex].AcTableSelector;
if (this.ah != 0)
{
this.Refine(ref decoder.InputProcessor, ref decoder.HuffmanTrees[huffmannIdx], 1 << this.al);
@@ -316,14 +316,14 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
else
{
int zig = this.zigStart;
- DecoderErrorCode errorCode;
+ OldDecoderErrorCode errorCode;
if (zig == 0)
{
zig++;
// Decode the DC coefficient, as specified in section F.2.2.1.
int value;
- int huffmanIndex = (HuffmanTree.DcTableIndex * HuffmanTree.ThRowSize) + this.pointers.ComponentScan[scanIndex].DcTableSelector;
+ int huffmanIndex = (OldHuffmanTree.DcTableIndex * OldHuffmanTree.ThRowSize) + this.pointers.ComponentScan[scanIndex].DcTableSelector;
errorCode = decoder.InputProcessor.DecodeHuffmanUnsafe(
ref decoder.HuffmanTrees[huffmanIndex],
out value);
@@ -411,30 +411,30 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
}
- private DecoderErrorCode DecodeEobRun(int count, ref InputProcessor decoder)
+ private OldDecoderErrorCode DecodeEobRun(int count, ref InputProcessor decoder)
{
int bitsResult;
- DecoderErrorCode errorCode = decoder.DecodeBitsUnsafe(count, out bitsResult);
- if (errorCode != DecoderErrorCode.NoError)
+ OldDecoderErrorCode errorCode = decoder.DecodeBitsUnsafe(count, out bitsResult);
+ if (errorCode != OldDecoderErrorCode.NoError)
{
return errorCode;
}
this.eobRun |= bitsResult;
- return DecoderErrorCode.NoError;
+ return OldDecoderErrorCode.NoError;
}
///
- /// Gets the block index used to retieve blocks from in
+ /// Gets the block index used to retieve blocks from in
///
- /// The instance
+ /// The instance
/// The index
- private int GetBlockIndex(JpegDecoderCore decoder)
+ private int GetBlockIndex(OldJpegDecoderCore decoder)
{
return ((this.by * decoder.MCUCountX) * this.hi) + this.bx;
}
- private void InitComponentScan(JpegDecoderCore decoder, int i, ref OldComponentScan currentComponentScan, ref int totalHv)
+ private void InitComponentScan(OldJpegDecoderCore decoder, int i, ref OldComponentScan currentComponentScan, ref int totalHv)
{
// Component selector.
int cs = decoder.Temp[1 + (2 * i)];
@@ -459,7 +459,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
private void ProcessComponentImpl(
- JpegDecoderCore decoder,
+ OldJpegDecoderCore decoder,
int i,
ref OldComponentScan currentComponentScan,
ref int totalHv,
@@ -481,13 +481,13 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
totalHv += currentComponent.HorizontalFactor * currentComponent.VerticalFactor;
currentComponentScan.DcTableSelector = (byte)(decoder.Temp[2 + (2 * i)] >> 4);
- if (currentComponentScan.DcTableSelector > HuffmanTree.MaxTh)
+ if (currentComponentScan.DcTableSelector > OldHuffmanTree.MaxTh)
{
throw new ImageFormatException("Bad DC table selector value");
}
currentComponentScan.AcTableSelector = (byte)(decoder.Temp[2 + (2 * i)] & 0x0f);
- if (currentComponentScan.AcTableSelector > HuffmanTree.MaxTh)
+ if (currentComponentScan.AcTableSelector > OldHuffmanTree.MaxTh)
{
throw new ImageFormatException("Bad AC table selector value");
}
@@ -499,7 +499,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// The instance
/// The Huffman tree
/// The low transform offset
- private void Refine(ref InputProcessor bp, ref HuffmanTree h, int delta)
+ private void Refine(ref InputProcessor bp, ref OldHuffmanTree h, int delta)
{
Block8x8F* b = this.pointers.Block;
@@ -512,7 +512,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
bool bit;
- DecoderErrorCode errorCode = bp.DecodeBitUnsafe(out bit);
+ OldDecoderErrorCode errorCode = bp.DecodeBitUnsafe(out bit);
if (!bp.CheckEOFEnsureNoError(errorCode))
{
return;
@@ -542,7 +542,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
int z = 0;
int val;
- DecoderErrorCode errorCode = bp.DecodeHuffmanUnsafe(ref h, out val);
+ OldDecoderErrorCode errorCode = bp.DecodeHuffmanUnsafe(ref h, out val);
if (!bp.CheckEOF(errorCode))
{
return;
@@ -651,7 +651,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
}
bool bit;
- DecoderErrorCode errorCode = bp.DecodeBitUnsafe(out bit);
+ OldDecoderErrorCode errorCode = bp.DecodeBitUnsafe(out bit);
if (!bp.CheckEOFEnsureNoError(errorCode))
{
return int.MinValue;
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/YCbCrImage.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/YCbCrImage.cs
index 745ff6781..c4ec8a9f9 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/YCbCrImage.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/YCbCrImage.cs
@@ -18,17 +18,17 @@ namespace ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
// Complex value type field + mutable + available to other classes = the field MUST NOT be private :P
#pragma warning disable SA1401 // FieldsMustBePrivate
///
- /// Gets the luminance components channel as .
+ /// Gets the luminance components channel as .
///
public Buffer2D YChannel;
///
- /// Gets the blue chroma components channel as .
+ /// Gets the blue chroma components channel as .
///
public Buffer2D CbChannel;
///
- /// Gets an offseted to the Cr channel
+ /// Gets an offseted to the Cr channel
///
public Buffer2D CrChannel;
#pragma warning restore SA1401
diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/JpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/OldJpegDecoderCore.cs
similarity index 97%
rename from src/ImageSharp/Formats/Jpeg/GolangPort/JpegDecoderCore.cs
rename to src/ImageSharp/Formats/Jpeg/GolangPort/OldJpegDecoderCore.cs
index 0bd7a1660..d6b7ecbc9 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/JpegDecoderCore.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/OldJpegDecoderCore.cs
@@ -19,7 +19,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
///
/// Performs the jpeg decoding operation.
///
- internal sealed unsafe class JpegDecoderCore : IDisposable
+ internal sealed unsafe class OldJpegDecoderCore : IDisposable
{
///
/// The maximum number of color components
@@ -35,7 +35,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
#pragma warning disable SA1401 // FieldsMustBePrivate
///
- /// Encapsulates stream reading and processing data and operations for .
+ /// Encapsulates stream reading and processing data and operations for .
/// It's a value type for imporved data locality, and reduced number of CALLVIRT-s
///
public InputProcessor InputProcessor;
@@ -64,12 +64,12 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
///
/// The black image to decode to.
///
- private JpegPixelArea blackImage;
+ private OldJpegPixelArea blackImage;
///
/// A grayscale image to decode to.
///
- private JpegPixelArea grayImage;
+ private OldJpegPixelArea grayImage;
///
/// The horizontal resolution. Calculated if the image has a JFIF header.
@@ -97,15 +97,15 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
private YCbCrImage ycbcrImage;
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
/// The configuration.
/// The options.
- public JpegDecoderCore(Configuration configuration, IJpegDecoderOptions options)
+ public OldJpegDecoderCore(Configuration configuration, IJpegDecoderOptions options)
{
this.IgnoreMetadata = options.IgnoreMetadata;
this.configuration = configuration ?? Configuration.Default;
- this.HuffmanTrees = HuffmanTree.CreateHuffmanTrees();
+ this.HuffmanTrees = OldHuffmanTree.CreateHuffmanTrees();
this.QuantizationTables = new Block8x8F[MaxTq + 1];
this.Temp = new byte[2 * Block8x8F.ScalarCount];
this.ComponentArray = new OldComponent[MaxComponents];
@@ -120,7 +120,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
///
/// Gets the huffman trees
///
- public HuffmanTree[] HuffmanTrees { get; }
+ public OldHuffmanTree[] HuffmanTrees { get; }
///
/// Gets the array of -s storing the "raw" frequency-domain decoded blocks.
@@ -231,11 +231,11 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
}
///
- /// Gets the representing the channel at a given component index
+ /// Gets the representing the channel at a given component index
///
/// The component index
- /// The of the channel
- public JpegPixelArea GetDestinationChannel(int compIndex)
+ /// The of the channel
+ public OldJpegPixelArea GetDestinationChannel(int compIndex)
{
if (this.ComponentCount == 1)
{
@@ -246,11 +246,11 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
switch (compIndex)
{
case 0:
- return new JpegPixelArea(this.ycbcrImage.YChannel);
+ return new OldJpegPixelArea(this.ycbcrImage.YChannel);
case 1:
- return new JpegPixelArea(this.ycbcrImage.CbChannel);
+ return new OldJpegPixelArea(this.ycbcrImage.CbChannel);
case 2:
- return new JpegPixelArea(this.ycbcrImage.CrChannel);
+ return new OldJpegPixelArea(this.ycbcrImage.CrChannel);
case 3:
return this.blackImage;
default:
@@ -460,9 +460,9 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
}
///
- /// Process the blocks in into Jpeg image channels ( and )
+ /// Process the blocks in into Jpeg image channels ( and )
/// are in a "raw" frequency-domain form. We need to apply IDCT, dequantization and unzigging to transform them into color-space blocks.
- /// We can copy these blocks into -s afterwards.
+ /// We can copy these blocks into -s afterwards.
///
/// The pixel type
private void ProcessBlocksIntoJpegImageChannels()
@@ -480,7 +480,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
}
///
- /// Convert the pixel data in and/or into pixels of
+ /// Convert the pixel data in and/or into pixels of
///
/// The pixel type
/// The metadata for the image.
@@ -788,7 +788,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
if (this.ComponentCount == 1)
{
Buffer2D buffer = Buffer2D.CreateClean(8 * this.MCUCountX, 8 * this.MCUCountY);
- this.grayImage = new JpegPixelArea(buffer);
+ this.grayImage = new OldJpegPixelArea(buffer);
}
else
{
@@ -828,7 +828,7 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
int v3 = this.ComponentArray[3].VerticalFactor;
Buffer2D buffer = Buffer2D.CreateClean(8 * h3 * this.MCUCountX, 8 * v3 * this.MCUCountY);
- this.blackImage = new JpegPixelArea(buffer);
+ this.blackImage = new OldJpegPixelArea(buffer);
}
}
}
@@ -1062,18 +1062,18 @@ namespace ImageSharp.Formats.Jpeg.GolangPort
this.InputProcessor.ReadFull(this.Temp, 0, 17);
int tc = this.Temp[0] >> 4;
- if (tc > HuffmanTree.MaxTc)
+ if (tc > OldHuffmanTree.MaxTc)
{
throw new ImageFormatException("Bad Tc value");
}
int th = this.Temp[0] & 0x0f;
- if (th > HuffmanTree.MaxTh || (!this.IsProgressive && (th > 1)))
+ if (th > OldHuffmanTree.MaxTh || (!this.IsProgressive && (th > 1)))
{
throw new ImageFormatException("Bad Th value");
}
- int huffTreeIndex = (tc * HuffmanTree.ThRowSize) + th;
+ int huffTreeIndex = (tc * OldHuffmanTree.ThRowSize) + th;
this.HuffmanTrees[huffTreeIndex].ProcessDefineHuffmanTablesMarkerLoop(
ref this.InputProcessor,
this.Temp,
diff --git a/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs b/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs
index 90816ec13..840f5d83f 100644
--- a/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs
+++ b/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs
@@ -65,7 +65,7 @@ namespace ImageSharp.Benchmarks.Image
{
Guard.NotNull(stream, "stream");
- using (var decoder = new JpegDecoderCore(configuration, this))
+ using (var decoder = new OldJpegDecoderCore(configuration, this))
{
return decoder.Decode(stream);
}
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
index 672c83895..836f97e58 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
@@ -174,7 +174,7 @@ namespace ImageSharp.Tests
image.Save(ms, new JpegEncoder());
ms.Seek(0, SeekOrigin.Begin);
- using (var decoder = new JpegDecoderCore(null, new JpegDecoder()))
+ using (var decoder = new OldJpegDecoderCore(null, new JpegDecoder()))
{
decoder.Decode(ms);
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs
index 690b65ff9..e8716d4aa 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs
@@ -64,7 +64,7 @@ namespace ImageSharp.Tests
Assert.Equal(img.CrChannel.Width, 400 / expectedCStrideDiv);
}
- private void PrintChannel(string name, JpegPixelArea channel)
+ private void PrintChannel(string name, OldJpegPixelArea channel)
{
this.Output.WriteLine($"{name}: Stride={channel.Stride}");
}