UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FOodleDataCompression Namespace Reference

Classes

struct  OodleScratchBuffers
 

Enumerations

enum class  ECompressor : uint8 {
  NotSet = 0 , Selkie = 1 , Mermaid = 2 , Kraken = 3 ,
  Leviathan = 4
}
 
enum class  ECompressionLevel : int8 {
  HyperFast4 = -4 , HyperFast3 = -3 , HyperFast2 = -2 , HyperFast1 = -1 ,
  None = 0 , SuperFast = 1 , VeryFast = 2 , Fast = 3 ,
  Normal = 4 , Optimal1 = 5 , Optimal2 = 6 , Optimal3 = 7 ,
  Optimal4 = 8 , Optimal5 = 9
}
 
enum class  ECompressionCommonUsage : uint8 { Default = 0 , FastRealtimeEncode = 1 , SlowerSmallerEncode = 2 , SlowestOfflineDistributionEncode = 3 }
 

Functions

CORE_API bool ECompressorToString (ECompressor InCompressor, const TCHAR **OutName)
 
CORE_API const TCHARECompressorToString (ECompressor InCompressor)
 
CORE_API bool ECompressorFromString (const FString &InName, ECompressor &OutCompressor)
 
CORE_API bool ECompressionLevelFromString (const TCHAR *InName, ECompressionLevel &OutLevel)
 
CORE_API bool ECompressionLevelToString (ECompressionLevel InLevel, const TCHAR **OutName)
 
CORE_API const TCHARECompressionLevelToString (ECompressionLevel InLevel)
 
CORE_API bool ECompressionLevelFromValue (int8 InValue, ECompressionLevel &OutLevel)
 
ECompressionCommonUsage CORE_API GetCommonUsageFromLegacyCompressionFlags (ECompressionFlags Flags)
 
void CORE_API GetCompressorAndLevelForCommonUsage (ECompressionCommonUsage Usage, ECompressor &OutCompressor, ECompressionLevel &OutLevel)
 
int64 CORE_API CompressedBufferSizeNeeded (int64 InUncompressedSize)
 
int64 CORE_API GetMaximumCompressedSize (int64 InUncompressedSize)
 
void CORE_API CompressionFormatInitOnFirstUseFromLock ()
 
int64 CORE_API Compress (void *OutCompressedData, int64 InCompressedBufferSize, const void *InUncompressedData, int64 InUncompressedSize, ECompressor Compressor, ECompressionLevel Level, bool CompressIndependentChunks, int64 DictionaryBackup)
 
bool CORE_API Decompress (void *OutUncompressedData, int64 InUncompressedSize, const void *InCompressedData, int64 InCompressedSize)
 
void CORE_API StartupPreInit (void)
 
int64 CompressParallelSub (TArray64< TArray64< uint8 > > &OutChunkCompressedData, const void *InUncompressedData, int64 UncompressedSize, ECompressor Compressor, ECompressionLevel Level, bool CompressIndependentChunks)
 
int64 CompressParallel (void *OutCompressedData, int64 CompressedBufferSize, const void *InUncompressedData, int64 UncompressedSize, ECompressor Compressor, ECompressionLevel Level, bool CompressIndependentChunks)
 
int64 CompressParallel (TArray64< uint8 > &OutCompressedArray, const void *InUncompressedData, int64 UncompressedSize, ECompressor Compressor, ECompressionLevel Level, bool CompressIndependentChunks)
 
bool DecompressParallel (void *OutUncompressedData, int64 UncompressedSize, const void *InCompressedData, int64 CompressedSize)
 
bool CORE_API ECompressorFromString (const class FString &InName, ECompressor &OutCompressor)
 

Enumeration Type Documentation

◆ ECompressionCommonUsage

Enumerator
Default 
FastRealtimeEncode 
SlowerSmallerEncode 
SlowestOfflineDistributionEncode 

◆ ECompressionLevel

ECompressionLevel : Choose the Oodle Compression Level this mostly trades encode speed vs compression ratio decode speed is determined by choice of compressor (ECompressor)

If in doubt start with "Normal" (level 4) then move up or down from there

The standard range is in "SuperFast" - "Normal" (levels 1-4)

"HyperFast" levels are for real-time encoding with minimal compression

The "Optimal" levels are much slower to encode, but provide more compression they are intended for offline cooks

representative encode speeds with compression ratio trade off :

Kraken-4 : 1.55:1 , 718.3 enc MB/s Kraken-3 : 1.71:1 , 541.8 enc MB/s Kraken-2 : 1.88:1 , 434.0 enc MB/s Kraken-1 : 2.10:1 , 369.1 enc MB/s Kraken1 : 2.27:1 , 242.6 enc MB/s Kraken2 : 2.32:1 , 157.4 enc MB/s Kraken3 : 2.39:1 , 34.8 enc MB/s Kraken4 : 2.44:1 , 22.4 enc MB/s Kraken5 : 2.55:1 , 10.1 enc MB/s Kraken6 : 2.56:1 , 5.4 enc MB/s Kraken7 : 2.64:1 , 3.7 enc MB/s

Enumerator
HyperFast4 
HyperFast3 
HyperFast2 
HyperFast1 
None 
SuperFast 
VeryFast 
Fast 
Normal 
Optimal1 
Optimal2 
Optimal3 
Optimal4 
Optimal5 

◆ ECompressor

ECompressor : Choose the Oodle Compressor this mostly trades decompression speed vs compression ratio encode speed is determined by ECompressionLevel , not the compressor choice.

From fastest to slowest (to decode) : Selkie, Mermaid, Kraken, Leviathan

When in doubt, start with Kraken Representative compression ratios and decode speeds :

Selkie4 : 1.86:1 , 4232.6 dec MB/s Mermaid4 : 2.21:1 , 2648.9 dec MB/s Kraken4 : 2.44:1 , 1467.1 dec MB/s Leviathan4 : 2.62:1 , 961.8 dec MB/s

Enumerator
NotSet 
Selkie 
Mermaid 
Kraken 
Leviathan 

Function Documentation

◆ Compress()

int64 CORE_API FOodleDataCompression::Compress ( void OutCompressedData,
int64  CompressedBufferSize,
const void InUncompressedData,
int64  UncompressedSize,
ECompressor  Compressor,
ECompressionLevel  Level,
bool  CompressIndependentChunks = false,
int64  DictionaryBackup = 0 
)

Encode provided data with chosen Compressor and Level CompressedBufferSize must be >= CompressedBufferSizeNeeded(UncompressedSize) use CompressParallel instead if buffer can ever be large

Parameters
OutCompressedDataoutput buffer where compressed data is written
CompressedBufferSizebytes available to write in OutCompressedData
InUncompressedDatainput buffer containing data to compress
UncompressedSizenumber of bytes in InUncompressedData to read
CompressorECompressor to encode with (this is saved in the stream)
LevelECompressionLevel to encode with (this is not saved in the stream)
CompressIndependentChunks(optional) should chunks be made independent (allows for parallel decode)
DictionaryBackup(optional) number of bytes preceding InUncompressedData which should be used for dictionary preload
Returns
Compressed size written or zero for failure

◆ CompressedBufferSizeNeeded()

int64 CORE_API FOodleDataCompression::CompressedBufferSizeNeeded ( int64  UncompressedSize)

What size of compressed output buffer is needed to encode into for Compress()

Parameters
UncompressedSizeLength of uncompressed data that will fit in this output buffer
Returns
Minimum size to allocate compressed output buffer

◆ CompressionFormatInitOnFirstUseFromLock()

void CORE_API FOodleDataCompression::CompressionFormatInitOnFirstUseFromLock ( )

◆ CompressParallel() [1/2]

int64 CORE_API FOodleDataCompression::CompressParallel ( TArray64< uint8 > &  OutCompressedData,
const void InUncompressedData,
int64  UncompressedSize,
ECompressor  Compressor,
ECompressionLevel  Level,
bool  CompressIndependentChunks = false 
)

Encode provided data with chosen Compressor and Level, using multiple threads for large buffers CompressedBufferSize must be >= CompressedBufferSizeNeeded(UncompressedSize) CompressParallel can be used in all cases instead of Compress it is fast even on small buffers (will just run synchronously on the calling thread) the output compressed data is the same as Compress can be decoded with either Decompress or DecompressParallel DecompressParallel can only parallelize if CompressIndependentChunks is true at encode time

Parameters
OutCompressedDataoutput buffer where compressed data is written; array is appended to
InUncompressedDatainput buffer containing data to compress
UncompressedSizenumber of bytes in InUncompressedData to read
CompressorECompressor to encode with (this is saved in the stream)
LevelECompressionLevel to encode with (this is not saved in the stream)
CompressIndependentChunksshould chunks be made independent (allows for parallel decode)
Returns
Compressed size written or zero for failure

◆ CompressParallel() [2/2]

int64 CORE_API FOodleDataCompression::CompressParallel ( void OutCompressedData,
int64  CompressedBufferSize,
const void InUncompressedData,
int64  UncompressedSize,
ECompressor  Compressor,
ECompressionLevel  Level,
bool  CompressIndependentChunks = false 
)

Encode provided data with chosen Compressor and Level, using multiple threads for large buffers CompressedBufferSize must be >= CompressedBufferSizeNeeded(UncompressedSize) CompressParallel can be used in all cases instead of Compress it is fast even on small buffers (will just run synchronously on the calling thread) the output compressed data is the same as Compress can be decoded with either Decompress or DecompressParallel DecompressParallel can only parallelize if CompressIndependentChunks is true at encode time

Parameters
OutCompressedDataoutput buffer where compressed data is written
CompressedBufferSizebytes available to write in OutCompressedData
InUncompressedDatainput buffer containing data to compress
UncompressedSizenumber of bytes in InUncompressedData to read
CompressorECompressor to encode with (this is saved in the stream)
LevelECompressionLevel to encode with (this is not saved in the stream)
CompressIndependentChunks(optional) should chunks be made independent (allows for parallel decode)
Returns
Compressed size written or zero for failure

◆ CompressParallelSub()

int64 FOodleDataCompression::CompressParallelSub ( TArray64< TArray64< uint8 > > &  OutChunkCompressedData,
const void InUncompressedData,
int64  UncompressedSize,
ECompressor  Compressor,
ECompressionLevel  Level,
bool  CompressIndependentChunks 
)

◆ Decompress()

bool CORE_API FOodleDataCompression::Decompress ( void OutUncompressedData,
int64  UncompressedSize,
const void InCompressedData,
int64  CompressedSize 
)

Decode compressed data that was made by Compress

UncompressedSize must match exactly the uncompressed size that was used at encode time. No partial decodes.

If buffer can ever be large, use DecompressParallel instead

Parameters
OutUncompressedDataoutput buffer where uncompressed data is written
UncompressedSizenumber of bytes to decompress
InCompressedDatainput buffer containing compressed data
CompressedSizesize of the input buffer, must be greater or equal to the number of compressed bytes needed
Returns
boolean success

◆ DecompressParallel()

bool CORE_API FOodleDataCompression::DecompressParallel ( void OutUncompressedData,
int64  UncompressedSize,
const void InCompressedData,
int64  CompressedSize 
)

Decode compressed data that was made by Compress, using multiple threads when possible.

UncompressedSize must match exactly the uncompressed size that was used at encode time. No partial decodes.

There's no penalty to using this on small buffers, it will just decode synchronously on the calling thread in that case. DecompressParallel can be used to decode data written by Compress or CompressParallel. DecompressParallel can be used in all places you would call Decompress.

DecompressParallel can only use more than 1 thread if the encoding was done with CompressIndependentChunks = true

Parameters
OutUncompressedDataoutput buffer where uncompressed data is written
UncompressedSizenumber of bytes to decompress
InCompressedDatainput buffer containing compressed data
CompressedSizesize of the input buffer, must be greater or equal to the number of compressed bytes needed
Returns
boolean success

◆ ECompressionLevelFromString()

CORE_API bool FOodleDataCompression::ECompressionLevelFromString ( const TCHAR InName,
ECompressionLevel OutLevel 
)

◆ ECompressionLevelFromValue()

bool CORE_API FOodleDataCompression::ECompressionLevelFromValue ( int8  InValue,
ECompressionLevel OutLevel 
)

◆ ECompressionLevelToString() [1/2]

CORE_API const TCHAR * FOodleDataCompression::ECompressionLevelToString ( ECompressionLevel  InLevel)

◆ ECompressionLevelToString() [2/2]

bool CORE_API FOodleDataCompression::ECompressionLevelToString ( ECompressionLevel  InLevel,
const TCHAR **  OutName 
)

◆ ECompressorFromString() [1/2]

bool CORE_API FOodleDataCompression::ECompressorFromString ( const class FString &  InName,
ECompressor OutCompressor 
)

◆ ECompressorFromString() [2/2]

CORE_API bool FOodleDataCompression::ECompressorFromString ( const FString &  InName,
ECompressor OutCompressor 
)

◆ ECompressorToString() [1/2]

CORE_API const TCHAR * FOodleDataCompression::ECompressorToString ( ECompressor  InCompressor)

◆ ECompressorToString() [2/2]

bool CORE_API FOodleDataCompression::ECompressorToString ( ECompressor  InCompressor,
const TCHAR **  OutName 
)

◆ GetCommonUsageFromLegacyCompressionFlags()

ECompressionCommonUsage CORE_API FOodleDataCompression::GetCommonUsageFromLegacyCompressionFlags ( ECompressionFlags  Flags)

Translate legacy CompressionFlags to an ECompressionCommonUsage CompressionFlags is not encouraged for new code; prefer directly calling to Oodle

Parameters
FlagsECompressionFlags (BiasSpeed,BiasSize,ForPackaging)
Returns
ECompressionCommonUsage

◆ GetCompressorAndLevelForCommonUsage()

void CORE_API FOodleDataCompression::GetCompressorAndLevelForCommonUsage ( ECompressionCommonUsage  Usage,
ECompressor OutCompressor,
ECompressionLevel OutLevel 
)

Translate CompressionCommonUsage to a Compressor & Level selection usually prefer the more expressive choice of {Compressor,Level}

Parameters
UsageYour intended compression use case
OutCompressorOutput reference
OutLevelOutput reference
Returns

◆ GetMaximumCompressedSize()

int64 CORE_API FOodleDataCompression::GetMaximumCompressedSize ( int64  UncompressedSize)

What is the maximum size of compressed data made after encoding For pre-allocating buffers at decode time or to check the length of compressed data at load time NOTE : CompressedBufferSizeNeeded() >= GetMaximumCompressedSize() this is not the size to allocate compressed buffers at encode time; see CompressedBufferSizeNeeded

Parameters
UncompressedSizeLength of uncompressed data that could have been encoded
Returns
Maximum size of compressed data that Compress() could have made

◆ StartupPreInit()

void CORE_API FOodleDataCompression::StartupPreInit ( void  )

Variable Documentation

◆ Compressor

ECompressor FOodleDataCompression::Compressor

◆ Level

ECompressionLevel FOodleDataCompression::Level

◆ Name

const TCHAR* FOodleDataCompression::Name