mirror of
https://github.com/chylex/Brotli-Builder.git
synced 2025-05-09 14:34:10 +02:00
Make CompressedMetaBlockBuilder return concrete MetaBlock.Compressed type
This commit is contained in:
parent
ed931fe700
commit
3d43f27bc9
@ -8,7 +8,7 @@ using BrotliLib.Serialization.Writer;
|
||||
|
||||
namespace BrotliImpl{
|
||||
class MetaBlockSizeTracker{
|
||||
public (MetaBlock, BrotliGlobalState)? Smallest { get; private set; } = null;
|
||||
public (MetaBlock.Compressed, BrotliGlobalState)? Smallest { get; private set; } = null;
|
||||
public int SmallestSize { get; private set; } = int.MaxValue;
|
||||
|
||||
private readonly BrotliGlobalState initialState;
|
||||
@ -17,7 +17,7 @@ namespace BrotliImpl{
|
||||
this.initialState = initialState;
|
||||
}
|
||||
|
||||
public void Test(MetaBlock tested, BrotliSerializationParameters? serializationParameters = null, string? debugText = null){
|
||||
public void Test(MetaBlock.Compressed tested, BrotliSerializationParameters? serializationParameters = null, string? debugText = null){
|
||||
var (testedSize, nextState) = CountBits(tested, initialState.Clone(), serializationParameters) ?? (int.MaxValue, null!);
|
||||
|
||||
if (debugText != null){
|
||||
|
@ -156,12 +156,12 @@ namespace BrotliLib.Brotli.Encode.Build{
|
||||
|
||||
// Building
|
||||
|
||||
public (MetaBlock MetaBlock, BrotliEncodeInfo NextInfo) Build(BrotliEncodeInfo info, BrotliCompressionParameters? parameters = null){
|
||||
public (MetaBlock.Compressed MetaBlock, BrotliEncodeInfo NextInfo) Build(BrotliEncodeInfo info, BrotliCompressionParameters? parameters = null){
|
||||
var (metaBlock, nextState) = Build(parameters ?? info.CompressionParameters);
|
||||
return (metaBlock, info.WithProcessedBytes(nextState, OutputSize));
|
||||
}
|
||||
|
||||
public (MetaBlock MetaBlock, BrotliGlobalState NextState) Build(BrotliCompressionParameters parameters){
|
||||
public (MetaBlock.Compressed MetaBlock, BrotliGlobalState NextState) Build(BrotliCompressionParameters parameters){
|
||||
var state = initialState.Clone();
|
||||
|
||||
// Setup
|
||||
|
Loading…
Reference in New Issue
Block a user