Browse Source

Small fixes

pull/1673/head
Dmitry Pentin 5 years ago
parent
commit
158969501e
  1. 13
      src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanScanEncoder.cs

13
src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanScanEncoder.cs

@ -424,10 +424,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder
/// Calculates how many minimum bits needed to store given value for Huffman jpeg encoding. /// Calculates how many minimum bits needed to store given value for Huffman jpeg encoding.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// This method returns 0 for input value 0. This is done specificaly for huffman encoding /// This is an internal operation supposed to be used only in <see cref="HuffmanScanEncoder"/> class for jpeg encoding.
/// </remarks> /// </remarks>
/// <param name="value">The value.</param> /// <param name="value">The value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(InliningOptions.ShortMethod)]
internal static int GetHuffmanEncodingLength(uint value) internal static int GetHuffmanEncodingLength(uint value)
{ {
DebugGuard.IsTrue(value <= (1 << 16), "Huffman encoder is supposed to encode a value of 16bit size max"); DebugGuard.IsTrue(value <= (1 << 16), "Huffman encoder is supposed to encode a value of 16bit size max");
@ -456,16 +456,17 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder
} }
/// <summary> /// <summary>
/// Returns index of the last non-zero element in given mcu block /// Returns index of the last non-zero element in given mcu block.
/// </summary>
/// <remarks>
/// If all values of the mcu block are zero, this method might return different results depending on the runtime and hardware support. /// If all values of the mcu block are zero, this method might return different results depending on the runtime and hardware support.
/// This is jpeg mcu specific code, mcu[0] stores a dc value which will be encoded outside of the loop. /// This is jpeg mcu specific code, mcu[0] stores a dc value which will be encoded outside of the loop.
/// This method is guaranteed to return either -1 or 0 if all elements are zero. /// This method is guaranteed to return either -1 or 0 if all elements are zero.
/// </summary>
/// <remarks>
/// This is an internal operation supposed to be used only in <see cref="HuffmanScanEncoder"/> class for jpeg encoding.
/// </remarks> /// </remarks>
/// <param name="mcu">Mcu block.</param> /// <param name="mcu">Mcu block.</param>
/// <returns>Index of the last non-zero element.</returns> /// <returns>Index of the last non-zero element.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(InliningOptions.ShortMethod)]
internal static int GetLastValuableElementIndex(ref Block8x8F mcu) internal static int GetLastValuableElementIndex(ref Block8x8F mcu)
{ {
#if SUPPORTS_RUNTIME_INTRINSICS #if SUPPORTS_RUNTIME_INTRINSICS

Loading…
Cancel
Save