DLL Interface

DELTAMAX_ENCODE_OPTIONS

The DELTAMAX_ENCODE_OPTIONS structure allows you to configure the DeltaMAX engine for an encode operation. It contains all of the user-configurable engine settings which affect the encoding process (creating patches).

typedef struct {

 

LPCTSTR lpszLicensedTo;

LPCTSTR lpszLicenseKey;
int nMemoryMax;
int nMemoryMaxPercent;
int nFreeMemoryMin;
int nLowMemMode;
int nFootprintSize;
BOOL bAutoIncreaseFootprintSize;
BOOL bEnableMultiPass;
int nMultiPassThreshold;
int nMultiPassMaxAdditionalPasses;
PFNONPROGRESS pProgressCallback;
PFNONMESSAGE pMessageCallback;
LPVOID lpUserData;
 

} DELTAMAX_ENCODE_OPTIONS;

Data Members

lpszLicensedTo

The user name that DeltaMAX is licensed to, exactly as it appears in the license information.

lpszLicenseKey

A valid license key.

nMemoryMax

The maximum virtual memory to allocate, in megabytes.

default: 0 MB

nMemoryMaxPercent

The maximum virtual memory to allocate, as a percentage of total physical memory. (1-100)

Only used when nMemoryMax is zero.

default: 80%

nFreeMemoryMin

The minimum physical memory to leave free, in megabytes.

default: 8 MB

nLowMemMode

Sets the low memory behavior mode: 0 = minimize diff size, 1 = maximize build speed.

0

Minimize diff size

- use virtual memory if necessary

- switch to condensed (but slower) source file indexing method in low memory situations

1

Maximize build speed

- use only physical memory to avoid paging

- use normal source file indexing method (faster, but needs twice as much memory)

default: 0

nFootprintSize

Sets the initial size of the source file mapping blocks. (0-11, 0 = automatic)

0

Automatic

Chooses an appropriate value automatically. If the multi-pass option is enabled, this selects the smallest footprint size possible for the available address space. Otherwise, a predetermined "best guess" size is selected based on the size of the source file.

1

8 bytes

Highest memory use. Usually gives best results, but sometimes larger values work better.

2

16 bytes

Good balance between diff size and memory use for files under 512 MB.

3

32 bytes

 

4

64 bytes

Often produces best results for files over 1 GB, however smaller values may work better for some files.

5

128 bytes

 

6

256 bytes

 

7

512 bytes

 

8

1024 bytes

 

9

2048 bytes

 

10

4096 bytes

 

11

8192 bytes

Lowest memory use.

Note: Smaller values use more memory but (generally) produce smaller diffs. However for some files, larger values may produce smaller diffs. It depends on the internal structure of the source and target files.

default: 0

bAutoIncreaseFootprintSize

Whether to automatically increase the footprint size in order to fit within available virtual memory.

TRUE

Increase the footprint size as required to fit within the available memory.

FALSE

Return a "not enough memory" error (201) if footprint size is too small.

default: TRUE

bEnableMultiPass

Whether to perform multiple passes in order to determine the best footprint size for the file's internal data structure.

TRUE

Starts out using the initial footprint size (nFootprintSize). Then, if the nMultiPassThreshold setting permits it, repeats the process using incrementally larger footprint sizes in order to produce the smallest diff file.

FALSE

Performs a single pass using the footprint size specified by nFootprintSize.

default: TRUE

nMultiPassThreshold

MultiPass time threshold, in seconds. Controls when the "multiple passes" optimization is allowed to occur.

0

Always perform multiple passes.

1+

Only perform additional passes if the initial pass takes fewer seconds than this.

Example: set this to 180 to only perform additional passes when the initial pass takes 3 minutes or less.

This is essentially a safeguard against very long encoding times on low memory systems when encoding speed is an issue. The multi-pass optimization can produce very good results, though, so setting this to 0 is highly recommended whenever encoding time is not a concern.

default: 300 seconds

nMultiPassMaxAdditionalPasses

The maximum number of additional passes to perform when performing multiple passes. (1-10)

Note: Fewer passes may be performed if the additional passes don't show any improvement.

default: 3

pProgressCallback

Pointer to an OnProgress callback function to receive progress updates during the encode operation.

default: NULL

pMessageCallback

Pointer to an OnMessage callback function to receive notification messages during the encode operation.

default: NULL

lpUserData

Pointer to your own user data.

default: NULL

Remarks

You can use the DeltaMaxInitEncodeOptions function to initialize the structure with default values.

For very large files (e.g. 1 GB or larger), the smallest footprint sizes will usually result in larger diffs. When dealing with large source files, an initial footprint setting of 3 (32 bytes) is more appropriate. For best results, use the multi-pass optimization to experimentally determine the best footprint size.

The multi-pass optimization does not test the compressibility of the diff files - it will choose the settings that produce the smallest uncompressed diffs. If you are further compressing your diff files (e.g. with LZW compression) before distribution, and you want to ensure the absolute smallest size after compression, you may want to implement the multi-pass optimization on your own (i.e. performing multiple calls and increasing the footprint size each time) so that you can compare the sizes of the resulting diff files after your chosen compression is applied.

See Also: DeltaMAXInitEncodeOptions, DELTAMAX_DECODE_OPTIONS