Skip to content

Commit

Permalink
Namespace update
Browse files Browse the repository at this point in the history
  • Loading branch information
ynse01 committed Jul 27, 2024
1 parent 96329f4 commit 056814f
Show file tree
Hide file tree
Showing 26 changed files with 61 additions and 30 deletions.
12 changes: 9 additions & 3 deletions src/ImageSharp/Formats/Heif/Av1/Av1Decoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
// Licensed under the Six Labors Split License.

using SixLabors.ImageSharp.Formats.Heif.Av1.OpenBitstreamUnit;
using SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
using SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;
using SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

namespace SixLabors.ImageSharp.Formats.Heif.Av1;

internal class Av1Decoder : IAv1TileReader
{
private readonly ObuReader obuReader;
private Av1TileReader? tileReader;
private Av1FrameDecoder? frameDecoder;

public Av1Decoder() => this.obuReader = new();

Expand All @@ -23,9 +25,13 @@ public void Decode(Span<byte> buffer)
{
Av1BitStreamReader reader = new(buffer);
this.obuReader.ReadAll(ref reader, buffer.Length, this, false);
this.FrameBuffer = this.tileReader?.FrameBuffer;
Guard.NotNull(this.tileReader, nameof(this.tileReader));
Guard.NotNull(this.SequenceHeader, nameof(this.SequenceHeader));
Guard.NotNull(this.FrameHeader, nameof(this.FrameHeader));

// TODO: Decode the FrameBuffer
this.FrameBuffer = this.tileReader.FrameBuffer;
this.frameDecoder = new(this.SequenceHeader, this.FrameHeader, this.FrameBuffer);
this.frameDecoder.DecodeFrame();
}

public void ReadTile(Span<byte> tileData, int tileNum)
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1BlockModeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using SixLabors.ImageSharp.Formats.Heif.Av1.Prediction;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1BlockModeInfo
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal static class Av1DefaultDistributions
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1Distribution.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

/// <summary>
/// Class representing the probability distribution used for symbol coding.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal enum Av1FilterIntraMode
{
Expand Down
5 changes: 1 addition & 4 deletions src/ImageSharp/Formats/Heif/Av1/Tiling/Av1FrameBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

using System;
using System.Reflection.Metadata.Ecma335;
using SixLabors.ImageSharp.Formats.Heif.Av1.OpenBitstreamUnit;
using SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal partial class Av1FrameBuffer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal partial class Av1FrameBuffer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1IntraFilterModeInfo
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1NzMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal static class Av1NzMap
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using SixLabors.ImageSharp.Formats.Heif.Av1.OpenBitstreamUnit;
using SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1ParseAboveNeighbor4x4Context
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using SixLabors.ImageSharp.Formats.Heif.Av1.OpenBitstreamUnit;
using SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1ParseLeftNeighbor4x4Context
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

// Generates 5 bit field in which each bit set to 1 represents
// a BlockSize partition 11111 means we split 128x128, 64x64, 32x32, 16x16
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PartitionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using SixLabors.ImageSharp.Formats.Heif.Av1.OpenBitstreamUnit;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1PartitionInfo
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1PlaneType.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal enum Av1PlaneType : int
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1SuperblockInfo
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SymbolDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using SixLabors.ImageSharp.Formats.Heif.Av1.Prediction;
using SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal ref struct Av1SymbolDecoder
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SymbolEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Buffers;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1SymbolEncoder : IDisposable
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SymbolReader.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal ref struct Av1SymbolReader
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1SymbolWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Buffers;
using SixLabors.ImageSharp.Memory;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1SymbolWriter : IDisposable
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TileInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using SixLabors.ImageSharp.Formats.Heif.Av1.OpenBitstreamUnit;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1TileInfo
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using SixLabors.ImageSharp.Formats.Heif.Av1.Prediction;
using SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1TileReader : IAv1TileReader
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

internal class Av1TransformBlockContext
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Heif/Av1/Tiling/Av1TransformInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
namespace SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

/// <summary>
/// Information of a single Transform Block.
Expand Down
28 changes: 28 additions & 0 deletions src/ImageSharp/Formats/Heif/Av1/Transform/Av1FrameDecoder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

using SixLabors.ImageSharp.Formats.Heif.Av1.OpenBitstreamUnit;
using SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

namespace SixLabors.ImageSharp.Formats.Heif.Av1.Transform;

internal class Av1FrameDecoder
{
private ObuSequenceHeader sequenceHeader;
private ObuFrameHeader frameHeader;
private Av1FrameBuffer frameBuffer;

public Av1FrameDecoder(ObuSequenceHeader sequenceHeader, ObuFrameHeader frameHeader, Av1FrameBuffer frameBuffer)
{
this.sequenceHeader = sequenceHeader;
this.frameHeader = frameHeader;
this.frameBuffer = frameBuffer;
}

public void DecodeFrame()
{
Guard.NotNull(this.sequenceHeader);

// TODO: Implement.
}
}
2 changes: 1 addition & 1 deletion tests/ImageSharp.Tests/Formats/Heif/Av1/Av1TilingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using SixLabors.ImageSharp.Formats.Heif.Av1;
using SixLabors.ImageSharp.Formats.Heif.Av1.OpenBitstreamUnit;
using SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
using SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;

namespace SixLabors.ImageSharp.Tests.Formats.Heif.Av1;

Expand Down
2 changes: 1 addition & 1 deletion tests/ImageSharp.Tests/Formats/Heif/Av1/SymbolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Buffers;
using SixLabors.ImageSharp.Formats.Heif.Av1;
using SixLabors.ImageSharp.Formats.Heif.Av1.Symbol;
using SixLabors.ImageSharp.Formats.Heif.Av1.Tiling;
using SixLabors.ImageSharp.Memory;

namespace SixLabors.ImageSharp.Tests.Formats.Heif.Av1;
Expand Down

0 comments on commit 056814f

Please sign in to comment.