struct

Brotli::Enc::Command

Inherits Struct < Value < Object

A sequence of literals followed by a backward-reference copy.

Constructors

insert(insertlen : Int32) : Command

InitInsertCommand: insert-only command (last tail of a metablock). Sets dist_prefix = NUM_DISTANCE_SHORT_CODES directly (16 is NOT re-encoded through prefix_encode_copy_distance — at ndirect = 0 it would fall into the regular branch and become (1 << 10) | 16).

Source
new(insertlen : Int32, copylen : Int32, copylen_code_delta : Int32, distance_code : UInt64, dist : DistanceParams)

InitCommand: distance_code is e.g. 0 for same-as-last short code, or 16 for offset 1 (intermediate code). The distance prefix/extra are stored as if npostfix and ndirect were 0-compatible; they are recomputed after clustering if needed (RecomputeDistancePrefixes).

Source

Instance methods

cmd_prefix
Source
cmd_prefix=(cmd_prefix : UInt16)
Source
copy_len

copy_len in low 25 bits, copy_code - copy_len in high 7 bits.

Source
copy_len=(copy_len : UInt32)

copy_len in low 25 bits, copy_code - copy_len in high 7 bits.

Source
copy_len_code
Source
dist_extra
Source
dist_extra=(dist_extra : UInt32)
Source
dist_prefix

distance code in low 10 bits, number of extra bits in high 6 bits.

Source
dist_prefix=(dist_prefix : UInt16)

distance code in low 10 bits, number of extra bits in high 6 bits.

Source
distance_context
Source
insert_len
Source
insert_len=(insert_len : UInt32)
Source
restore_distance_code(dist : DistanceParams) : UInt32

CommandRestoreDistanceCode: intermediate distance code back from the stored prefix/extra with the given distance params.

Source