bUseCompression

bUseCompression

#Overview

name: bUseCompression

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 51 C++ source files. Also referenced in 1 C# build file meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of bUseCompression is to control whether compression should be applied when processing or storing data, typically in the context of video capture, serialization, or data transfer within Unreal Engine 5. This variable is used across various subsystems and modules to determine if data should be compressed to reduce size at the cost of additional processing time.

Key points about bUseCompression:

  1. It’s used in multiple Unreal Engine subsystems, including Niagara, MovieSceneCapture, GeometryCore, and AIModule.

  2. In video capture contexts (UVideoCaptureProtocol), it determines whether the captured video should be compressed.

  3. In serialization contexts (e.g., FDynamicMesh3Serialization, FDynamicMeshAttributeSet), it controls whether data should be compressed when writing to or reading from archives.

  4. The value is typically set by the system or configuration, but can sometimes be user-configurable (e.g., in UVideoCaptureProtocol).

  5. When enabled, it usually results in smaller data size but increased processing time.

  6. It often interacts with other variables like CompressionQuality or CompressionType to determine the specifics of the compression.

  7. In some cases, enabling compression also triggers data compaction for more efficient storage.

Developers should be aware that:

  1. Enabling compression can significantly increase processing time, especially for large datasets.

  2. The trade-off between file size and processing time should be considered based on the specific use case.

  3. Some systems may have specific requirements or limitations when compression is used, so thorough testing is advisable.

  4. In some contexts, compression might be automatically enabled if certain conditions are met, even if not explicitly set.

Best practices when using this variable include:

  1. Consider the performance implications of enabling compression, especially for real-time or performance-critical systems.

  2. Ensure that all related compression settings (quality, type, etc.) are appropriately configured when enabling compression.

  3. Test the system thoroughly with compression both enabled and disabled to understand the impact on performance and data integrity.

  4. Document the use of compression in your project, including any specific settings or considerations for different subsystems.

  5. When serializing data, consider the backwards compatibility implications of changing compression settings.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:373, section: [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraDataInterfaceRenderTarget2D.cpp:646

Scope (from outer to inner):

file
function     bool UNiagaraDataInterfaceRenderTarget2D::SimCacheWriteFrame

Source code excerpt:


			const FName CompressionType = SimCacheData->CompressionType;
			const bool bUseCompression = CompressionType.IsNone() == false;
			const int TextureSizeBytes = TextureData.Num() * TextureData.GetTypeSize();
			int CompressedSize = bUseCompression ? FCompression::CompressMemoryBound(CompressionType, TextureSizeBytes) : TextureSizeBytes;

			CacheFrame->UncompressedSize = TextureSizeBytes;
			CacheFrame->CompressedSize = 0;
			uint8* FinalPixelData = reinterpret_cast<uint8*>(FMemory::Malloc(CompressedSize));
			if (bUseCompression)
			{
				if (FCompression::CompressMemory(CompressionType, FinalPixelData, CompressedSize, TextureData.GetData(), TextureSizeBytes, COMPRESS_BiasMemory))
				{
					CacheFrame->CompressedSize = CompressedSize;
				}
				else

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraDataInterfaceRenderTargetVolume.cpp:706

Scope (from outer to inner):

file
function     bool UNiagaraDataInterfaceRenderTargetVolume::SimCacheWriteFrame

Source code excerpt:


				const FName CompressionType = SimCacheData->CompressionType;
				const bool bUseCompression = CompressionType.IsNone() == false;
				const int TextureSizeBytes = TextureData.Num() * TextureData.GetTypeSize();
				int CompressedSize = bUseCompression ? FCompression::CompressMemoryBound(CompressionType, TextureSizeBytes) : TextureSizeBytes;

				CacheFrame->UncompressedSize = TextureSizeBytes;
				CacheFrame->CompressedSize = 0;
				uint8* FinalPixelData = reinterpret_cast<uint8*>(FMemory::Malloc(CompressedSize));
				if (bUseCompression)
				{
					if (FCompression::CompressMemory(CompressionType, FinalPixelData, CompressedSize, TextureData.GetData(), TextureSizeBytes, COMPRESS_BiasMemory))
					{
						CacheFrame->CompressedSize = CompressedSize;
					}
				}

#Loc: <Workspace>/Engine/Plugins/Media/AvidDNxMedia/Source/Source/Private/MoviePipelineAvidDNxOutput.cpp:28

Scope (from outer to inner):

file
function     TUniquePtr<MovieRenderPipeline::IVideoCodecWriter> UMoviePipelineAvidDNxOutput::Initialize_GameThread

Source code excerpt:

	Options.Height = InResolution.Y;
	Options.FrameRate = GetPipeline()->GetPipelinePrimaryConfig()->GetEffectiveFrameRate(GetPipeline()->GetTargetSequence());
	Options.bCompress = bUseCompression;
	Options.NumberOfEncodingThreads = NumberOfEncodingThreads;

	TUniquePtr<FAvidDNxEncoder> Encoder = MakeUnique<FAvidDNxEncoder>(Options);
	
	TUniquePtr<FAvidWriter> OutWriter = MakeUnique<FAvidWriter>();
	OutWriter->Writer = MoveTemp(Encoder);

#Loc: <Workspace>/Engine/Plugins/Media/AvidDNxMedia/Source/Source/Private/MoviePipelineAvidDNxOutput.h:16

Scope (from outer to inner):

file
class        class UMoviePipelineAvidDNxOutput : public UMoviePipelineVideoOutputBase
function     UMoviePipelineAvidDNxOutput

Source code excerpt:

		UMoviePipelineAvidDNxOutput()
		: UMoviePipelineVideoOutputBase()
		, bUseCompression(true)
		, NumberOfEncodingThreads(4)
	{
	}

protected:
	// UMoviePipelineVideoOutputBase Interface

#Loc: <Workspace>/Engine/Plugins/Media/AvidDNxMedia/Source/Source/Private/MoviePipelineAvidDNxOutput.h:41

Scope (from outer to inner):

file
class        class UMoviePipelineAvidDNxOutput : public UMoviePipelineVideoOutputBase

Source code excerpt:

	/** Should we use a lossy compression for the output? */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Settings")
	bool bUseCompression;

	/** How many threads should the AvidDNx Encoders use to encode frames? */
	UPROPERTY(EditAnywhere, meta=(UIMin=1, ClampMin=1), BlueprintReadWrite, Category = "Settings")
	int32 NumberOfEncodingThreads;

protected:

#Loc: <Workspace>/Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServerEditor/Private/AndroidFileServerRuntimeSettings.cpp:15

Scope (from outer to inner):

file
function     UAndroidFileServerRuntimeSettings::UAndroidFileServerRuntimeSettings

Source code excerpt:

		, bAllowExternalStartInShipping(false)
		, bCompileAFSProject(false)
		, bUseCompression(false)
		, bLogFiles(false)
		, bReportStats(false)
		, ConnectionType(EAFSConnectionType::USBOnly)
		, bUseManualIPAddress(false)
		, ManualIPAddress(TEXT(""))
{

#Loc: <Workspace>/Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServerEditor/Public/AndroidFileServerRuntimeSettings.h:51

Scope (from outer to inner):

file
class        class UAndroidFileServerRuntimeSettings : public UObject

Source code excerpt:

	// Enable compression during data transfer
	UPROPERTY(EditAnywhere, config, Category = Deployment, Meta=(EditCondition = "bEnablePlugin"))
	bool bUseCompression;

	// Log files transferred
	UPROPERTY(EditAnywhere, config, Category = Deployment, Meta=(EditCondition = "bEnablePlugin"))
	bool bLogFiles;

	// Report transfer rate statistics

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Classes/EnvironmentQuery/EnvQueryDebugHelpers.h:161

Scope (from outer to inner):

file
class        class UEnvQueryDebugHelpers : public UObject

Source code excerpt:

#if USE_EQS_DEBUGGER
	static AIMODULE_API void QueryToDebugData(FEnvQueryInstance& Query, EQSDebug::FQueryData& EQSLocalData, int32 MaxItemsToStore = 10);
	static AIMODULE_API void QueryToBlobArray(FEnvQueryInstance& Query, TArray<uint8>& BlobArray, bool bUseCompression = false);
	static AIMODULE_API void DebugDataToBlobArray(EQSDebug::FQueryData& QueryData, TArray<uint8>& BlobArray, bool bUseCompression = false);
	static AIMODULE_API void BlobArrayToDebugData(const TArray<uint8>& BlobArray, EQSDebug::FQueryData& EQSLocalData, bool bUseCompression = false);
#endif

#if ENABLE_VISUAL_LOG && USE_EQS_DEBUGGER
	static AIMODULE_API void LogQuery(FEnvQueryInstance& Query, const FLogCategoryBase& Category, ELogVerbosity::Type Verbosity);
	static AIMODULE_API void LogQuery(FEnvQueryInstance& Query, const FName& CategoryName, ELogVerbosity::Type Verbosity);

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/EnvironmentQuery/EnvQueryDebugHelpers.cpp:12

Scope (from outer to inner):

file
function     void UEnvQueryDebugHelpers::QueryToBlobArray

Source code excerpt:


#if USE_EQS_DEBUGGER
void UEnvQueryDebugHelpers::QueryToBlobArray(FEnvQueryInstance& Query, TArray<uint8>& BlobArray, bool bUseCompression)
{
	EQSDebug::FQueryData EQSLocalData;
	UEnvQueryDebugHelpers::QueryToDebugData(Query, EQSLocalData);

	DebugDataToBlobArray(EQSLocalData, BlobArray, bUseCompression);
}

void UEnvQueryDebugHelpers::DebugDataToBlobArray(EQSDebug::FQueryData& EQSLocalData, TArray<uint8>& BlobArray, bool bUseCompression)
{
	if (!bUseCompression)
	{
		FMemoryWriter ArWriter(BlobArray);
		ArWriter << EQSLocalData;
	}
	else
	{

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/EnvironmentQuery/EnvQueryDebugHelpers.cpp:112

Scope (from outer to inner):

file
function     void UEnvQueryDebugHelpers::BlobArrayToDebugData

Source code excerpt:

}

void  UEnvQueryDebugHelpers::BlobArrayToDebugData(const TArray<uint8>& BlobArray, EQSDebug::FQueryData& EQSLocalData, bool bUseCompression)
{
	if (!bUseCompression)
	{
		FMemoryReader ArReader(BlobArray);
		ArReader << EQSLocalData;
	}
	else
	{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/VisualLogger/VisualLoggerBinaryFileDevice.h:29

Scope (from outer to inner):

file
class        class FVisualLoggerBinaryFileDevice : public FVisualLogDevice

Source code excerpt:


protected:
	int32 bUseCompression : 1;
	float FrameCacheLenght;
	double StartRecordingTime;
	double LastLogTimeStamp;
	FArchive* FileArchive;
	FString TempFileName;
	FString FileName;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VisualLogger/VisualLoggerBinaryFileDevice.cpp:17

Scope (from outer to inner):

file
function     FVisualLoggerBinaryFileDevice::FVisualLoggerBinaryFileDevice

Source code excerpt:

	bool UseCompression = false;
	GConfig->GetBool(TEXT("VisualLogger"), TEXT("UseCompression"), UseCompression, GEngineIni);
	bUseCompression = UseCompression;
}

void FVisualLoggerBinaryFileDevice::Cleanup(bool bReleaseMemory)
{

}

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3_Serialization.cpp:24

Scope (from outer to inner):

file
namespace    FDynamicMesh3Serialization_Local

Source code excerpt:

	bool bPreserveDataLayout; //< Preserve the data layout, i.e. external vertex/triangle/edge indices are still valid after roundtrip serialization.
	bool bCompactData; //< Remove any holes or padding in the data layout, and discard/recompute any redundant data. 
	bool bUseCompression; //< Compress all data buffers to minimize memory footprint.

	explicit FDynamicMesh3SerializationOptions(const FArchive& Ar)
		: bPreserveDataLayout(Ar.IsTransacting())
		, bCompactData(!Ar.IsTransacting())
		, bUseCompression(Ar.IsPersistent())
	{
		checkSlow(bPreserveDataLayout != bCompactData); // Preserving the data layout and compacting the data are mutually exclusive.
	}

	enum EImplementationVariant
	{

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3_Serialization.cpp:49

Scope (from outer to inner):

file
namespace    FDynamicMesh3Serialization_Local
function     FArchive& operator<<

Source code excerpt:

		Ar << Options.bPreserveDataLayout;
		Ar << Options.bCompactData;
		Ar << Options.bUseCompression;
		return Ar;
	}
};

// Serializes a generic dynamic vector containing bulk data.
template <typename T>
void SerializeVector(FArchive& Ar, TDynamicVector<T>& Vector, const FDynamicMesh3SerializationOptions& Options)
{
	if (Options.bUseCompression)
	{
		Vector.template Serialize<true /* bForceBulkSerialization */, true /* bUseCompression */>(Ar);
	}
	else
	{
		Vector.template Serialize<true /* bForceBulkSerialization */, false /* bUseCompression */>(Ar);
	}
}

// Serializes an optional generic dynamic vector containing bulk data.
// We need to do our own serialization since using the default serialization for TOptional would not allow us to customize the dynamic vector serialization.
template <typename T>

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3_Serialization.cpp:109

Scope (from outer to inner):

file
namespace    FDynamicMesh3Serialization_Local
function     void SerializeRefCounts

Source code excerpt:

void SerializeRefCounts(FArchive& Ar, FRefCountVector& RefCounts, const FDynamicMesh3SerializationOptions& Options)
{
	RefCounts.Serialize(Ar, Options.bCompactData, Options.bUseCompression);
}

// Resets a ref count vector for dense triangle data, i.e. all ref count values are 1.
void ResetDenseTriangleRefCounts(size_t Num, FRefCountVector& TriangleRefCounts)
{
	TriangleRefCounts.Trim(Num);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3_Serialization.cpp:155

Scope (from outer to inner):

file
namespace    FDynamicMesh3Serialization_Local
function     void SerializeSmallListSet

Source code excerpt:

void SerializeSmallListSet(FArchive& Ar, FSmallListSet& SmallListSet, const FDynamicMesh3SerializationOptions& Options)
{
	SmallListSet.Serialize(Ar, Options.bCompactData, Options.bUseCompression);
}

// Recomputes all the redundant edge data for given sets of vertices and triangles.
template <typename FindEdgeFunc, typename AddEdgeInternalFunc>
void RecomputeEdgeData(const TDynamicVector<FVector3d>& Vertices, const TDynamicVector<FIndex3i>& Triangles, const FRefCountVector& TriangleRefCounts,
                       TDynamicVector<FDynamicMesh3::FEdge>& Edges, FRefCountVector& EdgeRefCounts, TDynamicVector<FIndex3i>& TriangleEdges,

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMesh3_Serialization.cpp:212

Scope (from outer to inner):

file
namespace    FDynamicMesh3Serialization_Local
function     void SerializeAttributeSet

Source code excerpt:

		}

		Mesh->Attributes()->Serialize(Ar, CompactMaps, Options.bUseCompression);
	}
}

// Creates a generic optional dynamic vector of a given size if and only if another optional vector is set.
// This reduces code duplication for creating compacting vectors for optional mesh data such as normals or colors.
template <typename T>

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshAttributeSet.cpp:1249

Scope (from outer to inner):

file
namespace    FDynamicMeshAttributeSet_Local
function     void SerializeLayers

Source code excerpt:

{
template <typename LayerType>
void SerializeLayers(TIndirectArray<LayerType>& Layers, FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression)
{
	int32 Num = Layers.Num();
	Ar << Num;
	if (Ar.IsLoading())
	{
		Layers.Empty(Num);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshAttributeSet.cpp:1263

Scope (from outer to inner):

file
namespace    FDynamicMeshAttributeSet_Local
function     void SerializeLayers

Source code excerpt:

	for (int32 Index = 0; Index < Num; ++Index)
	{
		Layers[Index].Serialize(Ar, CompactMaps, bUseCompression);
	}
}
} // namespace FDynamicMeshAttributeSet_Local

void FDynamicMeshAttributeSet::Serialize(FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression)
{
	using namespace FDynamicMeshAttributeSet_Local;
	
	Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);

	const bool bUseLegacySerialization = Ar.IsLoading() && Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) < FUE5MainStreamObjectVersion::DynamicMeshCompactedSerialization;

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshAttributeSet.cpp:1285

Scope (from outer to inner):

file
function     void FDynamicMeshAttributeSet::Serialize

Source code excerpt:

	else
	{
		Ar << bUseCompression;

		// We do our own serialization since using the serialization in TIndirectArray will not allow us to do compacting/compression.
		SerializeLayers(UVLayers, Ar, CompactMaps, bUseCompression);
		SerializeLayers(NormalLayers, Ar, CompactMaps, bUseCompression);
		SerializeLayers(PolygroupLayers, Ar, CompactMaps, bUseCompression);

		const bool bSerializeWeightLayers = !Ar.IsLoading() || Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) >= FUE5MainStreamObjectVersion::DynamicMeshAttributesWeightMapsAndNames;
		if (bSerializeWeightLayers)
		{
			SerializeLayers(WeightLayers, Ar, CompactMaps, bUseCompression);
		}
	}

	if (Ar.IsLoading())
	{
		// Manually populate ParentMesh since deserialization of the individual

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshAttributeSet.cpp:1330

Scope (from outer to inner):

file
function     void FDynamicMeshAttributeSet::Serialize

Source code excerpt:

			EnablePrimaryColors();
		}
		ColorLayer->Serialize(Ar, CompactMaps, bUseCompression);
	}

	bool bHasMaterialID = HasMaterialID();
	Ar << bHasMaterialID;
	if (bHasMaterialID)
	{

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshAttributeSet.cpp:1341

Scope (from outer to inner):

file
function     void FDynamicMeshAttributeSet::Serialize

Source code excerpt:

			EnableMaterialID();
		}
		MaterialIDAttrib->Serialize(Ar, CompactMaps, bUseCompression);
	}

	if (!bUseLegacySerialization)
	{
		int32 NumSkinWeightAttributes = SkinWeightAttributes.Num();
		Ar << NumSkinWeightAttributes;

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshAttributeSet.cpp:1365

Scope (from outer to inner):

file
function     void FDynamicMeshAttributeSet::Serialize

Source code excerpt:

				{
					Value.Reset(new FDynamicMeshVertexSkinWeightsAttribute(ParentMesh, false));
					Value.Get()->Serialize(Ar, CompactMaps, bUseCompression);
				}
			}
		}
		else
		{
			for (SkinWeightAttributesMap::TIterator It(SkinWeightAttributes); It; ++It)

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshAttributeSet.cpp:1381

Scope (from outer to inner):

file
function     void FDynamicMeshAttributeSet::Serialize

Source code excerpt:

				if (bIsValid)
				{
					Value.Get()->Serialize(Ar, CompactMaps, bUseCompression);
				}
			}
		}
	}

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshOverlay.cpp:1720

Scope (from outer to inner):

file
function     void TDynamicMeshOverlay<RealType, ElementSize>::Serialize

Source code excerpt:


template<typename RealType, int ElementSize>
void TDynamicMeshOverlay<RealType, ElementSize>::Serialize(FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression)
{
	Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);
	if (Ar.IsLoading() && Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) < FUE5MainStreamObjectVersion::DynamicMeshCompactedSerialization)
	{
		Ar << ElementsRefCounts;
		Ar << Elements;

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshOverlay.cpp:1732

Scope (from outer to inner):

file
function     void TDynamicMeshOverlay<RealType, ElementSize>::Serialize
lambda-function

Source code excerpt:

	else
	{
		auto SerializeVector = [](FArchive& Ar, auto& Vector, bool bUseCompression)
		{
			if (bUseCompression)
			{
				Vector.template Serialize<true, true>(Ar);
			}
			else
			{
				Vector.template Serialize<true, false>(Ar);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshOverlay.cpp:1748

Scope (from outer to inner):

file
function     void TDynamicMeshOverlay<RealType, ElementSize>::Serialize

Source code excerpt:

		if (Ar.IsLoading() || !CompactMaps || !CompactMaps->VertexMapIsSet())
		{
			ElementsRefCounts.Serialize(Ar, false, bUseCompression);

			SerializeVector(Ar, Elements, bUseCompression);
			SerializeVector(Ar, ParentVertices, bUseCompression);
		}
		else
		{
			const size_t NumElements = ElementsRefCounts.GetCount();

			FRefCountVector ElementsRefCountsCompact;

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshOverlay.cpp:1785

Scope (from outer to inner):

file
function     void TDynamicMeshOverlay<RealType, ElementSize>::Serialize

Source code excerpt:

			}

			ElementsRefCountsCompact.Serialize(Ar, true, bUseCompression);
			SerializeVector(Ar, ElementsCompact, bUseCompression);
			SerializeVector(Ar, ParentVerticesCompact, bUseCompression);
		}

		if (Ar.IsLoading() || ((!CompactMaps || !CompactMaps->TriangleMapIsSet()) && !ElementMap))
		{
			SerializeVector(Ar, ElementTriangles, bUseCompression);
		}
		else
		{
			TDynamicVector<int> ElementTrianglesCompact;
			ElementTrianglesCompact.SetNum(ParentMesh->TriangleCount() * 3);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/DynamicMesh/DynamicMeshOverlay.cpp:1848

Scope (from outer to inner):

file
function     void TDynamicMeshOverlay<RealType, ElementSize>::Serialize

Source code excerpt:

			}

			SerializeVector(Ar, ElementTrianglesCompact, bUseCompression);
		}
	}
}


namespace UE

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/Util/SmallListSet.cpp:456

Scope (from outer to inner):

file
function     void FSmallListSet::Serialize

Source code excerpt:

}

void FSmallListSet::Serialize(FArchive& Ar, bool bCompactData, bool bUseCompression)
{
	Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);
	if (Ar.IsLoading() && Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) < FUE5MainStreamObjectVersion::DynamicMeshCompactedSerialization)
	{
		Ar << ListHeads;
		Ar << ListBlocks;

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/Util/SmallListSet.cpp:471

Scope (from outer to inner):

file
function     void FSmallListSet::Serialize

Source code excerpt:

	{
		Ar << bCompactData;
		Ar << bUseCompression;

		auto SerializeVector = [](FArchive& Ar, auto& Vector, bool bUseCompression)
		{
			if (bUseCompression)
			{
				Vector.template Serialize<true, true>(Ar);
			}
			else
			{
				Vector.template Serialize<true, false>(Ar);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/Util/SmallListSet.cpp:485

Scope (from outer to inner):

file
function     void FSmallListSet::Serialize

Source code excerpt:

		};

		// Compact the data into a flat buffer if either bCompactData or bUseCompression is enabled.
		// Considering the significant time overhead for compression, it makes sense to just compact the data as well even though it is not requested.
		if (bCompactData || bUseCompression)
		{
			// We are compacting the data by flattening the lists into one tightly packed buffer.
			// The first value in the buffer is the number of allocated lists even if they are empty. After that each list consists of the number of values
			// followed by the actual values.
			// Note that due to values beyond the BLOCKSIZE are inserted into the linked list, we reverse the order for these values then loading in the data to
			// restore the original order.

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/Util/SmallListSet.cpp:502

Scope (from outer to inner):

file
function     void FSmallListSet::Serialize

Source code excerpt:

				Reset();

				SerializeVector(Ar, Buffer, bUseCompression);

				// Read a value from the buffer while making sure there are no buffer overruns due to corrupted data.
				const size_t BufferNum = Buffer.Num();
				auto GetBufferValue = [&Buffer, &BufferNum](const size_t Index) -> int32
				{
					return Index < BufferNum ? Buffer[Index] : 0;

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Private/Util/SmallListSet.cpp:576

Scope (from outer to inner):

file
function     void FSmallListSet::Serialize

Source code excerpt:

				}

				SerializeVector(Ar, Buffer, bUseCompression);
			}
		}
		else
		{
			// Naively serialize all of the underlying data.
			SerializeVector(Ar, ListHeads, false);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicMeshAttributeSet.h:541

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry

Source code excerpt:

	* @param Ar Archive to serialize with.
	* @param CompactMaps If this is not a null pointer, the mesh serialization compacted the vertex and/or triangle data using the provided mapping. 
	* @param bUseCompression Use compression for serializing bulk data.
	*/
	GEOMETRYCORE_API void Serialize(FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression);

protected:
	/** Parent mesh of this attribute set */
	FDynamicMesh3* ParentMesh;
	

	TIndirectArray<FDynamicMeshUVOverlay> UVLayers;
	TIndirectArray<FDynamicMeshNormalOverlay> NormalLayers;
	TUniquePtr<FDynamicMeshColorOverlay> ColorLayer;

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicMeshOverlay.h:607

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicMeshOverlay

Source code excerpt:

	 * @param Ar Archive to serialize with.
	 * @param CompactMaps If this is not a null pointer, the mesh serialization compacted the vertex and/or triangle data using the provided mapping. 
	 * @param bUseCompression Use compression for serializing bulk data.
	 */
	void Serialize(FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression);

public:
	/** Set a triangle's element indices to InvalidID */
	void InitializeNewTriangle(int TriangleID);
	/** Remove a triangle from the overlay */
	void OnRemoveTriangle(int TriangleID);
	/** Reverse the orientation of a triangle's elements */
	void OnReverseTriOrientation(int TriangleID);
	/** Update the overlay to reflect an edge split in the parent mesh */
	void OnSplitEdge(const DynamicMeshInfo::FEdgeSplitInfo& SplitInfo);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicMeshTriangleAttribute.h:446

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicMeshTriangleAttribute : public FDynamicMeshAttributeBase

Source code excerpt:

	* @param Ar Archive to serialize with.
	* @param CompactMaps If this is not a null pointer, the mesh serialization compacted the vertex and/or triangle data using the provided mapping. 
	* @param bUseCompression Use compression for serializing bulk data.
	*/
	void Serialize(FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression)
	{
		Super::Serialize(Ar);

		Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);
		if (Ar.IsLoading() && Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) < FUE5MainStreamObjectVersion::DynamicMeshCompactedSerialization)
		{
			Ar << AttribValues;
		}
		else
		{
			auto SerializeVector = [](FArchive& Ar, auto& Vector, bool bUseCompression)
			{
				if (bUseCompression)
				{
					Vector.template Serialize<true, true>(Ar);
				}
				else
				{
					Vector.template Serialize<true, false>(Ar);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicMeshTriangleAttribute.h:471

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicMeshTriangleAttribute : public FDynamicMeshAttributeBase
function     void Serialize

Source code excerpt:

			};

			Ar << bUseCompression;

			if (CompactMaps == nullptr || !CompactMaps->TriangleMapIsSet())
			{
				SerializeVector(Ar, AttribValues, bUseCompression);
			}
			else
			{
				TDynamicVector<AttribValueType> AttribValuesCompact;
				AttribValuesCompact.SetNum(ParentMesh->TriangleCount() * AttribDimension);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicMeshTriangleAttribute.h:495

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicMeshTriangleAttribute : public FDynamicMeshAttributeBase
function     void Serialize

Source code excerpt:

				}

				SerializeVector(Ar, AttribValuesCompact, bUseCompression);
			}
		}
	}
};

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicVertexAttribute.h:448

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicVertexAttribute : public TDynamicAttributeBase<ParentType>

Source code excerpt:

	* @param Ar Archive to serialize with.
	* @param CompactMaps If this is not a null pointer, the mesh serialization compacted the vertex and/or triangle data using the provided mapping.
	* @param bUseCompression Use compression for serializing bulk data.
	*/
	void Serialize(FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression)
	{
		Super::Serialize(Ar);

		Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);
		if (Ar.IsLoading() && Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) < FUE5MainStreamObjectVersion::DynamicMeshCompactedSerialization)
		{
			Ar << AttribValues;
		}
		else
		{
			auto SerializeVector = [](FArchive& Ar, auto& Vector, bool bUseCompression)
			{
				if (bUseCompression)
				{
					Vector.template Serialize<true, true>(Ar);
				}
				else
				{
					Vector.template Serialize<true, false>(Ar);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicVertexAttribute.h:473

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicVertexAttribute : public TDynamicAttributeBase<ParentType>
function     void Serialize

Source code excerpt:

			};

			Ar << bUseCompression;

			if (CompactMaps == nullptr || !CompactMaps->VertexMapIsSet())
			{
				SerializeVector(Ar, AttribValues, bUseCompression);
			}
			else
			{
				TDynamicVector<AttribValueType> AttribValuesCompact;
				AttribValuesCompact.SetNum(Parent->VertexCount() * AttribDimension);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicVertexAttribute.h:497

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicVertexAttribute : public TDynamicAttributeBase<ParentType>
function     void Serialize

Source code excerpt:

				}

				SerializeVector(Ar, AttribValuesCompact, bUseCompression);
			}
		}
	}


protected:

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicVertexSkinWeightsAttribute.h:470

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicVertexSkinWeightsAttribute final : public TDynamicAttributeBase<ParentType>
function     void Serialize

Source code excerpt:

	}

	void Serialize(FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression)
	{
		Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);

		Ar << bUseCompression;

		const bool bUseVertexCompactMap = CompactMaps && CompactMaps->VertexMapIsSet();

		if (!bUseCompression)
		{
			if (Ar.IsLoading() || !bUseVertexCompactMap)
			{
				VertexBoneWeights.Serialize<false, false>(Ar);
			}
			else

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/Util/DynamicVector.h:157

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicVector

Source code excerpt:

	 * Serialize vector to and from an archive
	 * @tparam bForceBulkSerialization Forces serialization to consider data to be trivial and serialize it in bulk to potentially achieve better performance.
	 * @tparam bUseCompression Use compression to serialize data; the resulting size will likely be smaller but serialization will take significantly longer.
	 * @param Ar Archive to serialize with
	 */
	template <bool bForceBulkSerialization = false, bool bUseCompression = false>
	void Serialize(FArchive& Ar)
	{
		Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);
		if (Ar.IsLoading() && Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) < FUE5MainStreamObjectVersion::DynamicMeshCompactedSerialization)
		{
			const SIZE_T CountBytes = 3 * sizeof(uint32) + Blocks.Num() * BlockSize * sizeof(Type);
			Ar.CountBytes(CountBytes, CountBytes);
			Ar << CurBlock;

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/Util/DynamicVector.h:450

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class TDynamicVector
class        class TBlockVector

Source code excerpt:

		}

		template <bool bForceBulkSerialization, bool bUseCompression>
		void Serialize(FArchive& Ar, uint32 Num)
		{
			constexpr bool bUseBulkSerialization = bForceBulkSerialization || TCanBulkSerialize<Type>::Value || sizeof(Type) == 1;
			static_assert(!bUseCompression || bUseBulkSerialization, "Compression only available when using bulk serialization");

			checkSlow(Num > 0);

			// Serialize compression flag, which adds flexibility when de-serializing existing data even if some implementation details change.  
			bool bUseCompressionForBulkSerialization = bUseBulkSerialization && bUseCompression;
			Ar << bUseCompressionForBulkSerialization;

			// Determine number of blocks.
			const bool bNumIsNotMultipleOfBlockSize = Num % BlockSize != 0;
			const uint32 NumBlocks = Num / BlockSize + bNumIsNotMultipleOfBlockSize;
			

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/Util/RefCountVector.h:518

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class FRefCountVector

Source code excerpt:

	 * @param Ar Archive to serialize with
	 * @param bCompactData Only serialize unique data and/or recompute redundant data when loading.
	 * @param bUseCompression Use compression to serialize data; the resulting size will likely be smaller but serialization will take significantly longer.
	 */
	void Serialize(FArchive& Ar, bool bCompactData, bool bUseCompression)
	{
		Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);
		if (Ar.IsLoading() && Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) < FUE5MainStreamObjectVersion::DynamicMeshCompactedSerialization)
		{
			Ar << RefCounts;
			Ar << FreeIndices;
			Ar << UsedCount;
		}
		else

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/Util/RefCountVector.h:533

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class FRefCountVector
function     void Serialize

Source code excerpt:

			// Serialize options.
			Ar << bCompactData;
			Ar << bUseCompression;

			// Serialize number of used ref counts. While this is redundant to the contents of the ref count vector, it allows us to accelerate restoring the
			// free indices and therefore it is worth the very minor storage overhead.
			Ar << UsedCount;

			// Serialize ref counts.
			if (bUseCompression)
			{
				RefCounts.Serialize<true, true>(Ar);
			}
			else
			{
				RefCounts.Serialize<true, false>(Ar);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/Util/RefCountVector.h:561

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class FRefCountVector
function     void Serialize

Source code excerpt:

			{
				// Compact the data by omitting the free indices entirely during save and recompute them during load.
				// Considering the significant time overhead for compression, we compact if either bCompactData or bUseCompression is enabled.
				if (bCompactData || bUseCompression)
				{
					if (Ar.IsLoading())
					{
						// Rebuild the free indices from the invalid ref count values.
						const size_t NumFree = RefCounts.Num() - UsedCount;
						FreeIndices.Resize(NumFree);

#Loc: <Workspace>/Engine/Source/Runtime/GeometryCore/Public/Util/SmallListSet.h:211

Scope (from outer to inner):

file
namespace    UE
namespace    Geometry
class        class FSmallListSet

Source code excerpt:

	* @param Ar Archive to serialize with
	* @param bCompactData Only serialize unique data and/or recompute redundant data when loading.
	* @param bUseCompression Use compression to serialize data; the resulting size will likely be smaller but serialization will take significantly longer.
	*/
	GEOMETRYCORE_API void Serialize(FArchive& Ar, bool bCompactData, bool bUseCompression);

	friend bool operator==(const FSmallListSet& Lhs, const FSmallListSet& Rhs)
	{
		if (Lhs.Size() != Rhs.Size())
		{
			return false;
		}
	
		for (int32 ListIndex = 0, ListNum = Lhs.Size(); ListIndex < ListNum; ++ListIndex)

#Loc: <Workspace>/Engine/Source/Runtime/MovieSceneCapture/Private/VideoCaptureProtocol.cpp:45

Scope (from outer to inner):

file
function     void UVideoCaptureProtocol::ConditionallyCreateWriter

Source code excerpt:

	Options.Height = InitSettings->DesiredSize.Y;

	if (bUseCompression)
	{
		Options.CompressionQuality = CompressionQuality / 100.f;
		
		float QualityOverride = 100.f;
		if (FParse::Value( FCommandLine::Get(), TEXT( "-MovieQuality=" ), QualityOverride ))
		{

#Loc: <Workspace>/Engine/Source/Runtime/MovieSceneCapture/Public/Protocols/VideoCaptureProtocol.h:19

Scope (from outer to inner):

file
class        class UVideoCaptureProtocol : public UFrameGrabberProtocol
function     UVideoCaptureProtocol

Source code excerpt:

	UVideoCaptureProtocol(const FObjectInitializer& Init)
		: Super(Init)
		, bUseCompression(true)
		, CompressionQuality(75)
	{}

public:

	UPROPERTY(config, EditAnywhere, Category=VideoSettings)
	bool bUseCompression;

	UPROPERTY(config, EditAnywhere, Category=VideoSettings, meta=(ClampMin=1, ClampMax=100, EditCondition=bUseCompression))
	float CompressionQuality;

public:
	MOVIESCENECAPTURE_API virtual bool SetupImpl() override;

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/AutomationTool/Android/AndroidPlatform.Automation.cs:886

		}

		if (!Ini.GetBool("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "bUseCompression", out bUseCompression))
		{
			bUseCompression = false;
		}
		if (!Ini.GetBool("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "bLogFiles", out bLogFiles))
		{
			bLogFiles = false;