HeifSequenceEncoder

The encoder of one image sequence (#177), which a HeifEncoder opens. The core hands it the pictures of the track in display order and writes the samples it returns into the track in the order they come, which is decoding order: an encoder that reorders pictures, as HEVC does with B pictures, holds a picture back and returns it later, each sample naming the picture it codes by HeifCodedSample.frameIndex. The core then writes the composition offsets (ctts) that put each picture back at its display time.

The contract of HeifEncoder.encode holds for each picture: every picture of the sequence has the first one's size, depth and chroma format, call cancellationCheck at a coarse step and let what it throws pass through.

Properties

Link copied to clipboard
abstract val brand: String

The brand of the image sequence for the ftyp box, such as avis for AV1 or hevc for HEVC, which the core lists beside the item brand of the first picture.

Link copied to clipboard
abstract val configuration: ByteArray

The payload of the configuration property of the sample entry (av1C, hvcC), without its box header, once the first picture is coded. The core also gives it to the first picture, which it writes as the primary item too, so that a reader of still images shows that picture.

Link copied to clipboard
abstract val imageBrand: String

The brand of the first picture as a still image item, such as avif or heic, for the ftyp box.

Link copied to clipboard
abstract val sampleEntryType: String

The four-character sample entry type of the track, such as av01 or hvc1.

Functions

Link copied to clipboard
abstract fun encode(planes: HeifPlanes, cancellationCheck: () -> Unit?): List<HeifCodedSample>

Codes the next picture, planes, and returns the samples that are ready, in decoding order: none while the encoder holds pictures back, one, or several.

Link copied to clipboard
abstract fun finish(cancellationCheck: () -> Unit?): List<HeifCodedSample>

Ends the sequence: the samples the encoder still holds, in decoding order.