Browse Source

Normalize HEIF internal member visibility

pull/2633/head
James Jackson-South 3 days ago
parent
commit
6e906fed4d
  1. 2
      src/ImageSharp/Formats/Heif/Av1/Av1BitStreamReader.cs
  2. 6
      src/ImageSharp/Formats/Heif/Av1/Av1BitStreamWriter.cs
  3. 32
      src/ImageSharp/Formats/Heif/Av1/Av1Math.cs
  4. 38
      src/ImageSharp/Formats/Heif/Av1/Entropy/Av1SymbolContextHelper.cs
  5. 20
      src/ImageSharp/Formats/Heif/Av1/ModeDecision/Av1BlockGeometry.cs
  6. 4
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuConstraintDirectionalEnhancementFilterParameters.cs
  7. 8
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuDecoderModelInfo.cs
  8. 6
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuDeltaParameters.cs
  9. 12
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuLoopFilterParameters.cs
  10. 4
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuLoopRestorationItem.cs
  11. 12
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuLoopRestorationParameters.cs
  12. 14
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuOperatingPoint.cs
  13. 10
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuQuantizationParameters.cs
  14. 4
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuReader.cs
  15. 18
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuSegmentationParameters.cs
  16. 30
      src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuTileGroupHeader.cs
  17. 38
      src/ImageSharp/Formats/Heif/Av1/Prediction/Inter/Av1InterPredictor.Arithmetic.cs
  18. 2
      src/ImageSharp/Formats/Heif/Av1/Prediction/Inter/Av1InterPredictor.Operator.cs
  19. 6
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EncoderBlockModeInfo.cs
  20. 4
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EncoderBlockStruct.cs
  21. 10
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EncoderCommon.cs
  22. 4
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EncoderPredictionUnit.cs
  23. 8
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EntropyCodingContext.cs
  24. 2
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1FrameInfo.cs
  25. 2
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1LevelBuffer.cs
  26. 26
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1MacroBlockD.cs
  27. 6
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1MacroBlockModeInfo.cs
  28. 2
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1ModeInfo.cs
  29. 2
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1NeighborArrayUnit.cs
  30. 4
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PartitionContext.cs
  31. 2
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PartitionInfo.cs
  32. 28
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PictureControlSet.cs
  33. 14
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PictureParentControlSet.cs
  34. 4
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SequenceControlSet.cs
  35. 4
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1Superblock.cs
  36. 2
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SuperblockGeometry.cs
  37. 6
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SuperblockInfo.cs
  38. 4
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TileReader.cs
  39. 2
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TileWriter.cs
  40. 10
      src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TransformInfo.cs
  41. 2
      src/ImageSharp/Formats/Heif/Av1/Transform/Av1InverseTransformMath.cs
  42. 12
      src/ImageSharp/Formats/Heif/Av1/Transform/Av1TransformFunctionParameters.cs
  43. 4
      src/ImageSharp/Formats/Heif/Hevc/HevcSliceSegmentHeader.cs

2
src/ImageSharp/Formats/Heif/Av1/Av1BitStreamReader.cs

@ -62,7 +62,7 @@ internal ref struct Av1BitStreamReader
/// Reads the next encoded bit.
/// </summary>
/// <returns>Zero or one.</returns>
internal uint ReadBit()
public uint ReadBit()
{
int byteOffset = Av1Math.DivideBy8Floor(this.BitPosition);
byte shift = (byte)(7 - Av1Math.Modulus8(this.BitPosition));

6
src/ImageSharp/Formats/Heif/Av1/Av1BitStreamWriter.cs

@ -126,7 +126,7 @@ internal ref struct Av1BitStreamWriter
/// Writes one Boolean bit.
/// </summary>
/// <param name="value">The Boolean value.</param>
internal void WriteBoolean(bool value)
public void WriteBoolean(bool value)
{
byte boolByte = value ? (byte)1 : (byte)0;
this.WriteBit(boolByte);
@ -172,7 +172,7 @@ internal ref struct Av1BitStreamWriter
/// </summary>
/// <param name="value">The symbol value.</param>
/// <param name="numberOfSymbols">The number of symbols in the alphabet.</param>
internal void WriteNonSymmetric(uint value, uint numberOfSymbols)
public void WriteNonSymmetric(uint value, uint numberOfSymbols)
{
if (numberOfSymbols <= 1)
{
@ -231,7 +231,7 @@ internal ref struct Av1BitStreamWriter
/// Writes a byte-aligned entropy-coded tile payload.
/// </summary>
/// <param name="tileData">The tile payload.</param>
internal void WriteBlob(ReadOnlySpan<byte> tileData)
public void WriteBlob(ReadOnlySpan<byte> tileData)
{
DebugGuard.IsTrue(Av1Math.Modulus8(this.BitPosition) == 0, "Writing of Tile Data only allowed on byte alignment");

32
src/ImageSharp/Formats/Heif/Av1/Av1Math.cs

@ -55,7 +55,7 @@ internal static class Av1Math
/// </summary>
/// <param name="x">The value.</param>
/// <returns>The zero-based position of the most significant set bit.</returns>
internal static uint Log2_32(uint x)
public static uint Log2_32(uint x)
{
uint log = 0;
int i;
@ -178,7 +178,7 @@ internal static class Av1Math
/// <param name="value">The value to align.</param>
/// <param name="n">The base-two alignment exponent.</param>
/// <returns>The aligned value.</returns>
internal static int AlignPowerOf2(int value, int n)
public static int AlignPowerOf2(int value, int n)
{
int mask = (1 << n) - 1;
return (value + mask) & ~mask;
@ -190,7 +190,7 @@ internal static class Av1Math
/// <param name="value">The value.</param>
/// <param name="n">The base-two divisor exponent.</param>
/// <returns>The rounded quotient.</returns>
internal static int RoundPowerOf2(int value, int n) => (value + ((1 << n) >> 1)) >> n;
public static int RoundPowerOf2(int value, int n) => (value + ((1 << n) >> 1)) >> n;
/// <summary>
/// Clamps a signed integer to an inclusive range.
@ -199,7 +199,7 @@ internal static class Av1Math
/// <param name="low">The inclusive lower bound.</param>
/// <param name="high">The inclusive upper bound.</param>
/// <returns>The clamped value.</returns>
internal static int Clamp(int value, int low, int high)
public static int Clamp(int value, int low, int high)
=> Math.Max(low, Math.Min(high, value));
/// <summary>
@ -209,7 +209,7 @@ internal static class Av1Math
/// <param name="low">The inclusive lower bound.</param>
/// <param name="high">The inclusive upper bound.</param>
/// <returns>The clamped value.</returns>
internal static long Clamp(long value, long low, long high)
public static long Clamp(long value, long low, long high)
=> Math.Max(low, Math.Min(high, value));
/// <summary>
@ -218,7 +218,7 @@ internal static class Av1Math
/// <param name="value">The value.</param>
/// <param name="n">The base-two divisor exponent.</param>
/// <returns>The floor-rounded quotient.</returns>
internal static int DivideLog2Floor(int value, int n)
public static int DivideLog2Floor(int value, int n)
=> value >> n;
/// <summary>
@ -227,7 +227,7 @@ internal static class Av1Math
/// <param name="value">The value.</param>
/// <param name="n">The base-two divisor exponent.</param>
/// <returns>The ceiling-rounded quotient.</returns>
internal static int DivideLog2Ceiling(int value, int n)
public static int DivideLog2Ceiling(int value, int n)
=> (value + (1 << n) - 1) >> n;
/// <summary>
@ -236,7 +236,7 @@ internal static class Av1Math
/// <param name="value">The value.</param>
/// <param name="bitCount">The base-two divisor exponent.</param>
/// <returns>The rounded quotient.</returns>
internal static int DivideRound(int value, int bitCount)
public static int DivideRound(int value, int bitCount)
=> (value + (1 << (bitCount - 1))) >> bitCount;
/// <summary>
@ -244,14 +244,14 @@ internal static class Av1Math
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The low three bits of the value.</returns>
internal static int Modulus8(int value) => value & 0x07;
public static int Modulus8(int value) => value & 0x07;
/// <summary>
/// Divides a value by eight with floor rounding.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The floor-rounded quotient.</returns>
internal static int DivideBy8Floor(int value) => value >> 3;
public static int DivideBy8Floor(int value) => value >> 3;
/// <summary>
/// Divides a signed value by a power of two with symmetric nearest-integer rounding.
@ -259,7 +259,7 @@ internal static class Av1Math
/// <param name="value">The signed value.</param>
/// <param name="n">The base-two divisor exponent.</param>
/// <returns>The signed rounded quotient.</returns>
internal static int RoundPowerOf2Signed(int value, int n)
public static int RoundPowerOf2Signed(int value, int n)
=> (value < 0) ? -RoundPowerOf2(-value, n) : RoundPowerOf2(value, n);
/// <summary>
@ -268,7 +268,7 @@ internal static class Av1Math
/// <param name="value">The value.</param>
/// <param name="bit">The positive shift count.</param>
/// <returns>The rounded signed result.</returns>
internal static int RoundShift(long value, int bit)
public static int RoundShift(long value, int bit)
{
DebugGuard.MustBeGreaterThanOrEqualTo(bit, 1, nameof(bit));
return (int)((value + (1L << (bit - 1))) >> bit);
@ -280,7 +280,7 @@ internal static class Av1Math
/// <param name="a">The antecedent.</param>
/// <param name="b">The consequent.</param>
/// <returns><see langword="false"/> only when <paramref name="a"/> is true and <paramref name="b"/> is false.</returns>
internal static bool Implies(bool a, bool b) => !a || b;
public static bool Implies(bool a, bool b) => !a || b;
/// <summary>
/// Gets one bit from an integer value.
@ -288,7 +288,7 @@ internal static class Av1Math
/// <param name="value">The value.</param>
/// <param name="n">The zero-based bit position.</param>
/// <returns>Zero or one.</returns>
internal static int GetBit(int value, int n)
public static int GetBit(int value, int n)
=> (value & (1 << n)) >> n;
/// <summary>
@ -296,7 +296,7 @@ internal static class Av1Math
/// </summary>
/// <param name="endOfBlockExtra">The value to update.</param>
/// <param name="n">The zero-based bit position.</param>
internal static void SetBit(ref int endOfBlockExtra, int n)
public static void SetBit(ref int endOfBlockExtra, int n)
=> endOfBlockExtra |= 1 << n;
/// <summary>
@ -305,5 +305,5 @@ internal static class Av1Math
/// <param name="a">The first value.</param>
/// <param name="b">The second value.</param>
/// <returns>The nonnegative absolute difference.</returns>
internal static int AbsoluteDifference(int a, int b) => (a > b) ? a - b : b - a;
public static int AbsoluteDifference(int a, int b) => (a > b) ? a - b : b - a;
}

38
src/ImageSharp/Formats/Heif/Av1/Entropy/Av1SymbolContextHelper.cs

@ -265,7 +265,7 @@ internal static class Av1SymbolContextHelper
/// </summary>
/// <param name="originalSize">The coded transform size.</param>
/// <returns>The square transform-size context.</returns>
internal static Av1TransformSize GetTransformSizeContext(Av1TransformSize originalSize)
public static Av1TransformSize GetTransformSizeContext(Av1TransformSize originalSize)
=> (Av1TransformSize)(((int)originalSize.GetSquareSize() + (int)originalSize.GetSquareUpSize() + 1) >> 1);
/// <summary>
@ -290,7 +290,7 @@ internal static class Av1SymbolContextHelper
/// <param name="endOfBlockPoint">The decoded end-of-block token.</param>
/// <param name="endOfBlockExtra">The decoded offset within the token group.</param>
/// <returns>The one-based end-of-block coefficient position.</returns>
internal static int RecordEndOfBlockPosition(int endOfBlockPoint, int endOfBlockExtra)
public static int RecordEndOfBlockPosition(int endOfBlockPoint, int endOfBlockExtra)
{
int endOfBlock = EndOfBlockGroupStart[endOfBlockPoint];
if (endOfBlock > 2)
@ -307,7 +307,7 @@ internal static class Av1SymbolContextHelper
/// <param name="levels">The padded coefficient-level buffer.</param>
/// <param name="position">The coordinate whose row-major index identifies the coefficient's scan position.</param>
/// <returns>The end-of-block lower-level context.</returns>
internal static int GetLowerLevelContextEndOfBlock(Av1LevelBuffer levels, Point position)
public static int GetLowerLevelContextEndOfBlock(Av1LevelBuffer levels, Point position)
=> GetLowerLevelContextEndOfBlock(levels, position.X + (position.Y * levels.Size.Width));
/// <summary>
@ -316,7 +316,7 @@ internal static class Av1SymbolContextHelper
/// <param name="levels">The padded coefficient-level buffer.</param>
/// <param name="scanIndex">The zero-based coefficient index in scan order.</param>
/// <returns>The end-of-block lower-level context.</returns>
internal static int GetLowerLevelContextEndOfBlock(Av1LevelBuffer levels, int scanIndex)
public static int GetLowerLevelContextEndOfBlock(Av1LevelBuffer levels, int scanIndex)
{
if (scanIndex == 0)
{
@ -344,7 +344,7 @@ internal static class Av1SymbolContextHelper
/// <param name="position">The coefficient position in raster order.</param>
/// <param name="transformSize">The transform size selecting the positional context offset.</param>
/// <returns>The lower-level context.</returns>
internal static int GetLowerLevelsContext2d(Av1LevelBuffer levelBuffer, Point position, Av1TransformSize transformSize)
public static int GetLowerLevelsContext2d(Av1LevelBuffer levelBuffer, Point position, Av1TransformSize transformSize)
{
DebugGuard.MustBeGreaterThan(position.X + position.Y, 0, nameof(position));
int mag;
@ -369,7 +369,7 @@ internal static class Av1SymbolContextHelper
/// <param name="pos">The final nonzero coefficient position.</param>
/// <param name="transformClass">The transform direction class.</param>
/// <returns>The base-range context.</returns>
internal static int GetBaseRangeContextEndOfBlock(Point pos, Av1TransformClass transformClass)
public static int GetBaseRangeContextEndOfBlock(Point pos, Av1TransformClass transformClass)
{
if (pos.X == 0 && pos.Y == 0)
{
@ -394,7 +394,7 @@ internal static class Av1SymbolContextHelper
/// <param name="position">The coefficient position in raster order.</param>
/// <param name="transformClass">The transform direction class.</param>
/// <returns>The base-range context.</returns>
internal static int GetBaseRangeContext(Av1LevelBuffer levels, Point position, Av1TransformClass transformClass)
public static int GetBaseRangeContext(Av1LevelBuffer levels, Point position, Av1TransformClass transformClass)
{
Span<byte> row0 = levels.GetRow(position.Y);
Span<byte> row1 = levels.GetRow(position.Y + 1);
@ -457,7 +457,7 @@ internal static class Av1SymbolContextHelper
/// <param name="levels">The padded coefficient-level buffer.</param>
/// <param name="position">The coefficient position in raster order.</param>
/// <returns>The two-dimensional base-range context.</returns>
internal static int GetBaseRangeContext2d(Av1LevelBuffer levels, Point position)
public static int GetBaseRangeContext2d(Av1LevelBuffer levels, Point position)
{
DebugGuard.MustBeGreaterThan(position.X + position.Y, 0, nameof(position));
Span<byte> row0 = levels.GetRow(position.Y);
@ -486,7 +486,7 @@ internal static class Av1SymbolContextHelper
/// <param name="transformSize">The coded transform size.</param>
/// <param name="transformClass">The transform direction class.</param>
/// <returns>The lower-level coefficient context.</returns>
internal static int GetLowerLevelsContext(Av1LevelBuffer levels, Point position, Av1TransformSize transformSize, Av1TransformClass transformClass)
public static int GetLowerLevelsContext(Av1LevelBuffer levels, Point position, Av1TransformSize transformSize, Av1TransformClass transformClass)
{
int stats = Av1NzMap.GetNzMagnitude(levels, position, transformClass);
return Av1NzMap.GetNzMapContextFromStats(stats, position, transformSize, transformClass);
@ -498,7 +498,7 @@ internal static class Av1SymbolContextHelper
/// <param name="transformSize">The coded transform size.</param>
/// <param name="useReducedSet">Indicates whether the frame restricts transform choices.</param>
/// <returns>The permitted transform set.</returns>
internal static Av1TransformSetType GetExtendedTransformSetType(Av1TransformSize transformSize, bool useReducedSet)
public static Av1TransformSetType GetExtendedTransformSetType(Av1TransformSize transformSize, bool useReducedSet)
=> GetExtendedTransformSetType(transformSize, false, useReducedSet);
/// <summary>
@ -508,7 +508,7 @@ internal static class Av1SymbolContextHelper
/// <param name="isInter">Indicates whether the block uses inter prediction.</param>
/// <param name="useReducedSet">Indicates whether the frame restricts transform choices.</param>
/// <returns>The permitted transform set.</returns>
internal static Av1TransformSetType GetExtendedTransformSetType(Av1TransformSize transformSize, bool isInter, bool useReducedSet)
public static Av1TransformSetType GetExtendedTransformSetType(Av1TransformSize transformSize, bool isInter, bool useReducedSet)
{
Av1TransformSize squareUpSize = transformSize.GetSquareUpSize();
@ -544,7 +544,7 @@ internal static class Av1SymbolContextHelper
/// <param name="modeInfo">The block prediction modes.</param>
/// <param name="planeType">The luma or chroma plane category.</param>
/// <returns>The transform type associated with the selected prediction mode.</returns>
internal static Av1TransformType ConvertIntraModeToTransformType(Av1BlockModeInfo modeInfo, Av1PlaneType planeType)
public static Av1TransformType ConvertIntraModeToTransformType(Av1BlockModeInfo modeInfo, Av1PlaneType planeType)
{
// libaom's get_uv_mode() is the explicit boundary between the distinct UV and luma prediction domains. CfL maps
// to DC because the chroma AC contribution is applied to a DC predictor before coefficient reconstruction.
@ -561,7 +561,7 @@ internal static class Av1SymbolContextHelper
/// <param name="transformSize">The coded transform size.</param>
/// <param name="transformClass">The transform direction class.</param>
/// <returns>The nonzero-map context.</returns>
internal static sbyte GetNzMapContext(
public static sbyte GetNzMapContext(
Av1LevelBuffer levels,
Point position,
Av1TransformSize transformSize,
@ -580,7 +580,7 @@ internal static class Av1SymbolContextHelper
/// <param name="transformSize">The coded transform size.</param>
/// <param name="transformClass">The transform direction class.</param>
/// <param name="coefficientContexts">The raster-indexed destination contexts.</param>
internal static void GetNzMapContexts(
public static void GetNzMapContexts(
Av1LevelBuffer levels,
ReadOnlySpan<short> scan,
ushort eob,
@ -624,14 +624,14 @@ internal static class Av1SymbolContextHelper
/// </summary>
/// <param name="setType">The transform set.</param>
/// <returns>The number of permitted transform types.</returns>
internal static int GetExtendedTransformTypeCount(Av1TransformSetType setType) => ExtendedTransformTypeCounts[(int)setType];
public static int GetExtendedTransformTypeCount(Av1TransformSetType setType) => ExtendedTransformTypeCounts[(int)setType];
/// <summary>
/// Gets the entropy-distribution index for an intra transform set.
/// </summary>
/// <param name="setType">The transform set.</param>
/// <returns>The distribution index, or <c>-1</c> for an inter-only set.</returns>
internal static int GetExtendedTransformSet(Av1TransformSetType setType)
public static int GetExtendedTransformSet(Av1TransformSetType setType)
=> GetExtendedTransformSet(setType, false);
/// <summary>
@ -640,7 +640,7 @@ internal static class Av1SymbolContextHelper
/// <param name="setType">The transform set.</param>
/// <param name="isInter">Indicates whether the block uses inter prediction.</param>
/// <returns>The distribution index, or <c>-1</c> when the set is unavailable for the prediction class.</returns>
internal static int GetExtendedTransformSet(Av1TransformSetType setType, bool isInter)
public static int GetExtendedTransformSet(Av1TransformSetType setType, bool isInter)
=> ExtendedTransformSetToIndex[((isInter ? 1 : 0) * TransformSetCount) + (int)setType];
/// <summary>
@ -648,7 +648,7 @@ internal static class Av1SymbolContextHelper
/// </summary>
/// <param name="culLevel">The cumulative-level context to update.</param>
/// <param name="dcValue">The signed DC coefficient.</param>
internal static void SetDcSign(ref int culLevel, int dcValue)
public static void SetDcSign(ref int culLevel, int dcValue)
{
if (dcValue < 0)
{
@ -666,7 +666,7 @@ internal static class Av1SymbolContextHelper
/// <param name="endOfBlock">The one-based end-of-block position.</param>
/// <param name="extra">Receives the offset within the selected token group.</param>
/// <returns>The end-of-block token.</returns>
internal static short GetEndOfBlockPosition(ushort endOfBlock, out int extra)
public static short GetEndOfBlockPosition(ushort endOfBlock, out int extra)
{
short t;
if (endOfBlock < 33)

20
src/ImageSharp/Formats/Heif/Av1/ModeDecision/Av1BlockGeometry.cs

@ -39,7 +39,7 @@ internal class Av1BlockGeometry
public Av1BlockSize BlockSize
{
get => this.blockSize;
internal set
set
{
this.blockSize = value;
this.BlockWidth = value.GetWidth();
@ -53,7 +53,7 @@ internal class Av1BlockGeometry
public Av1BlockSize BlockSizeUv
{
get => this.blockSizeUv;
internal set
set
{
this.blockSizeUv = value;
this.BlockWidthUv = value.GetWidth();
@ -64,12 +64,12 @@ internal class Av1BlockGeometry
/// <summary>
/// Gets or sets the block origin in pixels relative to the top-left corner of its superblock.
/// </summary>
public Point Origin { get; internal set; }
public Point Origin { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this luma block owns chroma samples in the mode-decision layout.
/// </summary>
public bool HasUv { get; internal set; }
public bool HasUv { get; set; }
/// <summary>
/// Gets the luma block width in pixels.
@ -124,17 +124,17 @@ internal class Av1BlockGeometry
/// <summary>
/// Gets or sets the mode-decision indices of blocks with the same size and origin as this block.
/// </summary>
public List<int> RedunancyList { get; internal set; }
public List<int> RedunancyList { get; set; }
/// <summary>
/// Gets or sets the zero-based component index of this block within a non-square partition.
/// </summary>
public int NonSquareIndex { get; internal set; }
public int NonSquareIndex { get; set; }
/// <summary>
/// Gets or sets the number of component blocks produced by this partition shape.
/// </summary>
public int TotalNonSuareCount { get; internal set; }
public int TotalNonSuareCount { get; set; }
/// <summary>
/// Gets the chroma block width in pixels.
@ -149,15 +149,15 @@ internal class Av1BlockGeometry
/// <summary>
/// Gets or sets the quadtree depth of this block within its superblock.
/// </summary>
public int Depth { get; internal set; }
public int Depth { get; set; }
/// <summary>
/// Gets or sets the width and height, in pixels, of the square sequence region that produced this block.
/// </summary>
public int SequenceSize { get; internal set; }
public int SequenceSize { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this block belongs to the last quadrant of its parent.
/// </summary>
public bool IsLastQuadrant { get; internal set; }
public bool IsLastQuadrant { get; set; }
}

4
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuConstraintDirectionalEnhancementFilterParameters.cs

@ -11,12 +11,12 @@ internal class ObuConstraintDirectionalEnhancementFilterParameters
/// <summary>
/// Gets or sets the number of bits used to select a filter-strength entry.
/// </summary>
public int BitCount { get; internal set; }
public int BitCount { get; set; }
/// <summary>
/// Gets or sets the filter damping value.
/// </summary>
public int Damping { get; internal set; } = 3;
public int Damping { get; set; } = 3;
/// <summary>
/// Gets or sets the primary and secondary luma strengths for each filter entry.

8
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuDecoderModelInfo.cs

@ -12,21 +12,21 @@ internal class ObuDecoderModelInfo
/// Gets or sets BufferDelayLength. Specifies the length of the decoder_buffer_delay and the encoder_buffer_delay
/// syntax elements, in bits.
/// </summary>
internal uint BufferDelayLength { get; set; }
public uint BufferDelayLength { get; set; }
/// <summary>
/// Gets or sets NumUnitsInDecodingTick. This is the number of time units of a decoding clock operating at the frequency time_scale Hz
/// that corresponds to one increment of a clock tick counter.
/// </summary>
internal uint NumUnitsInDecodingTick { get; set; }
public uint NumUnitsInDecodingTick { get; set; }
/// <summary>
/// Gets or sets BufferRemovalTimeLength. Specifies the length of the buffer_removal_time syntax element, in bits.
/// </summary>
internal uint BufferRemovalTimeLength { get; set; }
public uint BufferRemovalTimeLength { get; set; }
/// <summary>
/// Gets or sets the FramePresentationTimeLength. Specifies the length of the frame_presentation_time syntax element, in bits.
/// </summary>
internal uint FramePresentationTimeLength { get; set; }
public uint FramePresentationTimeLength { get; set; }
}

6
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuDeltaParameters.cs

@ -11,15 +11,15 @@ internal class ObuDeltaParameters
/// <summary>
/// Gets or sets a value indicating whether per-block delta values are present.
/// </summary>
public bool IsPresent { get; internal set; }
public bool IsPresent { get; set; }
/// <summary>
/// Gets or sets the delta-value multiplier, which is one, two, four, or eight.
/// </summary>
public int Resolution { get; internal set; }
public int Resolution { get; set; }
/// <summary>
/// Gets or sets a value indicating whether separate loop-filter deltas are signaled for multiple filter targets.
/// </summary>
public bool IsMulti { get; internal set; }
public bool IsMulti { get; set; }
}

12
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuLoopFilterParameters.cs

@ -21,32 +21,32 @@ internal class ObuLoopFilterParameters
/// <summary>
/// Gets or sets the horizontal and vertical luma filter levels.
/// </summary>
public int[] FilterLevel { get; internal set; } = new int[2];
public int[] FilterLevel { get; set; } = new int[2];
/// <summary>
/// Gets or sets the U-plane filter level.
/// </summary>
public int FilterLevelU { get; internal set; }
public int FilterLevelU { get; set; }
/// <summary>
/// Gets or sets the V-plane filter level.
/// </summary>
public int FilterLevelV { get; internal set; }
public int FilterLevelV { get; set; }
/// <summary>
/// Gets or sets the filter sharpness level.
/// </summary>
public int SharpnessLevel { get; internal set; }
public int SharpnessLevel { get; set; }
/// <summary>
/// Gets or sets a value indicating whether reference-frame and mode deltas are enabled.
/// </summary>
public bool ReferenceDeltaModeEnabled { get; internal set; }
public bool ReferenceDeltaModeEnabled { get; set; }
/// <summary>
/// Gets or sets a value indicating whether reference-frame and mode deltas are updated by this frame.
/// </summary>
public bool ReferenceDeltaModeUpdate { get; internal set; }
public bool ReferenceDeltaModeUpdate { get; set; }
/// <summary>
/// Gets the filter-level deltas for the AV1 reference-frame categories.

4
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuLoopRestorationItem.cs

@ -11,10 +11,10 @@ internal class ObuLoopRestorationItem
/// <summary>
/// Gets or sets the restoration-unit size, in samples.
/// </summary>
internal int Size { get; set; }
public int Size { get; set; }
/// <summary>
/// Gets or sets the restoration filter type.
/// </summary>
internal ObuRestorationType Type { get; set; } = ObuRestorationType.None;
public ObuRestorationType Type { get; set; } = ObuRestorationType.None;
}

12
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuLoopRestorationParameters.cs

@ -11,7 +11,7 @@ internal class ObuLoopRestorationParameters
/// <summary>
/// Initializes a new instance of the <see cref="ObuLoopRestorationParameters"/> class.
/// </summary>
internal ObuLoopRestorationParameters()
public ObuLoopRestorationParameters()
{
// AV1 addresses restoration state by plane, so all three plane entries must exist even
// when the active color configuration uses fewer planes.
@ -24,25 +24,25 @@ internal class ObuLoopRestorationParameters
/// <summary>
/// Gets or sets a value indicating whether any plane uses loop restoration.
/// </summary>
internal bool UsesLoopRestoration { get; set; }
public bool UsesLoopRestoration { get; set; }
/// <summary>
/// Gets or sets a value indicating whether either chroma plane uses loop restoration.
/// </summary>
internal bool UsesChromaLoopRestoration { get; set; }
public bool UsesChromaLoopRestoration { get; set; }
/// <summary>
/// Gets the loop-restoration configuration for each plane.
/// </summary>
internal ObuLoopRestorationItem[] Items { get; }
public ObuLoopRestorationItem[] Items { get; }
/// <summary>
/// Gets or sets the luma restoration-unit size shift.
/// </summary>
internal int UnitShift { get; set; }
public int UnitShift { get; set; }
/// <summary>
/// Gets or sets the chroma restoration-unit size shift relative to luma.
/// </summary>
internal int UVShift { get; set; }
public int UVShift { get; set; }
}

14
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuOperatingPoint.cs

@ -11,36 +11,36 @@ internal class ObuOperatingPoint
/// <summary>
/// Gets or sets the operating-point index.
/// </summary>
internal int OperatorIndex { get; set; }
public int OperatorIndex { get; set; }
/// <summary>
/// Gets or sets the AV1 sequence-level index.
/// </summary>
internal int SequenceLevelIndex { get; set; }
public int SequenceLevelIndex { get; set; }
/// <summary>
/// Gets or sets the sequence tier.
/// </summary>
internal int SequenceTier { get; set; }
public int SequenceTier { get; set; }
/// <summary>
/// Gets or sets a value indicating whether decoder-model timing is present for this operating point.
/// </summary>
internal bool IsDecoderModelInfoPresent { get; set; }
public bool IsDecoderModelInfoPresent { get; set; }
/// <summary>
/// Gets or sets a value indicating whether an initial display delay is present for this operating point.
/// </summary>
internal bool IsInitialDisplayDelayPresent { get; set; }
public bool IsInitialDisplayDelayPresent { get; set; }
/// <summary>
/// Gets or sets the initial display delay minus one, in decoded frames.
/// </summary>
internal uint InitialDisplayDelay { get; set; }
public uint InitialDisplayDelay { get; set; }
/// <summary>
/// Gets or sets the bitmask selecting temporal and spatial layers for the operating point.
/// A value of zero selects the complete coded sequence.
/// </summary>
internal uint Idc { get; set; }
public uint Idc { get; set; }
}

10
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuQuantizationParameters.cs

@ -21,25 +21,25 @@ internal class ObuQuantizationParameters
/// <summary>
/// Gets or sets a value indicating whether quantization matrices are enabled.
/// </summary>
public bool IsUsingQMatrix { get; internal set; }
public bool IsUsingQMatrix { get; set; }
/// <summary>
/// Gets or sets the DC quantizer-index deltas for the Y, U, and V planes.
/// </summary>
public int[] DeltaQDc { get; internal set; } = new int[3];
public int[] DeltaQDc { get; set; } = new int[3];
/// <summary>
/// Gets or sets the AC quantizer-index deltas for the Y, U, and V planes.
/// </summary>
public int[] DeltaQAc { get; internal set; } = new int[3];
public int[] DeltaQAc { get; set; } = new int[3];
/// <summary>
/// Gets or sets the quantization-matrix level for the Y, U, and V planes.
/// </summary>
public int[] QMatrix { get; internal set; } = new int[3];
public int[] QMatrix { get; set; } = new int[3];
/// <summary>
/// Gets or sets a value indicating whether the U and V planes use separate quantizer deltas.
/// </summary>
public bool HasSeparateUvDelta { get; internal set; }
public bool HasSeparateUvDelta { get; set; }
}

4
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuReader.cs

@ -589,7 +589,7 @@ internal class ObuReader
/// </summary>
/// <param name="reader">The reader positioned at the sequence-header payload.</param>
/// <param name="sequenceHeader">The sequence header to populate.</param>
internal static void ReadSequenceHeader(ref Av1BitStreamReader reader, ObuSequenceHeader sequenceHeader)
public static void ReadSequenceHeader(ref Av1BitStreamReader reader, ObuSequenceHeader sequenceHeader)
{
sequenceHeader.SequenceProfile = (ObuSequenceProfile)reader.ReadLiteral(3);
if (sequenceHeader.SequenceProfile > Av1Constants.MaxSequenceProfile)
@ -1808,7 +1808,7 @@ internal class ObuReader
/// <param name="reader">The reader positioned at the frame-header payload.</param>
/// <param name="header">The OBU header whose remaining payload size is updated.</param>
/// <param name="trailingBit">A value indicating whether trailing-bit syntax follows the frame header.</param>
internal void ReadFrameHeader(ref Av1BitStreamReader reader, ObuHeader header, bool trailingBit)
public void ReadFrameHeader(ref Av1BitStreamReader reader, ObuHeader header, bool trailingBit)
{
int startBitPosition = reader.BitPosition;
this.ReadUncompressedFrameHeader(ref reader, header);

18
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuSegmentationParameters.cs

@ -11,47 +11,47 @@ internal class ObuSegmentationParameters
/// <summary>
/// Gets or sets the effective quantization-matrix level for each plane and segment.
/// </summary>
public int[][] QMLevel { get; internal set; } = new int[3][];
public int[][] QMLevel { get; set; } = new int[3][];
/// <summary>
/// Gets or sets the enabled state of every feature for every segment.
/// </summary>
public bool[,] FeatureEnabled { get; internal set; } = new bool[Av1Constants.MaxSegmentCount, Av1Constants.SegmentationLevelMax];
public bool[,] FeatureEnabled { get; set; } = new bool[Av1Constants.MaxSegmentCount, Av1Constants.SegmentationLevelMax];
/// <summary>
/// Gets or sets a value indicating whether segmentation is enabled for the frame.
/// </summary>
public bool Enabled { get; internal set; }
public bool Enabled { get; set; }
/// <summary>
/// Gets or sets the value of every feature for every segment.
/// </summary>
public int[,] FeatureData { get; internal set; } = new int[Av1Constants.MaxSegmentCount, Av1Constants.SegmentationLevelMax];
public int[,] FeatureData { get; set; } = new int[Av1Constants.MaxSegmentCount, Av1Constants.SegmentationLevelMax];
/// <summary>
/// Gets or sets a value indicating whether segment identifiers are decoded before skip-mode decisions.
/// </summary>
public bool SegmentIdPrecedesSkip { get; internal set; }
public bool SegmentIdPrecedesSkip { get; set; }
/// <summary>
/// Gets or sets the greatest segment identifier that has at least one active feature.
/// </summary>
public int LastActiveSegmentId { get; internal set; }
public int LastActiveSegmentId { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the segmentation map is updated while decoding the frame.
/// </summary>
public int SegmentationUpdateMap { get; internal set; }
public int SegmentationUpdateMap { get; set; }
/// <summary>
/// Gets or sets a value indicating whether segmentation-map updates are coded relative to the existing map.
/// </summary>
public int SegmentationTemporalUpdate { get; internal set; }
public int SegmentationTemporalUpdate { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the frame supplies new per-segment feature data.
/// </summary>
public int SegmentationUpdateData { get; internal set; }
public int SegmentationUpdateData { get; set; }
/// <summary>
/// Determines whether a feature is active for a segment.

30
src/ImageSharp/Formats/Heif/Av1/OpenBitstreamUnit/ObuTileGroupHeader.cs

@ -11,32 +11,32 @@ internal class ObuTileGroupHeader
/// <summary>
/// Gets or sets the maximum tile width, in superblocks.
/// </summary>
internal int MaxTileWidthSuperblock { get; set; }
public int MaxTileWidthSuperblock { get; set; }
/// <summary>
/// Gets or sets the maximum tile height, in superblocks.
/// </summary>
internal int MaxTileHeightSuperblock { get; set; }
public int MaxTileHeightSuperblock { get; set; }
/// <summary>
/// Gets or sets the minimum base-2 logarithm of the tile-column count.
/// </summary>
internal int MinLog2TileColumnCount { get; set; }
public int MinLog2TileColumnCount { get; set; }
/// <summary>
/// Gets or sets the maximum base-2 logarithm of the tile-column count.
/// </summary>
internal int MaxLog2TileColumnCount { get; set; }
public int MaxLog2TileColumnCount { get; set; }
/// <summary>
/// Gets or sets the maximum base-2 logarithm of the tile-row count.
/// </summary>
internal int MaxLog2TileRowCount { get; set; }
public int MaxLog2TileRowCount { get; set; }
/// <summary>
/// Gets or sets the minimum base-2 logarithm of the total tile count.
/// </summary>
internal int MinLog2TileCount { get; set; }
public int MinLog2TileCount { get; set; }
/// <summary>
/// Gets or sets a value indicating whether tile columns and rows use uniform spacing.
@ -46,45 +46,45 @@ internal class ObuTileGroupHeader
/// <summary>
/// Gets or sets the base-2 logarithm of the tile-column count.
/// </summary>
internal int TileColumnCountLog2 { get; set; }
public int TileColumnCountLog2 { get; set; }
/// <summary>
/// Gets or sets the number of tile columns.
/// </summary>
internal int TileColumnCount { get; set; }
public int TileColumnCount { get; set; }
/// <summary>
/// Gets or sets the starting superblock column for each tile column.
/// </summary>
internal int[] TileColumnStartModeInfo { get; set; } = new int[Av1Constants.MaxTileRowCount + 1];
public int[] TileColumnStartModeInfo { get; set; } = new int[Av1Constants.MaxTileRowCount + 1];
/// <summary>
/// Gets or sets the minimum base-2 logarithm of the tile-row count.
/// </summary>
internal int MinLog2TileRowCount { get; set; }
public int MinLog2TileRowCount { get; set; }
/// <summary>
/// Gets or sets the base-2 logarithm of the tile-row count.
/// </summary>
internal int TileRowCountLog2 { get; set; }
public int TileRowCountLog2 { get; set; }
/// <summary>
/// Gets or sets the starting superblock row for each tile row.
/// </summary>
internal int[] TileRowStartModeInfo { get; set; } = new int[Av1Constants.MaxTileColumnCount + 1];
public int[] TileRowStartModeInfo { get; set; } = new int[Av1Constants.MaxTileColumnCount + 1];
/// <summary>
/// Gets or sets the number of tile rows.
/// </summary>
internal int TileRowCount { get; set; }
public int TileRowCount { get; set; }
/// <summary>
/// Gets or sets the tile whose entropy context is retained after frame decoding.
/// </summary>
internal uint ContextUpdateTileId { get; set; }
public uint ContextUpdateTileId { get; set; }
/// <summary>
/// Gets or sets the number of bytes used to signal each tile size.
/// </summary>
internal int TileSizeBytes { get; set; }
public int TileSizeBytes { get; set; }
}

38
src/ImageSharp/Formats/Heif/Av1/Prediction/Inter/Av1InterPredictor.Arithmetic.cs

@ -15,7 +15,7 @@ internal static partial class Av1InterPredictor
/// Convolves sixteen adjacent 8-bit samples into four signed 32-bit accumulator vectors.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void Convolve(
public static void Convolve(
ref byte source,
int tapStride,
nuint column,
@ -51,7 +51,7 @@ internal static partial class Av1InterPredictor
/// Convolves thirty-two adjacent 8-bit samples into four signed 32-bit accumulator vectors.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void Convolve(
public static void Convolve(
ref byte source,
int tapStride,
nuint column,
@ -85,7 +85,7 @@ internal static partial class Av1InterPredictor
/// Convolves sixty-four adjacent 8-bit samples into four signed 32-bit accumulator vectors.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void Convolve(
public static void Convolve(
ref byte source,
int tapStride,
nuint column,
@ -119,7 +119,7 @@ internal static partial class Av1InterPredictor
/// Convolves eight adjacent nonnegative 16-bit samples into two signed 32-bit accumulator vectors.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void Convolve(
public static void Convolve(
ref short source,
int tapStride,
nuint column,
@ -149,7 +149,7 @@ internal static partial class Av1InterPredictor
/// Convolves sixteen adjacent nonnegative 16-bit samples into two signed 32-bit accumulator vectors.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void Convolve(
public static void Convolve(
ref short source,
int tapStride,
nuint column,
@ -176,7 +176,7 @@ internal static partial class Av1InterPredictor
/// Convolves thirty-two adjacent nonnegative 16-bit samples into two signed 32-bit accumulator vectors.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void Convolve(
public static void Convolve(
ref short source,
int tapStride,
nuint column,
@ -203,28 +203,28 @@ internal static partial class Av1InterPredictor
/// Applies AV1 power-of-two rounding to four-lane signed accumulators.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector128<int> RoundPowerOfTwo(Vector128<int> value, int bits)
public static Vector128<int> RoundPowerOfTwo(Vector128<int> value, int bits)
=> bits == 0 ? value : (value + Vector128.Create(1 << (bits - 1))) >> bits;
/// <summary>
/// Applies AV1 power-of-two rounding to eight-lane signed accumulators.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector256<int> RoundPowerOfTwo(Vector256<int> value, int bits)
public static Vector256<int> RoundPowerOfTwo(Vector256<int> value, int bits)
=> bits == 0 ? value : (value + Vector256.Create(1 << (bits - 1))) >> bits;
/// <summary>
/// Applies AV1 power-of-two rounding to sixteen-lane signed accumulators.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector512<int> RoundPowerOfTwo(Vector512<int> value, int bits)
public static Vector512<int> RoundPowerOfTwo(Vector512<int> value, int bits)
=> bits == 0 ? value : (value + Vector512.Create(1 << (bits - 1))) >> bits;
/// <summary>
/// Clips and packs sixteen signed accumulators into 8-bit samples.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector128<byte> PackBytes(Vector128<int> result0, Vector128<int> result1, Vector128<int> result2, Vector128<int> result3)
public static Vector128<byte> PackBytes(Vector128<int> result0, Vector128<int> result1, Vector128<int> result2, Vector128<int> result3)
{
Vector128<int> maximum = Vector128.Create((int)byte.MaxValue);
result0 = Vector128.Clamp(result0, Vector128<int>.Zero, maximum);
@ -238,7 +238,7 @@ internal static partial class Av1InterPredictor
/// Clips and packs thirty-two signed accumulators into 8-bit samples.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector256<byte> PackBytes(Vector256<int> result0, Vector256<int> result1, Vector256<int> result2, Vector256<int> result3)
public static Vector256<byte> PackBytes(Vector256<int> result0, Vector256<int> result1, Vector256<int> result2, Vector256<int> result3)
{
Vector256<int> maximum = Vector256.Create((int)byte.MaxValue);
result0 = Vector256.Clamp(result0, Vector256<int>.Zero, maximum);
@ -252,7 +252,7 @@ internal static partial class Av1InterPredictor
/// Clips and packs sixty-four signed accumulators into 8-bit samples.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector512<byte> PackBytes(Vector512<int> result0, Vector512<int> result1, Vector512<int> result2, Vector512<int> result3)
public static Vector512<byte> PackBytes(Vector512<int> result0, Vector512<int> result1, Vector512<int> result2, Vector512<int> result3)
{
Vector512<int> maximum = Vector512.Create((int)byte.MaxValue);
result0 = Vector512.Clamp(result0, Vector512<int>.Zero, maximum);
@ -266,7 +266,7 @@ internal static partial class Av1InterPredictor
/// Clips and packs eight signed accumulators into high-bit-depth samples.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector128<ushort> PackHighBitDepth(Vector128<int> result0, Vector128<int> result1, int maximumValue)
public static Vector128<ushort> PackHighBitDepth(Vector128<int> result0, Vector128<int> result1, int maximumValue)
{
Vector128<int> maximum = Vector128.Create(maximumValue);
result0 = Vector128.Clamp(result0, Vector128<int>.Zero, maximum);
@ -278,7 +278,7 @@ internal static partial class Av1InterPredictor
/// Clips and packs sixteen signed accumulators into high-bit-depth samples.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector256<ushort> PackHighBitDepth(Vector256<int> result0, Vector256<int> result1, int maximumValue)
public static Vector256<ushort> PackHighBitDepth(Vector256<int> result0, Vector256<int> result1, int maximumValue)
{
Vector256<int> maximum = Vector256.Create(maximumValue);
result0 = Vector256.Clamp(result0, Vector256<int>.Zero, maximum);
@ -290,7 +290,7 @@ internal static partial class Av1InterPredictor
/// Clips and packs thirty-two signed accumulators into high-bit-depth samples.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vector512<ushort> PackHighBitDepth(Vector512<int> result0, Vector512<int> result1, int maximumValue)
public static Vector512<ushort> PackHighBitDepth(Vector512<int> result0, Vector512<int> result1, int maximumValue)
{
Vector512<int> maximum = Vector512.Create(maximumValue);
result0 = Vector512.Clamp(result0, Vector512<int>.Zero, maximum);
@ -301,7 +301,7 @@ internal static partial class Av1InterPredictor
/// <summary>
/// Computes one signed Q7 convolution sum from 8-bit samples.
/// </summary>
internal static int ConvolveScalar(ref byte source, int sourceStride, ref short coefficients, int tapCount)
public static int ConvolveScalar(ref byte source, int sourceStride, ref short coefficients, int tapCount)
{
int sum = 0;
for (int tap = 0; tap < tapCount; tap++)
@ -315,7 +315,7 @@ internal static partial class Av1InterPredictor
/// <summary>
/// Computes one signed Q7 convolution sum from high-bit-depth samples.
/// </summary>
internal static int ConvolveScalar(ref ushort source, int sourceStride, ref short coefficients, int tapCount)
public static int ConvolveScalar(ref ushort source, int sourceStride, ref short coefficients, int tapCount)
{
int sum = 0;
for (int tap = 0; tap < tapCount; tap++)
@ -329,7 +329,7 @@ internal static partial class Av1InterPredictor
/// <summary>
/// Computes one signed Q7 convolution sum from biased intermediate samples.
/// </summary>
internal static int ConvolveScalar(ref short source, int sourceStride, ref short coefficients, int tapCount)
public static int ConvolveScalar(ref short source, int sourceStride, ref short coefficients, int tapCount)
{
int sum = 0;
for (int tap = 0; tap < tapCount; tap++)
@ -343,5 +343,5 @@ internal static partial class Av1InterPredictor
/// <summary>
/// Rounds an integer after division by a power of two using AV1's unsigned-bias rule.
/// </summary>
internal static int RoundPowerOfTwo(int value, int bits) => bits == 0 ? value : (value + (1 << (bits - 1))) >> bits;
public static int RoundPowerOfTwo(int value, int bits) => bits == 0 ? value : (value + (1 << (bits - 1))) >> bits;
}

2
src/ImageSharp/Formats/Heif/Av1/Prediction/Inter/Av1InterPredictor.Operator.cs

@ -755,7 +755,7 @@ internal static partial class Av1InterPredictor
/// <param name="coefficients">The selected Q7 phase kernel.</param>
/// <param name="firstCoefficient">Receives the first coefficient used by the effective kernel.</param>
/// <param name="tapCount">Receives the effective two-, four-, six-, or eight-tap length.</param>
internal static void GetEffectiveKernel(ReadOnlySpan<short> coefficients, out int firstCoefficient, out int tapCount)
public static void GetEffectiveKernel(ReadOnlySpan<short> coefficients, out int firstCoefficient, out int tapCount)
{
// This matches libaom's get_filter_tap decision. Reducing symmetric zero endpoints avoids source loads and
// multiply-adds while retaining the original tap-to-source alignment through firstCoefficient.

6
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EncoderBlockModeInfo.cs

@ -53,15 +53,15 @@ internal class Av1EncoderBlockModeInfo
/// <summary>
/// Gets or sets the transform-tree depth selected for the block.
/// </summary>
public int TransformDepth { get; internal set; }
public int TransformDepth { get; set; }
/// <summary>
/// Gets or sets the luma prediction mode written for the block.
/// </summary>
public Av1PredictionMode Mode { get; internal set; }
public Av1PredictionMode Mode { get; set; }
/// <summary>
/// Gets or sets the chroma prediction mode written for the block.
/// </summary>
public Av1ChromaPredictionMode UvMode { get; internal set; }
public Av1ChromaPredictionMode UvMode { get; set; }
}

4
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EncoderBlockStruct.cs

@ -41,10 +41,10 @@ internal class Av1EncoderBlockStruct
/// <summary>
/// Gets or sets the palette size for luma and for the shared chroma mode.
/// </summary>
public required int[] PaletteSize { get; internal set; }
public required int[] PaletteSize { get; set; }
/// <summary>
/// Gets or sets the encoder prediction-unit state for the block.
/// </summary>
public required Av1EncoderPredictionUnit[] PredictionUnits { get; internal set; }
public required Av1EncoderPredictionUnit[] PredictionUnits { get; set; }
}

10
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EncoderCommon.cs

@ -13,25 +13,25 @@ internal class Av1EncoderCommon
/// <summary>
/// Gets or sets the frame height in 4x4 mode-information units.
/// </summary>
public int ModeInfoRowCount { get; internal set; }
public int ModeInfoRowCount { get; set; }
/// <summary>
/// Gets or sets the frame width in 4x4 mode-information units.
/// </summary>
public int ModeInfoColumnCount { get; internal set; }
public int ModeInfoColumnCount { get; set; }
/// <summary>
/// Gets or sets the row stride of frame mode information in 4x4 units.
/// </summary>
public int ModeInfoStride { get; internal set; }
public int ModeInfoStride { get; set; }
/// <summary>
/// Gets or sets the coded frame dimensions.
/// </summary>
public required ObuFrameSize FrameSize { get; internal set; }
public required ObuFrameSize FrameSize { get; set; }
/// <summary>
/// Gets or sets the tile layout for the current frame.
/// </summary>
public required ObuTileGroupHeader TilesInfo { get; internal set; }
public required ObuTileGroupHeader TilesInfo { get; set; }
}

4
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EncoderPredictionUnit.cs

@ -16,10 +16,10 @@ internal class Av1EncoderPredictionUnit
/// <summary>
/// Gets or sets the chroma-from-luma alpha magnitude index.
/// </summary>
public int ChromaFromLumaIndex { get; internal set; }
public int ChromaFromLumaIndex { get; set; }
/// <summary>
/// Gets or sets the packed chroma-from-luma alpha signs for the U and V planes.
/// </summary>
public int ChromaFromLumaSigns { get; internal set; }
public int ChromaFromLumaSigns { get; set; }
}

8
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1EntropyCodingContext.cs

@ -16,21 +16,21 @@ internal partial class Av1TileWriter
/// <summary>
/// Gets or sets the macroblock mode information currently being encoded.
/// </summary>
public required Av1MacroBlockModeInfo MacroBlockModeInfo { get; internal set; }
public required Av1MacroBlockModeInfo MacroBlockModeInfo { get; set; }
/// <summary>
/// Gets or sets the pixel origin of the current superblock.
/// </summary>
public Point SuperblockOrigin { get; internal set; }
public Point SuperblockOrigin { get; set; }
/// <summary>
/// Gets or sets the number of luma coefficient positions consumed in the current superblock.
/// </summary>
public int CodedAreaSuperblock { get; internal set; }
public int CodedAreaSuperblock { get; set; }
/// <summary>
/// Gets or sets the number of chroma coefficient positions consumed in the current superblock.
/// </summary>
public int CodedAreaSuperblockUv { get; internal set; }
public int CodedAreaSuperblockUv { get; set; }
}
}

2
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1FrameInfo.cs

@ -503,7 +503,7 @@ internal partial class Av1FrameInfo : IDisposable
/// Resets every constrained directional enhancement filter strength for a superblock to its unassigned value.
/// </summary>
/// <param name="index">The position in the frame superblock grid.</param>
internal void ClearCdef(Point index)
public void ClearCdef(Point index)
{
Span<int> cdefs = this.GetCdefStrength(index);
for (int i = 0; i < cdefs.Length; i++)

2
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1LevelBuffer.cs

@ -124,7 +124,7 @@ internal sealed class Av1LevelBuffer : IDisposable
/// <summary>
/// Clears all coefficient levels and context padding.
/// </summary>
internal void Clear()
public void Clear()
{
ObjectDisposedException.ThrowIf(this.memory == null, this);
this.memory.Memory.Span.Clear();

26
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1MacroBlockD.cs

@ -19,7 +19,7 @@ internal class Av1MacroBlockD
public required ReadOnlySpan<Av1ModeInfo> ModeInfo
{
get => this.modeInfo;
internal set
set
{
// A span cannot be retained by the class, so preserve the selected map entries in owned storage.
this.modeInfo = new Av1ModeInfo[value.Length];
@ -30,60 +30,60 @@ internal class Av1MacroBlockD
/// <summary>
/// Gets or sets the tile containing the current block.
/// </summary>
public required Av1TileInfo Tile { get; internal set; }
public required Av1TileInfo Tile { get; set; }
/// <summary>
/// Gets or sets a value indicating whether an above block is available within the tile.
/// </summary>
public bool IsUpAvailable { get; internal set; }
public bool IsUpAvailable { get; set; }
/// <summary>
/// Gets or sets a value indicating whether a left block is available within the tile.
/// </summary>
public bool IsLeftAvailable { get; internal set; }
public bool IsLeftAvailable { get; set; }
/// <summary>
/// Gets or sets the above macroblock mode information, when available.
/// </summary>
public Av1MacroBlockModeInfo? AboveMacroBlock { get; internal set; }
public Av1MacroBlockModeInfo? AboveMacroBlock { get; set; }
/// <summary>
/// Gets or sets the left macroblock mode information, when available.
/// </summary>
public Av1MacroBlockModeInfo? LeftMacroBlock { get; internal set; }
public Av1MacroBlockModeInfo? LeftMacroBlock { get; set; }
/// <summary>
/// Gets or sets the row stride of the frame mode-information map.
/// </summary>
public int ModeInfoStride { get; internal set; }
public int ModeInfoStride { get; set; }
/// <summary>
/// Gets or sets the signed distance from the block to the top frame edge in one-eighth-sample units.
/// </summary>
public int ToTopEdge { get; internal set; }
public int ToTopEdge { get; set; }
/// <summary>
/// Gets or sets the signed distance from the block to the bottom frame edge in one-eighth-sample units.
/// </summary>
public int ToBottomEdge { get; internal set; }
public int ToBottomEdge { get; set; }
/// <summary>
/// Gets or sets the signed distance from the block to the left frame edge in one-eighth-sample units.
/// </summary>
public int ToLeftEdge { get; internal set; }
public int ToLeftEdge { get; set; }
/// <summary>
/// Gets or sets the signed distance from the block to the right frame edge in one-eighth-sample units.
/// </summary>
public int ToRightEdge { get; internal set; }
public int ToRightEdge { get; set; }
/// <summary>
/// Gets or sets the block dimensions in samples for rectangular-partition context selection.
/// </summary>
public Size N8Size { get; internal set; }
public Size N8Size { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this block is the second half of a rectangular partition.
/// </summary>
public bool IsSecondRectangle { get; internal set; }
public bool IsSecondRectangle { get; set; }
}

6
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1MacroBlockModeInfo.cs

@ -11,15 +11,15 @@ internal class Av1MacroBlockModeInfo
/// <summary>
/// Gets or sets the prediction, transform, and segmentation decisions for the block.
/// </summary>
public required Av1EncoderBlockModeInfo Block { get; internal set; }
public required Av1EncoderBlockModeInfo Block { get; set; }
/// <summary>
/// Gets or sets the luma palette decisions for the block.
/// </summary>
public required Av1PaletteLumaModeInfo Palette { get; internal set; }
public required Av1PaletteLumaModeInfo Palette { get; set; }
/// <summary>
/// Gets or sets the constrained directional enhancement filter strength for the block.
/// </summary>
public int CdefStrength { get; internal set; }
public int CdefStrength { get; set; }
}

2
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1ModeInfo.cs

@ -11,5 +11,5 @@ internal class Av1ModeInfo
/// <summary>
/// Gets or sets the macroblock mode information associated with this map entry.
/// </summary>
public required Av1MacroBlockModeInfo MacroBlockModeInfo { get; internal set; }
public required Av1MacroBlockModeInfo MacroBlockModeInfo { get; set; }
}

2
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1NeighborArrayUnit.cs

@ -295,5 +295,5 @@ internal sealed class Av1NeighborArrayUnit<T> : IDisposable
/// <param name="blockSize">The block dimensions in samples.</param>
/// <param name="unitMask">The neighbor arrays to update.</param>
/// <exception cref="NotImplementedException">The byte-specific write path is not implemented.</exception>
internal void UnitModeWrite(Span<byte> dcSignSpan, Point blockOrigin, Size blockSize, Av1NeighborArrayUnit<Av1PartitionContext>.UnitMask unitMask) => throw new NotImplementedException();
public void UnitModeWrite(Span<byte> dcSignSpan, Point blockOrigin, Size blockSize, Av1NeighborArrayUnit<Av1PartitionContext>.UnitMask unitMask) => throw new NotImplementedException();
}

4
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PartitionContext.cs

@ -55,12 +55,12 @@ internal struct Av1PartitionContext : IMinMaxValue<Av1PartitionContext>
/// <summary>
/// Gets or sets the five-bit context derived from the left neighbor.
/// </summary>
public byte Left { get; internal set; }
public byte Left { get; set; }
/// <summary>
/// Gets or sets the five-bit context derived from the above neighbor.
/// </summary>
public byte Above { get; internal set; }
public byte Above { get; set; }
/// <summary>
/// Gets the above-neighbor partition context for the specified block size.

2
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PartitionInfo.cs

@ -145,7 +145,7 @@ internal ref struct Av1PartitionInfo
/// <summary>
/// Gets or sets the neighboring luma samples used by chroma-from-luma prediction.
/// </summary>
public Av1ChromaFromLumaContext? ChromaFromLumaContext { get; internal set; }
public Av1ChromaFromLumaContext? ChromaFromLumaContext { get; set; }
/// <summary>
/// Gets the block width in samples for a color plane.

28
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PictureControlSet.cs

@ -13,42 +13,42 @@ internal class Av1PictureControlSet
/// <summary>
/// Gets or sets the partition neighbor contexts for each tile.
/// </summary>
public required Av1NeighborArrayUnit<Av1PartitionContext>[] PartitionContexts { get; internal set; }
public required Av1NeighborArrayUnit<Av1PartitionContext>[] PartitionContexts { get; set; }
/// <summary>
/// Gets or sets the luma DC-sign and coefficient-level neighbor contexts for each tile.
/// </summary>
public required Av1NeighborArrayUnit<byte>[] LuminanceDcSignLevelCoefficientNeighbors { get; internal set; }
public required Av1NeighborArrayUnit<byte>[] LuminanceDcSignLevelCoefficientNeighbors { get; set; }
/// <summary>
/// Gets or sets the red-difference chroma DC-sign and coefficient-level neighbor contexts for each tile.
/// </summary>
public required Av1NeighborArrayUnit<byte>[] CrDcSignLevelCoefficientNeighbors { get; internal set; }
public required Av1NeighborArrayUnit<byte>[] CrDcSignLevelCoefficientNeighbors { get; set; }
/// <summary>
/// Gets or sets the blue-difference chroma DC-sign and coefficient-level neighbor contexts for each tile.
/// </summary>
public required Av1NeighborArrayUnit<byte>[] CbDcSignLevelCoefficientNeighbors { get; internal set; }
public required Av1NeighborArrayUnit<byte>[] CbDcSignLevelCoefficientNeighbors { get; set; }
/// <summary>
/// Gets or sets the transform-function neighbor contexts for each tile.
/// </summary>
public required Av1NeighborArrayUnit<byte>[] TransformFunctionContexts { get; internal set; }
public required Av1NeighborArrayUnit<byte>[] TransformFunctionContexts { get; set; }
/// <summary>
/// Gets or sets the sequence-wide encoder state.
/// </summary>
public required Av1SequenceControlSet Sequence { get; internal set; }
public required Av1SequenceControlSet Sequence { get; set; }
/// <summary>
/// Gets or sets the parent picture state shared across coding passes.
/// </summary>
public required Av1PictureParentControlSet Parent { get; internal set; }
public required Av1PictureParentControlSet Parent { get; set; }
/// <summary>
/// Gets or sets the frame segmentation identifiers used for spatial prediction.
/// </summary>
public required byte[] SegmentationNeighborMap { get; internal set; }
public required byte[] SegmentationNeighborMap { get; set; }
/// <summary>
/// Gets the frame grid that maps each 4x4 position to its mode-information span.
@ -58,22 +58,22 @@ internal class Av1PictureControlSet
/// <summary>
/// Gets or sets the contiguous mode-information storage addressed by <see cref="ModeInfoGrid"/>.
/// </summary>
public required Av1ModeInfo[] Mip { get; internal set; }
public required Av1ModeInfo[] Mip { get; set; }
/// <summary>
/// Gets or sets the row stride of <see cref="ModeInfoGrid"/> in 4x4 mode-information units.
/// </summary>
public int ModeInfoStride { get; internal set; }
public int ModeInfoStride { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the mode-information backing store uses 8x8 rather than 4x4 granularity.
/// </summary>
public bool Disallow4x4AllFrames { get; internal set; }
public bool Disallow4x4AllFrames { get; set; }
/// <summary>
/// Gets or sets the constrained directional enhancement filter presets for each filter block.
/// </summary>
public required int[][] CdefPreset { get; internal set; }
public required int[][] CdefPreset { get; set; }
/// <summary>
/// Gets the mode-information span mapped to a frame position.
@ -108,7 +108,7 @@ internal class Av1PictureControlSet
/// </summary>
/// <param name="blockOrigin">The block origin in 4x4 mode-information units.</param>
/// <returns>The macroblock mode information at the origin.</returns>
internal Av1MacroBlockModeInfo GetMacroBlockModeInfo(Point blockOrigin)
public Av1MacroBlockModeInfo GetMacroBlockModeInfo(Point blockOrigin)
{
int modeInfoStride = this.ModeInfoStride;
int offset = (blockOrigin.Y * modeInfoStride) + blockOrigin.X;
@ -130,7 +130,7 @@ internal class Av1PictureControlSet
/// <param name="blockSize">The block size.</param>
/// <param name="origin">The block origin in samples.</param>
/// <param name="segmentId">The segment identifier.</param>
internal void UpdateSegmentation(Av1BlockSize blockSize, Point origin, int segmentId)
public void UpdateSegmentation(Av1BlockSize blockSize, Point origin, int segmentId)
{
Av1EncoderCommon cm = this.Parent.Common;
Span<byte> segment_ids = this.SegmentationNeighborMap;

14
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PictureParentControlSet.cs

@ -13,35 +13,35 @@ internal class Av1PictureParentControlSet
/// <summary>
/// Gets or sets frame dimensions and tile state shared by encoder stages.
/// </summary>
public required Av1EncoderCommon Common { get; internal set; }
public required Av1EncoderCommon Common { get; set; }
/// <summary>
/// Gets or sets the frame header being encoded.
/// </summary>
public required ObuFrameHeader FrameHeader { get; internal set; }
public required ObuFrameHeader FrameHeader { get; set; }
/// <summary>
/// Gets or sets the preceding quantizer index for each tile context.
/// </summary>
public required int[] PreviousQIndex { get; internal set; }
public required int[] PreviousQIndex { get; set; }
/// <summary>
/// Gets or sets the encoder palette-search level.
/// </summary>
public int PaletteLevel { get; internal set; }
public int PaletteLevel { get; set; }
/// <summary>
/// Gets or sets the frame width aligned for superblock traversal.
/// </summary>
public int AlignedWidth { get; internal set; }
public int AlignedWidth { get; set; }
/// <summary>
/// Gets or sets the frame height aligned for superblock traversal.
/// </summary>
public int AlignedHeight { get; internal set; }
public int AlignedHeight { get; set; }
/// <summary>
/// Gets or sets the geometry state for each superblock in the picture.
/// </summary>
public required Av1SuperblockGeometry[] SuperblockGeometry { get; internal set; }
public required Av1SuperblockGeometry[] SuperblockGeometry { get; set; }
}

4
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SequenceControlSet.cs

@ -13,10 +13,10 @@ internal class Av1SequenceControlSet
/// <summary>
/// Gets or sets the sequence header that governs encoded pictures.
/// </summary>
public required ObuSequenceHeader SequenceHeader { get; internal set; }
public required ObuSequenceHeader SequenceHeader { get; set; }
/// <summary>
/// Gets or sets the maximum number of encoded blocks allocated for a picture.
/// </summary>
public int MaxBlockCount { get; internal set; }
public int MaxBlockCount { get; set; }
}

4
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1Superblock.cs

@ -23,10 +23,10 @@ internal class Av1Superblock
/// <summary>
/// Gets or sets the selected partition type for each partition-tree node.
/// </summary>
public required Av1PartitionType[] CodingUnitPartitionTypes { get; internal set; }
public required Av1PartitionType[] CodingUnitPartitionTypes { get; set; }
/// <summary>
/// Gets or sets the superblock index within the picture.
/// </summary>
public int Index { get; internal set; }
public int Index { get; set; }
}

2
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SuperblockGeometry.cs

@ -11,5 +11,5 @@ internal class Av1SuperblockGeometry
/// <summary>
/// Gets or sets a value indicating whether the superblock lies completely within the coded frame.
/// </summary>
public bool IsComplete { get; internal set; }
public bool IsComplete { get; set; }
}

6
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SuperblockInfo.cs

@ -72,17 +72,17 @@ internal class Av1SuperblockInfo
/// <summary>
/// Gets or sets the next luma transform-information index while parsing this superblock.
/// </summary>
public int TransformInfoIndexY { get; internal set; }
public int TransformInfoIndexY { get; set; }
/// <summary>
/// Gets or sets the next shared chroma transform-information index while parsing this superblock.
/// </summary>
public int TransformInfoIndexUv { get; internal set; }
public int TransformInfoIndexUv { get; set; }
/// <summary>
/// Gets or sets the number of mode-information records parsed for this superblock.
/// </summary>
public int BlockCount { get; internal set; }
public int BlockCount { get; set; }
/// <summary>
/// Gets the luma transform-information storage reserved for this superblock.

4
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TileReader.cs

@ -1812,7 +1812,7 @@ internal sealed class Av1TileReader : IAv1TileReader, IDisposable
/// <param name="partitionInfo">The current coding block and its neighbors.</param>
/// <param name="tileInfo">The active tile boundaries used by reference-motion-vector searches.</param>
/// <remarks>Implements the prefix, intra, and translational inter branches of AV1 section 5.11.7.</remarks>
internal void ReadInterFrameModeInfo(ref Av1SymbolDecoder reader, ref Av1PartitionInfo partitionInfo, Av1TileInfo tileInfo)
public void ReadInterFrameModeInfo(ref Av1SymbolDecoder reader, ref Av1PartitionInfo partitionInfo, Av1TileInfo tileInfo)
{
Av1BlockModeInfo modeInfo = partitionInfo.ModeInfo;
modeInfo.MotionVectors.Clear();
@ -2929,7 +2929,7 @@ internal sealed class Av1TileReader : IAv1TileReader, IDisposable
/// <remarks>
/// Implements <c>read_inter_segment_id</c> from AV1 section 5.11.8.
/// </remarks>
internal void ReadInterSegmentId(ref Av1SymbolDecoder reader, ref Av1PartitionInfo partitionInfo, bool beforeSkip)
public void ReadInterSegmentId(ref Av1SymbolDecoder reader, ref Av1PartitionInfo partitionInfo, bool beforeSkip)
{
ObuSegmentationParameters segmentationParameters = this.FrameHeader.SegmentationParameters;
Av1BlockModeInfo modeInfo = partitionInfo.ModeInfo;

2
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TileWriter.cs

@ -1587,7 +1587,7 @@ internal partial class Av1TileWriter
/// <param name="writer">The tile symbol encoder.</param>
/// <param name="block">The encoder block state.</param>
/// <param name="skip">The skip value to write.</param>
internal static void EncodeSkipCoefficients(ref Av1SymbolEncoder writer, Av1EncoderBlockStruct block, bool skip)
public static void EncodeSkipCoefficients(ref Av1SymbolEncoder writer, Av1EncoderBlockStruct block, bool skip)
{
Av1MacroBlockModeInfo? above_mi = block.MacroBlock.AboveMacroBlock;
Av1MacroBlockModeInfo? left_mi = block.MacroBlock.LeftMacroBlock;

10
src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TransformInfo.cs

@ -45,22 +45,22 @@ internal struct Av1TransformInfo
/// <summary>
/// Gets or sets the transform size used for this transform block.
/// </summary>
public Av1TransformSize Size { get; internal set; }
public Av1TransformSize Size { get; set; }
/// <summary>
/// Gets or sets the transform type used for this transform block.
/// </summary>
public Av1TransformType Type { get; internal set; }
public Av1TransformType Type { get; set; }
/// <summary>
/// Gets or sets the horizontal offset of this block in mode-information units.
/// </summary>
public int OffsetX { get; internal set; }
public int OffsetX { get; set; }
/// <summary>
/// Gets or sets the vertical offset of this block in mode-information units.
/// </summary>
public int OffsetY { get; internal set; }
public int OffsetY { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the transform block contains a coded residual.
@ -75,5 +75,5 @@ internal struct Av1TransformInfo
/// </item>
/// </list>
/// </summary>
public bool CodeBlockFlag { get; internal set; }
public bool CodeBlockFlag { get; set; }
}

2
src/ImageSharp/Formats/Heif/Av1/Transform/Av1InverseTransformMath.cs

@ -284,7 +284,7 @@ internal static class Av1InverseTransformMath
/// </summary>
/// <param name="transformSize">The signaled transform size.</param>
/// <returns>The maximum coefficient end position represented by AV1 syntax.</returns>
internal static int GetMaxEndOfBuffer(Av1TransformSize transformSize)
public static int GetMaxEndOfBuffer(Av1TransformSize transformSize)
{
if (transformSize is Av1TransformSize.Size64x64 or Av1TransformSize.Size64x32 or Av1TransformSize.Size32x64)
{

12
src/ImageSharp/Formats/Heif/Av1/Transform/Av1TransformFunctionParameters.cs

@ -11,30 +11,30 @@ internal struct Av1TransformFunctionParameters
/// <summary>
/// Gets or sets the compound transform type.
/// </summary>
public Av1TransformType TransformType { get; internal set; }
public Av1TransformType TransformType { get; set; }
/// <summary>
/// Gets or sets the transform-block dimensions.
/// </summary>
public Av1TransformSize TransformSize { get; internal set; }
public Av1TransformSize TransformSize { get; set; }
/// <summary>
/// Gets or sets the number of coefficient positions represented by the decoded coefficient buffer.
/// </summary>
public int EndOfBuffer { get; internal set; }
public int EndOfBuffer { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the coded segment uses the AV1 lossless transform rules.
/// </summary>
public bool IsLossless { get; internal set; }
public bool IsLossless { get; set; }
/// <summary>
/// Gets or sets the decoded sample bit depth.
/// </summary>
public int BitDepth { get; internal set; }
public int BitDepth { get; set; }
/// <summary>
/// Gets or sets a value indicating whether reconstructed samples use the 16-bit storage pipeline.
/// </summary>
public bool Is16BitPipeline { get; internal set; }
public bool Is16BitPipeline { get; set; }
}

4
src/ImageSharp/Formats/Heif/Hevc/HevcSliceSegmentHeader.cs

@ -450,7 +450,7 @@ internal sealed class HevcSliceSegmentHeader
/// <param name="rbspOffset">The decoded raw-byte-sequence payload offset.</param>
/// <param name="emulationPreventionBytePositions">The removed encoded-payload byte positions.</param>
/// <returns>The encoded byte-sequence payload offset at the same syntax boundary.</returns>
internal static int GetEncodedPayloadOffset(
public static int GetEncodedPayloadOffset(
int rbspOffset,
ReadOnlySpan<int> emulationPreventionBytePositions)
{
@ -474,7 +474,7 @@ internal sealed class HevcSliceSegmentHeader
/// <param name="encodedOffset">The encoded byte-sequence payload offset.</param>
/// <param name="emulationPreventionBytePositions">The removed encoded-payload byte positions.</param>
/// <returns>The decoded raw-byte-sequence payload offset at the same syntax boundary.</returns>
internal static int GetDecodedPayloadOffset(
public static int GetDecodedPayloadOffset(
int encodedOffset,
ReadOnlySpan<int> emulationPreventionBytePositions)
{

Loading…
Cancel
Save